47 #define max(x,y) (( x > y ) ? x : y)
50 double *val,
int *indx,
int *bindx,
int *rpntr,
51 int *cpntr,
int *bpntrb,
int *bpntre,
54 int i, j, jbgn, jend, ione = 1;
55 double sum, norm_tmp = 0.0, norm_b = 0.0;
56 double scaled_res_norm, res_norm, *tmp, max_norm = 0.0;
72 cblas_duscr_vbr(m_blk, val, indx, bindx, rpntr, cpntr, bpntrb, bpntre, &A);
77 tmp = (
double *) calloc(m,
sizeof(
double));
79 for (i = 0; i < m; i++) tmp[i] = b[i];
83 cblas_dusmm(m_blk, 1, n, -1.0, &A, x, m, 1.0, tmp, m);
85 for (i = 0; i <m ; i++)
87 max_norm =
max(fabs(tmp[i]),max_norm);
88 norm_tmp += tmp[i]*tmp[i];
92 res_norm = sqrt(norm_tmp);
93 scaled_res_norm = res_norm/sqrt(norm_b);
94 printf(
"\n\nMax norm of residual = %12.4g\n",max_norm);
95 printf(
"Two norm of residual = %12.4g\n",res_norm);
98 scaled_res_norm = res_norm/sqrt(norm_b);
99 printf(
"Scaled two norm of residual = %12.4g\n",scaled_res_norm);
double svbrres(int m, int n, int m_blk, double *val, int *indx, int *bindx, int *rpntr, int *cpntr, int *bpntrb, int *bpntre, double *x, double *b)