FLA_QR_UT_Accum_T_opt_var1.c File Reference

(r)


Functions

FLA_Error FLA_QR_UT_Accum_T_opt_var1 (FLA_Obj A, FLA_Obj T)
FLA_Error FLA_QR_UT_Accum_T_opt_var1_float (FLA_Obj A, FLA_Obj T)
FLA_Error FLA_QR_UT_Accum_T_opt_var1_double (FLA_Obj A, FLA_Obj T)
FLA_Error FLA_QR_UT_Accum_T_opt_var1_scomplex (FLA_Obj A, FLA_Obj T)
FLA_Error FLA_QR_UT_Accum_T_opt_var1_dcomplex (FLA_Obj A, FLA_Obj T)

Function Documentation

FLA_Error FLA_QR_UT_Accum_T_opt_var1 ( FLA_Obj  A,
FLA_Obj  T 
)

References FLA_Obj_datatype(), FLA_QR_UT_Accum_T_opt_var1_dcomplex(), FLA_QR_UT_Accum_T_opt_var1_double(), FLA_QR_UT_Accum_T_opt_var1_float(), and FLA_QR_UT_Accum_T_opt_var1_scomplex().

Referenced by FLA_QR_UT_internal().

00036 {
00037   FLA_Datatype datatype;
00038 
00039   datatype = FLA_Obj_datatype( A );
00040 
00041   switch ( datatype )
00042   {
00043     case FLA_FLOAT:
00044     FLA_QR_UT_Accum_T_opt_var1_float( A, T );
00045     break;
00046 
00047     case FLA_DOUBLE:
00048     FLA_QR_UT_Accum_T_opt_var1_double( A, T );
00049     break;
00050 
00051     case FLA_COMPLEX:
00052     FLA_QR_UT_Accum_T_opt_var1_scomplex( A, T );
00053     break;
00054 
00055     case FLA_DOUBLE_COMPLEX:
00056     FLA_QR_UT_Accum_T_opt_var1_dcomplex( A, T );
00057     break;
00058   }
00059 
00060   return FLA_SUCCESS;
00061 }

FLA_Error FLA_QR_UT_Accum_T_opt_var1_dcomplex ( FLA_Obj  A,
FLA_Obj  T 
)

References dscal(), FLA_Apply_househ2_UT_opt_dcomplex(), FLA_Househ2_UT_opt_dcomplex(), FLA_MINUS_ONE, FLA_Obj_ldim(), FLA_Obj_length(), FLA_Obj_width(), FLA_ONE, dcomplex::real, zcopy(), and zgemv().

Referenced by FLA_QR_UT_Accum_T_opt_var1().

00297 {
00298   dcomplex* buff_A  = FLA_DOUBLE_COMPLEX_PTR( A );
00299   dcomplex* buff_T  = FLA_DOUBLE_COMPLEX_PTR( T );
00300   dcomplex* buff_1  = FLA_DOUBLE_COMPLEX_PTR( FLA_ONE );
00301   dcomplex* buff_m1 = FLA_DOUBLE_COMPLEX_PTR( FLA_MINUS_ONE );
00302 
00303   int       m_A     = FLA_Obj_length( A );
00304   int       n_AT    = FLA_Obj_width( A );
00305   int       ldim_A  = FLA_Obj_ldim( A );
00306   int       ldim_T  = FLA_Obj_ldim( T );
00307 
00308   char      trans   = 'C';
00309   int       inc_one = 1;
00310   int       inc_two = 2;
00311   int       i;
00312 
00313   for ( i = 0; i < n_AT; ++i )
00314   {
00315     dcomplex* a10t      = buff_A + (0  )*ldim_A + i;
00316     dcomplex* A20       = buff_A + (0  )*ldim_A + i + 1;
00317     dcomplex* alpha11   = buff_A + (i  )*ldim_A + i;
00318     dcomplex* a21       = buff_A + (i  )*ldim_A + i + 1;
00319     dcomplex* a12t      = buff_A + (i+1)*ldim_A + i;
00320     dcomplex* A22       = buff_A + (i+1)*ldim_A + i + 1;
00321 
00322     dcomplex* tau11     = buff_T + (i  )*ldim_T + i;
00323     dcomplex* t01       = buff_T + (i  )*ldim_T;
00324 
00325     int       m_ahead   = m_A  - i - 1;
00326     int       n_ahead   = n_AT - i - 1;
00327     int       n_behind  = i;
00328 
00329     /*------------------------------------------------------------*/
00330 
00331     // FLA_Househ2_UT( alpha11,
00332     //                 a21, tau11 );
00333     FLA_Househ2_UT_opt_dcomplex( m_ahead,
00334                                  alpha11,
00335                                  a21, inc_one,
00336                                  tau11 );
00337 
00338     if ( i > 0 )
00339     {
00340       // FLA_Copyt_external( FLA_CONJ_TRANSPOSE, a10t, t01 );
00341       FLA_C2F( zcopy )( &n_behind,
00342                         a10t, &ldim_A,
00343                         t01,  &inc_one );
00344       FLA_C2F( dscal )( &n_behind,
00345                         &(buff_m1->real),
00346                         (( double* ) t01 ) + 1, &inc_two );
00347 
00348       // // t01 = a10t' + A20' * a21;
00349       // FLA_Gemv_external( FLA_CONJ_TRANSPOSE, FLA_ONE, A20, a21, FLA_ONE, t01 );
00350       FLA_C2F( zgemv )( &trans,
00351                         &m_ahead, &n_behind,
00352                         buff_1,
00353                         A20, &ldim_A,
00354                         a21, &inc_one,
00355                         buff_1,
00356                         t01, &inc_one );
00357     }
00358 
00359     if ( i < n_AT - 1 )
00360     {
00361       // FLA_Apply_househ2_UT( tau11, a21, a12t,
00362       //                                   A22 );
00363       FLA_Apply_househ2_UT_opt_dcomplex( m_ahead, n_ahead,
00364                                          tau11,
00365                                          a21, inc_one,
00366                                          a12t, ldim_A,
00367                                          A22, ldim_A );
00368     }
00369 
00370     /*------------------------------------------------------------*/
00371 
00372   }
00373 
00374   return FLA_SUCCESS;
00375 }

FLA_Error FLA_QR_UT_Accum_T_opt_var1_double ( FLA_Obj  A,
FLA_Obj  T 
)

References dcopy(), dgemv(), FLA_Apply_househ2_UT_opt_double(), FLA_Househ2_UT_opt_double(), FLA_Obj_ldim(), FLA_Obj_length(), FLA_Obj_width(), and FLA_ONE.

Referenced by FLA_QR_UT_Accum_T_opt_var1().

00140 {
00141   double* buff_A  = FLA_DOUBLE_PTR( A );
00142   double* buff_T  = FLA_DOUBLE_PTR( T );
00143   double* buff_1  = FLA_DOUBLE_PTR( FLA_ONE );
00144 
00145   int     m_A     = FLA_Obj_length( A );
00146   int     n_AT    = FLA_Obj_width( A );
00147   int     ldim_A  = FLA_Obj_ldim( A );
00148   int     ldim_T  = FLA_Obj_ldim( T );
00149 
00150   char    trans   = 'T';
00151   int     inc_one = 1;
00152   int     i;
00153 
00154   for ( i = 0; i < n_AT; ++i )
00155   {
00156     double* a10t      = buff_A + (0  )*ldim_A + i;
00157     double* A20       = buff_A + (0  )*ldim_A + i + 1;
00158     double* alpha11   = buff_A + (i  )*ldim_A + i;
00159     double* a21       = buff_A + (i  )*ldim_A + i + 1;
00160     double* a12t      = buff_A + (i+1)*ldim_A + i;
00161     double* A22       = buff_A + (i+1)*ldim_A + i + 1;
00162 
00163     double* tau11     = buff_T + (i  )*ldim_T + i;
00164     double* t01       = buff_T + (i  )*ldim_T;
00165 
00166     int     m_ahead   = m_A  - i - 1;
00167     int     n_ahead   = n_AT - i - 1;
00168     int     n_behind  = i;
00169 
00170     /*------------------------------------------------------------*/
00171 
00172     // FLA_Househ2_UT( alpha11,
00173     //                 a21, tau11 );
00174     FLA_Househ2_UT_opt_double( m_ahead,
00175                                alpha11,
00176                                a21, inc_one,
00177                                tau11 );
00178 
00179     if ( i > 0 )
00180     {
00181       // FLA_Copyt_external( FLA_CONJ_TRANSPOSE, a10t, t01 );
00182       FLA_C2F( dcopy )( &n_behind,
00183                         a10t, &ldim_A,
00184                         t01,  &inc_one );
00185 
00186       // // t01 = a10t' + A20' * a21;
00187       // FLA_Gemv_external( FLA_CONJ_TRANSPOSE, FLA_ONE, A20, a21, FLA_ONE, t01 );
00188       FLA_C2F( dgemv )( &trans,
00189                         &m_ahead, &n_behind,
00190                         buff_1,
00191                         A20, &ldim_A,
00192                         a21, &inc_one,
00193                         buff_1,
00194                         t01, &inc_one );
00195     }
00196 
00197     if ( i < n_AT - 1 )
00198     {
00199       // FLA_Apply_househ2_UT( tau11, a21, a12t,
00200       //                                   A22 );
00201       FLA_Apply_househ2_UT_opt_double( m_ahead, n_ahead,
00202                                        tau11,
00203                                        a21, inc_one,
00204                                        a12t, ldim_A,
00205                                        A22, ldim_A );
00206     }
00207 
00208     /*------------------------------------------------------------*/
00209 
00210   }
00211 
00212   return FLA_SUCCESS;
00213 }

FLA_Error FLA_QR_UT_Accum_T_opt_var1_float ( FLA_Obj  A,
FLA_Obj  T 
)

References FLA_Apply_househ2_UT_opt_float(), FLA_Househ2_UT_opt_float(), FLA_Obj_ldim(), FLA_Obj_length(), FLA_Obj_width(), FLA_ONE, scopy(), and sgemv().

Referenced by FLA_QR_UT_Accum_T_opt_var1().

00064 {
00065   float* buff_A  = FLA_FLOAT_PTR( A );
00066   float* buff_T  = FLA_FLOAT_PTR( T );
00067   float* buff_1  = FLA_FLOAT_PTR( FLA_ONE );
00068 
00069   int    m_A     = FLA_Obj_length( A );
00070   int    n_AT    = FLA_Obj_width( A );
00071   int    ldim_A  = FLA_Obj_ldim( A );
00072   int    ldim_T  = FLA_Obj_ldim( T );
00073 
00074   char   trans   = 'T';
00075   int    inc_one = 1;
00076   int    i;
00077 
00078   for ( i = 0; i < n_AT; ++i )
00079   {
00080     float* a10t      = buff_A + (0  )*ldim_A + i;
00081     float* A20       = buff_A + (0  )*ldim_A + i + 1;
00082     float* alpha11   = buff_A + (i  )*ldim_A + i;
00083     float* a21       = buff_A + (i  )*ldim_A + i + 1;
00084     float* a12t      = buff_A + (i+1)*ldim_A + i;
00085     float* A22       = buff_A + (i+1)*ldim_A + i + 1;
00086 
00087     float* tau11     = buff_T + (i  )*ldim_T + i;
00088     float* t01       = buff_T + (i  )*ldim_T;
00089 
00090     int    m_ahead  = m_A  - i - 1;
00091     int    n_ahead  = n_AT - i - 1;
00092     int    n_behind = i;
00093 
00094     /*------------------------------------------------------------*/
00095 
00096     // FLA_Househ2_UT( alpha11,
00097     //                 a21, tau11 );
00098     FLA_Househ2_UT_opt_float( m_ahead,
00099                               alpha11,
00100                               a21, inc_one,
00101                               tau11 );
00102 
00103     if ( i > 0 )
00104     {
00105       // FLA_Copyt_external( FLA_CONJ_TRANSPOSE, a10t, t01 );
00106       FLA_C2F( scopy )( &n_behind,
00107                         a10t, &ldim_A,
00108                         t01,  &inc_one );
00109 
00110       // // t01 = a10t' + A20' * a21;
00111       // FLA_Gemv_external( FLA_CONJ_TRANSPOSE, FLA_ONE, A20, a21, FLA_ONE, t01 );
00112       FLA_C2F( sgemv )( &trans,
00113                         &m_ahead, &n_behind,
00114                         buff_1,
00115                         A20, &ldim_A,
00116                         a21, &inc_one,
00117                         buff_1,
00118                         t01, &inc_one );
00119     }
00120 
00121     if ( i < n_AT - 1 )
00122     {
00123       // FLA_Apply_househ2_UT( tau11, a21, a12t,
00124       //                                   A22 );
00125       FLA_Apply_househ2_UT_opt_float( m_ahead, n_ahead,
00126                                       tau11,
00127                                       a21, inc_one,
00128                                       a12t, ldim_A,
00129                                       A22, ldim_A );
00130     }
00131 
00132     /*------------------------------------------------------------*/
00133 
00134   }
00135 
00136   return FLA_SUCCESS;
00137 }

FLA_Error FLA_QR_UT_Accum_T_opt_var1_scomplex ( FLA_Obj  A,
FLA_Obj  T 
)

References ccopy(), cgemv(), FLA_Apply_househ2_UT_opt_scomplex(), FLA_Househ2_UT_opt_scomplex(), FLA_MINUS_ONE, FLA_Obj_ldim(), FLA_Obj_length(), FLA_Obj_width(), FLA_ONE, scomplex::real, and sscal().

Referenced by FLA_QR_UT_Accum_T_opt_var1().

00216 {
00217   scomplex* buff_A  = FLA_COMPLEX_PTR( A );
00218   scomplex* buff_T  = FLA_COMPLEX_PTR( T );
00219   scomplex* buff_1  = FLA_COMPLEX_PTR( FLA_ONE );
00220   scomplex* buff_m1 = FLA_COMPLEX_PTR( FLA_MINUS_ONE );
00221 
00222   int       m_A     = FLA_Obj_length( A );
00223   int       n_AT    = FLA_Obj_width( A );
00224   int       ldim_A  = FLA_Obj_ldim( A );
00225   int       ldim_T  = FLA_Obj_ldim( T );
00226 
00227   char      trans   = 'C';
00228   int       inc_one = 1;
00229   int       inc_two = 2;
00230   int       i;
00231 
00232   for ( i = 0; i < n_AT; ++i )
00233   {
00234     scomplex* a10t      = buff_A + (0  )*ldim_A + i;
00235     scomplex* A20       = buff_A + (0  )*ldim_A + i + 1;
00236     scomplex* alpha11   = buff_A + (i  )*ldim_A + i;
00237     scomplex* a21       = buff_A + (i  )*ldim_A + i + 1;
00238     scomplex* a12t      = buff_A + (i+1)*ldim_A + i;
00239     scomplex* A22       = buff_A + (i+1)*ldim_A + i + 1;
00240 
00241     scomplex* tau11     = buff_T + (i  )*ldim_T + i;
00242     scomplex* t01       = buff_T + (i  )*ldim_T;
00243 
00244     int       m_ahead   = m_A  - i - 1;
00245     int       n_ahead   = n_AT - i - 1;
00246     int       n_behind  = i;
00247 
00248     /*------------------------------------------------------------*/
00249 
00250     // FLA_Househ2_UT( alpha11,
00251     //                 a21, tau11 );
00252     FLA_Househ2_UT_opt_scomplex( m_ahead,
00253                                  alpha11,
00254                                  a21, inc_one,
00255                                  tau11 );
00256 
00257     if ( i > 0 )
00258     {
00259       // FLA_Copyt_external( FLA_CONJ_TRANSPOSE, a10t, t01 );
00260       FLA_C2F( ccopy )( &n_behind,
00261                         a10t, &ldim_A,
00262                         t01,  &inc_one );
00263       FLA_C2F( sscal )( &n_behind,
00264                         &(buff_m1->real),
00265                         (( float* ) t01 ) + 1, &inc_two );
00266 
00267       // // t01 = a10t' + A20' * a21;
00268       // FLA_Gemv_external( FLA_CONJ_TRANSPOSE, FLA_ONE, A20, a21, FLA_ONE, t01 );
00269       FLA_C2F( cgemv )( &trans,
00270                         &m_ahead, &n_behind,
00271                         buff_1,
00272                         A20, &ldim_A,
00273                         a21, &inc_one,
00274                         buff_1,
00275                         t01, &inc_one );
00276     }
00277 
00278     if ( i < n_AT - 1 )
00279     {
00280       // FLA_Apply_househ2_UT( tau11, a21, a12t,
00281       //                                   A22 );
00282       FLA_Apply_househ2_UT_opt_scomplex( m_ahead, n_ahead,
00283                                          tau11,
00284                                          a21, inc_one,
00285                                          a12t, ldim_A,
00286                                          A22, ldim_A );
00287     }
00288 
00289     /*------------------------------------------------------------*/
00290 
00291   }
00292 
00293   return FLA_SUCCESS;
00294 }


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