#include <stdio.h>
int main(
const int argc,
char *
const argv[])
{
#ifndef RSB_NUMERICAL_TYPE_DOUBLE
printf("'double' type configured out."
" Please reconfigure the library with it and recompile.\n");
return EXIT_SUCCESS;
#else
const int nnz = 4;
const int nr = 3;
const int nc = 3;
#ifdef RSB_WANT_LONG_IDX_TYPE
const int64_t IA[] = { 0, 1, 2, 2 };
#else
const int IA[] = { 0, 1, 2, 2 };
#endif
#ifdef RSB_WANT_LONG_IDX_TYPE
const int64_t JA[] = { 0, 1, 0, 2 };
#else
const int JA[] = { 0, 1, 0, 2 };
#endif
double VA[] = { 11.0, 22.0, 13.0, 33.0 };
double X[] = { 0.0, 0.0, 0.0 };
const double B[] = { -1.0, -2.0, -2.0 };
const double AB[] = { 11.0+26.0, 44.0, 66.0+13.0 };
int i;
printf("Hello, RSB!\n");
{
goto err;
}
printf("Correctly initialized the library.\n");
{
goto err;
}
{
goto err;
}
{
printf("Symmetry property non set ?!\n");
goto err;
}
{
goto err;
}
{
goto err;
}
printf("Correctly allocated a matrix.\n");
VA[0] = 0.0;
{
goto err;
}
if( VA[0] != 11.0 )
{
goto err;
}
{
goto err;
}
for( i = 0 ; i < nc; ++i )
if( X[i] != AB[i] )
{
printf("Computed SPMV result seems wrong. Terminating.\n");
goto err;
}
printf("Correctly performed a SPMV.\n");
{
goto err;
}
printf("Correctly freed the matrix.\n");
{
goto err;
}
printf("Correctly finalized the library.\n");
printf("Program terminating with no error.\n");
return EXIT_SUCCESS;
err:
printf("Program terminating with error.\n");
return EXIT_FAILURE;
#endif
}