BlockIPPlatform
 All Classes Files Functions Variables
StdForm.h
Go to the documentation of this file.
1 
6 #ifndef STDFORM_H
7 #define STDFORM_H
8 
9 #include <vector>
10 
11 using namespace std;
12 
14 class StdForm {
15  public:
16  enum TYPE_TRANSFORM {NON_ZERO_LB, _INF_LB, FREE_VAR, X_, SLACK, SURPLUS};
17 
18  struct Transform {
19  TYPE_TRANSFORM type;
20  double bound;
21 
22  int x_index;
23 
24  };
25 
28  int m_cons;
29 
31  int *origVars;
32  int *transfVars;
34 
35  double constantFObj;
36  vector<int> *deletedRows;
37 
38  double *xOrig;
39  double *yOrig;
40  double *GxOrig;
41  double *HxOrig;
42  double *wOrig;
43  double *zOrig;
44 
45 
47  void (*fobj) (int n, double x[], double &fx, double Gx[], double Hx[], void *params);
48 
49  // Constructor
50  StdForm();
51 
52  // Destructor
53  ~StdForm();
54 
55  // Function to calculate the objective function in a transformed variables point
56  void fobj_stdform(int n, double x[], double &fx, double Gx[], double Hx[], void *params);
57 
58  // Converts a point from transformed variables to original variables space
59  void transformed_to_original_primal_variables(double* x);
60 
61  // Converts the dual variables of contraints from transformed to original variables space
62  void transformed_to_original_dual_variables(double* y, double* w, double* z);
63 
64  // Converts a point from original variables to transformed variables space
65  void original_to_transformed_primal_variables(double* &xout, double* xin);
66 
67  // Transforms objective function from original variables to transformed variables space
68  void transform_linear_and_quadratic_cost(double* &cost, double* &qcost, double &constant);
69 
70  // Converts the variable names from original variables to transformed variables space
71  void original_to_transformed_names(string* &outVarNames, string* inVarNames, string* &outConsNames, string* inConsNames);
72 
73  // Deletes the positions belonging to new variables
74  void delete_new_variables(double* &xout, double* xin);
75 };
76 
77 #endif //STDFORM_H