All Classes Files Functions Variables Pages
matrixOperations.h
Go to the documentation of this file.
1 
15 #ifndef MATRIXMANIP_H
16 #define MATRIXMANIP_H
17 
18 #include"graph.h"
19 #include<vector>
20 #include<string>
21 
22 /* \brief Returns matrix of submatrices (power of 2)
23  * \param G: Full matrix
24  * \return Matrix of submatrices
25  */
26 std::vector<CSC_MATRIX> getSubMatrices(Graph G);
27 
28 /*
29  * \brief Gets the ij element of a given CSC matrix
30  *
31  * \param i: Row of matrix
32  * \param j: Column of matrix
33  * \return value of matrix A(i,j)
34  */
35 double getAij(CSC_MATRIX A,int i,int j);
36 
37 
38 /*
39  * \brief Saves matrix in csc format to file
40  *
41  * \param A: Matrix in CSC format to save
42  * \param filename File to save matrix to.
43  * \return Error code.
44  */
45 int saveMatrixToFile(CSC_MATRIX A,std::string filename);
46 std::vector<CSC_MATRIX> divideVec(CSC_MATRIX X);
47 int writeTimingToFile(std::vector<std::vector<double> >& timeKeeper, std::string filename, int coarsen_levels);
48 std::vector<double> CSC_singleMatVec(CSC_MATRIX A,CSC_MATRIX X);
49 std::vector<double> CSC_globalMatVec(std::vector<CSC_MATRIX> Mats,std::vector<CSC_MATRIX> X);
50 CSC_MATRIX convertVecToCSC(std::vector<double> b);
51 CSC_MATRIX getDegreeMatrix(Graph G);
52 int applyDinv(CSC_MATRIX D, CSC_MATRIX& x);
53 int applyScalar(std::vector<double> & v, double Scalar);
54 int addVector(std::vector<double> & b,std::vector<double> v);
55 double computeResidual(std::vector<double> bn1,std::vector<double> bn);
56 std::vector<double> iterSolver(Graph G,std::vector<double> v, double alpha);
57 int reorderVec(std::vector<double> &b, std::vector<int> indMap);
58 int saveCSCMatrixToFile(Graph G,std::string filename);
59 #endif
TODO: Give description of Graph class and add comments to each function.
Definition: graph.h:37
Defines class for a graph object and struct for a matrix stored in compact sparse column format...
Struct defining matrix in Compact Sparse Column (CSC) format.
Definition: graph.h:22

Generated on Thu Oct 11 2018 12:36:17 for by  doxygen 1.8.5