Exemplo n.º 1
0
        public void doWork()
        {
            matrix.Fill((j, i) => array[i, j]);
            SquareQRDecomposition qr = matrix.QRDecomposition();
            SquareLUDecomposition lu = matrix.LUDecomposition();

            ColumnVector qrresult = qr.Solve(vector);
            ColumnVector luresult = lu.Solve(vector);

            ColumnVector c6  = matrix.Column(6);
            RowVector    r2  = matrix.Row(2);
            SquareMatrix inv = matrix.Inverse();

            ColumnVector result = new ColumnVector(inv.Dimension);

            for (int i = 0; i < matrix.Dimension; ++i)
            {
                for (int j = 0; j < matrix.Dimension; ++j)
                {
                    result[i] += matrix[i, j] * qrresult[j];
                }
            }
        }