Go to the documentation of this file.
58 static inline double zero() {
return 0.0; }
59 static inline double one() {
return 1.0; }
60 static inline double add(
const double&
a,
const double&
b) {
63 static inline double max(
const double&
a,
const double&
b) {
66 static inline double mul(
const double&
a,
const double&
b) {
69 static inline double div(
const double&
a,
const double&
b) {
72 static inline double id(
const double&
x) {
return x; }
126 (
const std::vector<typename Base::LabelC>& labelCs,
127 const std::vector<double>& ys) {
129 Base::create(labelCs.begin(), labelCs.end(), ys.begin(), ys.end());
141 (
const std::vector<typename Base::LabelC>& labelCs,
142 const std::string&
table) {
144 std::vector<double> ys;
145 std::istringstream iss(
table);
146 std::copy(std::istream_iterator<double>(iss),
147 std::istream_iterator<double>(), std::back_inserter(ys));
151 Base::create(labelCs.begin(), labelCs.end(), ys.begin(), ys.end());
161 template <
typename Iterator>
173 template <
typename M>
175 const std::map<M, L>& map) {
177 std::function<
L(
const M&)> L_of_M = [&map](
const M& label) ->
L {
178 return map.at(label);
180 std::function<double(
const double&)> op =
Ring::id;
214 std::stringstream
ss;
215 ss << std::setw(4) << std::setprecision(8) <<
v;
231 template <
typename T>
233 :
public Testable<AlgebraicDecisionTree<T>> {};
NodePtr create(It begin, It end, ValueIt beginY, ValueIt endY) const
static double id(const double &x)
std::function< std::string(Key)> LabelFormatter
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Concept check for values that can be used in unit tests.
AlgebraicDecisionTree(double leaf=1.0)
bool equals(const DecisionTree &other, const CompareFunc &compare=&DefaultCompare) const
AlgebraicDecisionTree operator/(const AlgebraicDecisionTree &g) const
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
static std::string DefaultFormatter(const L &x)
Default method used by labelFormatter or valueFormatter when printing.
static double max(const double &a, const double &b)
void print(const std::string &s, const LabelFormatter &labelFormatter, const ValueFormatter &valueFormatter) const
GTSAM-style print.
bool equals(const AlgebraicDecisionTree &other, double tol=1e-9) const
Equality method customized to value type double.
static std::stringstream ss
AlgebraicDecisionTree operator+(const AlgebraicDecisionTree &g) const
NodePtr root_
A DecisionTree just contains the root. TODO(dellaert): make protected.
graph add(PriorFactor< Pose2 >(1, priorMean, priorNoise))
AlgebraicDecisionTree(const typename Base::LabelC &labelC, double y1, double y2)
Create a new leaf function splitting on a variable.
static double div(const double &a, const double &b)
DecisionTree apply(const Unary &op) const
AlgebraicDecisionTree sum(const L &label, size_t cardinality) const
void g(const string &key, int i)
a decision tree is a function from assignments to values.
AlgebraicDecisionTree(const AlgebraicDecisionTree< M > &other, const std::map< M, L > &map)
void print(const std::string &s="", const typename Base::LabelFormatter &labelFormatter=&DefaultFormatter) const
print method customized to value type double.
AlgebraicDecisionTree(const L &label, double y1, double y2)
std::pair< Key, size_t > LabelC
NodePtr compose(Iterator begin, Iterator end, const L &label) const
Array< int, Dynamic, 1 > v
static double mul(const double &a, const double &b)
static double add(const double &a, const double &b)
DecisionTree combine(const L &label, size_t cardinality, const Binary &op) const
AlgebraicDecisionTree operator*(const AlgebraicDecisionTree &g) const
static const EIGEN_DEPRECATED end_t end
AlgebraicDecisionTree(const Base &add)
static std::string valueFormatter(const double &v)
NodePtr convertFrom(const typename DecisionTree< M, X >::NodePtr &f, std::function< L(const M &)> L_of_M, std::function< Y(const X &)> Y_of_X) const
Convert from a DecisionTree<M, X> to DecisionTree<L, Y>.
AlgebraicDecisionTree(Iterator begin, Iterator end, const L &label)
Create a range of decision trees, splitting on a single variable.
AlgebraicDecisionTree sum(const typename Base::LabelC &labelC) const
Matrix< RealScalar, Dynamic, Dynamic > M
gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:00:25