Example #1
0
// Compute element-wise product C[i,j] = A[i,j] * B[i,j]. Returns new matrix.
func Mul(A, B *matrix.ComplexMatrix) *matrix.ComplexMatrix {
	if !A.SizeMatch(B.Size()) {
		return nil
	}
	C := A.Copy()
	return C.Mul(B)
}
Example #2
0
// Return Imag(A).
func Imag(A *matrix.ComplexMatrix) *matrix.FloatMatrix {
	C := matrix.FloatZeros(A.Size())
	Ar := A.ComplexArray()
	Cr := C.FloatArray()
	for i, v := range Ar {
		Cr[i] = imag(v)
	}
	return C
}