2013-06-06 23:35:58 +08:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
|
|
2019-02-11 22:39:48 +08:00
|
|
|
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
|
2013-06-06 23:35:58 +08:00
|
|
|
* 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 Factor.cpp
|
|
|
|
|
* @brief The base class for all factors
|
|
|
|
|
* @author Kai Ni
|
|
|
|
|
* @author Frank Dellaert
|
|
|
|
|
* @author Richard Roberts
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// \callgraph
|
|
|
|
|
|
2013-06-06 23:36:11 +08:00
|
|
|
#include <iostream>
|
|
|
|
|
|
2013-07-30 07:55:40 +08:00
|
|
|
#include <gtsam/inference/Factor.h>
|
2013-06-06 23:35:58 +08:00
|
|
|
|
|
|
|
|
namespace gtsam {
|
|
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
2013-07-30 07:55:40 +08:00
|
|
|
void Factor::print(const std::string& s, const KeyFormatter& formatter) const
|
2013-06-06 23:35:58 +08:00
|
|
|
{
|
|
|
|
|
return this->printKeys(s, formatter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
2013-07-30 07:55:40 +08:00
|
|
|
void Factor::printKeys(const std::string& s, const KeyFormatter& formatter) const {
|
2021-04-30 07:43:27 +08:00
|
|
|
std::cout << (s.empty() ? "" : s + " ");
|
|
|
|
|
for (Key key : keys_) std::cout << " " << formatter(key);
|
2013-06-06 23:35:58 +08:00
|
|
|
std::cout << std::endl;
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-06 23:36:11 +08:00
|
|
|
/* ************************************************************************* */
|
2013-07-30 07:55:40 +08:00
|
|
|
bool Factor::equals(const This& other, double tol) const {
|
2013-06-06 23:36:11 +08:00
|
|
|
return keys_ == other.keys_;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-11 05:12:17 +08:00
|
|
|
/* ************************************************************************* */
|
|
|
|
|
double Factor::error(const HybridValues& c) const {
|
|
|
|
|
throw std::runtime_error("Factor::error is not implemented");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2016-05-21 11:41:22 +08:00
|
|
|
}
|