📜  在 Julia 中将数组转换为其复共轭 - conj!() 方法

📅  最后修改于: 2022-05-13 01:55:35.817000             🧑  作者: Mango

在 Julia 中将数组转换为其复共轭 - conj!() 方法

conj!()是 julia 中的内置函数,用于将指定的数组就地转换为其复共轭。

示例 1:

# Julia program to illustrate 
# the use of Array conj!() method
   
# Getting complex conjugate of 1D array
A = [1+im, 2+im, 3+im, 4+im];
println(conj!(A))
   
# Getting complex conjugate of 2D array
B = [5+im 6+im; 7+im 8+im];
println(conj!(B))
   
# Getting complex conjugate of 3D array
C = cat([1+im 3+im; 5+im 7+im], 
        [2+im 4+im; 6+im 8+im],
        [5+im 10+im; 15+im 20+im], dims = 3);
println(conj!(C))

输出:

示例 2:

# Julia program to illustrate 
# the use of Array conj!() method
  
# Getting complex conjugate of 1D array
A = [1+2im, 3+4im];
println(conj!(A))
  
# Getting complex conjugate of 2D array
B = [5+2im 6+3im; 7+4im 8+5im];
println(conj!(B))
  
# Getting complex conjugate of 3D array
C = cat([1+2im 3+4im; 5+6im 7+8im], 
        [2+4im 4+6im; 6+8im 8+10im], 
        [5+6im 10+11im; 15+16im 20+17im], dims = 3);
println(conj!(C))

输出: