30 using namespace gtsam;
39 auto model = noiseModel::Isotropic::Sigma(9, 1);
40 auto model2 = noiseModel::Isotropic::Sigma(3, 1);
51 if (
H) *
H = m_ * Matrix::Identity(X.rows() * X.cols(), X.rows() * X.cols());
63 H1->resize(x.size(), A.size());
64 *H1 << I_3x3, I_3x3, I_3x3;
76 double multiplier = 1.0;
88 double multiplier = 2.0;
89 Matrix X = Matrix::Identity(3, 3);
105 double multiplier = 2.0;
118 Matrix X = Matrix::Identity(3, 3);
121 double multiplier = 2.0;
136 Matrix X = Matrix::Identity(2, 2);
138 double multiplier = 2.0;
145 " noise model: unit (9) \n" 146 "FunctorizedFactor(X0)\n" 151 " noise model sigmas: 1 1 1 1 1 1 1 1 1\n";
159 double multiplier = 2.0;
160 Matrix X = Matrix::Identity(3, 3);
163 std::function<Matrix(Matrix, OptionalMatrixType)> functional =
176 double multiplier = 2.0;
177 Matrix X = Matrix::Identity(3, 3);
184 Matrix::Identity(X.rows() * X.cols(), X.rows() * X.cols());
185 return multiplier *
X;
199 Matrix A = Matrix::Identity(3, 3);
204 MakeFunctorizedFactor2<Matrix, Vector>(
keyA,
keyx,
x,
model2, functor);
214 Matrix A = Matrix::Identity(3, 3);
216 Matrix actualH1, actualH2;
218 auto factor = MakeFunctorizedFactor2<Matrix, Vector>(
keyA,
keyx,
x,
model2,
232 Matrix A = Matrix::Identity(3, 3);
236 std::function<Matrix(Matrix, Matrix, OptionalMatrixType, OptionalMatrixType)>
249 Matrix A = Matrix::Identity(3, 3);
255 OptionalJacobian<-1, -1> H2 = {}) {
257 H1->resize(x.size(), A.size());
258 *H1 << I_3x3, I_3x3, I_3x3;
Provides additional testing facilities for common data structures.
MultiplyFunctor(double m)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
bool assert_print_equal(const std::string &expected, const V &actual, const std::string &s="")
Vector operator()(const Matrix &A, const Vector &x, OptionalJacobian<-1, -1 > H1={}, OptionalJacobian<-1, -1 > H2={}) const
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Evaluate derivatives of a nonlinear factor numerically.
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
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 y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange [*:*] noreverse nowriteback set trange [*:*] noreverse nowriteback set urange [*:*] noreverse nowriteback set vrange [*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
static Point2 measurement(323.0, 240.0)
Matrix operator()(const Matrix &X, OptionalJacobian<-1, -1 > H={}) const
#define EXPECT(condition)
double m_
simple multiplier
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Functor that performs Ax where A is a matrix and x is a vector.
cout<< "The eigenvalues of A are:"<< endl<< ces.eigenvalues()<< endl;cout<< "The matrix of eigenvectors, V, is:"<< endl<< ces.eigenvectors()<< endl<< endl;complex< float > lambda
#define EXPECT_CORRECT_FACTOR_JACOBIANS(factor, values, numerical_derivative_step, tolerance)
Check the Jacobians produced by a factor against finite differences.
Functor that takes a matrix and multiplies every element by m.
void insert(Key j, const Value &val)
TEST(FunctorizedFactor, Identity)
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
std::uint64_t Key
Integer nonlinear key type.
void Print(const CONTAINER &keys, const string &s, const KeyFormatter &keyFormatter)