numl.Math.LinearAlgebra.Matrix.Stack C# (CSharp) Method

Stack() public static method

Stack a set of vectors into a matrix.
public static Stack ( ) : Matrix
return Matrix
        public static Matrix Stack(params Vector[] vectors)
        {
            return Matrix.Stack(VectorType.Row, vectors);
        }

Same methods

Matrix::Stack ( Matrix m, Matrix t ) : Matrix
Matrix::Stack ( VectorType type ) : Matrix

Usage Example

Beispiel #1
0
        /// <summary>
        /// An IEnumerable&lt;double[]&gt; extension method that converts the source into a matrix.
        /// </summary>
        /// <exception cref="InvalidOperationException">Thrown when the requested operation is invalid.</exception>
        /// <param name="source">The source to act on.</param>
        /// <param name="vectorType">The <see cref="VectorType"/> of the input array.</param>
        /// <returns>e as a Matrix.</returns>
        public static Matrix ToMatrix(this IEnumerable <Vector> source, VectorType vectorType = VectorType.Row)
        {
            var c = source.Count();

            if (c == 0)
            {
                throw new InvalidOperationException("Cannot create matrix from an empty set.");
            }

            return(Matrix.Stack(vectorType, source.ToArray()));
        }
All Usage Examples Of numl.Math.LinearAlgebra.Matrix::Stack