52 struct z_solver solver;
53 Clock t0, t3, refine_clk;
55 pastix_complex64_t *x = (pastix_complex64_t*)(xp->
b);
56 pastix_complex64_t *b = (pastix_complex64_t*)(bp->
b);
57 pastix_complex64_t *r, *dx;
59 double eps, normb, normr;
60 double berr, last_berr;
64 memset( &solver, 0,
sizeof(
struct z_solver) );
67 if ( !(pastix_data->
steps & STEP_NUMFACT) ) {
68 fprintf(stderr,
"pastix_task_refine: Simple refinement cannot be applied without preconditionner\n" );
72 n = pastix_data->
bcsc->n;
78 fprintf(stdout, OUT_ITERREFINE_PIVOT);
80 r = (pastix_complex64_t *)solver.malloc(n *
sizeof(pastix_complex64_t));
81 dx = (pastix_complex64_t *)solver.malloc(n *
sizeof(pastix_complex64_t));
83 clockInit(refine_clk);
84 clockStart(refine_clk);
86 normb = solver.norm( pastix_data, n, b );
101 solver.copy( pastix_data, n, b, r );
110 normr = solver.norm( pastix_data, n, r );
111 berr = normr / normb;
115 last_berr = 3 * berr;
120 ( pastix_data->
procnum == 0 ) ) {
121 solver.output_oneiter( t0, t3, berr, iter );
126 if ( (iter < itermax) &&
128 (berr <= (last_berr / 2.)) )
133 solver.copy( pastix_data, n, r, dx );
134 solver.spsv( pastix_data, dx, sb );
137 solver.axpy( pastix_data, n, 1.0, dx, x );
148 clockStop(refine_clk);
150 solver.output_final( pastix_data, berr, iter, refine_clk, x, x );
BEGIN_C_DECLS typedef int pastix_int_t
float _Complex pastix_complex32_t
@ DPARM_EPSILON_REFINEMENT
void z_refine_init(struct z_solver *, pastix_data_t *)
Initiate functions pointers to define basic operations.
pastix_int_t z_pivot_smp(pastix_data_t *pastix_data, pastix_rhs_t xp, pastix_rhs_t bp)
Main PaStiX data structure.
Main PaStiX RHS structure.