half_float.cpp
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // This Source Code Form is subject to the terms of the Mozilla
5 // Public License v. 2.0. If a copy of the MPL was not distributed
6 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 
8 #include <sstream>
9 
10 #include "main.h"
11 
13 
14 #define VERIFY_HALF_BITS_EQUAL(h, bits) \
15  VERIFY_IS_EQUAL((numext::bit_cast<numext::uint16_t>(h)), (static_cast<numext::uint16_t>(bits)))
16 
17 // Make sure it's possible to forward declare Eigen::half
18 namespace Eigen {
19 struct half;
20 }
21 
22 using Eigen::half;
23 
25 {
27 
28  // Round-trip bit-cast with uint16.
30  numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(1.0f))),
31  half(1.0f));
33  numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(0.5f))),
34  half(0.5f));
36  numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(-0.33333f))),
37  half(-0.33333f));
39  numext::bit_cast<half>(numext::bit_cast<numext::uint16_t>(half(0.0f))),
40  half(0.0f));
41 
42  // Conversion from float.
43  VERIFY_HALF_BITS_EQUAL(half(1.0f), 0x3c00);
44  VERIFY_HALF_BITS_EQUAL(half(0.5f), 0x3800);
45  VERIFY_HALF_BITS_EQUAL(half(0.33333f), 0x3555);
46  VERIFY_HALF_BITS_EQUAL(half(0.0f), 0x0000);
47  VERIFY_HALF_BITS_EQUAL(half(-0.0f), 0x8000);
48  VERIFY_HALF_BITS_EQUAL(half(65504.0f), 0x7bff);
49  VERIFY_HALF_BITS_EQUAL(half(65536.0f), 0x7c00); // Becomes infinity.
50 
51  // Denormals.
52  VERIFY_HALF_BITS_EQUAL(half(-5.96046e-08f), 0x8001);
53  VERIFY_HALF_BITS_EQUAL(half(5.96046e-08f), 0x0001);
54  VERIFY_HALF_BITS_EQUAL(half(1.19209e-07f), 0x0002);
55 
56  // Verify round-to-nearest-even behavior.
57  float val1 = float(half(__half_raw(0x3c00)));
58  float val2 = float(half(__half_raw(0x3c01)));
59  float val3 = float(half(__half_raw(0x3c02)));
60  VERIFY_HALF_BITS_EQUAL(half(0.5f * (val1 + val2)), 0x3c00);
61  VERIFY_HALF_BITS_EQUAL(half(0.5f * (val2 + val3)), 0x3c02);
62 
63  // Conversion from int.
64  VERIFY_HALF_BITS_EQUAL(half(-1), 0xbc00);
65  VERIFY_HALF_BITS_EQUAL(half(0), 0x0000);
66  VERIFY_HALF_BITS_EQUAL(half(1), 0x3c00);
67  VERIFY_HALF_BITS_EQUAL(half(2), 0x4000);
68  VERIFY_HALF_BITS_EQUAL(half(3), 0x4200);
69 
70  // Conversion from bool.
71  VERIFY_HALF_BITS_EQUAL(half(false), 0x0000);
72  VERIFY_HALF_BITS_EQUAL(half(true), 0x3c00);
73 
74  // Conversion to float.
75  VERIFY_IS_EQUAL(float(half(__half_raw(0x0000))), 0.0f);
76  VERIFY_IS_EQUAL(float(half(__half_raw(0x3c00))), 1.0f);
77 
78  // Denormals.
79  VERIFY_IS_APPROX(float(half(__half_raw(0x8001))), -5.96046e-08f);
80  VERIFY_IS_APPROX(float(half(__half_raw(0x0001))), 5.96046e-08f);
81  VERIFY_IS_APPROX(float(half(__half_raw(0x0002))), 1.19209e-07f);
82 
83  // NaNs and infinities.
84  VERIFY(!(numext::isinf)(float(half(65504.0f)))); // Largest finite number.
85  VERIFY(!(numext::isnan)(float(half(0.0f))));
86  VERIFY((numext::isinf)(float(half(__half_raw(0xfc00)))));
87  VERIFY((numext::isnan)(float(half(__half_raw(0xfc01)))));
88  VERIFY((numext::isinf)(float(half(__half_raw(0x7c00)))));
89  VERIFY((numext::isnan)(float(half(__half_raw(0x7c01)))));
90 
91 #if !EIGEN_COMP_MSVC
92  // Visual Studio errors out on divisions by 0
93  VERIFY((numext::isnan)(float(half(0.0 / 0.0))));
94  VERIFY((numext::isinf)(float(half(1.0 / 0.0))));
95  VERIFY((numext::isinf)(float(half(-1.0 / 0.0))));
96 #endif
97 
98  // Exactly same checks as above, just directly on the half representation.
99  VERIFY(!(numext::isinf)(half(__half_raw(0x7bff))));
100  VERIFY(!(numext::isnan)(half(__half_raw(0x0000))));
101  VERIFY((numext::isinf)(half(__half_raw(0xfc00))));
102  VERIFY((numext::isnan)(half(__half_raw(0xfc01))));
103  VERIFY((numext::isinf)(half(__half_raw(0x7c00))));
104  VERIFY((numext::isnan)(half(__half_raw(0x7c01))));
105 
106 #if !EIGEN_COMP_MSVC
107  // Visual Studio errors out on divisions by 0
108  VERIFY((numext::isnan)(half(0.0 / 0.0)));
109  VERIFY((numext::isinf)(half(1.0 / 0.0)));
110  VERIFY((numext::isinf)(half(-1.0 / 0.0)));
111 #endif
112 
113  // Conversion to bool
114  VERIFY(!static_cast<bool>(half(0.0)));
115  VERIFY(!static_cast<bool>(half(-0.0)));
116  VERIFY(static_cast<bool>(half(__half_raw(0x7bff))));
117  VERIFY(static_cast<bool>(half(-0.33333)));
118  VERIFY(static_cast<bool>(half(1.0)));
119  VERIFY(static_cast<bool>(half(-1.0)));
120  VERIFY(static_cast<bool>(half(-5.96046e-08f)));
121 }
122 
124 {
125  std::cout << "epsilon = " << NumTraits<half>::epsilon() << " (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::epsilon()) << ")" << std::endl;
126  std::cout << "highest = " << NumTraits<half>::highest() << " (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::highest()) << ")" << std::endl;
127  std::cout << "lowest = " << NumTraits<half>::lowest() << " (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::lowest()) << ")" << std::endl;
128  std::cout << "min = " << (std::numeric_limits<half>::min)() << " (0x" << std::hex << numext::bit_cast<numext::uint16_t>(half((std::numeric_limits<half>::min)())) << ")" << std::endl;
129  std::cout << "denorm min = " << (std::numeric_limits<half>::denorm_min)() << " (0x" << std::hex << numext::bit_cast<numext::uint16_t>(half((std::numeric_limits<half>::denorm_min)())) << ")" << std::endl;
130  std::cout << "infinity = " << NumTraits<half>::infinity() << " (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::infinity()) << ")" << std::endl;
131  std::cout << "quiet nan = " << NumTraits<half>::quiet_NaN() << " (0x" << std::hex << numext::bit_cast<numext::uint16_t>(NumTraits<half>::quiet_NaN()) << ")" << std::endl;
132  std::cout << "signaling nan = " << std::numeric_limits<half>::signaling_NaN() << " (0x" << std::hex << numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::signaling_NaN()) << ")" << std::endl;
133 
135 
137  numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::infinity()),
138  numext::bit_cast<numext::uint16_t>(half(std::numeric_limits<float>::infinity())) );
139  // There is no guarantee that casting a 32-bit NaN to 16-bit has a precise
140  // bit pattern. We test that it is in fact a NaN, then test the signaling
141  // bit (msb of significand is 1 for quiet, 0 for signaling).
142  const numext::uint16_t HALF_QUIET_BIT = 0x0200;
143  VERIFY(
144  (numext::isnan)(std::numeric_limits<half>::quiet_NaN())
145  && (numext::isnan)(half(std::numeric_limits<float>::quiet_NaN()))
146  && ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::quiet_NaN()) & HALF_QUIET_BIT) > 0)
147  && ((numext::bit_cast<numext::uint16_t>(half(std::numeric_limits<float>::quiet_NaN())) & HALF_QUIET_BIT) > 0) );
148  // After a cast to half, a signaling NaN may become non-signaling
149  // (e.g. in the case of casting float to native __fp16). Thus, we check that
150  // both are NaN, and that only the `numeric_limits` version is signaling.
151  VERIFY(
152  (numext::isnan)(std::numeric_limits<half>::signaling_NaN())
153  && (numext::isnan)(half(std::numeric_limits<float>::signaling_NaN()))
154  && ((numext::bit_cast<numext::uint16_t>(std::numeric_limits<half>::signaling_NaN()) & HALF_QUIET_BIT) == 0) );
155 
157  VERIFY( (std::numeric_limits<half>::denorm_min)() > half(0.f) );
159  VERIFY_IS_EQUAL( (std::numeric_limits<half>::denorm_min)()/half(2), half(0.f) );
160 }
161 
163 {
164  VERIFY_IS_EQUAL(float(half(2) + half(2)), 4);
165  VERIFY_IS_EQUAL(float(half(2) + half(-2)), 0);
166  VERIFY_IS_APPROX(float(half(0.33333f) + half(0.66667f)), 1.0f);
167  VERIFY_IS_EQUAL(float(half(2.0f) * half(-5.5f)), -11.0f);
168  VERIFY_IS_APPROX(float(half(1.0f) / half(3.0f)), 0.33333f);
169  VERIFY_IS_EQUAL(float(-half(4096.0f)), -4096.0f);
170  VERIFY_IS_EQUAL(float(-half(-4096.0f)), 4096.0f);
171 
172  half x(3);
173  half y = ++x;
174  VERIFY_IS_EQUAL(x, half(4));
175  VERIFY_IS_EQUAL(y, half(4));
176  y = --x;
177  VERIFY_IS_EQUAL(x, half(3));
178  VERIFY_IS_EQUAL(y, half(3));
179  y = x++;
180  VERIFY_IS_EQUAL(x, half(4));
181  VERIFY_IS_EQUAL(y, half(3));
182  y = x--;
183  VERIFY_IS_EQUAL(x, half(3));
184  VERIFY_IS_EQUAL(y, half(4));
185 }
186 
188 {
189  VERIFY(half(1.0f) > half(0.5f));
190  VERIFY(half(0.5f) < half(1.0f));
191  VERIFY(!(half(1.0f) < half(0.5f)));
192  VERIFY(!(half(0.5f) > half(1.0f)));
193 
194  VERIFY(!(half(4.0f) > half(4.0f)));
195  VERIFY(!(half(4.0f) < half(4.0f)));
196 
197  VERIFY(!(half(0.0f) < half(-0.0f)));
198  VERIFY(!(half(-0.0f) < half(0.0f)));
199  VERIFY(!(half(0.0f) > half(-0.0f)));
200  VERIFY(!(half(-0.0f) > half(0.0f)));
201 
202  VERIFY(half(0.2f) > half(-1.0f));
203  VERIFY(half(-1.0f) < half(0.2f));
204  VERIFY(half(-16.0f) < half(-15.0f));
205 
206  VERIFY(half(1.0f) == half(1.0f));
207  VERIFY(half(1.0f) != half(2.0f));
208 
209  // Comparisons with NaNs and infinities.
210 #if !EIGEN_COMP_MSVC
211  // Visual Studio errors out on divisions by 0
212  VERIFY(!(half(0.0 / 0.0) == half(0.0 / 0.0)));
213  VERIFY(half(0.0 / 0.0) != half(0.0 / 0.0));
214 
215  VERIFY(!(half(1.0) == half(0.0 / 0.0)));
216  VERIFY(!(half(1.0) < half(0.0 / 0.0)));
217  VERIFY(!(half(1.0) > half(0.0 / 0.0)));
218  VERIFY(half(1.0) != half(0.0 / 0.0));
219 
220  VERIFY(half(1.0) < half(1.0 / 0.0));
221  VERIFY(half(1.0) > half(-1.0 / 0.0));
222 #endif
223 }
224 
226 {
227  VERIFY_IS_EQUAL(float(numext::abs(half(3.5f))), 3.5f);
228  VERIFY_IS_EQUAL(float(abs(half(3.5f))), 3.5f);
229  VERIFY_IS_EQUAL(float(numext::abs(half(-3.5f))), 3.5f);
230  VERIFY_IS_EQUAL(float(abs(half(-3.5f))), 3.5f);
231 
232  VERIFY_IS_EQUAL(float(numext::floor(half(3.5f))), 3.0f);
233  VERIFY_IS_EQUAL(float(floor(half(3.5f))), 3.0f);
234  VERIFY_IS_EQUAL(float(numext::floor(half(-3.5f))), -4.0f);
235  VERIFY_IS_EQUAL(float(floor(half(-3.5f))), -4.0f);
236 
237  VERIFY_IS_EQUAL(float(numext::ceil(half(3.5f))), 4.0f);
238  VERIFY_IS_EQUAL(float(ceil(half(3.5f))), 4.0f);
239  VERIFY_IS_EQUAL(float(numext::ceil(half(-3.5f))), -3.0f);
240  VERIFY_IS_EQUAL(float(ceil(half(-3.5f))), -3.0f);
241 
242  VERIFY_IS_APPROX(float(numext::sqrt(half(0.0f))), 0.0f);
243  VERIFY_IS_APPROX(float(sqrt(half(0.0f))), 0.0f);
244  VERIFY_IS_APPROX(float(numext::sqrt(half(4.0f))), 2.0f);
245  VERIFY_IS_APPROX(float(sqrt(half(4.0f))), 2.0f);
246 
247  VERIFY_IS_APPROX(float(numext::pow(half(0.0f), half(1.0f))), 0.0f);
248  VERIFY_IS_APPROX(float(pow(half(0.0f), half(1.0f))), 0.0f);
249  VERIFY_IS_APPROX(float(numext::pow(half(2.0f), half(2.0f))), 4.0f);
250  VERIFY_IS_APPROX(float(pow(half(2.0f), half(2.0f))), 4.0f);
251 
252  VERIFY_IS_EQUAL(float(numext::exp(half(0.0f))), 1.0f);
253  VERIFY_IS_EQUAL(float(exp(half(0.0f))), 1.0f);
254  VERIFY_IS_APPROX(float(numext::exp(half(EIGEN_PI))), 20.f + float(EIGEN_PI));
255  VERIFY_IS_APPROX(float(exp(half(EIGEN_PI))), 20.f + float(EIGEN_PI));
256 
257  VERIFY_IS_EQUAL(float(numext::expm1(half(0.0f))), 0.0f);
258  VERIFY_IS_EQUAL(float(expm1(half(0.0f))), 0.0f);
259  VERIFY_IS_APPROX(float(numext::expm1(half(2.0f))), 6.3890561f);
260  VERIFY_IS_APPROX(float(expm1(half(2.0f))), 6.3890561f);
261 
262  VERIFY_IS_EQUAL(float(numext::log(half(1.0f))), 0.0f);
263  VERIFY_IS_EQUAL(float(log(half(1.0f))), 0.0f);
264  VERIFY_IS_APPROX(float(numext::log(half(10.0f))), 2.30273f);
265  VERIFY_IS_APPROX(float(log(half(10.0f))), 2.30273f);
266 
267  VERIFY_IS_EQUAL(float(numext::log1p(half(0.0f))), 0.0f);
268  VERIFY_IS_EQUAL(float(log1p(half(0.0f))), 0.0f);
269  VERIFY_IS_APPROX(float(numext::log1p(half(10.0f))), 2.3978953f);
270  VERIFY_IS_APPROX(float(log1p(half(10.0f))), 2.3978953f);
271 
272  VERIFY_IS_APPROX(numext::fmod(half(5.3f), half(2.0f)), half(1.3f));
273  VERIFY_IS_APPROX(fmod(half(5.3f), half(2.0f)), half(1.3f));
274  VERIFY_IS_APPROX(numext::fmod(half(-18.5f), half(-4.2f)), half(-1.7f));
275  VERIFY_IS_APPROX(fmod(half(-18.5f), half(-4.2f)), half(-1.7f));
276 }
277 
279 {
280  VERIFY_IS_APPROX(numext::cos(half(0.0f)), half(cosf(0.0f)));
281  VERIFY_IS_APPROX(cos(half(0.0f)), half(cosf(0.0f)));
283  // VERIFY_IS_APPROX(numext::cos(half(EIGEN_PI/2)), half(cosf(EIGEN_PI/2)));
284  // VERIFY_IS_APPROX(numext::cos(half(3*EIGEN_PI/2)), half(cosf(3*EIGEN_PI/2)));
285  VERIFY_IS_APPROX(numext::cos(half(3.5f)), half(cosf(3.5f)));
286 
287  VERIFY_IS_APPROX(numext::sin(half(0.0f)), half(sinf(0.0f)));
288  VERIFY_IS_APPROX(sin(half(0.0f)), half(sinf(0.0f)));
289  // VERIFY_IS_APPROX(numext::sin(half(EIGEN_PI)), half(sinf(EIGEN_PI)));
292  VERIFY_IS_APPROX(numext::sin(half(3.5f)), half(sinf(3.5f)));
293 
294  VERIFY_IS_APPROX(numext::tan(half(0.0f)), half(tanf(0.0f)));
295  VERIFY_IS_APPROX(tan(half(0.0f)), half(tanf(0.0f)));
296  // VERIFY_IS_APPROX(numext::tan(half(EIGEN_PI)), half(tanf(EIGEN_PI)));
297  // VERIFY_IS_APPROX(numext::tan(half(EIGEN_PI/2)), half(tanf(EIGEN_PI/2)));
298  //VERIFY_IS_APPROX(numext::tan(half(3*EIGEN_PI/2)), half(tanf(3*EIGEN_PI/2)));
299  VERIFY_IS_APPROX(numext::tan(half(3.5f)), half(tanf(3.5f)));
300 }
301 
303 {
304  typedef Array<half,1,Dynamic> ArrayXh;
305  Index size = internal::random<Index>(1,10);
306  Index i = internal::random<Index>(0,size-1);
307  ArrayXh a1 = ArrayXh::Random(size), a2 = ArrayXh::Random(size);
308  VERIFY_IS_APPROX( a1+a1, half(2)*a1 );
309  VERIFY( (a1.abs() >= half(0)).all() );
310  VERIFY_IS_APPROX( (a1*a1).sqrt(), a1.abs() );
311 
312  VERIFY( ((a1.min)(a2) <= (a1.max)(a2)).all() );
313  a1(i) = half(-10.);
314  VERIFY_IS_EQUAL( a1.minCoeff(), half(-10.) );
315  a1(i) = half(10.);
316  VERIFY_IS_EQUAL( a1.maxCoeff(), half(10.) );
317 
318  std::stringstream ss;
319  ss << a1;
320 }
321 
323 {
324  typedef Matrix<half,Dynamic,Dynamic> MatrixXh;
325  Index rows = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
326  Index cols = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
327  Index depth = internal::random<Index>(1,EIGEN_TEST_MAX_SIZE);
328  MatrixXh Ah = MatrixXh::Random(rows,depth);
329  MatrixXh Bh = MatrixXh::Random(depth,cols);
330  MatrixXh Ch = MatrixXh::Random(rows,cols);
331  MatrixXf Af = Ah.cast<float>();
332  MatrixXf Bf = Bh.cast<float>();
333  MatrixXf Cf = Ch.cast<float>();
334  VERIFY_IS_APPROX(Ch.noalias()+=Ah*Bh, (Cf.noalias()+=Af*Bf).cast<half>());
335 }
336 
338 {
340  for(int i = 0; i < g_repeat; i++) {
348  }
349 }
test_product
void test_product()
Definition: half_float.cpp:322
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
EIGEN_PI
#define EIGEN_PI
Definition: Eigen/src/Core/MathFunctions.h:16
Eigen::half_impl::__half_raw
Definition: Half.h:87
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
VERIFY_HALF_BITS_EQUAL
#define VERIFY_HALF_BITS_EQUAL(h, bits)
Definition: half_float.cpp:14
ceres::sin
Jet< T, N > sin(const Jet< T, N > &f)
Definition: jet.h:439
VERIFY_IS_EQUAL
#define VERIFY_IS_EQUAL(a, b)
Definition: main.h:386
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
Eigen::Array
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:45
log
const EIGEN_DEVICE_FUNC LogReturnType log() const
Definition: ArrayCwiseUnaryOps.h:128
isnan
#define isnan(X)
Definition: main.h:93
test_array
void test_array()
Definition: half_float.cpp:302
exp
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
Definition: ArrayCwiseUnaryOps.h:97
rows
int rows
Definition: Tutorial_commainit_02.cpp:1
ceres::cos
Jet< T, N > cos(const Jet< T, N > &f)
Definition: jet.h:426
size
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
ss
static std::stringstream ss
Definition: testBTree.cpp:31
epsilon
static double epsilon
Definition: testRot3.cpp:37
EIGEN_DECLARE_TEST
EIGEN_DECLARE_TEST(half_float)
Definition: half_float.cpp:337
align_3::a1
Point2 a1
Definition: testPose2.cpp:769
expm1
double expm1(double x)
Definition: unity.c:106
Eigen::numext::uint16_t
::uint16_t uint16_t
Definition: Meta.h:54
test_basic_functions
void test_basic_functions()
Definition: half_float.cpp:225
Eigen::bfloat16_impl::fmod
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 fmod(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:567
test_trigonometric_functions
void test_trigonometric_functions()
Definition: half_float.cpp:278
test_comparison
void test_comparison()
Definition: half_float.cpp:187
test_arithmetic
void test_arithmetic()
Definition: half_float.cpp:162
Eigen::all
static const Eigen::internal::all_t all
Definition: IndexedViewHelper.h:171
test_conversion
void test_conversion()
Definition: half_float.cpp:24
log1p
double log1p(double x)
Definition: unity.c:49
Eigen::g_repeat
static int g_repeat
Definition: main.h:169
tan
const EIGEN_DEVICE_FUNC TanReturnType tan() const
Definition: ArrayCwiseUnaryOps.h:269
ceres::pow
Jet< T, N > pow(const Jet< T, N > &f, double g)
Definition: jet.h:570
y
Scalar * y
Definition: level1_cplx_impl.h:124
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
VERIFY_IS_APPROX
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:15
Eigen::ArrayBase::pow
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_pow_op< typename Derived::Scalar, typename ExponentDerived::Scalar >, const Derived, const ExponentDerived > pow(const Eigen::ArrayBase< Derived > &x, const Eigen::ArrayBase< ExponentDerived > &exponents)
Definition: GlobalFunctions.h:143
main.h
align_3::a2
Point2 a2
Definition: testPose2.cpp:770
EIGEN_TEST_MAX_SIZE
#define EIGEN_TEST_MAX_SIZE
Definition: boostmultiprec.cpp:16
min
#define min(a, b)
Definition: datatypes.h:19
Half.h
ceil
const EIGEN_DEVICE_FUNC CeilReturnType ceil() const
Definition: ArrayCwiseUnaryOps.h:495
gtsam.examples.DogLegOptimizerExample.float
float
Definition: DogLegOptimizerExample.py:113
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: 3rdparty/Eigen/Eigen/src/Core/Matrix.h:178
abs
#define abs(x)
Definition: datatypes.h:17
cols
int cols
Definition: Tutorial_commainit_02.cpp:1
depth
static double depth
Definition: testSphericalCamera.cpp:64
Eigen::half
Definition: Half.h:142
test_numtraits
void test_numtraits()
Definition: half_float.cpp:123
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
ceres::sqrt
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:418
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
floor
const EIGEN_DEVICE_FUNC FloorReturnType floor() const
Definition: ArrayCwiseUnaryOps.h:481
CALL_SUBTEST
#define CALL_SUBTEST(FUNC)
Definition: main.h:399
VERIFY
#define VERIFY(a)
Definition: main.h:380
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
isinf
#define isinf(X)
Definition: main.h:94


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:40