Cartesius Library
sparsematrix Module Reference

Data Types

interface  assignment(=)
 
interface  operator(*)
 
interface  operator(+)
 
interface  operator(-)
 
interface  operator(.abs.)
 
interface  operator(.comm.)
 
interface  operator(.compr.)
 
interface  operator(.tr.)
 
type  sparse_matrix
 

Functions/Subroutines

subroutine mat2sparse (sp, mat)
 Convert a normal matrix into a sparse matrix. More...
 
subroutine sparse2mat (mat, sp)
 Convert sparse matrix into a normal one. More...
 
subroutine sparse2sparse (spout, spin)
 Copy the data of one sparse matrix into another. More...
 
type(sparse_matrix) function sp_neg (a)
 Return the negative of the given matrix. More...
 
type(sparse_matrix) function sp_abs (a)
 
type(sparse_matrix) function sum_sparse (a, b)
 Returns the sum of the two sparse matrices. More...
 
type(sparse_matrix) function sub_sparse (a, b)
 Returns the difference between two matrices. More...
 
type(sparse_matrix) function trans_matrix (a)
 Returns a transposed sparse matrix. More...
 
type(sparse_matrix) function mul_sparse (a, b)
 Returns the product of two sparse matrices. More...
 
type(sparse_matrix) function mul_sparse_num (num, a)
 
type(sparse_matrix) function sp_compr (a)
 Returns the given matrix, taking out the zero-values. More...
 
type(sparse_matrix) function commute_sparse (a, b)
 Returns the commutator of two sparse matrices. More...
 
real function, dimension(sp%nr) mul_sparse_vcol (sp, vin)
 Mutiplies a sparse matrix by a column-vector. More...
 
real function, dimension(sp%nc) mul_sparse_vrow (vin, sp)
 Multipiles a row-vector by a sparse matrix. More...
 

Function/Subroutine Documentation

◆ commute_sparse()

type(sparse_matrix) function sparsematrix::commute_sparse ( type(sparse_matrix), intent(in)  a,
type(sparse_matrix), intent(in)  b 
)

Returns the commutator of two sparse matrices.

◆ mat2sparse()

subroutine sparsematrix::mat2sparse ( type(sparse_matrix), intent(inout)  sp,
real, dimension(:, :), intent(in)  mat 
)

Convert a normal matrix into a sparse matrix.

◆ mul_sparse()

type(sparse_matrix) function sparsematrix::mul_sparse ( type(sparse_matrix), intent(in)  a,
type(sparse_matrix), intent(in)  b 
)

Returns the product of two sparse matrices.

◆ mul_sparse_num()

type(sparse_matrix) function sparsematrix::mul_sparse_num ( real, intent(in)  num,
type(sparse_matrix), intent(in)  a 
)

◆ mul_sparse_vcol()

real function, dimension(sp%nr) sparsematrix::mul_sparse_vcol ( type (sparse_matrix), intent(in)  sp,
real, dimension(:), intent(in)  vin 
)

Mutiplies a sparse matrix by a column-vector.

◆ mul_sparse_vrow()

real function, dimension(sp%nc) sparsematrix::mul_sparse_vrow ( real, dimension(:), intent(in)  vin,
type (sparse_matrix), intent(in)  sp 
)

Multipiles a row-vector by a sparse matrix.

◆ sp_abs()

type(sparse_matrix) function sparsematrix::sp_abs ( type(sparse_matrix), intent(in)  a)

◆ sp_compr()

type(sparse_matrix) function sparsematrix::sp_compr ( type(sparse_matrix), intent(in)  a)

Returns the given matrix, taking out the zero-values.

◆ sp_neg()

type(sparse_matrix) function sparsematrix::sp_neg ( type(sparse_matrix), intent(in)  a)

Return the negative of the given matrix.

◆ sparse2mat()

subroutine sparsematrix::sparse2mat ( real, dimension(sp%nr, sp%nc), intent(inout)  mat,
type(sparse_matrix), intent(in)  sp 
)

Convert sparse matrix into a normal one.

◆ sparse2sparse()

subroutine sparsematrix::sparse2sparse ( type(sparse_matrix), intent(inout)  spout,
type(sparse_matrix), intent(in)  spin 
)

Copy the data of one sparse matrix into another.

◆ sub_sparse()

type(sparse_matrix) function sparsematrix::sub_sparse ( type(sparse_matrix), intent(in)  a,
type(sparse_matrix), intent(in)  b 
)

Returns the difference between two matrices.

◆ sum_sparse()

type(sparse_matrix) function sparsematrix::sum_sparse ( type(sparse_matrix), intent(in)  a,
type(sparse_matrix), intent(in)  b 
)

Returns the sum of the two sparse matrices.

◆ trans_matrix()

type (sparse_matrix) function sparsematrix::trans_matrix ( type (sparse_matrix), intent(in)  a)

Returns a transposed sparse matrix.