On Sun, Jan 5, 2020, at 07:15 CST, "A.Z Ihsan" <
jurna...@gmail.com> wrote:
> Tensor<1, 3> b();
If you write this then you declare a function "b" returning a
Tensor<1,3>. Declare the tensor without the parentheses:
Tensor<1, 3> b;
You can access individual elements of the tensor via operator[]:
b[0] = 1;
b[1] = 1;
b[2] = 0;
And you can do meaningful mathematical tensor operations. Including,
scaling a tensor
auto a = 5. * b;
Adding two tensors together:
auto c = a + b;
Taking the inner product:
auto k = a * b;
etc.
Best,
Matthias