tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
conj.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_COMPLEX_CONJ_HPP
4#define TETL_COMPLEX_CONJ_HPP
5
9
10namespace etl {
11
13template <typename T>
14[[nodiscard]] constexpr auto conj(complex<T> const& z) noexcept -> complex<T>
15{
16 return complex<T>(z.real(), -z.imag());
17}
18
20template <floating_point Float>
21[[nodiscard]] constexpr auto conj(Float f) noexcept -> complex<Float>
22{
23 return complex<Float>(f);
24}
25
27template <integral Integer>
28[[nodiscard]] constexpr auto conj(Integer i) noexcept -> complex<double>
29{
30 return complex<double>(static_cast<double>(i));
31}
32
33} // namespace etl
34
35#endif // TETL_COMPLEX_CONJ_HPP
constexpr auto conj(complex< T > const &z) noexcept -> complex< T >
Definition conj.hpp:14
Definition adjacent_find.hpp:8
A complex number.
Definition complex.hpp:19