Operator_times

Functions

template<typename T1 >
arma_inline const eOp< T1,
eop_scalar_times
operator* (const Base< typename T1::elem_type, T1 > &X, const typename T1::elem_type k)
 Base * scalar.
template<typename T1 >
arma_inline const eOp< T1,
eop_scalar_times
operator* (const typename T1::elem_type k, const Base< typename T1::elem_type, T1 > &X)
 scalar * Base
template<typename T1 >
arma_inline const Op< T1,
op_trans2
operator* (const typename T1::elem_type k, const Op< T1, op_trans > &X)
 scalar * trans(T1)
template<typename T1 >
arma_inline const Op< T1,
op_trans2
operator* (const Op< T1, op_trans > &X, const typename T1::elem_type k)
 trans(T1) * scalar
template<typename T1 , typename T2 >
arma_inline const Glue< T1, Op
< T2, op_diagmat >
, glue_times_diag
operator* (const Base< typename T2::elem_type, T1 > &X, const Op< T2, op_diagmat > &Y)
 Base * diagmat.
template<typename T1 , typename T2 >
arma_inline const Glue< Op< T1,
op_diagmat >, T2,
glue_times_diag
operator* (const Op< T1, op_diagmat > &X, const Base< typename T1::elem_type, T2 > &Y)
 diagmat * Base
template<typename T1 , typename T2 >
arma_inline Mat< typename
promote_type< typename
T1::elem_type, typename
T2::elem_type >::result > 
operator* (const Op< T1, op_diagmat > &X, const Op< T2, op_diagmat > &Y)
 diagmat * diagmat
template<typename T1 , typename T2 >
arma_inline const Glue< T1, T2,
glue_times
operator* (const Base< typename T1::elem_type, T1 > &X, const Base< typename T1::elem_type, T2 > &Y)
 multiplication of Base objects with same element type
template<typename T1 , typename T2 >
arma_inline Mat< typename
promote_type< typename
T1::elem_type, typename
T2::elem_type >::result > 
operator* (const Base< typename force_different_type< typename T1::elem_type, typename T2::elem_type >::T1_result, T1 > &X, const Base< typename force_different_type< typename T1::elem_type, typename T2::elem_type >::T2_result, T2 > &Y)
 multiplication of Base objects with different element types

Function Documentation

template<typename T1 >
arma_inline const eOp<T1, eop_scalar_times> operator* ( const Base< typename T1::elem_type, T1 > &  X,
const typename T1::elem_type  k 
) [inline]

Base * scalar.

Definition at line 28 of file operator_times.hpp.

References Base< elem_type, derived >::get_ref().

00029   {
00030   arma_extra_debug_sigprint();
00031   
00032   return eOp<T1, eop_scalar_times>(X.get_ref(),k);
00033   }

template<typename T1 >
arma_inline const eOp<T1, eop_scalar_times> operator* ( const typename T1::elem_type  k,
const Base< typename T1::elem_type, T1 > &  X 
) [inline]

scalar * Base

Definition at line 42 of file operator_times.hpp.

References Base< elem_type, derived >::get_ref().

00043   {
00044   arma_extra_debug_sigprint();
00045   
00046   return eOp<T1, eop_scalar_times>(X.get_ref(),k);  // NOTE: order is swapped
00047   }

template<typename T1 >
arma_inline const Op<T1, op_trans2> operator* ( const typename T1::elem_type  k,
const Op< T1, op_trans > &  X 
) [inline]

scalar * trans(T1)

Definition at line 56 of file operator_times.hpp.

00057   {
00058   arma_extra_debug_sigprint();
00059   
00060   return Op<T1, op_trans2>(X.m, k);
00061   }

template<typename T1 >
arma_inline const Op<T1, op_trans2> operator* ( const Op< T1, op_trans > &  X,
const typename T1::elem_type  k 
) [inline]

trans(T1) * scalar

Definition at line 70 of file operator_times.hpp.

References Op< T1, op_type >::m.

00071   {
00072   arma_extra_debug_sigprint();
00073   
00074   return Op<T1, op_trans2>(X.m, k);
00075   }

template<typename T1 , typename T2 >
arma_inline const Glue<T1, Op<T2, op_diagmat>, glue_times_diag> operator* ( const Base< typename T2::elem_type, T1 > &  X,
const Op< T2, op_diagmat > &  Y 
) [inline]

Base * diagmat.

Definition at line 84 of file operator_times.hpp.

References Base< elem_type, derived >::get_ref().

00085   {
00086   arma_extra_debug_sigprint();
00087   
00088   return Glue<T1, Op<T2, op_diagmat>, glue_times_diag>(X.get_ref(), Y);
00089   }

template<typename T1 , typename T2 >
arma_inline const Glue<Op<T1, op_diagmat>, T2, glue_times_diag> operator* ( const Op< T1, op_diagmat > &  X,
const Base< typename T1::elem_type, T2 > &  Y 
) [inline]

diagmat * Base

Definition at line 98 of file operator_times.hpp.

References Base< T1::elem_type, Op< T1, op_type > >::get_ref().

00099   {
00100   arma_extra_debug_sigprint();
00101   
00102   return Glue<Op<T1, op_diagmat>, T2, glue_times_diag>(X, Y.get_ref());
00103   }

template<typename T1 , typename T2 >
arma_inline Mat< typename promote_type<typename T1::elem_type, typename T2::elem_type>::result > operator* ( const Op< T1, op_diagmat > &  X,
const Op< T2, op_diagmat > &  Y 
) [inline]

diagmat * diagmat

Definition at line 112 of file operator_times.hpp.

References upgrade_val< T1, T2 >::apply(), Mat< eT >::at(), promote_type< T1, T2 >::check(), Op< T1, op_type >::m, diagmat_proxy< T1 >::n_elem, and Mat< eT >::zeros().

00113   {
00114   arma_extra_debug_sigprint();
00115   
00116   typedef typename T1::elem_type eT1;
00117   typedef typename T2::elem_type eT2;
00118   
00119   typedef typename promote_type<eT1,eT2>::result out_eT;
00120   
00121   promote_type<eT1,eT2>::check();
00122   
00123   const diagmat_proxy<T1> A(X.m);
00124   const diagmat_proxy<T2> B(Y.m);
00125   
00126   arma_debug_assert_mul_size(A.n_elem, A.n_elem, B.n_elem, B.n_elem, "matrix multiply");
00127   
00128   const u32 N = A.n_elem;
00129   
00130   Mat<out_eT> out(N,N);
00131   
00132   out.zeros();
00133   
00134   for(u32 i=0; i<N; ++i)
00135     {
00136     out.at(i,i) = upgrade_val<eT1,eT2>::apply( A[i] ) * upgrade_val<eT1,eT2>::apply( B[i] );
00137     }
00138   
00139   return out;
00140   }

template<typename T1 , typename T2 >
arma_inline const Glue<T1, T2, glue_times> operator* ( const Base< typename T1::elem_type, T1 > &  X,
const Base< typename T1::elem_type, T2 > &  Y 
) [inline]

multiplication of Base objects with same element type

Definition at line 149 of file operator_times.hpp.

References Base< elem_type, derived >::get_ref().

00150   {
00151   arma_extra_debug_sigprint();
00152   
00153   return Glue<T1, T2, glue_times>(X.get_ref(), Y.get_ref());
00154   }

template<typename T1 , typename T2 >
arma_inline Mat<typename promote_type<typename T1::elem_type, typename T2::elem_type>::result> operator* ( const Base< typename force_different_type< typename T1::elem_type, typename T2::elem_type >::T1_result, T1 > &  X,
const Base< typename force_different_type< typename T1::elem_type, typename T2::elem_type >::T2_result, T2 > &  Y 
) [inline]

multiplication of Base objects with different element types

Definition at line 163 of file operator_times.hpp.

References glue_times::apply_mixed(), promote_type< T1, T2 >::check(), and Base< elem_type, derived >::get_ref().

00167   {
00168   arma_extra_debug_sigprint();
00169   
00170   typedef typename T1::elem_type eT1;
00171   typedef typename T2::elem_type eT2;
00172   
00173   typedef typename promote_type<eT1,eT2>::result out_eT;
00174   
00175   promote_type<eT1,eT2>::check();
00176   
00177   const unwrap<T1> tmp1(X.get_ref());
00178   const unwrap<T2> tmp2(Y.get_ref());
00179   
00180   const Mat<eT1>& A = tmp1.M;
00181   const Mat<eT2>& B = tmp2.M;
00182   
00183   Mat<out_eT> out;
00184   
00185   glue_times::apply_mixed(out, A, B);
00186   
00187   return out;
00188   }