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

◆ i

kyosu::i = {}
inlineconstexpr

Computes the complex number cinf i.e. complex(nan, inf) in the chosen type.

Computes the complex number mi i.e. complex(0, -1) in the chosen type, the conjugate of i.

Computes the complex number k i.e. quaternion(0, 0, 0, 1) in the chosen type.

Computes the complex number j i.e. quaternion(0, 0, 1, 0) in the chosen type.

Computes the complex number i i.e. complex(0, 1) in the chosen type.

Defined in Header

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr as_complex_t<underlying_type_t<T>> cinf(as<T> z) noexcept;
template<eve::floating_ordered_value T> constexpr és_complex_t<underlying_type_t<T>> cinf(as<T> z) noexcept;
}
Main KYOSU namespace.
Definition: types.hpp:14

Parameters

  • z: Value to process.

Return value

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::i;
using kyosu::as;
std::cout << "Real: \n";
std::cout << "i(kyosu::as(72.9f))" << " -> " << i(as(72.9f)) << "\n";
std::cout << "Complex: \n";
auto c = kyosu::complex_t<float>(3.5f,-2.9f);
std::cout << "c = " << c << std::endl;
std::cout << "i(as(c) " << " -> " << i(as(c)) << "\n";
std::cout << "Quaternion: \n";
auto z = kyosu::quaternion_t<double>(1.,2.,3.,4.);
std::cout << "i(as(z) " << " -> " << i(as(z)) << "\n";
std::cout << "SIMD: ";
using wc_t = eve::wide<kyosu::complex_t<double>, eve::fixed<2>>;
auto wz = wc_t(complex_t<double>(1.3,-3.7));
std::cout << "i(as(wz)) " << " -> " << i(as(wz)) << "\n";
return 0;
}
constexpr tags::callable_i i
Computes the complex number cinf i.e. complex(nan, inf) in the chosen type.
Definition: i.hpp:77
as_cayley_dickson_n_t< 4, T > quaternion_t
Type alias for quaternion numbers.
Definition: quaternion.hpp:27
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27

Defined in Header

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr as_complex_t<underlying_type_t<T>> i(as<T> z) noexcept;
template<eve::floating_ordered_value T> constexpr és_complex_t<underlying_type_t<T>> i(as<T> z) noexcept;
}

Parameters

  • z: Value to process.

Return value

  • always returns a complex scalar value i such that real(i) is null and imag(i) is one.

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::i;
using kyosu::as;
std::cout << "Real: \n";
std::cout << "i(kyosu::as(72.9f))" << " -> " << i(as(72.9f)) << "\n";
std::cout << "Complex: \n";
auto c = kyosu::complex_t<float>(3.5f,-2.9f);
std::cout << "c = " << c << std::endl;
std::cout << "i(as(c) " << " -> " << i(as(c)) << "\n";
std::cout << "Quaternion: \n";
auto z = kyosu::quaternion_t<double>(1.,2.,3.,4.);
std::cout << "i(as(z) " << " -> " << i(as(z)) << "\n";
std::cout << "SIMD: ";
using wc_t = eve::wide<kyosu::complex_t<double>, eve::fixed<2>>;
auto wz = wc_t(complex_t<double>(1.3,-3.7));
std::cout << "i(as(wz)) " << " -> " << i(as(wz)) << "\n";
return 0;
}

Defined in Header

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr as_complex_t<underlying_type_t<T>> j(as<T> z) noexcept;
template<eve::floating_ordered_value T> constexpr és_complex_t<underlying_type_t<T>> j(as<T> z) noexcept;
}

Parameters

  • z: Value to process.

Return value

  • always returns a quaternion scalar value j such that all parts are null except the jpart whose value is one.

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::i;
using kyosu::as;
std::cout << "Real: \n";
std::cout << "i(kyosu::as(72.9f))" << " -> " << i(as(72.9f)) << "\n";
std::cout << "Complex: \n";
auto c = kyosu::complex_t<float>(3.5f,-2.9f);
std::cout << "c = " << c << std::endl;
std::cout << "i(as(c) " << " -> " << i(as(c)) << "\n";
std::cout << "Quaternion: \n";
auto z = kyosu::quaternion_t<double>(1.,2.,3.,4.);
std::cout << "i(as(z) " << " -> " << i(as(z)) << "\n";
std::cout << "SIMD: ";
using wc_t = eve::wide<kyosu::complex_t<double>, eve::fixed<2>>;
auto wz = wc_t(complex_t<double>(1.3,-3.7));
std::cout << "i(as(wz)) " << " -> " << i(as(wz)) << "\n";
return 0;
}

Defined in Header

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr as_complex_t<underlying_type_t<T>> k(as<T> z) noexcept;
template<eve::floating_ordered_value T> constexpr és_complex_t<underlying_type_t<T>> k(as<T> z) noexcept;
}

Parameters

  • z: Value to process.

Return value

  • always returns a quaternion scalar value k such that all parts are null exceptthe k part whose value is one.

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::i;
using kyosu::as;
std::cout << "Real: \n";
std::cout << "i(kyosu::as(72.9f))" << " -> " << i(as(72.9f)) << "\n";
std::cout << "Complex: \n";
auto c = kyosu::complex_t<float>(3.5f,-2.9f);
std::cout << "c = " << c << std::endl;
std::cout << "i(as(c) " << " -> " << i(as(c)) << "\n";
std::cout << "Quaternion: \n";
auto z = kyosu::quaternion_t<double>(1.,2.,3.,4.);
std::cout << "i(as(z) " << " -> " << i(as(z)) << "\n";
std::cout << "SIMD: ";
using wc_t = eve::wide<kyosu::complex_t<double>, eve::fixed<2>>;
auto wz = wc_t(complex_t<double>(1.3,-3.7));
std::cout << "i(as(wz)) " << " -> " << i(as(wz)) << "\n";
return 0;
}

Defined in Header

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr as_complex_t<underlying_type_t<T>> mi(as<T> z) noexcept;
template<eve::floating_ordered_value T> constexpr és_complex_t<underlying_type_t<T>> mi(as<T> z) noexcept;
}

Parameters

  • z: Value to process.

Return value

  • always returns a complex scalar value mi such that real(i) is null and imag(i) is minus one.

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using kyosu::i;
using kyosu::as;
std::cout << "Real: \n";
std::cout << "i(kyosu::as(72.9f))" << " -> " << i(as(72.9f)) << "\n";
std::cout << "Complex: \n";
auto c = kyosu::complex_t<float>(3.5f,-2.9f);
std::cout << "c = " << c << std::endl;
std::cout << "i(as(c) " << " -> " << i(as(c)) << "\n";
std::cout << "Quaternion: \n";
auto z = kyosu::quaternion_t<double>(1.,2.,3.,4.);
std::cout << "i(as(z) " << " -> " << i(as(z)) << "\n";
std::cout << "SIMD: ";
using wc_t = eve::wide<kyosu::complex_t<double>, eve::fixed<2>>;
auto wz = wc_t(complex_t<double>(1.3,-3.7));
std::cout << "i(as(wz)) " << " -> " << i(as(wz)) << "\n";
return 0;
}