/// <summary>
        /// A Sparse EigenPair leaves the inverse of the eigen vector matrix null. This means any attempt to reconstruct the
        /// matrix from the EigenPair object will result in a NullPointerException. However, if this operation is not necessary,
        /// then ignoring the inverse is more efficient.
        /// </summary>
        /// <param name="Q"></param>
        /// <returns></returns>
        public static EigenPair ComputeSparseEigenPair(double[][] Q)
        {
            DoubleArray matrix      = new DoubleArray(Q);
            Eigen       eigenSystem = new Eigen(matrix);

            ComplexNumber[]   eigenValues  = LinearAlgebra.DiagonalShoArrayToArray(eigenSystem.D);
            ComplexNumber[][] eigenVectors = LinearAlgebra.ShoArrayToRaggedArray(eigenSystem.V);

            return(new EigenPair(eigenValues, eigenVectors, null));
        }
예제 #2
0
 public override string ToString()
 {
     return("V:\n" + LinearAlgebra.MatrixView(_vectors) + "\nD:\n[ " + SpecialFunctions.SpecialFunctions.CreateTabString2(_values) +
            " ]\ninv(V):\n" + LinearAlgebra.MatrixView(_invVectors));
 }