atlas  0.6
klsupport.h
Go to the documentation of this file.
1 
5 /*
6  This is klsupport.h
7 
8  Copyright (C) 2004,2005 Fokko du Cloux
9  part of the Atlas of Lie Groups and Representations
10 
11  For license information see the LICENSE file
12 */
13 
14 #ifndef KLSUPPORT_H /* guard against multiple inclusions */
15 #define KLSUPPORT_H
16 
17 
18 #include "bitset.h" // containment
19 
20 #include "../Atlas.h"
21 #include "blocks.h" // inlining of methods like |cross| and |cayley|
22 
23 namespace atlas {
24 
25 /******** function declarations *********************************************/
26 
27 /******** type definitions **************************************************/
28 
29 namespace klsupport {
30 
31 class KLSupport
32 {
35 
36  BitSet<NumStates> d_state;
37 
38  const Block_base& d_block; // non-owned reference
39 
40  std::vector<RankFlags> d_descent;
41  std::vector<RankFlags> d_goodAscent;
42  std::vector<BitMap> d_downset;
43  std::vector<BitMap> d_primset;
44  std::vector<BlockElt> d_lengthLess;
45  std::vector<std::vector<unsigned int> > d_prim_index;
46 
47  public:
48 
49 // constructors and destructors
50  KLSupport(const Block_base&);
51 
52 // copy and swap (use automatically generated copy constructor)
53  void swap(KLSupport&);
54 
55 // accessors
56  const Block_base& block() const { return d_block; }
57  size_t rank() const { return d_block.rank(); }
58  size_t size() const { return d_block.size(); }
59 
60  size_t length(BlockElt z) const { return d_block.length(z); }
61  BlockElt lengthLess(size_t l) const // number of block elements of length < l
62  { return d_lengthLess[l]; }
63 
64  BlockElt cross(size_t s, BlockElt z) const { return d_block.cross(s,z); }
65  BlockEltPair cayley(size_t s, BlockElt z) const
66  { return d_block.cayley(s,z); }
67 
68  DescentStatus::Value descentValue(size_t s, BlockElt z) const
69  { return d_block.descentValue(s,z); }
70  const DescentStatus& descent(BlockElt y) const // combined for all |s|
71  { return d_block.descent(y); }
72 
73  const RankFlags& descentSet(BlockElt z) const
74  { return d_descent[z]; }
76  { return d_goodAscent[z]; }
77 
78  // find ascent for |x| that is descent for |y| if any; |longBits| if none
79  unsigned int ascent_descent(BlockElt x,BlockElt y) const
80  { return (descentSet(y)-descentSet(x)).firstBit(); }
81 
82  // find non-i2 ascent for |x| that is descent for |y| if any; or |longBits|
83  unsigned int good_ascent_descent(BlockElt x,BlockElt y) const
84  { return (goodAscentSet(x)&descentSet(y)).firstBit(); }
85 
86  /* computing KL polynomials used to spend a large amount of time evaluating
87  primitivize and then to binary-search for the resulting primitve element.
88  Since the primitive condition only depends on the descent set, we speed
89  things up by tabulating for each descent set the map from block elements
90  to the index of their primitivized counterparts.
91  */
92  unsigned int prim_index (BlockElt x, const RankFlags& descent_set) const
93  { return d_prim_index[descent_set.to_ulong()][x]; }
94 
95  // this is where an element |y| occurs in its "own" primitive row
96  unsigned int self_index (BlockElt y) const
97  { return d_prim_index[descentSet(y).to_ulong()][y]; }
98 
99  // the following are filters of the bitmap
100  void filter_extremal(BitMap&, const RankFlags&) const;
101  void filter_primitive(BitMap&, const RankFlags&) const;
102 
103 // manipulators
104  void fill();
105  void fillDownsets();
106  void fillPrimitivize();
107 };
108 
109 } // |namespace klsupport|
110 
111 } // |namespace atlas|
112 
113 #endif
Definition: klsupport.h:31
std::pair< BlockElt, BlockElt > BlockEltPair
Definition: Atlas.h:369
size_t length(BlockElt z) const
Definition: klsupport.h:60
BitSet< constants::RANK_MAX > RankFlags
Definition: Atlas.h:60
const RankFlags & descentSet(BlockElt z) const
Definition: klsupport.h:73
const Block_base & d_block
Definition: klsupport.h:38
void filter_primitive(BitMap &, const RankFlags &) const
Definition: klsupport.cpp:108
Definition: klsupport.h:34
unsigned int prim_index(BlockElt x, const RankFlags &descent_set) const
Definition: klsupport.h:92
std::vector< BitMap > d_primset
Definition: klsupport.h:43
BlockElt lengthLess(size_t l) const
Definition: klsupport.h:61
BitSet< NumStates > d_state
Definition: klsupport.h:36
const DescentStatus & descent(BlockElt y) const
Definition: klsupport.h:70
std::vector< BitMap > d_downset
Definition: klsupport.h:42
unsigned int ascent_descent(BlockElt x, BlockElt y) const
Definition: klsupport.h:79
DescentStatus::Value descentValue(size_t s, BlockElt z) const
Definition: klsupport.h:68
std::vector< RankFlags > d_descent
Definition: klsupport.h:40
void fillDownsets()
Fills in the |downset|, |primset|, |descents| and |goodAscent| bitmap/set vectors. Here |downset| and |primset| are vectors indexed by a simple reflection |s|, and giving a bitmap over all block elements, while |descents| and |goodAscent| are vectors indexed by a block element |z| and giving a bitset over all simple reflections. This difference is motivated by their use: |downset| and |primset| are used to filter bitmaps over the entire block according to some set of simple generators, which is easier if the data is grouped by generator. In fact the data computed is stored twice: one always has |downset[s].isMember(z) == descents[z].test(s)| and |primset[s].isMember(z) != good_ascent[z].test(s)|.
Definition: klsupport.cpp:199
KLSupport(const Block_base &)
Definition: klsupport.cpp:45
std::vector< std::vector< unsigned int > > d_prim_index
Definition: klsupport.h:45
unsigned int self_index(BlockElt y) const
Definition: klsupport.h:96
size_t size() const
Definition: klsupport.h:58
std::vector< BlockElt > d_lengthLess
Definition: klsupport.h:44
void filter_extremal(BitMap &, const RankFlags &) const
: Flags in b those block elements which are extremal w.r.t. the simple reflections in d...
Definition: klsupport.cpp:87
void fillPrimitivize()
Definition: klsupport.cpp:255
void swap(KLSupport &)
Definition: klsupport.cpp:58
Definition: Atlas.h:38
unsigned int good_ascent_descent(BlockElt x, BlockElt y) const
Definition: klsupport.h:83
Definition: klsupport.h:33
const Block_base & block() const
Definition: klsupport.h:56
Class definitions and function declarations for the BitSet class.
unsigned int BlockElt
Definition: Atlas.h:367
State
Definition: klsupport.h:33
std::vector< RankFlags > d_goodAscent
Definition: klsupport.h:41
const RankFlags & goodAscentSet(BlockElt z) const
Definition: klsupport.h:75
void fill()
Definition: klsupport.cpp:155
BlockElt cross(size_t s, BlockElt z) const
Definition: klsupport.h:64
size_t rank() const
Definition: klsupport.h:57
BlockEltPair cayley(size_t s, BlockElt z) const
Definition: klsupport.h:65