/// <summary> /// Create a new dense matrix as a copy of the given column vectors. /// This new matrix will be independent from the vectors. /// A new memory block will be allocated for storing the matrix. /// </summary> public static DenseMatrix OfColumnVectors(params Vector<double>[] columns) { var storage = new VectorStorage<double>[columns.Length]; for (int i = 0; i < columns.Length; i++) { storage[i] = columns[i].Storage; } return new DenseMatrix(DenseColumnMajorMatrixStorage<double>.OfColumnVectors(storage)); }
/// <summary> /// Create a new dense matrix as a copy of the given column vectors. /// This new matrix will be independent from the vectors. /// A new memory block will be allocated for storing the matrix. /// </summary> public static DenseMatrix OfColumnVectors(IEnumerable <Vector <double> > columns) { return(new DenseMatrix(DenseColumnMajorMatrixStorage <double> .OfColumnVectors(columns.Select(c => c.Storage).ToArray()))); }