ScaMaC  0.8.2
A Scalable Matrix Collection
scamac_sparsemat.h
Go to the documentation of this file.
1 
8 #ifndef SCAMAC_SPARSEMAT_H
9 #define SCAMAC_SPARSEMAT_H
10 
11 #include "scamac_generator.h"
12 #include <stdbool.h>
13 
14 /* abstract object */
15 typedef struct scamac_sparsemat_st ScamacMatrix;
16 
20 ScamacErrorCode scamac_sparsemat_alloc(ScamacInt nr, ScamacInt nc, ScamacInt ne, ScamacValType valtype, ScamacMatrix ** sm);
24 ScamacErrorCode scamac_sparsemat_free(ScamacMatrix * sm);
25 
26 ScamacInt scamac_sparsemat_query_nr(const ScamacMatrix * sm);
27 ScamacInt scamac_sparsemat_query_nc(const ScamacMatrix * sm);
28 ScamacValType scamac_sparsemat_query_valtype(const ScamacMatrix * sm);
29 // int scamac_sparsemat_query_type(const ScamacMatrix * sm); // TODO: value or pattern matrix
30 // int scamac_sparsemat_query_symmetry(const ScamacMatrix * sm); // General, Symmetric, ...
31 
32 
36 ScamacErrorCode scamac_sparsemat_from_generator(const ScamacGenerator * gen, ScamacMatrix ** sm);
37 
43 bool scamac_sparsemat_check(const ScamacMatrix * sm);
44 
49 ScamacErrorCode scamac_sparsemat_to_dense(const ScamacMatrix * sm, void ** dm);
50 
51 #endif /* SCAMAC_SPARSEMAT_H */
ScamacErrorCode scamac_sparsemat_alloc(ScamacInt nr, ScamacInt nc, ScamacInt ne, ScamacValType valtype, ScamacMatrix **sm)
Allocate sparse matrix.
ScamacErrorCode scamac_sparsemat_from_generator(const ScamacGenerator *gen, ScamacMatrix **sm)
Obtain sparse matrix from ScaMaC generator.
bool scamac_sparsemat_check(const ScamacMatrix *sm)
basic sanity check for sparse matrix
generic ScaMaC generator routines
ScamacErrorCode scamac_sparsemat_free(ScamacMatrix *sm)
Free allocated sparse matrix.
ScamacErrorCode scamac_sparsemat_to_dense(const ScamacMatrix *sm, void **dm)
convert sparse matrix to dense matrix
struct scamac_generator_st ScamacGenerator
Abstract generator object.
Definition: scamac_generator.h:24