libflame  revision_anchor
Functions
FLA_Apply_QUD_UT_inc.h File Reference

(r)

Go to the source code of this file.

Functions

FLA_Error FLASH_Apply_QUD_UT_inc (FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj T, FLA_Obj W, FLA_Obj R, FLA_Obj U, FLA_Obj C, FLA_Obj V, FLA_Obj D)
FLA_Error FLA_Apply_QUD_UT_inc_internal (FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj T, FLA_Obj W, FLA_Obj R, FLA_Obj U, FLA_Obj C, FLA_Obj V, FLA_Obj D, fla_apqudutinc_t *cntl)
FLA_Error FLA_Apply_QUD_UT_inc_lhfc (FLA_Obj T, FLA_Obj W, FLA_Obj R, FLA_Obj U, FLA_Obj C, FLA_Obj V, FLA_Obj D, fla_apqudutinc_t *cntl)
FLA_Error FLASH_Apply_QUD_UT_inc_create_workspace (FLA_Obj T, FLA_Obj R, FLA_Obj *W)

Function Documentation

FLA_Error FLA_Apply_QUD_UT_inc_internal ( FLA_Side  side,
FLA_Trans  trans,
FLA_Direct  direct,
FLA_Store  storev,
FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  R,
FLA_Obj  U,
FLA_Obj  C,
FLA_Obj  V,
FLA_Obj  D,
fla_apqudutinc_t cntl 
)

References FLA_Apply_QUD_UT_inc_internal_check(), FLA_Apply_QUD_UT_inc_lhfc(), and FLA_Check_error_level().

Referenced by FLASH_Apply_QUD_UT_inc().

{
    FLA_Error r_val = FLA_SUCCESS;

    if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
        FLA_Apply_QUD_UT_inc_internal_check( side, trans, direct, storev, T, W, R, U, C, V, D, cntl );

    if      ( side == FLA_LEFT )
    {
        if      ( trans == FLA_NO_TRANSPOSE )
        {
            if      ( direct == FLA_FORWARD )
            {
                if      ( storev == FLA_COLUMNWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                else if ( storev == FLA_ROWWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
            }
            else if ( direct == FLA_BACKWARD )
            {
                if      ( storev == FLA_COLUMNWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                else if ( storev == FLA_ROWWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
            }
        }
        else if ( trans == FLA_TRANSPOSE || trans == FLA_CONJ_TRANSPOSE )
        {
            if      ( direct == FLA_FORWARD )
            {
                if      ( storev == FLA_COLUMNWISE )
                    r_val = FLA_Apply_QUD_UT_inc_lhfc( T, W, R, U, C, V, D, cntl );
                else if ( storev == FLA_ROWWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
            }
            else if ( direct == FLA_BACKWARD )
            {
                if      ( storev == FLA_COLUMNWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                else if ( storev == FLA_ROWWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
            }
        }
    }
    else if ( side == FLA_RIGHT )
    {
        if      ( trans == FLA_NO_TRANSPOSE )
        {
            if      ( direct == FLA_FORWARD )
            {
                if      ( storev == FLA_COLUMNWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                else if ( storev == FLA_ROWWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
            }
            else if ( direct == FLA_BACKWARD )
            {
                if      ( storev == FLA_COLUMNWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                else if ( storev == FLA_ROWWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
            }
        }
        else if ( trans == FLA_TRANSPOSE || trans == FLA_CONJ_TRANSPOSE )
        {
            if      ( direct == FLA_FORWARD )
            {
                if      ( storev == FLA_COLUMNWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                else if ( storev == FLA_ROWWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
            }
            else if ( direct == FLA_BACKWARD )
            {
                if      ( storev == FLA_COLUMNWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
                else if ( storev == FLA_ROWWISE )
                    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
            }
        }
    }

    return r_val;
}

References FLA_Apply_QUD_UT_inc_lhfc_blk_var1().

Referenced by FLA_Apply_QUD_UT_inc_internal().

{
    return FLA_Apply_QUD_UT_inc_lhfc_blk_var1( T, W, R, U, C, V, D, cntl );
}
FLA_Error FLASH_Apply_QUD_UT_inc ( FLA_Side  side,
FLA_Trans  trans,
FLA_Direct  direct,
FLA_Store  storev,
FLA_Obj  T,
FLA_Obj  W,
FLA_Obj  R,
FLA_Obj  U,
FLA_Obj  C,
FLA_Obj  V,
FLA_Obj  D 
)

References FLA_Apply_QUD_UT_inc_check(), FLA_Apply_QUD_UT_inc_internal(), FLA_Check_error_level(), FLASH_Queue_begin(), and FLASH_Queue_end().

Referenced by FLASH_UDdate_UT_inc_update_rhs().

{
  FLA_Error r_val;

  // Check parameters.
  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
    FLA_Apply_QUD_UT_inc_check( side, trans, direct, storev, T, W, R, U, C, V, D );

  // Begin a parallel region.
  FLASH_Queue_begin();
  
  // Invoke _internal() back-end with the standard control tree.
  r_val = FLA_Apply_QUD_UT_inc_internal( side, trans, direct, storev,
                                         T, W, R, U, C, V, D, flash_apqudutinc_cntl );

  // End the parallel region.
  FLASH_Queue_end();

  return r_val;
}

References FLA_Abort(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_width(), FLA_Print_message(), FLASH_Obj_create_ext(), FLASH_Obj_depth(), FLASH_Obj_scalar_length_tl(), and FLASH_Obj_scalar_width_tl().

Referenced by FLASH_UDdate_UT_inc_update_rhs().

{
    FLA_Datatype datatype;
    dim_t        depth;
    dim_t        b_alg;
    dim_t        b_flash;
    dim_t        m, n;

    // Query the depth.
    depth = FLASH_Obj_depth( T );

    // *** The current Apply_QUD_UT_inc algorithm implemented assumes that
    // the matrix has a hierarchical depth of 1. We check for that here
    // because we anticipate that we'll use a more general algorithm in the
    // future, and we don't want to forget to remove the constraint. ***
    if ( depth != 1 )
    {
       FLA_Print_message( "FLASH_Apply_QUD_UT_inc() currently only supports matrices of depth 1",
                          __FILE__, __LINE__ );
       FLA_Abort();
    }

    // Query the datatype of matrix T.
    datatype = FLA_Obj_datatype( T );

    // Inspect the length of a the top-left element of T to get the
    // algorithmic blocksize we'll use throughout the Apply_QUD_UT_inc
    // algorithm.
    b_alg = FLASH_Obj_scalar_length_tl( T );

    // The width of the top-left element gives us the storage blocksize.
    b_flash = FLASH_Obj_scalar_width_tl( T );

    // Determine the element (not scalar) dimensions of the new hierarchical
    // matrix W. By using the element dimensions, we will probably allocate
    // more storage than we actually need (at the bottom and right edge cases)
    // but this is simpler than computing the exact amount and the excess
    // storage is usually small in practice.
    m = FLA_Obj_length( R );
    n = FLA_Obj_width( R );

    // Create hierarchical matrix W, with element dimensions conformal to R,
    // where each block is b_alg-by-b_flash.
    FLASH_Obj_create_ext( datatype, m * b_alg, n * b_flash, 
                          depth, &b_alg, &b_flash, 
                          W );
   
    return FLA_SUCCESS;
}