Skip to content
Snippets Groups Projects
quick.cc 830 B
Newer Older
Stephen Smith's avatar
Stephen Smith committed
/*  quick.cc

    Mark Woolrich, FMRIB Image Analysis Group

    Copyright (C) 1999-2000 University of Oxford  */

/*  CCOPYRIGHT  */

#include <iostream>
#include <fstream>
#include <iomanip>
#include <strstream>
Mark Jenkinson's avatar
Mark Jenkinson committed
#define WANT_STREAM
#define WANT_MATH

#include "miscmaths.h"
Mark Woolrich's avatar
Mark Woolrich committed
#include "sparse_matrix.h"
#include "libprob.h"
Mark Jenkinson's avatar
Mark Jenkinson committed

using namespace MISCMATHS;

int main(int argc, char *argv[])
{
  try{
Mark Woolrich's avatar
Mark Woolrich committed
    
    SparseMatrix x(3,4);
    SparseMatrix y(3,4);
    x.insert(1,1,1);
    y.insert(1,1,2);
    y.insert(1,2,3);

    x.insert(2,3,1.5);

    y.insert(2,4,3);
    x.insert(2,4,-1);

    y.insert(3,4,6);

    SparseMatrix ret;


    OUT(x.AsMatrix());
    OUT(y.AsMatrix());

    add(x,y,ret);
    
    OUT(ret.AsMatrix());
Mark Jenkinson's avatar
Mark Jenkinson committed

  }
  catch(Exception p_excp) 
    {
      cerr << p_excp.what() << endl;
    }
  return 0;
}