XLPack 7.0
Python API Reference Manual
Loading...
Searching...
No Matches

◆ mm_write1()

def mm_write1 ( fname  ,
nrow  ,
ncol  ,
val  ,
rowptr  ,
colind  ,
fchk  = 0,
mshape  = 0 
)

Write a matrix to the Matrix Market file

Purpose
This function writes a real sparse matrix in CSR format to the Matrix Market file. The data is written as it is without checking the contents.
Returns
info (int)
= 0: Successful exit.
< 0: The (-info)-th argument is invalid.
= 1: Failed to open file.
= 2: File already exists.
Parameters
[in]fnameInput file name.
[in]nrowNumber of rows of the matrix. (nrow >= 0) (If nrow = 0, returns without computation)
[in]ncolNumber of columns of the matrix. (ncol >= 0) (If ncol = 0, returns without computation)
[in]valNumpy ndarray (1-dimensional, float, nnz)
Values of nonzero elements of sparse matrix (where nnz is the number of nonzero elements).
[in]rowptrNumpy ndarray (1-dimensional, int32, nrow + 1)
Row pointers of sparse matrix.
[in]colindNumpy ndarray (1-dimensional, int32, nnz)
Column indices of sparse matrix (where nnz is the number of nonzero elements).
[in]fchk(Optional)
Specify whether to check if the specified file already exists. (default = 0)
= 0: Overwrites without checking.
= 1: Returns an error (info = 2) if the specified file already exists.
[in]mshape(Optional)
行列の形状. (default = 0)
= 0: General.
= 1: Symmetric.
= 2: Skew-symmetric.