Loading...
Searching...
No Matches
AbcDualRowSteepest.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2002, International Business Machines
// Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
#ifndef AbcDualRowSteepest_H
#define AbcDualRowSteepest_H
#include "AbcDualRowPivot.hpp"
class CoinIndexedVector;
//#############################################################################
class AbcDualRowSteepest : public AbcDualRowPivot {
public:
virtual int pivotRow();
virtual double updateWeights(CoinIndexedVector &input, CoinIndexedVector &updatedColumn);
virtual double updateWeights1(CoinIndexedVector &input, CoinIndexedVector &updateColumn);
virtual void updateWeightsOnly(CoinIndexedVector &input);
virtual void updateWeights2(CoinIndexedVector &input, CoinIndexedVector &updateColumn);
virtual void updatePrimalSolution(CoinIndexedVector &input,
double theta);
virtual void updatePrimalSolutionAndWeights(CoinIndexedVector &weightsVector,
CoinIndexedVector &updateColumn,
double theta);
virtual void saveWeights(AbcSimplex *model, int mode);
virtual void recomputeInfeasibilities();
virtual void clearArrays();
virtual bool looksOptimal() const;
enum Persistence {
normal = 0x00, // create (if necessary) and destroy
keep = 0x01 // create (if necessary) and leave
};
AbcDualRowSteepest(int mode = 3);
AbcDualRowSteepest(const AbcDualRowSteepest &);
AbcDualRowSteepest &operator=(const AbcDualRowSteepest &rhs);
void fill(const AbcDualRowSteepest &rhs);
virtual ~AbcDualRowSteepest();
virtual AbcDualRowPivot *clone(bool copyData = true) const;
inline int mode() const
{
return mode_;
}
inline void setPersistence(Persistence life)
{
persistence_ = life;
}
inline Persistence persistence() const
{
return persistence_;
}
inline CoinIndexedVector *infeasible() const
{
return infeasible_;
}
inline CoinIndexedVector *weights() const
{
return weights_;
}
inline AbcSimplex *model() const
{
return model_;
}
//---------------------------------------------------------------------------
private:
double norm_;
double factorizationRatio_;
int state_;
int mode_;
Persistence persistence_;
CoinIndexedVector *weights_;
CoinIndexedVector *infeasible_;
CoinIndexedVector *savedWeights_;
};
// For Devex stuff
#undef DEVEX_TRY_NORM
#define DEVEX_TRY_NORM 1.0e-8
#define DEVEX_ADD_ONE 1.0
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
AbcDualRowPivot.hpp
AbcSimplex
#define AbcSimplex
Definition AbcWarmStart.hpp:16
AbcDualRowPivot::model_
AbcSimplex * model_
Pointer to model.
Definition AbcDualRowPivot.hpp:122
AbcDualRowPivot::AbcDualRowPivot
AbcDualRowPivot()
Default Constructor.
AbcDualRowSteepest::clone
virtual AbcDualRowPivot * clone(bool copyData=true) const
Clone.
AbcDualRowSteepest::infeasible
CoinIndexedVector * infeasible() const
Infeasible vector.
Definition AbcDualRowSteepest.hpp:116
AbcDualRowSteepest::mode_
int mode_
If 0 then we are using uninitialized weights, 1 then full, if 2 then uninitialized partial,...
Definition AbcDualRowSteepest.hpp:148
AbcDualRowSteepest::clearArrays
virtual void clearArrays()
Gets rid of all arrays.
AbcDualRowSteepest::pivotRow
virtual int pivotRow()
Returns pivot row, -1 if none.
AbcDualRowSteepest::updateWeights
virtual double updateWeights(CoinIndexedVector &input, CoinIndexedVector &updatedColumn)
Updates weights and returns pivot alpha.
AbcDualRowSteepest::~AbcDualRowSteepest
virtual ~AbcDualRowSteepest()
Destructor.
AbcDualRowSteepest::updateWeightsOnly
virtual void updateWeightsOnly(CoinIndexedVector &input)
AbcDualRowSteepest::updateWeights1
virtual double updateWeights1(CoinIndexedVector &input, CoinIndexedVector &updateColumn)
Does most of work for weights and returns pivot alpha.
AbcDualRowSteepest::weights_
CoinIndexedVector * weights_
weight array
Definition AbcDualRowSteepest.hpp:152
AbcDualRowSteepest::norm_
double norm_
Definition AbcDualRowSteepest.hpp:137
AbcDualRowSteepest::Persistence
Persistence
enums for persistence
Definition AbcDualRowSteepest.hpp:67
AbcDualRowSteepest::keep
@ keep
Definition AbcDualRowSteepest.hpp:69
AbcDualRowSteepest::normal
@ normal
Definition AbcDualRowSteepest.hpp:68
AbcDualRowSteepest::weights
CoinIndexedVector * weights() const
Weights vector.
Definition AbcDualRowSteepest.hpp:121
AbcDualRowSteepest::persistence_
Persistence persistence_
Life of weights.
Definition AbcDualRowSteepest.hpp:150
AbcDualRowSteepest::mode
int mode() const
Mode.
Definition AbcDualRowSteepest.hpp:102
AbcDualRowSteepest::saveWeights
virtual void saveWeights(AbcSimplex *model, int mode)
Saves any weights round factorization as pivot rows may change Save model May also recompute infeasib...
AbcDualRowSteepest::factorizationRatio_
double factorizationRatio_
Ratio of size of factorization to number of rows.
Definition AbcDualRowSteepest.hpp:139
AbcDualRowSteepest::model
AbcSimplex * model() const
Model.
Definition AbcDualRowSteepest.hpp:126
AbcDualRowSteepest::persistence
Persistence persistence() const
Definition AbcDualRowSteepest.hpp:111
AbcDualRowSteepest::fill
void fill(const AbcDualRowSteepest &rhs)
Fill most values.
AbcDualRowSteepest::state_
int state_
Status 0) Normal -1) Needs initialization 1) Weights are stored by sequence number.
Definition AbcDualRowSteepest.hpp:145
AbcDualRowSteepest::looksOptimal
virtual bool looksOptimal() const
Returns true if would not find any row.
AbcDualRowSteepest::recomputeInfeasibilities
virtual void recomputeInfeasibilities()
Recompute infeasibilities.
AbcDualRowSteepest::savedWeights_
CoinIndexedVector * savedWeights_
save weight array (so we can use checkpoint)
Definition AbcDualRowSteepest.hpp:156
AbcDualRowSteepest::updatePrimalSolution
virtual void updatePrimalSolution(CoinIndexedVector &input, double theta)
Updates primal solution (and maybe list of candidates) Uses input vector which it deletes.
AbcDualRowSteepest::operator=
AbcDualRowSteepest & operator=(const AbcDualRowSteepest &rhs)
Assignment operator.
AbcDualRowSteepest::infeasible_
CoinIndexedVector * infeasible_
square of infeasibility array (just for infeasible rows)
Definition AbcDualRowSteepest.hpp:154
AbcDualRowSteepest::setPersistence
void setPersistence(Persistence life)
Set/ get persistence.
Definition AbcDualRowSteepest.hpp:107
AbcDualRowSteepest::updateWeights2
virtual void updateWeights2(CoinIndexedVector &input, CoinIndexedVector &updateColumn)
Actually updates weights.
AbcDualRowSteepest::AbcDualRowSteepest
AbcDualRowSteepest(int mode=3)
Default Constructor 0 is uninitialized, 1 full, 2 is partial uninitialized, 3 starts as 2 but may swi...
AbcDualRowSteepest::updatePrimalSolutionAndWeights
virtual void updatePrimalSolutionAndWeights(CoinIndexedVector &weightsVector, CoinIndexedVector &updateColumn, double theta)
AbcDualRowSteepest::AbcDualRowSteepest
AbcDualRowSteepest(const AbcDualRowSteepest &)
Copy constructor.