/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public VectorXD Solve(VectorXD other, DenseSolverType denseSolverType = DenseSolverType.ColPivHouseholderQR) { double[] vout = new double[Rows]; switch (denseSolverType) { case DenseSolverType.PartialPivLU: EigenDenseUtilities.SolvePartialPivLU(GetValues(), Rows, Cols, other.GetValues(), vout); break; case DenseSolverType.FullPivLU: EigenDenseUtilities.SolveFullPivLU(GetValues(), Rows, Cols, other.GetValues(), vout); break; case DenseSolverType.LDLT: EigenDenseUtilities.SolveLDLT(GetValues(), Rows, Cols, other.GetValues(), vout); break; case DenseSolverType.LLT: EigenDenseUtilities.SolveLLT(GetValues(), Rows, Cols, other.GetValues(), vout); break; case DenseSolverType.ColPivHouseholderQR: default: EigenDenseUtilities.SolveColPivHouseholderQr(GetValues(), Rows, Cols, other.GetValues(), vout); break; } return(new VectorXD(vout)); }
private bool IsEqual(VectorXD other) { if (Length != other.Length) { return(false); } return(ArrayHelpers.ArraysEqual(_values, other._values)); }
public VectorXD Mult(VectorXD other) { double[] outVector = new double[Rows]; EigenDenseUtilities.Mult(GetValues(), Rows, Cols, other.GetValues(), other.Length, outVector); return(new VectorXD(outVector)); }
/// <summary> /// /// </summary> /// <param name="rhs"></param> public VectorXD LeastSquaresSVD(VectorXD rhs, SVDType svdType = SVDType.Jacobi) { double[] vout = new double[Cols]; if (svdType == SVDType.Jacobi) { EigenDenseUtilities.SVDLeastSquares(GetValues(), Rows, Cols, rhs.GetValues(), vout); } else { EigenDenseUtilities.SVDLeastSquaresBdcSvd(GetValues(), Rows, Cols, rhs.GetValues(), vout); } return(new VectorXD(vout)); }
/// <summary> /// A^TAx = A^b /// </summary> /// <param name="rhs"></param> /// <returns></returns> public VectorXD LeastSquaresNE(VectorXD rhs) { double[] vout = new double[Cols]; EigenDenseUtilities.NormalEquationsLeastSquares(GetValues(), Rows, Cols, rhs.GetValues(), vout); return(new VectorXD(vout)); }
public double RelativeError(VectorXD rhs, VectorXD x) { return(EigenDenseUtilities.RelativeError(GetValues(), Rows, Cols, rhs.GetValues(), x.GetValues())); }
public double Dot(VectorXD other) { return(EigenDenseUtilities.Dot(GetValues(), other.GetValues(), Length)); }
public VectorXD Minus(VectorXD other) { return(new VectorXD(ArrayHelpers.ArraysMinus(_values, other._values))); }
public VectorXD Add(VectorXD other) { double[] outVector = new double[Length]; EigenDenseUtilities.Add(GetValues(), other.GetValues(), Length, outVector); return(new VectorXD(outVector)); }