/usr/include/givaro/givbits.h is in libgivaro-dev 3.7.2-1.
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 107 | // ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/kernel/bstruct/givbits.h,v $
// Copyright(c)'1994-2009 by The Givaro group
// This file is part of Givaro.
// Givaro is governed by the CeCILL-B license under French law
// and abiding by the rules of distribution of free software.
// see the COPYRIGHT file for more details.
// Author: T. Gautier
// $Id: givbits.h,v 1.3 2011-02-02 16:23:55 bboyer Exp $
// ==========================================================================
/** @file givbits.h
* @ingroup bstruct
* @brief field of n bits, for any n
*/
#ifndef __GIVARO_bits_H
#define __GIVARO_bits_H
#include <iostream>
#include "givaro/givaromm.h"
#include "givaro/givarray0.h"
namespace Givaro {
//! Bits.
class Bits {
public:
typedef size_t base ;
Bits () ;
Bits (const size_t n) ; // -- n is the number of bits reclaimed
Bits( const Bits& B ) ; // -- logical recopy
~Bits() ;
// -- All binary operand must have same type:
// <op>in are for inplace operator (this receives the result)
const Bits operator&( const Bits& A ) const ;
Bits& andin( const Bits& A, const Bits B) ;
Bits& operator&= (const Bits& A) ;
//inline const Bits operator& (const Bits& A) const { return operator&(A) ; }
// -- Or
const Bits operator|( const Bits& A ) const ;
Bits& orin( const Bits& A, const Bits B) ;
Bits& operator|=( const Bits& A ) ;
//inline const Bits operator| (const Bits& A) const { return operator|(A) ; }
// -- Or
const Bits operator^( const Bits& A ) const ;
Bits& xorin( const Bits& A, const Bits B) ;
Bits& operator^=( const Bits& A ) ;
//inline const Bits operator^ (const Bits& A) const { return operator^(A) ; }
// -- Not
const Bits operator~( ) const ;
Bits& notin( const Bits& A ) ;
//inline const Bits operator~ () const { return operator~() ; }
// -- Assignement: physical recopy
Bits& copy( const Bits& src ) ;
Bits& operator= (const Bits& B);
// -- Logical recopy
Bits& logcopy( const Bits& src ) ;
// -- Returns the number of non zero bits :
long numone() const ;
// -- Returns the index of non zero bits
void indexofone( Array0<Bits::base>& ) const ;
// -- Returns the length (in bit) of this :
size_t length() const ;
// -- set to 0 all bits:
void clear() ;
// -- set to 0 the i-th bit
void clear(const int i) ;
// -- set to 1 all bits
void set() ;
// -- set to 1 the i-th bit
void set(const int i) ;
// -- returns the i-th bit
int get(const int i) const ;
int operator[] (const int i) const ;
int operator[] (const size_t i) const ;
// -- IO/methods
std::ostream& print( std::ostream& o ) const ;
protected:
typedef Array0<Bits::base> Rep ;
Bits( const Rep& r ) ;
Rep rep ;
private:
static GivModule Module;
friend class GivModule;
static void Init(int*, char***);
static void End();
} ;
} // namespace Givaro
#include "givaro/givbits.inl"
#endif // __GIVARO_bits_H
|