Changeset 114


Ignore:
Timestamp:
Feb 5, 2003 3:07:45 PM (17 years ago)
Author:
forrest
Message:

Re-order variables

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpModel.cpp

    r112 r114  
    4747
    4848  optimizationDirection_(1),
     49  objectiveValue_(0.0),
     50  smallElement_(1.0e-20),
    4951  numberRows_(0),
    5052  numberColumns_(0),
     
    6264  rowCopy_(NULL),
    6365  ray_(NULL),
    64   objectiveValue_(0.0),
    65   smallElement_(1.0e-20),
     66  status_(NULL),
     67  integerType_(NULL),
    6668  numberIterations_(0),
    6769  solveType_(0),
    6870  problemStatus_(-1),
     71  lengthNames_(0),
    6972  defaultHandler_(true),
    70   status_(NULL),
    71   lengthNames_(0),
    7273  rowNames_(),
    73   columnNames_(),
    74   integerType_(NULL)
     74  columnNames_()
    7575{
    7676  intParam_[ClpMaxNumIteration] = 99999999;
  • trunk/ClpNonLinearCost.cpp

    r63 r114  
    1818//-------------------------------------------------------------------
    1919ClpNonLinearCost::ClpNonLinearCost () :
     20  changeCost_(0.0),
     21  largestInfeasibility_(0.0),
     22  sumInfeasibilities_(0.0),
    2023  numberRows_(0),
    2124  numberColumns_(0),
     
    2629  cost_(NULL),
    2730  model_(NULL),
     31  infeasible_(NULL),
    2832  numberInfeasibilities_(-1),
    29   changeCost_(0.0),
    30   largestInfeasibility_(0.0),
    31   sumInfeasibilities_(0.0),
    32   convex_(true),
    33   infeasible_(NULL)
     33  convex_(true)
    3434{
    3535
     
    196196//-------------------------------------------------------------------
    197197ClpNonLinearCost::ClpNonLinearCost (const ClpNonLinearCost & rhs) :
     198  changeCost_(0.0),
     199  largestInfeasibility_(0.0),
     200  sumInfeasibilities_(0.0),
    198201  numberRows_(rhs.numberRows_),
    199202  numberColumns_(rhs.numberColumns_),
     
    204207  cost_(NULL),
    205208  model_(NULL),
     209  infeasible_(NULL),
    206210  numberInfeasibilities_(-1),
    207   changeCost_(0.0),
    208   largestInfeasibility_(0.0),
    209   sumInfeasibilities_(0.0),
    210   convex_(true),
    211   infeasible_(NULL)
     211  convex_(true)
    212212
    213213  if (numberRows_) {
  • trunk/ClpPrimalColumnSteepest.cpp

    r97 r114  
    2525ClpPrimalColumnSteepest::ClpPrimalColumnSteepest (int mode)
    2626  : ClpPrimalColumnPivot(),
    27     state_(-1),
    28     mode_(mode),
     27    devex_(0.0),
    2928    weights_(NULL),
    3029    infeasible_(NULL),
    3130    alternateWeights_(NULL),
    3231    savedWeights_(NULL),
     32    reference_(NULL),
     33    state_(-1),
     34    mode_(mode),
    3335    pivotSequence_(-1),
    3436    savedPivotSequence_(-1),
    35     savedSequenceOut_(-1), 
    36     reference_(NULL),
    37     devex_(0.0)
     37    savedSequenceOut_(-1)
    3838{
    3939  type_=2+64*mode;
  • trunk/ClpSimplex.cpp

    r112 r114  
    3131  ClpModel(),
    3232  columnPrimalInfeasibility_(0.0),
     33  rowPrimalInfeasibility_(0.0),
    3334  columnPrimalSequence_(-2),
    34   rowPrimalInfeasibility_(0.0),
    3535  rowPrimalSequence_(-2),
    3636  columnDualInfeasibility_(0.0),
     37  rowDualInfeasibility_(0.0),
    3738  columnDualSequence_(-2),
    38   rowDualInfeasibility_(0.0),
    3939  rowDualSequence_(-2),
    4040  primalToleranceToGetOptimal_(-1.0),
     
    4545  largestSolutionError_(0.0),
    4646  dualBound_(1.0e10),
     47  alpha_(0.0),
     48  theta_(0.0),
     49  lowerIn_(0.0),
     50  valueIn_(0.0),
     51  upperIn_(0.0),
     52  dualIn_(0.0),
     53  lowerOut_(-1),
     54  valueOut_(-1),
     55  upperOut_(-1),
     56  dualOut_(-1),
     57  dualTolerance_(0.0),
     58  primalTolerance_(0.0),
     59  sumDualInfeasibilities_(0.0),
     60  sumPrimalInfeasibilities_(0.0),
     61  infeasibilityCost_(1.0e10),
     62  sumOfRelaxedDualInfeasibilities_(0.0),
     63  sumOfRelaxedPrimalInfeasibilities_(0.0),
    4764  lower_(NULL),
    4865  rowLowerWork_(NULL),
     
    5471  rowObjectiveWork_(NULL),
    5572  objectiveWork_(NULL),
    56   alpha_(0.0),
    57   theta_(0.0),
    58   lowerIn_(0.0),
    59   valueIn_(0.0),
    60   upperIn_(0.0),
    61   dualIn_(0.0),
    6273  sequenceIn_(-1),
    6374  directionIn_(-1),
    64   lowerOut_(-1),
    65   valueOut_(-1),
    66   upperOut_(-1),
    67   dualOut_(-1),
    6875  sequenceOut_(-1),
    6976  directionOut_(-1),
     
    7683  rowActivityWork_(NULL),
    7784  columnActivityWork_(NULL),
    78   dualTolerance_(0.0),
    79   primalTolerance_(0.0),
    80   sumDualInfeasibilities_(0.0),
    8185  numberDualInfeasibilities_(0),
    8286  numberDualInfeasibilitiesWithoutFree_(0),
    83   sumPrimalInfeasibilities_(0.0),
    8487  numberPrimalInfeasibilities_(0),
     88  numberRefinements_(0),
    8589  pivotVariable_(NULL),
    8690  factorization_(NULL),
    87   numberRefinements_(0),
    8891  rowScale_(NULL),
    8992  savedSolution_(NULL),
     
    9598  forceFactorization_(-1),
    9699  perturbation_(100),
    97   infeasibilityCost_(1.0e10),
    98100  nonLinearCost_(NULL),
    99101  specialOptions_(0),
     
    101103  numberFake_(0),
    102104  progressFlag_(0),
    103   firstFree_(-1),
    104   sumOfRelaxedDualInfeasibilities_(0.0),
    105   sumOfRelaxedPrimalInfeasibilities_(0.0)
     105  firstFree_(-1)
    106106
    107107{
     
    10201020  ClpModel(rhs),
    10211021  columnPrimalInfeasibility_(0.0),
     1022  rowPrimalInfeasibility_(0.0),
    10221023  columnPrimalSequence_(-2),
    1023   rowPrimalInfeasibility_(0.0),
    10241024  rowPrimalSequence_(-2),
    10251025  columnDualInfeasibility_(0.0),
     1026  rowDualInfeasibility_(0.0),
    10261027  columnDualSequence_(-2),
    1027   rowDualInfeasibility_(0.0),
    10281028  rowDualSequence_(-2),
    10291029  primalToleranceToGetOptimal_(-1.0),
     
    10341034  largestSolutionError_(0.0),
    10351035  dualBound_(1.0e10),
     1036  alpha_(0.0),
     1037  theta_(0.0),
     1038  lowerIn_(0.0),
     1039  valueIn_(0.0),
     1040  upperIn_(0.0),
     1041  dualIn_(0.0),
     1042  lowerOut_(-1),
     1043  valueOut_(-1),
     1044  upperOut_(-1),
     1045  dualOut_(-1),
     1046  dualTolerance_(0.0),
     1047  primalTolerance_(0.0),
     1048  sumDualInfeasibilities_(0.0),
     1049  sumPrimalInfeasibilities_(0.0),
     1050  infeasibilityCost_(1.0e10),
     1051  sumOfRelaxedDualInfeasibilities_(0.0),
     1052  sumOfRelaxedPrimalInfeasibilities_(0.0),
    10361053  lower_(NULL),
    10371054  rowLowerWork_(NULL),
     
    10431060  rowObjectiveWork_(NULL),
    10441061  objectiveWork_(NULL),
    1045   alpha_(0.0),
    1046   theta_(0.0),
    1047   lowerIn_(0.0),
    1048   valueIn_(0.0),
    1049   upperIn_(0.0),
    1050   dualIn_(0.0),
    10511062  sequenceIn_(-1),
    10521063  directionIn_(-1),
    1053   lowerOut_(-1),
    1054   valueOut_(-1),
    1055   upperOut_(-1),
    1056   dualOut_(-1),
    10571064  sequenceOut_(-1),
    10581065  directionOut_(-1),
     
    10651072  rowActivityWork_(NULL),
    10661073  columnActivityWork_(NULL),
    1067   dualTolerance_(0.0),
    1068   primalTolerance_(0.0),
    1069   sumDualInfeasibilities_(0.0),
    10701074  numberDualInfeasibilities_(0),
    10711075  numberDualInfeasibilitiesWithoutFree_(0),
    1072   sumPrimalInfeasibilities_(0.0),
    10731076  numberPrimalInfeasibilities_(0),
     1077  numberRefinements_(0),
    10741078  pivotVariable_(NULL),
    10751079  factorization_(NULL),
    1076   numberRefinements_(0),
    10771080  rowScale_(NULL),
    10781081  savedSolution_(NULL),
    10791082  columnScale_(NULL),
    1080   scalingFlag_(0),
     1083  scalingFlag_(1),
    10811084  numberTimesOptimal_(0),
    10821085  changeMade_(1),
     
    10841087  forceFactorization_(-1),
    10851088  perturbation_(100),
    1086   infeasibilityCost_(1.0e10),
    10871089  nonLinearCost_(NULL),
    10881090  specialOptions_(0),
     
    10901092  numberFake_(0),
    10911093  progressFlag_(0),
    1092   firstFree_(-1),
    1093   sumOfRelaxedDualInfeasibilities_(0.0),
    1094   sumOfRelaxedPrimalInfeasibilities_(0.0)
     1094  firstFree_(-1)
    10951095{
    10961096  int i;
     
    11111111  ClpModel(rhs),
    11121112  columnPrimalInfeasibility_(0.0),
     1113  rowPrimalInfeasibility_(0.0),
    11131114  columnPrimalSequence_(-2),
    1114   rowPrimalInfeasibility_(0.0),
    11151115  rowPrimalSequence_(-2),
    11161116  columnDualInfeasibility_(0.0),
     1117  rowDualInfeasibility_(0.0),
    11171118  columnDualSequence_(-2),
    1118   rowDualInfeasibility_(0.0),
    11191119  rowDualSequence_(-2),
    11201120  primalToleranceToGetOptimal_(-1.0),
     
    11251125  largestSolutionError_(0.0),
    11261126  dualBound_(1.0e10),
     1127  alpha_(0.0),
     1128  theta_(0.0),
     1129  lowerIn_(0.0),
     1130  valueIn_(0.0),
     1131  upperIn_(0.0),
     1132  dualIn_(0.0),
     1133  lowerOut_(-1),
     1134  valueOut_(-1),
     1135  upperOut_(-1),
     1136  dualOut_(-1),
     1137  dualTolerance_(0.0),
     1138  primalTolerance_(0.0),
     1139  sumDualInfeasibilities_(0.0),
     1140  sumPrimalInfeasibilities_(0.0),
     1141  infeasibilityCost_(1.0e10),
     1142  sumOfRelaxedDualInfeasibilities_(0.0),
     1143  sumOfRelaxedPrimalInfeasibilities_(0.0),
    11271144  lower_(NULL),
    11281145  rowLowerWork_(NULL),
     
    11341151  rowObjectiveWork_(NULL),
    11351152  objectiveWork_(NULL),
    1136   alpha_(0.0),
    1137   theta_(0.0),
    1138   lowerIn_(0.0),
    1139   valueIn_(0.0),
    1140   upperIn_(0.0),
    1141   dualIn_(0.0),
    11421153  sequenceIn_(-1),
    11431154  directionIn_(-1),
    1144   lowerOut_(-1),
    1145   valueOut_(-1),
    1146   upperOut_(-1),
    1147   dualOut_(-1),
    11481155  sequenceOut_(-1),
    11491156  directionOut_(-1),
     
    11561163  rowActivityWork_(NULL),
    11571164  columnActivityWork_(NULL),
    1158   dualTolerance_(0.0),
    1159   primalTolerance_(0.0),
    1160   sumDualInfeasibilities_(0.0),
    11611165  numberDualInfeasibilities_(0),
    11621166  numberDualInfeasibilitiesWithoutFree_(0),
    1163   sumPrimalInfeasibilities_(0.0),
    11641167  numberPrimalInfeasibilities_(0),
     1168  numberRefinements_(0),
    11651169  pivotVariable_(NULL),
    11661170  factorization_(NULL),
    1167   numberRefinements_(0),
    11681171  rowScale_(NULL),
    11691172  savedSolution_(NULL),
    11701173  columnScale_(NULL),
    1171   scalingFlag_(0),
     1174  scalingFlag_(1),
    11721175  numberTimesOptimal_(0),
    11731176  changeMade_(1),
     
    11751178  forceFactorization_(-1),
    11761179  perturbation_(100),
    1177   infeasibilityCost_(1.0e10),
    11781180  nonLinearCost_(NULL),
    11791181  specialOptions_(0),
     
    11811183  numberFake_(0),
    11821184  progressFlag_(0),
    1183   firstFree_(-1),
    1184   sumOfRelaxedDualInfeasibilities_(0.0),
    1185   sumOfRelaxedPrimalInfeasibilities_(0.0)
     1185  firstFree_(-1)
    11861186{
    11871187  int i;
  • trunk/include/ClpModel.hpp

    r112 r114  
    376376  /// Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore
    377377  double optimizationDirection_;
     378  /// Array of double parameters
     379  double dblParam_[ClpLastDblParam];
     380  /// Objective value
     381  double objectiveValue_;
     382  /// Small element value
     383  double smallElement_;
    378384  /// Number of rows
    379385  int numberRows_;
     
    406412  /// Infeasible/unbounded ray
    407413  double * ray_;
    408   /// Array of integer parameters
    409   int intParam_[ClpLastIntParam];
    410   /// Array of double parameters
    411   double dblParam_[ClpLastDblParam];
    412   /// Array of string parameters
    413   std::string strParam_[ClpLastStrParam];
    414   /// Objective value
    415   double objectiveValue_;
    416   /// Small element value
    417   double smallElement_;
    418   /// Number of iterations
    419   int numberIterations_;
    420   /// Solve type - 1 simplex, 2 simplex interface
    421   int solveType_;
    422   /// Status of problem
    423   int problemStatus_;
    424   /// Message handler
    425   CoinMessageHandler * handler_;
    426   /// Flag to say if default handler (so delete)
    427   bool defaultHandler_;
    428   /// Messages
    429   CoinMessages messages_;
    430414  /** Status Region.  I know that not all algorithms need a status
    431415      array, but it made sense for things like crossover and put
     
    436420  */
    437421  unsigned char * status_;
     422  /// Integer information
     423  char * integerType_;
     424  /// Array of integer parameters
     425  int intParam_[ClpLastIntParam];
     426  /// Number of iterations
     427  int numberIterations_;
     428  /// Solve type - 1 simplex, 2 simplex interface
     429  int solveType_;
     430  /// Status of problem
     431  int problemStatus_;
    438432  /// length of names (0 means no names)
    439433  int lengthNames_;
     434  /// Message handler
     435  CoinMessageHandler * handler_;
     436  /// Flag to say if default handler (so delete)
     437  bool defaultHandler_;
    440438  /// Row names
    441439  std::vector<std::string> rowNames_;
    442440  /// Column names
    443441  std::vector<std::string> columnNames_;
    444   /// Integer information
    445   char * integerType_;
     442  /// Messages
     443  CoinMessages messages_;
     444  /// Array of string parameters
     445  std::string strParam_[ClpLastStrParam];
    446446  //@}
    447447};
  • trunk/include/ClpNonLinearCost.hpp

    r63 r114  
    158158  /**@name Data members */
    159159  //@{
     160  /// Change in cost because of infeasibilities
     161  double changeCost_;
     162  /// Largest infeasibility
     163  double largestInfeasibility_;
     164  /// Sum of infeasibilities
     165  double sumInfeasibilities_;
    160166  /// Number of rows (mainly for checking and copy)
    161167  int numberRows_;
     
    176182  /// Model
    177183  ClpSimplex * model_;
     184  // Array to say which regions are infeasible
     185  unsigned int * infeasible_;
    178186  /// Number of infeasibilities found
    179187  int numberInfeasibilities_;
    180   /// Change in cost because of infeasibilities
    181   double changeCost_;
    182   /// Largest infeasibility
    183   double largestInfeasibility_;
    184   /// Sum of infeasibilities
    185   double sumInfeasibilities_;
    186188  /// If all non-linear costs convex
    187189  bool convex_;
    188   // Array to say which regions are infeasible
    189   unsigned int * infeasible_;
    190190  //@}
    191191};
  • trunk/include/ClpPrimalColumnSteepest.hpp

    r53 r114  
    100100private:
    101101  ///@name Private member data
     102  // Update weight
     103  double devex_;
     104  /// weight array
     105  double * weights_;
     106  /// square of infeasibility array (just for infeasible columns)
     107  CoinIndexedVector * infeasible_;
     108  /// alternate weight array (so we can unroll)
     109  CoinIndexedVector * alternateWeights_;
     110  /// save weight array (so we can use checkpoint)
     111  double * savedWeights_;
     112  // Array for exact devex to say what is in reference framework
     113  unsigned int * reference_;
    102114  /** Status
    103115      0) Normal
     
    108120  /// If 0 then we are using exact devex, 1 then full
    109121  int mode_;
    110   /// weight array
    111   double * weights_;
    112   /// square of infeasibility array (just for infeasible columns)
    113   CoinIndexedVector * infeasible_;
    114   /// alternate weight array (so we can unroll)
    115   CoinIndexedVector * alternateWeights_;
    116   /// save weight array (so we can use checkpoint)
    117   double * savedWeights_;
    118122  // This is pivot row (or pivot sequence round re-factorization)
    119123  int pivotSequence_; 
     
    122126  // This is saved outgoing variable
    123127  int savedSequenceOut_; 
    124   // Array for exact devex to say what is in reference framework
    125   unsigned int * reference_;
    126   // Update weight
    127   double devex_;
    128128  //@}
    129129};
  • trunk/include/ClpSimplex.hpp

    r111 r114  
    624624  /// Worst column primal infeasibility
    625625  double columnPrimalInfeasibility_;
     626  /// Worst row primal infeasibility
     627  double rowPrimalInfeasibility_;
    626628  /// Sequence of worst (-1 if feasible)
    627629  int columnPrimalSequence_;
    628   /// Worst row primal infeasibility
    629   double rowPrimalInfeasibility_;
    630630  /// Sequence of worst (-1 if feasible)
    631631  int rowPrimalSequence_;
    632632  /// Worst column dual infeasibility
    633633  double columnDualInfeasibility_;
     634  /// Worst row dual infeasibility
     635  double rowDualInfeasibility_;
    634636  /// Sequence of worst (-1 if feasible)
    635637  int columnDualSequence_;
    636   /// Worst row dual infeasibility
    637   double rowDualInfeasibility_;
    638638  /// Sequence of worst (-1 if feasible)
    639639  int rowDualSequence_;
     
    652652  /// Dual bound
    653653  double dualBound_;
     654  /// Alpha (pivot element)
     655  double alpha_;
     656  /// Theta (pivot change)
     657  double theta_;
     658  /// Lower Bound on In variable
     659  double lowerIn_;
     660  /// Value of In variable
     661  double valueIn_;
     662  /// Upper Bound on In variable
     663  double upperIn_;
     664  /// Reduced cost of In variable
     665  double dualIn_;
     666  /// Lower Bound on Out variable
     667  double lowerOut_;
     668  /// Value of Out variable
     669  double valueOut_;
     670  /// Upper Bound on Out variable
     671  double upperOut_;
     672  /// Infeasibility (dual) or ? (primal) of Out variable
     673  double dualOut_;
     674  /// Current dual tolerance for algorithm
     675  double dualTolerance_;
     676  /// Current primal tolerance for algorithm
     677  double primalTolerance_;
     678  /// Sum of dual infeasibilities
     679  double sumDualInfeasibilities_;
     680  /// Sum of primal infeasibilities
     681  double sumPrimalInfeasibilities_;
     682  /// Weight assigned to being infeasible in primal
     683  double infeasibilityCost_;
     684  /// Sum of Dual infeasibilities using tolerance based on error in duals
     685  double sumOfRelaxedDualInfeasibilities_;
     686  /// Sum of Primal infeasibilities using tolerance based on error in primals
     687  double sumOfRelaxedPrimalInfeasibilities_;
    654688  /// Working copy of lower bounds (Owner of arrays below)
    655689  double * lower_;
     
    674708  /// Useful column length arrays
    675709  CoinIndexedVector * columnArray_[6];
    676   /// Alpha (pivot element)
    677   double alpha_;
    678   /// Theta (pivot change)
    679   double theta_;
    680   /// Lower Bound on In variable
    681   double lowerIn_;
    682   /// Value of In variable
    683   double valueIn_;
    684   /// Upper Bound on In variable
    685   double upperIn_;
    686   /// Reduced cost of In variable
    687   double dualIn_;
    688710  /// Sequence of In variable
    689711  int sequenceIn_;
    690712  /// Direction of In, 1 going up, -1 going down, 0 not a clude
    691713  int directionIn_;
    692   /// Lower Bound on Out variable
    693   double lowerOut_;
    694   /// Value of Out variable
    695   double valueOut_;
    696   /// Upper Bound on Out variable
    697   double upperOut_;
    698   /// Infeasibility (dual) or ? (primal) of Out variable
    699   double dualOut_;
    700714  /// Sequence of Out variable
    701715  int sequenceOut_;
     
    718732  /// Column activities - working copy
    719733  double * columnActivityWork_;
    720   /// Current dual tolerance for algorithm
    721   double dualTolerance_;
    722   /// Current primal tolerance for algorithm
    723   double primalTolerance_;
    724   /// Sum of dual infeasibilities
    725   double sumDualInfeasibilities_;
    726734  /// Number of dual infeasibilities
    727735  int numberDualInfeasibilities_;
    728736  /// Number of dual infeasibilities (without free)
    729737  int numberDualInfeasibilitiesWithoutFree_;
    730   /// Sum of primal infeasibilities
    731   double sumPrimalInfeasibilities_;
    732738  /// Number of primal infeasibilities
    733739  int numberPrimalInfeasibilities_;
     740  /// How many iterative refinements to do
     741  int numberRefinements_;
    734742  /// dual row pivot choice
    735743  ClpDualRowPivot * dualRowPivot_;
     
    740748  /// factorization
    741749  ClpFactorization * factorization_;
    742   /// How many iterative refinements to do
    743   int numberRefinements_;
    744750  /// Row scale factors for matrix
    745751  // ****** get working simply then make coding more efficient
     
    761767      This forces re-factorization early */
    762768  int forceFactorization_;
    763   /// Saved status regions
    764   unsigned char * saveStatus_;
    765769  /** Perturbation:
    766770      -50 to +50 - perturb by this power of ten (-6 sounds good)
     
    771775  */
    772776  int perturbation_;
    773   /// Weight assigned to being infeasible in primal
    774   double infeasibilityCost_;
     777  /// Saved status regions
     778  unsigned char * saveStatus_;
    775779  /** Very wasteful way of dealing with infeasibilities in primal.
    776780      However it will allow non-linearities and use of dual
     
    788792  /// First free/super-basic variable (-1 if none)
    789793  int firstFree_;
    790   /// Sum of Dual infeasibilities using tolerance based on error in duals
    791   double sumOfRelaxedDualInfeasibilities_;
    792   /// Sum of Primal infeasibilities using tolerance based on error in primals
    793   double sumOfRelaxedPrimalInfeasibilities_;
    794794  //@}
    795795};
     
    846846  /// Sum of infeasibilities for algorithm
    847847  double infeasibility_[CLP_PROGRESS];
     848  /// Pointer back to model so we can get information
     849  ClpSimplex * model_;
    848850  /// Number of infeasibilities
    849851  int numberInfeasibilities_[CLP_PROGRESS];
     
    852854  /// Number of times it looked like loop
    853855  int numberBadTimes_;
    854   /// Pointer back to model so we can get information
    855   ClpSimplex * model_;
    856856  //@}
    857857};
Note: See TracChangeset for help on using the changeset viewer.