source: XIOS/dev/dev_olga/src/extern/blitz/include/blitz/range.cc @ 1022

Last change on this file since 1022 was 1022, checked in by mhnguyen, 7 years ago
File size: 676 bytes
Line 
1#ifndef BZ_RANGE_CC
2#define BZ_RANGE_CC
3
4
5#include <blitz/range.h>
6#include <blitz/array/ops.h>
7
8BZ_NAMESPACE(blitz)
9
10
11inline Range::T_numtype Range::operator[](int i) const
12{
13  return first_ + i * stride_;
14}
15
16inline RectDomain<Range::rank_> Range::domain() const
17{ 
18  return RectDomain<rank_>(TinyVector<int,1>(0),
19                           TinyVector<int,1>(ubound(0)));
20}
21
22inline bool Range::assertInRange(const T_index& BZ_DEBUG_PARAM(index)) const
23{
24  BZPRECHECK((index[0]<=ubound(0)) && (index[0]>=0),
25             "Range index out of range: " << index[0]
26             << endl << "Lower bounds: 0" << endl
27             <<         "Length:      " << length() << endl);
28  return true;
29}
30
31BZ_NAMESPACE_END
32
33#endif
Note: See TracBrowser for help on using the repository browser.