Esempio n. 1
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 JaggedCholeskyDecomposition();

            clone.L                = L.MemberwiseClone();
            clone.D                = (Double[])D.Clone();
            clone.destroyed        = destroyed;
            clone.dimension        = dimension;
            clone.undefined        = undefined;
            clone.robust           = robust;
            clone.positiveDefinite = positiveDefinite;
            return(clone);
        }
Esempio n. 2
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 JaggedCholeskyDecomposition FromLeftTriangularMatrix(Double[][] leftTriangular)
        {
            var chol = new JaggedCholeskyDecomposition();

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

            return(chol);
        }