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

◆ muli

kyosu::muli = eve::functor<muli_t>
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.

Header file

#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 auto muli
Computes the value of the parameter multiplied by i on the left side. For real, complex and quaternio...
Definition: muli.hpp:71
Main KYOSU namespace.
Definition: cinf.hpp:13

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 auto i
Computes the complex number in the chosen type.
Definition: i.hpp:69
constexpr auto quaternion
Constructs a kyosu::quaternion_t instance.
Definition: to_quaternion.hpp:83
as_cayley_dickson_n_t< 2, T > complex_t
Type alias for complex numbers.
Definition: complex.hpp:27