|
|
@ -28,8 +28,6 @@ |
|
|
// OTHER DEALINGS IN THE SOFTWARE.
|
|
|
// OTHER DEALINGS IN THE SOFTWARE.
|
|
|
// </copyright>
|
|
|
// </copyright>
|
|
|
|
|
|
|
|
|
using System.Runtime; |
|
|
|
|
|
|
|
|
|
|
|
namespace MathNet.Numerics.LinearAlgebra.Double |
|
|
namespace MathNet.Numerics.LinearAlgebra.Double |
|
|
{ |
|
|
{ |
|
|
using Algorithms.LinearAlgebra; |
|
|
using Algorithms.LinearAlgebra; |
|
|
@ -169,6 +167,21 @@ namespace MathNet.Numerics.LinearAlgebra.Double |
|
|
return new DenseMatrix(DenseColumnMajorMatrixStorage<double>.OfColumnEnumerables(rows, columns, data)); |
|
|
return new DenseMatrix(DenseColumnMajorMatrixStorage<double>.OfColumnEnumerables(rows, columns, data)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <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>
|
|
|
/// <summary>
|
|
|
/// Create a new dense matrix as a copy of the given enumerable of enumerable columns.
|
|
|
/// Create a new dense matrix as a copy of the given enumerable of enumerable columns.
|
|
|
/// Each enumerable in the master enumerable specifies a column.
|
|
|
/// Each enumerable in the master enumerable specifies a column.
|
|
|
@ -192,6 +205,21 @@ namespace MathNet.Numerics.LinearAlgebra.Double |
|
|
return new DenseMatrix(DenseColumnMajorMatrixStorage<double>.OfRowEnumerables(rows, columns, data)); |
|
|
return new DenseMatrix(DenseColumnMajorMatrixStorage<double>.OfRowEnumerables(rows, columns, data)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <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)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Create a new dense matrix as a copy of the given enumerable of enumerable rows.
|
|
|
/// Create a new dense matrix as a copy of the given enumerable of enumerable rows.
|
|
|
/// Each enumerable in the master enumerable specifies a row.
|
|
|
/// Each enumerable in the master enumerable specifies a row.
|
|
|
|