// -*- c++ -*- // // $COPYRIGHT$ // //=========================================================================== #include "mtl/mtl.h" #include "mtl/utils.h" #include "mtl/linalg_vec.h" /* Sample Output [1,2,3,] [3,0,-1,] Vectors x and y are orthogonal. */ using namespace mtl; using namespace std; int main() { //begin const int N = 3; double dx[] = { 1, 2, 3}; double dy[] = { 3, 0, -1}; typedef external_vec Vec; Vec x(dx,N), y(dy,N); print_vector(x); print_vector(y); double dotprd = dot(x, y); if (dotprd == 0) cout << "Vectors x and y are orthogonal." << endl; else cout << "dot(x,y) = " << dotprd << endl; //end return 0; }