Drake
 All Classes Files Functions Variables
DrakeFunction Class Reference

drakeFunction.DrakeFunction Abstract parent class for all DrakeFunction classes A DrakeFunction represents a vector-valued function of a single vector input More...

Collaboration diagram for DrakeFunction:

Public Member Functions

virtual function eval (obj, x)
 All child classes must implement an 'eval' method that evaluates the function and its derivative. More...
 
function DrakeFunction (dim_input, dim_output)
 obj = drakeFunction.DrakeFunction(dim_input, dim_output) returns a DrakeFunction object representing a map from R^dim_input to R^dim_output More...
 
function getSparsityPattern (obj)
 
function setSparsityPattern (obj)
 obj = setSparsityPattern(obj) sets the sparsity pattern properties (iCfun and jGvar) in the returned object. More...
 
function plus (obj, other, same_input)
 fcn = plus(obj,other,same_input) returns a DrakeFunction whose output is the sum of the outputs of obj and other. More...
 
function minus (obj, other, varargin)
 fcn = minus(obj,other,same_input) See documentation for drakeFunction.DrakeFunction.plus More...
 
function uminus (obj)
 
function mtimes (obj, other)
 
function times (obj, other)
 
function vertcat (obj, varargin)
 
function concatenate (obj, varargin)
 
function compose (fcn1, fcn2)
 
function duplicate (obj, n)
 fcn = duplicate(obj,n) returns a concatenated DrakeFunction containing n duplicates of obj More...
 
function addInputs (obj, n_additional_inputs, append)
 fcn = appendInputs(obj,n_additional_inputs,append) returns a DrakeFunction that is the same as obj, but with unused inputs added. More...
 
function subsref (obj, s)
 
function getNumInputs (obj)
 
function getNumOutputs (obj)
 

Public Attributes

Property name
 

Protected Attributes

Property dim_input
 
Property dim_output
 
Property iCfun
 gradient sparsity information More...
 
Property jCvar
 
Property nnz
 

Detailed Description

drakeFunction.DrakeFunction Abstract parent class for all DrakeFunction classes A DrakeFunction represents a vector-valued function of a single vector input

Constructor & Destructor Documentation

function DrakeFunction ( dim_input  ,
dim_output   
)

obj = drakeFunction.DrakeFunction(dim_input, dim_output) returns a DrakeFunction object representing a map from R^dim_input to R^dim_output

Parameters
dim_input% length of input vector
dim_output% length of output vector
Return values
obj– drakeFunction.DrakeFunction object

Member Function Documentation

function addInputs ( obj  ,
n_additional_inputs  ,
append   
)

fcn = appendInputs(obj,n_additional_inputs,append) returns a DrakeFunction that is the same as obj, but with unused inputs added.

These inputs are appended or prepended based on the value of 'append'.

Parameters
obj
n_additional_inputs
append– Logical indicating whether to add the inputs after (T) or before (F) the current inputs. Optional.
Default: True
Return values
fcn
function compose ( fcn1  ,
fcn2   
)
Return values
fcn3
function concatenate ( obj  ,
varargin   
)
Return values
fcn
function duplicate ( obj  ,
 
)

fcn = duplicate(obj,n) returns a concatenated DrakeFunction containing n duplicates of obj

Return values
fcn
virtual function eval ( obj  ,
 
)
virtual

All child classes must implement an 'eval' method that evaluates the function and its derivative.

function getNumInputs ( obj  )
Return values
dim_input
function getNumOutputs ( obj  )
Return values
dim_output
function getSparsityPattern ( obj  )
Return values
iCfun
jCvar
function minus ( obj  ,
other  ,
varargin   
)

fcn = minus(obj,other,same_input) See documentation for drakeFunction.DrakeFunction.plus

Parameters
objDrakeFunction object
otherDrakeFunction object
same_input– Logical scalar indicating whether the functions
Return values
fcnDrakeFunction which evaluates the difference between obj and other
function mtimes ( obj  ,
other   
)
Return values
fcn
function plus ( obj  ,
other  ,
same_input   
)

fcn = plus(obj,other,same_input) returns a DrakeFunction whose output is the sum of the outputs of obj and other.

If same_input = true, the returned DrakeFunction has an input of the same size as that of obj and other. If same_input = false, the returned DrakeFunction has an input whose length is the sum of those of the inputs of obj and other

fcn = plus(obj,other) is equivalent to plus(obj,other,false)

Parameters
objDrakeFunction object
otherDrakeFunction object
same_input– Logical scalar indicating whether the functions to be summed should share the same input. Optional.
Default: false
Return values
fcnDrakeFunction which evaluates the sum of obj and other
function setSparsityPattern ( obj  )

obj = setSparsityPattern(obj) sets the sparsity pattern properties (iCfun and jGvar) in the returned object.

Sub-classes that wish to modify the default sparsity pattern (dense) should overload this method

Return values
obj
function subsref ( obj  ,
 
)
Return values
varargout
function times ( obj  ,
other   
)
Return values
fcn
function uminus ( obj  )
Return values
fcn
function vertcat ( obj  ,
varargin   
)
Return values
fcn

Member Data Documentation

Property dim_input
protected
Property dim_output
protected
Property iCfun
protected

gradient sparsity information

Property jCvar
protected
Property name
Property nnz
protected

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