|
libflame
revision_anchor
|
Go to the source code of this file.
Functions | |
| FLA_Error | FLA_QR_UT_piv (FLA_Obj A, FLA_Obj T, FLA_Obj w, FLA_Obj p) |
| FLA_Error | FLA_QR_UT_piv_internal (FLA_Obj A, FLA_Obj T, FLA_Obj w, FLA_Obj p, fla_qrut_t *cntl) |
| FLA_Error | FLA_QR_UT_piv_colnorm (FLA_Obj alpha, FLA_Obj A, FLA_Obj b) |
| FLA_Error | FLA_QR_UT_piv_check (FLA_Obj A, FLA_Obj T, FLA_Obj w, FLA_Obj p) |
| FLA_Error | FLA_QR_UT_piv_internal_check (FLA_Obj A, FLA_Obj T, FLA_Obj w, FLA_Obj p, fla_qrut_t *cntl) |
| FLA_Error | FLA_QR_UT_piv_colnorm_check (FLA_Obj alpha, FLA_Obj A, FLA_Obj b) |
References FLA_Check_error_level(), FLA_ONE, FLA_QR_UT_piv_check(), FLA_QR_UT_piv_colnorm(), FLA_QR_UT_piv_internal(), FLA_Set(), and FLA_ZERO.
{
FLA_Error r_val;
// Check parameters.
if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
FLA_QR_UT_piv_check( A, T, w, p );
FLA_Set( FLA_ZERO, w );
FLA_QR_UT_piv_colnorm( FLA_ONE, A, w );
r_val = FLA_QR_UT_piv_internal( A, T, w, p, fla_qrut_piv_cntl_leaf );
return r_val;
}
References FLA_Check_floating_object(), FLA_Check_identical_object_datatype(), FLA_Check_identical_object_precision(), FLA_Check_int_object(), FLA_Check_nonconstant_object(), FLA_Check_object_length_equals(), FLA_Check_object_width_equals(), and FLA_Obj_width().
Referenced by FLA_QR_UT_piv().
{
FLA_Error e_val;
e_val = FLA_Check_floating_object( A );
FLA_Check_error_code( e_val );
e_val = FLA_Check_nonconstant_object( A );
FLA_Check_error_code( e_val );
e_val = FLA_Check_identical_object_datatype( A, T );
FLA_Check_error_code( e_val );
e_val = FLA_Check_object_width_equals( T, FLA_Obj_width( A ) );
FLA_Check_error_code( e_val );
e_val = FLA_Check_identical_object_precision( A, w );
FLA_Check_error_code( e_val );
e_val = FLA_Check_object_length_equals( w, FLA_Obj_width( A ) );
FLA_Check_error_code( e_val );
e_val = FLA_Check_int_object( p );
FLA_Check_error_code( e_val );
e_val = FLA_Check_object_length_equals( p, FLA_Obj_width( A ) );
FLA_Check_error_code( e_val );
return FLA_SUCCESS;
}
| FLA_Error FLA_QR_UT_piv_colnorm | ( | FLA_Obj | alpha, |
| FLA_Obj | A, | ||
| FLA_Obj | b | ||
| ) |
References FLA_Axpy(), FLA_Check_error_level(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Dot(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_extract_real_part(), FLA_Obj_free(), FLA_Obj_width(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_QR_UT_piv_colnorm_check(), FLA_Repart_1x2_to_1x3(), and FLA_Repart_2x1_to_3x1().
Referenced by FLA_QR_UT_piv(), FLA_QR_UT_piv_unb_var1(), and FLA_QR_UT_piv_unb_var2().
{
FLA_Obj AL, AR, A0, a1, A2;
FLA_Obj bT, b0,
bB, beta1,
b2;
FLA_Obj val2_a1, val2_a1_real;
// A and b has matching dimensions.
if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
FLA_QR_UT_piv_colnorm_check( alpha, A, b );
FLA_Obj_create( FLA_Obj_datatype( A ), 1, 1, 0, 0, &val2_a1 );
FLA_Obj_create( FLA_Obj_datatype( b ), 1, 1, 0, 0, &val2_a1_real );
FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT );
FLA_Part_2x1( b, &bT,
&bB, 0, FLA_TOP );
while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &a1, &A2,
1, FLA_RIGHT );
FLA_Repart_2x1_to_3x1( bT, &b0,
/* ** */ /* ** */
&beta1,
bB, &b2, 1, FLA_BOTTOM );
/*------------------------------------------------------------*/
// Using dot product is a bit dangerous when a1 is close to
// under/over flow limits.
// The matrix should be properly scaled before using QR_UT_piv.
FLA_Dot( a1, a1, val2_a1 );
FLA_Obj_extract_real_part( val2_a1, val2_a1_real );
FLA_Axpy( alpha, val2_a1_real, beta1 );
/*------------------------------------------------------------*/
FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, a1, /**/ A2,
FLA_LEFT );
FLA_Cont_with_3x1_to_2x1( &bT, b0,
beta1,
/* ** */ /* ** */
&bB, b2, FLA_TOP );
}
FLA_Obj_free( &val2_a1 );
FLA_Obj_free( &val2_a1_real );
return FLA_SUCCESS;
}
| FLA_Error FLA_QR_UT_piv_colnorm_check | ( | FLA_Obj | alpha, |
| FLA_Obj | A, | ||
| FLA_Obj | b | ||
| ) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), FLA_Check_object_length_equals(), and FLA_Obj_width().
Referenced by FLA_QR_UT_piv_colnorm().
{
FLA_Error e_val;
e_val = FLA_Check_if_scalar( alpha );
FLA_Check_error_code( e_val );
e_val = FLA_Check_floating_object( A );
FLA_Check_error_code( e_val );
e_val = FLA_Check_nonconstant_object( A );
FLA_Check_error_code( e_val );
e_val = FLA_Check_identical_object_precision( A, b );
FLA_Check_error_code( e_val );
e_val = FLA_Check_object_length_equals( b, FLA_Obj_width( A ) );
FLA_Check_error_code( e_val );
return FLA_SUCCESS;
}
| FLA_Error FLA_QR_UT_piv_internal | ( | FLA_Obj | A, |
| FLA_Obj | T, | ||
| FLA_Obj | w, | ||
| FLA_Obj | p, | ||
| fla_qrut_t * | cntl | ||
| ) |
References FLA_Check_error_level(), FLA_QR_UT_piv_blk_var1(), FLA_QR_UT_piv_blk_var2(), FLA_QR_UT_piv_internal_check(), FLA_QR_UT_piv_unb_var1(), and FLA_QR_UT_piv_unb_var2().
Referenced by FLA_QR_UT_piv(), FLA_QR_UT_piv_blk_var1(), and FLA_QR_UT_piv_blk_var2().
{
FLA_Error r_val = FLA_SUCCESS;
if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
FLA_QR_UT_piv_internal_check( A, T, w, p, cntl );
// Blocked blas2 oriented version
// ------------ Variant 1 set -------------
if ( FLA_Cntl_variant( cntl ) == FLA_UNBLOCKED_VARIANT1 )
{
r_val = FLA_QR_UT_piv_unb_var1( A, T, w, p );
}
else if ( FLA_Cntl_variant( cntl ) == FLA_UNB_OPT_VARIANT1 )
{
//r_val = FLA_QR_UT_piv_opt_var1( A, T );
FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
}
else if ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT1 )
{
r_val = FLA_QR_UT_piv_blk_var1( A, T, w, p, cntl );
}
// ----------------------------------------
// ------------ Variant 2 set -------------
else if ( FLA_Cntl_variant( cntl ) == FLA_UNBLOCKED_VARIANT2 )
{
r_val = FLA_QR_UT_piv_unb_var2( A, T, w, p );
}
else if ( FLA_Cntl_variant( cntl ) == FLA_UNB_OPT_VARIANT2 )
{
//r_val = FLA_QR_UT_opt_var2( A, T );
FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
}
else if ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT2 )
{
r_val = FLA_QR_UT_piv_blk_var2( A, T, w, p, cntl );
}
// ----------------------------------------
else
{
FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
}
return r_val;
}
| FLA_Error FLA_QR_UT_piv_internal_check | ( | FLA_Obj | A, |
| FLA_Obj | T, | ||
| FLA_Obj | w, | ||
| FLA_Obj | p, | ||
| fla_qrut_t * | cntl | ||
| ) |
References FLA_Check_identical_object_elemtype(), and FLA_Check_null_pointer().
Referenced by FLA_QR_UT_piv_internal().
{
FLA_Error e_val;
// Abort if the control structure is NULL.
e_val = FLA_Check_null_pointer( ( void* ) cntl );
FLA_Check_error_code( e_val );
// Verify that the object element types are identical.
e_val = FLA_Check_identical_object_elemtype( A, T );
FLA_Check_error_code( e_val );
return FLA_SUCCESS;
}
1.7.6.1