Class for perform conversions between standard form and original problem.
More...
#include <StdForm.h>
|
| StdForm () |
| Constructor.
|
|
| ~StdForm () |
| Destructor.
|
|
void | fobj_stdform (int n, double x[], double &fx, double Gx[], double Hx[], void *params) |
| Function to calculate the objective function in a transformed variables point.
|
|
void | transformed_to_original_primal_variables (double *x) |
| Converts a point from transformed variables to original variables space.
|
|
void | transformed_to_original_dual_variables (double *y, double *w, double *z) |
|
void | original_to_transformed_primal_variables (double *&xout, double *xin) |
| Converts a point from original variables to transformed variables space.
|
|
void | transform_linear_and_quadratic_cost (double *&cost, double *&qcost, double &constant) |
| Transforms objective function from original variables to transformed variables space.
|
|
void | original_to_transformed_names (string *&outVarNames, string *inVarNames, string *&outConsNames, string *inConsNames) |
| Converts the variable names from original variables to transformed variables space.
|
|
void | delete_new_variables (double *&xout, double *xin) |
|
|
int | numOrigVars |
| Number of variables in the original problem.
|
|
int | numTransfVars |
| Number of variables in the transformed (standardized) problem.
|
|
int | m_cons |
| Number of constraints (including slacks) in the standardized problem.
|
|
int | numTransforms |
| Number of transformations performed in variables.
|
|
int * | origVars |
| Index to the original variables (that need a transformatiBon in objective function) in original problem, of size numTransforms.
|
|
int * | transfVars |
| Index to the original variables (that need a transformation in objective function) in standardized problem, of size numTransforms.
|
|
Transform * | transforms |
| Transformations performed in variables, of size numTransforms.
|
|
double | constantFObj |
| Constant to add in the objective function.
|
|
vector< int > * | deletedRows |
| Index to the rows that have been deleted.
|
|
double * | xOrig |
| Optimal solution in the original problem.
|
|
double * | yOrig |
| Optimal dual variables in the original problem.
|
|
double * | GxOrig |
| Gradient in x in the original problem.
|
|
double * | HxOrig |
| Hessian in x in the original problem.
|
|
double * | wOrig |
| Optimal dual variables of x_i <= u_i bounds in the original problem.
|
|
double * | zOrig |
| Optimal dual variables of x_i >= 0 bounds in the original problem.
|
|
void(* | fobj )(int n, double x[], double &fx, double Gx[], double Hx[], void *params) |
| User function to calculate the objective function in a point.
|
|
Class for perform conversions between standard form and original problem.
void StdForm::delete_new_variables |
( |
double *& |
xout, |
|
|
double * |
xin |
|
) |
| |
- Parameters
-
xout | Vector in original variables space, is allocated by the function with new, must be freed with delete[] |
xin | Vector in transformed variables space |
void StdForm::fobj_stdform |
( |
int |
n, |
|
|
double |
x[], |
|
|
double & |
fx, |
|
|
double |
Gx[], |
|
|
double |
Hx[], |
|
|
void * |
params |
|
) |
| |
Function to calculate the objective function in a transformed variables point.
Converts a point from transformed variables to original variables space and call the user function to calculate the objective function in that point, after that inverts the transformations to return the information in the transformed variables space
- Parameters
-
n | Number of variables in transformed variables space |
x | Point in transformed variables space |
fx | Objective function value in x |
Gx | Gradient in x |
Hx | Hessian in x |
params | User parameters to perform objective function calculations |
void StdForm::original_to_transformed_names |
( |
string *& |
outVarNames, |
|
|
string * |
inVarNames, |
|
|
string *& |
outConsNames, |
|
|
string * |
inConsNames |
|
) |
| |
Converts the variable names from original variables to transformed variables space.
- Parameters
-
outVarNames | Variable names including slacks, output in transformed variables space |
inVarNames | Variable names including slacks, input in original variables space |
outConsNames | Constraint names including linking constraints, output in transformed variables space |
inConsNames | Constraint names including linking constraints, input in original variables space |
void StdForm::original_to_transformed_primal_variables |
( |
double *& |
xout, |
|
|
double * |
xin |
|
) |
| |
Converts a point from original variables to transformed variables space.
- Parameters
-
xout | Point in transformed variables space, is allocated by the function with new, must be freed with delete[] |
xin | Point in original variables space |
void StdForm::transform_linear_and_quadratic_cost |
( |
double *& |
cost, |
|
|
double *& |
qcost, |
|
|
double & |
constant |
|
) |
| |
Transforms objective function from original variables to transformed variables space.
- Parameters
-
cost | Linear cost of variables including slacks, input in original variables space, output in transformed variables space |
qcost | Quadratic cost of variables including slacks, input in original variables space, output in transformed variables space |
constant | Constant to add in the objective function |
void StdForm::transformed_to_original_dual_variables |
( |
double * |
y, |
|
|
double * |
w, |
|
|
double * |
z |
|
) |
| |
Converts the dual variables y of constraints, and (z,w) of lower and upper bounds from transformed to original space.
Constraints of the form lhs <= Ax <= rhs are transformed to Ax+s= rhs, 0<= s<= rhs-lhs. y are the multipliers of Ax+s= rhs, and yOrig_l and yOrig_r the multipliers for, respectively, lhs <= Ax and Ax <=rhs. It can be seen that
- if y(i)>=0 then yOrig_r(i)= y(i) and yOrig_l(i)=0;
- if y(i)<=0 then yOrig_l(i)= 0 and and yOrig_l(i)=-y(i). We will only use a single yOrig=y vector, such that when yOrig(i) is positive it is yOrig_r(i), and when negative it is -yOrig_l(i).
Multipliers z are related to upper bounds x<=u, while multipliers w are related to lower bounds l<= x.
Variables without upper bounds do not have z; we will set the corresponding components zOrig(i)=0.
Free variables do not have z and w. We will set the corresponding components of zOrig(i)=wOrig(i)=0.
For variables with the transformation NON_ZERO_LB (x~= x-l) we have that zOrig(i)= z(i) and wOrig(i)= w(i).
For variables with the transformation _INF_LB (x~= -x+u) we have that zOrig(i)= w(i) and wOrig(i)= 0 =z(i).
- Parameters
-
y | Dual variables of constraint in standardized problem |
w | Dual variables of x_i <= u_i bounds in standardized problem |
z | Dual variables of x_i >= 0 bounds in standardized problem |
- Note
- Dual variables in original problem are stored in yOrig, wOrig and zOrig
void StdForm::transformed_to_original_primal_variables |
( |
double * |
x | ) |
|
Converts a point from transformed variables to original variables space.
- Parameters
-
x | Point in transformed variables space |
- Note
- Point in original variables space is stored in xOrig
The documentation for this class was generated from the following files:
- /home/jcastro2/intpoint/BlockIPPlatform/BlockIP/BlockIP/src_blockip-v2/StdForm.h
- /home/jcastro2/intpoint/BlockIPPlatform/BlockIP/BlockIP/src_blockip-v2/StdForm.C