9 #ifndef DART_OPTIMIZER_SNOPT_SNOPT_INTERFACE_H
10 #define DART_OPTIMIZER_SNOPT_SNOPT_INTERFACE_H
13 #include <Eigen/Dense>
14 #include "dart/optimizer/OptimizerArrayTypes.h"
37 typedef int (*
updateFunc) (
long mask,
int compute_gradients,
double *coef_values,
void *update_data);
40 int nonlin_constr_total,
int nonlin_obj_coef,
int nonlin_jac_coef,
41 int *constr_eqns,
int has_objective, VVD J, VVB JMap, std::vector<double> *constraints,
42 double *objective, std::vector<double> *gradient,
updateFunc update_f,
void *update_d);
44 SnoptInterface(
int has_objective, VVD J, VVB JMap, std::vector<double> *constraints,
double *objective,
45 std::vector<double> *gradient,
updateFunc update_f,
void *update_d);
48 Return solve(
double *x,
double *lo_bounds,
double *hi_bounds,
int unit = 4);
50 void clear(
long mask,
int compute_derivs);
52 void resizeJacobian(
int coef_total,
int nonlin_coef_total,
int constr_total,
int nonlin_constr_total);
91 void update(
long mask,
int compute_derivs,
double *x);
99 void scaleValues(
long update_type,
int compute_derivs);
102 static void snoptObj(
int *mode,
int *nn_obj,
double *x,
103 double *f_obj,
double *g_obj,
int *nstate,
104 char *cu,
int *lencu,
int *iu,
int *leniu,
105 double *ru,
int *lenru);
106 static void snoptJac(
int *mode,
int *nn_con,
int *nn_jac,
int *ne_jac,
107 double *x,
double *f_con,
double *g_con,
int *nstate,
108 char *cu,
int *lencu,
int *iu,
int *leniu,
109 double *ru,
int *lenru);
Definition: SnoptInterface.hpp:24
double * mSolverX
Definition: SnoptInterface.hpp:61
SlackType
Definition: SnoptInterface.hpp:28
@ Vslack
Definition: SnoptInterface.hpp:28
@ NoSlack
Definition: SnoptInterface.hpp:28
@ Wslack
Definition: SnoptInterface.hpp:28
static void snoptJac(int *mode, int *nn_con, int *nn_jac, int *ne_jac, double *x, double *f_con, double *g_con, int *nstate, char *cu, int *lencu, int *iu, int *leniu, double *ru, int *lenru)
Definition: SnoptInterface.cpp:504
AbnormalType mAbnormal
Definition: SnoptInterface.hpp:87
void fillUpSnoptFormat(VVD jacobian, double **a, int **ha, int **ka)
Definition: SnoptInterface.cpp:538
void clear(long mask, int compute_derivs)
Definition: SnoptInterface.cpp:109
Return
Definition: SnoptInterface.hpp:26
@ Stop
Definition: SnoptInterface.hpp:26
@ Solution
Definition: SnoptInterface.hpp:26
@ UserStop
Definition: SnoptInterface.hpp:26
@ Infeasible
Definition: SnoptInterface.hpp:26
@ Error
Definition: SnoptInterface.hpp:26
void * mUpdateData
Definition: SnoptInterface.hpp:97
static void snoptObj(int *mode, int *nn_obj, double *x, double *f_obj, double *g_obj, int *nstate, char *cu, int *lencu, int *iu, int *leniu, double *ru, int *lenru)
Definition: SnoptInterface.cpp:484
Eigen::VectorXd mConstrScale
Definition: SnoptInterface.hpp:77
int mNumNonlinObjCoef
Definition: SnoptInterface.hpp:58
double * mBoundsLo
Definition: SnoptInterface.hpp:63
void updateSolverX()
Definition: SnoptInterface.cpp:194
VVB mCoefMap
Definition: SnoptInterface.hpp:80
void resizeJacobian(int coef_total, int nonlin_coef_total, int constr_total, int nonlin_constr_total)
Definition: SnoptInterface.cpp:135
double * mProblemX
Definition: SnoptInterface.hpp:62
bool mTermination
Definition: SnoptInterface.hpp:86
void update(long mask, int compute_derivs, double *x)
Definition: SnoptInterface.cpp:186
int(* updateFunc)(long mask, int compute_gradients, double *coef_values, void *update_data)
Definition: SnoptInterface.hpp:37
int mOutput
Definition: SnoptInterface.hpp:83
VVD mdConstrdCoef
Definition: SnoptInterface.hpp:75
std::vector< double > * mdObjdCoef
Definition: SnoptInterface.hpp:72
static void checkTermination(int *iAbort, double *xs)
Definition: SnoptInterface.cpp:601
AbnormalType
Definition: SnoptInterface.hpp:29
@ NONE
Definition: SnoptInterface.hpp:29
@ HESSIAN_UPDATE
Definition: SnoptInterface.hpp:29
@ INFEASIBLE
Definition: SnoptInterface.hpp:29
@ HESSIAN_RESET
Definition: SnoptInterface.hpp:29
int * mConstrEqns
Definition: SnoptInterface.hpp:65
UpdateType
Definition: SnoptInterface.hpp:27
@ Obj
Definition: SnoptInterface.hpp:27
@ Constr
Definition: SnoptInterface.hpp:27
double * mBoundsHi
Definition: SnoptInterface.hpp:64
std::vector< double > * mConstr
Definition: SnoptInterface.hpp:74
int mHasObjective
Definition: SnoptInterface.hpp:67
~SnoptInterface()
Definition: SnoptInterface.cpp:98
int mNumNonlinJacCoef
Definition: SnoptInterface.hpp:59
int mBreak
Definition: SnoptInterface.hpp:88
double * mObj
Definition: SnoptInterface.hpp:71
SnoptInterface(int constr_total, int coef_total, int nonlin_constr_total, int nonlin_obj_coef, int nonlin_jac_coef, int *constr_eqns, int has_objective, VVD J, VVB JMap, std::vector< double > *constraints, double *objective, std::vector< double > *gradient, updateFunc update_f, void *update_d)
Definition: SnoptInterface.cpp:21
int mNumNonlinConstr
Definition: SnoptInterface.hpp:57
int mNumConstr
Definition: SnoptInterface.hpp:55
int mNumCoef
Definition: SnoptInterface.hpp:56
double mReturnedObj
Definition: SnoptInterface.hpp:81
static SnoptInterface * mRef
Definition: SnoptInterface.hpp:69
SnoptInterface::updateFunc mUpdateFunc
Definition: SnoptInterface.hpp:96
int sparseCount(int col)
Definition: SnoptInterface.cpp:591
int mSum
Definition: SnoptInterface.hpp:84
bool mCheckTerm
Definition: SnoptInterface.hpp:85
Eigen::VectorXd mCoefScale
Definition: SnoptInterface.hpp:78
Return solve(double *x, double *lo_bounds, double *hi_bounds, int unit=4)
Definition: SnoptInterface.cpp:298
void scaleValues(long update_type, int compute_derivs)
Definition: SnoptInterface.cpp:199
Definition: BulletCollisionDetector.cpp:63
Definition: SnoptInterface.hpp:31
double val
Definition: SnoptInterface.hpp:34
SlackType type
Definition: SnoptInterface.hpp:33
int constr_idx
Definition: SnoptInterface.hpp:32