#include <stdio.h>
int main(
const int argc,
char *
const argv[])
{
#ifndef RSB_NUMERICAL_TYPE_DOUBLE
printf("Skipping a test because of 'double' type opted out.\n");
return EXIT_SUCCESS;
#else
const rsb_char_t * filename = argc > 1 ? argv[1] :
"pd.mtx";
printf("Hello, RSB!\n");
{
printf("Error while initializing the library.\n");
goto err;
}
printf("Correctly initialized the library.\n");
{
printf("Error while loading matrix %s from file.\n",
filename);
goto err;
}
printf("Correctly loaded and allocated a matrix"
" from file %s.\n",filename);
printf("Matrix is symmetric\n");
printf("Matrix is hermitian\n");
printf("Now SPMV with NULL vectors will be attempted,"
" resulting in an error (so don't worry).\n");
{
printf("Correctly detected an error condition.\n");
goto okerr;
}
printf("No error detected ?\nIf you see this line printed out,"
" please report as a bug, because the above NULL pointers"
" should have been detected\n");
return EXIT_FAILURE;
okerr:
printf("Program correctly recovered from intentional"
" error condition.\n");
{
printf("Error while freeing the matrix!\n");
goto err;
}
printf("Correctly freed the matrix.\n");
err:
{
printf("Failed finalizing the library.\n");
goto ferr;
}
printf("Correctly finalized the library.\n");
return EXIT_SUCCESS;
ferr:
return EXIT_FAILURE;
#endif
}
auto main() -> int
Definition: assemble.cpp:38
This file specifies the Sparse BLAS interface to librsb. Supported types :(float,double,...
@ blas_no_trans
Definition: blas_sparse.h:32
#define BLAS_usgp
Definition: blas_sparse.h:563
int blas_sparse_matrix
Definition: blas_sparse.h:167
@ blas_invalid_handle
Definition: blas_sparse.h:133
@ blas_hermitian
Definition: blas_sparse.h:109
@ blas_symmetric
Definition: blas_sparse.h:108
rsb_err_t rsb_lib_exit(struct rsb_initopts *iop)
Definition: rsb_rsb.c:202
rsb_err_t rsb_perror(void *stream, rsb_err_t errval)
Definition: rsb_rsb.c:814
rsb_err_t rsb_lib_init(struct rsb_initopts *iop)
Definition: rsb_rsb.c:56
blas_sparse_matrix rsb_blas_file_mtx_load(const rsb_char_t *filename, rsb_type_t typecode)
Definition: rsb_libspblas.c:3670
int BLAS_usds(blas_sparse_matrix A)
Definition: rsb_libspblas.c:2644
int BLAS_dusmv(const enum blas_trans_type transA, double alpha, const blas_sparse_matrix A, const double *x, const int incx, double *y, const int incy)
Definition: rsb_libspblas.c:936
This file declares the user interface functions and data structures for the librsb library (see The l...
char rsb_char_t
Definition: rsb.h:408
#define RSB_ERR_NO_ERROR
Definition: rsb.h:616
#define RSB_NULL_EXIT_OPTIONS
Definition: rsb.h:848
char rsb_type_t
Definition: rsb.h:378
#define RSB_NULL_INIT_OPTIONS
Definition: rsb.h:847
#define RSB_NUMERICAL_TYPE_DOUBLE
Character code for type double. See rsb_type_t .
Definition: rsb_types.h:185