Exemple #1
0
 /// <summary>
 /// Create a new dense matrix as a copy of the given row 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 OfRowVectors(params Vector<double>[] rows)
 {
     var storage = new VectorStorage<double>[rows.Length];
     for (int i = 0; i < rows.Length; i++)
     {
         storage[i] = rows[i].Storage;
     }
     return new DenseMatrix(DenseColumnMajorMatrixStorage<double>.OfRowVectors(storage));
 }
Exemple #2
0
 /// <summary>
 /// Create a new dense matrix as a copy of the given row 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 OfRowVectors(IEnumerable <Vector <double> > rows)
 {
     return(new DenseMatrix(DenseColumnMajorMatrixStorage <double> .OfRowVectors(rows.Select(r => r.Storage).ToArray())));
 }