HiRep 0.1
Loading...
Searching...
No Matches
linear_algebra.h
Go to the documentation of this file.
1/***************************************************************************\
2* Copyright (c) 2008, Claudio Pica *
3* All rights reserved. *
4\***************************************************************************/
5
9
15#ifndef LINEAR_ALGEBRA_H
16#define LINEAR_ALGEBRA_H
17
18#include "libhr_core.h"
19#include "hr_complex.h"
20#include "Utils/generics.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26// Linear Algebra functions are generic
27// They are parametrized over the input types for double/single precision
28// The template is in TMPL/linear_algebra.h.tmpl
29
30#ifdef WITH_GPU
31double *alloc_double_sum_field(int n);
32hr_complex *alloc_complex_sum_field(int n);
33#endif
34
35// double precision
36#define _FIELD_TYPE spinor_field
37#define _REAL double
38#define _COMPLEX hr_complex
39#include "TMPL/linear_algebra_def.h.tmpl" // This has to go first
40#include "TMPL/linear_algebra_reduction.h.tmpl"
41#include "TMPL/linear_algebra_base_operations.h.tmpl"
42#include "TMPL/linear_algebra_lc.h.tmpl"
43#include "TMPL/linear_algebra_gamma.h.tmpl"
44#include "TMPL/linear_algebra_base.h.tmpl" // This has to come last
45
46// single precision
47#define _FIELD_TYPE spinor_field_flt
48#define _REAL float
49#define _COMPLEX hr_complex_flt
50#include "TMPL/linear_algebra_def.h.tmpl"
51#include "TMPL/linear_algebra_reduction.h.tmpl"
52#include "TMPL/linear_algebra_base_operations.h.tmpl"
53#include "TMPL/linear_algebra_lc.h.tmpl"
54#include "TMPL/linear_algebra_gamma.h.tmpl"
55#include "TMPL/linear_algebra_base.h.tmpl"
56
57// double precision
58#define _FIELD_TYPE scalar_field
59#define _REAL double
60#define _COMPLEX hr_complex
61#include "TMPL/linear_algebra_def.h.tmpl"
62#include "TMPL/linear_algebra_reduction.h.tmpl"
63#include "TMPL/linear_algebra_base_operations.h.tmpl"
64#include "TMPL/linear_algebra_base.h.tmpl"
65
66#define _FIELD_TYPE suNg_field
67#define _REAL double
68#define _COMPLEX hr_complex
69#include "TMPL/linear_algebra_def.h.tmpl"
70#include "TMPL/linear_algebra_reduction.h.tmpl"
71#include "TMPL/linear_algebra_base_operations.h.tmpl"
72#include "TMPL/linear_algebra_base.h.tmpl"
73
74#define _FIELD_TYPE suNf_field
75#define _REAL double
76#define _COMPLEX hr_complex
77#include "TMPL/linear_algebra_def.h.tmpl"
78#include "TMPL/linear_algebra_reduction.h.tmpl"
79#include "TMPL/linear_algebra_base_operations.h.tmpl"
80#include "TMPL/linear_algebra_base.h.tmpl"
81
82#define _FIELD_TYPE suNfc_field
83#define _REAL double
84#define _COMPLEX hr_complex
85#include "TMPL/linear_algebra_def.h.tmpl"
86#include "TMPL/linear_algebra_reduction.h.tmpl"
87#include "TMPL/linear_algebra_base_operations.h.tmpl"
88#include "TMPL/linear_algebra_base.h.tmpl"
89
90#define _FIELD_TYPE suNg_field_flt
91#define _REAL float
92#define _COMPLEX hr_complex_flt
93#include "TMPL/linear_algebra_def.h.tmpl"
94#include "TMPL/linear_algebra_reduction.h.tmpl"
95#include "TMPL/linear_algebra_base_operations.h.tmpl"
96#include "TMPL/linear_algebra_base.h.tmpl"
97
98#define _FIELD_TYPE suNf_field_flt
99#define _REAL float
100#define _COMPLEX hr_complex_flt
101#include "TMPL/linear_algebra_def.h.tmpl"
102#include "TMPL/linear_algebra_reduction.h.tmpl"
103#include "TMPL/linear_algebra_base_operations.h.tmpl"
104#include "TMPL/linear_algebra_base.h.tmpl"
105
106#define _FIELD_TYPE suNg_scalar_field
107#define _REAL double
108#define _COMPLEX hr_complex
109#include "TMPL/linear_algebra_def.h.tmpl"
110#include "TMPL/linear_algebra_reduction.h.tmpl"
111#include "TMPL/linear_algebra_base_operations.h.tmpl"
112#include "TMPL/linear_algebra_base.h.tmpl"
113
114#define _FIELD_TYPE suNg_av_field
115#define _REAL double
116#define _COMPLEX hr_complex
117#include "TMPL/linear_algebra_def.h.tmpl"
118#include "TMPL/linear_algebra_reduction.h.tmpl"
119#include "TMPL/linear_algebra_base_operations.h.tmpl"
120#include "TMPL/linear_algebra_base.h.tmpl"
121
122#define _FIELD_TYPE gtransf
123#define _REAL double
124#define _COMPLEX hr_complex
125#include "TMPL/linear_algebra_def.h.tmpl"
126#include "TMPL/linear_algebra_reduction.h.tmpl"
127#include "TMPL/linear_algebra_base_operations.h.tmpl"
128#include "TMPL/linear_algebra_base.h.tmpl"
129
130#define _FIELD_TYPE ldl_field
131#define _REAL double
132#define _COMPLEX hr_complex
133#include "TMPL/linear_algebra_def.h.tmpl"
134#include "TMPL/linear_algebra_base.h.tmpl"
135
136#define _FIELD_TYPE clover_term
137#define _REAL double
138#define _COMPLEX hr_complex
139#include "TMPL/linear_algebra_def.h.tmpl"
140#include "TMPL/linear_algebra_reduction.h.tmpl"
141#include "TMPL/linear_algebra_base_operations.h.tmpl"
142#include "TMPL/linear_algebra_base.h.tmpl"
143
144#define _FIELD_TYPE clover_force
145#define _REAL double
146#define _COMPLEX hr_complex
147#include "TMPL/linear_algebra_def.h.tmpl"
148#include "TMPL/linear_algebra_reduction.h.tmpl"
149#include "TMPL/linear_algebra_base_operations.h.tmpl"
150#include "TMPL/linear_algebra_base.h.tmpl"
151
152#define _FIELD_TYPE staple_field
153#define _REAL double
154#define _COMPLEX hr_complex
155#include "TMPL/linear_algebra_def.h.tmpl"
156#include "TMPL/linear_algebra_reduction.h.tmpl"
157#include "TMPL/linear_algebra_base_operations.h.tmpl"
158#include "TMPL/linear_algebra_base.h.tmpl"
159
160#undef _DECLARE_LINA_HEADER
161
162#ifdef __cplusplus
163}
164#endif
165#endif
Type definitions and macros for complex numbers.