fn_trunc_exp.hpp
Go to the documentation of this file.
1 // Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
2 // Copyright (C) 2008-2010 Conrad Sanderson
3 //
4 // This file is part of the Armadillo C++ library.
5 // It is provided without any warranty of fitness
6 // for any purpose. You can redistribute this file
7 // and/or modify it under the terms of the GNU
8 // Lesser General Public License (LGPL) as published
9 // by the Free Software Foundation, either version 3
10 // of the License or (at your option) any later version.
11 // (see http://www.opensource.org/licenses for more info)
12 
13 
14 
17 
18 
19 
20 template<typename eT>
21 inline
22 static
24 trunc_exp(const eT x)
25  {
26  if(std::numeric_limits<eT>::is_iec559 && (x >= Math<eT>::log_max() ))
27  {
29  }
30  else
31  {
32  return std::exp(x);
33  }
34  }
35 
36 
37 
38 template<typename eT>
39 inline
40 static
42 trunc_exp(const eT x)
43  {
44  return eT( trunc_exp( double(x) ) );
45  }
46 
47 
48 
49 template<typename T>
51 static
52 std::complex<T>
53 trunc_exp(const std::complex<T>& x)
54  {
55  return std::exp(x);
56  }
57 
58 
59 
60 template<typename T1>
64  {
66 
67  return eOp<T1, eop_trunc_exp>(A.get_ref());
68  }
69 
70 
71 
72 template<typename T1>
76  {
78 
80  }
81 
82 
83 
static arma_float_only< eT >::result trunc_exp(const eT x)
arma_inline const eOp< T1, eop_exp > exp(const Base< typename T1::elem_type, T1 > &A)
Definition: fn_elem.hpp:237
arma_inline const derived & get_ref() const
Definition: Base_meat.hpp:22
arma_inline const Op< T1, op_max > max(const Base< typename T1::elem_type, T1 > &X, const uword dim=0)
Delayed &#39;maximum values&#39; operation. The dimension, along which the maxima are found, is set via &#39;dim&#39;. For dim = 0, the maximum value of each column is found (i.e. searches by traversing across rows). For dim = 1, the maximum value of each row is found (i.e. searches by traversing across columns). The default is dim = 0.
Definition: fn_max.hpp:28
#define arma_extra_debug_sigprint
Definition: debug.hpp:1116
Analog of the Base class, intended for cubes.
#define arma_inline
arma_inline const derived & get_ref() const


armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:57