Skip to content
Snippets Groups Projects
Commit 74d73777 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

include comments

parent af8e74bc
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@
#ifdef OGS_USE_EIGEN
#include "MathLib/LinAlg/Eigen/EigenTools.h"
#endif // USE_LIS
#endif // OGS_USE_EIGEN
#ifdef USE_LIS
#include "MathLib/LinAlg/Lis/LisTools.h"
......
......@@ -9,6 +9,7 @@
#include "EigenLinearSolver.h"
#include <boost/property_tree/ptree.hpp>
#include <logog/include/logog.hpp>
#include <unsupported/Eigen/IterativeSolvers>
......@@ -36,7 +37,7 @@ public:
// Compute the numerical factorization
_solver.factorize(A);
if(_solver.info()!=Eigen::Success) {
INFO("\t failed");
ERR("The numerical factorization failed in Eigen");
return;
}
}
......
......@@ -12,8 +12,7 @@
#include <vector>
#include <boost/any.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ptree_fwd.hpp>
#include "EigenVector.h"
#include "EigenOption.h"
......
......@@ -11,9 +11,10 @@
#define EIGENMATRIX_H_
#include <cassert>
#ifndef NDEBUG
#include <fstream>
#include <iosfwd>
#include <string>
#endif
#include <Eigen/Sparse>
......@@ -122,6 +123,7 @@ public:
/// return if this matrix is already assembled or not
bool isAssembled() const { return true; }
#ifndef NDEBUG
/// printout this matrix for debugging
void write(const std::string &filename) const
{
......@@ -138,6 +140,7 @@ public:
os << it.row() << " " << it.col() << ": " << it.value() << "\n";
os << std::endl;
}
#endif
RawMatrixType& getRawMatrix() { return _mat; }
const RawMatrixType& getRawMatrix() const { return _mat; }
......
......@@ -23,7 +23,7 @@ void applyKnownSolution(EigenMatrix &A_, EigenVector &b_, const std::vector<std:
typedef EigenMatrix::RawMatrixType SpMat;
auto &A = A_.getRawMatrix();
auto &b = b_.getRawVector();
const size_t n_rows = A.rows();
const std::size_t n_rows = A.rows();
for (std::size_t ix=0; ix<vec_knownX_id.size(); ix++)
{
int row_id = vec_knownX_id[ix];
......@@ -32,7 +32,7 @@ void applyKnownSolution(EigenMatrix &A_, EigenVector &b_, const std::vector<std:
for (SpMat::InnerIterator it(A,row_id); it; ++it)
it.valueRef() = .0;
//b_i -= A(i,k)*val, i!=k
for (size_t i=0; i<n_rows; i++)
for (std::size_t i=0; i<n_rows; i++)
for (SpMat::InnerIterator it(A,i); it; ++it)
{
if (it.col()!=row_id) continue;
......@@ -41,7 +41,7 @@ void applyKnownSolution(EigenMatrix &A_, EigenVector &b_, const std::vector<std:
//b_k = val
b[row_id] = x;
//A(i, k) = 0., i!=k
for (size_t i=0; i<n_rows; i++)
for (std::size_t i=0; i<n_rows; i++)
for (SpMat::InnerIterator it(A,i); it; ++it)
{
if (it.col()!=row_id) continue;
......
......@@ -10,9 +10,11 @@
#ifndef EIGENVECTOR_H_
#define EIGENVECTOR_H_
#include <string>
#include <vector>
#ifndef NDEBUG
#include <fstream>
#include <string>
#endif
#include <Eigen/Eigen>
......@@ -86,8 +88,10 @@ public:
}
}
#ifndef NDEBUG
/// printout this equation for debugging
void write (const std::string &filename) const { std::ofstream os(filename); os << _vec; }
#endif
/// return a raw Lis vector object
RawVectorType& getRawVector() {return _vec; }
......
......@@ -9,6 +9,7 @@
#include "EigenLisLinearSolver.h"
#include <boost/property_tree/ptree.hpp>
#ifdef _OPENMP
#include <omp.h>
#endif
......
......@@ -12,7 +12,7 @@
#include <vector>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ptree_fwd.hpp>
#include <lis.h>
#include "MathLib/LinAlg/Lis/LisOption.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment