pktools 2.6.7
Processing Kernel for geospatial data
IndexValue.h
1/**********************************************************************
2IndexValue.h: class to work with structs containing an index 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 _INDEXVALUE_H_
21#define _INDEXVALUE_H_
22
24 int position;
25 double value;
26};
28public:
29 int operator() (const IndexValue& pv1, const IndexValue& pv2) const{
30 return pv1.value>pv2.value;//for decreasing order
31 }
32};
34public:
35 int operator() (const IndexValue& pv1, const IndexValue& pv2) const{
36 return pv1.value>pv2.value;//for decreasing order
37 }
38};
40public:
41 int operator() (const IndexValue& pv1, const IndexValue& pv2) const{
42 return pv1.value<pv2.value;//for increasing order
43 }
44};
45#endif /* _INDEXVALUE_H_ */