|
|
|
@ -500,6 +500,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return DenseMatrix(DenseColumnMajorMatrixStorage<T>.OfColumnArrays(columns)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new dense matrix of T as a copy of the given column arrays.
|
|
|
|
/// This new matrix will be independent from the arrays.
|
|
|
|
/// A new memory block will be allocated for storing the matrix.
|
|
|
|
/// </summary>
|
|
|
|
public Matrix<T> DenseMatrixOfColumnArrays(IEnumerable<T[]> columns) |
|
|
|
{ |
|
|
|
return DenseMatrix(DenseColumnMajorMatrixStorage<T>.OfColumnArrays((columns as T[][]) ?? columns.ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new dense matrix as a copy of the given column vectors.
|
|
|
|
/// This new matrix will be independent from the vectors.
|
|
|
|
@ -515,6 +525,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return DenseMatrix(DenseColumnMajorMatrixStorage<T>.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 Matrix<T> DenseMatrixOfColumnVectors(IEnumerable<Vector<T>> columns) |
|
|
|
{ |
|
|
|
return DenseMatrix(DenseColumnMajorMatrixStorage<T>.OfColumnVectors(columns.Select(c => c.Storage).ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new dense matrix as a copy of the given enumerable of enumerable rows.
|
|
|
|
/// Each enumerable in the master enumerable specifies a row.
|
|
|
|
@ -547,6 +567,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return DenseMatrix(DenseColumnMajorMatrixStorage<T>.OfRowArrays(rows)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new dense matrix of T as a copy of the given row arrays.
|
|
|
|
/// This new matrix will be independent from the arrays.
|
|
|
|
/// A new memory block will be allocated for storing the matrix.
|
|
|
|
/// </summary>
|
|
|
|
public Matrix<T> DenseMatrixOfRowArrays(IEnumerable<T[]> rows) |
|
|
|
{ |
|
|
|
return DenseMatrix(DenseColumnMajorMatrixStorage<T>.OfRowArrays((rows as T[][]) ?? rows.ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new dense matrix as a copy of the given row vectors.
|
|
|
|
/// This new matrix will be independent from the vectors.
|
|
|
|
@ -562,6 +592,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return DenseMatrix(DenseColumnMajorMatrixStorage<T>.OfRowVectors(storage)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <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 Matrix<T> DenseMatrixOfRowVectors(IEnumerable<Vector<T>> rows) |
|
|
|
{ |
|
|
|
return DenseMatrix(DenseColumnMajorMatrixStorage<T>.OfRowVectors(rows.Select(r => r.Storage).ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new dense matrix with the diagonal as a copy of the given vector.
|
|
|
|
/// This new matrix will be independent from the vector.
|
|
|
|
@ -749,6 +789,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return SparseMatrix(SparseCompressedRowMatrixStorage<T>.OfColumnArrays(columns)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse matrix as a copy of the given column arrays.
|
|
|
|
/// This new matrix will be independent from the arrays.
|
|
|
|
/// A new memory block will be allocated for storing the matrix.
|
|
|
|
/// </summary>
|
|
|
|
public Matrix<T> SparseMatrixOfColumnArrays(IEnumerable<T[]> columns) |
|
|
|
{ |
|
|
|
return SparseMatrix(SparseCompressedRowMatrixStorage<T>.OfColumnArrays((columns as T[][]) ?? columns.ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse matrix as a copy of the given column vectors.
|
|
|
|
/// This new matrix will be independent from the vectors.
|
|
|
|
@ -764,6 +814,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return SparseMatrix(SparseCompressedRowMatrixStorage<T>.OfColumnVectors(storage)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse 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 Matrix<T> SparseMatrixOfColumnVectors(IEnumerable<Vector<T>> columns) |
|
|
|
{ |
|
|
|
return SparseMatrix(SparseCompressedRowMatrixStorage<T>.OfColumnVectors(columns.Select(c => c.Storage).ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse matrix as a copy of the given enumerable of enumerable rows.
|
|
|
|
/// Each enumerable in the master enumerable specifies a row.
|
|
|
|
@ -796,6 +856,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return SparseMatrix(SparseCompressedRowMatrixStorage<T>.OfRowArrays(rows)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse matrix as a copy of the given row arrays.
|
|
|
|
/// This new matrix will be independent from the arrays.
|
|
|
|
/// A new memory block will be allocated for storing the matrix.
|
|
|
|
/// </summary>
|
|
|
|
public Matrix<T> SparseMatrixOfRowArrays(IEnumerable<T[]> rows) |
|
|
|
{ |
|
|
|
return SparseMatrix(SparseCompressedRowMatrixStorage<T>.OfRowArrays((rows as T[][]) ?? rows.ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse matrix as a copy of the given row vectors.
|
|
|
|
/// This new matrix will be independent from the vectors.
|
|
|
|
@ -811,6 +881,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return SparseMatrix(SparseCompressedRowMatrixStorage<T>.OfRowVectors(storage)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse 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 Matrix<T> SparseMatrixOfRowVectors(IEnumerable<Vector<T>> rows) |
|
|
|
{ |
|
|
|
return SparseMatrix(SparseCompressedRowMatrixStorage<T>.OfRowVectors(rows.Select(r => r.Storage).ToArray())); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse matrix with the diagonal as a copy of the given vector.
|
|
|
|
/// This new matrix will be independent from the vector.
|
|
|
|
|