/// <summary>
        ///   Creates a new Cholesky decomposition directly from
        ///   an already computed left triangular matrix <c>L</c>.
        /// </summary>
        /// <param name="leftTriangular">The left triangular matrix from a Cholesky decomposition.</param>
        ///
        public static JaggedCholeskyDecompositionD FromLeftTriangularMatrix(Decimal[][] leftTriangular)
        {
            var chol = new JaggedCholeskyDecompositionD();

            chol.n = leftTriangular.Length;
            chol.L = leftTriangular;
            chol.positiveDefinite = true;
            chol.robust           = false;
            chol.D = Vector.Ones <Decimal>(chol.n);
            return(chol);
        }
Beispiel #2
0
        /// <summary>
        ///   Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        ///   A new object that is a copy of this instance.
        /// </returns>
        ///
        public object Clone()
        {
            var clone = new JaggedCholeskyDecompositionD();

            clone.L                = L.MemberwiseClone();
            clone.D                = (Decimal[])D.Clone();
            clone.destroyed        = destroyed;
            clone.dimension        = dimension;
            clone.undefined        = undefined;
            clone.robust           = robust;
            clone.positiveDefinite = positiveDefinite;
            return(clone);
        }
Beispiel #3
0
        /// <summary>
        ///   Creates a new Cholesky decomposition directly from
        ///   an already computed left triangular matrix <c>L</c>.
        /// </summary>
        /// <param name="leftTriangular">The left triangular matrix from a Cholesky decomposition.</param>
        ///
        public static JaggedCholeskyDecompositionD FromLeftTriangularMatrix(Decimal[][] leftTriangular)
        {
            var chol = new JaggedCholeskyDecompositionD();

            chol.dimension        = leftTriangular.Length;
            chol.L                = leftTriangular;
            chol.positiveDefinite = true;
            chol.robust           = false;
            chol.D                = new Decimal[chol.dimension];
            for (int i = 0; i < chol.D.Length; i++)
            {
                chol.D[i] = 1;
            }

            return(chol);
        }