/usr/include/givaro/givdegree.h is in libgivaro-dev 3.2.13-1.2.
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 | #ifndef _POLY1DEBGREE_H_
#define _POLY1DEBGREE_H_
// ==========================================================================
// $Source: /var/lib/cvs/Givaro/src/library/poly1/givdegree.h,v $
// Copyright(c)'94-97 by Givaro Team
// see the copyright file.
// Authors: T. Gautier
// $Id: givdegree.h,v 1.3 2008-07-02 12:53:02 jgdumas Exp $
// Description: opaque class for Degree of polynomial. Degree of polynomial
// 0 is Degree::deginfty with value DEGPOLYZERO.
// ==========================================================================
#include <iostream>
// -- Degree type for polynomials
//
class Degree {
public:
typedef long value_type;
enum { DEGPOLYZERO =-1};
Degree(long a = DEGPOLYZERO): _deg(a) { }
// JGD 03.06.2003
// Commented out because of ambiguous overload on the operators
// // -- cast --> long
// operator long() { return _deg; }
// operator int() { return _deg; }
// -- Degree of zero polynomial
static const long deginfty = DEGPOLYZERO;
// -- cvrt
long value() const { return _deg; }
// -- Basic arithmetic:
Degree operator+( const Degree& d) const { return Degree(_deg+d._deg); }
Degree operator-( const Degree& d) const { return Degree(_deg-d._deg); }
Degree operator*( const Degree& d) const { return Degree(_deg*d._deg); }
Degree operator/( const Degree& d) const { return Degree(_deg/d._deg); }
long operator++() { return ++_deg; }
long operator--() { return --_deg; }
long operator++(int) { return _deg++; }
long operator--(int) { return _deg--; }
// -- Comparizon:
int operator==( const Degree& d) const { return _deg == d._deg; }
int operator!=( const Degree& d) const { return _deg != d._deg; }
int operator<=( const Degree& d) const { return _deg <= d._deg; }
int operator< ( const Degree& d) const { return _deg < d._deg; }
int operator>=( const Degree& d) const { return _deg >= d._deg; }
int operator> ( const Degree& d) const { return _deg > d._deg; }
// -- methods
friend std::ostream& operator<< (std::ostream& o, const Degree& d) { return o << d._deg; }
friend std::istream& operator>> (std::istream& i, Degree& d) { return i >> d._deg; }
public:
long _deg;
};
inline long value(const Degree& d) { return d._deg; }
#endif
|