1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<html>
<title>Blitz++ Class Reference: Range</title>
<body>
<h1>Blitz++ Class Reference: Range</h1>
An object of type Range represents an ordered set of uniformly
spaced integers. Range objects can be used to initialize
vectors, to refer to subvectors, or as operands in a vector
expression. Here are some examples:
<pre>
Vector<double> x = Range(0,6); // x = [ 0 1 2 3 4 5 6 ]
cout << x(Range::all()) << endl // [ 0 1 2 3 4 5 6 ]
<< x(Range(3,5)) << endl // [ 3 4 5 ]
<< x(Range(3,Range::toEnd)) << endl // [ 3 4 5 6 ]
<< x(Range(Range::fromStart,3)) << endl // [ 0 1 2 3 ]
<< x(Range(1,5,2)) << endl; // [ 1 3 5 ]
</body>
</html>
|