Recreated initializeRandomlyAt
parent
5a6bfed42c
commit
fc7944b42d
|
@ -2960,6 +2960,7 @@ class ShonanAveraging2 {
|
||||||
|
|
||||||
// Advanced API
|
// Advanced API
|
||||||
gtsam::NonlinearFactorGraph buildGraphAt(size_t p) const;
|
gtsam::NonlinearFactorGraph buildGraphAt(size_t p) const;
|
||||||
|
gtsam::Values initializeRandomlyAt(size_t p) const;
|
||||||
double costAt(size_t p, const gtsam::Values& values) const;
|
double costAt(size_t p, const gtsam::Values& values) const;
|
||||||
pair<double, Vector> computeMinEigenVector(const gtsam::Values& values) const;
|
pair<double, Vector> computeMinEigenVector(const gtsam::Values& values) const;
|
||||||
bool checkOptimality(const gtsam::Values& values) const;
|
bool checkOptimality(const gtsam::Values& values) const;
|
||||||
|
@ -3004,6 +3005,7 @@ class ShonanAveraging3 {
|
||||||
|
|
||||||
// Advanced API
|
// Advanced API
|
||||||
gtsam::NonlinearFactorGraph buildGraphAt(size_t p) const;
|
gtsam::NonlinearFactorGraph buildGraphAt(size_t p) const;
|
||||||
|
gtsam::Values initializeRandomlyAt(size_t p) const;
|
||||||
double costAt(size_t p, const gtsam::Values& values) const;
|
double costAt(size_t p, const gtsam::Values& values) const;
|
||||||
pair<double, Vector> computeMinEigenVector(const gtsam::Values& values) const;
|
pair<double, Vector> computeMinEigenVector(const gtsam::Values& values) const;
|
||||||
bool checkOptimality(const gtsam::Values& values) const;
|
bool checkOptimality(const gtsam::Values& values) const;
|
||||||
|
|
|
@ -749,10 +749,23 @@ Values ShonanAveraging<d>::initializeRandomly(std::mt19937 &rng) const {
|
||||||
return initial;
|
return initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
template <size_t d> Values ShonanAveraging<d>::initializeRandomly() const {
|
||||||
|
return initializeRandomly(kRandomNumberGenerator);
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template <size_t d>
|
template <size_t d>
|
||||||
Values ShonanAveraging<d>::initializeRandomly() const {
|
Values ShonanAveraging<d>::initializeRandomlyAt(size_t p,
|
||||||
return ShonanAveraging<d>::initializeRandomly(kRandomNumberGenerator);
|
std::mt19937 &rng) const {
|
||||||
|
const Values randomRotations = initializeRandomly(rng);
|
||||||
|
return LiftTo<Rot3>(p, randomRotations); // lift to p!
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
template <size_t d>
|
||||||
|
Values ShonanAveraging<d>::initializeRandomlyAt(size_t p) const {
|
||||||
|
return initializeRandomlyAt(p, kRandomNumberGenerator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
|
@ -235,6 +235,15 @@ public:
|
||||||
*/
|
*/
|
||||||
NonlinearFactorGraph buildGraphAt(size_t p) const;
|
NonlinearFactorGraph buildGraphAt(size_t p) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create initial Values of type SO(p)
|
||||||
|
* @param p the dimensionality of the rotation manifold
|
||||||
|
*/
|
||||||
|
Values initializeRandomlyAt(size_t p, std::mt19937 &rng) const;
|
||||||
|
|
||||||
|
/// Version of initializeRandomlyAt with fixed random seed.
|
||||||
|
Values initializeRandomlyAt(size_t p) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate cost for SO(p)
|
* Calculate cost for SO(p)
|
||||||
* Values should be of type SO(p)
|
* Values should be of type SO(p)
|
||||||
|
|
Loading…
Reference in New Issue