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

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

#include <sp/matrix.h>

Collaboration diagram for spDMatrix:
Collaboration graph

Public Member Functions

File I/O for Matrix (<sp/fileio.h>)
spDMatrix xdmreaddmatrix (const char *filename, long ncol, int swap)
 
spDMatrix xdmreadsmatrix (const char *filename, long ncol, int swap)
 
spDMatrix xdmreadlmatrix (const char *filename, long ncol, int swap)
 
spDMatrix xdmreadfmatrix (const char *filename, long ncol, int swap)
 
spBool dmwritedmatrix (const char *filename, spDMatrix mat, int swap)
 
spBool dmwritesmatrix (const char *filename, spDMatrix mat, int swap)
 
spBool dmwritelmatrix (const char *filename, spDMatrix mat, int swap)
 
spBool dmwritefmatrix (const char *filename, spDMatrix mat, int swap)
 
Matrix Dump (<sp/fileio.h>)
void dmfdump (spDMatrix mat, FILE *fp)
 
#define dmdump(mat)   dmfdump(mat, (stdout))
 

Data Fields

long row
 
long col
 
double ** data
 
double ** imag
 

Detailed Description

Matrix type that contains the elements of double type.

Actually, This is a typedefed type by typedef struct _spDMatrix *spDMatrix;. To allocate memory for spDMatrix, call a function with prefix xdm such as xdmalloc() , xdmzeros() , etc. To deallocate memory, call xdmfree() .

Examples
mattest.c.

Field Documentation

◆ row

long row

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

Examples
mattest.c.

◆ col

long col

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

Examples
mattest.c.

◆ data

double** data

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

Examples
mattest.c.

◆ imag

double** imag

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

Examples
mattest.c.