Loading...
Searching...
No Matches
KarcherMeanFactor.h
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
/*
* @file KarcherMeanFactor.h
* @author Frank Dellaert
* @date March 2019
*/
#pragma once
#include <gtsam/base/Matrix.h>
#include <gtsam/linear/JacobianFactor.h>
#include <map>
#include <vector>
namespace gtsam {
template <class T>
T FindKarcherMean(const std::vector<T, Eigen::aligned_allocator<T>> &rotations);
template <class T> T FindKarcherMean(std::initializer_list<T> &&rotations);
template <class T> class KarcherMeanFactor : public NonlinearFactor {
// Compile time dimension: can be -1
enum { D = traits<T>::dimension };
// Runtime dimension: always >=0
size_t d_;
boost::shared_ptr<JacobianFactor> whitenedJacobian_;
public:
template <typename CONTAINER>
KarcherMeanFactor(const CONTAINER &keys, int d = D,
boost::optional<double> beta = boost::none);
~KarcherMeanFactor() override {}
double error(const Values &c) const override { return 0; }
size_t dim() const override { return d_; }
boost::shared_ptr<GaussianFactor> linearize(const Values &c) const override {
return whitenedJacobian_;
}
};
// \KarcherMeanFactor
} // namespace gtsam
Matrix.h
typedef and functions to augment Eigen's MatrixXd
JacobianFactor.h
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::traits
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
gtsam::Factor::keys
const KeyVector & keys() const
Access the factor's involved variable keys.
Definition Factor.h:140
gtsam::NonlinearFactor::NonlinearFactor
NonlinearFactor()
Default constructor for I/O only.
Definition NonlinearFactor.h:58
gtsam::Values
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65
gtsam::KarcherMeanFactor::error
double error(const Values &c) const override
Calculate the error of the factor: always zero.
Definition KarcherMeanFactor.h:69
gtsam::KarcherMeanFactor::KarcherMeanFactor
KarcherMeanFactor(const CONTAINER &keys, int d=D, boost::optional< double > beta=boost::none)
Construct from given keys.
Definition KarcherMeanFactor-inl.h:60
gtsam::KarcherMeanFactor::dim
size_t dim() const override
get the dimension of the factor (number of rows on linearization)
Definition KarcherMeanFactor.h:72
gtsam::KarcherMeanFactor::linearize
boost::shared_ptr< GaussianFactor > linearize(const Values &c) const override
linearize to a GaussianFactor
Definition KarcherMeanFactor.h:75
gtsam::KarcherMeanFactor::~KarcherMeanFactor
~KarcherMeanFactor() override
Destructor.
Definition KarcherMeanFactor.h:66