/usr/include/geos/precision/CommonBits.h is in libgeos-dev 3.2.2-3ubuntu1.
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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | /**********************************************************************
* $Id: CommonBits.h 2556 2009-06-06 22:22:28Z strk $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2005-2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#ifndef GEOS_PRECISION_COMMONBITS_H
#define GEOS_PRECISION_COMMONBITS_H
#include <geos/export.h>
#include <geos/platform.h> // for int64
namespace geos {
namespace precision { // geos.precision
/** \brief
* Determines the maximum number of common most-significant
* bits in the mantissa of one or numbers.
*
* Can be used to compute the double-precision number which
* is represented by the common bits.
* If there are no common bits, the number computed is 0.0.
*
*/
class GEOS_DLL CommonBits {
private:
bool isFirst;
int commonMantissaBitsCount;
int64 commonBits;
int64 commonSignExp;
public:
/** \brief
* Computes the bit pattern for the sign and exponent of a
* double-precision number.
*
* @param num
* @return the bit pattern for the sign and exponent
*/
static int64 signExpBits(int64 num);
/** \brief
* This computes the number of common most-significant
* bits in the mantissas of two double-precision numbers.
*
* It does not count the hidden bit, which is always 1.
* It does not determine whether the numbers have the same
* exponent - if they do not, the value computed by this
* function is meaningless.
* @param db
* @return the number of common most-significant mantissa bits
*/
static int numCommonMostSigMantissaBits(int64 num1, int64 num2);
/** \brief
* Zeroes the lower n bits of a bitstring.
*
* @param bits the bitstring to alter
* @param i the number of bits to zero
* @return the zeroed bitstring
*/
static int64 zeroLowerBits(int64 bits, int nBits);
/** \brief
* Extracts the i'th bit of a bitstring.
*
* @param bits the bitstring to extract from
* @param i the bit to extract
* @return the value of the extracted bit
*/
static int getBit(int64 bits, int i);
CommonBits();
void add(double num);
double getCommon();
};
} // namespace geos.precision
} // namespace geos
#endif // GEOS_PRECISION_COMMONBITS_H
/**********************************************************************
* $Log$
* Revision 1.1 2006/03/23 09:17:19 strk
* precision.h header split, minor optimizations
*
**********************************************************************/
|