Commit 506acf23 authored by Martin Marinov's avatar Martin Marinov

Remove dummy constructor and destructor definitions that can be generated...

Remove dummy constructor and destructor definitions that can be generated automatically by the compiler.
parent a7794840
......@@ -42,17 +42,9 @@ namespace COMISO {
class COMISODLLEXPORT ArpackSolver
{
public:
// sparse matrix type
typedef EigenArpackMatrixT<double,Eigen::SparseMatrix<double,Eigen::ColMajor> > 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<class MatrixT,class MatrixT2>
void check_result(const MatrixT& _A, std::vector<double>& _eigenvalues, MatrixT2& _eigenvectors);
private:
};
......
......@@ -74,9 +74,6 @@ public:
}
}
/// Destructor
~EigenArpackMatrixT() {}
// get reference on matrix
Matrix& matrix() { return mat_; }
......
......@@ -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)
{
......
......@@ -30,14 +30,6 @@ BoundConstraint(const unsigned int _var_idx, // index of variable for bound c
}
//-----------------------------------------------------------------------------
BoundConstraint::
~BoundConstraint()
{
}
//-----------------------------------------------------------------------------
......
......@@ -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 );
......
......@@ -39,12 +39,6 @@ namespace COMISO {
class COMISODLLEXPORT CBCSolver
{
public:
/// Default constructor
CBCSolver() {}
/// Destructor
~CBCSolver() {}
// ********** SOLVE **************** //
//! \throws Outcome
bool solve(
......
......@@ -44,12 +44,6 @@ public:
typedef std::pair<unsigned int, VariableType> PairUiV;
/// Default constructor
COMISOSolver() {}
/// Destructor
~COMISOSolver() {}
// ********** SOLVE **************** //
void solve(NProblemInterface* _problem, // problem instance
std::vector<NConstraintInterface*>& _constraints, // linear constraints
......
......@@ -1300,14 +1300,6 @@ add_constraint_to_model( NConstraintInterface* _constraint, std::vector<IloNumVa
}
CPLEXSolver::
CPLEXSolver()
{
}
//-----------------------------------------------------------------------------
......
......@@ -45,12 +45,6 @@ class COMISODLLEXPORT CPLEXSolver
{
public:
/// Default constructor
CPLEXSolver();
/// Destructor
~CPLEXSolver() { /*env_.end();*/}
// ********** SOLVE **************** //
// this function has to be inline due to static linking issues
bool solve(NProblemInterface* _problem, // problem instance
......
......@@ -5,22 +5,20 @@
//== INCLUDES =================================================================
#include "CombinedProblem.hh"
#include <Base/Debug/DebOut.hh>
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();
......
......@@ -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();
......
......@@ -39,9 +39,6 @@ ConeConstraint::ConeConstraint(const double _c, const int _i, const SMatrixNC& _
{
}
/// Destructor
ConeConstraint::~ConeConstraint() {}
int ConeConstraint::n_unknowns()
{
return Q_.cols();
......
......@@ -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
......
......@@ -13,17 +13,6 @@
namespace COMISO {
ConstraintTools::ConstraintTools()
{
}
//-----------------------------------------------------------------------------
ConstraintTools::~ConstraintTools()
{
}
//-----------------------------------------------------------------------------
void
......
......@@ -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<NConstraintInterface*>& _constraints, const double _eps = 1e-8);
......
......@@ -242,8 +242,6 @@ private:
Job::~Job()
{
DEB_enter_func;
delete stts_;
if (url_.empty()) // not setup
......
......@@ -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);
......
......@@ -237,9 +237,6 @@ public:
/// Default constructor
FiniteElementProblem(const unsigned int _n);
/// Destructor
virtual ~FiniteElementProblem();
void add_set(FiniteElementSetBase* _fe_set);
void clear_sets();
......
......@@ -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;
......
......@@ -42,13 +42,6 @@ namespace COMISO {
class COMISODLLEXPORT GUROBISolver
{
public:
/// Default constructor
GUROBISolver();
/// Destructor
~GUROBISolver() {}
// ********** SOLVE **************** //
bool solve(NProblemInterface* _problem, // problem instance
std::vector<NConstraintInterface*>& _constraints, // linear constraints
......
......@@ -52,9 +52,6 @@ public:
/// Default constructor -> set up IpOptApplication
IPOPTSolver();
/// Destructor
~IPOPTSolver() {}
// ********** SOLVE **************** //
// solve -> returns ipopt status code
//------------------------------------------------------
......
......@@ -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();}
......
......@@ -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();
......
......@@ -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
......
......@@ -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)
......
......@@ -20,13 +20,6 @@ namespace COMISO {
/// Constructor
LinearConstraintHandlerPenalty::LinearConstraintHandlerPenalty() : penalty_(10000) {}
//-----------------------------------------------------------------------------
/// Destructor
LinearConstraintHandlerPenalty::~LinearConstraintHandlerPenalty()
{}
//-----------------------------------------------------------------------------
// penalty weight
......
......@@ -51,9 +51,6 @@ public:
template<class MatrixT, class VectorT>
LinearConstraintHandlerPenalty( const MatrixT& _C, const VectorT& _c);
/// Destructor
~LinearConstraintHandlerPenalty();
// penalty weight
double& penalty();
......
......@@ -15,10 +15,6 @@ namespace COMISO {
x_.resize(_dimension, 0.0);
}
LinearProblem::~LinearProblem()
{
}
int LinearProblem::n_unknowns()
{
return static_cast<int>(coeffs_.size());
......
......@@ -45,9 +45,6 @@ public:
/// Default constructor
LinearProblem (std::size_t _dimension = 0);
/// Destructor
virtual ~LinearProblem();
// problem definition
virtual int n_unknowns();
......
......@@ -2,10 +2,4 @@
namespace COMISO {
NPDerivativeChecker::NPDerivativeChecker()
{}
NPDerivativeChecker::~NPDerivativeChecker()
{}
}
......@@ -60,12 +60,6 @@ public:
double relativeEps;
};
/// Default constructor
NPDerivativeChecker();
/// Destructor
~NPDerivativeChecker();
template<class ProblemInterface>
bool check_all(ProblemInterface* _np, double _dx, double _eps)
{
......
......@@ -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<double>& _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(); }
......
......@@ -47,9 +47,6 @@ public:
/// Default constructor having a pointer to the main problem
NPLinearConstraintsElimination( NProblemGmmInterface* _np);
/// Destructor
~NPLinearConstraintsElimination();
// initialize constraints
template<class MatrixT, class VectorT>
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<class MatrixT, class VectorT>
void initialize_constraints( const MatrixT& _C, const VectorT& _c);
......
......@@ -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();
}
......
......@@ -39,9 +39,6 @@ public:
/// Default constructor
NPTiming(NProblemInterface* _base);
/// Destructor
~NPTiming();
virtual int n_unknowns ();
virtual void initial_x( double* _x );
......
......@@ -14,6 +14,7 @@
#include <gmm/gmm.h>
#include <CoMISo/Config/CoMISoDefines.hh>
#include <Base/Debug/DebOut.hh>
//== 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;
......
......@@ -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 */
......
......@@ -65,9 +65,6 @@ public:
//#endif
}
/// Destructor
~NewtonSolver() {}
// solve without linear constraints
int solve(NProblemInterface* _problem)
{
......
......@@ -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()); }
......
......@@ -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);
......
......@@ -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 ( )
......
......@@ -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$.
......
......@@ -30,20 +30,6 @@
namespace COMISO {
EigenLDLTSolver::EigenLDLTSolver() : n_(0)
{
}
//-----------------------------------------------------------------------------
EigenLDLTSolver::~EigenLDLTSolver()
{
}
//-----------------------------------------------------------------------------
......@@ -56,7 +42,7 @@ bool EigenLDLTSolver::calc_system( const std::vector<int>& _colptr,
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool EigenLDLTSolver::update_system( const std::vector<int>& _colptr,
......
......@@ -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 <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
\*===========================================================================*/
//=============================================================================
......@@ -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<int>& _colptr,
const std::vector<int>& _rowind,
const std::vector<double>& _values);
COMISODLLEXPORT
bool calc_system( const std::vector<int>& _colptr,
const std::vector<int>& _rowind,
const std::vector<double>& _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<int>& _colptr,
const std::vector<int>& _rowind,
const std::vector<double>& _values);
COMISODLLEXPORT
bool update_system( const std::vector<int>& _colptr,
const std::vector<int>& _rowind,
const std::vector<double>& _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<double>& _x0, std::vector<double>& _b);
COMISODLLEXPORT
bool& show_timings();
COMISODLLEXPORT
int dimension();
bool solve(std::vector<double>& _x0, std::vector<double>& _b);
bool& show_timings();
int dimension();
private:
// dimension n_
unsigned int n_;
// dimension n_
unsigned int n_;
Eigen::SimplicialLDLT<Eigen::SparseMatrix<double> > ldlt_;
Eigen::SimplicialLDLT<Eigen::SparseMatrix<double> > ldlt_;
bool show_timings_;
bool show_timings_;
};
//=============================================================================
//=============================================================================
} // namespace COMISO
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(COMISO_EIGEN_LDLT_SOLVER_TEMPLATES_C)
......
......@@ -38,16 +38,8 @@ template <class RealT>
class IterativeSolverT
{
public:
typedef RealT Real;
/// Constructor
IterativeSolverT() {}