Commit 02fbe149 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Further modifications and bug fixes from coverage tests

parent 8fdde640
......@@ -406,7 +406,7 @@ build-gnu-gcov:
- mkdir build_gcov/
- cd build_gcov/
- cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILE=gcc -DCMAKE_BUILD_TYPE="Coverage" -DBUILD_TESTS=ON -DBUILD_PARAMS=ON -DBUILD_PYTHON=ON -DCMAKE_INSTALL_PREFIX=../gnu_gcov/ ../
- make
- make install
- make coverage_xml
- cd ../
coverage: /^\s*lines:\s*\d+.\d+\%/
......
......@@ -64,6 +64,8 @@ protected:
std::string _expr; //!< Expression of the feature
public:
using Node::n_leaves;
using Node::rung;
/**
* @brief Base Constructor
* @details This is only used for serialization
......@@ -286,7 +288,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(int cur_rung = 0) const {return cur_rung;}
inline int rung(int cur_rung) const {return cur_rung;}
/**
* @brief Update the primary feature decomposition of a feature
......
......@@ -26,7 +26,7 @@ ModelNode::ModelNode()
ModelNode::ModelNode(
const unsigned long int feat_ind,
const unsigned long int rung,
const int rung,
const std::string expr,
const std::string latex_expr,
const std::string postfix_expr,
......
......@@ -77,6 +77,7 @@ protected:
int _n_leaves; //!< The number of primary features (non-unique) this feature contains (The number of leaves of the Binary Expression Tree)
public:
using Node::n_leaves;
using Node::rung;
/**
* @brief Base Constructor
* @details This is only used for serialization
......@@ -99,7 +100,7 @@ public:
*/
ModelNode(
const unsigned long int feat_ind,
const unsigned long int rung,
const int rung,
const std::string expr,
const std::string latex_expr,
const std::string postfix_expr,
......@@ -335,7 +336,7 @@ public:
/**
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*/
inline int rung(int cur_rung = 0) const {return _rung;}
inline int rung(int cur_rung) const {return _rung;}
/**
* @brief Update the primary feature decomposition of a feature
......@@ -401,8 +402,8 @@ public:
* @param unit (Unit) Unit of the feature
*/
ModelNode(
const unsigned long int feat_ind,
const unsigned long int rung,
const int feat_ind,
const int rung,
const std::string expr,
const std::string latex_expr,
const std::string postfix_expr,
......@@ -429,8 +430,8 @@ public:
* @param unit (Unit) Unit of the feature
*/
ModelNode(
const unsigned long int feat_ind,
const unsigned long int rung,
const int feat_ind,
const int rung,
const std::string expr,
const std::string latex_expr,
const std::string postfix_expr,
......
......@@ -329,13 +329,20 @@ public:
*/
virtual NODE_TYPE type() const = 0;
/**
* @brief Return the rung of the feature (Height of the binary expression tree - 1)
*
* @param cur_rung (int) A recursive helper counter for the rung
*/
virtual int rung(const int cur_rung) const = 0;
// DocString: node_rung
/**
* @brief Return the rung of the feature (Height of the binary expression tree - 1)
*
* @param cur_rung (int) A recursive helper counter for the rung
*/
virtual int rung(const int cur_rung = 0) const = 0;
inline int rung() const {return rung(0);}
/**
* @brief Get the primary feature decomposition of a feature
......
......@@ -72,6 +72,7 @@ protected:
public:
using Node::n_leaves;
using Node::rung;
/**
* @brief Base Constructor
* @details This is only used for serialization
......@@ -331,7 +332,7 @@ public:
*
* @param cur_rung (int) A recursive helper counter for the rung
*/
virtual int rung(int cur_rung = 0) const = 0;
virtual int rung(int cur_rung) const = 0;
/**
* @brief Returns the type of node this is
......
......@@ -47,6 +47,7 @@ class AbsNode: public OperatorNode<1>
ar & boost::serialization::base_object<OperatorNode>(*this);
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -132,7 +133,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -48,6 +48,7 @@ class AbsDiffNode: public OperatorNode<2>
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -138,7 +139,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return std::max(_feats[0]->rung(cur_rung + 1), _feats[1]->rung(cur_rung + 1));}
inline int rung(const int cur_rung) const {return std::max(_feats[0]->rung(cur_rung + 1), _feats[1]->rung(cur_rung + 1));}
/**
* @brief Returns the type of node this is
......
......@@ -47,6 +47,7 @@ class AddNode: public OperatorNode<2>
ar & boost::serialization::base_object<OperatorNode>(*this);
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -122,7 +123,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return std::max(_feats[0]->rung(cur_rung + 1), _feats[1]->rung(cur_rung + 1));}
inline int rung(const int cur_rung) const {return std::max(_feats[0]->rung(cur_rung + 1), _feats[1]->rung(cur_rung + 1));}
/**
* @brief Get the valid LaTeX expression that represents the feature
......
......@@ -47,6 +47,7 @@ class CbNode: public OperatorNode<1>
ar & boost::serialization::base_object<OperatorNode>(*this);
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -132,7 +133,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -47,6 +47,7 @@ class CbrtNode: public OperatorNode<1>
ar & boost::serialization::base_object<OperatorNode>(*this);
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -132,7 +133,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -47,6 +47,7 @@ class CosNode: public OperatorNode<1>
ar & boost::serialization::base_object<OperatorNode>(*this);
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -132,7 +133,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -47,6 +47,7 @@ class DivNode: public OperatorNode<2>
ar & boost::serialization::base_object<OperatorNode>(*this);
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -137,7 +138,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return std::max(_feats[0]->rung(cur_rung + 1), _feats[1]->rung(cur_rung + 1));}
inline int rung(const int cur_rung) const {return std::max(_feats[0]->rung(cur_rung + 1), _feats[1]->rung(cur_rung + 1));}
/**
* @brief Returns the type of node this is
......
......@@ -47,6 +47,7 @@ class ExpNode: public OperatorNode<1>
ar & boost::serialization::base_object<OperatorNode>(*this);
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -132,7 +133,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -43,6 +43,7 @@ class InvNode: public OperatorNode<1>
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -129,7 +130,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -47,6 +47,7 @@ class LogNode: public OperatorNode<1>
ar & boost::serialization::base_object<OperatorNode>(*this);
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -138,7 +139,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -48,6 +48,7 @@ class MultNode: public OperatorNode<2>
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -137,7 +138,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return std::max(_feats[0]->rung(cur_rung + 1), _feats[1]->rung(cur_rung + 1));}
inline int rung(const int cur_rung) const {return std::max(_feats[0]->rung(cur_rung + 1), _feats[1]->rung(cur_rung + 1));}
/**
* @brief Returns the type of node this is
......
......@@ -48,6 +48,7 @@ class NegExpNode: public OperatorNode<1>
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -133,7 +134,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -48,6 +48,7 @@ class SinNode: public OperatorNode<1>
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -133,7 +134,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
......@@ -48,6 +48,7 @@ class SixPowNode: public OperatorNode<1>
}
public:
using Node::rung;
/**
* @brief Base Constructor
......@@ -133,7 +134,7 @@ public:
* @brief return the rung of the feature (Height of the binary expression tree - 1)
*
*/
inline int rung(const int cur_rung=0) const {return _feats[0]->rung(cur_rung + 1);}
inline int rung(const int cur_rung) const {return _feats[0]->rung(cur_rung + 1);}
/**
* @brief Returns the type of node this is
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment