|
Go to the documentation of this file. 1 #ifndef NPSTAT_ORDEREDPOINTND_HH_
2 #define NPSTAT_ORDEREDPOINTND_HH_
20 template < typename Po int> class OrderedPointND;
22 template < typename Po int>
23 bool operator==( const OrderedPointND<Point>& l,
24 const OrderedPointND<Point>& r);
26 template < typename Po int>
27 bool operator!=( const OrderedPointND<Point>& l,
28 const OrderedPointND<Point>& r);
38 template < class Po int>
42 typedef typename Point::value_type value_type;
52 template < typename Num2>
59 template < typename Num2>
71 inline const Point& point() const { return point_;}
72 inline const value_type* coords() const { return &point_[0];}
73 inline const unsigned long* number() const { return number_;}
74 inline unsigned dim() const { return dim_size;}
75 inline unsigned size() const { return dim_size;}
79 inline value_type& operator[]( unsigned i) { return point_[i];}
98 unsigned long number_[dim_size];
111 template < class Po int1, class Po int2>
113 const unsigned* dimsToUse, unsigned nDimsToUse,
122 template < typename Num2, class Po int>
124 const unsigned* dimsToUse, unsigned nDimsToUse,
128 template < typename Num2, class Po int>
130 const unsigned* dimsToUse, unsigned nDimsToUse,
131 std::vector<Point>* out);
134 template < typename Num1, typename Num2>
136 const unsigned* dimsToUse, unsigned nDimsToUse,
137 std::vector<Num2>* out);
140 template < class Po int>
141 inline std::vector<OrderedPointND<Point> >*
142 makeOrderedPoints( const std::vector<Point>& data)
144 std::vector<OrderedPointND<Point> >* opoints =
145 new std::vector<OrderedPointND<Point> >();
146 const unsigned long sz = data.size();
147 opoints->reserve(sz);
148 for ( unsigned long i=0; i<sz; ++i)
149 opoints->emplace_back(data[i]);
153 template < typename Num2, class Po int>
154 inline std::vector<OrderedPointND<Point> >*
155 makeOrderedFromFlat( const std::vector<Num2>& data, unsigned stride,
156 const unsigned* dimsToUse, unsigned nDimsToUse)
158 std::vector<OrderedPointND<Point> >* result =
159 new std::vector<OrderedPointND<Point> >();
164 template < typename Num2, class Po int>
165 inline std::vector<Point>*
166 makePointsFromFlat( const std::vector<Num2>& data, unsigned stride,
167 const unsigned* dimsToUse, unsigned nDimsToUse)
169 std::vector<Point>* result = new std::vector<Point>();
176 makeFlatFromFlat( const Vec& data, unsigned stride,
177 const unsigned* dimsToUse, unsigned nDimsToUse)
179 Vec* result = new Vec();
186 #include "npstat/stat/OrderedPointND.icc"
bool operator==(const npstat::BoxND< Numeric > &l, const npstat::BoxND< Numeric > &r)
Compile-time dimensionality detector for classes like std::array.
Definition: OrderedPointND.hh:40
unsigned long getNumber(unsigned i) const
void setNumber(unsigned i, unsigned long value)
OrderedPointND(const Point &point, const unsigned long *number, unsigned lenNumber)
const value_type & operator[](unsigned i) const Definition: OrderedPointND.hh:82
value_type & operator[](unsigned i) Definition: OrderedPointND.hh:79
OrderedPointND(const Num2 *data, const unsigned *indices, unsigned lenIndices)
const Point & point() const Definition: OrderedPointND.hh:71
OrderedPointND(const Num2 *data, unsigned dataLen)
OrderedPointND(const Point &point)
Definition: AbsArrayProjector.hh:14
void fillOrderedFromFlat(const std::vector< Num2 > &data, unsigned stride, const unsigned *dimsToUse, unsigned nDimsToUse, std::vector< OrderedPointND< Point > > *out)
void fillFlatFromFlat(const std::vector< Num1 > &data, unsigned stride, const unsigned *dimsToUse, unsigned nDimsToUse, std::vector< Num2 > *out)
void fillOrderedPoints(const std::vector< Point1 > &data, const unsigned *dimsToUse, unsigned nDimsToUse, std::vector< OrderedPointND< Point2 > > *out)
void fillPointsFromFlat(const std::vector< Num2 > &data, unsigned stride, const unsigned *dimsToUse, unsigned nDimsToUse, std::vector< Point > *out)
Definition: PointDimensionality.hh:20
|