23 template<
typename vec_type>
28 const typename vec_type::pod_type start,
29 const typename vec_type::pod_type end,
30 const uword num = 100u,
37 typedef typename vec_type::elem_type eT;
38 typedef typename vec_type::pod_type T;
46 eT* x_mem = x.memptr();
48 const uword num_m1 = num - 1;
52 const T delta = (end-start)/T(num_m1);
54 for(
uword i=0; i<num_m1; ++i)
56 x_mem[i] = eT(start + i*delta);
59 x_mem[num_m1] = eT(end);
63 const double delta = (end >= start) ?
double(end-start)/double(num_m1) : -double(start-end)/double(num_m1);
65 for(
uword i=0; i<num_m1; ++i)
67 x_mem[i] = eT(
double(start) + i*delta);
70 x_mem[num_m1] = eT(end);
92 return linspace<mat>(start, end, num);
100 template<
typename eT>
107 std::swap(log_a, log_b);
110 const eT negdelta = log_b - log_a;
118 #if defined(ARMA_HAVE_LOG1P) 119 return (log_a + log1p(
std::exp(negdelta)));
128 template<
typename eT>
141 template<
typename T1>
149 typedef typename T1::elem_type eT;
154 return A.is_finite();
159 template<
typename T1>
167 typedef typename T1::elem_type eT;
172 return A.is_finite();
177 template<
typename T1>
arma_float_only< eT >::result log_add(eT log_a, eT log_b)
arma_inline const eOp< T1, eop_exp > exp(const Base< typename T1::elem_type, T1 > &A)
arma_inline const derived & get_ref() const
arma_inline arma_warn_unused bool is_finite(const eT x, const typename arma_scalar_only< eT >::result *junk=0)
vec_type linspace(const typename vec_type::pod_type start, const typename vec_type::pod_type end, const uword num=100u, const typename arma_Mat_Col_Row_only< vec_type >::result *junk=0)
Generate a vector with 'num' elements. The values of the elements linearly increase from 'start' upto...
#define arma_ignore(variable)
arma_inline Op< T1, op_sympd > sympd(const Base< typename T1::elem_type, T1 > &X)
#define arma_extra_debug_sigprint
Analog of the Base class, intended for cubes.
arma_inline const derived & get_ref() const
arma_inline const eOp< T1, eop_log > log(const Base< typename T1::elem_type, T1 > &A)
arma_inline bool arma_isfinite(eT val)