Replies: 1 comment 3 replies
-
I think we should follow what the C++ standard does with the subscript operator( The subscript operator does not check bounds, but, on the other hand, method In our case, C.at(1,1) = 3; // bound checked
C(1,1) = 3; // no bound checked; equivalent to C[i] This kind of optimization could be very helpful inside a hot loop. Otherwise, we have to incur the cost of a bound check that is very bad for high-performant code. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now index accessing is performed using the
at
member function in tensor e.g. in tensor_dynamic, see also in example.Is it possible to overload
operator()
for this purpose? Note thatoperator()
will also be used for creating subtensors.We could also use
operator[]
for accessing single indices and multi-indices.This will be again closer to a Matlab or Octave or R notation.
Beta Was this translation helpful? Give feedback.
All reactions