diff --git a/EigenSolver/ArpackSolver.hh b/EigenSolver/ArpackSolver.hh index 067916a60a1e2542857975d423ea5fbe0beeca6a..029d157cc2e83a1d02c8da348c70b44f4b53be7b 100644 --- a/EigenSolver/ArpackSolver.hh +++ b/EigenSolver/ArpackSolver.hh @@ -42,17 +42,9 @@ namespace COMISO { class COMISODLLEXPORT ArpackSolver { public: - // sparse matrix type typedef EigenArpackMatrixT > Matrix; - - /// Constructor - ArpackSolver() {} - - /// Destructor - ~ArpackSolver() {} - // solve eigenproblem // number of desired eigenvalues -> _n_eigenvalues // which eigenvalues -> one of {LA (largest algebraic), SA (smalles algebraic), LM (largest magnitude), SM(smallest magnitued), BE(both ends)} @@ -77,9 +69,6 @@ public: // check resulting eigenvalues/eigenvectors template void check_result(const MatrixT& _A, std::vector& _eigenvalues, MatrixT2& _eigenvectors); - -private: - }; diff --git a/EigenSolver/EigenArpackMatrixT.hh b/EigenSolver/EigenArpackMatrixT.hh index 9aa2f8e873252ada79748c55e62b658f226d916a..4e456e9a61b787bf14d4a88755d32535f69f2070 100644 --- a/EigenSolver/EigenArpackMatrixT.hh +++ b/EigenSolver/EigenArpackMatrixT.hh @@ -74,9 +74,6 @@ public: } } - /// Destructor - ~EigenArpackMatrixT() {} - // get reference on matrix Matrix& matrix() { return mat_; } diff --git a/NSolver/AcceleratedQuadraticProxy.hh b/NSolver/AcceleratedQuadraticProxy.hh index 5b773d7fa34b92a4588d3874dc2bd7450dbe1558..35261f495c4df4ffdfb5c42656eb3e5a74eb8c9e 100644 --- a/NSolver/AcceleratedQuadraticProxy.hh +++ b/NSolver/AcceleratedQuadraticProxy.hh @@ -45,9 +45,6 @@ public: AcceleratedQuadraticProxy(const double _eps = 1e-6, const int _max_iters = 1000, const double _accelerate = 100.0, const double _alpha_ls=0.2, const double _beta_ls = 0.6) : eps_(_eps), max_iters_(_max_iters), accelerate_(_accelerate), alpha_ls_(_alpha_ls), beta_ls_(_beta_ls) {} - /// Destructor - ~AcceleratedQuadraticProxy() {} - // solve without linear constraints int solve(NProblemInterface* _quadratic_problem, NProblemInterface* _nonlinear_problem, bool _update_factorization = true) { diff --git a/NSolver/BoundConstraint.cc b/NSolver/BoundConstraint.cc index c0b541a8bc8e36ae9e800b3aa3b3065110f590f0..bac966106f18a2ff243f84549284d5a4872da48f 100644 --- a/NSolver/BoundConstraint.cc +++ b/NSolver/BoundConstraint.cc @@ -30,14 +30,6 @@ BoundConstraint(const unsigned int _var_idx, // index of variable for bound c } -//----------------------------------------------------------------------------- - -BoundConstraint:: -~BoundConstraint() -{ -} - - //----------------------------------------------------------------------------- diff --git a/NSolver/BoundConstraint.hh b/NSolver/BoundConstraint.hh index c419ef1410b9d45aa082f0595d6b2a5123e7c40f..ab2f47b977326d432ca433f54347e8e3ee863dac 100644 --- a/NSolver/BoundConstraint.hh +++ b/NSolver/BoundConstraint.hh @@ -47,10 +47,6 @@ public: const unsigned int _n = 0, // number of unknowns in problem const ConstraintType _type = NC_LESS_EQUAL); // type of bound upper, lower or both (equal) - - /// Destructor - virtual ~BoundConstraint(); - virtual int n_unknowns ( ); virtual double eval_constraint ( const double* _x ); virtual void eval_gradient ( const double* _x, SVectorNC& _g ); diff --git a/NSolver/CBCSolver.hh b/NSolver/CBCSolver.hh index 3811a56f093740c50804ac863b710c807cffd793..db9a7ea68c3d7954811f2a6ac4b903a50bab313d 100644 --- a/NSolver/CBCSolver.hh +++ b/NSolver/CBCSolver.hh @@ -39,12 +39,6 @@ namespace COMISO { class COMISODLLEXPORT CBCSolver { public: - /// Default constructor - CBCSolver() {} - - /// Destructor - ~CBCSolver() {} - // ********** SOLVE **************** // //! \throws Outcome bool solve( diff --git a/NSolver/COMISOSolver.hh b/NSolver/COMISOSolver.hh index c336d5e4993bac1ab85a7a6bb56dc87260ed25c6..4d177929ea13afe68fac2a8a0d449a92b23b9ee1 100644 --- a/NSolver/COMISOSolver.hh +++ b/NSolver/COMISOSolver.hh @@ -44,12 +44,6 @@ public: typedef std::pair PairUiV; - /// Default constructor - COMISOSolver() {} - - /// Destructor - ~COMISOSolver() {} - // ********** SOLVE **************** // void solve(NProblemInterface* _problem, // problem instance std::vector& _constraints, // linear constraints diff --git a/NSolver/CPLEXSolver.cc b/NSolver/CPLEXSolver.cc index f4f33099da8c9781804006e2813e095a977a427f..240271d9b79f56a42fd05a07ac6e04b303d416d7 100644 --- a/NSolver/CPLEXSolver.cc +++ b/NSolver/CPLEXSolver.cc @@ -1300,14 +1300,6 @@ add_constraint_to_model( NConstraintInterface* _constraint, std::vector namespace COMISO { CombinedProblem::CombinedProblem (NProblemInterface* _p1, NProblemInterface* _p2, const double _c1, const double _c2) : p1_(_p1) , p2_(_p2), c1_(_c1), c2_(_c2) { - if(p1_->n_unknowns() != p2_->n_unknowns()) - std::cerr << "Warning: CombinedProblem received two problems with different #unknowns!!!" << std::endl; + DEB_enter_func; + DEB_warning_if(p1_->n_unknowns() != p2_->n_unknowns(), 1, + "CombinedProblem received two problems with different unknowns #"); g_temp_.resize(p1_->n_unknowns()); } -CombinedProblem::~CombinedProblem() -{ -} - int CombinedProblem::n_unknowns() { return p1_->n_unknowns(); diff --git a/NSolver/CombinedProblem.hh b/NSolver/CombinedProblem.hh index 193d8cb1e094bb6c1b53b753b921ed6b486ea3c2..c0c16a863e9205be0ea26d7cf276c8a4681e31af 100644 --- a/NSolver/CombinedProblem.hh +++ b/NSolver/CombinedProblem.hh @@ -48,9 +48,6 @@ public: /// Default constructor CombinedProblem (NProblemInterface* _p1, NProblemInterface* _p2, const double _c1 = 1.0, const double _c2 = 1.0); - /// Destructor - virtual ~CombinedProblem(); - // problem definition virtual int n_unknowns(); diff --git a/NSolver/ConeConstraint.cc b/NSolver/ConeConstraint.cc index abb7328a4b6cf56759e0e21e6909441d1efe6c31..9a7d16c76e9d80391717faf23c3f2806eb29d665 100644 --- a/NSolver/ConeConstraint.cc +++ b/NSolver/ConeConstraint.cc @@ -39,9 +39,6 @@ ConeConstraint::ConeConstraint(const double _c, const int _i, const SMatrixNC& _ { } -/// Destructor -ConeConstraint::~ConeConstraint() {} - int ConeConstraint::n_unknowns() { return Q_.cols(); diff --git a/NSolver/ConeConstraint.hh b/NSolver/ConeConstraint.hh index 3f556d31040152f12a7cbb178a5e0c06f6cafda0..c747713f072e2cbce402d53cb6298ed9a608b19c 100644 --- a/NSolver/ConeConstraint.hh +++ b/NSolver/ConeConstraint.hh @@ -39,9 +39,6 @@ public: // cone constraint of the form -> 0.5*(c_ * x(i_)^2 - x^T Q_ x) >= 0 ConeConstraint(const double _c, const int _i, const SMatrixNC& _Q); - /// Destructor - virtual ~ConeConstraint(); - virtual int n_unknowns(); // resize coefficient vector = #unknowns diff --git a/NSolver/ConstraintTools.cc b/NSolver/ConstraintTools.cc index cd3b5504bc2c5181a70dbfd3c2519df141191915..52ebde669062a3cc80c298424c8505a166632ae7 100644 --- a/NSolver/ConstraintTools.cc +++ b/NSolver/ConstraintTools.cc @@ -13,17 +13,6 @@ namespace COMISO { -ConstraintTools::ConstraintTools() -{ -} - -//----------------------------------------------------------------------------- - - -ConstraintTools::~ConstraintTools() -{ -} - //----------------------------------------------------------------------------- void diff --git a/NSolver/ConstraintTools.hh b/NSolver/ConstraintTools.hh index eb61f43ee8ae220308fd76ad8441a87fc4f10a2b..7156c50e44f98f9a8f1b9cb263502d4f08a5cc31 100644 --- a/NSolver/ConstraintTools.hh +++ b/NSolver/ConstraintTools.hh @@ -47,12 +47,6 @@ public: typedef gmm::row_matrix< SVectorGMM > RMatrixGMM; typedef gmm::col_matrix< SVectorGMM > CMatrixGMM; - /// Default constructor - ConstraintTools(); - - /// Destructor - ~ConstraintTools(); - // remove all linear dependent linear equality constraints. the remaining constraints are a subset of the original ones // nonlinear or equality constraints are preserved. static void remove_dependent_linear_constraints(std::vector& _constraints, const double _eps = 1e-8); diff --git a/NSolver/DOCloudJob.cc b/NSolver/DOCloudJob.cc index 094f55feb56f16156549307ef7fea1fb1ac91dc9..4d12c8226ae9371860a577a0dcf91bc8d98ee5f5 100644 --- a/NSolver/DOCloudJob.cc +++ b/NSolver/DOCloudJob.cc @@ -242,8 +242,6 @@ private: Job::~Job() { - DEB_enter_func; - delete stts_; if (url_.empty()) // not setup diff --git a/NSolver/FiniteElementProblem.cc b/NSolver/FiniteElementProblem.cc index 6b8af3c7b2212e8be6bdf41482d274b5302b683f..b13aab5fa23bf64b6baafb13c4a4ffa8034ac7af 100644 --- a/NSolver/FiniteElementProblem.cc +++ b/NSolver/FiniteElementProblem.cc @@ -13,11 +13,6 @@ FiniteElementProblem::FiniteElementProblem(const unsigned int _n) { } -/// Destructor -FiniteElementProblem::~FiniteElementProblem() -{ -} - void FiniteElementProblem::add_set(FiniteElementSetBase* _fe_set) { fe_sets_.push_back(_fe_set); diff --git a/NSolver/FiniteElementProblem.hh b/NSolver/FiniteElementProblem.hh index 27c23acde28a7a7723ddc688428038006deaba90..8891a3fe83bb451f1c9cc29ff171aab3c2d9efcb 100644 --- a/NSolver/FiniteElementProblem.hh +++ b/NSolver/FiniteElementProblem.hh @@ -237,9 +237,6 @@ public: /// Default constructor FiniteElementProblem(const unsigned int _n); - /// Destructor - virtual ~FiniteElementProblem(); - void add_set(FiniteElementSetBase* _fe_set); void clear_sets(); diff --git a/NSolver/GUROBISolver.cc b/NSolver/GUROBISolver.cc index 8e037c41464c69a95d8227eaa061e91cb3d4b351..46b8f60643c28f6cb6996d40e58d95f2a7919346 100644 --- a/NSolver/GUROBISolver.cc +++ b/NSolver/GUROBISolver.cc @@ -59,13 +59,6 @@ void add_constraint_to_model(COMISO::NConstraintInterface* _constraint, //----------------------------------------------------------------------------- -GUROBISolver:: -GUROBISolver() -{ -} - -//----------------------------------------------------------------------------- - static void process_gurobi_exception(const GRBException& _exc) { DEB_enter_func; diff --git a/NSolver/GUROBISolver.hh b/NSolver/GUROBISolver.hh index f8b45e6793ae137346d8d2cf61c7152620b647dc..03bce31ed7d8c0de413a7a0970628498a9d6ab88 100644 --- a/NSolver/GUROBISolver.hh +++ b/NSolver/GUROBISolver.hh @@ -42,13 +42,6 @@ namespace COMISO { class COMISODLLEXPORT GUROBISolver { public: - - /// Default constructor - GUROBISolver(); - - /// Destructor - ~GUROBISolver() {} - // ********** SOLVE **************** // bool solve(NProblemInterface* _problem, // problem instance std::vector& _constraints, // linear constraints diff --git a/NSolver/IPOPTSolver.hh b/NSolver/IPOPTSolver.hh index a9b0fc3f2820d2b579e45bae48be7e449cb3e8cf..540a5e5c0c594e4d47371de2531fe462448cb509 100644 --- a/NSolver/IPOPTSolver.hh +++ b/NSolver/IPOPTSolver.hh @@ -52,9 +52,6 @@ public: /// Default constructor -> set up IpOptApplication IPOPTSolver(); - /// Destructor - ~IPOPTSolver() {} - // ********** SOLVE **************** // // solve -> returns ipopt status code //------------------------------------------------------ diff --git a/NSolver/IPOPTSolverLean.cc b/NSolver/IPOPTSolverLean.cc index ed5e16e172283ad844704c108f5351828056aac6..652335f35afff492669c90dfe7a2672808dfa836 100644 --- a/NSolver/IPOPTSolverLean.cc +++ b/NSolver/IPOPTSolverLean.cc @@ -171,12 +171,16 @@ static void throw_ipopt_solve_failure(Ipopt::ApplicationReturnStatus const statu // Internal_Error=-199 // }; //------------------------------------------------------ - switch(status) { + switch (status) + { case Ipopt::Maximum_Iterations_Exceeded: COMISO_THROW(IPOPT_MAXIMUM_ITERATIONS_EXCEEDED); + case Ipopt::NonIpopt_Exception_Thrown: + // this could be due to a thrown PROGRESS_ABORTED exception, ... + PROGRESS_RESUME_ABORT; // ... so check if we need to resume it default: COMISO_THROW(IPOPT_OPTIMIZATION_FAILED); - } // endswicth + } } static void check_ipopt_status(Ipopt::ApplicationReturnStatus const _stat) @@ -185,7 +189,6 @@ static void check_ipopt_status(Ipopt::ApplicationReturnStatus const _stat) throw_ipopt_solve_failure(_stat); } - void IPOPTSolverLean::solve(NProblemInterface* _problem, const std::vector& _constraints) { diff --git a/NSolver/LeastSquaresProblem.hh b/NSolver/LeastSquaresProblem.hh index 145fe63e22cb036e90d08c89bfa668d416e0b59d..5af031814e613ec6c2e49b57da48402867c54b2e 100644 --- a/NSolver/LeastSquaresProblem.hh +++ b/NSolver/LeastSquaresProblem.hh @@ -41,10 +41,6 @@ public: /// Default constructor LeastSquaresProblem(const int _n_unknowns = 0) :n_(_n_unknowns), x_(_n_unknowns, 0.0) {} - - /// Destructor - ~LeastSquaresProblem() {} - void add_term(NConstraintInterface* _term); void clear_terms() {terms_.clear();} diff --git a/NSolver/LinearConstraint.cc b/NSolver/LinearConstraint.cc index 94dde03ff9d1cc1baaf94f001bfb020e3db0c2d5..a8b5dd307b3faa942e1972383835f6933ee8ef60 100644 --- a/NSolver/LinearConstraint.cc +++ b/NSolver/LinearConstraint.cc @@ -35,9 +35,6 @@ LinearConstraint::LinearConstraint(const SVectorNC& _coeffs, const double _b, co b_ = _b; } -/// Destructor -LinearConstraint::~LinearConstraint() {} - int LinearConstraint::n_unknowns() { return coeffs_.innerSize(); diff --git a/NSolver/LinearConstraint.hh b/NSolver/LinearConstraint.hh index 9aadecc761c7bff994473e4bef08740d464f874a..27cae71e1702585eb434caa506b259f15709993d 100644 --- a/NSolver/LinearConstraint.hh +++ b/NSolver/LinearConstraint.hh @@ -48,9 +48,6 @@ public: // linear equation of the form -> coeffs_^T *x + b_=_type= 0 LinearConstraint(const SVectorNC& _coeffs, const double _b, const ConstraintType _type = NC_EQUAL); - /// Destructor - virtual ~LinearConstraint(); - virtual int n_unknowns(); // resize coefficient vector = #unknowns diff --git a/NSolver/LinearConstraintHandlerElimination.hh b/NSolver/LinearConstraintHandlerElimination.hh index 22c8a7c80bebdfbd115c5f2373c3f21fb0316cb8..9a841b0eeabc23f050cf2069fb72bd14e92c7eea 100644 --- a/NSolver/LinearConstraintHandlerElimination.hh +++ b/NSolver/LinearConstraintHandlerElimination.hh @@ -52,10 +52,6 @@ public: LinearConstraintHandlerElimination( const MatrixT& _C, const VectorT& _c) {initialize(_C, _c); } - - /// Destructor - ~LinearConstraintHandlerElimination() {} - // number of variables int n() {return n_;} // number of reduced variables (after elimination) diff --git a/NSolver/LinearConstraintHandlerPenalty.cc b/NSolver/LinearConstraintHandlerPenalty.cc index 89f523d512e367c9da830495c81473c595bcb617..7ebb6960bbf01fd7ab44cb69f08a4418cc03b875 100644 --- a/NSolver/LinearConstraintHandlerPenalty.cc +++ b/NSolver/LinearConstraintHandlerPenalty.cc @@ -20,13 +20,6 @@ namespace COMISO { /// Constructor LinearConstraintHandlerPenalty::LinearConstraintHandlerPenalty() : penalty_(10000) {} - -//----------------------------------------------------------------------------- - -/// Destructor -LinearConstraintHandlerPenalty::~LinearConstraintHandlerPenalty() -{} - //----------------------------------------------------------------------------- // penalty weight diff --git a/NSolver/LinearConstraintHandlerPenalty.hh b/NSolver/LinearConstraintHandlerPenalty.hh index 3b0b9d1474cb971ed8f79efedfc5c7d714d74c1c..bd8d23bc5a6c7917c95c91d5afea48683527cceb 100644 --- a/NSolver/LinearConstraintHandlerPenalty.hh +++ b/NSolver/LinearConstraintHandlerPenalty.hh @@ -51,9 +51,6 @@ public: template LinearConstraintHandlerPenalty( const MatrixT& _C, const VectorT& _c); - /// Destructor - ~LinearConstraintHandlerPenalty(); - // penalty weight double& penalty(); diff --git a/NSolver/LinearProblem.cc b/NSolver/LinearProblem.cc index 8939eceebd412e6a522e730b1d5a38f4aa5fb1e8..c845aa776d061452f8a3f935f70682b05b23d995 100644 --- a/NSolver/LinearProblem.cc +++ b/NSolver/LinearProblem.cc @@ -15,10 +15,6 @@ namespace COMISO { x_.resize(_dimension, 0.0); } -LinearProblem::~LinearProblem() -{ -} - int LinearProblem::n_unknowns() { return static_cast(coeffs_.size()); diff --git a/NSolver/LinearProblem.hh b/NSolver/LinearProblem.hh index d0f368ab6dc66f5891f435594ba0d498b9279c6e..ebca0b2ea6f8155a1b751382914e3005220dafea 100644 --- a/NSolver/LinearProblem.hh +++ b/NSolver/LinearProblem.hh @@ -45,9 +45,6 @@ public: /// Default constructor LinearProblem (std::size_t _dimension = 0); - /// Destructor - virtual ~LinearProblem(); - // problem definition virtual int n_unknowns(); diff --git a/NSolver/NPDerivativeChecker.cc b/NSolver/NPDerivativeChecker.cc index 05fca0fc9f1796a6114d99744c36c30154a0feaa..743c362224b0786311d76748603d5d23d738d99a 100644 --- a/NSolver/NPDerivativeChecker.cc +++ b/NSolver/NPDerivativeChecker.cc @@ -2,10 +2,4 @@ namespace COMISO { -NPDerivativeChecker::NPDerivativeChecker() -{} - -NPDerivativeChecker::~NPDerivativeChecker() -{} - } diff --git a/NSolver/NPDerivativeChecker.hh b/NSolver/NPDerivativeChecker.hh index acdb95d9d3a8be018c734aa0d1a1ee55cb8c1b0a..05cd93b1e5e6998437aa522c47da8c8ba3cfc4cc 100644 --- a/NSolver/NPDerivativeChecker.hh +++ b/NSolver/NPDerivativeChecker.hh @@ -60,12 +60,6 @@ public: double relativeEps; }; - /// Default constructor - NPDerivativeChecker(); - - /// Destructor - ~NPDerivativeChecker(); - template bool check_all(ProblemInterface* _np, double _dx, double _eps) { diff --git a/NSolver/NPLinearConstraints.cc b/NSolver/NPLinearConstraints.cc index 8adc3c9db8736f663529d9940c4f1e08d38684a7..ef2c2a97da70c31720225934af60cf8754c3a720 100644 --- a/NSolver/NPLinearConstraints.cc +++ b/NSolver/NPLinearConstraints.cc @@ -31,9 +31,6 @@ NPLinearConstraintsElimination::NPLinearConstraintsElimination(NProblemGmmInterf this->initialize_identity(base_->n_unknowns()); } -/// Destructor -NPLinearConstraintsElimination::~NPLinearConstraintsElimination() {} - // NSolverInterface int NPLinearConstraintsElimination::n_unknowns () { return this->n_reduced(); } @@ -126,10 +123,6 @@ double* NPLinearConstraintsElimination::P(const std::vector& _v) NPLinearConstraintsPenalty::NPLinearConstraintsPenalty( NProblemGmmInterface* _np) : base_(_np) { if( !base_) std::cerr << "Warning: initialized NPLinearConstraints with zero pointer...\n"; } - /// Destructor -NPLinearConstraintsPenalty::~NPLinearConstraintsPenalty() -{} - // NSolverInterface int NPLinearConstraintsPenalty::n_unknowns () { return base_->n_unknowns(); } diff --git a/NSolver/NPLinearConstraints.hh b/NSolver/NPLinearConstraints.hh index 78ea2685c655f3f8791f51bc792bfdffff28923d..deae5f9bf334ecb94789b692a125f2f25b648e84 100644 --- a/NSolver/NPLinearConstraints.hh +++ b/NSolver/NPLinearConstraints.hh @@ -47,9 +47,6 @@ public: /// Default constructor having a pointer to the main problem NPLinearConstraintsElimination( NProblemGmmInterface* _np); - /// Destructor - ~NPLinearConstraintsElimination(); - // initialize constraints template void initialize_constraints( const MatrixT& _C, const VectorT& _c); @@ -100,9 +97,6 @@ public: /// Default constructor having a pointer to the main problem NPLinearConstraintsPenalty( NProblemGmmInterface* _np); - /// Destructor - ~NPLinearConstraintsPenalty(); - // initialize constraints template void initialize_constraints( const MatrixT& _C, const VectorT& _c); diff --git a/NSolver/NPTiming.cc b/NSolver/NPTiming.cc index 6bdf0958f5acf81866fa678d6ee9d483750b7201..109fdb1018eaec34895093aa5a287b8be1673955 100644 --- a/NSolver/NPTiming.cc +++ b/NSolver/NPTiming.cc @@ -23,10 +23,7 @@ namespace COMISO { /// Default constructor NPTiming::NPTiming(NProblemInterface* _base) : base_(_base) {start_timing();} -/// Destructor -NPTiming::~NPTiming() {} - -int NPTiming::n_unknowns () +int NPTiming::n_unknowns() { return base_->n_unknowns(); } diff --git a/NSolver/NPTiming.hh b/NSolver/NPTiming.hh index 593abf9c22fa0e41d9358182edee24f8ada46f5b..cb9a4cbf8440c7c5c86877fd12dd59d1d03dd9b6 100644 --- a/NSolver/NPTiming.hh +++ b/NSolver/NPTiming.hh @@ -39,9 +39,6 @@ public: /// Default constructor NPTiming(NProblemInterface* _base); - /// Destructor - ~NPTiming(); - virtual int n_unknowns (); virtual void initial_x( double* _x ); diff --git a/NSolver/NProblemGmmInterface.hh b/NSolver/NProblemGmmInterface.hh index da1c933311615015e6944cc4dad9419107bcc4f7..88cb966771cee429bb872cf59936e7b6011d9e9a 100644 --- a/NSolver/NProblemGmmInterface.hh +++ b/NSolver/NProblemGmmInterface.hh @@ -14,6 +14,7 @@ #include #include +#include //== FORWARDDECLARATIONS ====================================================== @@ -42,11 +43,11 @@ public: /// Default constructor NProblemGmmInterface() - {std::cerr << "Warning: NProblemGmmInterface is deprecated -> use NProblemInterface instead!!!" << std::endl;} + { + DEB_error( + "NProblemGmmInterface is deprecated -> use NProblemInterface instead"); + } - /// Destructor - ~NProblemGmmInterface() {} - virtual int n_unknowns ( ) = 0; virtual void initial_x ( double* _x ) = 0; virtual double eval_f ( const double* _x ) = 0; diff --git a/NSolver/NProblemIPOPT.hh b/NSolver/NProblemIPOPT.hh index 9f8e4a6e50220fc9e2a058c012b56089c0c50d3e..cd419e6bab381e5d1f77497cbad7331cb678e62a 100644 --- a/NSolver/NProblemIPOPT.hh +++ b/NSolver/NProblemIPOPT.hh @@ -72,9 +72,6 @@ public: analyze_special_properties(_problem, _constraints); } - /** default destructor */ - virtual ~NProblemIPOPT() {}; - /**@name Overloaded from TNLP */ //@{ /** Method to return some info about the nlp */ @@ -218,9 +215,6 @@ public: : problem_(_problem), constraints_(_constraints), nnz_jac_g_(0), nnz_h_lag_(0) {} - /** default destructor */ - virtual ~NProblemGmmIPOPT() {}; - /**@name Overloaded from TNLP */ //@{ /** Method to return some info about the nlp */ diff --git a/NSolver/NewtonSolver.cc b/NSolver/NewtonSolver.cc index 701c34cfb55b51b59d6c989f742dad3a94b4a007..4e8f378117d7cf1af642fddb5a300b0e295ecb84 100644 --- a/NSolver/NewtonSolver.cc +++ b/NSolver/NewtonSolver.cc @@ -183,10 +183,11 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A, if(!fact_ok || kkt_res2 > KKT_res_eps || constraint_res2 > max_allowed_constraint_violation2) { - // alternatingly regularize hessian and constraints + DEB_warning(2, "Numerical issues in KKT system"); + // alternate hessian and constraints regularization if(reg_iters % 2 == 0 || regularize_constraints >= regularize_constraints_limit) { - DEB_line(2, "Warning: numerical issues in KKT system with residual^2 " << kkt_res2 << " (" << constraint_res2 << ") -> regularize hessian"); + DEB_line(2, "residual ^ 2 " << kkt_res2 << "->regularize hessian"); if(regularize_hessian == 0.0) regularize_hessian = 1e-6; else @@ -194,7 +195,7 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A, } else { - DEB_line(2, "Warning: numerical issues in KKT system with residual^2 " << kkt_res2 << " (" << constraint_res2 << ") -> regularize constraints"); + DEB_line(2, "residual^2 " << kkt_res2 << " -> regularize constraints"); if(regularize_constraints == 0.0) regularize_constraints = 1e-8; else @@ -208,7 +209,8 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A, // no valid step could be found? if(kkt_res2 > KKT_res_eps || constraint_res2 > max_allowed_constraint_violation2 || reg_iters >= max_KKT_regularization_iters) { - DEB_line(2, "Warning: numerical issues in KKT system could not be resolved -> terminating NewtonSolver with current solution"); + DEB_error("numerical issues in KKT system could not be resolved " + "-> terminating NewtonSolver with current solution"); _problem->store_result(x.data()); return 0; } @@ -229,7 +231,8 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A, if(constraint_violation2 > 2*initial_constraint_violation2 && constraint_violation2 > max_allowed_constraint_violation2) { - DEB_line(2, "Warning: numerical issues in KKT system leads to constraint violation -> recovery phase"); + DEB_warning(2, "Numerical issues in KKT system lead to " + "constraint violation -> recovery phase"); // restore old solution x -= dx.head(n)*t; diff --git a/NSolver/NewtonSolver.hh b/NSolver/NewtonSolver.hh index 772c85208f448516f3f4770b6418278ab0a5b034..6a14537588806e8493ff5ffe7b49a9bc0d6bf50b 100644 --- a/NSolver/NewtonSolver.hh +++ b/NSolver/NewtonSolver.hh @@ -65,9 +65,6 @@ public: //#endif } - /// Destructor - ~NewtonSolver() {} - // solve without linear constraints int solve(NProblemInterface* _problem) { diff --git a/NSolver/SuperSparseMatrixT.hh b/NSolver/SuperSparseMatrixT.hh index 1fa9692789879c9045f4b64a8ce32f2d9bbdb556..5a40eb7f79556c32684ef56fa6c7070b0e600a8b 100644 --- a/NSolver/SuperSparseMatrixT.hh +++ b/NSolver/SuperSparseMatrixT.hh @@ -81,9 +81,6 @@ public: : n_rows_(_n_rows), n_cols_(_n_cols) {} - /// Destructor - ~SuperSparseMatrixT() {} - // iterate over non-zeros iterator begin() { return iterator(data_.begin()); } iterator end() { return iterator(data_.end()); } diff --git a/NSolver/TAOSolver.hh b/NSolver/TAOSolver.hh index 149f45fda3332616d52a174d0d3c65557be9ab9d..e8d268e9abf773fa501edc31cf72cd017c94dcc1 100644 --- a/NSolver/TAOSolver.hh +++ b/NSolver/TAOSolver.hh @@ -42,14 +42,6 @@ namespace COMISO { class COMISODLLEXPORT TAOSolver { public: - - /// Default constructor - TAOSolver() {} - - - /// Destructor - ~TAOSolver() {} - // solve problem static int solve( NProblemInterface* _base); static int solve( NProblemGmmInterface* _base); diff --git a/NSolver/TestInterface.hh b/NSolver/TestInterface.hh index 993c8a0aed1a75d0b94c2caaa63afbc7a412363d..319756eaaf5c4eeaa5e548e90ea03408bdf397cd 100644 --- a/NSolver/TestInterface.hh +++ b/NSolver/TestInterface.hh @@ -36,13 +36,6 @@ namespace COMISO { class COMISODLLEXPORT TestInterface : public NProblemGmmInterface { public: - - /// Default constructor - TestInterface() {} - - /// Destructor - ~TestInterface() {} - // minimize (x-2.4)^2 virtual int n_unknowns ( ) diff --git a/QtWidgets/MISolverDialogUI.hh b/QtWidgets/MISolverDialogUI.hh deleted file mode 100644 index cb8691b80378156153784736d9fb0e8c9cb14a5e..0000000000000000000000000000000000000000 --- a/QtWidgets/MISolverDialogUI.hh +++ /dev/null @@ -1,113 +0,0 @@ -/*===========================================================================*\ - * * - * CoMISo * - * Copyright (C) 2008-2009 by Computer Graphics Group, RWTH Aachen * - * www.rwth-graphics.de * - * * - *---------------------------------------------------------------------------* - * This file is part of CoMISo. * - * * - * CoMISo is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * CoMISo is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with CoMISo. If not, see . * - * * -\*===========================================================================*/ - - -//============================================================================= -// -// CLASS MiSolverDialog -// -//============================================================================= - - -#ifndef COMISO_MISOLVERDIALOG_HH -#define COMISO_MISOLVERDIALOG_HH - -#include -#include - -//== BUILD-TIME DEPENDENCIES ================================================================= -#if COMISO_QT_AVAILABLE -//============================================================================================ - -//== INCLUDES ================================================================= - -#include "ui_QtMISolverDialogBaseUI.hh" - -// ACGMake users have to include -// #include "QtMISolverDialogBase.hh" - - -#include - -//== FORWARDDECLARATIONS ====================================================== - -//== NAMESPACES =============================================================== - -namespace COMISO -{ - -//== CLASS DEFINITION ========================================================= - - - -/** \class MISolverDialog MISolverDialog.hh - - Brief Description. - - A more elaborate description follows. -*/ -class MISolverDialog - : public QDialog, public Ui::QtMISolverDialogBaseUI -{ - Q_OBJECT -public: - - /// Default constructor - MISolverDialog( MISolver& _misolver, - QWidget* _parent = 0 ): - QDialog( _parent ), - Ui::QtMISolverDialogBaseUI(), - misolver_( _misolver ) - { - setupUi( this ); - get_parameters(); - - connect( okPB, SIGNAL( clicked() ), this, SLOT( slotOkButton() ) ); - connect( cancelPB, SIGNAL( clicked() ), this, SLOT( slotCancelButton() ) ); - } - - /// Destructor - ~MISolverDialog() {} - - void get_parameters(); - void set_parameters(); - - -public slots: - virtual void slotOkButton(); - virtual void slotCancelButton(); - -private: - - MISolver& misolver_; -}; - - -//============================================================================= -} // namespace COMISO -//============================================================================= -#endif // COMISO_MISOLVERDIALOG_HH defined -//============================================================================= - -#endif diff --git a/Solver/ConstrainedSolver.cc b/Solver/ConstrainedSolver.cc index 4ea10aad83b728d90fbb28e9e17d401b729022a7..b9bd4c94a18ba0ce650908c63f26c46caab837b5 100644 --- a/Solver/ConstrainedSolver.cc +++ b/Solver/ConstrainedSolver.cc @@ -127,6 +127,9 @@ using namespace COMISO_STD; template void ConstrainedSolver::solve(WSRowMatrix&, WSColMatrix&, DoubleVector&, DoubleVector&, IntVector&, double, bool, bool); +template void ConstrainedSolver::solve(WSRowMatrix&, WSRowMatrix&, + DoubleVector&, IntVector&, double, bool, bool); + template void ConstrainedSolver::solve_const(const WSRowMatrix&, const WSColMatrix&, DoubleVector&, const DoubleVector&, const IntVector&, double, bool, bool); diff --git a/Solver/ConstrainedSolver.hh b/Solver/ConstrainedSolver.hh index f2c6dc45e3a55a7315662acea5b732725af55fee..7f045fecf25b5895196bd2075d022015620d2b3a 100644 --- a/Solver/ConstrainedSolver.hh +++ b/Solver/ConstrainedSolver.hh @@ -67,9 +67,6 @@ public: ConstrainedSolver( bool _do_gcd = true): do_gcd_(_do_gcd) { epsilon_ = 1e-8; noisy_ = 1; } - /// Destructor - ~ConstrainedSolver() { } - /** @name Contrained solvers * Functions to solve constrained linear systems of the form Ax=b (stemming from quadratic energies). * The constraints can be linear constraints of the form \f$ x_1*c_1+ \cdots +x_n*c_n=c \f$ as well as integer constraints \f$x_i\in \mathbf{Z}\f$. diff --git a/Solver/EigenLDLTSolver.cc b/Solver/EigenLDLTSolver.cc index bc7f277085986331f55444f7973c98d00e1461fb..81321981033e4f575040b65ea2f29395c049845d 100644 --- a/Solver/EigenLDLTSolver.cc +++ b/Solver/EigenLDLTSolver.cc @@ -30,20 +30,6 @@ namespace COMISO { - EigenLDLTSolver::EigenLDLTSolver() : n_(0) -{ - -} - - - //----------------------------------------------------------------------------- - - - EigenLDLTSolver::~EigenLDLTSolver() -{ -} - - //----------------------------------------------------------------------------- @@ -56,7 +42,7 @@ bool EigenLDLTSolver::calc_system( const std::vector& _colptr, } - //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- bool EigenLDLTSolver::update_system( const std::vector& _colptr, diff --git a/Solver/EigenLDLTSolver.hh b/Solver/EigenLDLTSolver.hh index 3fde54f353fee9464cb4a0dd3f28edba2350afc6..488fc53d585abb5c92f177054fed3749924726e7 100644 --- a/Solver/EigenLDLTSolver.hh +++ b/Solver/EigenLDLTSolver.hh @@ -4,7 +4,7 @@ * Copyright (C) 2008-2009 by Computer Graphics Group, RWTH Aachen * * www.rwth-graphics.de * * * - *---------------------------------------------------------------------------* + *---------------------------------------------------------------------------* * This file is part of CoMISo. * * * * CoMISo is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ * You should have received a copy of the GNU General Public License * * along with CoMISo. If not, see . * * * -\*===========================================================================*/ +\*===========================================================================*/ //============================================================================= @@ -58,59 +58,54 @@ LOW_CODE_QUALITY_SECTION_END namespace COMISO { //== CLASS DEFINITION ========================================================= -class EigenLDLTSolver +class COMISODLLEXPORT EigenLDLTSolver { public: + EigenLDLTSolver() : n_(0) {} - // _size is maximal size this instance can handle (smaller problems are possible!!!) - COMISODLLEXPORT EigenLDLTSolver(); - COMISODLLEXPORT ~EigenLDLTSolver(); + bool calc_system(const std::vector& _colptr, + const std::vector& _rowind, + const std::vector& _values); - COMISODLLEXPORT - bool calc_system( const std::vector& _colptr, - const std::vector& _rowind, - const std::vector& _values ); + template< class GMM_MatrixT> + bool calc_system_gmm(const GMM_MatrixT& _mat); - template< class GMM_MatrixT> - bool calc_system_gmm( const GMM_MatrixT& _mat); + template< class Eigen_MatrixT> + bool calc_system_eigen(const Eigen_MatrixT& _mat); - template< class Eigen_MatrixT> - bool calc_system_eigen( const Eigen_MatrixT& _mat); + bool update_system(const std::vector& _colptr, + const std::vector& _rowind, + const std::vector& _values); - COMISODLLEXPORT - bool update_system( const std::vector& _colptr, - const std::vector& _rowind, - const std::vector& _values ); + template< class GMM_MatrixT> + bool update_system_gmm(const GMM_MatrixT& _mat); - template< class GMM_MatrixT> - bool update_system_gmm( const GMM_MatrixT& _mat); + template< class Eigen_MatrixT> + bool update_system_eigen(const Eigen_MatrixT& _mat); - template< class Eigen_MatrixT> - bool update_system_eigen( const Eigen_MatrixT& _mat); - COMISODLLEXPORT - bool solve ( double * _x0, double * _b); + bool solve(double * _x0, double * _b); - COMISODLLEXPORT - bool solve ( std::vector& _x0, std::vector& _b); - COMISODLLEXPORT - bool& show_timings(); - - COMISODLLEXPORT - int dimension(); - + bool solve(std::vector& _x0, std::vector& _b); + + + bool& show_timings(); + + + int dimension(); + private: - // dimension n_ - unsigned int n_; + // dimension n_ + unsigned int n_; - Eigen::SimplicialLDLT > ldlt_; + Eigen::SimplicialLDLT > ldlt_; - bool show_timings_; + bool show_timings_; }; -//============================================================================= + //============================================================================= } // namespace COMISO //============================================================================= #if defined(INCLUDE_TEMPLATES) && !defined(COMISO_EIGEN_LDLT_SOLVER_TEMPLATES_C) diff --git a/Solver/IterativeSolverT.hh b/Solver/IterativeSolverT.hh index 34b7aad0b3616887d5d6300b3d2af0fe14f71c2d..8f843590bb761de384eab18b9b0ed1f72b40ffe3 100644 --- a/Solver/IterativeSolverT.hh +++ b/Solver/IterativeSolverT.hh @@ -38,16 +38,8 @@ template class IterativeSolverT { public: - typedef RealT Real; - /// Constructor - IterativeSolverT() {} - - /// Destructor - ~IterativeSolverT() {} - - // local gauss_seidel bool gauss_seidel_local( typename gmm::csc_matrix& _A, std::vector& _x, diff --git a/Solver/MISolver.cc b/Solver/MISolver.cc index 13730ed4d7359cef5b0b557d383c90d52015f1f9..16b7a0daf80f0fd20242dd8efe72fe12c3903c34 100644 --- a/Solver/MISolver.cc +++ b/Solver/MISolver.cc @@ -82,14 +82,6 @@ MISolver::MISolver() } -//----------------------------------------------------------------------------- - - -MISolver::~MISolver() -{ -} - - //----------------------------------------------------------------------------- void @@ -211,10 +203,12 @@ MISolver::solve_cplex( } catch (IloException& e) { + PROGRESS_RESUME_ABORT; // resume a processed abort request DEB_warning(2, "CPLEX Concert exception caught: " << e.getMessage() ) } catch (...) { + PROGRESS_RESUME_ABORT; // resume a processed abort request DEB_warning(1, "CPLEX Unknown exception caught" ) } @@ -844,10 +838,12 @@ MISolver::solve_gurobi( } catch(GRBException& e) { + PROGRESS_RESUME_ABORT; // resume a processed abort request DEB_warning(2, "Error code = " << e.getErrorCode() << "[" << e.getMessage() << "]\n") } catch(...) { + PROGRESS_RESUME_ABORT; // resume a processed abort request DEB_warning(1, "Exception during optimization") } diff --git a/Solver/MISolver.hh b/Solver/MISolver.hh index 8ed24b75a12391ca0f8f3e5ea06addcd054cc281..f2ceee313e0bcd212445fcb43a51ecf0f0612e41 100644 --- a/Solver/MISolver.hh +++ b/Solver/MISolver.hh @@ -96,10 +96,6 @@ public: /// default Constructor MISolver(); - /// Destructor - ~MISolver(); - - /// Compute greedy approximation to a mixed integer problem. /** @param _A symmetric positive semi-definite CSC matrix (Will be \b destroyed!) * @param _x vector holding solution at the end diff --git a/Utils/MutablePriorityQueueT.hh b/Utils/MutablePriorityQueueT.hh index 8797f4a1a256f24675a31d2a94b88f662420f61c..697876f8670ded7c2149708be0369db6a2ea495d 100644 --- a/Utils/MutablePriorityQueueT.hh +++ b/Utils/MutablePriorityQueueT.hh @@ -56,16 +56,8 @@ template class MutablePriorityQueueT { public: - - typedef Triple TripleVII; - /// Default constructor - MutablePriorityQueueT() {} - - /// Destructor - ~MutablePriorityQueueT() {} - // reset timestamps void clear(size_t _n) {