Fn_kron

Functions

template<typename T1 , typename T2 >
const Glue< T1, T2, glue_kronkron (const Base< typename T1::elem_type, T1 > &A, const Base< typename T1::elem_type, T2 > &B)
 kronecker product of two matrices, with the matrices having the same element type
template<typename T , typename T1 , typename T2 >
Mat< typename promote_type
< typename T1::elem_type,
typename T2::elem_type >
::result > 
kron (const Base< std::complex< T >, T1 > &X, const Base< T, T2 > &Y)
 kronecker product of two matrices, with the matrices having different element types
template<typename T , typename T1 , typename T2 >
Mat< typename promote_type
< typename T1::elem_type,
typename T2::elem_type >
::result > 
kron (const Base< T, T1 > &X, const Base< std::complex< T >, T2 > &Y)
 kronecker product of two matrices, with the matrices having different element types

Function Documentation

template<typename T1 , typename T2 >
const Glue<T1,T2,glue_kron> kron ( const Base< typename T1::elem_type, T1 > &  A,
const Base< typename T1::elem_type, T2 > &  B 
) [inline]

kronecker product of two matrices, with the matrices having the same element type

Definition at line 29 of file fn_kron.hpp.

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

00030   {
00031   arma_extra_debug_sigprint();
00032 
00033   return Glue<T1, T2, glue_kron>(A.get_ref(), B.get_ref());
00034   }

template<typename T , typename T1 , typename T2 >
Mat<typename promote_type<typename T1::elem_type,typename T2::elem_type>::result> kron ( const Base< std::complex< T >, T1 > &  X,
const Base< T, T2 > &  Y 
) [inline]

kronecker product of two matrices, with the matrices having different element types

Definition at line 44 of file fn_kron.hpp.

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

00045   {
00046   arma_extra_debug_sigprint();
00047 
00048   typedef typename std::complex<T> eT1;
00049 
00050   promote_type<eT1,T>::check();
00051   
00052   const unwrap<T1> tmp1(X.get_ref());
00053   const unwrap<T2> tmp2(Y.get_ref());
00054   
00055   const Mat< eT1 >& A = tmp1.M;
00056   const Mat<T>&     B = tmp2.M;
00057 
00058   Mat<eT1> out;
00059   
00060   glue_kron::direct_kron(out, A, B);
00061   
00062   return out;
00063   }

template<typename T , typename T1 , typename T2 >
Mat<typename promote_type<typename T1::elem_type,typename T2::elem_type>::result> kron ( const Base< T, T1 > &  X,
const Base< std::complex< T >, T2 > &  Y 
) [inline]

kronecker product of two matrices, with the matrices having different element types

Definition at line 73 of file fn_kron.hpp.

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

00074   {
00075   arma_extra_debug_sigprint();
00076 
00077   typedef typename std::complex<T> eT2;  
00078 
00079   promote_type<T,eT2>::check();
00080   
00081   const unwrap<T1> tmp1(X.get_ref());
00082   const unwrap<T2> tmp2(Y.get_ref());
00083   
00084   const Mat<T>&     A = tmp1.M;
00085   const Mat< eT2 >& B = tmp2.M;
00086 
00087   Mat<eT2> out;
00088   
00089   glue_kron::direct_kron(out, A, B);
00090   
00091   return out;
00092   }