This file is indexed.

/usr/include/givaro/random-integer.h is in libgivaro-dev 4.0.2-8ubuntu1.

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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// ==========================================================================
// Copyright(c)'2016 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.
// Authors: J.-G. Dumas

#ifndef __GIVARO_random_integer_iterator_H
#define __GIVARO_random_integer_iterator_H


namespace std {
    template <bool B>
    using bool_constant = integral_constant<bool, B>;
}

namespace Givaro
{

    template <class Element> class ZRing; 

	/*!@brief Random Integer Iterator.
	 * @ingroup integers
	 * @ingroup randiter
	 *
	 * Generates integers of specified length.
	 * @tparam _Unsigned if \c true, then only non negative integers
	 * are generated, if \c false, their sign is random.
     * @tparam _Exact_Size if \c true, then random integers have
     * exactly the number of required bits, if \c false, they have
     * less than the required number of bits
	 */
	template<bool _Unsigned=true, bool _Exact_Size=false>
	class RandomIntegerIterator {
        typedef typename 
        std::bool_constant<_Exact_Size>::type _Exact_Size_t;
	public:
		typedef Givaro::Integer Integer_Type ;
		typedef Givaro::Integer Element ;
		typedef Givaro::ZRing<Integer> Integer_Domain ;

		/*! Constructor.
		 * @param bits size of integers (in bits)
		 * @param seed if \c 0 a seed will be generated, otherwise, the
		 * provided seed will be use.
		 */
		RandomIntegerIterator(const Integer_Domain& D, size_t bits = 30, uint64_t seed = 0) :
                _bits(bits), _integer(), _ring(D)
		{
            if (! bits) bits = 30;
			GIVARO_ASSERT( bits>0, "[RandomIntegerIterator] bad bit size");
			if (! seed)
				setSeed( static_cast<uint64_t>(BaseTimer::seed()) );
			else
				setSeed( seed );

			this->operator++();
		}

		/// copy constructor.
		/// @param R random iterator to be copied.
		RandomIntegerIterator (const RandomIntegerIterator &R) :
                _bits(R._bits), _integer(R._integer), _ring(R._ring)
		{}

		/// copy.
		/// @param R random iterator to be copied.
		RandomIntegerIterator &operator=(const RandomIntegerIterator &R)
		{
			if (this != &R) {
				_bits = R._bits;
				_integer = R._integer;
                const_cast<Integer_Domain&>(_ring)=R._ring;
			}
			return *this;
		}


		/** @brief operator++()
		 *  creates a new random integer.
		 */
		inline RandomIntegerIterator &operator ++ ()
		{
			this->nextRandom(_Exact_Size_t(), _integer);
			return *this;
		}

		/** @brief get the random integer.
		 *  returns the actual integer.
		 */
		const Integer_Type &operator *  () const
		{
			return _integer;
		}

		/** @brief get the random integer.
		 *  returns the actual integer.
		 *  @warning a new integer is not generated.
		 */
		const Integer_Type & randomInteger() const
		{
			return _integer;
		}

		Integer_Type & random (Integer_Type & a) const
		{
			return this->nextRandom(_Exact_Size_t(), a);
		}

        Element& operator() (Element& a) const {
            return this->random(a);
        }

        Element operator() () const{
            Element a; this->random(a); return a;
        }
        Element random () const {
            return this->operator()();
        }

		/** @brief Sets the seed.
		 *  Set the random seed to be \p ul.
		 *  @param ul the new seed.
		 */
		void static setSeed(uint64_t ul)
		{
			Givaro::Integer::seeding(ul);
		}

		void setBits (size_t  bits)
		{
			_bits = bits;
		}

		size_t getBits () const
		{
			return _bits ;
		}

        const Integer_Domain& ring() const
        { 
            return _ring;
        }
        
                

    protected:
        inline Integer_Type& nextRandom(std::true_type,  Integer_Type & a) const {
			return Givaro::Integer::random_exact<_Unsigned>(a,_bits);
        }
        inline Integer_Type& nextRandom(std::false_type, Integer_Type & a) const {
			return Givaro::Integer::random_lessthan<_Unsigned>(a,_bits);
        }

		size_t    				_bits;  	//!< common length of all integers
		Integer_Type   			_integer;	//!< the generated integer.
        const Integer_Domain& 	_ring;
        
	};

}

#endif //__GIVARO_random_integer_iterator_H