NDOSolver / FiOracle
Interfaces and Solvers for NonDifferentiable Optimization
Loading...
Searching...
No Matches
Bundle.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*---------------------------- File Bundle.h -------------------------------*/
3/*--------------------------------------------------------------------------*/
31/*--------------------------------------------------------------------------*/
32/*----------------------------- DEFINITIONS --------------------------------*/
33/*--------------------------------------------------------------------------*/
34
35#ifndef _Bundle
36 #define _Bundle /* self-identification: #endif at the end of the file */
37
38/*--------------------------------------------------------------------------*/
39/*-------------------------------- MACROS ----------------------------------*/
40/*--------------------------------------------------------------------------*/
44/*------------------------------- LOG_BND ----------------------------------*/
45
46#define LOG_BND 1
47
48/* If LOG_BND > 0, the Bundle class produces a log of its activities on the
49 ostream object and at the "level of verbosity" set with the method
50 SetBLog() [see below]. */
51
53/*--------------------------------------------------------------------------*/
54/*------------------------------ INCLUDES ----------------------------------*/
55/*--------------------------------------------------------------------------*/
56
57#include "NDOSlver.h"
58
59#include "MPSolver.h"
60
61#include <algorithm>
62
63/*--------------------------------------------------------------------------*/
64/*----------------------------- NAMESPACE ----------------------------------*/
65/*--------------------------------------------------------------------------*/
66
68{
69
70/*--------------------------------------------------------------------------*/
71/*----------------------------- CLASSES ------------------------------------*/
72/*--------------------------------------------------------------------------*/
76/*--------------------------------------------------------------------------*/
77/*--------------------------- GENERAL NOTES --------------------------------*/
78/*--------------------------------------------------------------------------*/
100class Bundle : public NDOSolver
101{
102
103/*--------------------------------------------------------------------------*/
104/*----------------------- PUBLIC PART OF THE CLASS -------------------------*/
105/*--------------------------------------------------------------------------*/
106
107 public:
108
109/*--------------------------------------------------------------------------*/
110/*---------------------------- PUBLIC TYPES --------------------------------*/
111/*--------------------------------------------------------------------------*/
119 enum BndParam { kBPar1 = kLastNDOParam ,
120 kBPar2 , kBPar3 , kBPar4 , kBPar5 , kBPar6 ,
121 km1 , km3 ,
122 kmxIncr , kmnIncr , kMnSSC , kmxDecr , kmnDecr , kMnNSC ,
123 ktMaior , ktMinor , ktInit , ktCurr , ktSPar1 , ktSPar2 ,
124 kPPar1 , kPPar2 , kPPar3 ,
125 kMPEFsb , kMPEOpt
126 };
127
129/*--------------------- PUBLIC METHODS OF THE CLASS ------------------------*/
130/*--------------------------------------------------------------------------*/
131/*---------------------------- CONSTRUCTOR ---------------------------------*/
132/*--------------------------------------------------------------------------*/
136 Bundle( istream *iStrm = 0 );
137
389/*-------------------------- OTHER INITIALIZATIONS -------------------------*/
390/*--------------------------------------------------------------------------*/
394 void SetMPSolver( MPSolver *MPS = 0 );
395
408/*--------------------------------------------------------------------------*/
409
410 void SetFiOracle( FiOracle *Fi = 0 );
411
412/*--------------------------------------------------------------------------*/
413
414 void SetLambda( cLMRow tLambda = 0 );
415
416/*--------------------------------------------------------------------------*/
417
418 void KeepBestLambda( const bool KBL = true );
419
420/*--------------------------------------------------------------------------*/
421
422 inline void SetPar( const int wp , const int value );
423
443/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
444
445 inline void SetPar( const int wp , cHpNum value );
446
460/*--------------------------------------------------------------------------*/
461
462 void SetNDOLog( std::ostream *outs = 0 , const char lvl = 0 );
463
484/*--------------------------------------------------------------------------*/
485/*-------------------- METHODS FOR SOLVING THE PROBLEM ---------------------*/
486/*--------------------------------------------------------------------------*/
491
536/*--------------------------------------------------------------------------*/
537
538 void ReSetAlg( unsigned char RstLvl = 0 );
539
563/*---------------------- METHODS FOR READING RESULTS -----------------------*/
564/*--------------------------------------------------------------------------*/
569
574/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
575
577
582/*--------------------------------------------------------------------------*/
583
584 inline bool IsOptimal( HpNum eps = 0 ) const;
585
586/*--------------------------------------------------------------------------*/
587
588 inline HpNum ReadSigma( void ) const;
589
590 inline HpNum ReadDStart( cHpNum tt = 1 ) const;
591
601/*--------------------------------------------------------------------------*/
602
603 inline bool CurrentIsLast( void );
604
614/*--------------------------------------------------------------------------*/
615
617
619
620/*--------------------------------------------------------------------------*/
621
623
624/*--------------------------------------------------------------------------*/
625
627
628/*--------------------------------------------------------------------------*/
629
630 HpNum Readt( void )
631
632
633 {
634 return( t );
635 }
636
637/*--------------------------------------------------------------------------*/
642 inline Index NrSSs( void ) const
643 {
644 return( ParSS );
645 }
646
648/*-------------- METHODS FOR READING THE DATA OF THE PROBLEM ---------------*/
649/*--------------------------------------------------------------------------*/
650
651 inline void GetPar( const int wp , int &value );
652
653 inline void GetPar( const int wp , HpNum &value );
654
655/*--------------------------------------------------------------------------*/
656/*------------- METHODS FOR ADDING / REMOVING / CHANGING DATA --------------*/
657/*--------------------------------------------------------------------------*/
661 void AddVariables( Index NNwVrs , cLMRow IVs = 0 );
662
663 void RemoveVariables( cIndex_Set whch = 0 , Index hwmny = 0 );
664
665 void ChgFiV( cIndex wFi = Inf< Index >() );
666
667 void ChgSbG( cIndex strt = 0 , Index stp = Inf< Index >() ,
668 cIndex wFi = Inf< Index >() );
669
670/*--------------------------------------------------------------------------*/
671
672 void RemoveItem( cIndex Name );
673
680/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
681
682 void RemoveItems( void );
683
692/*------------------------------ DESTRUCTOR --------------------------------*/
693/*--------------------------------------------------------------------------*/
697 virtual ~Bundle();
698
700/*-------------------- PROTECTED PART OF THE CLASS -------------------------*/
701/*--------------------------------------------------------------------------*/
702
703 protected:
704
705/*--------------------------------------------------------------------------*/
706/*--------------------------- PROTECTED TYPES ------------------------------*/
707/*--------------------------------------------------------------------------*/
708
712 enum EIStatus { kEINorm = 0,
713 kEIAbort ,
714 kEILoopNow ,
715 kEIContAnyway
716 };
717
718/*--------------------------------------------------------------------------*/
719/*-------------------------- PROTECTED METHODS -----------------------------*/
720/*--------------------------------------------------------------------------*/
721/*----------------------- HOOK FOR DERIVED CLASSES -------------------------*/
722/*--------------------------------------------------------------------------*/
729 virtual EIStatus EveryIteration( void );
730
762/*---------------------- PROTECTED PART OF THE CLASS -----------------------*/
763/*--------------------------------------------------------------------------*/
764/*-- --*/
765/*-- The standard user should not care about the following part: users --*/
766/*-- who need to really extend the functionality of the Bundle class --*/
767/*-- (e.g. by implementing a different subproblem solver) may use these --*/
768/*-- methods and data structures. It is *dangerous* to *modify* the --*/
769/*-- data structures, while it safe to read them. --*/
770/*-- --*/
771/*--------------------------------------------------------------------------*/
772/*-------------------------- PROTECTED METHODS -----------------------------*/
773/*--------------------------------------------------------------------------*/
774
775 void FormD( void );
776
777/* When no variables generation is done (PPar2 == 0), FormD() just calls
778 SolveMP() once and calculates the direction d: however, it also implements
779 some strategies to survive to "fatal" failures in the subproblem solver,
780 typically eliminating some of the items in the bundle.
781
782 Set the protected field Result to kOK if (eventually after some "fatal"
783 failure) a tentative descent direction could be found, to kUnfsbl if the
784 MP is dual unfeasible and to kError if this was returned by SolveMP(): in
785 the latter cases, the whole algorithm must abort.
786
787 If variables generation is done (PPar2 > 0), this is where the
788 corresponding strategies are implemented: in this case, SolveMP() can be
789 called more than once within the same call to FormD(), since the resulting
790 direction has to be optimal w.r.t. all the current "active set" of
791 variables. */
792
793/*--------------------------------------------------------------------------*/
794
795 void FormLambda1( HpNum Tau );
796
797/* After a (successful) call to FormD(), sets the new tentative point Lambda1
798 (a protected field of type LMRow) as Lambda1 = Lambda + ( Tau / t ) * d. */
799
800/*--------------------------------------------------------------------------*/
801
802 bool FiAndGi( void );
803
804/* Computes Fi( Lambda1 ), inserting the obtained items (subgradients or
805 constraints) in the bundle. Returns true <=> the newly obtained information
806 changes the solution of the MP. */
807
808/*--------------------------------------------------------------------------*/
809
810 void GotoLambda1( void );
811
812/* Move the current point to Lambda1. */
813
814/*--------------------------------------------------------------------------*/
815
816 void UpdtCntrs( void );
817
818/* Updates the out-of-base counters for all items in the Bundle. */
819
820/*--------------------------------------------------------------------------*/
821
822 void SimpleBStrat( void );
823
824/* Eliminate outdated items, i.e., these with "large" out-of-base counter. */
825
826/*--------------------------------------------------------------------------*/
827
828 void Log1( void );
829
830 void Log2( void );
831
832/*--------------------------------------------------------------------------*/
833
834 bool CheckAlfa( const bool All = false );
835
836 void StrongCheckAlfa( void );
837
838/*--------------------------------------------------------------------------*/
839
840 void UpdtLowerBound( void );
841
842/*--------------------------------------------------------------------------*/
843
844 void UpdtaBP3( void );
845
846 void CmptaBPX( void );
847
848/*--------------------------------------------------------------------------*/
849/*----------------------- PROTECTED DATA STRUCTURES -----------------------*/
850/*--------------------------------------------------------------------------*/
851
852 MPSolver *Master; // (pointer to) the Master Problem Solver
853
854 int BPar1; // parameter for removal of items (B-strategy)
855 int BPar2; // max Bundle size
856 HpNum BPar3; // max number of items fetched from Fi() at each call
857 HpNum BPar4; // min number of items fetched from Fi() at each call
858 HpNum BPar5; // control how the actual BPar3 changes over time
859 int BPar6; // same as above
860
861 HpNum mxIncr; // max increase/decrease t parameters:
862 HpNum mnIncr; // see the description in the constructor
863 int MnSSC;
864 HpNum mxDecr;
865 HpNum mnDecr;
866 int MnNSC;
867
868 HpNum m1; // parameters for deciding if a SS/NS is done:
869 HpNum m3; // see the description in the constructor
870
871 HpNum tMaior; // max value for t
872 HpNum tMinor; // min value for t
873 HpNum tInit; // initial value for t
874
875 int tSPar1; // long-term t-strategy parameters
876 HpNum tSPar2; // see the description in the constructor
877
878 int PPar1; // pricing related parameters
879 int PPar2; // see the description in the constructor
880 int PPar3;
881
882 HpNum MPEFsb; // precision required to the MP Solver (feasibility)
883 HpNum MPEOpt; // precision required to the MP Solver (optimality)
884
885 Index MaxNumVar; // maximum number of variables
886 Bool_Vec IsEasy; // tells whether any component of Fi is "easy"
887
888 LMRow Lambda; // the current point
889 LMRow Lambda1; // the tentative point
890 LMRow LmbdBst; // the best point found so far
891
892 Index_Set LamBase; // the set of indices of Lambda
893 Index_Set Lam1Bse; // the set of indices of Lambda1
894 Index LamDim; // dimension of LamBase
895
896 bool KpBstL; // if LmbdBst has to be kept
897 bool BHasChgd; // true if LamBase has changed during the latest
898 // pricing (never set to true if PPar2 == 0, unless
899 // at the very first call to the oracle)
900 bool LHasChgd; // true if Lambda has changed since the latest call
901 // to FiAndGi(): allows repeated calls in the same
902 // Lambda, e.g. with increasing precision
903 bool tHasChgd; // true if t has changed since the last MP
904
905 HpRow FiLambda; // Fi[ k ]( Lambda )
906 HpRow FiBest; // best value(s) of Fi found so far
907 HpRow FiLambda1; // Fi[ k ]( Lambda1 )
908 HpRow RfrncFi; // the value of Fi[ k ]() where the zero of the Cutting
909 // Plane models are fixed: it is == FiLambda[ k ]() but
910 // when FiLambda[ k ]() == HpINF
911 // HpNum b0; // the constant in the affine 0-th component of Fi
912 // we could get to know it, if it was useful (which it is not)
913
914 Index_Set whisZ; // the position in the bundle where the "aggregate
915 // subgradient" Z[ k ] of "component" k is kept in
916 // whisZ[ k ]; Inf< Index >() means it is not in the
917 // bundle
918 Index_Set whisG1; // name of the "representative subgradient" for each
919 // component of Fi()
920 LMRow ScPr1; // ScalarProduct( dir , G[ WhIsG1[ k ] ] )
921 HpRow Alfa1; // linearization error of G[ WhIsG1[ k ] ] w.r.t. the
922 // current point Lambda
923 HpRow DeltaAlfa; // correction of Fi-values due to inexactness
924
925 HpRow LowerBound; // Lower Bound over (the various components of) Fi
926
927 HpNum t; // the (tremendous) t parameter
928 HpNum Prevt; // what t were before being changed for funny reasons
929
930 HpNum Sigma; // Sigma*: convex combination of the Alfa's
931 HpNum DSTS; // D*_{t*}( -z* ), the other part of the dual objective
932 HpNum vStar; // v*, the predicted improvement
933 HpNum Deltav; // the "desired improvement" in the Fi-value
934
935 HpNum DeltaFi; // FiLambda - FiLambda1
936 HpNum EpsU; // precision required by the long-term t-strategy
937
938 HpNum EpsCurr; // the precision currently required to the FiOracle
939 HpNum EpsFi; // the last precision passed to the FiOracle (can be
940 // different from EpsCurr)
941
942 int ParSS; // number of SS within the present call to Solve()
943
944 int CSSCntr; // counter of consecutive SS
945 int CNSCntr; // counter of consecutive NS
946
947 Index FreDim; // number of free positions in the Bundle
948 Index_Set FreList; // list (heap) of free positions in the Bundle
949
950 SIndex_Set OOBase; // Out-Of-Base counters:
951 // = Inf< SIndex >() means no item is there
952 // = k > 0 means out of base since k iterations
953 // = 0 means in the current base but potentially
954 // removable
955 // = a *finite* negative value - k means not
956 // removable for the next k iterations: note that
957 // some items in base may be such
958 // = - Inf< SIndex >() means unremovable
959 Index_Set InctvCtr; // "out of base" counter for variables
960 Index_Set nBase; // temporary
961
962 bool TrueLB; // true if LowerBound is a "true" lower bound rather
963 // than just the "minus infinity"
964 bool LBHasChgd; // true some LowerBound has changed
965 bool SSDone; // true if the laste step was a SS
966
967 bool ItemsChgd; // true if no items have been added to MP
968
969 FiOracle::FiStatus *FiStatus;
970
971 #if( NONMONOTONE )
972 HpRow FiVals; // Fi-values for the last NONMONOTONE SSs
973 #endif
974
975/*--------------------------------------------------------------------------*/
976/*--------------------- PRIVATE PART OF THE CLASS --------------------------*/
977/*--------------------------------------------------------------------------*/
978
979 private:
980
981/*--------------------------------------------------------------------------*/
982/*-------------------------- PRIVATE METHODS -------------------------------*/
983/*--------------------------------------------------------------------------*/
984
985 inline bool DoSS( void );
986
987/*--------------------------------------------------------------------------*/
988
989 inline void Delete( cIndex i );
990
991/*--------------------------------------------------------------------------*/
992
993 inline bool FindNextSG( Index &wFi );
994
995/*--------------------------------------------------------------------------*/
996
997 inline Index BStrategy( cIndex wFi );
998
999/*--------------------------------------------------------------------------*/
1000
1001 inline Index FindAPlace( cIndex wFi );
1002
1003/*--------------------------------------------------------------------------*/
1004
1005 inline HpNum Heuristic1( void );
1006
1007 inline HpNum Heuristic2( void );
1008
1009/*--------------------------------------------------------------------------*/
1010
1011 inline void InitMP( void );
1012
1013/*--------------------------------------------------------------------------*/
1014
1015 inline void AggregateZ( cHpRow Mlt , cIndex_Set MBse , Index MBDm ,
1016 cIndex wFi , cIndex whr );
1017
1018/*--------------------------------------------------------------------------*/
1019
1020 inline HpNum WhichFi( cHpRow FiVect , cIndex wFi );
1021
1022/*--------------------------------------------------------------------------*/
1023
1024 inline void MemDealloc( void );
1025
1026/*--------------------------------------------------------------------------*/
1027/*----------------------- PRIVATE DATA STRUCTURES -------------------------*/
1028/*--------------------------------------------------------------------------*/
1029
1030 Index MBDim; // number of items in the optimal multiplier base
1031 Index aBP3; // current max number of items to be fetched
1032 Index aBP4; // min number of items to be fetched
1033
1034/*--------------------------------------------------------------------------*/
1035
1036 }; // end( class Bundle )
1037
1039/*--------------------------------------------------------------------------*/
1040/*------------------- inline methods implementation ------------------------*/
1041/*--------------------------------------------------------------------------*/
1042
1043inline void Bundle::SetPar( const int wp , const int value )
1044{
1045 switch( wp ) {
1046 case( kBPar1 ): BPar1 = value; break;
1047 case( kBPar2 ): // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1048 if( value != BPar2 ) {
1049 if( Oracle ) { // communicate the changes to the Oracle
1050 Oracle->SetMaxName( value );
1051
1052 // resize data structures depending on BPar2
1053 SIndex_Set oldOOBase = OOBase;
1054 Index_Set oldFreList = FreList;
1055
1056 OOBase = new SIndex[ value ];
1057 FreList = new Index[ value ];
1058
1059 const int copydim = std::min( value , int( BPar2 ) );
1060
1061 if( oldOOBase ) {
1062 for( int i = 0 ; i < copydim ; i ++ )
1063 OOBase[ i ] = oldOOBase[ i ];
1064 delete[] oldOOBase;
1065 }
1066 else
1067 for( int i = 0 ; i < value ; i ++ )
1068 OOBase[ i ] = Inf< SIndex >();
1069
1070 if( oldFreList ) {
1071 for( int i = 0 ; i < copydim ; i ++ )
1072 FreList[ i ] = oldFreList[ i ];
1073 delete[] oldFreList;
1074 }
1075 }
1076
1077 BPar2 = value; // set the parameter
1078 if( Master && Oracle ) // communicate the changes to the Master
1079 Master->SetDim( BPar2 , 0 , PPar2 ? true : false );
1080 }
1081 break;
1082 case( kBPar6 ): BPar6 = value; CmptaBPX(); break;
1083 case( kMnSSC ): MnSSC = value; break;
1084 case( kMnNSC ): MnNSC = value; break;
1085 case( ktSPar1 ): tSPar1 = value; break;
1086 case( kPPar1 ): PPar1 = value; break;
1087 case( kPPar2 ): PPar2 = value; break;
1088 case( kPPar3 ): PPar3 = value; break;
1089 default: NDOSolver::SetPar( wp , value );
1090 }
1091 } // end( Bundle::SetPar( Index ) )
1092
1093/*--------------------------------------------------------------------------*/
1094
1095inline void Bundle::SetPar( const int wp , cHpNum value )
1096{
1097 switch( wp ) {
1098 case( kBPar3 ): BPar3 = value; CmptaBPX(); break;
1099 case( kBPar4 ): BPar4 = value; CmptaBPX(); break;
1100 case( kBPar5 ): BPar5 = value; CmptaBPX(); break;
1101 case( km1 ): m1 = value; break;
1102 case( km3 ): m3 = value; break;
1103 case( kmxIncr ): mxIncr = value; if( mxIncr < 1 ) mxIncr = 1; break;
1104 case( kmnIncr ): mnIncr = value; if( mnIncr < 1 ) mnIncr = 1; break;
1105 case( kmxDecr ): mxDecr = value; if( mxDecr > 1 ) mxDecr = 1; break;
1106 case( kmnDecr ): mnDecr = value; if( mnDecr > 1 ) mnDecr = 1; break;
1107 case( ktMaior ): tMaior = value;
1108 if( t > tMaior ) { t = tMaior; tHasChgd = true; }
1109 if( tInit > tMaior ) tInit = tMaior;
1110 break;
1111 case( ktMinor ): tMinor = value; break;
1112 if( t < tMinor ) { t = tMinor; tHasChgd = true; }
1113 if( tInit < tMaior ) tInit = tMinor;
1114 break;
1115 case( ktInit ): tInit = value;
1116 if( t != tInit ) { t = tInit; tHasChgd = true; }
1117 break;
1118 case( ktCurr ): t = value; tHasChgd = true; break;
1119 case( ktSPar2 ): tSPar2 = value; break;
1120 case( kEInit ): // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1121 if( EInit != value ) {
1122 EInit = value;
1123 EpsCurr = EInit >= 0 ? EInit : - EInit;
1124 }
1125 break;
1126 case( kMPEFsb ): //- - - - - - - - - - - - - - - - - - - - - - - - - - - -
1127 if( Master )
1128 Master->SetPar( MPSolver::kFsbEps , MPEFsb = value );
1129 break;
1130 case( kMPEOpt ): //- - - - - - - - - - - - - - - - - - - - - - - - - - - -
1131 if( Master )
1132 Master->SetPar( MPSolver::kOptEps , MPEOpt = value );
1133 break;
1134 default:
1135 NDOSolver::SetPar( wp , value );
1136 }
1137 } // end( Bundle::SetPar( HpNum ) )
1138
1139/*--------------------------------------------------------------------------*/
1140
1141inline bool Bundle::IsOptimal( HpNum eps ) const
1142{
1143 HpNum FiL = *FiLambda;
1144
1145 if( ( FiL == Inf< HpNum >() ) || ( vStar == -Inf< HpNum >() ) )
1146 return( false );
1147 else {
1148 if( FiL < 0 ) FiL = - FiL;
1149 if( FiL < 1 ) FiL = 1;
1150
1151 if( eps <= 0 )
1152 eps = EpsLin;
1153
1154 return( DSTS + Sigma <= eps * FiL );
1155 }
1156 }
1157
1158/*--------------------------------------------------------------------------*/
1159
1160inline HpNum Bundle::ReadSigma( void ) const
1161{
1162 return( Sigma );
1163 }
1164
1165/*--------------------------------------------------------------------------*/
1166
1168{
1169 return( Master->ReadDStart( tt ) );
1170 }
1171
1172/*--------------------------------------------------------------------------*/
1173
1174inline bool Bundle::CurrentIsLast( void )
1175{
1176 return( SSDone );
1177 }
1178
1179/*--------------------------------------------------------------------------*/
1180
1181inline void Bundle::GetPar( const int wp , int &value )
1182{
1183 switch( wp ) {
1184 case( kBPar1 ): value = BPar1; break;
1185 case( kBPar2 ): value = BPar2; break;
1186 case( kBPar6 ): value = BPar6; break;
1187 case( kMnSSC ): value = MnSSC; break;
1188 case( kMnNSC ): value = MnNSC; break;
1189 case( ktSPar1 ): value = tSPar1; break;
1190 case( kPPar1 ): value = PPar1; break;
1191 case( kPPar2 ): value = PPar2; break;
1192 case( kPPar3 ): value = PPar3; break;
1193 default: NDOSolver::GetPar( wp , value );
1194 }
1195 } // end( Bundle::GetPar( Index ) )
1196
1197/*--------------------------------------------------------------------------*/
1198
1199inline void Bundle::GetPar( const int wp , HpNum &value )
1200{
1201 switch( wp ) {
1202 case( kBPar3 ): value = BPar3; break;
1203 case( kBPar4 ): value = BPar4; break;
1204 case( kBPar5 ): value = BPar5; break;
1205 case( km1 ): value = m1; break;
1206 case( km3 ): value = m3; break;
1207 case( kmxIncr ): value = mxIncr; break;
1208 case( kmnIncr ): value = mnIncr; break;
1209 case( kmxDecr ): value = mxDecr; break;
1210 case( kmnDecr ): value = mnDecr; break;
1211 case( ktMaior ): value = tMaior; break;
1212 case( ktMinor ): value = tMinor; break;
1213 case( ktInit ): value = tInit; break;
1214 case( ktSPar2 ): value = tSPar2; break;
1215 case( kMPEFsb ): value = MPEFsb; break;
1216 case( kMPEOpt ): value = MPEOpt; break;
1217 default: NDOSolver::GetPar( wp , value );
1218 }
1219 } // end( Bundle::GetPar( HpNum ) )
1220
1221/*--------------------------------------------------------------------------*/
1222
1223 } // end( namespace NDO_di_unipi_it )
1224
1225/*--------------------------------------------------------------------------*/
1226/*--------------------------------------------------------------------------*/
1227
1228#endif /* Bundle.h included */
1229
1230/*--------------------------------------------------------------------------*/
1231/*------------------------- End File Bundle.h ------------------------------*/
1232/*--------------------------------------------------------------------------*/
Definition Bundle.h:101
Bundle(istream *iStrm=0)
void SetMPSolver(MPSolver *MPS=0)
void SetLambda(cLMRow tLambda=0)
EIStatus
Definition Bundle.h:712
void ReSetAlg(unsigned char RstLvl=0)
void SetPar(const int wp, const int value)
Definition Bundle.h:1043
HpNum ReadFiVal(cIndex wFi=Inf< Index >())
void ChgSbG(cIndex strt=0, Index stp=Inf< Index >(), cIndex wFi=Inf< Index >())
NDOStatus Solve(void)
bool IsOptimal(HpNum eps=0) const
Definition Bundle.h:1141
void GetPar(const int wp, int &value)
Definition Bundle.h:1181
void RemoveVariables(cIndex_Set whch=0, Index hwmny=0)
Index NrSSs(void) const
Definition Bundle.h:642
HpNum ReadBestFiVal(cIndex wFi=Inf< Index >())
cHpRow ReadMult(cIndex_Set &I, Index &D, cIndex wFi=Inf< Index >())
virtual EIStatus EveryIteration(void)
void RemoveItem(cIndex Name)
void SetFiOracle(FiOracle *Fi=0)
HpNum ReadLBMult(cIndex wFi=Inf< Index >())
BndParam
Definition Bundle.h:119
cLMRow ReadSol(cIndex_Set &I, Index &D)
cLMRow ReadBestSol(cIndex_Set &I, Index &D)
void AddVariables(Index NNwVrs, cLMRow IVs=0)
bool CurrentIsLast(void)
Definition Bundle.h:1174
HpNum ReadDStart(cHpNum tt=1) const
Definition Bundle.h:1167
void SetNDOLog(std::ostream *outs=0, const char lvl=0)
void ChgFiV(cIndex wFi=Inf< Index >())
Definition FiOracle.h:231
FiStatus
Definition FiOracle.h:248
virtual void SetMaxName(cIndex MxNme=0)
Definition FiOracle.h:384
Definition MPSolver.h:121
virtual void SetDim(cIndex MxBSz=0, FiOracle *Oracle=nullptr, const bool UsAvSt=false)
Definition MPSolver.h:278
virtual HpNum ReadDStart(cHpNum tt=1)=0
Definition NDOSlver.h:60
virtual void SetPar(const int wp, const int value)
Definition NDOSlver.h:1047
NDOStatus
Definition NDOSlver.h:91
virtual void GetPar(const int wp, int &value)
Definition NDOSlver.h:1075
FiOracle * Oracle
(pointer to) the oracle for Fi
Definition NDOSlver.h:978
HpNum EInit
precision-related parameter: initial precision
Definition NDOSlver.h:986
HpNum EpsLin
optimality related parameter: relative precision
Definition NDOSlver.h:984
int SIndex
Definition OPTtypes.h:69
HpNum * HpRow
"finer" (fp) array
Definition OPTtypes.h:99
const HpNum cHpNum
a read-only HpNum
Definition OPTtypes.h:102
double HpNum
"finer" floating point numbers
Definition OPTtypes.h:98
const Index cIndex
a read-only Index
Definition OPTtypes.h:64
cIndex * cIndex_Set
read-only array
Definition OPTtypes.h:65
SIndex * SIndex_Set
set (array) of s. indices
Definition OPTtypes.h:71
Index * Index_Set
set (array) of indices
Definition OPTtypes.h:61
bool * Bool_Vec
vector of booleans
Definition OPTtypes.h:52
unsigned int Index
Index in a vector ( >= 0 )
Definition OPTtypes.h:60
cHpNum * cHpRow
read-only array
Definition OPTtypes.h:103
LMNum * LMRow
a vector of Lagrangean Multipliers
Definition OPTtypes.h:130
cLMNum * cLMRow
a read-only vector of LMs
Definition OPTtypes.h:134
static constexpr T Inf(void) noexcept
Inf< T >() = infinity value for T.
Definition OPTUtils.h:357
virtual void SetPar(const int wp, cHpNum value)=0
Definition Bundle.h:68