Op_trig


Classes

class  op_cos
class  op_acos
class  op_cosh
class  op_acosh
class  op_sin
class  op_asin
class  op_sinh
class  op_asinh
class  op_tan
class  op_atan
class  op_tanh
class  op_atanh

Functions

template<typename T1 >
static void op_cos::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_cos > &in)
template<typename T1 >
static void op_acos::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_acos > &in)
template<typename T , typename T1 >
static void op_acos::apply (Mat< std::complex< T > > &out, const Op< T1, op_acos > &in)
template<typename T1 >
static void op_cosh::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_cosh > &in)
template<typename T1 >
static void op_acosh::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_acosh > &in)
template<typename T1 >
static void op_sin::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_sin > &in)
template<typename T1 >
static void op_asin::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_asin > &in)
template<typename T , typename T1 >
static void op_asin::apply (Mat< std::complex< T > > &out, const Op< T1, op_asin > &in)
template<typename T1 >
static void op_sinh::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_sinh > &in)
template<typename T1 >
static void op_asinh::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_asinh > &in)
template<typename T1 >
static void op_tan::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_tan > &in)
template<typename T1 >
static void op_atan::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_atan > &in)
template<typename T , typename T1 >
static void op_atan::apply (Mat< std::complex< T > > &out, const Op< T1, op_atan > &in)
template<typename T1 >
static void op_tanh::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_tanh > &in)
template<typename T1 >
static void op_atanh::apply (Mat< typename T1::elem_type > &out, const Op< T1, op_atanh > &in)

Function Documentation

template<typename T1 >
void op_cos::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_cos > &  in 
) [inline, static, inherited]

Definition at line 32 of file op_trig_meat.hpp.

References cos(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and Mat< eT >::set_size().

00033   {
00034   arma_extra_debug_sigprint();
00035   
00036   typedef typename T1::elem_type eT;
00037   
00038   const unwrap<T1> tmp(in.m);
00039   
00040   const Mat<eT>& A = tmp.M;
00041   const u32 n_elem = A.n_elem;
00042   
00043   out.set_size(A.n_rows, A.n_cols);
00044   eT* out_ptr = out.memptr();
00045   
00046   for(u32 i=0; i<n_elem; ++i)
00047     {
00048     out_ptr[i] = std::cos(A.mem[i]);
00049     }
00050   
00051   }

template<typename T1 >
void op_acos::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_acos > &  in 
) [inline, static, inherited]

Definition at line 58 of file op_trig_meat.hpp.

References acos(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and Mat< eT >::set_size().

00059   {
00060   arma_extra_debug_sigprint();
00061   
00062   typedef typename T1::elem_type eT;
00063   
00064   const unwrap<T1> tmp(in.m);
00065   
00066   const Mat<eT>& A = tmp.M;
00067   const u32 n_elem = A.n_elem;
00068   
00069   out.set_size(A.n_rows, A.n_cols);
00070   eT* out_ptr = out.memptr();
00071   
00072   for(u32 i=0; i<n_elem; ++i)
00073     {
00074     out_ptr[i] = std::acos(A.mem[i]);
00075     }
00076   
00077   }

template<typename T , typename T1 >
void op_acos::apply ( Mat< std::complex< T > > &  out,
const Op< T1, op_acos > &  in 
) [inline, static, inherited]

Definition at line 84 of file op_trig_meat.hpp.

References acos(), arma_stop(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::n_cols, Mat< eT >::n_elem, and Mat< eT >::n_rows.

00085   {
00086   arma_extra_debug_sigprint();
00087   
00088   #if defined(ARMA_USE_BOOST)
00089     {
00090     typedef typename std::complex<T> eT;
00091     isnt_same_type<eT, typename T1::elem_type>::check();
00092     
00093     const unwrap<T1> tmp(in.m);
00094     
00095     const Mat<eT>& A = tmp.M;
00096     const u32 n_elem = A.n_elem;
00097     
00098     out.set_size(A.n_rows, A.n_cols);
00099     eT* out_ptr = out.memptr();
00100     
00101     for(u32 i=0; i<n_elem; ++i)
00102       {
00103       out_ptr[i] = boost::math::acos(A.mem[i]);
00104       }
00105     }
00106   #else
00107     {
00108     arma_stop("op_acos::apply(): need Boost libraries");
00109     }
00110   #endif
00111   }

template<typename T1 >
void op_cosh::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_cosh > &  in 
) [inline, static, inherited]

Definition at line 118 of file op_trig_meat.hpp.

References cosh(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and Mat< eT >::set_size().

00119   {
00120   arma_extra_debug_sigprint();
00121   
00122   typedef typename T1::elem_type eT;
00123   
00124   const unwrap<T1> tmp(in.m);
00125   
00126   const Mat<eT>& A = tmp.M;
00127   const u32 n_elem = A.n_elem;
00128   
00129   out.set_size(A.n_rows, A.n_cols);
00130   eT* out_ptr = out.memptr();
00131   
00132   for(u32 i=0; i<n_elem; ++i)
00133     {
00134     out_ptr[i] = std::cosh(A.mem[i]);
00135     }
00136   
00137   }

template<typename T1 >
void op_acosh::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_acosh > &  in 
) [inline, static, inherited]

Definition at line 144 of file op_trig_meat.hpp.

References acosh(), arma_stop(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and Mat< eT >::set_size().

00145   {
00146   arma_extra_debug_sigprint();
00147   
00148   #if defined(ARMA_USE_BOOST)
00149     {
00150     typedef typename T1::elem_type eT;
00151     
00152     const unwrap<T1> tmp(in.m);
00153     
00154     const Mat<eT>& A = tmp.M;
00155     const u32 n_elem = A.n_elem;
00156     
00157     out.set_size(A.n_rows, A.n_cols);
00158     eT* out_ptr = out.memptr();
00159     
00160     for(u32 i=0; i<n_elem; ++i)
00161       {
00162       out_ptr[i] = boost::math::acosh(A.mem[i]);
00163       }
00164     }
00165   #else
00166     {
00167     arma_stop("op_acosh::apply(): need Boost libraries");
00168     }
00169   #endif
00170   
00171   }

template<typename T1 >
void op_sin::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_sin > &  in 
) [inline, static, inherited]

Definition at line 180 of file op_trig_meat.hpp.

References Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, Mat< eT >::set_size(), and sin().

00181   {
00182   arma_extra_debug_sigprint();
00183   
00184   typedef typename T1::elem_type eT;
00185   
00186   const unwrap<T1> tmp(in.m);
00187   
00188   const Mat<eT>& A = tmp.M;
00189   const u32 n_elem = A.n_elem;
00190   
00191   out.set_size(A.n_rows, A.n_cols);
00192   eT* out_ptr = out.memptr();
00193   
00194   for(u32 i=0; i<n_elem; ++i)
00195     {
00196     out_ptr[i] = std::sin(A.mem[i]);
00197     }
00198   
00199   }

template<typename T1 >
void op_asin::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_asin > &  in 
) [inline, static, inherited]

Definition at line 206 of file op_trig_meat.hpp.

References acos(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and Mat< eT >::set_size().

00207   {
00208   arma_extra_debug_sigprint();
00209   
00210   typedef typename T1::elem_type eT;
00211   
00212   const unwrap<T1> tmp(in.m);
00213   
00214   const Mat<eT>& A = tmp.M;
00215   const u32 n_elem = A.n_elem;
00216   
00217   out.set_size(A.n_rows, A.n_cols);
00218   eT* out_ptr = out.memptr();
00219   
00220   for(u32 i=0; i<n_elem; ++i)
00221     {
00222     out_ptr[i] = std::acos(A.mem[i]);
00223     }
00224   
00225   }

template<typename T , typename T1 >
void op_asin::apply ( Mat< std::complex< T > > &  out,
const Op< T1, op_asin > &  in 
) [inline, static, inherited]

Definition at line 232 of file op_trig_meat.hpp.

References arma_stop(), asin(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::n_cols, Mat< eT >::n_elem, and Mat< eT >::n_rows.

00233   {
00234   arma_extra_debug_sigprint();
00235   
00236   #if defined(ARMA_USE_BOOST)
00237     {
00238     typedef typename std::complex<T> eT;
00239     isnt_same_type<eT, typename T1::elem_type>::check();
00240     
00241     const unwrap<T1> tmp(in.m);
00242     
00243     const Mat<eT>& A = tmp.M;
00244     const u32 n_elem = A.n_elem;
00245     
00246     out.set_size(A.n_rows, A.n_cols);
00247     eT* out_ptr = out.memptr();
00248     
00249     for(u32 i=0; i<n_elem; ++i)
00250       {
00251       out_ptr[i] = boost::math::asin(A.mem[i]);
00252       }
00253     }
00254   #else
00255     {
00256     arma_stop("op_asin::apply(): need Boost libraries");
00257     }
00258   #endif
00259   }

template<typename T1 >
void op_sinh::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_sinh > &  in 
) [inline, static, inherited]

Definition at line 266 of file op_trig_meat.hpp.

References Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, Mat< eT >::set_size(), and sinh().

00267   {
00268   arma_extra_debug_sigprint();
00269   
00270   typedef typename T1::elem_type eT;
00271   
00272   const unwrap<T1> tmp(in.m);
00273   
00274   const Mat<eT>& A = tmp.M;
00275   const u32 n_elem = A.n_elem;
00276   
00277   out.set_size(A.n_rows, A.n_cols);
00278   eT* out_ptr = out.memptr();
00279   
00280   for(u32 i=0; i<n_elem; ++i)
00281     {
00282     out_ptr[i] = std::sinh(A.mem[i]);
00283     }
00284   
00285   }

template<typename T1 >
void op_asinh::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_asinh > &  in 
) [inline, static, inherited]

Definition at line 292 of file op_trig_meat.hpp.

References arma_stop(), asinh(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and Mat< eT >::set_size().

00293   {
00294   arma_extra_debug_sigprint();
00295   
00296   #if defined(ARMA_USE_BOOST)
00297     {
00298     typedef typename T1::elem_type eT;
00299     
00300     const unwrap<T1> tmp(in.m);
00301   
00302     const Mat<eT>& A = tmp.M;
00303     const u32 n_elem = A.n_elem;
00304     
00305     out.set_size(A.n_rows, A.n_cols);
00306     eT* out_ptr = out.memptr();
00307     
00308     for(u32 i=0; i<n_elem; ++i)
00309       {
00310       out_ptr[i] = boost::math::asinh(A.mem[i]);
00311       }
00312     }
00313   #else
00314     {
00315     arma_stop("op_asinh::apply(): need Boost libraries");
00316     }
00317   #endif
00318   }

template<typename T1 >
void op_tan::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_tan > &  in 
) [inline, static, inherited]

Definition at line 327 of file op_trig_meat.hpp.

References Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, Mat< eT >::set_size(), and tan().

00328   {
00329   arma_extra_debug_sigprint();
00330   
00331   typedef typename T1::elem_type eT;
00332   
00333   const unwrap<T1> tmp(in.m);
00334   
00335   const Mat<eT>& A = tmp.M;
00336   const u32 n_elem = A.n_elem;
00337   
00338   out.set_size(A.n_rows, A.n_cols);
00339   eT* out_ptr = out.memptr();
00340   
00341   for(u32 i=0; i<n_elem; ++i)
00342     {
00343     out_ptr[i] = std::tan(A.mem[i]);
00344     }
00345   
00346   }

template<typename T1 >
void op_atan::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_atan > &  in 
) [inline, static, inherited]

Definition at line 353 of file op_trig_meat.hpp.

References atan(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and Mat< eT >::set_size().

00354   {
00355   arma_extra_debug_sigprint();
00356   
00357   typedef typename T1::elem_type eT;
00358   
00359   const unwrap<T1> tmp(in.m);
00360   
00361   const Mat<eT>& A = tmp.M;
00362   const u32 n_elem = A.n_elem;
00363   
00364   out.set_size(A.n_rows, A.n_cols);
00365   eT* out_ptr = out.memptr();
00366   
00367   for(u32 i=0; i<n_elem; ++i)
00368     {
00369     out_ptr[i] = std::atan(A.mem[i]);
00370     }
00371   
00372   }

template<typename T , typename T1 >
void op_atan::apply ( Mat< std::complex< T > > &  out,
const Op< T1, op_atan > &  in 
) [inline, static, inherited]

Definition at line 379 of file op_trig_meat.hpp.

References arma_stop(), atan(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::n_cols, Mat< eT >::n_elem, and Mat< eT >::n_rows.

00380   {
00381   arma_extra_debug_sigprint();
00382   
00383   #if defined(ARMA_USE_BOOST)
00384     {
00385     typedef typename std::complex<T> eT;
00386     isnt_same_type<eT, typename T1::elem_type>::check();
00387     
00388     const unwrap<T1> tmp(in.m);
00389     
00390     const Mat<eT>& A = tmp.M;
00391     const u32 n_elem = A.n_elem;
00392     
00393     out.set_size(A.n_rows, A.n_cols);
00394     eT* out_ptr = out.memptr();
00395     
00396     for(u32 i=0; i<n_elem; ++i)
00397       {
00398       out_ptr[i] = boost::math::atan(A.mem[i]);
00399       }
00400     }
00401   #else
00402     {
00403     arma_stop("op_asin::apply(): need Boost libraries");
00404     }
00405   #endif
00406   }

template<typename T1 >
void op_tanh::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_tanh > &  in 
) [inline, static, inherited]

Definition at line 413 of file op_trig_meat.hpp.

References Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, Mat< eT >::set_size(), and tanh().

00414   {
00415   arma_extra_debug_sigprint();
00416   
00417   typedef typename T1::elem_type eT;
00418   
00419   const unwrap<T1> tmp(in.m);
00420   
00421   const Mat<eT>& A = tmp.M;
00422   const u32 n_elem = A.n_elem;
00423   
00424   out.set_size(A.n_rows, A.n_cols);
00425   eT* out_ptr = out.memptr();
00426   
00427   for(u32 i=0; i<n_elem; ++i)
00428     {
00429     out_ptr[i] = std::tanh(A.mem[i]);
00430     }
00431   
00432   }

template<typename T1 >
void op_atanh::apply ( Mat< typename T1::elem_type > &  out,
const Op< T1, op_atanh > &  in 
) [inline, static, inherited]

Definition at line 439 of file op_trig_meat.hpp.

References arma_stop(), atanh(), Op< T1, op_type >::m, Mat< eT >::mem, Mat< eT >::memptr(), Mat< eT >::n_cols, Mat< eT >::n_elem, Mat< eT >::n_rows, and Mat< eT >::set_size().

00440   {
00441   arma_extra_debug_sigprint();
00442   
00443   #if defined(ARMA_USE_BOOST)
00444     {
00445     typedef typename T1::elem_type eT;
00446     
00447     const unwrap<T1> tmp(in.m);
00448   
00449     const Mat<eT>& A = tmp.M;
00450     const u32 n_elem = A.n_elem;
00451     
00452     out.set_size(A.n_rows, A.n_cols);
00453     eT* out_ptr = out.memptr();
00454     
00455     for(u32 i=0; i<n_elem; ++i)
00456       {
00457       out_ptr[i] = boost::math::atanh(A.mem[i]);
00458       }
00459     }
00460   #else
00461     {
00462     arma_stop("op_atanh::apply(): need Boost libraries");
00463     }
00464   #endif
00465   
00466   }