gtsam
Loading...
Searching...
No Matches
DummyFactor.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include <gtsam/config.h>
13
14#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V43
15
16#include <gtsam_unstable/dllexport.h>
18
19namespace gtsam {
20
25class GTSAM_UNSTABLE_EXPORT DummyFactor : public NonlinearFactor {
26protected:
27
28 // Store the dimensions of the variables and the dimension of the full system
29 std::vector<size_t> dims_;
30 size_t rowDim_;
31
32public:
33
35 DummyFactor() : rowDim_(1) { }
36
38 DummyFactor(const Key& key1, size_t dim1, const Key& key2, size_t dim2);
39
40 ~DummyFactor() override {}
41
42 // testable
43
45 void print(const std::string& s = "", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
46
48 bool equals(const NonlinearFactor& f, double tol = 1e-9) const override;
49
50 // access
51
52 const std::vector<size_t>& dims() const { return dims_; }
53
54 // factor interface
55
59 double error(const Values& c) const override { return 0.0; }
60
62 size_t dim() const override { return rowDim_; }
63
65 std::shared_ptr<GaussianFactor> linearize(const Values& c) const override;
66
73 NonlinearFactor::shared_ptr clone() const override {
74 return std::static_pointer_cast<NonlinearFactor>(
75 NonlinearFactor::shared_ptr(new DummyFactor(*this)));
76 }
77
78};
79
80} // \namespace gtsam
81
82#endif // GTSAM_ALLOW_DEPRECATED_SINCE_V43
83
84
85
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
Nonlinear factor base class.
Definition NonlinearFactor.h:70