NDOSolver / FiOracle
Interfaces and Solvers for NonDifferentiable Optimization
Loading...
Searching...
No Matches
TestFi.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*---------------------------- File TestFi.h -------------------------------*/
3/*--------------------------------------------------------------------------*/
25/*--------------------------------------------------------------------------*/
26/*----------------------------- DEFINITIONS --------------------------------*/
27/*--------------------------------------------------------------------------*/
28
29#ifndef __TestFi
30 #define __TestFi /* self-identification: #endif at the end of the file */
31
32/*--------------------------------------------------------------------------*/
33/*------------------------------ INCLUDES ----------------------------------*/
34/*--------------------------------------------------------------------------*/
35
36#include "FiOracle.h"
37
38/*--------------------------------------------------------------------------*/
39/*------------------------------ NAMESPACE ---------------------------------*/
40/*--------------------------------------------------------------------------*/
41
42namespace NDO_di_unipi_it
43{
44
45/*--------------------------------------------------------------------------*/
46/*----------------------------- CLASS TestFi -------------------------------*/
47/*--------------------------------------------------------------------------*/
48
49class TestFi : public FiOracle
50 // the class may also derive from other class
51{
52
53/*--------------------------------------------------------------------------*/
54/*----------------------- PUBLIC PART OF THE CLASS -------------------------*/
55/*--------------------------------------------------------------------------*/
56
57 public:
58
59/*--------------------------------------------------------------------------*/
60/*--------------------------- PUBLIC METHODS -------------------------------*/
61/*--------------------------------------------------------------------------*/
62/*---------------------------- CONSTRUCTOR ---------------------------------*/
63/*--------------------------------------------------------------------------*/
68 TestFi( cIndex NV , cLMNum L0 );
69
70/*--------------------------------------------------------------------------*/
71/*-------------------- METHODS FOR SOLVING THE PROBLEM ---------------------*/
72/*--------------------------------------------------------------------------*/
73
74 virtual HpNum Fi( cIndex wFi = Inf< Index >() ) override final;
75
76/*--------------------------------------------------------------------------*/
77/*---------------------- METHODS FOR READING RESULTS -----------------------*/
78/*--------------------------------------------------------------------------*/
79
80 virtual Index GetGi( SgRow SubG , cIndex_Set &SGBse ,
81 cIndex Name = Inf< Index >() , cIndex strt = 0 ,
82 Index stp = Inf< Index >() ) override final;
83
84/*--------------------------------------------------------------------------*/
85/*-------------------- METHODS FOR READING OTHER RESULTS -------------------*/
86/*--------------------------------------------------------------------------*/
87
88 virtual HpNum GetLowerBound( cIndex wFi = Inf< Index >() ) override final
89 {
90 return( wFi > 1 ? 0 : - Inf< HpNum >() ); // the optimal value is 1
91 }
92
93/*--------------------------------------------------------------------------*/
94/*------------- METHODS FOR ADDING / REMOVING / CHANGING DATA --------------*/
95/*--------------------------------------------------------------------------*/
96
97/*--------------------------------------------------------------------------*/
98/*------------------------------ DESTRUCTOR --------------------------------*/
99/*--------------------------------------------------------------------------*/
101
102 virtual ~TestFi();
103
104/*--------------------------------------------------------------------------*/
105/*-------------------- PROTECTED PART OF THE CLASS -------------------------*/
106/*--------------------------------------------------------------------------*/
107
108 protected:
109
110/*--------------------------------------------------------------------------*/
111/*-------------------------- PROTECTED METHODS -----------------------------*/
112/*--------------------------------------------------------------------------*/
113
114/*--------------------------------------------------------------------------*/
115/*----------------------- PROTECTED DATA STRUCTURES -----------------------*/
116/*--------------------------------------------------------------------------*/
117
122/*--------------------------------------------------------------------------*/
123/*--------------------- PRIVATE PART OF THE CLASS --------------------------*/
124/*--------------------------------------------------------------------------*/
125
126 private:
127
128/*--------------------------------------------------------------------------*/
129/*-------------------------- PRIVATE METHODS -------------------------------*/
130/*--------------------------------------------------------------------------*/
131
132/*--------------------------------------------------------------------------*/
133/*----------------------- PRIVATE DATA STRUCTURES -------------------------*/
134/*--------------------------------------------------------------------------*/
135
136/*--------------------------------------------------------------------------*/
137
138 }; // end( class TestFi )
139
140/*--------------------------------------------------------------------------*/
141
142}; // end( namespace NDO_di_unipi_it )
143
144/*--------------------------------------------------------------------------*/
145/*--------------------------------------------------------------------------*/
146
147#endif /* TestFi.h included */
148
149/*--------------------------------------------------------------------------*/
150/*------------------------- End File TestFi.h ------------------------------*/
151/*--------------------------------------------------------------------------*/
Definition FiOracle.h:231
Definition TestFi.h:51
virtual ~TestFi()
destructor of the class: it must be virtual
TestFi(cIndex NV, cLMNum L0)
virtual HpNum GetLowerBound(cIndex wFi=Inf< Index >()) override final
Definition TestFi.h:88
LMNum Cntr
Definition TestFi.h:118
virtual HpNum Fi(cIndex wFi=Inf< Index >()) override final
virtual Index GetGi(SgRow SubG, cIndex_Set &SGBse, cIndex Name=Inf< Index >(), cIndex strt=0, Index stp=Inf< Index >()) override final
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
unsigned int Index
Index in a vector ( >= 0 )
Definition OPTtypes.h:60
SgNum * SgRow
a subgradient
Definition OPTtypes.h:112
double LMNum
a Lagrangean Multiplier
Definition OPTtypes.h:129
const LMNum cLMNum
a read-only Lagrangean Multiplier
Definition OPTtypes.h:133
static constexpr T Inf(void) noexcept
Inf< T >() = infinity value for T.
Definition OPTUtils.h:357
Definition Bundle.h:68