Go to the documentation of this file.
30 for(
const Key&
key: gaussian->keys()) {
46 :
Base(jacobian, lin_points) {
49 size_t *dims = (
size_t *)alloca(
sizeof(
size_t) * (jacobian->size() + 1));
52 dims[index++] = jacobian->getDim(
iter);
59 Ab_.
matrix() = jacobian->augmentedJacobian();
65 std::cout <<
s << std::endl;
67 std::cout <<
"Nonlinear Keys: ";
69 std::cout << keyFormatter(
key) <<
" ";
70 std::cout << std::endl;
73 std::cout <<
"A[" << keyFormatter(*
key) <<
"]=\n" <<
A(*
key) << std::endl;
75 std::cout <<
"b=\n" <<
b() << std::endl;
100 return 0.5 * errorVector.dot(errorVector);
104 std::shared_ptr<GaussianFactor>
108 std::vector<std::pair<Key, Matrix> > terms;
110 terms.push_back(std::make_pair(
key, this->
A(
key)));
129 errorVector +=
A *
d;
144 :
Base(hessian, lin_points), info_(hessian->
info()) {}
149 std::cout <<
s << std::endl;
151 std::cout <<
"Nonlinear Keys: ";
153 std::cout << keyFormatter(
key) <<
" ";
154 std::cout << std::endl;
168 thisMatrix(thisMatrix.rows()-1, thisMatrix.cols()-1) = 0.0;
169 Matrix rhsMatrix =
e->info_.selfadjointView();
170 rhsMatrix(rhsMatrix.rows()-1, rhsMatrix.cols()-1) = 0.0;
186 for(
unsigned int i = 0;
i < this->
size(); ++
i){
191 index += linPt.
dim();
199 return 0.5 * (
f - 2.0 * xtg + xGx);
203 std::shared_ptr<GaussianFactor>
209 for(
unsigned int i = 0;
i < this->
size(); ++
i){
214 index += linPt.
dim();
224 std::vector<Vector> gs;
234 std::vector<Matrix> Gs;
Expression of a fixed-size or dynamic-size block.
A Gaussian factor using the canonical parameters (information form)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
SymmetricBlockMatrix info_
virtual bool equals(const NonlinearFactor &f, double tol=1e-9) const
size_t dim() const override
Block range(DenseIndex startBlock, DenseIndex endBlock)
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
Eigen::SelfAdjointView< constBlock, Eigen::Upper > selfadjointView(DenseIndex I, DenseIndex J) const
Return the square sub-matrix that contains blocks(i:j, i:j).
virtual size_t dim() const =0
std::shared_ptr< This > shared_ptr
A shared_ptr to this class.
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
const_iterator begin() const
size_t dim() const override
double error(const Values &c) const override
virtual Vector localCoordinates_(const Value &value) const =0
const ValueType at(Key j) const
void print(const Matrix &A, const string &s, ostream &stream)
LinearizedGaussianFactor()=default
LinearizedHessianFactor()
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Eigen::SelfAdjointView< constBlock, Eigen::Upper > squaredTerm() const
Vector error_vector(const Values &c) const
std::shared_ptr< This > shared_ptr
shared_ptr to this class
std::shared_ptr< GaussianFactor > linearize(const Values &c) const override
static shared_ptr Create(size_t dim)
LinearizedJacobianFactor()
bool equals(const Values &other, double tol=1e-9) const
DenseIndex nBlocks() const
Block count.
DenseIndex nBlocks() const
Block count.
constColumn linearTerm() const
const_iterator end() const
void g(const string &key, int i)
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 offset
const gtsam::Symbol key('X', 0)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
double error(const Values &c) const override
const constBVector b() const
KeyVector::const_iterator const_iterator
Const iterator over keys.
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
const KeyVector & keys() const
Access the factor's involved variable keys.
iterator iter(handle obj)
ptrdiff_t DenseIndex
The index type for Eigen objects.
const Matrix & matrix() const
Eigen::SelfAdjointView< Block, Eigen::Upper > diagonalBlock(DenseIndex J)
Return the J'th diagonal block as a self adjoint view.
void insert(Key j, const Value &val)
double constantTerm() const
const constABlock A() const
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
std::shared_ptr< This > shared_ptr
shared_ptr to this class
DenseIndex getDim(DenseIndex block) const
Number of dimensions for variable on this diagonal block.
std::shared_ptr< GaussianFactor > linearize(const Values &c) const override
constBlock aboveDiagonalBlock(DenseIndex I, DenseIndex J) const
Get block above the diagonal (I, J).
std::uint64_t Key
Integer nonlinear key type.
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
A dummy factor that allows a linear factor to act as a nonlinear factor.
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:55