/// <summary> /// Backward Laplace transform. /// </summary> /// <param name="B">Matrix</param> /// <returns>Matrix</returns> public Complex32[,] Backward(Complex32[,] B) { int N = B.GetLength(0), M = B.GetLength(1); Complex32[,] U = LaplaceTransform.Matrix(N, sigma, true); Complex32[,] V = LaplaceTransform.Matrix(M, sigma, true); Complex32[,] A; if (direction == Direction.Both) { A = U.Hermitian().Dot(B).Dot(V); A = normalized ? A.Div(Math.Sqrt(N * M)) : A; } else if (direction == Direction.Vertical) { A = U.Hermitian().Dot(B); A = normalized ? A.Div(Math.Sqrt(N)) : A; } else { A = B.Dot(V); A = normalized ? A.Div(Math.Sqrt(M)) : A; } return(A); }
/// <summary> /// Forward Laplace transform. /// </summary> /// <param name="A">Matrix</param> /// <returns>Matrix</returns> public Complex32[,] Forward(Complex32[,] A) { int N = A.GetLength(0), M = A.GetLength(1); Complex32[,] U = LaplaceTransform.Matrix(N, sigma); Complex32[,] V = LaplaceTransform.Matrix(M, sigma); Complex32[,] B; if (direction == Direction.Both) { B = U.Dot(A).Dot(V.Hermitian()); B = normalized ? B.Div(Math.Sqrt(N * M)) : B; } else if (direction == Direction.Vertical) { B = U.Dot(A); B = normalized ? B.Div(Math.Sqrt(N)) : B; } else { B = A.Dot(V.Hermitian()); B = normalized ? B.Div(Math.Sqrt(M)) : B; } return(B); }
/// <summary> /// Backward Laplace transform. /// </summary> /// <param name="B">Array</param> /// <returns>Array</returns> public Complex32[] Backward(Complex32[] B) { int N = B.Length; Complex32[,] U = LaplaceTransform.Matrix(N, sigma, true); Complex32[] A = Matrice.Dot(B, U.Hermitian()); if (normalized) { A = Matrice.Div(A, Math.Sqrt(N)); } return(A); }
/// <summary> /// Forward Laplace transform. /// </summary> /// <param name="A">Array</param> /// <returns>Array</returns> public Complex32[] Forward(Complex32[] A) { int N = A.Length; Complex32[,] U = LaplaceTransform.Matrix(N, sigma); Complex32[] B = Matrice.Dot(A, U); if (normalized) { B = Matrice.Div(B, Math.Sqrt(N)); } return(B); }