39 static inline double zero() {
42 static inline double one() {
45 static inline double add(
const double&
a,
const double&
b) {
48 static inline double max(
const double&
a,
const double&
b) {
51 static inline double mul(
const double&
a,
const double&
b) {
54 static inline double div(
const double&
a,
const double&
b) {
57 static inline double id(
const double&
x) {
72 Super(label, y1, y2) {
77 Super(labelC, y1, y2) {
82 (
const std::vector<typename Super::LabelC>& labelCs,
const std::vector<double>& ys) {
89 (
const std::vector<typename Super::LabelC>& labelCs,
const std::string&
table) {
91 std::vector<double> ys;
92 std::istringstream iss(
table);
93 std::copy(std::istream_iterator<double>(iss),
94 std::istream_iterator<double>(), std::back_inserter(ys));
102 template<
typename Iterator>
111 const std::map<M, L>& map) {
112 this->
root_ = this->
template convert<M, double>(other.
root_, map,
AlgebraicDecisionTree(const Super &add)
static double add(const double &a, const double &b)
DecisionTree apply(const Unary &op) const
static double max(const double &a, const double &b)
void g(const string &key, int i)
AlgebraicDecisionTree operator+(const AlgebraicDecisionTree &g) const
static double mul(const double &a, const double &b)
DecisionTree combine(const L &label, size_t cardinality, const Binary &op) const
NodePtr compose(Iterator begin, Iterator end, const L &label) const
static double div(const double &a, const double &b)
AlgebraicDecisionTree sum(const typename Super::LabelC &labelC) const
AlgebraicDecisionTree(Iterator begin, Iterator end, const L &label)
NodePtr create(It begin, It end, ValueIt beginY, ValueIt endY) const
static double id(const double &x)
AlgebraicDecisionTree(const typename Super::LabelC &labelC, double y1, double y2)
AlgebraicDecisionTree operator*(const AlgebraicDecisionTree &g) const
DecisionTree< L, double > Super
AlgebraicDecisionTree(const AlgebraicDecisionTree< M > &other, const std::map< M, L > &map)
AlgebraicDecisionTree sum(const L &label, size_t cardinality) 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
AlgebraicDecisionTree(const L &label, double y1, double y2)
AlgebraicDecisionTree operator/(const AlgebraicDecisionTree &g) const
std::pair< Key, size_t > LabelC