ScaMaC
0.8.2
A Scalable Matrix Collection
|
High-level access to the ScaMaC library for matrix generation. More...
Files | |
file | scamac.h |
ScaMaC library top-level header file | |
Typedefs | |
typedef struct scamac_generator_st | ScamacGenerator |
Abstract generator object. | |
typedef struct scamac_workspace_st | ScamacWorkspace |
Abstract workspace object. | |
Functions | |
ScamacErrorCode | scamac_benchmark_obtain (const char *name, int m, int x, ScamacGenerator **gen) |
obtain generator for benchmark matrix "Bmname-m-x" e.g. scamac_benchmark_obtain("Simple",1,1) gives, to quote, "the simplest benchmark matrix ever". More... | |
ScamacErrorCode | scamac_generator_set_rngseed (ScamacGenerator *gen, const char *parname, uint64_t seed) |
set random seed | |
ScamacErrorCode | scamac_generator_set_rngseed_str (ScamacGenerator *gen, const char *parname, const char *seedstr) |
set random seed, reading from an arbitrary (random) string More... | |
ScamacErrorCode | scamac_generator_check (const ScamacGenerator *gen, char **desc) |
Check the parameters of the generator. More... | |
ScamacErrorCode | scamac_generate_row (const ScamacGenerator *gen, ScamacWorkspace *ws, ScamacIdx irow, ScamacFlag flag, ScamacIdx *nzr, ScamacIdx *cind, double *val) |
Generate one row of a matrix. More... | |
ScamacErrorCode | scamac_alloc_cind_val (const ScamacGenerator *gen, ScamacFlag flag, ScamacIdx **cind, double **val) |
Allocate vector cind and val, for calls to scamac_generate_row(). More... | |
High-level access to the ScaMaC library for matrix generation.
Only the functions listed here should be called directly by the user. They are bundled in the top-level header scamac.h.
ScamacErrorCode scamac_alloc_cind_val | ( | const ScamacGenerator * | gen, |
ScamacFlag | flag, | ||
ScamacIdx ** | cind, | ||
double ** | val | ||
) |
Allocate vector cind and val, for calls to scamac_generate_row().
This function is merely a convenience.
ScamacErrorCode scamac_benchmark_obtain | ( | const char * | name, |
int | m, | ||
int | x, | ||
ScamacGenerator ** | gen | ||
) |
obtain generator for benchmark matrix "Bmname-m-x" e.g. scamac_benchmark_obtain("Simple",1,1) gives, to quote, "the simplest benchmark matrix ever".
ScamacErrorCode scamac_generate_row | ( | const ScamacGenerator * | gen, |
ScamacWorkspace * | ws, | ||
ScamacIdx | irow, | ||
ScamacFlag | flag, | ||
ScamacIdx * | nzr, | ||
ScamacIdx * | cind, | ||
double * | val | ||
) |
Generate one row of a matrix.
We generate a row.
[in] | gen | Matrix generator, after scamac_generator_finalize() |
[in,out] | ws | Workspace, allocated by scamac_workspace_alloc() |
[in] | irow | index of the row to be generated |
[in] | flag | flags |
[out] | nzr | number of non-zero elements in the row |
[out] | cind | column indices of non-zero elements |
[out] | val | values of non-zero elements |
ScamacErrorCode scamac_generator_check | ( | const ScamacGenerator * | gen, |
char ** | desc | ||
) |
Check the parameters of the generator.
This routine performs some checks.
[in] | gen | The generator to be checked |
[out] | desc | If desc != NULL, it contains a string describing the problems with the parameters. |
ScamacErrorCode scamac_generator_set_rngseed_str | ( | ScamacGenerator * | gen, |
const char * | parname, | ||
const char * | seedstr | ||
) |
set random seed, reading from an arbitrary (random) string
The random values used in matrix generation depend on a seed value, which is given by a matrix parameter normally called "seed". Random number generation is consistent: For the same seed, the same random values are used independently of the way the matrix is generated.