9 #ifndef _MP_utilities_hpp_ 10 #define _MP_utilities_hpp_ 44 template<
int nbr,
class T>
45 vector<T>
makeVector(T i1, T i2=0, T i3=0, T i4=0, T i5=0) {
60 inline int mod(
int a,
int b) {
62 return (t>=0) ? t : t+b;
74 int size()
const {
return size_; }
76 RowMajor(
int s1,
int s2,
int s3,
int s4,
int s5) :
77 size1(s1), size2(s2), size3(s3), size4(s4), size5(s5),
78 size_(s1*s2*s3*s4*s5) {}
79 int f(
int i1=0,
int i2=0,
int i3=0,
int i4=0,
int i5=0)
const {
80 if ( i1==outOfBound || i2==outOfBound || i3==outOfBound ||
81 i4==outOfBound || i5==outOfBound ) {
85 i *= size2; i += i2; i *= size3; i += i3;
86 i *= size4; i += i4; i *= size5; i += i5;
90 int size1,size2,size3,size4,size5,
size_;
120 if (root != h.
root) {
141 if(root->count == 1) {
Functor & operator=(const Functor &)
vector< T > makeVector(T i1, T i2=0, T i3=0, T i4=0, T i5=0)
Utility for doing reference counted pointers.
Utility interface class for adding a string name onto a structure.
const int outOfBound
Distinct return value on conditions where an index goes out of bounds.
All flopc++ code is contained within the flopc namespace.
const T & operator->() const
int f(int i1=0, int i2=0, int i3=0, int i4=0, int i5=0) const
Function object. Often used.
RowMajor(int s1, int s2, int s3, int s4, int s5)
void setName(const string &n)
virtual void operator()() const =0
const Handle & operator=(const Handle &h)
int mod(int a, int b)
return the strictly positive modulus of two integers