]> www.ginac.de Git - ginac.git/blobdiff - ginac/ex.h
Improved dummy index renaming.
[ginac.git] / ginac / ex.h
index 228b44e5450474754253f38eae94041f5b66270e..60ffa12934047f2054e3549be071d77849c6ea1a 100644 (file)
@@ -52,6 +52,12 @@ private:
 /** For construction of flyweights, etc. */
 static library_init library_initializer;
 
+/** Rotate bits of unsigned value by one bit to the left.
+  * This can be necesary if the user wants to define its own hashes. */
+inline unsigned rotate_left(unsigned n)
+{
+       return (n & 0x80000000U) ? (n << 1 | 0x00000001U) : (n << 1);
+}
 
 class scalar_products;
 class const_iterator;