Main Page
Modules
Namespaces
Classes
Files
File List
File Members
include
armadillo_bits
fn_eps.hpp
Go to the documentation of this file.
1
// Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
2
// Copyright (C) 2009-2010 Conrad Sanderson
3
// Copyright (C) 2009-2010 Dimitrios Bouzas
4
//
5
// This file is part of the Armadillo C++ library.
6
// It is provided without any warranty of fitness
7
// for any purpose. You can redistribute this file
8
// and/or modify it under the terms of the GNU
9
// Lesser General Public License (LGPL) as published
10
// by the Free Software Foundation, either version 3
11
// of the License or (at your option) any later version.
12
// (see http://www.opensource.org/licenses for more info)
13
14
15
18
19
20
23
template
<
typename
T1>
24
inline
25
const
eOp<T1, eop_eps>
26
eps
(
const
Base<typename T1::elem_type, T1>
& X,
const
typename
arma_not_cx<typename T1::elem_type>::result
*
junk
= 0)
27
{
28
arma_extra_debug_sigprint
();
29
30
arma_ignore
(
junk
);
31
32
typedef
typename
T1::elem_type eT;
33
34
return
eOp<T1, eop_eps>
(X.
get_ref
());
35
}
36
37
38
41
template
<
typename
T1>
42
inline
43
Mat< typename T1::pod_type >
44
eps
(
const
Base
< std::complex<typename T1::pod_type>, T1>& X,
const
typename
arma_cx_only<typename T1::elem_type>::result
*
junk
= 0)
45
{
46
arma_extra_debug_sigprint
();
47
48
arma_ignore
(
junk
);
49
50
typedef
typename
T1::pod_type T;
51
typedef
typename
T1::elem_type eT;
52
53
const
unwrap<T1>
tmp(X.get_ref());
54
const
Mat<eT>
& A = tmp.M;
55
56
Mat<T>
out(A.n_rows, A.n_cols);
57
58
T* out_mem = out.
memptr
();
59
const
eT* A_mem = A.memptr();
60
const
uword
n_elem = A.n_elem;
61
62
for
(
uword
i=0; i<n_elem; ++i)
63
{
64
out_mem[i] =
eop_aux::direct_eps
( A_mem[i] );
65
}
66
67
68
return
out;
69
}
70
71
72
73
template
<
typename
eT>
74
arma_inline
75
arma_warn_unused
76
typename
arma_integral_only<eT>::result
77
eps
(
const
eT& x)
78
{
79
arma_ignore
(x);
80
81
return
eT(0);
82
}
83
84
85
86
template
<
typename
eT>
87
arma_inline
88
arma_warn_unused
89
typename
arma_float_only<eT>::result
90
eps
(
const
eT& x)
91
{
92
return
eop_aux::direct_eps
(x);
93
}
94
95
96
97
template
<
typename
T>
98
arma_inline
99
arma_warn_unused
100
typename
arma_float_only<T>::result
101
eps
(
const
std::complex<T>& x)
102
{
103
return
eop_aux::direct_eps
(x);
104
}
105
106
107
Mat::memptr
arma_inline arma_warn_unused eT * memptr()
returns a pointer to array of eTs used by the matrix
Definition:
Mat_meat.hpp:4024
Base
Definition:
Base_bones.hpp:25
eOp
Definition:
eOp_bones.hpp:20
Base::get_ref
arma_inline const derived & get_ref() const
Definition:
Base_meat.hpp:22
eps
const eOp< T1, eop_eps > eps(const Base< typename T1::elem_type, T1 > &X, const typename arma_not_cx< typename T1::elem_type >::result *junk=0)
eps version for non-complex matrices and vectors
Definition:
fn_eps.hpp:26
junk
Definition:
typedef.hpp:169
uword
u32 uword
Definition:
typedef.hpp:85
arma_ignore
#define arma_ignore(variable)
Definition:
compiler_setup.hpp:23
arma_integral_only
Definition:
restrictors.hpp:45
arma_extra_debug_sigprint
#define arma_extra_debug_sigprint
Definition:
debug.hpp:1116
arma_warn_unused
#define arma_warn_unused
Definition:
compiler_setup.hpp:21
arma_cx_only
Definition:
restrictors.hpp:113
Mat
Dense matrix class.
Definition:
forward_bones.hpp:19
arma_inline
#define arma_inline
Definition:
compiler_setup.hpp:19
arma_not_cx::result
T result
Definition:
restrictors.hpp:120
eop_aux::direct_eps
static arma_inline arma_integral_only< eT >::result direct_eps(const eT)
Definition:
eop_aux.hpp:269
unwrap
Definition:
unwrap.hpp:20
arma_float_only
Definition:
restrictors.hpp:97
armadillo_matrix
Author(s):
autogenerated on Fri Apr 16 2021 02:31:57