NTPoly
|
A module for handling locally stored CSR matrices. More...
Data Types | |
type | sparsematrix_t |
A datatype for storing a CSR matrix. More... | |
Functions/Subroutines | |
pure subroutine, public | constructemptysparsematrix (this, columns, rows) |
Internal only. Create a sparse matrix with a certain number of columns and rows. Will allocate storage for the outer values, nothing else. More... | |
subroutine, public | constructsparsematrixfromfile (this, file_name) |
Create a sparse matrix by reading in a matrix market file. More... | |
pure subroutine, public | constructzerosparsematrix (this, rows, columns) |
Construct a sparse matrix with zero values in it. More... | |
pure subroutine, public | constructfromtripletlist (this, triplet_list, rows, columns) |
Construct a sparse matrix from a SORTED triplet list. The triplet list must be sorted to efficiently fill in the matrix. This constructor assumes you have already sorted the triplet list. More... | |
pure subroutine, public | destructsparsematrix (this) |
Explicitly destruct a sparse matrix. More... | |
pure subroutine, public | copysparsematrix (matA, matB) |
Copy a sparse matrix in a safe way. More... | |
pure integer function, public | getrows (this) |
Get the number of rows of a matrix. More... | |
pure integer function, public | getcolumns (this) |
Get the number of columns of a matrix. More... | |
pure subroutine, public | extractrow (this, row_number, row_out) |
Extract a row from the matrix into the compressed vector representation. More... | |
pure subroutine, public | extractcolumn (this, column_number, column_out) |
Extract a column from the matrix into the compressed vector representation. More... | |
pure subroutine, public | transposesparsematrix (this, matT) |
Transpose a sparse matrix and return it in a separate matrix. The current implementation has you go from matrix to triplet list, triplet list to transposed triplet list. The triplet list must then be sorted and then the return matrix is constructed. More... | |
pure subroutine, public | composesparsematrix (mat_array, block_rows, block_columns, out_matrix) |
Create a big matrix from an array of matrices by putting them one next to another. More... | |
pure subroutine, public | composesparsematrixcolumns (mat_list, out_matrix) |
Create a big Matrix C = [Matrix 1 | Matrix 1, ...] where the columns of the first matrix are followed by the columns of the matrices in the list. More... | |
pure subroutine, public | splitsparsematrix (this, block_rows, block_columns, split_array, block_size_row_in, block_size_column_in) |
Split a sparse matrix into an array of sparse matrices. More... | |
pure subroutine, public | splitsparsematrixcolumns (this, num_blocks, block_sizes, split_list) |
Split a matrix into into small blocks based on the specified offsets. More... | |
pure subroutine, public | matrixtotripletlist (this, triplet_list) |
Construct a triplet list from a matrix. More... | |
subroutine, public | printsparsematrix (this, file_name_in) |
Print out a sparse matrix. More... | |
A module for handling locally stored CSR matrices.
pure subroutine, public sparsematrixmodule::composesparsematrix | ( | type(sparsematrix_t), dimension(block_columns, block_rows), intent(in) | mat_array, |
integer, intent(in) | block_rows, | ||
integer, intent(in) | block_columns, | ||
type(sparsematrix_t), intent(inout) | out_matrix | ||
) |
Create a big matrix from an array of matrices by putting them one next to another.
[in] | mat_array | 2d array of matrices to compose. |
[in] | block_rows | the number of rows of the array of blocks. |
[in] | block_columns | the number of columns of the array of blocks. |
[out] | out_matrix | the composed matrix. |
pure subroutine, public sparsematrixmodule::composesparsematrixcolumns | ( | type(sparsematrix_t), dimension(:), intent(in) | mat_list, |
type(sparsematrix_t), intent(inout) | out_matrix | ||
) |
Create a big Matrix C = [Matrix 1 | Matrix 1, ...] where the columns of the first matrix are followed by the columns of the matrices in the list.
[in] | mat_list | list of matrices to compose. |
[out] | out_matrix | = [Matrix 1 | Matrix 2, ...] . |
pure subroutine, public sparsematrixmodule::constructemptysparsematrix | ( | type(sparsematrix_t), intent(out) | this, |
integer, intent(in) | columns, | ||
integer, intent(in) | rows | ||
) |
Internal only. Create a sparse matrix with a certain number of columns and rows. Will allocate storage for the outer values, nothing else.
[out] | this | the matrix being created. It will have the outer index allocated, but nothing else. |
[in] | columns | number of matrix columns. |
[in] | rows | number of matrix rows. |
pure subroutine, public sparsematrixmodule::constructfromtripletlist | ( | type(sparsematrix_t), intent(out) | this, |
type(tripletlist_t), intent(in) | triplet_list, | ||
integer, intent(in) | rows, | ||
integer, intent(in) | columns | ||
) |
Construct a sparse matrix from a SORTED triplet list. The triplet list must be sorted to efficiently fill in the matrix. This constructor assumes you have already sorted the triplet list.
[out] | this | the matrix being constructed |
[in] | triplet_list | a list of triplet values. They must be sorted. |
[in] | rows | number of matrix rows |
[in] | columns | number of matrix columns |
subroutine, public sparsematrixmodule::constructsparsematrixfromfile | ( | type(sparsematrix_t), intent(out) | this, |
character(len=*), intent(in) | file_name | ||
) |
Create a sparse matrix by reading in a matrix market file.
[out] | this | the matrix being constructed. |
[in] | file_name | name of the file. |
pure subroutine, public sparsematrixmodule::constructzerosparsematrix | ( | type(sparsematrix_t), intent(out) | this, |
integer, intent(in) | rows, | ||
integer, intent(in) | columns | ||
) |
Construct a sparse matrix with zero values in it.
[out] | this | the matrix being constructed |
[in] | rows | number of matrix rows |
[in] | columns | number of matrix columns |
pure subroutine, public sparsematrixmodule::copysparsematrix | ( | type(sparsematrix_t), intent(in) | matA, |
type(sparsematrix_t), intent(inout) | matB | ||
) |
Copy a sparse matrix in a safe way.
[in] | matA | matrix to copy |
[in,out] | matB | = matA |
pure subroutine, public sparsematrixmodule::destructsparsematrix | ( | type(sparsematrix_t), intent(inout) | this | ) |
Explicitly destruct a sparse matrix.
[in,out] | this | the matrix to free up |
pure subroutine, public sparsematrixmodule::extractcolumn | ( | type(sparsematrix_t), intent(in) | this, |
integer, intent(in) | column_number, | ||
type(sparsematrix_t), intent(inout) | column_out | ||
) |
Extract a column from the matrix into the compressed vector representation.
[in] | this | the matrix to extract from. |
[in] | column_number | the row to extract |
[out] | column_out | the matrix representing that row |
pure subroutine, public sparsematrixmodule::extractrow | ( | type(sparsematrix_t), intent(in) | this, |
integer, intent(in) | row_number, | ||
type(sparsematrix_t), intent(inout) | row_out | ||
) |
Extract a row from the matrix into the compressed vector representation.
[in] | this | the matrix to extract from. |
[in] | row_number | the row to extract |
[out] | row_out | the matrix representing that row |
pure integer function, public sparsematrixmodule::getcolumns | ( | type(sparsematrix_t), intent(in) | this | ) |
Get the number of columns of a matrix.
[in] | this | the matrix. |
pure integer function, public sparsematrixmodule::getrows | ( | type(sparsematrix_t), intent(in) | this | ) |
Get the number of rows of a matrix.
[in] | this | the matrix. |
pure subroutine, public sparsematrixmodule::matrixtotripletlist | ( | type(sparsematrix_t), intent(in) | this, |
type(tripletlist_t), intent(inout) | triplet_list | ||
) |
Construct a triplet list from a matrix.
[in] | this | the matrix to construct the triplet list from. |
[out] | triplet_list | the triplet list we created. |
subroutine, public sparsematrixmodule::printsparsematrix | ( | type(sparsematrix_t), intent(in) | this, |
character(len=*), intent(in), optional | file_name_in | ||
) |
Print out a sparse matrix.
[in] | this | the matrix to be printed. |
[in] | file_name_in | optionally, you can pass a file to print to. |
pure subroutine, public sparsematrixmodule::splitsparsematrix | ( | type(sparsematrix_t), intent(in) | this, |
integer, intent(in) | block_rows, | ||
integer, intent(in) | block_columns, | ||
type(sparsematrix_t), dimension(block_columns, block_rows), intent(inout) | split_array, | ||
integer, dimension(block_rows), intent(in), optional | block_size_row_in, | ||
integer, dimension(block_columns), intent(in), optional | block_size_column_in | ||
) |
Split a sparse matrix into an array of sparse matrices.
[in] | this | the matrix to split. |
[in] | block_rows | number of rows to split the matrix into. |
[in] | block_columns | number of columns to split the matrix into. |
[out] | split_array | a COLUMNxROW array for the output to go into. |
[in] | block_size_row_in | specifies the block size (optional) |
[in] | block_size_column_in | specifies the block size (optional) |
pure subroutine, public sparsematrixmodule::splitsparsematrixcolumns | ( | type(sparsematrix_t), intent(in) | this, |
integer, intent(in) | num_blocks, | ||
integer, dimension(num_blocks), intent(in) | block_sizes, | ||
type(sparsematrix_t), dimension(num_blocks), intent(inout) | split_list | ||
) |
Split a matrix into into small blocks based on the specified offsets.
[in] | this | matrix to perform this operation on. |
[in] | num_blocks | number of blocks to split into |
[out] | block_offsets | the offsets used for splitting. |
[out] | split_list | 1D array of blocks. |
pure subroutine, public sparsematrixmodule::transposesparsematrix | ( | type(sparsematrix_t), intent(in) | this, |
type(sparsematrix_t), intent(inout) | matT | ||
) |
Transpose a sparse matrix and return it in a separate matrix. The current implementation has you go from matrix to triplet list, triplet list to transposed triplet list. The triplet list must then be sorted and then the return matrix is constructed.
[in] | this | the matrix to be transposed. |
[out] | matT | the input matrix transposed. |