|
|
|
@ -1127,6 +1127,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return Dense(DenseVectorStorage<T>.OfVector(vector.Storage)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new dense vector as a copy of the given array.
|
|
|
|
/// This new vector will be independent from the array.
|
|
|
|
/// A new memory block will be allocated for storing the vector.
|
|
|
|
/// </summary>
|
|
|
|
public Vector<T> DenseOfArray(T[] array) |
|
|
|
{ |
|
|
|
return Dense(DenseVectorStorage<T>.OfVector(new DenseVectorStorage<T>(array.Length, array))); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new dense vector as a copy of the given enumerable.
|
|
|
|
/// This new vector will be independent from the enumerable.
|
|
|
|
@ -1192,6 +1202,16 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
return Sparse(SparseVectorStorage<T>.OfVector(vector.Storage)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse vector as a copy of the given array.
|
|
|
|
/// This new vector will be independent from the array.
|
|
|
|
/// A new memory block will be allocated for storing the vector.
|
|
|
|
/// </summary>
|
|
|
|
public Vector<T> SparseOfArray(T[] array) |
|
|
|
{ |
|
|
|
return Sparse(SparseVectorStorage<T>.OfEnumerable(array)); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Create a new sparse vector as a copy of the given enumerable.
|
|
|
|
/// This new vector will be independent from the enumerable.
|
|
|
|
|