public static bool LinearlyDependent(Vector <Real>[] vectors) { if (vectors.Select(v => v.Dimension).Distinct().Count() > 1) { throw new IncompatibleOperationException(VectorOperationType.Dimension); } // If the amount of vectors is greater than the dimension they're // automatically linearly dependent. if (vectors[0].Dimension < vectors.Length) { return(true); } var m = new RealMatrix(vectors); if (m.IsSquare()) { return(m.Determinant().Equals(0)); } m = m.ToReducedEchelonForm().ToRealMatrix(); return(m.AmountOfNullRows() != 0); }
/// <summary> /// Gets the eigenvalues of the given matrix, calculated numerically from the /// characteristic polynomial of this matrix. Continues until all eigenvalues /// have been found. /// </summary> /// <param name="m"></param> /// <returns></returns> public static RealVector RealEigenValues(this RealMatrix m) { if (!m.IsSquare()) { throw new IncompatibleOperationException(MatrixOperationType.Eigenvalue); } ComplexVector values = new ComplexVector(m.Width); throw new NotImplementedException(); }