spLib
Loading...
Searching...
No Matches
spSMatrix Class Reference

Matrix type that contains the elements of short type. More...

#include <sp/matrix.h>

Collaboration diagram for spSMatrix:
Collaboration graph

Public Member Functions

File I/O for Matrix (<sp/fileio.h>)
spSMatrix xsmreadsmatrix (const char *filename, long ncol, int swap)
 
spBool smwritesmatrix (const char *filename, spSMatrix mat, int swap)
 
Matrix Dump (<sp/fileio.h>)
void smfdump (spSMatrix mat, FILE *fp)
 
#define smdump(mat)   smfdump(mat, (stdout))
 

Data Fields

long row
 
long col
 
short ** data
 
short ** imag
 

Detailed Description

Matrix type that contains the elements of short type.

Actually, This is a typedefed type by typedef struct _spSMatrix *spSMatrix;. To allocate memory for spSMatrix, call a function with prefix xsm such as xsmalloc() , xsmzeros() , etc. To deallocate memory, call xsmfree() .

Field Documentation

◆ row

long row

The number of rows of spSMatrix. You can access the number of elements as x->row for the memory allocated x of spSMatrix.

◆ col

long col

The number of columns of spSMatrix. You can access the number of elements as x->col for the memory allocated x of spSMatrix.

◆ data

short** data

Data of the real part of spSMatrix. You can access the element of the data at row 0, column 0 as x->data[0][0] for the memory allocated x of spSMatrix.

◆ imag

short** imag

Data of the imaginary part of spSMatrix. You can access the element of the data at row 0, column 0 as x->imag[0][0] for the memory allocated x of spSMatrix. If no imaginary part exists, this member can be NULL.