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
python
gtsam
tests
test_HybridValues.py
Go to the documentation of this file.
1
"""
2
GTSAM Copyright 2010-2022, Georgia Tech Research Corporation,
3
Atlanta, Georgia 30332-0415
4
All Rights Reserved
5
6
See LICENSE for the license information
7
8
Unit tests for Hybrid Values.
9
Author: Shangjie Xue
10
"""
11
# pylint: disable=invalid-name, no-name-in-module, no-member
12
13
from
__future__
import
print_function
14
15
import
unittest
16
17
import
numpy
as
np
18
from
gtsam.symbol_shorthand
import
C, X
19
from
gtsam.utils.test_case
import
GtsamTestCase
20
21
import
gtsam
22
23
24
class
TestHybridValues
(
GtsamTestCase
):
25
"""Unit tests for HybridValues."""
26
27
def
test_basic
(self):
28
"""Test construction and basic methods of hybrid values."""
29
30
hv1 =
gtsam.HybridValues
()
31
hv1.insert(
X
(0), np.ones((3, 1)))
32
hv1.insert(
C
(0), 2)
33
34
hv2 =
gtsam.HybridValues
()
35
hv2.insert(
C
(0), 2)
36
hv2.insert(
X
(0), np.ones((3, 1)))
37
38
self.assertEqual(hv1.atDiscrete(
C
(0)), 2)
39
self.assertEqual(hv1.at(
X
(0))[0], np.ones((3, 1))[0])
40
41
42
if
__name__ ==
"__main__"
:
43
unittest.main()
gtsam::HybridValues
Definition:
HybridValues.h:37
test_HybridValues.TestHybridValues.test_basic
def test_basic(self)
Definition:
test_HybridValues.py:27
gtsam::symbol_shorthand
Definition:
inference/Symbol.h:147
X
#define X
Definition:
icosphere.cpp:20
gtsam::utils.test_case
Definition:
test_case.py:1
C
Matrix< Scalar, Dynamic, Dynamic > C
Definition:
bench_gemm.cpp:50
test_HybridValues.TestHybridValues
Definition:
test_HybridValues.py:24
gtsam::utils.test_case.GtsamTestCase
Definition:
test_case.py:16
gtsam
Author(s):
autogenerated on Wed Mar 19 2025 03:06:17