Minotaur 0.4.1
Docs for developers
Public Member Functions | List of all members
MINOTAUR_AMPL::AMPLJacobian Class Reference

Jacobian class has methods to call Jacobian evaluation routines of AMPL. This class is not meant to calculate Jacobian of native Minotaur functions. More...

#include <AMPLJacobian.h>

Inheritance diagram for MINOTAUR_AMPL::AMPLJacobian:
Inheritance graph
[legend]
Collaboration diagram for MINOTAUR_AMPL::AMPLJacobian:
Collaboration graph
[legend]

Public Member Functions

 AMPLJacobian (AMPLInterfacePtr iface)
 Construct AMPLJacobian using an AMPL(ASL) interface. More...
 
 ~AMPLJacobian ()
 Destroy.
 
void fillColRowIndices (Minotaur::UInt *jcol, Minotaur::UInt *irow)
 Fill in column and row indices of nonzeros in Jacobian. More...
 
void fillRowColIndices (Minotaur::UInt *irow, Minotaur::UInt *jcol)
 Fill the indices of non-zeros in Jacobian, row-wise (or constraint-wise). More...
 
void fillColRowValues (const double *x, double *values, int *error)
 Evaluate Jacobian at a given point x, column-wise. Fill the values of Jacobian at a given point x into array 'values'. The ordering is same as that provided by fillColRowIndices(). More...
 
void fillRowColValues (const double *x, double *values, int *error)
 Evaluate Jacobian at a given point x, row-wise. More...
 
Minotaur::UInt getNumNz ()
 Return the number of non-zeros in the Jacobian. More...
 
- Public Member Functions inherited from Minotaur::Jacobian
 Jacobian ()
 Default constructor.
 
 Jacobian (const std::vector< ConstraintPtr > &cons, const UInt n)
 Constructor using constraints.
 
virtual ~Jacobian ()
 Destroy.
 
virtual UInt getNumNz ()
 Return the number of nonzeros in the Jacobian. More...
 
virtual void fillRowColIndices (UInt *iRow, UInt *jCol)
 
virtual void fillRowColValues (const double *x, double *values, int *error)
 
virtual void fillColRowIndices (UInt *, UInt *)
 Fill indices, column wise. More...
 
virtual void fillColRowValues (const double *, double *, int *)
 Fill values, column wise. More...
 
void write (std::ostream &out) const
 

Detailed Description

Jacobian class has methods to call Jacobian evaluation routines of AMPL. This class is not meant to calculate Jacobian of native Minotaur functions.

Constructor & Destructor Documentation

◆ AMPLJacobian()

AMPLJacobian::AMPLJacobian ( AMPLInterfacePtr  iface)

Construct AMPLJacobian using an AMPL(ASL) interface.

Parameters
[in]ifacePointer to AMPLInterface class from which we read the instance.

Member Function Documentation

◆ fillColRowIndices()

void AMPLJacobian::fillColRowIndices ( Minotaur::UInt jcol,
Minotaur::UInt irow 
)
virtual

Fill in column and row indices of nonzeros in Jacobian.

Given arrays irow and jcol, fill in the row and column index of each non-zero in the jacobian. The entries are ordered by columns. This is slightly inefficient because AMPL computes the gradients row-wise and then translates them to column-wise (using goff). e.g. x1x3 + x1^2x4 = 2 x0 + x5 = 0 then, irow = [0 0 0 1 1] jcol = [1 3 4 0 5]

Parameters
[out]jcolArray of size returned by getNumNz().
[out]irowArray of size returned by getNumNz().

Reimplemented from Minotaur::Jacobian.

◆ fillColRowValues()

void AMPLJacobian::fillColRowValues ( const double *  x,
double *  values,
int *  error 
)
virtual

Evaluate Jacobian at a given point x, column-wise. Fill the values of Jacobian at a given point x into array 'values'. The ordering is same as that provided by fillColRowIndices().

Parameters
[in]xThe point at which Jacobian is to be evaluated.
[out]valuesThe array of size returned by getNumNz() into which values are saved.
[out]erroris set to a nonzero value if a problem is encountered, otherwise it is left undisturbed.

Reimplemented from Minotaur::Jacobian.

◆ fillRowColIndices()

void AMPLJacobian::fillRowColIndices ( Minotaur::UInt irow,
Minotaur::UInt jcol 
)
virtual

Fill the indices of non-zeros in Jacobian, row-wise (or constraint-wise).

Parameters
[out]irowArray of size returned by getNumNz().
[out]jcolArray of size returned by getNumNz().

Reimplemented from Minotaur::Jacobian.

◆ fillRowColValues()

void AMPLJacobian::fillRowColValues ( const double *  x,
double *  values,
int *  error 
)
virtual

Evaluate Jacobian at a given point x, row-wise.

Parameters
[in]xThe point at which Jacobian is to be evaluated.
[out]valuesThe array of size returned by getNumNz() into which values are saved.
[out]erroris set to a nonzero value if a problem is encountered, otherwise it is left undisturbed.

Reimplemented from Minotaur::Jacobian.

◆ getNumNz()

Minotaur::UInt AMPLJacobian::getNumNz ( )
virtual

Return the number of non-zeros in the Jacobian.

Reimplemented from Minotaur::Jacobian.


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

Minotaur source code documented by Doxygen 1.9.4 on Fri Apr 25 2025