kyosu v0.1.0
Complex Without Complexes
 
Loading...
Searching...
No Matches

◆ chi

kyosu::chi = eve::functor<chi_t>
inlineconstexpr

Computes the gudermanian of the argument.

Header file

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
constexpr auto chi(value auto z, auto belongs) noexcept;
}
constexpr auto chi
Computes the gudermanian of the argument.
Definition: chi.hpp:70
Main KYOSU namespace.
Definition: cinf.hpp:13

Parameters

  • z: Value to inspect.
  • belongs: predicate function

Return value

Returns 1 in the type of z if belongs(x) evaluate to true else 0.

External references

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
eve::wide re = {2.0, -4.0, -10.0, 0.0};
eve::wide im = {0.0, -1.0, 0.0, 5.0};
auto c = kyosu::complex(re, im);
auto belongs = [](auto v) {return kyosu::abs(v) > 8.0 || v == 2.0; };
std::cout << " <- c = " << c << '\n';
std::cout << " -> chi(c, belongs) = " << kyosu::chi(c, belongs) << '\n';
std::cout << " -> chi[real(c) > -2](c, belongs) = " << kyosu::chi[kyosu::real(c) > -2](c, belongs) << '\n';
}
constexpr auto real
Extracts the real part of a value.
Definition: parts.hpp:74
constexpr auto complex
Constructs a kyosu::complex_t instance.
Definition: to_complex.hpp:75
constexpr auto abs
Computes the absolute value of the parameter.
Definition: abs.hpp:78