ScaMaC  0.8.2
A Scalable Matrix Collection
scamac_matop.h
Go to the documentation of this file.
1 
8 #ifndef SCAMAC_MATOP_H
9 #define SCAMAC_MATOP_H
10 
11 
12 #include "scamac_vector.h"
13 #include "scamac_generator.h"
14 #include "scamac_sparsemat.h"
15 #include <complex.h>
16 
17 /* abstract object */
18 typedef struct scamac_matop_st ScamacMatop;
19 
23 //ScamacErrorCode scamac_matop_alloc(ScamacInt nr, ScamacInt nc, ScamacInt ne, ScamacValType valtype, ScamacMatop ** sm);
24 
28 ScamacErrorCode scamac_matop_from_generator(const ScamacGenerator * gen, ScamacMatop ** sm);
29 
33 ScamacErrorCode scamac_matop_from_matrix(const ScamacMatrix * mat, ScamacMatop ** sm);
34 
38 ScamacErrorCode scamac_matop_free(ScamacMatop * sm);
39 
40 ScamacInt scamac_matop_query_nr(const ScamacMatop * sm);
41 ScamacInt scamac_matop_query_nc(const ScamacMatop * sm);
42 ScamacValType scamac_matop_query_valtype(const ScamacMatop * sm);
43 
48 //ScamacErrorCode scamac_sparsemat_mvm(const ScamacMatrix *sm, const double *x, double *y, double alpha, double beta, double gamma);
49 ScamacErrorCode scamac_matop_mvm(const ScamacMatop *sm, const ScamacVector *x, ScamacVector *y, double alpha, double beta, double gamma);
50 
55 //ScamacErrorCode scamac_sparsemat_mvm_cplx(const ScamacMatrix *sm, const double complex *x, double complex *y,
56 // double complex alpha, double complex beta, double complex gamma);
57 ScamacErrorCode scamac_matop_mvm_cplx(const ScamacMatop *sm, const ScamacVector *x, ScamacVector *y,
58  double complex alpha, double complex beta, double complex gamma);
59 
60 #endif /* SCAMAC_MATOP_H */
Sparse matrix creation and manipulation.
ScamacErrorCode scamac_matop_mvm_cplx(const ScamacMatop *sm, const ScamacVector *x, ScamacVector *y, double complex alpha, double complex beta, double complex gamma)
Complex sparse matrix-vector multiplication: y = alpha SM x + beta y + gamma x.
generic ScaMaC generator routines
Vector creation and manipulation.
ScamacErrorCode scamac_matop_from_generator(const ScamacGenerator *gen, ScamacMatop **sm)
Create matop.
struct scamac_generator_st ScamacGenerator
Abstract generator object.
Definition: scamac_generator.h:24
ScamacErrorCode scamac_matop_free(ScamacMatop *sm)
Free allocated matop.
ScamacErrorCode scamac_matop_mvm(const ScamacMatop *sm, const ScamacVector *x, ScamacVector *y, double alpha, double beta, double gamma)
Sparse matrix-vector multiplication: y = alpha SM x + beta y + gamma x.
ScamacErrorCode scamac_matop_from_matrix(const ScamacMatrix *mat, ScamacMatop **sm)
Obtain matop from ScaMaC sparse matrix.