FLA_Chol_u_unb_var3.c File Reference

(r)


Functions

FLA_Error FLA_Chol_u_unb_var3 (FLA_Obj A)

Function Documentation

FLA_Error FLA_Chol_u_unb_var3 ( FLA_Obj  A  ) 

References FLA_Cont_with_3x3_to_2x2(), FLA_Herc_external(), FLA_Inv_scal_external(), FLA_MINUS_ONE, FLA_Obj_is_real(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), FLA_Sqrt(), and FLA_Syr_external().

00038 {
00039   FLA_Obj ATL,   ATR,      A00,  a01,     A02,
00040           ABL,   ABR,      a10t, alpha11, a12t,
00041                            A20,  a21,     A22;
00042 
00043   int value = 0;
00044 
00045   FLA_Part_2x2( A,    &ATL, &ATR,
00046                       &ABL, &ABR,     0, 0, FLA_TL );
00047 
00048   while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){
00049 
00050     FLA_Repart_2x2_to_3x3( ATL, /**/ ATR,       &A00,  /**/ &a01,     &A02,
00051                         /* ************* */   /* ************************** */
00052                                                 &a10t, /**/ &alpha11, &a12t,
00053                            ABL, /**/ ABR,       &A20,  /**/ &a21,     &A22,
00054                            1, 1, FLA_BR );
00055 
00056     /*------------------------------------------------------------*/
00057 
00058     if ( FLA_Obj_is_real( A ) )
00059     {
00060       /* alpha11 = sqrt( alpha11 ); */
00061       value = FLA_Sqrt( alpha11 );
00062   
00063       if ( value != FLA_SUCCESS )
00064         return ( FLA_Obj_length( A00 ) + 1 );
00065 
00066       /* a12t = a12t / alpha11; */
00067       FLA_Inv_scal_external( alpha11, a12t );
00068 
00069       /* A22 = A22 - a12t' * a12t; */
00070       FLA_Syr_external( FLA_UPPER_TRIANGULAR, FLA_MINUS_ONE, a12t, A22 );
00071     }
00072     else
00073     {
00074       /* alpha11 = sqrt( alpha11 ); */
00075       value = FLA_Sqrt( alpha11 );
00076   
00077       if ( value != FLA_SUCCESS )
00078         return ( FLA_Obj_length( A00 ) + 1 );
00079 
00080       /* a12t = a12t / alpha11; */
00081       FLA_Inv_scal_external( alpha11, a12t );
00082 
00083       /* A22 = A22 - a12t' * a12t; */
00084       FLA_Herc_external( FLA_UPPER_TRIANGULAR, FLA_CONJUGATE, FLA_MINUS_ONE, a12t, A22 );
00085     }
00086 
00087     /*------------------------------------------------------------*/
00088 
00089     FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR,       A00,  a01,     /**/ A02,
00090                                                      a10t, alpha11, /**/ a12t,
00091                             /* ************** */  /* ************************ */
00092                               &ABL, /**/ &ABR,       A20,  a21,     /**/ A22,
00093                               FLA_TL );
00094   }
00095 
00096   return value;
00097 }


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