Debian Codegraph @

src/base/PosValue.h

raw symbols SCIP
1 /**********************************************************************
2 PosValue.h: class to work with structs containing a position and a value
3 Author(s): [email protected]
4 Copyright (C) 2016-2020 European Union (Joint Research Centre)
5
6 This file is part of jiplib.
7
8 jiplib is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 jiplib is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with jiplib. If not, see <https://www.gnu.org/licenses/>.
20 ***********************************************************************/
21 #ifndef _POSVALUE_H_
22 #define _POSVALUE_H_
23
24 struct PosValue{
25 double posx;
26 double posy;
27 double value;
28 };
29 class Compare_PosValue{
30 public:
31 int operator() (const PosValue& pv1, const PosValue& pv2) const{
32 return pv1.value>pv2.value;//for decreasing order
33 }
34 };
35 class Decrease_PosValue{
36 public:
37 int operator() (const PosValue& pv1, const PosValue& pv2) const{
38 return pv1.value>pv2.value;//for decreasing order
39 }
40 };
41 class Increase_PosValue{
42 public:
43 int operator() (const PosValue& pv1, const PosValue& pv2) const{
44 return pv1.value<pv2.value;//for increasing order
45 }
46 };
47 #endif /* _POSVALUE_H_ */