std::conj(std::complex)
STD::conj%28 std::Complex%29
Defined in header | | |
---|---|---|
template< class T > complex<T> conj( const complex<T>& z | (1) | |
std::complex<long double> conj( long double z | (2) | (since C++11) |
template< class DoubleOrInteger > std::complex<double> conj( DoubleOrInteger z | (3) | (since C++11) |
std::complex<float> conj( float z | (4) | (since C++11) |
计算复共轭成z
通过倒转假想部分的符号。
%28,因为C++11%提供了29附加过载float
,,,double
,,,long double
,以及所有整数类型,它们被视为零虚分量的复数。
参数
z | - | complex value |
---|
返回值
复共轭z
...
例
二次
#include <iostream>
#include <complex>
int main()
{
std::complex<double> z(1,2
std::cout << "The conjugate of " << z << " is " << std::conj(z) << '\n'
<< "Their product is " << z*std::conj(z) << '\n';
}
二次
产出:
二次
The conjugate of (1,2) is (1,-2)
Their product is (5,0)
二次
另见
abs(std::complex) | returns the magnitude of a complex number (function template) |
---|---|
norm | returns the squared magnitude (function template) |
polar | constructs a complex number from magnitude and phase angle (function template) |
c CONJ文件
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。