56 for (
index_t i = 0; i!=n; i++ )
60 const T e1 = this->
evalObj(ctmp);
61 tmp[i] = u[i] + T(0.00002);
62 const T e3 = this->
evalObj(ctmp);
63 tmp[i] = u[i] - T(0.00001);
64 const T e2 = this->
evalObj(ctmp);
65 tmp[i] = u[i] - T(0.00002);
66 const T e4 = this->
evalObj(ctmp);
68 result[c++]= ( 8 * (e1 - e2) + e4 - e3 ) / T(0.00012);
125 int numConDerivs ()
const {
return m_conJacRows.size(); }
141 const std::vector<index_t> & conJacRows()
const {
return m_conJacRows; }
143 const std::vector<index_t> & conJacCols()
const {
return m_conJacCols; }
208 #ifndef GISMO_BUILD_LIB
209 #include GISMO_HPP_HEADER(gsOptProblem.hpp)
virtual void gradObj_into(const gsAsConstVector< T > &u, gsAsVector< T > &result) const
Returns the gradient of the objective function at design value u By default it uses finite difference...
Definition: gsOptProblem.h:45
Class defining an optimization problem.
Definition: gsOptProblem.h:24
int m_numConstraints
Number of constraints.
Definition: gsOptProblem.h:174
virtual void computeJacStructure()
Computes the sparsity pattern of the constraint Jacobian matrix.
Definition: gsOptProblem.h:92
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
gsMatrix< T > m_lambda
Lagrange multipliers (set in the finalize_solution method)
Definition: gsOptProblem.h:201
gsVector< T > m_conUpperBounds
Upper bounds for the constraints.
Definition: gsOptProblem.h:189
#define index_t
Definition: gsConfig.h:32
virtual void jacobCon_into(const gsAsConstVector< T > &, gsAsVector< T > &) const
Returns Jacobian of the constraints at design value u. Format of result is sparse, complying to m_conJacRows and m_conJacCols.
Definition: gsOptProblem.h:80
gsVector< T > m_conLowerBounds
Lower bounds for the constraints.
Definition: gsOptProblem.h:186
gsVector< T > m_desUpperBounds
Upper bounds for the design variables.
Definition: gsOptProblem.h:183
Creates a mapped object or data pointer to a vector without copying data.
Definition: gsLinearAlgebra.h:129
int m_numDesignVars
Number of design variables.
Definition: gsOptProblem.h:171
int numDesignVars() const
Callback function is executed after every iteration. Returning false causes premature termination of ...
Definition: gsOptProblem.h:119
std::vector< index_t > m_conJacRows
Constraint Jacobian non-zero entries rows.
Definition: gsOptProblem.h:192
virtual T evalObj(const gsAsConstVector< T > &) const
Returns the gradient value of the objective function at design value u.
Definition: gsOptProblem.h:39
Creates a mapped object or data pointer to a const vector without copying data.
Definition: gsLinearAlgebra.h:130
This is the main header file that collects wrappers of Eigen for linear algebra.
virtual void evalCon_into(const gsAsConstVector< T > &, gsAsVector< T > &) const
Returns values of the constraints at design value u.
Definition: gsOptProblem.h:74
gsVector< T > m_desLowerBounds
Lower bounds for the design variables.
Definition: gsOptProblem.h:180
virtual void hessLagr_into(const gsAsConstVector< T > &, gsAsVector< T > &) const
Returns Hessian Lagrangian of the constraints at design value.
Definition: gsOptProblem.h:84
int m_numConJacNonZero
Number of nonzero entries in the Constraint Jacobian.
Definition: gsOptProblem.h:177
gsMatrix< T > m_curDesign
Current design variables (and starting point )
Definition: gsOptProblem.h:198
std::vector< index_t > m_conJacCols
Constraint Jacobian non-zero entries columns.
Definition: gsOptProblem.h:195