FLA_QR_UT.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLA_QR_UT (FLA_Obj A, FLA_Obj T)
FLA_Error FLA_QR_UT_internal (FLA_Obj A, FLA_Obj T, fla_qrut_t *cntl)
FLA_Error FLA_QR_UT_copy_internal (FLA_Obj A, FLA_Obj T, FLA_Obj U, fla_qrut_t *cntl)
FLA_Error FLA_QR_UT_create_T (FLA_Obj A, FLA_Obj *T)
FLA_Error FLA_QR_UT_recover_tau (FLA_Obj T, FLA_Obj tau)


Function Documentation

FLA_Error FLA_QR_UT ( FLA_Obj  A,
FLA_Obj  T 
)

References FLA_Blocksize_set(), FLA_Check_error_level(), FLA_Obj_length(), FLA_QR_UT_check(), and FLA_QR_UT_internal().

00038 {
00039   FLA_Error r_val;
00040   dim_t     nb_alg;
00041   //dim_t     nb_alg_mid;
00042 
00043   // Check parameters.
00044   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
00045     FLA_QR_UT_check( A, T );
00046 
00047   // Inspect the length of T to get the implied outer blocksize.
00048   nb_alg     = FLA_Obj_length( T );
00049 
00050   // Scale the outer blocksize to get the inner blocksize.
00051   //nb_alg_mid = max( nb_alg * FLA_QR_INNER_TO_OUTER_B_RATIO, 1 );
00052 
00053   // Adjust the blocksizes in the control trees.
00054   FLA_Blocksize_set( FLA_Cntl_blocksize( fla_qrut_cntl_leaf ),
00055                      nb_alg, nb_alg, nb_alg, nb_alg );
00056   //FLA_Blocksize_set( FLA_Cntl_blocksize( fla_qrut_cntl2 ),
00057   //                   nb_alg, nb_alg, nb_alg, nb_alg );
00058   //FLA_Blocksize_set( FLA_Cntl_blocksize( fla_qrut_cntl2_mid ),
00059   //                   nb_alg_mid, nb_alg_mid, nb_alg_mid, nb_alg_mid );
00060 
00061   // Invoke FLA_QR_UT_internal() with the standard control tree.
00062   //r_val = FLA_QR_UT_internal( A, T, fla_qrut_cntl2 );
00063   r_val = FLA_QR_UT_internal( A, T, fla_qrut_cntl_leaf );
00064 
00065   return r_val;
00066 }

FLA_Error FLA_QR_UT_copy_internal ( FLA_Obj  A,
FLA_Obj  T,
FLA_Obj  U,
fla_qrut_t cntl 
)

References FLA_Check_error_level(), FLA_QR_UT_copy_internal_check(), FLA_QR_UT_copy_task(), and FLASH_Queue_get_enabled().

Referenced by FLA_QR_UT_inc_blk_var2().

00036 {
00037     FLA_Error r_val = FLA_SUCCESS;
00038     
00039     if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
00040         FLA_QR_UT_copy_internal_check( A, T, U, cntl );
00041 
00042     if ( FLASH_Queue_get_enabled() )
00043     {
00044         // Enqueue task.
00045         ENQUEUE_FLASH_QR_UT_copy( *FLASH_OBJ_PTR_AT( A ),
00046                                   *FLASH_OBJ_PTR_AT( T ),
00047                                   *FLASH_OBJ_PTR_AT( U ),
00048                                   NULL );
00049     }
00050     else
00051     {
00052         // Execute task immediately.
00053         FLA_QR_UT_copy_task( *FLASH_OBJ_PTR_AT( A ),
00054                              *FLASH_OBJ_PTR_AT( T ),
00055                              *FLASH_OBJ_PTR_AT( U ),
00056                              NULL );
00057     }
00058 
00059     return r_val;
00060 }

FLA_Error FLA_QR_UT_create_T ( FLA_Obj  A,
FLA_Obj T 
)

References FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_width(), and FLA_Query_blocksize().

Referenced by fla_qr_ut_create_t_f().

00036 {
00037   FLA_Datatype datatype;
00038   dim_t        b, n;
00039 
00040   // Query the datatype of A.
00041   datatype = FLA_Obj_datatype( A );
00042 
00043   // Query the blocksize from the library.
00044   b = FLA_Query_blocksize( datatype, FLA_DIMENSION_MIN );
00045 
00046   // Query the width of A.
00047   n = FLA_Obj_width( A );
00048 
00049   // Create a b x n matrix to hold the block Householder transforms that will be
00050   // accumulated within the QR factorization algorithm.
00051   FLA_Obj_create( datatype, b, n, T );
00052 
00053   return FLA_SUCCESS;
00054 }

FLA_Error FLA_QR_UT_internal ( FLA_Obj  A,
FLA_Obj  T,
fla_qrut_t cntl 
)

References FLA_Check_error_level(), FLA_Obj_elemtype(), FLA_QR_UT_Accum_T_blk_var1(), FLA_QR_UT_Accum_T_opt_var1(), FLA_QR_UT_Accum_T_unb_var1(), FLA_QR_UT_blk_var2(), FLA_QR_UT_internal(), FLA_QR_UT_internal_check(), FLA_QR_UT_task(), and FLASH_Queue_get_enabled().

00040 {
00041     FLA_Error r_val = FLA_SUCCESS;
00042     
00043     if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
00044         FLA_QR_UT_internal_check( A, T, cntl );
00045 
00046     if      ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
00047               FLA_Obj_elemtype( A ) == FLA_MATRIX &&
00048               FLA_Cntl_variant( cntl ) == FLA_SUBPROBLEM )
00049     {
00050         // Recurse
00051         r_val = FLA_QR_UT_internal( *FLASH_OBJ_PTR_AT( A ),
00052                                     *FLASH_OBJ_PTR_AT( T ),
00053                                     flash_qrut_cntl_leaf );
00054     }
00055     else if ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
00056               FLA_Obj_elemtype( A ) == FLA_SCALAR &&
00057               FLASH_Queue_get_enabled( ) )
00058     {
00059         // Enqueue
00060         ENQUEUE_FLASH_QR_UT( A, T, cntl );
00061     }
00062     else
00063     {
00064         if ( FLA_Cntl_matrix_type( cntl ) == FLA_HIER &&
00065              FLA_Obj_elemtype( A ) == FLA_SCALAR &&
00066              !FLASH_Queue_get_enabled( ) )
00067         {
00068             // Execute leaf.
00069             // NOTE: This may be redundant since we execute _internal() with
00070             // fla_qrut_cntl_leaf (in lieu of an _external() function).
00071             cntl = fla_qrut_cntl_leaf;
00072         }
00073 
00074         if      ( FLA_Cntl_variant( cntl ) == FLA_SUBPROBLEM )
00075         {
00076             r_val = FLA_QR_UT_task( A, T, fla_qrut_cntl_leaf );
00077         }
00078         else if ( FLA_Cntl_variant( cntl ) == FLA_UNBLOCKED_VARIANT1 )
00079         {
00080             r_val = FLA_QR_UT_Accum_T_unb_var1( A, T );
00081         }
00082         else if ( FLA_Cntl_variant( cntl ) == FLA_UNB_OPT_VARIANT1 )
00083         {
00084             r_val = FLA_QR_UT_Accum_T_opt_var1( A, T );
00085         }
00086         else if ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT1 )
00087         {
00088             r_val = FLA_QR_UT_Accum_T_blk_var1( A, T, cntl );
00089         }
00090         else if ( FLA_Cntl_variant( cntl ) == FLA_BLOCKED_VARIANT2 )
00091         {
00092             r_val = FLA_QR_UT_blk_var2( A, T, cntl );
00093         }
00094     }
00095 
00096     return r_val;
00097 }

FLA_Error FLA_QR_UT_recover_tau ( FLA_Obj  T,
FLA_Obj  tau 
)

References FLA_Check_error_level(), FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Obj_length(), FLA_Obj_width(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_QR_UT_recover_tau_check(), FLA_QR_UT_recover_tau_submatrix(), FLA_Repart_1x2_to_1x3(), and FLA_Repart_2x1_to_3x1().

Referenced by fla_qr_ut_recover_tau_f().

00038 {
00039   FLA_Obj TL,    TR,       T0,  T1,  T2;
00040 
00041   FLA_Obj tT,              t0,
00042           tB,              t1,
00043                            t2;
00044 
00045   dim_t b;
00046   dim_t b_alg;
00047 
00048   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
00049     FLA_QR_UT_recover_tau_check( T, t );
00050 
00051   b_alg = FLA_Obj_length( T );
00052 
00053   FLA_Part_1x2( T,    &TL,  &TR,      0, FLA_LEFT );
00054 
00055   FLA_Part_2x1( t,    &tT, 
00056                       &tB,            0, FLA_TOP );
00057 
00058   while ( FLA_Obj_width( TL ) < FLA_Obj_width( T ) ){
00059 
00060     b = min( FLA_Obj_width( TR ), b_alg );
00061 
00062     FLA_Repart_1x2_to_1x3( TL,  /**/ TR,        &T0, /**/ &T1, &T2,
00063                            b, FLA_RIGHT );
00064 
00065     FLA_Repart_2x1_to_3x1( tT,                &t0, 
00066                         /* ** */            /* ** */
00067                                               &t1, 
00068                            tB,                &t2,        b, FLA_BOTTOM );
00069 
00070     /*------------------------------------------------------------*/
00071 
00072     FLA_QR_UT_recover_tau_submatrix( T1, t1 );
00073 
00074     /*------------------------------------------------------------*/
00075 
00076     FLA_Cont_with_1x3_to_1x2( &TL,  /**/ &TR,        T0, T1, /**/ T2,
00077                               FLA_LEFT );
00078 
00079     FLA_Cont_with_3x1_to_2x1( &tT,                t0, 
00080                                                   t1, 
00081                             /* ** */           /* ** */
00082                               &tB,                t2,     FLA_TOP );
00083   }
00084 
00085   return FLA_SUCCESS;
00086 }


Generated on Mon Jul 6 05:45:56 2009 for libflame by  doxygen 1.5.9