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