CPXXgetnumnz and CPXgetnumnz

The routine CPXXgetnumnz/CPXgetnumnz accesses the number of nonzero elements in the constraint matrix of a CPLEX problem object, not including the objective function, quadratic constraints, or the bounds constraints on the variables.

CPXNNZ  CPXXgetnumnz( CPXCENVptr env, CPXCLPptr lp )

int  CPXgetnumnz( CPXCENVptr env, CPXCLPptr lp )

Description

The routine CPXXgetnumnz/CPXgetnumnz accesses the number of nonzero elements in the constraint matrix of a CPLEX problem object, not including the objective function, quadratic constraints, or the bounds constraints on the variables.

Arguments

env
A pointer to the CPLEX environment as returned by CPXXopenCPLEX/CPXopenCPLEX.
lp
A pointer to a CPLEX problem object as returned by CPXXcreateprob/CPXcreateprob.

Return

If the problem object or environment does not exist, CPXXgetnumnz/CPXgetnumnz returns the value 0 (zero); otherwise, it returns the number of nonzero elements.

Example


cur_numnz = CPXgetnumnz (env, lp);