FLA_QR_UT_UD.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLASH_QR_UT_UD (FLA_Obj U, FLA_Obj D, FLA_Obj T)
FLA_Error FLA_QR_UT_UD_internal (FLA_Obj U, FLA_Obj D, FLA_Obj T, fla_qrutud_t *cntl)


Function Documentation

FLA_Error FLA_QR_UT_UD_internal ( FLA_Obj  U,
FLA_Obj  D,
FLA_Obj  T,
fla_qrutud_t cntl 
)

References FLA_Check_error_level(), FLA_Obj_elemtype(), FLA_QR_UT_UD_Accum_T_opt_var1(), FLA_QR_UT_UD_Accum_T_unb_var1(), FLA_QR_UT_UD_blk_var1(), FLA_QR_UT_UD_blk_var2(), FLA_QR_UT_UD_internal(), FLA_QR_UT_UD_internal_check(), FLA_QR_UT_UD_task(), and FLASH_Queue_get_enabled().

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

FLA_Error FLASH_QR_UT_UD ( FLA_Obj  U,
FLA_Obj  D,
FLA_Obj  T 
)

References FLA_Blocksize_set(), FLA_Check_error_level(), FLA_Part_2x1(), FLA_QR_UT_UD_check(), FLA_QR_UT_UD_internal(), FLASH_Obj_scalar_length(), FLASH_Queue_begin(), and FLASH_Queue_end().

00040 {
00041   FLA_Error r_val;
00042   int       nb_alg_in;
00043   FLA_Obj   TT, TB;
00044 
00045   // Check parameters.
00046   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
00047     FLA_QR_UT_UD_check( B, D, T );
00048 
00049   // Inspect the length of a single row of T to get the blocksize used by
00050   // the QR/LQ factorization, which will be our inner blocksize for
00051   // QR_UT_UD.
00052   FLA_Part_2x1( T,   &TT,
00053                      &TB,   1, FLA_TOP );
00054   nb_alg_in = FLASH_Obj_scalar_length( TT );
00055 
00056   // Adjust the blocksize of the control tree node for the flat subproblem.
00057   if ( FLA_Cntl_blocksize( fla_qrutud_cntl_leaf ) != NULL )
00058     FLA_Blocksize_set( FLA_Cntl_blocksize( fla_qrutud_cntl_leaf ),
00059                        nb_alg_in, nb_alg_in, nb_alg_in, nb_alg_in );
00060 
00061   // Begin a parallel region.
00062   FLASH_Queue_begin();
00063   
00064   // Invoke FLA_QR_UT_UD_internal() with the standard control tree.
00065   r_val = FLA_QR_UT_UD_internal( B, D, T, flash_qrutud_cntl );
00066 
00067   // End the parallel region.
00068   FLASH_Queue_end();
00069 
00070   return r_val;
00071 }


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