/usr/include/linbox/ring/modular.h is in liblinbox-dev 1.4.2-5build1.
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 | /* linbox/ring/modular.h
* Copyright (C) 1999-2001 William J Turner,
* 2001 Bradford Hovinen
*
* Written by William J Turner <wjturner@math.ncsu.edu>,
* Bradford Hovinen <hovinen@cis.udel.edu>
*
* ------------------------------------
* 2002-04-10 Bradford Hovinen <hovinen@cis.udel.edu>
*
* LargeGivaro::Modular is now replace by a class Givaro::Modular parameterized on the element
* type. So, the old LargeGivaro::Modular is equivalent to Givaro::Modular<integer>. All other
* interface details are exactly the same.
*
* Renamed from large-modular.h to modular.h
* ------------------------------------
*
*
* ========LICENCE========
* This file is part of the library LinBox.
*
* LinBox is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* ========LICENCE========
*.
*/
/*! @file ring/modular.h
* @ingroup ring
* @brief A Givaro::Modular ring is a representations of <code>Z/mZ</code>.
* This file groups many implementations/specialisations of modular rings.
* - Givaro::Modular arithmetic is provided in the <code>ModularXXX<T></code> classes.
* - Specialisations for \ref FieldAXPY, \ref MVProductDomain, \ref DotProductDomain.
* - Random Iterators
* .
*
* @bug move Element& init(const Element&) to FFPACK. use using more..
*/
#ifndef __LINBOX_ring_modular_H
#define __LINBOX_ring_modular_H
#include <givaro/modular.h>
#include <givaro/modular-balanced.h>
#include <givaro/gfq.h>
#include <iostream>
#include <climits>
#include <cmath>
#include "linbox/integer.h"
#include "linbox/field/field-interface.h"
#include "linbox/util/field-axpy.h"
#include "linbox/util/write-mm.h"
#include "linbox/vector/vector-traits.h"
#include "linbox/linbox-config.h"
#include "linbox/field/field-traits.h"
// Namespace in which all LinBox code resides
namespace LinBox
{ /* Givaro::Modular Base */
using Givaro::Caster;
template <class Ring>
struct ClassifyRing;
template <class Element, class Compute>
struct ClassifyRing<Givaro::Modular<Element,Compute> const>
{
typedef RingCategories::ModularTag categoryTag;
};
template <class Element, class Compute>
struct ClassifyRing<Givaro::Modular<Element,Compute>>
{
typedef RingCategories::ModularTag categoryTag;
};
template<class Element>
struct ClassifyRing<Givaro::ModularBalanced<Element> > {
typedef RingCategories::ModularTag categoryTag;
};
template<typename XXX>
struct ClassifyRing<Givaro::GFqDom<XXX>> {
typedef RingCategories::ModularTag categoryTag;
};
/*
template <>
inline std::ostream& Givaro::ModularBase<Integer>::write (std::ostream &os) const
{
return os << "GMP integers mod " << _modulus;
}
*/
// template <>
// inline integer& Givaro::Modular<integer>::init (integer& x, const double& y) const
// {
// integer tmp = (integer)y % _modulus;
// if (tmp<0) tmp += _modulus;
// return x = tmp;
// }
} // namespace LinBox
#include "linbox/vector/vector-domain.h"
namespace LinBox {
template<class Field>
class MVProductDomain ;
} // LinBox
/*! Specialization of FieldAXPY and DotProducts for parameterized modular field */
#include "linbox/ring/modular/modular-int32.h"
#include "linbox/ring/modular/modular-int64.h"
#include "linbox/ring/modular/modular-short.h"
#include "linbox/ring/modular/modular-byte.h"
#include "linbox/ring/modular/modular-double.h"
#include "linbox/ring/modular/modular-float.h"
#include "linbox/ring/modular/modular-unsigned.h"
#endif // __LINBOX_field_modular_H
// Local Variables:
// mode: C++
// tab-width: 8
// indent-tabs-mode: nil
// c-basic-offset: 8
// End:
// vim:sts=8:sw=8:ts=8:noet:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
|