NTPoly
Data Types | Functions/Subroutines
matrixmemorypoolmodule Module Reference

A module for handling scratch memory for matrix multiplication. The purpose of this module is to avoid having to allocate memory on the heap during a matrix multiply, and to manage the underlying hash table. More...

Data Types

type  matrixmemorypool_t
 A memory pool datatype that can be reused for matrix matrix multiplication. this is to prevent excessive alloc/dealloc. More...
 

Functions/Subroutines

subroutine, public constructmatrixmemorypool (this, columns, rows, sparsity_in)
 Construct Matrix Memory Pool object. More...
 
pure subroutine, public destructmatrixmemorypool (this)
 A destructor for a matrix memory pool. More...
 
pure logical function, public checkmemorypoolvalidity (this, columns, rows)
 Checks if a given memory pool has been validly allocated to handle the given parameters. More...
 
subroutine, public setpoolsparsity (this, sparsity)
 Sets the expected sparsity of the matrix, which helps with hashing. More...
 

Detailed Description

A module for handling scratch memory for matrix multiplication. The purpose of this module is to avoid having to allocate memory on the heap during a matrix multiply, and to manage the underlying hash table.

Function/Subroutine Documentation

◆ checkmemorypoolvalidity()

pure logical function, public matrixmemorypoolmodule::checkmemorypoolvalidity ( type(matrixmemorypool_t), intent(in)  this,
integer, intent(in)  columns,
integer, intent(in)  rows 
)

Checks if a given memory pool has been validly allocated to handle the given parameters.

Parameters
[in]thisthe memory pool to check.
[in]columnsnumber of columns in the matrix.
[in]rowsnumber of rows in the matrix.
Returns
true if the memory pool is valid.

◆ constructmatrixmemorypool()

subroutine, public matrixmemorypoolmodule::constructmatrixmemorypool ( type(matrixmemorypool_t), intent(out), target  this,
integer(kind=c_int), intent(in)  columns,
integer(kind=c_int), intent(in)  rows,
real(ntreal), intent(in), optional  sparsity_in 
)

Construct Matrix Memory Pool object.

Parameters
[out]thisa constructed Matrix Memory Pool object.
[in]columnsnumber of columns in the matrix.
[in]rowsnumber of rows in the matrix.
[in]sparsity_inestimated sparsity (optional).

◆ destructmatrixmemorypool()

pure subroutine, public matrixmemorypoolmodule::destructmatrixmemorypool ( type(matrixmemorypool_t), intent(inout)  this)

A destructor for a matrix memory pool.

Parameters
[in,out]thisthe matrix being destructed.

◆ setpoolsparsity()

subroutine, public matrixmemorypoolmodule::setpoolsparsity ( type(matrixmemorypool_t), intent(inout), target  this,
real(ntreal), intent(in)  sparsity 
)

Sets the expected sparsity of the matrix, which helps with hashing.

Parameters
[in,out]thisthe memory pool to set the sparsity of.
[in]sparsitythe sparsity value.