M
Martin Magnusson
I want to create a templated class (templated over the number of
dimensions) of N-dimensional tensors. With N=1 you get a vector, N=2
you get an ordinary matrix, N=3 you get a 3D tensor, etc.
Is there a good way to do this, ensuring constant-time access?
Constant-time insertion and deletion wouldn't be necessary.
I suppose that hash_map with an N-dimensional vector as its key_value
would do the job, but it would of course not be as efficient as
implementing specialized classes for the dimensionalities I actually need.
dimensions) of N-dimensional tensors. With N=1 you get a vector, N=2
you get an ordinary matrix, N=3 you get a 3D tensor, etc.
Is there a good way to do this, ensuring constant-time access?
Constant-time insertion and deletion wouldn't be necessary.
I suppose that hash_map with an N-dimensional vector as its key_value
would do the job, but it would of course not be as efficient as
implementing specialized classes for the dimensionalities I actually need.