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

◆ series_from_array() [2/2]

template<class T >
aff::ConstSeries<T> aff::series_from_array ( const aff::ConstArray< T > &  array)

create a series container from an array container.

Definition at line 75 of file converters.h.

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

76  {
77  typedef aff::ConstSeries<T> Tseries;
78  typedef aff::ConstArray<T> Tarray;
79  typename Tarray::Tshape shape(array.shape());
81  "ERROR: array is not suitable to be converted to series");
82  typename Tseries::Trepresentation representation=array.representation();
83  typename Tseries::Tshape seriesshape(shape.first(0),
84  shape.last(0),
85  shape.first_offset());
86  Tseries retval(seriesshape, representation);
87  return retval;
88  } // aff::ConstSeries<T> series_from_array(const aff::ConstArray<T>& array)
const Trepresentation & representation() const
provide restricted access representation
Definition: array.h:324
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
base class
Definition: series.h:105
const Tshape & shape() const
provide access to const shape
Definition: array.h:318
Array base classThis is a multidimensional (array) container that uses a strided memory layout (Fortr...
Definition: array.h:172
Here is the call graph for this function: