glucat 0.12.0
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 "glucat/global.h"
35
36#include <boost/numeric/ublas/fwd.hpp>
37
38#include <utility>
39#include <array>
40#include <map>
41#include <vector>
42
43namespace glucat { namespace gen
44{
45 namespace ublas = boost::numeric::ublas;
46
48 using signature_t = std::pair<index_t, index_t>;
49
51 template< class Matrix_T >
53 private std::map< signature_t, std::vector<Matrix_T> >
54 {
55 public:
57 auto operator() (const index_t p, const index_t q) -> const Matrix_T*;
59 static auto generator() -> generator_table<Matrix_T>&;
60 private:
62 auto gen_vector(const index_t p, const index_t q) -> const std::vector<Matrix_T>&;
64 void gen_from_pm1_qm1(const std::vector<Matrix_T>& old, const signature_t sig);
66 void gen_from_pm4_qp4(const std::vector<Matrix_T>& old, const signature_t sig);
68 void gen_from_pp4_qm4(const std::vector<Matrix_T>& old, const signature_t sig);
70 void gen_from_qp1_pm1(const std::vector<Matrix_T>& old, const signature_t sig);
71
76 // Enforce singleton
77 // Reference: A. Alexandrescu, "Modern C++ Design", Chapter 6
78 generator_table() = default;
79 ~generator_table() = default;
80 public:
82 auto operator= (const generator_table&) -> generator_table& = delete;
83 };
84
86 static const std::array<index_t, 8> offset_to_super = {0,-1, 0,-1,-2, 3, 2, 1};
87
88} }
89#endif // _GLUCAT_GENERATION_H
auto gen_vector(const index_t p, const index_t q) -> const std::vector< Matrix_T > &
Construct a vector of generators for a specific signature.
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.
static auto generator() -> generator_table< Matrix_T > &
Single instance of generator table.
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.
auto operator()(const index_t p, const index_t q) -> const Matrix_T *
Pointer to generators for a specific signature.
friend class friend_for_private_destructor
Definition generation.h:75
auto operator=(const generator_table &) -> generator_table &=delete
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.
generator_table(const generator_table &)=delete
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.
static const std::array< index_t, 8 > offset_to_super
Offsets between the current signature and that of the real superalgebra.
Definition generation.h:86
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:48
int index_t
Size of index_t should be enough to represent LO, HI.
Definition global.h:77