AFF --- A container for numbers (array) by Friederich and Forbriger.

◆ series_from_array() [1/2]

template<class T >
aff::Series<T> aff::series_from_array ( const aff::Array< T > &  array)

create a series container from an array container.

Examples:
tests/helpertest.cc.

Definition at line 53 of file converters.h.

References AFF_assert, aff::util::is_dense_1D_array(), aff::Array< T >::representation(), and aff::Array< T >::shape().

Referenced by main().

54  {
55  typedef aff::Series<T> Tseries;
56  typedef aff::Array<T> Tarray;
57  typename Tarray::Tshape shape(array.shape());
59  "ERROR: array is not suitable to be converted to series");
60  typename Tseries::Trepresentation representation=array.representation();
61  typename Tseries::Tshape seriesshape(shape.first(0),
62  shape.last(0),
63  shape.first_offset());
64  Tseries retval(seriesshape, representation);
65  return retval;
66  } // aff::Series<T> series_from_array(const aff::Array<T>& array)
const Trepresentation & representation() const
return full access representation
Definition: array.h:494
bool is_dense_1D_array(const aff::Strided &shape)
check whether array shape describes a 1D array with dense layout in the memory.
Definition: strided.cc:302
#define AFF_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: error.h:162
Full multi-dimensional array functionality.This is the full array class template. It adds no addition...
Definition: array.h:151
A base class for time series and spectra.
Definition: series.h:266
const Tshape & shape() const
provide access to const shape
Definition: array.h:318
Here is the call graph for this function:
Here is the caller graph for this function: