12 #include "CoinHelperFunctions.hpp"
19 using namespace Couenne;
40 for (
int i=0; i<
nnz_; i++)
73 for (
int i=0; i<
nnz_; i++)
84 #define reallocStep 100
91 r = (
int *) realloc (r, nMax *
sizeof (
int));
92 c = (
int *) realloc (c, nMax *
sizeof (
int));
123 for (
int i = 0; i < p -> nCons (); i++) {
127 if (c -> Body () -> Type () ==
AUX ||
128 c -> Body () -> Type () ==
VAR)
135 std::set <int> deplist;
141 for (std::set <int>::iterator
k = deplist.begin ();
k != deplist.end (); ++
k) {
144 if (p -> Var (*k) -> Multiplicity () <= 0)
148 *J = c -> Body () -> differentiate (*
k),
152 *sJ = J -> simplify (),
158 if ((rJ -> Type () ==
CONST) &&
159 (rJ -> Value () == 0.))
186 for (
int i = 0; i < p -> nVars (); i++) {
190 if ((e -> Type () !=
AUX) ||
191 (e -> Multiplicity () <= 0))
198 std::set <int> deplist;
202 deplist.insert (e -> Index ());
206 for (std::set <int>::iterator
k = deplist.begin ();
k != deplist.end (); ++
k) {
208 if (p -> Var (*k) -> Multiplicity () <= 0)
212 *J = (*
k == e -> Index ()) ?
214 e -> Image () -> differentiate (*
k),
218 *sJ = J -> simplify (),
224 if ((rJ -> Type () ==
CONST) &&
225 (rJ -> Value () == 0.))
249 printf (
"jacobian: %d nonzeros, %d rows\n",
nnz_,
nRows_);
251 for (
int i=0; i<
nnz_; i++) {
256 expr_ [i] -> print ();
Jacobian of the problem (computed through Couenne expression classes).
int * iRow_
row indices (read this way by eval_jac_g)
ExprJac & operator=(const ExprJac &)
void fint fint fint real fint real real real real real real real real real * e
static void reAlloc(int nCur, int &nMax, int *&r, int *&c, expression **&e)
Class to represent nonlinear constraints.
#define reallocStep
code for refilling jacobian
Class for MINLP problems with symbolic information.
void fint fint fint real fint real real real real real real real * r
expression ** expr_
nonzero expression elements (there are nnz_ of them)
int nRows_
number of actual constraints
int nnz_
number of (symbolic) nonzeroes