test_std_map.py
Go to the documentation of this file.
1 from std_map import X, copy, copy_boost, copy_X, std_map_to_dict
2 
3 t = {"one": 1.0, "two": 2.0}
4 t2 = {"one": 1, "two": 2, "three": 3}
5 
6 assert std_map_to_dict(t) == t
7 assert std_map_to_dict(copy(t)) == t
8 m = copy_boost(t2)
9 assert m.todict() == t2
10 
11 xmap_cpp = copy_X({"one": X(1), "two": X(2)})
12 print(xmap_cpp.todict())
13 x1 = xmap_cpp["one"]
14 x1.val = 11
15 print(xmap_cpp.todict())
16 assert xmap_cpp["one"].val == 11
17 assert xmap_cpp["two"].val == 2
test_CholmodSimplicialLDLT.X
X
Definition: test_CholmodSimplicialLDLT.py:17
print
void print(const Eigen::SparseMatrix< Scalar, Options > &mat)
Definition: sparse_matrix.cpp:50
std_map_to_dict
bp::dict std_map_to_dict(const std::map< std::string, T1 > &map)
Definition: std_map.cpp:11
copy_boost
boost::unordered_map< std::string, T1 > copy_boost(const boost::unordered_map< std::string, T1 > &obj)
Definition: std_map.cpp:26
copy
ReturnMatrix copy(const Eigen::MatrixBase< Matrix > &mat)
Definition: matrix.cpp:131


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Sat Nov 2 2024 02:14:45