spLib
Loading...
Searching...
No Matches
<sp/fileio.h>: File I/O

File I/O for Vector (<sp/fileio.h>)

spSVector xsvreadssignal (const char *filename, long headlen, int swap)
 
spLVector xlvreadlsignal (const char *filename, long headlen, int swap)
 
spFVector xfvreadfsignal (const char *filename, long headlen, int swap)
 
spDVector xdvreaddsignal (const char *filename, long headlen, int swap)
 
spDVector xdvreadssignal (const char *filename, long headlen, int swap)
 
spDVector xdvreadlsignal (const char *filename, long headlen, int swap)
 
spDVector xdvreadfsignal (const char *filename, long headlen, int swap)
 
spBool svwritessignal (const char *filename, spSVector vector, int swap)
 
spBool lvwritelsignal (const char *filename, spLVector vector, int swap)
 
spBool fvwritefsignal (const char *filename, spFVector vector, int swap)
 
spBool dvwritedsignal (const char *filename, spDVector vector, int swap)
 
spBool dvwritessignal (const char *filename, spDVector vector, int swap)
 
spBool dvwritelsignal (const char *filename, spDVector vector, int swap)
 
spBool dvwritefsignal (const char *filename, spDVector vector, int swap)
 
#define xdvreaddvector(filename, swap)   xdvreaddsignal((filename), 0, (swap))
 
#define xdvreadsvector(filename, swap)   xdvreadssignal((filename), 0, (swap))
 
#define xdvreadlvector(filename, swap)   xdvreadlsignal((filename), 0, (swap))
 
#define xdvreadfvector(filename, swap)   xdvreadfsignal((filename), 0, (swap))
 
#define dvwritedvector(filename, vector, swap)   dvwritedsignal(filename, vector, swap)
 
#define dvwritesvector(filename, vector, swap)   dvwritessignal(filename, vector, swap)
 
#define dvwritelvector(filename, vector, swap)   dvwritelsignal(filename, vector, swap)
 
#define dvwritefvector(filename, vector, swap)   dvwritefsignal(filename, vector, swap)
 
#define xfvreadfvector(filename, swap)   xfvreadfsignal((filename), 0, (swap))
 
#define fvwritefvector(filename, vector, swap)   fvwritefsignal(filename, vector, swap)
 
#define xlvreadlvector(filename, swap)   xlvreadlsignal((filename), 0, (swap))
 
#define lvwritelvector(filename, vector, swap)   lvwritelsignal(filename, vector, swap)
 
#define xsvreadsvector(filename, swap)   xsvreadssignal((filename), 0, (swap))
 
#define svwritesvector(filename, vector, swap)   svwritessignal(filename, vector, swap)
 

File I/O for Matrix (<sp/fileio.h>)

spSMatrix xsmreadsmatrix (const char *filename, long ncol, int swap)
 
spLMatrix xlmreadlmatrix (const char *filename, long ncol, int swap)
 
spFMatrix xfmreadfmatrix (const char *filename, long ncol, int swap)
 
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 smwritesmatrix (const char *filename, spSMatrix mat, int swap)
 
spBool lmwritelmatrix (const char *filename, spLMatrix mat, int swap)
 
spBool fmwritefmatrix (const char *filename, spFMatrix mat, 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)
 

Text I/O for Vector (<sp/fileio.h>)

spBool svreadsvector_txt (const char *filename, spSVector vector)
 
spBool lvreadlvector_txt (const char *filename, spLVector vector)
 
spBool fvreadfvector_txt (const char *filename, spFVector vector)
 
spBool dvreaddvector_txt (const char *filename, spDVector vector)
 
spSVector xsvreadsvector_txt (const char *filename)
 
spLVector xlvreadlvector_txt (const char *filename)
 
spFVector xfvreadfvector_txt (const char *filename)
 
spDVector xdvreaddvector_txt (const char *filename)
 
spBool svreadcol_txt (const char *filename, int col, spSVector vector)
 
spBool lvreadcol_txt (const char *filename, int col, spLVector vector)
 
spBool fvreadcol_txt (const char *filename, int col, spFVector vector)
 
spBool dvreadcol_txt (const char *filename, int col, spDVector vector)
 
spSVector xsvreadcol_txt (const char *filename, int col)
 
spLVector xlvreadcol_txt (const char *filename, int col)
 
spFVector xfvreadcol_txt (const char *filename, int col)
 
spDVector xdvreadcol_txt (const char *filename, int col)
 
spBool svwritesvector_txt (const char *filename, spSVector vector)
 
spBool lvwritelvector_txt (const char *filename, spLVector vector)
 
spBool fvwritefvector_txt (const char *filename, spFVector vector)
 
spBool dvwritedvector_txt (const char *filename, spDVector vector)
 

Vector Modification for I/O (<sp/fileio.h>)

float fvmaxamp (spFVector vec)
 
double dvmaxamp (spDVector vec)
 
float fvadjustamp (spFVector vec, float amp)
 
double dvadjustamp (spDVector vec, double amp)
 
float fvlimitamp (spFVector vec, float amp)
 
double dvlimitamp (spDVector vec, double amp)
 
spFVector xfvextractchannel (spFVector x, int channel, int num_channel)
 
spDVector xdvextractchannel (spDVector x, int channel, int num_channel)
 

Vector Dump (<sp/fileio.h>)

void svdump (spSVector vec)
 
void lvdump (spLVector vec)
 
void fvdump (spFVector vec)
 
void dvdump (spDVector vec)
 
void svfdump (spSVector vec, FILE *fp)
 
void lvfdump (spLVector vec, FILE *fp)
 
void fvfdump (spFVector vec, FILE *fp)
 
void dvfdump (spDVector vec, FILE *fp)
 
void svnfdump (FILE *fp,...)
 
void lvnfdump (FILE *fp,...)
 
void fvnfdump (FILE *fp,...)
 
void dvnfdump (FILE *fp,...)
 

Matrix Dump (<sp/fileio.h>)

void smfdump (spSMatrix mat, FILE *fp)
 
void lmfdump (spLMatrix mat, FILE *fp)
 
void fmfdump (spFMatrix mat, FILE *fp)
 
void dmfdump (spDMatrix mat, FILE *fp)
 
#define dmdump(mat)   dmfdump(mat, (stdout))
 
#define fmdump(mat)   fmfdump(mat, (stdout))
 
#define lmdump(mat)   lmfdump(mat, (stdout))
 
#define smdump(mat)   smfdump(mat, (stdout))
 

Detailed Description

#include <sp/fileio.h>

Macro Definition Documentation

◆ dmdump

#define dmdump ( mat)    dmfdump(mat, (stdout))

Displays the contents of the matrix mat to the standard output.

◆ xdvreaddvector

#define xdvreaddvector ( filename,
swap )   xdvreaddsignal((filename), 0, (swap))
related

Loads a binary vector into a new vector.

Parameters
[in]filenameThe name of the input vector file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xdvreadsvector

#define xdvreadsvector ( filename,
swap )   xdvreadssignal((filename), 0, (swap))
related

Loads a binary vector of short type into a new vector of double type.

Parameters
[in]filenameThe name of the input vector file containing data of short type.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xdvreadlvector

#define xdvreadlvector ( filename,
swap )   xdvreadlsignal((filename), 0, (swap))
related

Loads a binary vector of long type into a new vector of double type.

Parameters
[in]filenameThe name of the input vector file containing data of long type.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xdvreadfvector

#define xdvreadfvector ( filename,
swap )   xdvreadfsignal((filename), 0, (swap))
related

Loads a binary vector of float type into a new vector of double type.

Parameters
[in]filenameThe name of the input vector file containing data of float type.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ dvwritedvector

#define dvwritedvector ( filename,
vector,
swap )   dvwritedsignal(filename, vector, swap)
related

Saves the vector as a binary vector file.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvwritesvector

#define dvwritesvector ( filename,
vector,
swap )   dvwritessignal(filename, vector, swap)
related

Saves the vector of double type as a binary vector file of short type.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvwritelvector

#define dvwritelvector ( filename,
vector,
swap )   dvwritelsignal(filename, vector, swap)
related

Saves the vector of double type as a binary vector file of long type.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvwritefvector

#define dvwritefvector ( filename,
vector,
swap )   dvwritefsignal(filename, vector, swap)
related

Saves the vector of double type as a binary vector file of float type.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ fmdump

#define fmdump ( mat)    fmfdump(mat, (stdout))

Displays the contents of the matrix mat to the standard output.

◆ xfvreadfvector

#define xfvreadfvector ( filename,
swap )   xfvreadfsignal((filename), 0, (swap))
related

Loads a binary vector into a new vector.

Parameters
[in]filenameThe name of the input vector file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ fvwritefvector

#define fvwritefvector ( filename,
vector,
swap )   fvwritefsignal(filename, vector, swap)
related

Saves the vector as a binary vector file.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ lmdump

#define lmdump ( mat)    lmfdump(mat, (stdout))

Displays the contents of the matrix mat to the standard output.

◆ xlvreadlvector

#define xlvreadlvector ( filename,
swap )   xlvreadlsignal((filename), 0, (swap))
related

Loads a binary vector into a new vector.

Parameters
[in]filenameThe name of the input vector file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ lvwritelvector

#define lvwritelvector ( filename,
vector,
swap )   lvwritelsignal(filename, vector, swap)
related

Saves the vector as a binary vector file.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ smdump

#define smdump ( mat)    smfdump(mat, (stdout))

Displays the contents of the matrix mat to the standard output.

◆ xsvreadsvector

#define xsvreadsvector ( filename,
swap )   xsvreadssignal((filename), 0, (swap))
related

Loads a binary vector into a new vector.

Parameters
[in]filenameThe name of the input vector file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ svwritesvector

#define svwritesvector ( filename,
vector,
swap )   svwritessignal(filename, vector, swap)
related

Saves the vector as a binary vector file.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

Function Documentation

◆ xsvreadssignal()

spSVector xsvreadssignal ( const char * filename,
long headlen,
int swap )

Loads a binary signal into a new vector.

Parameters
[in]filenameThe name of the input signal file.
[in]headlenThe header size in bytes of the file. The beginning of the file of this size will be skipped.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xlvreadlsignal()

spLVector xlvreadlsignal ( const char * filename,
long headlen,
int swap )

Loads a binary signal into a new vector.

Parameters
[in]filenameThe name of the input signal file.
[in]headlenThe header size in bytes of the file. The beginning of the file of this size will be skipped.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xfvreadfsignal()

spFVector xfvreadfsignal ( const char * filename,
long headlen,
int swap )

Loads a binary signal into a new vector.

Parameters
[in]filenameThe name of the input signal file.
[in]headlenThe header size in bytes of the file. The beginning of the file of this size will be skipped.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xdvreaddsignal()

spDVector xdvreaddsignal ( const char * filename,
long headlen,
int swap )

Loads a binary signal into a new vector.

Parameters
[in]filenameThe name of the input signal file.
[in]headlenThe header size in bytes of the file. The beginning of the file of this size will be skipped.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xdvreadssignal()

spDVector xdvreadssignal ( const char * filename,
long headlen,
int swap )

Loads a binary signal of short type into a new vector of double type.

Parameters
[in]filenameThe name of the input signal file containing data of short type.
[in]headlenThe header size in bytes of the file. The beginning of the file of this size will be skipped.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xdvreadlsignal()

spDVector xdvreadlsignal ( const char * filename,
long headlen,
int swap )

Loads a binary signal of long type into a new vector of double type.

Parameters
[in]filenameThe name of the input signal file containing data of long type.
[in]headlenThe header size in bytes of the file. The beginning of the file of this size will be skipped.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ xdvreadfsignal()

spDVector xdvreadfsignal ( const char * filename,
long headlen,
int swap )

Loads a binary signal of float type into a new vector of double type.

Parameters
[in]filenameThe name of the input signal file containing data of float type.
[in]headlenThe header size in bytes of the file. The beginning of the file of this size will be skipped.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated vector.

◆ svwritessignal()

spBool svwritessignal ( const char * filename,
spSVector vector,
int swap )

Saves the vector as a binary signal file.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ lvwritelsignal()

spBool lvwritelsignal ( const char * filename,
spLVector vector,
int swap )

Saves the vector as a binary signal file.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ fvwritefsignal()

spBool fvwritefsignal ( const char * filename,
spFVector vector,
int swap )

Saves the vector as a binary signal file.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvwritedsignal()

spBool dvwritedsignal ( const char * filename,
spDVector vector,
int swap )

Saves the vector as a binary signal file.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvwritessignal()

spBool dvwritessignal ( const char * filename,
spDVector vector,
int swap )

Saves the vector of double type as a binary signal file of short type.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvwritelsignal()

spBool dvwritelsignal ( const char * filename,
spDVector vector,
int swap )

Saves the vector of double type as a binary signal file of long type.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvwritefsignal()

spBool dvwritefsignal ( const char * filename,
spDVector vector,
int swap )

Saves the vector of double type as a binary signal file of float type.

Parameters
[in]filenameThe name of the file.
[in]vectorThe vector to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ xsmreadsmatrix()

spSMatrix xsmreadsmatrix ( const char * filename,
long ncol,
int swap )

Loads a binary matrix into a new matrix.

Parameters
[in]filenameThe name of the input matrix file.
[in]ncolThe number of columns of the input matrix file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated matrix.

◆ xlmreadlmatrix()

spLMatrix xlmreadlmatrix ( const char * filename,
long ncol,
int swap )

Loads a binary matrix into a new matrix.

Parameters
[in]filenameThe name of the input matrix file.
[in]ncolThe number of columns of the input matrix file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated matrix.

◆ xfmreadfmatrix()

spFMatrix xfmreadfmatrix ( const char * filename,
long ncol,
int swap )

Loads a binary matrix into a new matrix.

Parameters
[in]filenameThe name of the input matrix file.
[in]ncolThe number of columns of the input matrix file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated matrix.

◆ xdmreaddmatrix()

spDMatrix xdmreaddmatrix ( const char * filename,
long ncol,
int swap )

Loads a binary matrix into a new matrix.

Parameters
[in]filenameThe name of the input matrix file.
[in]ncolThe number of columns of the input matrix file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated matrix.

◆ xdmreadsmatrix()

spDMatrix xdmreadsmatrix ( const char * filename,
long ncol,
int swap )

Loads a binary matrix of short type into a new matrix of double type.

Parameters
[in]filenameThe name of the input matrix file containing data of short type.
[in]ncolThe number of columns of the input matrix file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated matrix.

◆ xdmreadlmatrix()

spDMatrix xdmreadlmatrix ( const char * filename,
long ncol,
int swap )

Loads a binary matrix of long type into a new matrix of double type.

Parameters
[in]filenameThe name of the input matrix file containing data of long type.
[in]ncolThe number of columns of the input matrix file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated matrix.

◆ xdmreadfmatrix()

spDMatrix xdmreadfmatrix ( const char * filename,
long ncol,
int swap )

Loads a binary matrix of float type into a new matrix of double type.

Parameters
[in]filenameThe name of the input matrix file containing data of float type.
[in]ncolThe number of columns of the input matrix file.
[in]swapNonzero value enables the endian (byte-order) conversion.
Returns
The memory-allocated matrix.

◆ smwritesmatrix()

spBool smwritesmatrix ( const char * filename,
spSMatrix mat,
int swap )

Saves the matrix as a binary matrix file.

Parameters
[in]filenameThe name of the file.
[in]matThe matrix to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ lmwritelmatrix()

spBool lmwritelmatrix ( const char * filename,
spLMatrix mat,
int swap )

Saves the matrix as a binary matrix file.

Parameters
[in]filenameThe name of the file.
[in]matThe matrix to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ fmwritefmatrix()

spBool fmwritefmatrix ( const char * filename,
spFMatrix mat,
int swap )

Saves the matrix as a binary matrix file.

Parameters
[in]filenameThe name of the file.
[in]matThe matrix to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dmwritedmatrix()

spBool dmwritedmatrix ( const char * filename,
spDMatrix mat,
int swap )

Saves the matrix as a binary matrix file.

Parameters
[in]filenameThe name of the file.
[in]matThe matrix to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dmwritesmatrix()

spBool dmwritesmatrix ( const char * filename,
spDMatrix mat,
int swap )

Saves the matrix of double type as a binary matrix file of short type.

Parameters
[in]filenameThe name of the file.
[in]matThe matrix to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dmwritelmatrix()

spBool dmwritelmatrix ( const char * filename,
spDMatrix mat,
int swap )

Saves the matrix of double type as a binary matrix file of long type.

Parameters
[in]filenameThe name of the file.
[in]matThe matrix to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dmwritefmatrix()

spBool dmwritefmatrix ( const char * filename,
spDMatrix mat,
int swap )

Saves the matrix of double type as a binary matrix file of float type.

Parameters
[in]filenameThe name of the file.
[in]matThe matrix to save.
[in]swapNonzero value enables the endian (byte-order) conversion.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ svreadsvector_txt()

spBool svreadsvector_txt ( const char * filename,
spSVector vector )

Loads a text vector into the specified vector. If the number of lines of the file is longer than the length of the specified vector, the lines whose index exceeds the length will be ignored. If the number of lines of the file is shorter than the length of the specified vector, the trailing data of the vector will be zero-padded.

Parameters
[in]filenameThe name of the input text file. Each line of the text file corresponds to an element of the vector.
[in,out]vectorThe vector into which the data of the file loads.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ lvreadlvector_txt()

spBool lvreadlvector_txt ( const char * filename,
spLVector vector )

Loads a text vector into the specified vector. If the number of lines of the file is longer than the length of the specified vector, the lines whose index exceeds the length will be ignored. If the number of lines of the file is shorter than the length of the specified vector, the trailing data of the vector will be zero-padded.

Parameters
[in]filenameThe name of the input text file. Each line of the text file corresponds to an element of the vector.
[in,out]vectorThe vector into which the data of the file loads.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ fvreadfvector_txt()

spBool fvreadfvector_txt ( const char * filename,
spFVector vector )

Loads a text vector into the specified vector. If the number of lines of the file is longer than the length of the specified vector, the lines whose index exceeds the length will be ignored. If the number of lines of the file is shorter than the length of the specified vector, the trailing data of the vector will be zero-padded.

Parameters
[in]filenameThe name of the input text file. Each line of the text file corresponds to an element of the vector.
[in,out]vectorThe vector into which the data of the file loads.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvreaddvector_txt()

spBool dvreaddvector_txt ( const char * filename,
spDVector vector )

Loads a text vector into the specified vector. If the number of lines of the file is longer than the length of the specified vector, the lines whose index exceeds the length will be ignored. If the number of lines of the file is shorter than the length of the specified vector, the trailing data of the vector will be zero-padded.

Parameters
[in]filenameThe name of the input text file. Each line of the text file corresponds to an element of the vector.
[in,out]vectorThe vector into which the data of the file loads.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ xsvreadsvector_txt()

spSVector xsvreadsvector_txt ( const char * filename)

Loads a text vector into a new vector.

Parameters
[in]filenameThe name of the input text file. Each line of the text file corresponds to an element of the vector.
Returns
The memory-allocated vector.

◆ xlvreadlvector_txt()

spLVector xlvreadlvector_txt ( const char * filename)

Loads a text vector into a new vector.

Parameters
[in]filenameThe name of the input text file. Each line of the text file corresponds to an element of the vector.
Returns
The memory-allocated vector.

◆ xfvreadfvector_txt()

spFVector xfvreadfvector_txt ( const char * filename)

Loads a text vector into a new vector.

Parameters
[in]filenameThe name of the input text file. Each line of the text file corresponds to an element of the vector.
Returns
The memory-allocated vector.

◆ xdvreaddvector_txt()

spDVector xdvreaddvector_txt ( const char * filename)

Loads a text vector into a new vector.

Parameters
[in]filenameThe name of the input text file. Each line of the text file corresponds to an element of the vector.
Returns
The memory-allocated vector.

◆ svreadcol_txt()

spBool svreadcol_txt ( const char * filename,
int col,
spSVector vector )

Loads a text vector containing multiple data columns into the specified vector. If the number of lines of the file is longer than the length of the specified vector, the lines whose index exceeds the length will be ignored. If the number of lines of the file is shorter than the length of the specified vector, the trailing data of the vector will be zero-padded.

Parameters
[in]filenameThe name of the input text file. Each line of the text file contains multiples numbers separated by a whitespace.
[in]colA 0-based column index.
[in,out]vectorThe vector into which the data of the file loads.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ lvreadcol_txt()

spBool lvreadcol_txt ( const char * filename,
int col,
spLVector vector )

Loads a text vector containing multiple data columns into the specified vector. If the number of lines of the file is longer than the length of the specified vector, the lines whose index exceeds the length will be ignored. If the number of lines of the file is shorter than the length of the specified vector, the trailing data of the vector will be zero-padded.

Parameters
[in]filenameThe name of the input text file. Each line of the text file contains multiples numbers separated by a whitespace.
[in]colA 0-based column index.
[in,out]vectorThe vector into which the data of the file loads.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ fvreadcol_txt()

spBool fvreadcol_txt ( const char * filename,
int col,
spFVector vector )

Loads a text vector containing multiple data columns into the specified vector. If the number of lines of the file is longer than the length of the specified vector, the lines whose index exceeds the length will be ignored. If the number of lines of the file is shorter than the length of the specified vector, the trailing data of the vector will be zero-padded.

Parameters
[in]filenameThe name of the input text file. Each line of the text file contains multiples numbers separated by a whitespace.
[in]colA 0-based column index.
[in,out]vectorThe vector into which the data of the file loads.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvreadcol_txt()

spBool dvreadcol_txt ( const char * filename,
int col,
spDVector vector )

Loads a text vector containing multiple data columns into the specified vector. If the number of lines of the file is longer than the length of the specified vector, the lines whose index exceeds the length will be ignored. If the number of lines of the file is shorter than the length of the specified vector, the trailing data of the vector will be zero-padded.

Parameters
[in]filenameThe name of the input text file. Each line of the text file contains multiples numbers separated by a whitespace.
[in]colA 0-based column index.
[in,out]vectorThe vector into which the data of the file loads.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ xsvreadcol_txt()

spSVector xsvreadcol_txt ( const char * filename,
int col )

Loads a text vector containing multiple data columns into a new vector.

Parameters
[in]filenameThe name of the input text file. Each line of the text file contains multiples numbers separated by a whitespace.
[in]colThe zero-based column number to load.
Returns
The memory-allocated vector.

◆ xlvreadcol_txt()

spLVector xlvreadcol_txt ( const char * filename,
int col )

Loads a text vector containing multiple data columns into a new vector.

Parameters
[in]filenameThe name of the input text file. Each line of the text file contains multiples numbers separated by a whitespace.
[in]colThe zero-based column number to load.
Returns
The memory-allocated vector.

◆ xfvreadcol_txt()

spFVector xfvreadcol_txt ( const char * filename,
int col )

Loads a text vector containing multiple data columns into a new vector.

Parameters
[in]filenameThe name of the input text file. Each line of the text file contains multiples numbers separated by a whitespace.
[in]colThe zero-based column number to load.
Returns
The memory-allocated vector.

◆ xdvreadcol_txt()

spDVector xdvreadcol_txt ( const char * filename,
int col )

Loads a text vector containing multiple data columns into a new vector.

Parameters
[in]filenameThe name of the input text file. Each line of the text file contains multiples numbers separated by a whitespace.
[in]colThe zero-based column number to load.
Returns
The memory-allocated vector.

◆ svwritesvector_txt()

spBool svwritesvector_txt ( const char * filename,
spSVector vector )

Saves the vector as a text vector file.

Parameters
[in]filenameThe name of the file. Each line of the text file corresponds to an element of the vector.
[in]vectorThe vector to save.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ lvwritelvector_txt()

spBool lvwritelvector_txt ( const char * filename,
spLVector vector )

Saves the vector as a text vector file.

Parameters
[in]filenameThe name of the file. Each line of the text file corresponds to an element of the vector.
[in]vectorThe vector to save.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ fvwritefvector_txt()

spBool fvwritefvector_txt ( const char * filename,
spFVector vector )

Saves the vector as a text vector file.

Parameters
[in]filenameThe name of the file. Each line of the text file corresponds to an element of the vector.
[in]vectorThe vector to save.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ dvwritedvector_txt()

spBool dvwritedvector_txt ( const char * filename,
spDVector vector )

Saves the vector as a text vector file.

Parameters
[in]filenameThe name of the file. Each line of the text file corresponds to an element of the vector.
[in]vectorThe vector to save.
Return values
SP_TRUESuccess
SP_FALSEFailure

◆ fvmaxamp()

float fvmaxamp ( spFVector vec)

Gets the maximal absolute amplitude of the vector.

◆ dvmaxamp()

double dvmaxamp ( spDVector vec)

Gets the maximal absolute amplitude of the vector.

◆ fvadjustamp()

float fvadjustamp ( spFVector vec,
float amp )

Amplifies the specified vector so that the maximal absolute amplitude of the vector is amp .

◆ dvadjustamp()

double dvadjustamp ( spDVector vec,
double amp )

Amplifies the specified vector so that the maximal absolute amplitude of the vector is amp .

◆ fvlimitamp()

float fvlimitamp ( spFVector vec,
float amp )

Amplifies the specified vector so that the maximal absolute amplitude of the vector is amp only if the maximal absolute amplitude exceeds amp .

◆ dvlimitamp()

double dvlimitamp ( spDVector vec,
double amp )

Amplifies the specified vector so that the maximal absolute amplitude of the vector is amp only if the maximal absolute amplitude exceeds amp .

◆ xfvextractchannel()

spFVector xfvextractchannel ( spFVector x,
int channel,
int num_channel )

Extracts data associated with channel from the vector containing multi-channel data with the interleaved format which the number of the channel is num_channel .

◆ xdvextractchannel()

spDVector xdvextractchannel ( spDVector x,
int channel,
int num_channel )

Extracts data associated with channel from the vector containing multi-channel data with the interleaved format which the number of the channel is num_channel .

◆ svdump()

void svdump ( spSVector vec)

Displays the contents of the vector vec to the standard output.

◆ lvdump()

void lvdump ( spLVector vec)

Displays the contents of the vector vec to the standard output.

◆ fvdump()

void fvdump ( spFVector vec)

Displays the contents of the vector vec to the standard output.

◆ dvdump()

void dvdump ( spDVector vec)

Displays the contents of the vector vec to the standard output.

◆ svfdump()

void svfdump ( spSVector vec,
FILE * fp )

Outputs the contents of the vector vec to the file associated with the file pointer fp .

◆ lvfdump()

void lvfdump ( spLVector vec,
FILE * fp )

Outputs the contents of the vector vec to the file associated with the file pointer fp .

◆ fvfdump()

void fvfdump ( spFVector vec,
FILE * fp )

Outputs the contents of the vector vec to the file associated with the file pointer fp .

◆ dvfdump()

void dvfdump ( spDVector vec,
FILE * fp )

Outputs the contents of the vector vec to the file associated with the file pointer fp .

◆ svnfdump()

void svnfdump ( FILE * fp,
... )

Outputs the real part of the multiple vectors of spSVector type to the file associated with the file pointer fp . Each column of the output corresponds to the contents of a vector. The final argument of this function must be NULL.

◆ lvnfdump()

void lvnfdump ( FILE * fp,
... )

Outputs the real part of the multiple vectors of spLVector type to the file associated with the file pointer fp . Each column of the output corresponds to the contents of a vector. The final argument of this function must be NULL.

◆ fvnfdump()

void fvnfdump ( FILE * fp,
... )

Outputs the real part of the multiple vectors of spFVector type to the file associated with the file pointer fp . Each column of the output corresponds to the contents of a vector. The final argument of this function must be NULL.

◆ dvnfdump()

void dvnfdump ( FILE * fp,
... )

Outputs the real part of the multiple vectors of spDVector type to the file associated with the file pointer fp . Each column of the output corresponds to the contents of a vector. The final argument of this function must be NULL.

◆ smfdump()

void smfdump ( spSMatrix mat,
FILE * fp )

Outputs the contents of the matrix mat to the file associated with the file pointer fp .

◆ lmfdump()

void lmfdump ( spLMatrix mat,
FILE * fp )

Outputs the contents of the matrix mat to the file associated with the file pointer fp .

◆ fmfdump()

void fmfdump ( spFMatrix mat,
FILE * fp )

Outputs the contents of the matrix mat to the file associated with the file pointer fp .

◆ dmfdump()

void dmfdump ( spDMatrix mat,
FILE * fp )

Outputs the contents of the matrix mat to the file associated with the file pointer fp .