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

◆ conj

kyosu::conj = eve::functor<conj_t>
inlineconstexpr

Computes the conjugate value.

Header file

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<concepts::cayley_dickson T> constexpr T conj(T z) noexcept;
template<concepts::real T> constexpr T conj(T z) noexcept;
}
constexpr auto conj
Computes the conjugate value.
Definition: conj.hpp:70
Main KYOSU namespace.
Definition: cinf.hpp:13

Parameters

  • z: Value to conjugate.

Return value

Returns the conjugate of its argument. i.e. the value with the same real part and the opposite pure part.

For real inputs the call reduces to identity.

External references

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::conj;
std::cout << "Real: ";
std::cout << 72.9f << " -> " << conj(72.9f) << "\n";
std::cout << "Complex: ";
std::cout << kyosu::complex_t<float>(3.5f,-2.9f) << " -> " << conj(kyosu::complex_t<float>(3.5f,-2.9f)) << "\n";
std::cout << "Quaternion: ";
std::cout << kyosu::quaternion_t<double>(1.,2.,3.,4.) << " -> " << conj(kyosu::quaternion_t<double>(1.,2.,3.,4.)) << "\n";
std::cout << "SIMD: ";
using wc_t = eve::wide<kyosu::complex_t<double>, eve::fixed<2>>;
std::cout << wc_t(kyosu::complex_t<double>(1.3,-3.7)) << " -> " << conj(wc_t(kyosu::complex_t<double>(1.3,-3.7))) << "\n";
return 0;
}
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:24
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27