FLA_Absolute_square.c File Reference

(r)


Functions

FLA_Error FLA_Absolute_square (FLA_Obj alpha)
void FLA_F2C() fla_absolute_square_f (F_INT *alpha, F_INT *IERROR)

Function Documentation

FLA_Error FLA_Absolute_square ( FLA_Obj  alpha  ) 

References FLA_Absolute_square_check(), FLA_Check_error_level(), FLA_Obj_datatype(), dcomplex::imag, scomplex::imag, dcomplex::real, and scomplex::real.

Referenced by fla_absolute_square_f(), FLA_Ttmm_l_unb_var1(), FLA_Ttmm_l_unb_var2(), FLA_Ttmm_l_unb_var3(), FLA_Ttmm_u_unb_var1(), FLA_Ttmm_u_unb_var2(), and FLA_Ttmm_u_unb_var3().

00036 {
00037   FLA_Datatype datatype;
00038 
00039   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
00040     FLA_Absolute_square_check( alpha );
00041 
00042   datatype = FLA_Obj_datatype( alpha );
00043   
00044   switch ( datatype ){
00045 
00046   case FLA_FLOAT:
00047   {
00048     float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
00049 
00050     *buff_alpha = (*buff_alpha) * (*buff_alpha);
00051 
00052     break;
00053   }
00054 
00055   case FLA_DOUBLE:
00056   {
00057     double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
00058 
00059     *buff_alpha = (*buff_alpha) * (*buff_alpha);
00060 
00061     break;
00062   }
00063 
00064   case FLA_COMPLEX:
00065   {
00066     scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
00067 
00068     buff_alpha->real = buff_alpha->real * buff_alpha->real + 
00069                        buff_alpha->imag * buff_alpha->imag; 
00070     buff_alpha->imag = 0.0F; 
00071 
00072     break;
00073   }
00074 
00075   case FLA_DOUBLE_COMPLEX:
00076   {
00077     dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
00078 
00079     buff_alpha->real = buff_alpha->real * buff_alpha->real + 
00080                        buff_alpha->imag * buff_alpha->imag; 
00081     buff_alpha->imag = 0.0; 
00082 
00083     break;
00084   }
00085 
00086   }
00087 
00088   return FLA_SUCCESS;
00089 }

void FLA_F2C() fla_absolute_square_f ( F_INT *  alpha,
F_INT *  IERROR 
)

References FLA_Absolute_square().

00093 {
00094   *IERROR = FLA_Absolute_square( *( ( FLA_Obj * ) alpha ) );
00095 }


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