SOSpin is hosted by Hepforge, IPPP Durham
SOSpin  1.0.0
son.h
Go to the documentation of this file.
1 
11 // ----------------------------------------------------------------------------
12 // SOSpin Library
13 // Copyright (C) 2015 SOSpin Project
14 //
15 // Authors:
16 //
17 // Nuno Cardoso (nuno.cardoso@tecnico.ulisboa.pt)
18 // David Emmanuel-Costa (david.costa@tecnico.ulisboa.pt)
19 // Nuno Gonçalves (nunogon@deec.uc.pt)
20 // Catarina Simoes (csimoes@ulg.ac.be)
21 //
22 // ----------------------------------------------------------------------------
23 // This file is part of SOSpin Library.
24 //
25 // SOSpin Library is free software: you can redistribute it and/or modify
26 // it under the terms of the GNU General Public License as published by
27 // the Free Software Foundation, either version 3 of the License, or any
28 // later version.
29 //
30 // SOSpin Library is distributed in the hope that it will be useful,
31 // but WITHOUT ANY WARRANTY; without even the implied warranty of
32 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 // GNU General Public License for more details.
34 //
35 // You should have received a copy of the GNU General Public License
36 // along with SOSpin Library. If not, see <http://www.gnu.org/licenses/>.
37 // ----------------------------------------------------------------------------
38 
39 // son.h created on 27/02/2015
40 //
41 // This file contains the functions necessary to do things
42 // in the SOSpin Library.
43 //
44 // Revision 1.1 28/02/2015 23:19:29 david
45 // License updated
46 //
47 
53 #ifndef SON_H
54 #define SON_H
55 
56 
57 #include "timer.h"
58 #include "index.h"
59 #include "dlist.h"
60 #include "braket.h"
61 #include "form.h"
62 #include "enum.h"
63 
64 #if DOXYGEN
65 #define nAsserts
66 #endif
67 
68 namespace sospin {
69 
70 
75 #define bb(a) DList(0, newIdx(a))
76 
81 #define bbt(a) DList(1, newIdx(a))
82 
87 #define b(a) DList(0, newIdx(#a))
88 
93 #define bt(a) DList(1, newIdx(#a))
94 
100 #define delta(a,b) DList(2, newIdx(#a), newIdx(#b))
101 
104 #define identity DList(3, 0)
105 
112 #define bra(i,a,b) Braket(i,#a, b, bra)
113 
119 #define ket(i,a,b) Braket(i,#a, b, ket)
120 
126 #define braket(i,a,b) Braket(i,#a, b, braket)
127 
133 #define free(i,a,b) Braket(i,#a, b, none)
134 
135 
144 #define Field(a, b, c, d) FormField(#a, b, c, d)
145 
149 void setDim(int n);
153 int getDim();
154 
155 
159 bool GroupEven();
160 
161 
165 void CleanGlobalDecl();
166 
167 
172 void setVerbosity(Verbosity verb);
173 
179 
184 ostream& operator<<(ostream& out,const Verbosity &a);
185 
186 //Braket BopN1();
187 Braket Bop(std::string startid="i");
188 Braket BopIdnum();
189 
190 //void process_mem_usage(double& vm_usage, double& resident_set); //only works for linux
191 
196 size_t getCurrentRSS( );
197 
198 
203 size_t getPeakRSS( );
204 
205 
210 
211 
212 }
213 
214 #endif
215 
216 
217 
int getDim()
Get the group dimension.
Definition: son.cpp:64
Functions and cointainer for indices.
Verbosity getVerbosity()
Return current verbosity level.
Definition: son.cpp:84
void CleanGlobalDecl()
Clean all indexes and function declarations.
Definition: son.cpp:75
Defintions for all general (initialisation etc.) routines of class Braket.
Defintions for all general (initialisation etc.) routines of class Timer.
Defintions for all general (initialisation etc.) routines of class DList.
size_t getCurrentRSS()
Gets current resident set size (RSS) - physical memory use.
Definition: son.cpp:274
void setVerbosity(Verbosity verb)
Set verbosity level.
Definition: son.cpp:80
Enumerators.
bool GroupEven()
Return Group parity.
Definition: son.cpp:68
Functions and tables to use with FORM program.
ostream & operator<<(ostream &out, const OPMode &a)
Get the mode of the expression.
Definition: braket.cpp:266
Braket BopIdnum()
Operator B, charge conjugation matrix for SO(2N) spinor representations.
Definition: son.cpp:134
void setDim(int n)
Set the group dimension.
Definition: son.cpp:59
Braket Bop(string startid)
Operator B, "charge conjugation" matrix for SO(2N) spinor representations.
Definition: son.cpp:99
enum Verbosity_s Verbosity
size_t getPeakRSS()
Gets highest (peak) value so far for resident set size (RSS) - physical memory use.
Definition: son.cpp:228
void print_process_mem_usage()
Prints memory stats (current and peak resident set size) in MB.
Definition: son.cpp:316