DART  6.7.3
dart::optimizer::snopt::SnoptInterface Class Reference

#include <SnoptInterface.hpp>

Classes

struct  Slack
 

Public Types

enum  Return {
  Solution , UserStop , Error , Stop ,
  Infeasible
}
 
enum  UpdateType { Obj = 1 , Constr = 2 }
 
enum  SlackType { NoSlack = 0 , Vslack = 1 , Wslack = 2 }
 
enum  AbnormalType { NONE = 0 , INFEASIBLE = 1 , HESSIAN_UPDATE = 2 , HESSIAN_RESET = 3 }
 
typedef int(* updateFunc) (long mask, int compute_gradients, double *coef_values, void *update_data)
 

Public Member Functions

 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)
 
 SnoptInterface (int has_objective, VVD J, VVB JMap, std::vector< double > *constraints, double *objective, std::vector< double > *gradient, updateFunc update_f, void *update_d)
 
 ~SnoptInterface ()
 
Return solve (double *x, double *lo_bounds, double *hi_bounds, int unit=4)
 
void clear (long mask, int compute_derivs)
 
void resizeJacobian (int coef_total, int nonlin_coef_total, int constr_total, int nonlin_constr_total)
 
void resizeCoef ()
 
void updateSolverX ()
 
void update (long mask, int compute_derivs, double *x)
 

Static Public Member Functions

static void checkTermination (int *iAbort, double *xs)
 

Public Attributes

int mNumConstr
 
int mNumCoef
 
int mNumNonlinConstr
 
int mNumNonlinObjCoef
 
int mNumNonlinJacCoef
 
double * mSolverX
 
double * mProblemX
 
double * mBoundsLo
 
double * mBoundsHi
 
int * mConstrEqns
 
int mHasObjective
 
double * mObj
 
std::vector< double > * mdObjdCoef
 
std::vector< double > * mConstr
 
VVD mdConstrdCoef
 
Eigen::VectorXd mConstrScale
 
Eigen::VectorXd mCoefScale
 
VVB mCoefMap
 
double mReturnedObj
 
int mOutput
 
int mSum
 
bool mCheckTerm
 
bool mTermination
 
AbnormalType mAbnormal
 
int mBreak
 

Static Public Attributes

static SnoptInterfacemRef = NULL
 

Protected Member Functions

void scaleValues (long update_type, int compute_derivs)
 

Protected Attributes

SnoptInterface::updateFunc mUpdateFunc
 
void * mUpdateData
 

Private Member Functions

void fillUpSnoptFormat (VVD jacobian, double **a, int **ha, int **ka)
 
int sparseCount (int col)
 

Static Private Member Functions

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)
 
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)
 

Member Typedef Documentation

◆ updateFunc

typedef int(* dart::optimizer::snopt::SnoptInterface::updateFunc) (long mask, int compute_gradients, double *coef_values, void *update_data)

Member Enumeration Documentation

◆ AbnormalType

Enumerator
NONE 
INFEASIBLE 
HESSIAN_UPDATE 
HESSIAN_RESET 

◆ Return

Enumerator
Solution 
UserStop 
Error 
Stop 
Infeasible 

◆ SlackType

Enumerator
NoSlack 
Vslack 
Wslack 

◆ UpdateType

Constructor & Destructor Documentation

◆ SnoptInterface() [1/2]

dart::optimizer::snopt::SnoptInterface::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,
SnoptInterface::updateFunc  update_f,
void *  update_d 
)

◆ SnoptInterface() [2/2]

dart::optimizer::snopt::SnoptInterface::SnoptInterface ( int  has_objective,
VVD  J,
VVB  JMap,
std::vector< double > *  constraints,
double *  objective,
std::vector< double > *  gradient,
SnoptInterface::updateFunc  update_f,
void *  update_d 
)

◆ ~SnoptInterface()

dart::optimizer::snopt::SnoptInterface::~SnoptInterface ( )

Member Function Documentation

◆ checkTermination()

void dart::optimizer::snopt::SnoptInterface::checkTermination ( int *  iAbort,
double *  xs 
)
static

◆ clear()

void dart::optimizer::snopt::SnoptInterface::clear ( long  mask,
int  compute_derivs 
)

◆ fillUpSnoptFormat()

void dart::optimizer::snopt::SnoptInterface::fillUpSnoptFormat ( VVD  jacobian,
double **  a,
int **  ha,
int **  ka 
)
private

◆ resizeCoef()

void dart::optimizer::snopt::SnoptInterface::resizeCoef ( )

◆ resizeJacobian()

void dart::optimizer::snopt::SnoptInterface::resizeJacobian ( int  coef_total,
int  nonlin_coef_total,
int  constr_total,
int  nonlin_constr_total 
)

◆ scaleValues()

void dart::optimizer::snopt::SnoptInterface::scaleValues ( long  update_type,
int  compute_derivs 
)
protected

◆ snoptJac()

void dart::optimizer::snopt::SnoptInterface::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 
)
staticprivate

◆ snoptObj()

void dart::optimizer::snopt::SnoptInterface::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 
)
staticprivate

◆ solve()

SnoptInterface::Return dart::optimizer::snopt::SnoptInterface::solve ( double *  x,
double *  lo_bounds,
double *  hi_bounds,
int  unit = 4 
)

◆ sparseCount()

int dart::optimizer::snopt::SnoptInterface::sparseCount ( int  col)
private

◆ update()

void dart::optimizer::snopt::SnoptInterface::update ( long  mask,
int  compute_derivs,
double *  x 
)

◆ updateSolverX()

void dart::optimizer::snopt::SnoptInterface::updateSolverX ( )

Member Data Documentation

◆ mAbnormal

AbnormalType dart::optimizer::snopt::SnoptInterface::mAbnormal

◆ mBoundsHi

double* dart::optimizer::snopt::SnoptInterface::mBoundsHi

◆ mBoundsLo

double* dart::optimizer::snopt::SnoptInterface::mBoundsLo

◆ mBreak

int dart::optimizer::snopt::SnoptInterface::mBreak

◆ mCheckTerm

bool dart::optimizer::snopt::SnoptInterface::mCheckTerm

◆ mCoefMap

VVB dart::optimizer::snopt::SnoptInterface::mCoefMap

◆ mCoefScale

Eigen::VectorXd dart::optimizer::snopt::SnoptInterface::mCoefScale

◆ mConstr

std::vector<double>* dart::optimizer::snopt::SnoptInterface::mConstr

◆ mConstrEqns

int* dart::optimizer::snopt::SnoptInterface::mConstrEqns

◆ mConstrScale

Eigen::VectorXd dart::optimizer::snopt::SnoptInterface::mConstrScale

◆ mdConstrdCoef

VVD dart::optimizer::snopt::SnoptInterface::mdConstrdCoef

◆ mdObjdCoef

std::vector<double>* dart::optimizer::snopt::SnoptInterface::mdObjdCoef

◆ mHasObjective

int dart::optimizer::snopt::SnoptInterface::mHasObjective

◆ mNumCoef

int dart::optimizer::snopt::SnoptInterface::mNumCoef

◆ mNumConstr

int dart::optimizer::snopt::SnoptInterface::mNumConstr

◆ mNumNonlinConstr

int dart::optimizer::snopt::SnoptInterface::mNumNonlinConstr

◆ mNumNonlinJacCoef

int dart::optimizer::snopt::SnoptInterface::mNumNonlinJacCoef

◆ mNumNonlinObjCoef

int dart::optimizer::snopt::SnoptInterface::mNumNonlinObjCoef

◆ mObj

double* dart::optimizer::snopt::SnoptInterface::mObj

◆ mOutput

int dart::optimizer::snopt::SnoptInterface::mOutput

◆ mProblemX

double* dart::optimizer::snopt::SnoptInterface::mProblemX

◆ mRef

SnoptInterface * dart::optimizer::snopt::SnoptInterface::mRef = NULL
static

◆ mReturnedObj

double dart::optimizer::snopt::SnoptInterface::mReturnedObj

◆ mSolverX

double* dart::optimizer::snopt::SnoptInterface::mSolverX

◆ mSum

int dart::optimizer::snopt::SnoptInterface::mSum

◆ mTermination

bool dart::optimizer::snopt::SnoptInterface::mTermination

◆ mUpdateData

void* dart::optimizer::snopt::SnoptInterface::mUpdateData
protected

◆ mUpdateFunc

SnoptInterface::updateFunc dart::optimizer::snopt::SnoptInterface::mUpdateFunc
protected