Drake
 All Classes Files Functions Variables
Constraint Class Reference

Constraint that will be used for Drake solvers. More...

Inheritance diagram for Constraint:
Collaboration diagram for Constraint:

Public Member Functions

function Constraint (lb, ub, xdim, options)
 Constraint(lb,ub) or Constraint(lb,ub,eval_handle) More...
 
function setSparseStructure (obj, iCfun, jCvar)
 set the sparse structure of the 1st order gradient matrix More...
 
function getGradientSparseStructure (obj)
 
function checkGradient (obj, tol, varargin)
 Check the accuracy and sparsity pattern of the gradient. More...
 
function setName (obj, name)
 
function disp (obj)
 
function eval (obj, varargin)
 
function setBounds (obj, lb, ub)
 revise the bounds for the constraint More...
 

Public Attributes

Property grad_level
 
Property grad_method
 A string indicating the method to compute gradient. If empty,. More...
 

Protected Member Functions

virtual function constraintEval (obj, varargin)
 

Protected Attributes

Property lb
 
Property ub
 
Property xdim
 
Property num_cnstr
 
Property name
 
Property ceq_idx
 
Property cin_idx
 

Detailed Description

Constraint that will be used for Drake solvers.

This is an abstract class, subclasses must implement the protected method constraintEval. The eval function here is maintained to allow use with geval, if the user does not specify required gradients.

Constraints may be functions of multiple arguments.

Constructor & Destructor Documentation

function Constraint ( lb  ,
ub  ,
xdim  ,
options   
)

Constraint(lb,ub) or Constraint(lb,ub,eval_handle)

Parameters
lbThe lower bound of the constraint
ubThe upper bound of the constraint
xdimsize of the input
Options:
grad_level  derivative level of user gradients -2 - non-differentiable -1 - unknown 0 - no user gradients 1 - first derivatives provided %
Default: -1
iCfun  The row indices of nonzero entries in the gradient matrix
jCvar  The column indices of nonzero entries in the gradient matrix
Return values
obj

Member Function Documentation

function checkGradient ( obj  ,
tol  ,
varargin   
)

Check the accuracy and sparsity pattern of the gradient.

Parameters
tol– A double scalar. The tolerance of the user gradient, compared with numerical gradient
varargin– The argument passed to eval function
virtual function constraintEval ( obj  ,
varargin   
)
protectedvirtual
function disp ( obj  )
function eval ( obj  ,
varargin   
)
Return values
varargout
function getGradientSparseStructure ( obj  )
Return values
iCfun
jCvar
nnz
function setBounds ( obj  ,
lb  ,
ub   
)

revise the bounds for the constraint

Parameters
lbThe lower bound of the constraint
ubThe upper bound of the constraint
Return values
obj
function setName ( obj  ,
name   
)
Parameters
name– A cell array, name{i} is the name string of i'th constraint if name is a string, then the variables will be named name1, name2, name3, etc.
Return values
obj
function setSparseStructure ( obj  ,
iCfun  ,
jCvar   
)

set the sparse structure of the 1st order gradient matrix

Parameters
iCfun– An int vector. The row index of non-zero entries of the gradient matrix
jCvar– An int vector. The column index of the non-zero entries of the gradient matrix
Return values
obj

Member Data Documentation

Property ceq_idx
protected
Property cin_idx
protected
Property grad_level
Property grad_method

A string indicating the method to compute gradient. If empty,.

Property lb
protected
Property name
protected
Property num_cnstr
protected
Property ub
protected
Property xdim
protected

The documentation for this class was generated from the following file: