Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

/home/r0/dav/atlas.dir/atlas3/sources/utilities/constants.h File Reference

#include <cstddef>
#include <limits>

Include dependency graph for constants.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  atlas
namespace  atlas::constants

Classes

class  atlas::constants::BaseShift< n >
 Computes (in the constant BaseShift<n>::value) the base two logarithm of n. More...
class  atlas::constants::BaseShift< 1ul >
class  atlas::constants::Bool< n >
 Tests whether n is non-zero. More...
class  atlas::constants::Bool<(size_t) 0ul >

Variables

const unsigned char ucharMax = std::numeric_limits<unsigned char>::max()
const unsigned long ulongMax = std::numeric_limits<unsigned long>::max()
const unsigned long charBits = std::numeric_limits<unsigned char>::digits
const unsigned long longBits = std::numeric_limits<unsigned long>::digits
const unsigned long sizeBits = std::numeric_limits<size_t>::digits
const unsigned long hiBit = 1ul << (longBits - 1)
const unsigned long firstCharMask = (1ul << charBits) - 1ul
const size_t RANK_MAX = 16ul
const unsigned long posBits = longBits - 1ul
const unsigned long baseBits = ~posBits
const unsigned long baseShift = BaseShift<longBits>::value
 This one tells by how much we have to shift a binary number N to get the base (number of machine words needed for a bitmap of size N).


Detailed Description

This is constants.h

Definition in file constants.h.


Variable Documentation

const unsigned long atlas::constants::baseBits = ~posBits
 

Constant used to pick a bit-address apart: this is the logical complement of posBits. It is assumed that the number of bits in an unsigned long is a power of two.

Definition at line 105 of file constants.h.

const unsigned long atlas::constants::baseShift = BaseShift<longBits>::value
 

This one tells by how much we have to shift a binary number N to get the base (number of machine words needed for a bitmap of size N).

It is the base 2 logarithm of longBits. The difficulty is to compute this at compile time! We use a neat (and well-known) template trick for that. The result is correct only when n is a power of two. (Should be 5 on 32 bit machine.)

Definition at line 133 of file constants.h.

Referenced by atlas::bitmap::BitMap::BitMap().

const unsigned long atlas::constants::charBits = std::numeric_limits<unsigned char>::digits
 

Explanation: the constant charBits is in fact 8 everywhere. Fokko's surprise is about getting 7 for <char>, which is apparently signed

Definition at line 36 of file constants.h.

Referenced by atlas::constants::init().

const unsigned long atlas::constants::firstCharMask = (1ul << charBits) - 1ul
 

bit mask for lower order char of an unsigned long

Definition at line 53 of file constants.h.

const unsigned long atlas::constants::hiBit = 1ul << (longBits - 1)
 

Definition at line 48 of file constants.h.

const unsigned long atlas::constants::longBits = std::numeric_limits<unsigned long>::digits
 

32 or 64, depending on the architecture

Definition at line 41 of file constants.h.

Referenced by atlas::constants::init().

const unsigned long atlas::constants::posBits = longBits - 1ul
 

Constant used to pick a bit-address apart: serves as flags for the address within a word. It is assumed that the number of bits in an unsigned long is a power of two.

Definition at line 99 of file constants.h.

Referenced by atlas::bitmap::BitMap::BitMap(), and atlas::bitmap::BitMap::set_capacity().

const size_t atlas::constants::RANK_MAX = 16ul
 

RANK_MAX is the largest allowed rank for a reductive group. It should not exceed 128, or the data type for Weyl groups will overflow (in a way requiring fundamental rewriting of bitSet and bitVector). It should always be a power of two. The constant PRIMES_MAX in size.h has to be set in accordance with RANK_MAX, so that Weyl group sizes can be properly stored.

Definition at line 85 of file constants.h.

Referenced by atlas::interactive_lietype::checkLieType(), and atlas::interactive_lietype::printRankMessage().

const unsigned long atlas::constants::sizeBits = std::numeric_limits<size_t>::digits
 

equal to longBits virtually everywhere

Definition at line 46 of file constants.h.

Referenced by atlas::pool::Pool::memoryReport(), atlas::pool::Pool::Pool(), and atlas::pool::Pool::reportDestruction().

const unsigned char atlas::constants::ucharMax = std::numeric_limits<unsigned char>::max()
 

Definition at line 24 of file constants.h.

const unsigned long atlas::constants::ulongMax = std::numeric_limits<unsigned long>::max()
 

2**32 - 1 on Mac.

Definition at line 28 of file constants.h.


Generated on Wed Mar 26 16:51:47 2008 for atlas by  doxygen 1.3.9.1