#include
#include
using namespace std;
int main()
{
valarray v(12), result;
valarray len(2), interval(2);
unsigned int i;
for(i=0; i<12; i++) v[i] = i;
len[0] = 3; len[1] = 3;
interval[0] = 2; interval[1] = 3;
cout << "Contents of v: ";
for(i=0; i<12; i++)
cout << v[i] << " ";
cout << endl;
result = v[gslice(0,len,interval)];
cout << "Contents of result: ";
for(i=0; i cout << result[i] << " ";
return 0;
}