37 throw Elements::Exception() <<
"Invalid number of knots(" << m_knots.size() <<
")-functions(" << m_functions.size()
47 if (*knotsIter < *(knotsIter - 1)) {
48 throw Elements::Exception(
"knots must be increasing");
95double Piecewise::integrate(
const double x1,
const double x2)
const {
109 if (knotIter != m_knots.begin()) {
112 auto functionIter = m_functions.begin() + (knotIter - m_knots.begin());
113 while (++knotIter != m_knots.end()) {
114 auto prevKnotIter = knotIter - 1;
115 if (max <= *prevKnotIter) {
118 if (min < *knotIter) {
119 double down = (min > *prevKnotIter) ? min : *prevKnotIter;
120 double up = (max < *knotIter) ? max : *knotIter;
125 return direction * result;