operator_minus.hpp
Go to the documentation of this file.
00001 // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
00002 // Copyright (C) 2008-2010 Conrad Sanderson
00003 // 
00004 // This file is part of the Armadillo C++ library.
00005 // It is provided without any warranty of fitness
00006 // for any purpose. You can redistribute this file
00007 // and/or modify it under the terms of the GNU
00008 // Lesser General Public License (LGPL) as published
00009 // by the Free Software Foundation, either version 3
00010 // of the License or (at your option) any later version.
00011 // (see http://www.opensource.org/licenses for more info)
00012 
00013 
00016 
00017 
00018 
00020 template<typename T1>
00021 arma_inline
00022 const eOp<T1, eop_neg>
00023 operator-
00024 (const Base<typename T1::elem_type,T1>& X)
00025   {
00026   arma_extra_debug_sigprint();
00027   
00028   return eOp<T1,eop_neg>(X.get_ref());
00029   }
00030 
00031 
00032 
00034 template<typename T1>
00035 arma_inline
00036 const T1&
00037 operator-
00038 (const eOp<T1, eop_neg>& X)
00039   {
00040   arma_extra_debug_sigprint();
00041   
00042   return X.m;
00043   }
00044 
00045 
00046 
00048 template<typename T1>
00049 arma_inline
00050 const eOp<T1, eop_scalar_minus_post>
00051 operator-
00052   (
00053   const Base<typename T1::elem_type,T1>& X,
00054   const typename T1::elem_type           k
00055   )
00056   {
00057   arma_extra_debug_sigprint();
00058   
00059   return eOp<T1, eop_scalar_minus_post>(X.get_ref(), k);
00060   }
00061 
00062 
00063 
00065 template<typename T1>
00066 arma_inline
00067 const eOp<T1, eop_scalar_minus_pre>
00068 operator-
00069   (
00070   const typename T1::elem_type           k,
00071   const Base<typename T1::elem_type,T1>& X
00072   )
00073   {
00074   arma_extra_debug_sigprint();
00075   
00076   return eOp<T1, eop_scalar_minus_pre>(X.get_ref(), k);
00077   }
00078 
00079 
00080 
00082 template<typename T1>
00083 arma_inline
00084 const mtOp<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_minus_pre>
00085 operator-
00086   (
00087   const std::complex<typename T1::pod_type>& k,
00088   const Base<typename T1::pod_type, T1>&     X
00089   )
00090   {
00091   arma_extra_debug_sigprint();
00092   
00093   return mtOp<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_minus_pre>('j', X.get_ref(), k);
00094   }
00095 
00096 
00097 
00099 template<typename T1>
00100 arma_inline
00101 const mtOp<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_minus_post>
00102 operator-
00103   (
00104   const Base<typename T1::pod_type, T1>&     X,
00105   const std::complex<typename T1::pod_type>& k
00106   )
00107   {
00108   arma_extra_debug_sigprint();
00109   
00110   return mtOp<typename std::complex<typename T1::pod_type>, T1, op_cx_scalar_minus_post>('j', X.get_ref(), k);
00111   }
00112 
00113 
00114 
00116 template<typename T1, typename T2>
00117 arma_inline
00118 const eGlue<T1, T2, eglue_minus>
00119 operator-
00120   (
00121   const Base<typename T1::elem_type,T1>& X,
00122   const Base<typename T1::elem_type,T2>& Y
00123   )
00124   {
00125   arma_extra_debug_sigprint();
00126   
00127   return eGlue<T1, T2, eglue_minus>(X.get_ref(), Y.get_ref());
00128   }
00129 
00130 
00131 
00133 template<typename T1, typename T2>
00134 inline
00135 const mtGlue<typename promote_type<typename T1::elem_type, typename T2::elem_type>::result, T1, T2, glue_mixed_minus>
00136 operator-
00137   (
00138   const Base< typename force_different_type<typename T1::elem_type, typename T2::elem_type>::T1_result, T1>& X,
00139   const Base< typename force_different_type<typename T1::elem_type, typename T2::elem_type>::T2_result, T2>& Y
00140   )
00141   {
00142   arma_extra_debug_sigprint();
00143   
00144   typedef typename T1::elem_type eT1;
00145   typedef typename T2::elem_type eT2;
00146   
00147   typedef typename promote_type<eT1,eT2>::result out_eT;
00148   
00149   promote_type<eT1,eT2>::check();
00150   
00151   return mtGlue<out_eT, T1, T2, glue_mixed_minus>( X.get_ref(), Y.get_ref() );
00152   }
00153 
00154 
00155 


armadillo_matrix
Author(s): Conrad Sanderson - NICTA (www.nicta.com.au), (Wrapper by Sjoerd van den Dries)
autogenerated on Tue Jan 7 2014 11:42:05