//
//  test_vector.cc -- a driver to test the Vector class.
//

#include <stdlib.h>
#include <math.h>
#include <iostream.h>
#include <iomanip.h>
#include "Vector.hh"

template<class IndexType, class BaseData>
void
PrintVector( Vector<IndexType, BaseData> & V )
{
  for ( int i = V.LowIndex(); i <= V.HighIndex(); i++ )
    cout << V[i] << "\t";
  cout << endl << endl;
}


int
main()
{
  Vector< int, int > X( 0, 4 );
  X[0] = 2;
  X[1] = -3;
  X[2] = 65;
  X[3] = 1;
  X[4] = 11;

  cout << "X:\n";
  PrintVector( X );

  Vector< int, int > Y( 0, 4 );
  Y[0] = 8;
  Y[1] = 5;
  Y[2] = -6;
  Y[3] = 4;
  Y[4] = 1;

  cout << "Y:\n";
  PrintVector( Y );

  cout << "Dot product of X and Y is " << X.DotProduct( Y ) << endl;

  exit( EXIT_SUCCESS );
}



// Template instantiations
template class Vector< int, int >;
template class Vector< int, float >;
template void PrintVector( Vector<int, int> &);
template void PrintVector( Vector<int, float> &);



