/*
To overload an operator in order to use it with classes we declare operator functions, which are regular functions
whose names are the operator keyword followed by the operator sign that we want to overload. The format is:
      
"type operator sign (parameters) { /.../ }"
*/

#include <iostream>
#include "CVector.hpp"
using namespace std;   

int main() {
    
     CVector vec1(1,2);
     CVector vec2(3,4);
     CVector sum, sub;
     int ip;
    
     cout << " v1 = ";
     vec1.printv();
     cout << " v2 = ";    
     vec2.printv();
     cout << endl;
     
// Vector Addition
     sum = vec1+vec2;
     cout << " v1+v2 = ";
     sum.printv();

// Vector substraction
     sub = vec1-vec2;
     cout << " v1-v2 = ";
     sub.printv();
        
// Inner Product
     ip = vec1*vec2;        
     cout << " <v1,v2> = " << ip << endl;

// Vector norm
     vec1.set(3,4);
     cout << "\n\n Norm of vector: ";
     vec1.printv();
     cout << " is " << norm(vec1) << endl;
    
     std::cin.get();
     return (0);       
}
             
