FLA_Shift_pivots_to.c File Reference

(r)


Functions

FLA_Error FLA_Shift_pivots_to (FLA_Pivot_type ptype, FLA_Obj ipiv)
void FLA_F2C() fla_shift_pivots_to_f (F_INT *ptype, F_INT *ipiv, F_INT *IERROR)

Function Documentation

FLA_Error FLA_Shift_pivots_to ( FLA_Pivot_type  ptype,
FLA_Obj  ipiv 
)

References FLA_Check_error_level(), FLA_Obj_length(), FLA_Obj_width(), and FLA_Shift_pivots_to_check().

Referenced by FLA_LU_piv_blk_external(), FLA_LU_piv_unb_external(), and fla_shift_pivots_to_f().

00036 {
00037   int          m_ipiv, n_ipiv;
00038   int*         buff_ipiv;
00039   int          i;
00040 
00041   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
00042     FLA_Shift_pivots_to_check( ptype, ipiv );
00043 
00044   m_ipiv    = FLA_Obj_length( ipiv );
00045   n_ipiv    = FLA_Obj_width( ipiv );
00046   buff_ipiv = FLA_INT_PTR( ipiv );
00047 
00048   if ( m_ipiv < 1 || n_ipiv < 1 ) return FLA_SUCCESS;
00049 
00050   if ( ptype == FLA_LAPACK_PIVOTS )
00051   {
00052     // Shift FLAME pivots to LAPACK pivots.
00053     for ( i = 0; i < m_ipiv; i++ )
00054       buff_ipiv[ i ] += i + 1;
00055   }
00056   else
00057   {
00058     // Otherwise, shift LAPACK pivots back to FLAME.
00059     for ( i = 0; i < m_ipiv; i++ )
00060       buff_ipiv[ i ] -= i + 1;
00061   }
00062 
00063   return FLA_SUCCESS;
00064 }

void FLA_F2C() fla_shift_pivots_to_f ( F_INT *  ptype,
F_INT *  ipiv,
F_INT *  IERROR 
)

References FLA_Shift_pivots_to().

00068 {
00069   *IERROR = FLA_Shift_pivots_to( *( ( FLA_Pivot_type * ) ptype ),
00070                                  *( ( FLA_Obj        * ) ipiv  ) );
00071 }


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