Skip to content
Snippets Groups Projects
Commit a2691ee2 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MaL] Eigen add final to classes. Del dtors.

parent 856343e6
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ namespace details ...@@ -26,7 +26,7 @@ namespace details
/// Template class for Eigen direct linear solvers /// Template class for Eigen direct linear solvers
template <class T_SOLVER, class T_BASE> template <class T_SOLVER, class T_BASE>
class EigenDirectLinearSolver : public T_BASE class EigenDirectLinearSolver final : public T_BASE
{ {
public: public:
explicit EigenDirectLinearSolver(EigenMatrix::RawMatrixType &A) : _A(A) explicit EigenDirectLinearSolver(EigenMatrix::RawMatrixType &A) : _A(A)
...@@ -39,8 +39,6 @@ public: ...@@ -39,8 +39,6 @@ public:
} }
} }
virtual ~EigenDirectLinearSolver() {}
void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &/*opt*/) override void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &/*opt*/) override
{ {
INFO("-> solve"); INFO("-> solve");
...@@ -58,7 +56,7 @@ private: ...@@ -58,7 +56,7 @@ private:
/// Template class for Eigen iterative linear solvers /// Template class for Eigen iterative linear solvers
template <class T_SOLVER, class T_BASE> template <class T_SOLVER, class T_BASE>
class EigenIterativeLinearSolver : public T_BASE class EigenIterativeLinearSolver final : public T_BASE
{ {
public: public:
explicit EigenIterativeLinearSolver(EigenMatrix::RawMatrixType &A) : _A(A) explicit EigenIterativeLinearSolver(EigenMatrix::RawMatrixType &A) : _A(A)
...@@ -71,8 +69,6 @@ public: ...@@ -71,8 +69,6 @@ public:
} }
} }
virtual ~EigenIterativeLinearSolver() {}
void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &opt) override void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &opt) override
{ {
INFO("-> solve"); INFO("-> solve");
......
...@@ -24,12 +24,12 @@ class EigenMatrix; ...@@ -24,12 +24,12 @@ class EigenMatrix;
/** /**
*/ */
class EigenLinearSolver class EigenLinearSolver final
{ {
public: public:
EigenLinearSolver(EigenMatrix &A, boost::property_tree::ptree const*const option = nullptr); EigenLinearSolver(EigenMatrix &A, boost::property_tree::ptree const*const option = nullptr);
virtual ~EigenLinearSolver() ~EigenLinearSolver()
{ {
delete _solver; delete _solver;
} }
...@@ -64,8 +64,10 @@ protected: ...@@ -64,8 +64,10 @@ protected:
class IEigenSolver class IEigenSolver
{ {
public: public:
virtual ~IEigenSolver() {} virtual ~IEigenSolver() = default;
/// execute a linear solver /**
* execute a linear solver
*/
virtual void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &) = 0; virtual void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &) = 0;
}; };
......
...@@ -40,8 +40,6 @@ public: ...@@ -40,8 +40,6 @@ public:
*/ */
explicit EigenMatrix(std::size_t n) :_mat(n, n) {} explicit EigenMatrix(std::size_t n) :_mat(n, n) {}
~EigenMatrix() {}
/// return the number of rows /// return the number of rows
std::size_t getNRows() const { return _mat.rows(); } std::size_t getNRows() const { return _mat.rows(); }
......
...@@ -18,7 +18,7 @@ namespace MathLib ...@@ -18,7 +18,7 @@ namespace MathLib
/** /**
* \brief Option for Eigen sparse solver * \brief Option for Eigen sparse solver
*/ */
struct EigenOption struct EigenOption final
{ {
/// Solver type /// Solver type
enum class SolverType : int enum class SolverType : int
...@@ -53,9 +53,6 @@ struct EigenOption ...@@ -53,9 +53,6 @@ struct EigenOption
*/ */
EigenOption(); EigenOption();
/// Destructor
~EigenOption() {}
/** /**
* return a linear solver type from the solver name * return a linear solver type from the solver name
* *
......
...@@ -24,7 +24,7 @@ namespace MathLib ...@@ -24,7 +24,7 @@ namespace MathLib
/** /**
* Global vector based on Eigen vector * Global vector based on Eigen vector
*/ */
class EigenVector class EigenVector final
{ {
public: public:
using RawVectorType = Eigen::VectorXd; using RawVectorType = Eigen::VectorXd;
...@@ -38,11 +38,6 @@ public: ...@@ -38,11 +38,6 @@ public:
/// copy constructor /// copy constructor
EigenVector(EigenVector const &src) : _vec(src._vec) {} EigenVector(EigenVector const &src) : _vec(src._vec) {}
/**
*
*/
virtual ~EigenVector() {}
/// return a vector length /// return a vector length
std::size_t size() const { return _vec.size(); } std::size_t size() const { return _vec.size(); }
......
...@@ -25,7 +25,7 @@ class EigenMatrix; ...@@ -25,7 +25,7 @@ class EigenMatrix;
/** /**
* Linear solver using Lis library with Eigen matrix and vector objects * Linear solver using Lis library with Eigen matrix and vector objects
*/ */
class EigenLisLinearSolver class EigenLisLinearSolver final
{ {
public: public:
/** /**
...@@ -37,8 +37,6 @@ public: ...@@ -37,8 +37,6 @@ public:
*/ */
EigenLisLinearSolver(EigenMatrix &A, boost::property_tree::ptree const*const option = nullptr); EigenLisLinearSolver(EigenMatrix &A, boost::property_tree::ptree const*const option = nullptr);
virtual ~EigenLisLinearSolver() {}
/** /**
* configure linear solvers * configure linear solvers
* @param option * @param option
......
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