LinearAlgebraPool<T> Class

Provides a pool of vectors and matrices to minimize memory allocations.

Definition

Namespace: Numerics.NET.Collections
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.7
C#
public class LinearAlgebraPool<T>
Inheritance
Object  →  LinearAlgebraPool<T>

Type Parameters

T
The type of elements in the vector or matrix.

Remarks

Using the LinearAlgebraPool<T> class to rent and return vectors that rent their storage buffers from an array pool. This can help reduce the number of memory allocations and deallocations in the application, which can improve performance in situations where vectors and matrices are created and destroyed frequently.

Many operations that return parts of vectors or matrices return a view that references the original buffer. Care must therefore be taken when using the LinearAlgebraPool<T> class because it is possible to inadvertently retain references to rented buffers.

Constructors

LinearAlgebraPool<T> Initializes a new instance of the LinearAlgebraPool<T> class with the specified array pool.

Properties

ArrayPool The array pool used to rent and return storage arrays.
Shared Gets a shared instance of the LinearAlgebraPool<T> class.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
RentBandMatrix Rents a band matrix with the specified dimensions from the pool.
RentHermitianMatrix Rents a Hermitian matrix with the specified dimensions from the pool.
RentLowerTriangularMatrix Rents a lower triangular matrix with the specified dimensions from the pool.
RentMatrix Rents a dense matrix with the specified dimensions from the pool.
RentSymmetricMatrix Rents a symmetric matrix with the specified dimensions from the pool.
RentUpperTriangularMatrix Rents a lower triangular matrix with the specified dimensions from the pool.
RentVector Rents a vector of the specified length from the pool.
Return(Matrix<T>, Boolean) Returns a rented matrix to the pool.
Return(Vector<T>, Boolean) Returns a rented vector to the pool.
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also