PreCMatrix.h
Go to the documentation of this file.
00001 // written by png shao wei
00002 
00003 /*
00004  *sla.h contains a data structure called SparseMatrix.
00005  *It is used to store the sparse version of matrices.
00006  *You can think of it as consisting of a vector that contains three items,
00007  *i.e the start-state, the end-state and the probability
00008  *In my factored parser, i need to store similar entries, but i need to sort all the entries.
00009  *Instead of writing a sort method, I created a class PreSparseMatrix and I implemented a comparator.
00010  *This allows me to use the default sort provided by STL library.
00011  *
00012  *
00013  **/
00014 
00015 #include <cmath>
00016 #include <vector>
00017 #include <algorithm>
00018 #include <iostream>
00019 #include "MathLib.h"
00020 #include "PreCEntry.h"
00021 
00022 using namespace momdp;
00023 using namespace std;
00024 
00025 class PreSparseMatrix {
00026     public:
00027 
00028         int value_a;
00029         int value_b;
00030 
00031         PreSparseMatrix();
00032         PreSparseMatrix(int a, int b);
00033 
00034         vector<PreCEntry> preCEntries;
00035         void addEntries(int a, int b, double c);
00036         void sortEntries();
00037 
00038         SharedPointer<SparseMatrix>  convertSparseMatrix();
00039 
00040         std::ostream& write(std::ostream& out);
00041         void removeDuplicates();
00042 
00043 };


appl
Author(s): petercai
autogenerated on Tue Jan 7 2014 11:02:29