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

◆ muli

kyosu::muli = {}
inlineconstexpr

Computes the value of the parameter multiplied by i on the left side. For real complex and quaternion the computation is an optimization over the call to * operator.

Defined in Header

#include <kyosu/functions.hpp>

Callable Signatures

namespace kyosu
{
template<kyosu::concepts::cayley_dickson T> constexpr auto muli(T z) noexcept;
template<eve::floating_ordered_value T> constexpr auto muli(T z) noexcept;
}
constexpr tags::callable_muli muli
Computes the value of the parameter multiplied by i on the left side. For real complex and quaternion...
Definition: muli.hpp:74
Main KYOSU namespace.
Definition: types.hpp:14

Parameters

  • z: Value to process.

Return value

  • Returns i(as(z))*z; If z is floating point a complex is returned. In the other cases the returned value as the same type as the input.

Example

#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
using wide_ft = eve::wide <float, eve::fixed<4>>;
wide_ft r = { 3.0f, 2.0f, 1.0f, 0.5f};
wide_ft i = { 2.0f , -1.0, -5.0, 0.0};
auto zq = kyosu::quaternion(1.0f, 2.0f, 3.0f, 4.0f);
std::cout
<< "---- simd" << std::endl
<< "<- r = " << r << std::endl
<< "-> muli(r) = " << kyosu::muli(r)<< std::endl
<< "<- zc = " << zc << std::endl
<< "-> muli(zc) = " << kyosu::muli(zc)<< std::endl
<< "<- zq = " << zq << std::endl
<< "-> muli(zq) = " << kyosu::muli(zq) << std::endl;
return 0;
}
constexpr tags::callable_quaternion quaternion
Constructs a kyosu::quaternion.
Definition: to_quaternion.hpp:72
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< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27