39 assert(source.
types!=NULL);
41 assert(source.
starts!=NULL);
49 for(
int i = 0 ; i <
num ; i++) {
54 for(
int i = 0 ; i <
numNz ; i++) {
60 assert(source.
types==NULL);
62 assert(source.
starts==NULL);
76 if(types)
delete [] types;
78 if(starts)
delete [] starts;
80 if(indices)
delete [] indices;
82 if(priorities)
delete [] priorities;
84 if(weights)
delete [] weights;
90 delete [] perturb_radius_;
92 perturb_radius_ =
new double[numvars];
93 for(
int i=0; i<numvars; i++) {
94 perturb_radius_[i] = perturb_radius[i];
115 Ipopt::TNLP::IndexStyleEnum dummy;
124 for(
int i = 0 ; i <
n ; i++){
126 (x_lb[i] < - 0.99 || x_lb[i] > 0.99 ||
127 x_ub[i] <0.01 || x_ub[i] > 1.99) ){
Base class for all MINLPs that use a standard triplet matrix form and dense vectors.
int num
Number of SOS constraints.
virtual bool get_bounds_info(Ipopt::Index n, Ipopt::Number *x_l, Ipopt::Number *x_u, Ipopt::Index m, Ipopt::Number *g_l, Ipopt::Number *g_u)=0
overload this method to return the information about the bound on the variables and constraints...
virtual bool get_variables_types(Ipopt::Index n, VariableType *var_types)=0
overload this method to provide the variables types.
TMINLP()
Default destructor.
Class to store sos constraints for model.
virtual bool get_nlp_info(Ipopt::Index &n, Ipopt::Index &m, Ipopt::Index &nnz_jac_g, Ipopt::Index &nnz_h_lag, Ipopt::TNLP::IndexStyleEnum &index_style)=0
overload this method to return the number of variables and constraints, and the number of non-zeros i...
int * starts
For 0 <= i < nums, start[i] gives the indice of indices and weights arrays at which the description o...
int numNz
Total number of non zeroes in SOS constraints.
virtual ~TMINLP()
Default destructor.
int * priorities
priorities of sos constraints.
bool hasGeneralInteger()
Say if problem has general integer variables.
int * indices
indices of elements belonging to the SOS.
void SetPerturbationArray(Ipopt::Index numvars, const double *perturb_radius)
Method for setting the perturbation radii.
void gutsOfDestructor()
Reset information.
SosInfo()
default constructor.
double * weights
weights of the elements of the SOS.