#include <iostream>
#include "sparse_matrix.h"

using namespace std;
using namespace math_tools;

int
main()
{
   cout << endl << "-------" << endl;
   SparseMatrix< double > matrix;
   double d = 1.0;
   for(int i = 2; i >= 0; i--) {
      for(int j = 2; j >= 0; j--) {
         matrix.put(i*10,j*10,d);
         d++;
      }
   }
   for(int i = 0; i < 3; i++) {
      for(int j = 0; j < 3; j++) {
         d = 0.0;
         if(matrix.get(i*10,j*10,d)) {
            cout << " " << d;
         }
         else { 
            cout << " 0";
         }
      }
      cout << endl;
   }
   cout << endl << "-------" << endl;
   d = 1.0;
   matrix.clear();
   for(int i = 0; i < 3; i++) {
      for(int j = 0; j < 3; j++) {
         matrix.put(i*10,j*10,d);
         d++;
      }
   } 
   for(int i = 0; i < 3; i++) {
      for(int j = 0; j < 3; j++) {
         d = 0.0;
         if(matrix.get(i*10,j*10,d)) {
            cout << " " << d;
         }
         else {
            cout << " " << 0.0;
         }
      }
      cout << endl;
   }
   cout << endl << "-------" << endl;
   return 0;
}
