LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Member Functions | Private Attributes | List of all members
ndarray::detail::SimpleInitializer< N > Class Template Reference

#include <initialization.h>

Inheritance diagram for ndarray::detail::SimpleInitializer< N >:
ndarray::detail::Initializer< N, SimpleInitializer< N > >

Public Member Functions

template<typename Target >
Target apply () const
 
 SimpleInitializer (Vector< int, N > const &shape)
 
- Public Member Functions inherited from ndarray::detail::Initializer< N, SimpleInitializer< N > >
 operator Array< T, N, C > () const
 
 operator ArrayRef< T, N, C > () const
 

Private Attributes

Vector< int, N > _shape
 

Detailed Description

template<int N>
class ndarray::detail::SimpleInitializer< N >

Definition at line 55 of file initialization.h.

Constructor & Destructor Documentation

template<int N>
ndarray::detail::SimpleInitializer< N >::SimpleInitializer ( Vector< int, N > const &  shape)
inlineexplicit

Definition at line 69 of file initialization.h.

69 : _shape(shape) {}

Member Function Documentation

template<int N>
template<typename Target >
Target ndarray::detail::SimpleInitializer< N >::apply ( ) const
inline

Definition at line 59 of file initialization.h.

59  {
60  typedef detail::ArrayAccess< Target > Access;
61  typedef typename Access::Core Core;
62  typedef typename Access::Element Element;
63  DataOrderEnum order = (ExpressionTraits< Target >::RMC::value < 0) ? COLUMN_MAJOR : ROW_MAJOR;
64  int total = _shape.product();
65  std::pair<Manager::Ptr,Element*> p = SimpleManager<Element>::allocate(total);
66  return Access::construct(p.second, Core::create(_shape, order, p.first));
67  }
static Ptr create(Vector< int, M > const &shape, Vector< int, M > const &strides, Manager::Ptr const &manager=Manager::Ptr())
Create a Core::Ptr with the given shape, strides, and manager.
Definition: Core.h:68
T product() const
Return the product of all elements.
Definition: Vector.h:216
Vector< T, M > first() const
Create a new Vector from the first M elements of this.
Definition: Vector.h:159
DataOrderEnum
An enumeration for stride computation.
Definition: ndarray_fwd.h:60
static std::pair< Manager::Ptr, T * > allocate(int size)
Definition: Manager.h:71

Member Data Documentation

template<int N>
Vector<int,N> ndarray::detail::SimpleInitializer< N >::_shape
private

Definition at line 72 of file initialization.h.


The documentation for this class was generated from the following file: