FLA_LU_incpiv.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLASH_LU_incpiv_create_hier_matrices (FLA_Obj A_flat, dim_t depth, dim_t *b_flash, dim_t b_alg, FLA_Obj *A, FLA_Obj *p, FLA_Obj *L)
dim_t FLASH_LU_incpiv_determine_alg_blocksize (FLA_Obj A)


Function Documentation

FLA_Error FLASH_LU_incpiv_create_hier_matrices ( FLA_Obj  A_flat,
dim_t  depth,
dim_t b_flash,
dim_t  b_alg,
FLA_Obj A,
FLA_Obj p,
FLA_Obj L 
)

References FLA_Abort(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_width(), FLA_Print_message(), FLASH_LU_incpiv_determine_alg_blocksize(), FLASH_Obj_create_ext(), and FLASH_Obj_create_hier_copy_of_flat().

00036 {
00037    FLA_Datatype datatype;
00038    dim_t        m, n;
00039    dim_t        one = 1;
00040    
00041    // *** The current LU_incpiv algorithm implemented assumes that
00042    // the matrix has a hierarchical depth of 1. We check for that here, because
00043    // we anticipate that we'll use a more general algorithm in the future, and
00044    // we don't want to forget to remove the constraint. ***
00045    if ( depth != 1 )
00046    {
00047       FLA_Print_message( "FLASH_LU_incpiv() currently only supports matrices of depth 1",
00048                          __FILE__, __LINE__ );
00049       FLA_Abort();
00050    }
00051 
00052    // Create hierarchical copy of matrix A_flat.
00053    FLASH_Obj_create_hier_copy_of_flat( A_flat, depth, b_flash, A );
00054 
00055    // Query the datatype of matrix A_flat.
00056    datatype = FLA_Obj_datatype( A_flat );
00057    
00058    // If the user passed in zero for b_alg, then we need to set the algorithmic
00059    // (inner) blocksize to a reasonable default value.
00060    if ( b_alg == 0 )
00061    {
00062       b_alg = FLASH_LU_incpiv_determine_alg_blocksize( *A );
00063    }
00064 
00065    // Query the element (not scalar) dimensions of the new hierarchical matrix.
00066    // This is done so we can create p and L with full blocks for the bottom
00067    // and right "edge cases" of A.
00068    m = FLA_Obj_length( *A );
00069    n = FLA_Obj_width ( *A );
00070 
00071    // Create hierarchical matrices p and L.
00072    FLASH_Obj_create_ext( FLA_INT,  m * b_flash[0], n, 
00073                          depth, b_flash, &one, 
00074                          p );
00075    
00076    FLASH_Obj_create_ext( datatype, m * b_flash[0], n * b_alg, 
00077                          depth, b_flash, &b_alg, 
00078                          L );
00079       
00080    return FLA_SUCCESS;
00081 }

dim_t FLASH_LU_incpiv_determine_alg_blocksize ( FLA_Obj  A  ) 

References FLA_Obj_length().

Referenced by FLASH_LU_incpiv_create_hier_matrices().

00085 {
00086    dim_t nb_alg;
00087    dim_t nb_flash;
00088 
00089    // Acquire the storage blocksize.
00090    nb_flash = FLA_Obj_length( *FLASH_OBJ_PTR_AT( A ) );
00091 
00092    // Scale the storage blocksize by a pre-defined scalar to arrive at a
00093    // reasonable algorithmic blocksize, but make sure it's at least 1.
00094    nb_alg = max( nb_flash * FLA_LU_INNER_TO_OUTER_B_RATIO, 1 );
00095 
00096    return nb_alg;
00097 }


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