/usr/include/newmat/controlw.h is in libnewmat10-dev 1.10.4-6.
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 | //$$ controlw.h Control word class
#ifndef CONTROL_WORD_LIB
#define CONTROL_WORD_LIB 0
// for organising an int as a series of bits which indicate whether an
// option is on or off.
class ControlWord
{
protected:
int cw; // the control word
public:
ControlWord() : cw(0) {} // do nothing
ControlWord(int i) : cw(i) {} // load an integer
// select specific bits (for testing at least one set)
ControlWord operator*(ControlWord i) const
{ return ControlWord(cw & i.cw); }
void operator*=(ControlWord i) { cw &= i.cw; }
// set bits
ControlWord operator+(ControlWord i) const
{ return ControlWord(cw | i.cw); }
void operator+=(ControlWord i) { cw |= i.cw; }
// reset bits
ControlWord operator-(ControlWord i) const
{ return ControlWord(cw - (cw & i.cw)); }
void operator-=(ControlWord i) { cw -= (cw & i.cw); }
// check if all of selected bits set or reset
bool operator>=(ControlWord i) const { return (cw & i.cw) == i.cw; }
bool operator<=(ControlWord i) const { return (cw & i.cw) == cw; }
// flip selected bits
ControlWord operator^(ControlWord i) const
{ return ControlWord(cw ^ i.cw); }
ControlWord operator~() const { return ControlWord(~cw); }
// convert to integer
int operator+() const { return cw; }
int operator!() const { return cw==0; }
FREE_CHECK(ControlWord)
};
#endif
|