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

/home/r0/dav/atlas.dir/atlas3/sources/gkmod/descents.h

Go to the documentation of this file.
00001 /*!
00002 \file
00003 \brief Class definition for the class DescentStatus.
00004 */
00005 
00006 /*
00007   This is descents.h
00008 
00009   Copyright (C) 2004,2005 Fokko du Cloux
00010   part of the Atlas of Reductive Lie Groups
00011 
00012   See file main.cpp for full copyright notice
00013 */
00014 
00015 #ifndef DESCENTS_H  /* guard against multiple inclusions */
00016 #define DESCENTS_H
00017 
00018 #include "descents_fwd.h"
00019 
00020 #include "constants.h"
00021 
00022 namespace atlas {
00023 
00024 /******** constant declarations *********************************************/
00025 
00026 namespace descents {}
00027 
00028 /******** function declarations *********************************************/
00029 
00030 /******** type definitions **************************************************/
00031 
00032 namespace descents {
00033 
00034 
00035   /*!
00036 \brief Describes the descent status of each simple root for a single
00037 representation.
00038 
00039     There are eight possibilities for the descent status of a representation
00040     parameter w.r.t. a simple reflection, so this information could be packed
00041     in three bits. However, this would lead to having some packets lie across
00042     word boundaries, with the ensuing complications. Four bits is a good
00043     choice; here we take the lazy way of using even eight bits, as this
00044     makes the reading even a bit easier. We might come back to  four at
00045     some later change---this should not require a change in user interface.
00046   */
00047 class DescentStatus {
00048 
00049  private:
00050 
00051   /*!
00052 \brief Value of byte \#j specifies the descent status of simple root
00053 \#j.
00054 
00055 Value should be 0 through 7; values 0 through 3 are ascents, and 4
00056 through 7 are descents.
00057   */
00058   unsigned char d_data[constants::RANK_MAX];
00059   static const unsigned ValMask = constants::charBits - 1;
00060 
00061   /*!
00062 \brief Bitwise "and" of Value with this is non-zero if Value is one of
00063 ImaginaryCompact, ComplexDescent, RealTypeII, or RealTypeI (numbers 4--7)
00064   */
00065   static const unsigned DescentMask = 0x4ul;
00066 
00067   /*!
00068 \brief Bitwise "and" of Value with this is equal to this if Value is either
00069 ComplexDescent (5) or RealTypeI (7)
00070   */
00071   static const unsigned DirectRecursionMask = 0x5ul;
00072 
00073  public:
00074 
00075   enum Value { ComplexAscent, RealNonparity, ImaginaryTypeI, ImaginaryTypeII,
00076                ImaginaryCompact, ComplexDescent, RealTypeII, RealTypeI };
00077 
00078   /*!
00079 \brief Tests whether Value is 4 through 7.  These are the descents.
00080 
00081 The simple roots passing this test comprise the tau invariant for the
00082 representation.
00083   */
00084   static bool isDescent(Value v) {
00085     return (v & DescentMask)!=0;
00086   }
00087 
00088   /*!
00089 \brief Tests whether both bits of DirectRecursionMask are set
00090 
00091 In the case of a complex descent or a real type I descent there is a simple
00092 recursion formula for the KL element.
00093   */
00094   static bool isDirectRecursion(Value v) {
00095     return (v & DirectRecursionMask) == DirectRecursionMask;
00096   }
00097 
00098 // constructors and destructors
00099   DescentStatus() { // sets statuses of all simple roots to 0 (ComplexAscent)
00100     memset(d_data,0,constants::RANK_MAX);
00101   }
00102 
00103   ~DescentStatus() {}
00104 
00105 // copy and assignment (these copy statuses of all simple roots)
00106   DescentStatus(const DescentStatus& ds) {
00107     memcpy(d_data,ds.d_data,constants::RANK_MAX);
00108   }
00109 
00110   DescentStatus& operator=(const DescentStatus& ds) {
00111     memcpy(d_data,ds.d_data,constants::RANK_MAX);
00112     return *this;
00113   }
00114 
00115 // accessors
00116 
00117 /*!
00118 \brief Returns descent status of simple root \#s.
00119 */
00120   Value operator[] (size_t s) const {
00121     return static_cast<Value> (d_data[s]); // cast converts integer to enum
00122   }
00123 
00124 // manipulators
00125 
00126 /*!
00127 \brief Sets the descent status of simple root \#s to v.
00128 */
00129   void set(size_t s, Value v) {
00130     d_data[s] = v; // no cast needed here; enum value converts to integral type
00131   }
00132 };
00133 
00134 }
00135 
00136 }
00137 
00138 #endif

Generated on Wed Mar 26 16:49:33 2008 for atlas by  doxygen 1.3.9.1