/usr/include/kdtree++/function.hpp is in libkdtree++-dev 0.7.1+git20101123-4build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | /** \file
* Defines the various functors and interfaces used for KDTree.
*
* \author Martin F. Krafft <libkdtree@pobox.madduck.net>
* \author Sylvain Bougerel <sylvain.bougerel.devel@gmail.com>
*/
#ifndef INCLUDE_KDTREE_ACCESSOR_HPP
#define INCLUDE_KDTREE_ACCESSOR_HPP
#include <cstddef>
namespace KDTree
{
template <typename _Val>
struct _Bracket_accessor
{
typedef typename _Val::value_type result_type;
result_type
operator()(_Val const& V, size_t const N) const
{
return V[N];
}
};
template <typename _Tp>
struct always_true
{
bool operator() (const _Tp& ) const { return true; }
};
template <typename _Tp, typename _Dist>
struct squared_difference
{
typedef _Dist distance_type;
distance_type
operator() (const _Tp& __a, const _Tp& __b) const
{
distance_type d=__a - __b;
return d*d;
}
};
template <typename _Tp, typename _Dist>
struct squared_difference_counted
{
typedef _Dist distance_type;
squared_difference_counted()
: _M_count(0)
{ }
void reset ()
{ _M_count = 0; }
long&
count () const
{ return _M_count; }
distance_type
operator() (const _Tp& __a, const _Tp& __b) const
{
distance_type d=__a - __b;
++_M_count;
return d*d;
}
private:
mutable long _M_count;
};
} // namespace KDTree
#endif // include guard
/* COPYRIGHT --
*
* This file is part of libkdtree++, a C++ template KD-Tree sorting container.
* libkdtree++ is (c) 2004-2007 Martin F. Krafft <libkdtree@pobox.madduck.net>
* and Sylvain Bougerel <sylvain.bougerel.devel@gmail.com> distributed under the
* terms of the Artistic License 2.0. See the ./COPYING file in the source tree
* root for more information.
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
* OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
|