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)
Creates a mapped object or data pointer to a const vector without copying data.
Definition gsAsMatrix.h:285
Creates a mapped object or data pointer to a vector without copying data.
Definition gsAsMatrix.h:239
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Class defining an optimization problem.
Definition gsOptProblem.h:25
int m_numConstraints
Number of constraints.
Definition gsOptProblem.h:174
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
int numDesignVars() const
Callback function is executed after every iteration. Returning false causes premature termination of ...
Definition gsOptProblem.h:119
gsVector< T > m_conUpperBounds
Upper bounds for the constraints.
Definition gsOptProblem.h:189
gsVector< T > m_conLowerBounds
Lower bounds for the constraints.
Definition gsOptProblem.h:186
gsVector< T > m_desLowerBounds
Lower bounds for the design variables.
Definition gsOptProblem.h:180
virtual T evalObj(const gsAsConstVector< T > &) const
Returns the gradient value of the objective function at design value u.
Definition gsOptProblem.h:39
virtual void jacobCon_into(const gsAsConstVector< T > &, gsAsVector< T > &) const
Returns Jacobian of the constraints at design value u. Format of result is sparse,...
Definition gsOptProblem.h:80
gsMatrix< T > m_lambda
Lagrange multipliers (set in the finalize_solution method)
Definition gsOptProblem.h:201
int m_numConJacNonZero
Number of nonzero entries in the Constraint Jacobian.
Definition gsOptProblem.h:177
std::vector< index_t > m_conJacRows
Constraint Jacobian non-zero entries rows.
Definition gsOptProblem.h:192
virtual void computeJacStructure()
Computes the sparsity pattern of the constraint Jacobian matrix.
Definition gsOptProblem.h:92
int m_numDesignVars
Number of design variables.
Definition gsOptProblem.h:171
std::vector< index_t > m_conJacCols
Constraint Jacobian non-zero entries columns.
Definition gsOptProblem.h:195
gsMatrix< T > m_curDesign
Current design variables (and starting point )
Definition gsOptProblem.h:198
gsVector< T > m_desUpperBounds
Upper bounds for the design variables.
Definition gsOptProblem.h:183
virtual void evalCon_into(const gsAsConstVector< T > &, gsAsVector< T > &) const
Returns values of the constraints at design value u.
Definition gsOptProblem.h:74
virtual void hessLagr_into(const gsAsConstVector< T > &, gsAsVector< T > &) const
Returns Hessian Lagrangian of the constraints at design value.
Definition gsOptProblem.h:84
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
This is the main header file that collects wrappers of Eigen for linear algebra.
The G+Smo namespace, containing all definitions for the library.