Drake
QuadraticCost Class Reference

Implements a cost of the form .5 x'Qx + b'x + c . More...

#include <drake/solvers/cost.h>

Inheritance diagram for QuadraticCost:
[legend]
Collaboration diagram for QuadraticCost:
[legend]

Public Member Functions

template<typename DerivedQ , typename Derivedb >
 QuadraticCost (const Eigen::MatrixBase< DerivedQ > &Q, const Eigen::MatrixBase< Derivedb > &b, double c=0.)
 Constructs a cost of the form .5 x'Qx + b'x + c . More...
 
 ~QuadraticCost () override
 
const Eigen::MatrixXd & Q () const
 
const Eigen::VectorXd & b () const
 
double c () const
 
template<typename DerivedQ , typename DerivedB >
void UpdateCoefficients (const Eigen::MatrixBase< DerivedQ > &new_Q, const Eigen::MatrixBase< DerivedB > &new_b, double new_c=0.)
 Updates the quadratic and linear term of the constraint. More...
 
Does not allow copy, move, or assignment
 QuadraticCost (const QuadraticCost &)=delete
 
QuadraticCostoperator= (const QuadraticCost &)=delete
 
 QuadraticCost (QuadraticCost &&)=delete
 
QuadraticCostoperator= (QuadraticCost &&)=delete
 
- Public Member Functions inherited from Cost
 Cost (const Cost &)=delete
 
Costoperator= (const Cost &)=delete
 
 Cost (Cost &&)=delete
 
Costoperator= (Cost &&)=delete
 
- Public Member Functions inherited from EvaluatorBase
virtual ~EvaluatorBase ()
 
void Eval (const Eigen::Ref< const Eigen::VectorXd > &x, Eigen::VectorXd &y) const
 Evaluates the expression with a scalar type of double. More...
 
void Eval (const Eigen::Ref< const AutoDiffVecXd > &x, AutoDiffVecXd &y) const
 Evaluates the expression with a scalar type of AutoDiffXd. More...
 
void set_description (const std::string &description)
 Set a human-friendly description for the evaluator. More...
 
const std::string & get_description () const
 Getter for a human-friendly description for the evaluator. More...
 
int num_vars () const
 Getter for the number of variables, namely the number of rows in x, as used in Eval(x, y). More...
 
int num_outputs () const
 Getter for the number of outputs, namely the number of rows in y, as used in Eval(x, y). More...
 
 EvaluatorBase (const EvaluatorBase &)=delete
 
EvaluatorBaseoperator= (const EvaluatorBase &)=delete
 
 EvaluatorBase (EvaluatorBase &&)=delete
 
EvaluatorBaseoperator= (EvaluatorBase &&)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from Cost
 Cost (int num_vars, const std::string &description="")
 Constructs a cost evaluator. More...
 
- Protected Member Functions inherited from EvaluatorBase
 EvaluatorBase (int num_outputs, int num_vars, const std::string &description="")
 Constructs a evaluator. More...
 

Detailed Description

Implements a cost of the form .5 x'Qx + b'x + c .

Constructor & Destructor Documentation

QuadraticCost ( const QuadraticCost )
delete
QuadraticCost ( QuadraticCost &&  )
delete
QuadraticCost ( const Eigen::MatrixBase< DerivedQ > &  Q,
const Eigen::MatrixBase< Derivedb > &  b,
double  c = 0. 
)
inline

Constructs a cost of the form .5 x'Qx + b'x + c .

Parameters
QQuadratic term.
bLinear term.
c(optional) Constant term.
~QuadraticCost ( )
inlineoverride

Member Function Documentation

const Eigen::VectorXd& b ( ) const
inline
double c ( ) const
inline
QuadraticCost& operator= ( const QuadraticCost )
delete
QuadraticCost& operator= ( QuadraticCost &&  )
delete
const Eigen::MatrixXd& Q ( ) const
inline
void UpdateCoefficients ( const Eigen::MatrixBase< DerivedQ > &  new_Q,
const Eigen::MatrixBase< DerivedB > &  new_b,
double  new_c = 0. 
)
inline

Updates the quadratic and linear term of the constraint.

The new matrices need to have the same dimension as before.

Parameters
new_QNew quadratic term.
new_bNew linear term.
new_c(optional) New constant term.

Here is the call graph for this function:

Here is the caller graph for this function:


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