8.9.4. MDOPsdExpr

MDOPsdExpr

Represents a PSD expression in a MindOpt application. The PSD expression contains the PSD item and optionally a linear expression.

Methods

MDOPsdExpr

Construct a PSD expression with a linear expression

MDOPsdExpr

Construct a PSD expression with a PSD term

addTerm

Add a PSD term to this PSD expression

addTerm

Add a linear term to this PSD expression

addTerms

Add linear terms to this PSD expression

getCoeff

Retrieve the coefficients in the ith PSD term

getLinExpr

Retrieve the linear expression contained in this PSD expression

getPsdVar

Retrieve the PSD variable in the ith PSD term

getValue

Retrieve the value of this PSD expression after the problem is resolved

remove

Delete the ith PSD term from this PSD expression

remove

Delete All PSD terms that contain the specified PSD variable

size

Retrieve the number of PSD terms contained in a PSD expression

MDOPsdExpr(MDOLinExpr le)

Construct a PSD expression with a linear expression

Parameters

MDOLinExpr le – The linear expression

MDOPsdExpr(MDOPsdVar var, MDOMatrix coeff)

Construct a PSD expression with a PSD term

Parameters
  • MDOPsdVar var – The PSD variable of the PSD term

  • MDOMatrix coeff – The coefficients of PSD term

void addTerm(MDOMatrix coeff, MDOPsdVar var)

Add a PSD term to this PSD expression

Parameters
  • MDOMatrix coeff – The coefficients of the new PSD term to be added

  • MDOPsdVar var – The PSD variable of the new PSD term to be added

void addTerm(double coeff, MDOVar var)

Add a linear term to this PSD expression.

Parameters
  • double coeff – The coefficient of the new linear term to be added

  • MDOVar var – The variable of the new linear term to be added

void addTerms(double[] coeff, MDOVar[] var)

Add linear terms to this PSD expression.

Parameters
  • double[] coeff – The coefficients of the new linear term to be added.

  • MDOVar[] var – The variables of the new linear term to be added.

MDOMatrix getCoeff(int i)

Retrieve the coefficients in the ith PSD term.

Parameters

int i – The index of the PSD term

Returns

The coefficients in the ith PSD term

MDOLinExpr getLinExpr()

Retrieve the linear expression contained in this PSD expression

Returns

The linear expression contained in the PSD expression

MDOPsdVar getPsdVar(int i)

Retrieve the PSD variable in the ith PSD term

Parameters

int i – The index of the PSD term

Returns

The PSD variable contained in the ith PSD term

double getValue()

Retrieve the value of this PSD expression after the problem is resolved

Returns

The value of this PSD expression after the problem is solved

void remove(int i)

Delete the ith PSD term from this PSD expression

Parameters

int i – The index of the PSD term to be deleted.

boolean remove(MDOPsdVar v)

Delete All PSD terms that contain the specified PSD variable

Parameters

MDOPsdVar v – PSD variable to delete

Returns

True if at least one term is deleted.

int size()

Retrieve the number of PSD terms contained in a PSD expression.

Returns

The number of PSD terms contained in the PSD expression.