forked from edrosten/TooN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_data_functions.awk
More file actions
35 lines (28 loc) · 834 Bytes
/
Copy pathmake_data_functions.awk
File metadata and controls
35 lines (28 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
BEGIN{
N=100
print "//Mechanically generate code. Do not edit."
print "namespace TooN {"
print "//modify make_data.awk and run make internal/data_functions.hh"
for(i=1; i <= N; i++)
{
printf "inline Operator<Internal::Data<" i ", double> > Data(double x1"
for(j=2; j<= i; j++)
printf ", double x"j
print "){"
print " Operator<Internal::Data<"i", double> > d;"
for(j=1; j<= i; j++)
print " d.vals["j-1"] = x"j";"
print " return d;"
print "}"
printf "template<typename Precision> inline Operator<Internal::Data<" i ", Precision> > Data(const Precision& x1"
for(j=2; j<= i; j++)
printf ", const Precision& x"j
print "){"
print " Operator<Internal::Data<"i", Precision> > d;"
for(j=1; j<= i; j++)
print " d.vals["j-1"] = x"j";"
print " return d;"
print "}"
}
print "}"
}