// File:            testvect.cpp
// ---------------------------------------------------------------------
// Author:          Russell Lowke, lowke@fas.harvard.edu
// TF:              Francis Crick
// Date modified:   7/24/2002
// Assignment:      Unit 6 Main programming exercises
// Version:			1
//
// Description:
//

#include <iostream>
#include <iomanip>
#include "vector.hpp"



// Write your test program here.  
// It should fully test your new vector functions.

int
main()
{
	cout << "new vector with 20 items\n";
	vector testa(20);
	cout << "ensure inializing properly\n";
	cout << testa << endl;
	cout << "add first and last elements\n";
	testa.set_value(0, -1);
	testa.set_value(19, -1);
	cout << testa << endl;
	cout << "add general elements\n";
	for (int i = 0; i < 20; i++) {
		testa.set_value(19 - i, i);
	}
	cout << testa << endl;
	cout << "get_value at 8 = " << testa.get_value(8) << endl;
	cout << "norm for " << testa << " is " << testa.get_norm() << endl;
	vector testb(4);
	testb.set_value(0, 1);
	testb.set_value(1, -1);
	testb.set_value(2, -3);
	testb.set_value(3, 5);
	cout << "norm for " << testb << " is " << testb.get_norm() << endl;
	cout << testa << " == " << testb << "   " << ( testa == testb ) << endl;
	cout << testb << " == " << testb << "   " << ( testb == testb ) << endl;
	cout << "seta = setb\n";
	testa = testb;
	cout << "seta is now = " << testa << endl;
	cout << "seta + setb = " << (testa + testb) << endl;
	cout << "seta - setb = " << (testa - testb) << " (cancels out)" << endl;
	vector testc(4);
	testc.set_value(0, 3);
	testc.set_value(1, 8);
	testc.set_value(2, 2);
	vector testd(4);
	testd.set_value(0, -2);
	testd.set_value(1, 1);
	testd.set_value(2, 10);
	cout << "setc: " << testc << " * setd: " << testd << " = " << testc * testd << endl;
	
	exit (0);
}
