46 for (i=0; i<rows; i++) {
47 for (j=0; j<cols; j++) {
71 note(
"Sparse Matrix:\n");
72 note(
"\tnnz = %li, rows = %li, cols = %li\n", A->
nnz, A->
n_row,
76 note(
"\tvalues = [ ");
77 for (i=0; i<A->
nnz; i++) {
78 if (i != 0)
note(
", ");
85 for (i=0; i<A->
n_row+1; i++) {
86 if (i != 0)
note(
", ");
93 for (i=0; i<A->
nnz; i++) {
94 if (i != 0)
note(
", ");
long * ja
column indices, should be of length nnz
long n_col
number of columns of the original matrix
Header file for gensvm_debug.c.
#define matrix_get(M, cols, i, j)
void gensvm_print_matrix(double *M, long rows, long cols)
Print a dense matrix.
long nnz
number of nonzero elements
void gensvm_print_sparse(struct GenSparse *A)
Print a sparse matrix.
double * values
actual nonzero values, should be of length nnz
long * ia
cumulative row lengths, should be of length n_row+1
A structure to represent a sparse matrix in CSR format.
void note(const char *fmt,...)
Parse a formatted string and write to the output stream.
long n_row
number of rows of the original matrix