/usr/include/linbox/vector/pair.h is in liblinbox-dev 1.1.6~rc0-4.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 | // ======================================================================= // (C) Linbox 2000
// Pair of I and T : struct { column index, value }
// Time-stamp: <19 Sep 03 11:00:25 Jean-Guillaume.Dumas@imag.fr>
// =======================================================================
#ifndef _LIN_PAIR_H_
#define _LIN_PAIR_H_
#include <iostream>
// ---------------------------------------------------
//
/// Pair of I and T : struct { column index, value }
template<class T, class I = unsigned long> class Pair {
public:
typedef Pair<T, I> Self_t;
typedef T Type_t;
// ~Pair() {};
Pair() {};
Pair(const I jj, const T& val) :_j(jj),_value(val){};
Pair(const Self_t& p) :_j(p._j),_value(p._value){};
T getvalue() const { return _value; };
I getindex() const { return _j; };
I j() const { return _j; };
T affect(const T& val) { return _value = val; };
T change_value(const T& val) { return _value = val; };
I change_j(const I jj) { return _j = jj; };
I change_index(const I jj) { return _j = jj; };
Self_t assign(const T& val) {
_value = val;
return *this;
};
Self_t assign(const I jj, const T& val) {
_value = val;
_j = jj;
return *this;
};
I decr() { return --_j; };
I operator--() { return --_j; };
I operator--(int) { return _j--; };
I incr() { return ++_j; };
I operator++() { return ++_j; };
I operator++(int) { return _j++; };
friend inline std::istream& operator>> (std::istream& is, Pair<T, I>& a) {
I jj;
T val;
is >> jj >> val;
a._value=val; a._j=jj;
// a = Pair<T, I>(jj,val);
return is;
};
friend inline std::ostream& operator<< (std::ostream& o, const Pair<T, I> a){
// return o << a.j() << " " << a.getvalue() ;
return o << a._j << " " << a._value ;
};
private:
I _j;
T _value;
};
#endif // _LIN_PAIR_H_
|