v0.14.0
Number_test.cpp
Go to the documentation of this file.
1 #include "../../FTensor.hpp"
2 #include <iostream>
3 
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  Tensor2 t2(1, 2, 3, 4, 5, 6, 7, 8, 9);
12 
13  const Index<'i', 3> i;
14  const Index<'j'> j;
15  const Number<0> N0;
16  const Number<1> N1;
17  const Number<2> N2;
18 
19  for(int ii = 0; ii < 100000000; ii++)
20  {
21  y(i) += (x(i) + n(i) + t2(i, N0))
22  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
23  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
24  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
25  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
26  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
27  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
28  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
29  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
30  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
31  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
32  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
33  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
34  // -(x(i)+n(i)+t2(i,N0))+(x(i)+n(i)+t2(i,N0))
35  ;
36  }
37  std::cout << y(0) << " " << y(1) << " " << y(2) << std::endl;
38 }
FTensor
JSON compatible output.
Definition: Christof_constructor.hpp:6
FTensor::Tensor1< double, 3 >
main
int main()
Definition: Number_test.cpp:6
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
FTensor::Number< 0 >
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
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19