File: range.cc

package info (click to toggle)
blitz%2B%2B 1%3A0.10-3.2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,276 kB
  • ctags: 12,037
  • sloc: cpp: 70,465; sh: 11,116; fortran: 1,510; python: 1,246; f90: 852; makefile: 701
file content (33 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef BZ_RANGE_CC
#define BZ_RANGE_CC


#include <blitz/range.h>
#include <blitz/array/ops.h>

BZ_NAMESPACE(blitz)


inline Range::T_numtype Range::operator[](int i) const
{
  return first_ + i * stride_;
}

inline RectDomain<Range::rank_> Range::domain() const
{ 
  return RectDomain<rank_>(TinyVector<int,1>(0),
			   TinyVector<int,1>(ubound(0)));
}

inline bool Range::assertInRange(const T_index& BZ_DEBUG_PARAM(index)) const
{
  BZPRECHECK((index[0]<=ubound(0)) && (index[0]>=0),
	     "Range index out of range: " << index[0]
	     << endl << "Lower bounds: 0" << endl
	     <<         "Length:      " << length() << endl);
  return true;
}

BZ_NAMESPACE_END

#endif