atlas  0.6
descents.h
Go to the documentation of this file.
1 
6 /*
7  This is descents.h
8 
9  Copyright (C) 2004,2005 Fokko du Cloux
10  part of the Atlas of Lie Groups and Representations
11 
12  For license information see the LICENSE file
13 */
14 
15 #ifndef DESCENTS_H /* guard against multiple inclusions */
16 #define DESCENTS_H
17 
18 #include <cstring>
19 
20 namespace atlas {
21 
22 /******** constant declarations *********************************************/
23 
24 namespace descents {}
25 
26 /******** function declarations *********************************************/
27 
28 /******** type definitions **************************************************/
29 
30 namespace descents {
31 
32 
46 
54  unsigned char d_data[constants::RANK_MAX];
55  static const unsigned ValMask = constants::charBits - 1;
56 
61  static const unsigned DescentMask = 0x4ul;
62 
67  static const unsigned DirectRecursionMask = 0x5ul;
68 
69  public:
70 
71  enum Value { ComplexAscent, RealNonparity, ImaginaryTypeI, ImaginaryTypeII,
72  ImaginaryCompact, ComplexDescent, RealTypeII, RealTypeI };
73 
80  static bool isDescent(Value v) {
81  return (v & DescentMask)!=0;
82  }
83 
90  static bool isDirectRecursion(Value v) {
91  return (v & DirectRecursionMask) == DirectRecursionMask;
92  }
93 
94 // constructors and destructors
95  DescentStatus() { // sets statuses of all simple roots to 0 (ComplexAscent)
96  std::memset(d_data,0,constants::RANK_MAX);
97  }
98 
100 
101 // copy and assignment (these copy statuses of all simple roots)
103  std::memcpy(d_data,ds.d_data,constants::RANK_MAX);
104  }
105 
107  std::memcpy(d_data,ds.d_data,constants::RANK_MAX);
108  return *this;
109  }
110 
111 // accessors
112 
116  Value operator[] (size_t s) const {
117  return static_cast<Value> (d_data[s]); // cast converts integer to enum
118  }
119 
120 // manipulators
121 
125  void set(size_t s, Value v) {
126  d_data[s] = v; // no cast needed here; enum value converts to integral type
127  }
128 };
129 
130 }
131 
132 }
133 
134 #endif
static const size_t RANK_MAX
Definition: constants.h:57
DescentStatus()
Definition: descents.h:95
Value
Definition: descents.h:71
~DescentStatus()
Definition: descents.h:99
DescentStatus & operator=(const DescentStatus &ds)
Definition: descents.h:106
static bool isDescent(Value v)
Tests whether Value is 4 through 7. These are the descents.
Definition: descents.h:80
Describes the descent status of each simple root for a single representation.
Definition: descents.h:45
static bool isDirectRecursion(Value v)
Tests whether both bits of DirectRecursionMask are set.
Definition: descents.h:90
unsigned char d_data[constants::RANK_MAX]
Value of byte #j specifies the descent status of simple root #j.
Definition: descents.h:54
Definition: Atlas.h:38
DescentStatus(const DescentStatus &ds)
Definition: descents.h:102
static const unsigned charBits
Definition: constants.h:38
Vertex v
Definition: graph.cpp:116