// -*- c++ -*- // // $COPYRIGHT$ // //=========================================================================== #include "mtl/mtl.h" #include "mtl/utils.h" #include "mtl/linalg_vec.h" /* Sample output; X: [1,5,3,1,] The L-2 norm of X is 6 */ using namespace mtl; using namespace std; typedef external_vec Vec; int main() { double data[] = {1,5,3,1}; Vec x(data, 4); double s = two_norm(x); cout << "X: "; print_vector(x); cout << "The L-2 norm of X is " << s << endl; return 0; }