#include "pset5.h"
#include<iostream.h>
#include<stdlib.h>

main()
{
  char filename[40];
  int n;

  cout << "filename> ";
  cin >> filename;
  ifstream infile(filename, ios::in);

  infile >> n;
  Vector R=Vector(infile,n);
  Matrix K=Matrix(infile,n,n);
  cout << "Here's the first matrix:" << endl;
  K.print();
  Matrix K2=Matrix(infile,n,n);
  cout << "Here's the second matrix:" << endl;
  K2.print();
  cout << "Here's first matrix + second matrix:" << endl;
  Matrix temp;
  temp=K+K2;
  temp.print();
  cout << "Here's the first matrix - second matrix:" << endl;
  temp=K-K2;
  temp.print();
  cout << "Here's the first matrix * second matrix:" << endl;
  temp=K*K2;
  temp.print();
  cout << "Here's the determinant of the first matrix: "
       << K.determinant() << endl;
  cout << "Here's the inverse of the first matrix:" << endl;
  K.inverse().print();
  cout << "The solution to the KU=R equation:" << endl;
  Solver aug=Solver(K,R);
  aug.gauss();
  cout << "And finally, the check with inv(K)*R:" << endl;
  temp=K.inverse()*R;
  temp.print();
}
