glucat  0.8.2
generation.h
Go to the documentation of this file.
1 #ifndef _GLUCAT_GENERATION_H
2 #define _GLUCAT_GENERATION_H
3 /***************************************************************************
4  GluCat : Generic library of universal Clifford algebra templates
5  generation.h : Declare functions for generation of the matrix representation
6  -------------------
7  begin : Wed Jan 23 2002
8  copyright : (C) 2002-2012 by Paul C. Leopardi
9  ***************************************************************************
10 
11  This library is free software: you can redistribute it and/or modify
12  it under the terms of the GNU Lesser General Public License as published
13  by the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public License
22  along with this library. If not, see <http://www.gnu.org/licenses/>.
23 
24  ***************************************************************************
25  This library is based on a prototype written by Arvind Raja and was
26  licensed under the LGPL with permission of the author. See Arvind Raja,
27  "Object-oriented implementations of Clifford algebras in C++: a prototype",
28  in Ablamowicz, Lounesto and Parra (eds.)
29  "Clifford algebras with numeric and symbolic computations", Birkhauser, 1996.
30  ***************************************************************************
31  See also Arvind Raja's original header comments in glucat.h
32  ***************************************************************************/
33 
34 #include <utility>
35 #include <map>
36 #include <vector>
37 
38 namespace glucat { namespace gen
39 {
40  namespace ublas = boost::numeric::ublas;
41 
43  typedef std::pair<index_t, index_t> signature_t;
44 
46  template< class Matrix_T >
48  private std::map< signature_t, std::vector<Matrix_T> >
49  {
50  public:
52  const Matrix_T* operator() (const index_t p, const index_t q);
55  private:
57  const std::vector<Matrix_T>& gen_vector(const index_t p, const index_t q);
59  void gen_from_pm1_qm1(const std::vector<Matrix_T>& old, const signature_t sig);
61  void gen_from_pm4_qp4(const std::vector<Matrix_T>& old, const signature_t sig);
63  void gen_from_pp4_qm4(const std::vector<Matrix_T>& old, const signature_t sig);
65  void gen_from_qp1_pm1(const std::vector<Matrix_T>& old, const signature_t sig);
66 
67  // Enforce singleton
68  // Reference: A. Alexandrescu, "Modern C++ Design", Chapter 6
73 
78  };
79 
81  static const index_t offset_to_super[] = {0,-1, 0,-1,-2, 3, 2, 1};
82 
83 } }
84 #endif // _GLUCAT_GENERATION_H
static generator_table< Matrix_T > & generator()
Single instance of generator table.
static const index_t offset_to_super[]
Offsets between the current signature and that of the real superalgebra.
Definition: generation.h:81
Table of generators for specific signatures.
Definition: generation.h:47
void gen_from_qp1_pm1(const std::vector< Matrix_T > &old, const signature_t sig)
Construct generators for p,q given generators for q+1,p-1.
friend class friend_for_private_destructor
Definition: generation.h:77
void gen_from_pm4_qp4(const std::vector< Matrix_T > &old, const signature_t sig)
Construct generators for p,q given generators for p-4,q+4.
void gen_from_pp4_qm4(const std::vector< Matrix_T > &old, const signature_t sig)
Construct generators for p,q given generators for p+4,q-4.
void gen_from_pm1_qm1(const std::vector< Matrix_T > &old, const signature_t sig)
Construct generators for p,q given generators for p-1,q-1.
std::pair< index_t, index_t > signature_t
A signature is a pair of indices, p, q, with p == frame.max(), q == -frame.min()
Definition: generation.h:43
generator_table & operator=(const generator_table &)
const std::vector< Matrix_T > & gen_vector(const index_t p, const index_t q)
Construct a vector of generators for a specific signature.
int index_t
Size of index_t should be enough to represent LO, HI.
Definition: global.h:77
const Matrix_T * operator()(const index_t p, const index_t q)
Pointer to generators for a specific signature.