Commit c9cbb879 authored by Pit Nestle's avatar Pit Nestle

SLIMProblemInterface, SLIMSolver added

parent c042d7c0
Pipeline #7400 passed with stages
in 6 minutes and 54 seconds
//=============================================================================
//
// CLASS NProblemInterface
//
//=============================================================================
#ifndef COMISO_SLIMPROBLEMINTERFACE_HH
#define COMISO_SLIMPROBLEMINTERFACE_HH
//== COMPILE-TIME PACKAGE REQUIREMENTS ========================================
#include <CoMISo/Config/config.hh>
#if COMISO_EIGEN3_AVAILABLE
//== INCLUDES =================================================================
#include <Base/Code/Quality.hh>
#include <iostream>
#include <cfloat>
LOW_CODE_QUALITY_SECTION_BEGIN
#include <Eigen/Eigen>
#if !(EIGEN_VERSION_AT_LEAST(3,1,0))
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#endif
#include <Eigen/Sparse>
LOW_CODE_QUALITY_SECTION_END
#include <CoMISo/Config/CoMISoDefines.hh>
//== FORWARDDECLARATIONS ======================================================
//== NAMESPACES ===============================================================
namespace COMISO {
//== CLASS DEFINITION =========================================================
/** \class NProblemInterface NProblemGmmInterface.hh <COMISO/NSolver/NPRoblemInterface.hh>
Brief Description.
A more elaborate description follows.
*/
class COMISODLLEXPORT SLIMProblemInterface
{
public:
/// Default constructor
SLIMProblemInterface();
/// Destructor
virtual ~SLIMProblemInterface();
int n_triangles();
int n_vertices();
void addReferenceVertex(double _x, double _y, double _z);
void addParamVertex(double _x, double _y);
void addTriangle(int _a, int _b, int _c);
void getJacobian(int _f, Eigen::Matrix2d& j);
void getRotation(int _f, Eigen::Matrix2d& r);
void getWeightMat(int _f, Eigen::Matrix2d& w);
void getSingularValues(int _f, double& s1, double& s2);
virtual double evaluateEnergy() = 0;
virtual double evaluateGradient() = 0;
};
//=============================================================================
} // namespace COMISO
//=============================================================================
#endif // COMISO_EIGEN3_AVAILABLE
//=============================================================================
#endif // COMISO_SLIMPROBLEMINTERFACE_HH defined
//=============================================================================
//=============================================================================
//
// CLASS SLIMSolver
//
//=============================================================================
#ifndef COMISO_SLIMSOLVER_HH
#define COMISO_SLIMSOLVER_HH
//== COMPILE-TIME PACKAGE REQUIREMENTS ========================================
#include <CoMISo/Config/config.hh>
//== INCLUDES =================================================================
#include <CoMISo/Config/CoMISoDefines.hh>
#include <CoMISo/Utils/StopWatch.hh>
#include "SLIMProblemInterface.hh"
//#include <Base/Debug/DebTime.hh>
#if COMISO_SUITESPARSE_AVAILABLE
#include <Eigen/UmfPackSupport>
#include <Eigen/CholmodSupport>
#endif
// ToDo: why is Metis not working yet?
//#if COMISO_METIS_AVAILABLE
// #include <Eigen/MetisSupport>
//#endif
//== FORWARDDECLARATIONS ======================================================
//== NAMESPACES ===============================================================
namespace COMISO {
//== CLASS DEFINITION =========================================================
/** \class NewtonSolver NewtonSolver.hh <ACG/.../NewtonSolver.hh>
Brief Description.
A more elaborate description follows.
*/
class COMISODLLEXPORT SLIMSolver
{
public:
/// Default constructor
SLIMSolver(const double _lambda = 1e-4, const int _max_iters = 100)
: lambda_(_lambda), max_iters_(_max_iters)
{
}
int solve(SLIMProblemInterface& problem);
private:
double lambda_;
int max_iters_;
};
//=============================================================================
} // namespace COMISO
//=============================================================================
#endif // ACG_NEWTONSOLVER_HH defined
//=============================================================================
#ifndef SLIMPROBLEMINTERFACE_H
#define SLIMPROBLEMINTERFACE_H
#endif // SLIMPROBLEMINTERFACE_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment