14 this->reserve(obj.size());
15 for (
auto const& p : obj)
21 this->reserve(obj.size());
22 for (
auto const& p : obj)
30 end_step =
size() - 1;
33 if (start_step >= end_step)
throw GeoAlgoException(
"Cannot have start step >= end step!");
38 if (
size() < 2)
return 0;
41 for (
size_t i = start_step; i < end_step; ++i)
43 length += (*
this)[i]._Dist_((*
this)[i + 1]);
51 if (
size() < 2)
return false;
54 for (
size_t i = 0; i <
size() - 1; ++i) {
56 length += (*this)[i]._Dist_((*
this)[i + 1]);
58 if (length > ref)
return true;
67 if (!(
size() && obj == (*rbegin()))) std::vector<geoalgo::Point_t>::push_back(obj);
74 if ((*(this->
begin())).
size() != obj.size()) {
76 std::ostringstream msg;
77 msg <<
"<<" << __FUNCTION__ <<
">>" 78 <<
" size mismatch: " << (*(this->
begin())).size() <<
" != " << obj.size() << std::endl;
86 if (!
size() || !(obj.size()))
return;
90 std::ostringstream msg;
91 msg <<
"<<" << __FUNCTION__ <<
">>" 92 <<
" size mismatch: " << (*(this->
begin())).size() <<
" != " << (*obj.begin()).
size()
101 if (
size() < (i + 2)) {
102 std::ostringstream msg;
103 msg <<
"<<" << __FUNCTION__ <<
">>" 104 <<
" length=" <<
size() <<
" is too short to find a direction @ index=" << i << std::endl;
112 return ((*
this)[i + 1] - (*
this)[i]);
void compat(const Point_t &obj) const
Dimensionality check function w/ Trajectory.
Class def header for a class GeoAlgoException.
Trajectory(size_t npoints=0, size_t ndimension=0)
Default ctor to specify # points and dimension of each point.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
void push_back(const Point_t &obj)
push_back overrie w/ dimensionality check
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
double Length(size_t start_step=0, size_t end_step=0) const
The summed-length along all trajectory points.
Vector Dir(size_t i=0) const
The direction at a specified trajectory point.
bool IsLonger(double) const
Check if the trajectory is longer than specified value.
Class def header for a class Trajectory.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Vector _Dir_(size_t i) const
Returns a direction vector at a specified trajectory point w/o size check.