Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 template<typename T1, typename T2>
00027 arma_inline
00028 const Glue<T1,T2,glue_kron>
00029 kron(const Base<typename T1::elem_type,T1>& A, const Base<typename T1::elem_type,T2>& B)
00030 {
00031 arma_extra_debug_sigprint();
00032
00033 return Glue<T1, T2, glue_kron>(A.get_ref(), B.get_ref());
00034 }
00035
00036
00037
00038
00039
00040
00041 template<typename T, typename T1, typename T2>
00042 inline
00043 Mat<typename eT_promoter<T1,T2>::eT>
00044 kron(const Base<std::complex<T>,T1>& X, const Base<T,T2>& Y)
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 }
00064
00065
00066
00067
00068
00069
00070 template<typename T, typename T1, typename T2>
00071 inline
00072 Mat<typename eT_promoter<T1,T2>::eT>
00073 kron(const Base<T,T1>& X, const Base<std::complex<T>,T2>& Y)
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 }
00093
00094
00095
00096