Fastor
Fastor copied to clipboard
Binary operators on tensor views
Not sure if the below is supposed to work or not, but seems strange that there is inconsistent behavior between operator += and operator +. Should this work? If not is there an easy way to get the desired behavior of taking a slice of a higher dimensional tensor and adding to a lower dimensional tensor?
Fastor::Tensor<double,2,2,2> test1 = 1;
Fastor::Tensor<double,2,2> test2 = 3;
test2 += test1(1,Fastor::all,Fastor::all); // <- works fine
test2 = test2 + test1(1,Fastor::all,Fastor::all); // <- compiles but throws runtime_error EXPRESSION SHAPE MISMATCH
This is certainly a bug. I will have a look. Thanks for reporting.