libflame  revision_anchor
Functions
FLA_Shift_pivots_to.c File Reference

(r)

Functions

FLA_Error FLA_Shift_pivots_to (FLA_Pivot_type ptype, FLA_Obj p)
 

Function Documentation

◆ FLA_Shift_pivots_to()

FLA_Error FLA_Shift_pivots_to ( FLA_Pivot_type  ptype,
FLA_Obj  p 
)
14 {
15  int m_p, n_p;
16  int* buff_p;
17  int i;
18 
19  if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
20  FLA_Shift_pivots_to_check( ptype, p );
21 
22  m_p = FLA_Obj_length( p );
23  n_p = FLA_Obj_width( p );
24  buff_p = FLA_INT_PTR( p );
25 
26  if ( m_p < 1 || n_p < 1 ) return FLA_SUCCESS;
27 
28  if ( ptype == FLA_LAPACK_PIVOTS )
29  {
30  // Shift FLAME pivots to LAPACK pivots.
31  for ( i = 0; i < m_p; i++ )
32  buff_p[ i ] += i + 1;
33  }
34  else
35  {
36  // Otherwise, shift LAPACK pivots back to FLAME.
37  for ( i = 0; i < m_p; i++ )
38  buff_p[ i ] -= i + 1;
39  }
40 
41  return FLA_SUCCESS;
42 }
FLA_Error FLA_Shift_pivots_to_check(FLA_Pivot_type ptype, FLA_Obj p)
Definition: FLA_Shift_pivots_to_check.c:13
dim_t FLA_Obj_width(FLA_Obj obj)
Definition: FLA_Query.c:123
dim_t FLA_Obj_length(FLA_Obj obj)
Definition: FLA_Query.c:116
unsigned int FLA_Check_error_level(void)
Definition: FLA_Check.c:18
int i
Definition: bl1_axmyv2.c:145

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

Referenced by FLA_LU_piv_blk_external(), and FLA_LU_piv_unb_external().