/// <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.n = leftTriangular.Length;
            chol.L = leftTriangular;
            chol.positiveDefinite = true;
            chol.robust           = false;
            chol.Diagonal         = Vector.Ones <double>(chol.n);
            return(chol);
        }
        /// <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.Diagonal         = (double[])Diagonal.Clone();
            clone.destroyed        = destroyed;
            clone.n                = n;
            clone.IsUndefined      = IsUndefined;
            clone.robust           = robust;
            clone.positiveDefinite = positiveDefinite;
            return(clone);
        }