std::conj(std::complex)
std::conj(std::complex)用来计算complex的共轭部分,通过相反虚部的标识。
example:
1 #include <iostream> 2 #include <complex> 3 4 int main() 5 { 6 std::complex<double> z(1,2); 7 std::cout << "The conjugate of " << z << " is " << std::conj(z) << ‘\n‘ 8 << "Their product is " << z*std::conj(z) << ‘\n‘; 9 }
output:
The conjugate of (1,2) is (1,-2) Their product is (5,0)
std::complex类conj
原文地址:https://www.cnblogs.com/liangyi322/p/10053018.html
时间: 2024-10-27 11:35:51