fn_trig.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2009 NICTA
00002 // 
00003 // Authors:
00004 // - Conrad Sanderson (conradsand at ieee dot org)
00005 // 
00006 // This file is part of the Armadillo C++ library.
00007 // It is provided without any warranty of fitness
00008 // for any purpose. You can redistribute this file
00009 // and/or modify it under the terms of the GNU
00010 // Lesser General Public License (LGPL) as published
00011 // by the Free Software Foundation, either version 3
00012 // of the License or (at your option) any later version.
00013 // (see http://www.opensource.org/licenses for more info)
00014 
00015 
00016 //! \addtogroup fn_trig
00017 //! @{
00018 
00019 //
00020 // trigonometric functions:
00021 // cos family: cos, acos, cosh, acosh
00022 // sin family: sin, asin, sinh, asinh
00023 // tan family: tan, atan, tanh, atanh
00024 
00025 
00026 //
00027 // cos
00028 
00029 template<typename T1>
00030 inline
00031 const Op<T1, op_cos>
00032 cos(const Base<typename T1::elem_type,T1>& A)
00033   {
00034   arma_extra_debug_sigprint();
00035   
00036   return Op<T1, op_cos>(A.get_ref());
00037   }
00038 
00039 
00040 
00041 //
00042 // acos
00043 
00044 template<typename T1>
00045 inline
00046 const Op<T1, op_acos>
00047 acos(const Base<typename T1::elem_type,T1>& A)
00048   {
00049   arma_extra_debug_sigprint();
00050   
00051   return Op<T1, op_acos>(A.get_ref());
00052   }
00053 
00054 
00055 
00056 //
00057 // cosh
00058 
00059 template<typename T1>
00060 inline
00061 const Op<T1, op_cosh>
00062 cosh(const Base<typename T1::elem_type,T1>& A)
00063   {
00064   arma_extra_debug_sigprint();
00065   
00066   return Op<T1, op_cosh>(A.get_ref());
00067   }
00068 
00069 
00070 
00071 //
00072 // acosh
00073 
00074 template<typename T1>
00075 inline
00076 const Op<T1, op_acosh>
00077 acosh(const Base<typename T1::elem_type,T1>& A)
00078   {
00079   arma_extra_debug_sigprint();
00080   
00081   return Op<T1, op_acosh>(A.get_ref());
00082   }
00083 
00084 
00085 
00086 //
00087 // sin
00088 
00089 template<typename T1>
00090 inline
00091 const Op<T1, op_sin>
00092 sin(const Base<typename T1::elem_type,T1>& A)
00093   {
00094   arma_extra_debug_sigprint();
00095   
00096   return Op<T1, op_sin>(A.get_ref());
00097   }
00098 
00099 
00100 
00101 //
00102 // asin
00103 
00104 template<typename T1>
00105 inline
00106 const Op<T1, op_asin>
00107 asin(const Base<typename T1::elem_type,T1>& A)
00108   {
00109   arma_extra_debug_sigprint();
00110   
00111   return Op<T1, op_asin>(A.get_ref());
00112   }
00113 
00114 
00115 
00116 //
00117 // sinh
00118 
00119 template<typename T1>
00120 inline
00121 const Op<T1, op_sinh>
00122 sinh(const Base<typename T1::elem_type,T1>& A)
00123   {
00124   arma_extra_debug_sigprint();
00125   
00126   return Op<T1, op_sinh>(A.get_ref());
00127   }
00128 
00129 
00130 
00131 //
00132 // asinh
00133 
00134 template<typename T1>
00135 inline
00136 const Op<T1, op_asinh>
00137 asinh(const Base<typename T1::elem_type,T1>& A)
00138   {
00139   arma_extra_debug_sigprint();
00140   
00141   return Op<T1, op_asinh>(A.get_ref());
00142   }
00143 
00144 
00145 
00146 //
00147 // tan
00148 
00149 template<typename T1>
00150 inline
00151 const Op<T1, op_tan>
00152 tan(const Base<typename T1::elem_type,T1>& A)
00153   {
00154   arma_extra_debug_sigprint();
00155   
00156   return Op<T1, op_tan>(A.get_ref());
00157   }
00158 
00159 
00160 
00161 //
00162 // atan
00163 
00164 template<typename T1>
00165 inline
00166 const Op<T1, op_atan>
00167 atan(const Base<typename T1::elem_type,T1>& A)
00168   {
00169   arma_extra_debug_sigprint();
00170   
00171   return Op<T1, op_atan>(A.get_ref());
00172   }
00173 
00174 
00175 
00176 //
00177 // tanh
00178 
00179 template<typename T1>
00180 inline
00181 const Op<T1, op_tanh>
00182 tanh(const Base<typename T1::elem_type,T1>& A)
00183   {
00184   arma_extra_debug_sigprint();
00185   
00186   return Op<T1, op_tanh>(A.get_ref());
00187   }
00188 
00189 
00190 
00191 //
00192 // atanh
00193 
00194 template<typename T1>
00195 inline
00196 const Op<T1, op_atanh>
00197 atanh(const Base<typename T1::elem_type,T1>& A)
00198   {
00199   arma_extra_debug_sigprint();
00200   
00201   return Op<T1, op_atanh>(A.get_ref());
00202   }
00203 
00204 
00205 
00206 //
00207 //
00208 // handling of cubes
00209 
00210 
00211 
00212 //
00213 // cos
00214 
00215 template<typename T1>
00216 inline
00217 const OpCube<T1, op_cos>
00218 cos(const BaseCube<typename T1::elem_type,T1>& A)
00219   {
00220   arma_extra_debug_sigprint();
00221   
00222   return OpCube<T1, op_cos>(A.get_ref());
00223   }
00224 
00225 
00226 
00227 //
00228 // acos
00229 
00230 template<typename T1>
00231 inline
00232 const OpCube<T1, op_acos>
00233 acos(const BaseCube<typename T1::elem_type,T1>& A)
00234   {
00235   arma_extra_debug_sigprint();
00236   
00237   return OpCube<T1, op_acos>(A.get_ref());
00238   }
00239 
00240 
00241 
00242 //
00243 // cosh
00244 
00245 template<typename T1>
00246 inline
00247 const OpCube<T1, op_cosh>
00248 cosh(const BaseCube<typename T1::elem_type,T1>& A)
00249   {
00250   arma_extra_debug_sigprint();
00251   
00252   return OpCube<T1, op_cosh>(A.get_ref());
00253   }
00254 
00255 
00256 
00257 //
00258 // acosh
00259 
00260 template<typename T1>
00261 inline
00262 const OpCube<T1, op_acosh>
00263 acosh(const BaseCube<typename T1::elem_type,T1>& A)
00264   {
00265   arma_extra_debug_sigprint();
00266   
00267   return OpCube<T1, op_acosh>(A.get_ref());
00268   }
00269 
00270 
00271 
00272 //
00273 // sin
00274 
00275 template<typename T1>
00276 inline
00277 const OpCube<T1, op_sin>
00278 sin(const BaseCube<typename T1::elem_type,T1>& A)
00279   {
00280   arma_extra_debug_sigprint();
00281   
00282   return OpCube<T1, op_sin>(A.get_ref());
00283   }
00284 
00285 
00286 
00287 //
00288 // asin
00289 
00290 template<typename T1>
00291 inline
00292 const OpCube<T1, op_asin>
00293 asin(const BaseCube<typename T1::elem_type,T1>& A)
00294   {
00295   arma_extra_debug_sigprint();
00296   
00297   return OpCube<T1, op_asin>(A.get_ref());
00298   }
00299 
00300 
00301 
00302 //
00303 // sinh
00304 
00305 template<typename T1>
00306 inline
00307 const OpCube<T1, op_sinh>
00308 sinh(const BaseCube<typename T1::elem_type,T1>& A)
00309   {
00310   arma_extra_debug_sigprint();
00311   
00312   return OpCube<T1, op_sinh>(A.get_ref());
00313   }
00314 
00315 
00316 
00317 //
00318 // asinh
00319 
00320 template<typename T1>
00321 inline
00322 const OpCube<T1, op_asinh>
00323 asinh(const BaseCube<typename T1::elem_type,T1>& A)
00324   {
00325   arma_extra_debug_sigprint();
00326   
00327   return OpCube<T1, op_asinh>(A.get_ref());
00328   }
00329 
00330 
00331 
00332 //
00333 // tan
00334 
00335 template<typename T1>
00336 inline
00337 const OpCube<T1, op_tan>
00338 tan(const BaseCube<typename T1::elem_type,T1>& A)
00339   {
00340   arma_extra_debug_sigprint();
00341   
00342   return OpCube<T1, op_tan>(A.get_ref());
00343   }
00344 
00345 
00346 
00347 //
00348 // atan
00349 
00350 template<typename T1>
00351 inline
00352 const OpCube<T1, op_atan>
00353 atan(const BaseCube<typename T1::elem_type,T1>& A)
00354   {
00355   arma_extra_debug_sigprint();
00356   
00357   return OpCube<T1, op_atan>(A.get_ref());
00358   }
00359 
00360 
00361 
00362 //
00363 // tanh
00364 
00365 template<typename T1>
00366 inline
00367 const OpCube<T1, op_tanh>
00368 tanh(const BaseCube<typename T1::elem_type,T1>& A)
00369   {
00370   arma_extra_debug_sigprint();
00371   
00372   return OpCube<T1, op_tanh>(A.get_ref());
00373   }
00374 
00375 
00376 
00377 //
00378 // atanh
00379 
00380 template<typename T1>
00381 inline
00382 const OpCube<T1, op_atanh>
00383 atanh(const BaseCube<typename T1::elem_type,T1>& A)
00384   {
00385   arma_extra_debug_sigprint();
00386   
00387   return OpCube<T1, op_atanh>(A.get_ref());
00388   }
00389 
00390 
00391 
00392 //! @}