/usr/include/polybori/groebner/PolyEntryReference.h is in libbrial-groebner-dev 0.8.5-4.
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 | // -*- c++ -*-
//*****************************************************************************
/** @file PolyEntryReference.h
*
* @author Michael Brickenstein (original) and Alexander Dreyer (refactored)
* @date 2012-01-04
*
* This file includes the definition of the class @c PolyEntryReference.
*
* @par Copyright:
* (c) by The PolyBoRi Team
*
**/
//*****************************************************************************
#ifndef polybori_groebner_PolyEntryReference_h_
#define polybori_groebner_PolyEntryReference_h_
// include basic definitions
#include "groebner_defs.h"
#include <set>
#include "PolyEntryIndices.h"
#include "PolyEntry.h"
BEGIN_NAMESPACE_PBORIGB
/** @class PolyEntryReference
* @brief This class defines @c PolyEntryReference.
*
* It allows non-constant access to those attributes, that
* could not cause inconsistencies, but only constant access to others
**/
class PolyEntryReference {
typedef PolyEntryReference self;
public:
typedef PolyEntryIndices vector_type;
typedef PolyEntry value_type;
/// Construct from plain non-constant reference
PolyEntryReference(value_type &entry, vector_type& parent):
vPairCalculated(entry.vPairCalculated), minimal(entry.minimal),
m_entry(entry), m_parent(parent) { }
/// Equality check
bool operator==(const self& rhs) const { return m_entry == rhs; }
/// @name The following data is accessible without yielding inconsistencies
//@{
void markVariablePairsCalculated() {
return m_entry.markVariablePairsCalculated(); }
bool propagatableBy(const PolyEntry& other) const {
return m_entry.propagatableBy(other);
}
std::set<idx_type>& vPairCalculated;
bool& minimal;
//@}
/// Assignment also triggers changes in the parent
template <class Type>
self& operator=(const Type& rhs) {
Monomial lm(m_entry.lead);
m_entry = rhs;
m_parent.update(lm, m_entry);
return *this;
}
/// Constant access
const value_type& get() const { return const_cast<const value_type&>(m_entry); }
/// Conversion to constant reference
operator const value_type&() const { return get(); }
private:
value_type& m_entry;
vector_type& m_parent;
};
END_NAMESPACE_PBORIGB
#endif /* polybori_groebner_PolyEntryReference_h_ */
|