Debian Codegraph @

vcg/wrap/math/sparse_matrix.h

raw symbols SCIP
1 #include <vector>
2 #include <map>
3 #include <algorithm>
4
5
6 ///this class define the interface to use sparse matrix
7 ///you must extend this class and implement the code of each function in order
8 ///to the system solver you're using.
9 ///For details on implementation see system_interface_LDL.h as example
10 template <class ScalarType>
11 class SparseMatrix{
12
13 public:
14
15 std::vector<int> _Ap;
16 std::vector<int> _Ai;
17 std::vector<double> _Ax;
18
19 typedef typename std::pair<int,int> IndexType;
20
21 int _dimension;
22
23 public:
24
25 ///initilaization of the system
26 virtual void Initalize(int dimension)
27 {_dimension=dimension;}
28
29 ///create a sparse matrix given a set of entries as vector
30 ///of pair of int
31 virtual void CreateSparse(std::vector<IndexType> Entries)
32 {}
33
34 ///return the value of the matrix
35 virtual ScalarType &A(int row,int col)
36 {return (_Ax[0]);}
37
38 ///return true if the rapresention of sparse matriz is symmetric
39 virtual bool IsSymmetric()
40 {return false;}
41
42 virtual void Zero()
43 {}
44
45 ///return the dimension of the matrix
46 virtual int Size(){return _dimension;}
47
48 };