45 if ( B_ptr == NULL ) {
46 pastix_print_error(
"pastixRhsInit: wrong B parameter" );
89 pastix_print_error(
"pastixRhsFinalize: wrong B parameter" );
98 pastix_print_warning(
"Calling pastixRhsFinalize before restoring the ordering of vector b.\n"
100 " pastix_subtask_applyorder( pastix_data, flttype, PastixDirBackward, m, n,\n"
102 "prior to this call to restore it.\n" );
106 if ( B->
cblkb != NULL ) {
107 memFree_null( B->
cblkb );
153 if ( ( dB->
flttype != PastixComplex64 ) &&
154 ( dB->
flttype != PastixDouble ) )
156 pastix_print_error(
"bvecDoubletoSingle: Invalid float type for mixed-precision" );
161 size_t size = dB->
ld * dB->
n;
167 sB->
b = malloc( size * pastix_size_of( sB->
flttype ) );
173 assert( sB->
b != NULL );
174 assert( sB->
m == dB->
m );
175 assert( sB->
n == dB->
n );
178 case PastixComplex64:
179 rc = LAPACKE_zlag2c_work( LAPACK_COL_MAJOR, dB->
m, dB->
n, dB->
b, dB->
ld, sB->
b, sB->
ld );
182 rc = LAPACKE_dlag2s_work( LAPACK_COL_MAJOR, dB->
m, dB->
n, dB->
b, dB->
ld, sB->
b, sB->
ld );
186 pastix_print_error(
"bvecDoubletoSingle: Invalid input float type for mixed-precision" );
233 if ( ( sB->
flttype != PastixComplex32 ) &&
234 ( sB->
flttype != PastixFloat ) )
236 pastix_print_error(
"bvecSingleToDouble: Invalid input float type for mixed-precision" );
241 size_t size = sB->
ld * sB->
n;
247 dB->
b = malloc( size * pastix_size_of( dB->
flttype ) );
253 assert( dB->
b != NULL );
254 assert( dB->
m == sB->
m );
255 assert( dB->
n == sB->
n );
258 case PastixComplex32:
259 rc = LAPACKE_clag2z_work( LAPACK_COL_MAJOR, sB->
m, sB->
n, sB->
b, sB->
ld, dB->
b, dB->
ld );
262 rc = LAPACKE_slag2d_work( LAPACK_COL_MAJOR, sB->
m, sB->
n, sB->
b, sB->
ld, dB->
b, dB->
ld );
266 pastix_print_error(
"bvecSingleToDouble: Invalid float type for mixed-precision" );
int pastixRhsInit(pastix_rhs_t *B_ptr)
Initialize an RHS data structure.
int pastixRhsFinalize(pastix_rhs_t B)
Cleanup an RHS data structure.
@ PASTIX_ERR_BADPARAMETER
int pastixRhsDoubletoSingle(const pastix_rhs_t dB, pastix_rhs_t sB)
Reduces the precision of an RHS.
int pastixRhsSingleToDouble(const pastix_rhs_t sB, pastix_rhs_t dB)
Increases the precision of an RHS.
pastix_int_t * Ploc2Pglob
bvec_handle_comm_t * rhs_comm
pastix_coeftype_t flttype
Main PaStiX RHS structure.