Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
c
d
e
f
g
i
k
l
m
n
p
q
r
s
t
u
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Classes
Class List
Class Hierarchy
Class Members
All
!
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
!
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
f
k
l
m
n
o
p
r
s
t
v
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
:
a
b
c
d
e
g
h
i
l
m
n
o
p
r
s
t
u
v
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
x
z
Enumerations
Enumerator
b
c
e
f
g
i
l
m
n
o
p
r
s
t
u
v
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
gtsam
linear
tests
testErrors.cpp
Go to the documentation of this file.
1
/* ----------------------------------------------------------------------------
2
3
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
4
* Atlanta, Georgia 30332-0415
5
* All Rights Reserved
6
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8
* See LICENSE for the license information
9
10
* -------------------------------------------------------------------------- */
11
18
#include <
CppUnitLite/TestHarness.h
>
19
#include <
gtsam/base/Testable.h
>
20
#include <
gtsam/linear/Errors.h
>
21
22
using namespace
std
;
23
using namespace
gtsam
;
24
25
/* ************************************************************************* */
26
TEST
(
Errors
,
arithmetic
) {
27
Errors
e
= {
Vector2
(1.0, 2.0),
Vector3
(3.0, 4.0, 5.0)};
28
DOUBLES_EQUAL
(1 + 4 + 9 + 16 + 25,
dot
(
e
,
e
), 1
e
-9);
29
30
axpy
(2.0,
e
,
e
);
31
const
Errors
expected
= {
Vector2
(3.0, 6.0),
Vector3
(9.0, 12.0, 15.0)};
32
CHECK
(
assert_equal
(
expected
,
e
));
33
}
34
35
/* ************************************************************************* */
36
int
main
() {
37
TestResult
tr;
38
return
TestRegistry::runAllTests
(tr);
39
}
40
/* ************************************************************************* */
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition:
TestRegistry.cpp:27
main
int main()
Definition:
testErrors.cpp:36
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Testable.h
Concept check for values that can be used in unit tests.
gtsam::Vector2
Eigen::Vector2d Vector2
Definition:
Vector.h:43
TestHarness.h
gtsam::Vector3
Eigen::Vector3d Vector3
Definition:
Vector.h:44
arithmetic
Annotation to mark enums as an arithmetic type.
Definition:
attr.h:119
TEST
TEST(Errors, arithmetic)
Definition:
testErrors.cpp:26
dot
Scalar EIGEN_BLAS_FUNC() dot(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Definition:
level1_real_impl.h:49
DOUBLES_EQUAL
#define DOUBLES_EQUAL(expected, actual, threshold)
Definition:
Test.h:141
axpy
int EIGEN_BLAS_FUNC() axpy(const int *n, const RealScalar *palpha, const RealScalar *px, const int *incx, RealScalar *py, const int *incy)
Definition:
level1_impl.h:12
cholesky::expected
Matrix expected
Definition:
testMatrix.cpp:916
Errors.h
vector of errors
gtsam::FastList< Vector >
TestResult
Definition:
TestResult.h:26
gtsam
traits
Definition:
SFMdata.h:40
CHECK
#define CHECK(condition)
Definition:
Test.h:108
std
Definition:
BFloat16.h:88
gtsam::assert_equal
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition:
Matrix.cpp:41
gtsam
Author(s):
autogenerated on Wed Mar 19 2025 03:06:34