FLA_Norm1.c File Reference

(r)


Functions

FLA_Error FLA_Norm1 (FLA_Obj A, FLA_Obj norm)
void FLA_F2C() fla_norm1_f (F_INT *A, F_INT *norm, F_INT *IERROR)

Function Documentation

FLA_Error FLA_Norm1 ( FLA_Obj  A,
FLA_Obj  norm 
)

References FLA_Asum_external(), FLA_Check_error_level(), FLA_Cont_with_1x3_to_1x2(), FLA_Max_abs_value(), FLA_Norm1_check(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_width(), FLA_Part_1x2(), and FLA_Repart_1x2_to_1x3().

Referenced by fla_norm1_f(), and FLASH_Norm1().

00036 {
00037   FLA_Obj AL,   AR,       A0,  a1,  A2;
00038 
00039   FLA_Obj b;
00040   FLA_Obj bL,   bR,       b0,  beta1,  b2;
00041 
00042   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
00043     FLA_Norm1_check( A, norm );
00044 
00045   FLA_Obj_create( FLA_Obj_datatype( A ), 1, FLA_Obj_width( A ), &b );
00046 
00047   FLA_Part_1x2( A,    &AL,  &AR,      0, FLA_LEFT );
00048 
00049   FLA_Part_1x2( b,    &bL,  &bR,      0, FLA_LEFT );
00050 
00051   while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){
00052 
00053     FLA_Repart_1x2_to_1x3( AL,  /**/ AR,        &A0, /**/ &a1, &A2,
00054                            1, FLA_RIGHT );
00055 
00056     FLA_Repart_1x2_to_1x3( bL,  /**/ bR,        &b0, /**/ &beta1, &b2,
00057                            1, FLA_RIGHT );
00058 
00059     /*------------------------------------------------------------*/
00060 
00061     FLA_Asum_external( a1, beta1 );
00062 
00063     /*------------------------------------------------------------*/
00064 
00065     FLA_Cont_with_1x3_to_1x2( &AL,  /**/ &AR,        A0, a1, /**/ A2,
00066                               FLA_LEFT );
00067 
00068     FLA_Cont_with_1x3_to_1x2( &bL,  /**/ &bR,        b0, beta1, /**/ b2,
00069                               FLA_LEFT );
00070   }
00071 
00072   FLA_Max_abs_value( b, norm );
00073 
00074   FLA_Obj_free( &b );
00075 
00076   return FLA_SUCCESS;
00077 }

void FLA_F2C() fla_norm1_f ( F_INT *  A,
F_INT *  norm,
F_INT *  IERROR 
)

References FLA_Norm1().

00081 {
00082   *IERROR = FLA_Norm1( *( ( FLA_Obj * ) A    ),
00083                        *( ( FLA_Obj * ) norm ) );
00084 }


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