diff --git a/MathLib/LinAlg/Eigen/EigenLinearSolver.cpp b/MathLib/LinAlg/Eigen/EigenLinearSolver.cpp index 8b42c9b77f7935283de1d9d0f0c57cca9fef61e1..867b25d869c9b89852f9ee23a4f2e0ee66496ada 100644 --- a/MathLib/LinAlg/Eigen/EigenLinearSolver.cpp +++ b/MathLib/LinAlg/Eigen/EigenLinearSolver.cpp @@ -26,7 +26,7 @@ namespace details /// Template class for Eigen direct linear solvers template <class T_SOLVER, class T_BASE> -class EigenDirectLinearSolver : public T_BASE +class EigenDirectLinearSolver final : public T_BASE { public: explicit EigenDirectLinearSolver(EigenMatrix::RawMatrixType &A) : _A(A) @@ -39,8 +39,6 @@ public: } } - virtual ~EigenDirectLinearSolver() {} - void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &/*opt*/) override { INFO("-> solve"); @@ -58,7 +56,7 @@ private: /// Template class for Eigen iterative linear solvers template <class T_SOLVER, class T_BASE> -class EigenIterativeLinearSolver : public T_BASE +class EigenIterativeLinearSolver final : public T_BASE { public: explicit EigenIterativeLinearSolver(EigenMatrix::RawMatrixType &A) : _A(A) @@ -71,8 +69,6 @@ public: } } - virtual ~EigenIterativeLinearSolver() {} - void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &opt) override { INFO("-> solve"); diff --git a/MathLib/LinAlg/Eigen/EigenLinearSolver.h b/MathLib/LinAlg/Eigen/EigenLinearSolver.h index 8f7261e3fa13bf100757cb5d61f7345f8b49b904..8d428c88f4ec4b142b72cb626e573064a10d32f8 100644 --- a/MathLib/LinAlg/Eigen/EigenLinearSolver.h +++ b/MathLib/LinAlg/Eigen/EigenLinearSolver.h @@ -24,12 +24,12 @@ class EigenMatrix; /** */ -class EigenLinearSolver +class EigenLinearSolver final { public: EigenLinearSolver(EigenMatrix &A, boost::property_tree::ptree const*const option = nullptr); - virtual ~EigenLinearSolver() + ~EigenLinearSolver() { delete _solver; } @@ -64,8 +64,10 @@ protected: class IEigenSolver { public: - virtual ~IEigenSolver() {} - /// execute a linear solver + virtual ~IEigenSolver() = default; + /** + * execute a linear solver + */ virtual void solve(EigenVector::RawVectorType &b, EigenVector::RawVectorType &x, EigenOption &) = 0; }; diff --git a/MathLib/LinAlg/Eigen/EigenMatrix.h b/MathLib/LinAlg/Eigen/EigenMatrix.h index 2b7c80405319d4e31de2a9d342fc4eeed9110f1b..79b54e5cb0c388e5dadfcf85877310042bcfb9f7 100644 --- a/MathLib/LinAlg/Eigen/EigenMatrix.h +++ b/MathLib/LinAlg/Eigen/EigenMatrix.h @@ -40,8 +40,6 @@ public: */ explicit EigenMatrix(std::size_t n) :_mat(n, n) {} - ~EigenMatrix() {} - /// return the number of rows std::size_t getNRows() const { return _mat.rows(); } diff --git a/MathLib/LinAlg/Eigen/EigenOption.h b/MathLib/LinAlg/Eigen/EigenOption.h index bd8d3f625a730686e61b61efd9fd61e6a8af5126..a7ef314ff3779e29911b3563eed4014bb1a051e7 100644 --- a/MathLib/LinAlg/Eigen/EigenOption.h +++ b/MathLib/LinAlg/Eigen/EigenOption.h @@ -18,7 +18,7 @@ namespace MathLib /** * \brief Option for Eigen sparse solver */ -struct EigenOption +struct EigenOption final { /// Solver type enum class SolverType : int @@ -53,9 +53,6 @@ struct EigenOption */ EigenOption(); - /// Destructor - ~EigenOption() {} - /** * return a linear solver type from the solver name * diff --git a/MathLib/LinAlg/Eigen/EigenVector.h b/MathLib/LinAlg/Eigen/EigenVector.h index 31ad4e83d77663df7cd77d88ba41c052b1e78a9e..ca52dc1481ca49d6151c27185af209087a2d211d 100644 --- a/MathLib/LinAlg/Eigen/EigenVector.h +++ b/MathLib/LinAlg/Eigen/EigenVector.h @@ -24,7 +24,7 @@ namespace MathLib /** * Global vector based on Eigen vector */ -class EigenVector +class EigenVector final { public: using RawVectorType = Eigen::VectorXd; @@ -38,11 +38,6 @@ public: /// copy constructor EigenVector(EigenVector const &src) : _vec(src._vec) {} - /** - * - */ - virtual ~EigenVector() {} - /// return a vector length std::size_t size() const { return _vec.size(); } diff --git a/MathLib/LinAlg/EigenLis/EigenLisLinearSolver.h b/MathLib/LinAlg/EigenLis/EigenLisLinearSolver.h index c503e34ddaa43a18cc7f9303f592541cc621db6e..4629b9e834987d2ae5e175f806c39d8f3f026de2 100644 --- a/MathLib/LinAlg/EigenLis/EigenLisLinearSolver.h +++ b/MathLib/LinAlg/EigenLis/EigenLisLinearSolver.h @@ -25,7 +25,7 @@ class EigenMatrix; /** * Linear solver using Lis library with Eigen matrix and vector objects */ -class EigenLisLinearSolver +class EigenLisLinearSolver final { public: /** @@ -37,8 +37,6 @@ public: */ EigenLisLinearSolver(EigenMatrix &A, boost::property_tree::ptree const*const option = nullptr); - virtual ~EigenLisLinearSolver() {} - /** * configure linear solvers * @param option