| 500 | double piecewise_function::start() const { return start_; } |
| 501 | double piecewise_function::end() const { return start_ + length(); } |
| 502 | double piecewise_function::length() const { |
| 503 | return std::accumulate(spans_.begin(), spans_.end(), 0.0, [](const auto& v, const auto& s) { return v + s->length(); }); |
| 504 | |
| 505 | // this is a secondary option where we only compute length once and cache it. |
| 506 | // mutex is needed to prevent interruption of the accumulation if there is multi-threading |
| 507 | // skipping this detail for now and just adding up the span lengths every time |
| 508 | //if (!length_.has_value()) { |
| 509 | // length_ = std::accumulate(spans_.begin(), spans_.end(), 0.0, [](const auto& v, const auto& s) { return v + s->length(); }); |
| 510 | //} |
| 511 | //return *length_; |
| 512 | } |
| 513 | |
| 514 | |
| 515 | gradient_function::gradient_function(piecewise_function::const_ptr horizontal, piecewise_function::const_ptr vertical, const IfcUtil::IfcBaseInterface* instance) : |
no test coverage detected