// -*- c++ -*- // // $COPYRIGHT$ // //=========================================================================== // compile this with +K3 --inline_keyword_space_time=10000 --no_exceptions #include #include #include using namespace mtl; const int N = 3; //begin template inline void do_add(VecX& x, VecY& y) { for (int i = 0; i < N; ++i) { x[i] = i; y[i] = i + 1; } blais_vv::add(x.begin(), y.begin()); } //end int main() { // interesting difference between on the stack and // not on the stack. When on the stack KCC // evaluates the addition at compiler time. //begin int ix[N], iy[N]; external_vec x1(ix, N); external_vec y1(iy, N); do_add(x1, y1); dense1D x2(N); dense1D y2(N); do_add(x2, y2, N); //end print_vector(y1); print_vector(y2); return 0; }