TS++ library: time series library

◆ synchronize_nsamples()

template<typename T >
void ts::TimeSeriesCollection< T >::synchronize_nsamples ( )

Synchronize header with series.

Set actual number of samples and nsamples in header to the smaller of both.

Definition at line 158 of file tscollection.h.

159  {
160  typename Tbase::iterator i_series=this->begin();
161  while (i_series != this->end())
162  {
163  const unsigned int& header_nsamples=i_series->header.nsamples;
164  unsigned int series_nsamples=i_series->size();
165  unsigned int nsamples=
166  series_nsamples < header_nsamples
167  ? series_nsamples : header_nsamples;
168  i_series->header.nsamples=nsamples;
169  i_series->setlastindex(i_series->f()+nsamples-1);
170  ++i_series;
171  }
172  } // void TimeSeriesCollection<T>::synchronize_nsamples()