d_lu_solve_factored() private method

private d_lu_solve_factored ( int n, int nrhs, double a, [ ipiv, [ b ) : int
n int
nrhs int
a double
ipiv [
b [
return int
Ejemplo n.º 1
0
        public override void LUSolveFactored(int columnsOfB, double[] a, int order, int[] ipiv, double[] b)
        {
            if (a == null)
            {
                throw new ArgumentNullException(nameof(a));
            }

            if (ipiv == null)
            {
                throw new ArgumentNullException(nameof(ipiv));
            }

            if (a.Length != order * order)
            {
                throw new ArgumentException("The array arguments must have the same length.", nameof(a));
            }

            if (ipiv.Length != order)
            {
                throw new ArgumentException("The array arguments must have the same length.", nameof(ipiv));
            }

            if (b.Length != columnsOfB * order)
            {
                throw new ArgumentException("The array arguments must have the same length.", nameof(b));
            }

            if (ReferenceEquals(a, b))
            {
                throw new ArgumentException("Arguments must be different objects.");
            }

            var info = SafeNativeMethods.d_lu_solve_factored(order, columnsOfB, a, ipiv, b);

            if (info < 0)
            {
                throw new InvalidParameterException(Math.Abs(info));
            }
        }
Ejemplo n.º 2
0
        public override void LUSolveFactored(int columnsOfB, double[] a, int order, int[] ipiv, double[] b)
        {
            if (a == null)
            {
                throw new ArgumentNullException("a");
            }

            if (ipiv == null)
            {
                throw new ArgumentNullException("ipiv");
            }

            if (a.Length != order * order)
            {
                throw new ArgumentException(Resources.ArgumentArraysSameLength, "a");
            }

            if (ipiv.Length != order)
            {
                throw new ArgumentException(Resources.ArgumentArraysSameLength, "ipiv");
            }

            if (b.Length != columnsOfB * order)
            {
                throw new ArgumentException(Resources.ArgumentArraysSameLength, "b");
            }

            if (ReferenceEquals(a, b))
            {
                throw new ArgumentException(Resources.ArgumentReferenceDifferent);
            }

            var info = SafeNativeMethods.d_lu_solve_factored(order, columnsOfB, a, ipiv, b);

            if (info < 0)
            {
                throw new InvalidParameterException(Math.Abs(info));
            }
        }