numl.Math.LinearAlgebra.Matrix.operator C# (CSharp) Метод

operator() публичный статический Метод

Solves Ax = b for x If A is not square or the system is overdetermined, this operation solves the linear least squares A.T * A x = A.T * b.
Thrown when the requested operation is invalid.
public static operator ( ) : Vector
Результат Vector
        public static Vector operator /(Matrix A, Vector b)
        {
            if (A.Rows != b.Length)
                throw new InvalidOperationException("Matrix row count does not match vector length!");

            // LLS
            if (A.Rows != A.Cols)
            {
                Matrix C = A.T * A;
                Matrix L = C.Cholesky();
                Vector d = (A.T * b).ToVector();
                Vector z = Matrix.Forward(L, d);
                Vector x = Matrix.Backward(L.T, z);
                return x;
            }
            // regular solve
            else
            {

                // need to be smarter here....
                return ((A ^ -1) * b).ToVector();
            }
        }

Same methods

Matrix::operator ( ) : IEnumerable
Matrix::operator ( ) : Matrix
Matrix::operator ( ) : bool