v0.14.0
src
ftensor
tests
speed
example.cpp
Go to the documentation of this file.
1
#include <iostream>
2
using namespace
std
;
3
#include "../../FTensor.hpp"
4
using namespace
FTensor
;
5
6
int
main
()
7
{
8
Tensor1<double, 3>
y(0, 1, 2);
9
Tensor1<double, 3>
x(2, 3, 4);
10
Tensor1<double, 3>
n
(5, 6, 7);
11
const
Index<'i', 3>
i
;
12
13
for
(
int
j
= 0;
j
< 10000000;
j
++)
14
{
15
y(
i
) = x(
i
) +
n
(
i
);
16
x(
i
) = y(
i
) -
n
(
i
);
17
n
(
i
) =
n
(
i
) + (y(
i
) - x(
i
)) - (y(
i
) - x(
i
)) + (y(
i
) - x(
i
))
18
- (y(
i
) - x(
i
)) + (y(
i
) - x(
i
)) - (y(
i
) - x(
i
));
19
20
n
(
i
) =
n
(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
)
21
+ y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
)
22
- x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
)
23
+ y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
)
24
- x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
)
25
+ y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
)
26
- x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
)
27
+ y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
)
28
- x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
)
29
+ y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
)
30
- x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
) + y(
i
) - x(
i
)
31
// +y(i)-x(i)
32
// +y(i)-x(i)
33
// +y(i)-x(i)
34
// +y(i)-x(i)
35
// +y(i)-x(i)
36
// +y(i)-x(i)
37
// +y(i)-x(i)
38
// +y(i)-x(i)
39
// +y(i)-x(i)
40
// +y(i)-x(i)
41
// +y(i)-x(i)
42
// +y(i)-x(i)
43
// +y(i)-x(i)
44
// +y(i)-x(i)
45
// +y(i)-x(i)
46
// +y(i)-x(i)
47
// +y(i)-x(i)
48
// +y(i)-x(i)
49
// +y(i)-x(i)
50
// +y(i)-x(i)
51
// +y(i)-x(i)
52
// +y(i)-x(i)
53
// +y(i)-x(i)
54
// +y(i)-x(i)
55
// +y(i)-x(i)
56
// +y(i)-x(i)
57
// +y(i)-x(i)
58
// +y(i)-x(i)
59
;
60
61
// n(i)=(y(i)-x(i))*(y(i)-x(i))/(n(i));
62
// n(i)=(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))*(y(i)-x(i))/(n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i)*n(i));
63
}
64
cout << y(0) <<
" "
<< y(1) <<
" "
<< y(2) << endl;
65
}
FTensor
JSON compatible output.
Definition:
Christof_constructor.hpp:6
FTensor::Tensor1< double, 3 >
main
int main()
Definition:
example.cpp:6
i
FTensor::Index< 'i', SPACE_DIM > i
Definition:
hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
convert.n
n
Definition:
convert.py:82
std
Definition:
enable_if.hpp:5
j
FTensor::Index< 'j', 3 > j
Definition:
matrix_function.cpp:19
Generated by
Doxygen
1.8.17 and hosted at