public void Dtpsv(StoredTriangle uplo, TransposeMatrix transA, DiagonalValues diag, int n,
                          double[] a, int offsetA, double[] x, int offsetX, int incX)
        {
            bool unit = (diag == DiagonalValues.Unit) ? true : false;

            if (UseUpperImplementation(uplo, transA))
            {
                CblasLevel2Implementations.BackSubstitutionPackedColMajor(unit, n, a, offsetA, x, offsetX, incX);
            }
            else
            {
                CblasLevel2Implementations.ForwardSubstitutionPackedRowMajor(unit, n, a, offsetA, x, offsetX, incX);
            }
        }
        public void Dtpmv(StoredTriangle uplo, TransposeMatrix transA, DiagonalValues diag, int n,
                          double[] a, int offsetA, double[] x, int offsetX, int incX)
        {
            // The copy may be avoidable in trangular operations, if we start the dot products from the bottom
            var input = new double[x.Length];

            Array.Copy(x, input, x.Length);

            CblasLevel2Implementations.Diagonal managedDiag = (diag == DiagonalValues.NonUnit) ?
                                                              CblasLevel2Implementations.Diagonal.Regular : CblasLevel2Implementations.Diagonal.Unit;
            if (UseUpperImplementation(uplo, transA))
            {
                CblasLevel2Implementations.UpperTimesVectorPackedColMajor(
                    managedDiag, n, 1.0, a, offsetA, input, offsetX, incX, 0.0, x, offsetX, incX);
            }
            else
            {
                CblasLevel2Implementations.LowerTimesVectorPackedRowMajor(
                    managedDiag, n, 1.0, a, offsetA, input, offsetX, incX, 0.0, x, offsetX, incX);
            }
        }
 /// <summary>
 /// See http://www.dotnumerics.com/NumericalLibraries/LinearAlgebra/CSharpCodeFiles/dtrsv.aspx
 /// </summary>
 public void Dtrsv(StoredTriangle uplo, TransposeMatrix transA, DiagonalValues diag, int n,
                   double[] a, int offsetA, int ldA, double[] x, int offsetX, int incX)
 => dtrsv.Run(uplo.Translate(), transA.Translate(), diag.Translate(), n, a, offsetA, ldA, ref x, offsetX, incX);
 /// <summary>
 /// See https://software.intel.com/en-us/mkl-developer-reference-fortran-trsv#D8733073-F041-4AA1-B82C-123DFA993AD7
 /// </summary>
 public void Dtrsv(StoredTriangle uplo, TransposeMatrix transA, DiagonalValues diag, int n,
                   double[] a, int offsetA, int ldA, double[] x, int offsetX, int incX)
 => Blas.Dtrsv(uplo.Translate(), transA.Translate(), diag.Translate(), ref n, ref a[offsetA], ref ldA,
               ref x[offsetX], ref incX);
示例#5
0
 internal static string Translate(this DiagonalValues diag) => (diag == DiagonalValues.Unit) ? "U" : "N";