Static Public Member Functions

gemv< do_trans_A, use_alpha, use_beta > Class Template Reference
[Gemv]

//! Wrapper for ATLAS/BLAS gemv function, using template arguments to control the arguments passed to gemv. //! 'y' is assumed to have been set to the correct size (i.e. taking into account the transpose) More...

#include <gemv.hpp>

List of all members.

Static Public Member Functions

template<typename eT >
static void apply_blas_type (eT *y, const Mat< eT > &A, const eT *x, const eT alpha=eT(1), const eT beta=eT(0))
template<typename eT >
static arma_inline void apply (eT *y, const Mat< eT > &A, const eT *x, const eT alpha=eT(1), const eT beta=eT(0))
static arma_inline void apply (float *y, const Mat< float > &A, const float *x, const float alpha=float(1), const float beta=float(0))
static arma_inline void apply (double *y, const Mat< double > &A, const double *x, const double alpha=double(1), const double beta=double(0))
static arma_inline void apply (std::complex< float > *y, const Mat< std::complex< float > > &A, const std::complex< float > *x, const std::complex< float > alpha=std::complex< float >(1), const std::complex< float > beta=std::complex< float >(0))
static arma_inline void apply (std::complex< double > *y, const Mat< std::complex< double > > &A, const std::complex< double > *x, const std::complex< double > alpha=std::complex< double >(1), const std::complex< double > beta=std::complex< double >(0))

Detailed Description

template<const bool do_trans_A = false, const bool use_alpha = false, const bool use_beta = false>
class gemv< do_trans_A, use_alpha, use_beta >

//! Wrapper for ATLAS/BLAS gemv function, using template arguments to control the arguments passed to gemv. //! 'y' is assumed to have been set to the correct size (i.e. taking into account the transpose)

Definition at line 123 of file gemv.hpp.


Member Function Documentation

template<const bool do_trans_A = false, const bool use_alpha = false, const bool use_beta = false>
template<typename eT >
static void gemv< do_trans_A, use_alpha, use_beta >::apply_blas_type ( eT *  y,
const Mat< eT > &  A,
const eT *  x,
const eT  alpha = eT(1),
const eT  beta = eT(0) 
) [inline, static]

Definition at line 131 of file gemv.hpp.

References gemv< do_trans_A, use_alpha, use_beta >::apply(), Mat< eT >::mem, Mat< eT >::n_cols, Mat< eT >::n_elem, and Mat< eT >::n_rows.

Referenced by gemv< do_trans_A, use_alpha, use_beta >::apply().

    {
    arma_extra_debug_sigprint();
    
    if(A.n_elem <= 256u)
     {
     gemv_arma<do_trans_A, use_alpha, use_beta>::apply(y,A,x,alpha,beta);
     }
    else
      {
      #if defined(ARMA_USE_ATLAS)
        {
        arma_extra_debug_print("atlas::cblas_gemv()");
        
        atlas::cblas_gemv<eT>
          (
          atlas::CblasColMajor,
          (do_trans_A) ? atlas::CblasTrans : atlas::CblasNoTrans,
          A.n_rows,
          A.n_cols,
          (use_alpha) ? alpha : eT(1),
          A.mem,
          A.n_rows,
          x,
          1,
          (use_beta) ? beta : eT(0),
          y,
          1
          );
        }
      #elif defined(ARMA_USE_BLAS)
        {
        arma_extra_debug_print("blas::gemv_()");
        
        const char trans_A     = (do_trans_A) ? 'T' : 'N';
        const int  m           = A.n_rows;
        const int  n           = A.n_cols;
        const eT   local_alpha = (use_alpha) ? alpha : eT(1);
        //const int  lda         = A.n_rows;
        const int  inc         = 1;
        const eT   local_beta  = (use_beta) ? beta : eT(0);
        
        arma_extra_debug_print( arma_boost::format("blas::gemv_(): trans_A = %c") % trans_A );

        blas::gemv_<eT>
          (
          &trans_A,
          &m,
          &n,
          &local_alpha,
          A.mem,
          &m,  // lda
          x,
          &inc,
          &local_beta,
          y,
          &inc
          );
        }
      #else
        {
        gemv_arma<do_trans_A, use_alpha, use_beta>::apply(y,A,x,alpha,beta);
        }
      #endif
      }
    
    }

template<const bool do_trans_A = false, const bool use_alpha = false, const bool use_beta = false>
template<typename eT >
static arma_inline void gemv< do_trans_A, use_alpha, use_beta >::apply ( eT *  y,
const Mat< eT > &  A,
const eT *  x,
const eT  alpha = eT(1),
const eT  beta = eT(0) 
) [inline, static]
template<const bool do_trans_A = false, const bool use_alpha = false, const bool use_beta = false>
static arma_inline void gemv< do_trans_A, use_alpha, use_beta >::apply ( float *  y,
const Mat< float > &  A,
const float *  x,
const float  alpha = float(1),
const float  beta = float(0) 
) [inline, static]
template<const bool do_trans_A = false, const bool use_alpha = false, const bool use_beta = false>
static arma_inline void gemv< do_trans_A, use_alpha, use_beta >::apply ( double *  y,
const Mat< double > &  A,
const double *  x,
const double  alpha = double(1),
const double  beta = double(0) 
) [inline, static]
template<const bool do_trans_A = false, const bool use_alpha = false, const bool use_beta = false>
static arma_inline void gemv< do_trans_A, use_alpha, use_beta >::apply ( std::complex< float > *  y,
const Mat< std::complex< float > > &  A,
const std::complex< float > *  x,
const std::complex< float >  alpha = std::complex<float>(1),
const std::complex< float >  beta = std::complex<float>(0) 
) [inline, static]
template<const bool do_trans_A = false, const bool use_alpha = false, const bool use_beta = false>
static arma_inline void gemv< do_trans_A, use_alpha, use_beta >::apply ( std::complex< double > *  y,
const Mat< std::complex< double > > &  A,
const std::complex< double > *  x,
const std::complex< double >  alpha = std::complex<double>(1),
const std::complex< double >  beta = std::complex<double>(0) 
) [inline, static]