A
Akyl Tulegenov
Dear All!
I faced a problem when implementing class Tensor. The idea is
simple - give a rank as an input to produce a tensor of rank n.
But how to do it programmatically w/o the use of any "if
then" statements? At the moment I have a large number of classes
Tensor_N, which doesn't look nice, and doesn't fit to the problem I'm
trying to solve.
for rank one I need *array, for 2 **array, for 3 ***array, etc.
Is there any way to make it as a black box?
For instance, create a string beginning with n stars and use it in
the code??? A tiny code-snippet would be extremely helpful to catch the
general idea. Certainly, if it is possible at all.
Cheers.
Akyl.
I faced a problem when implementing class Tensor. The idea is
simple - give a rank as an input to produce a tensor of rank n.
But how to do it programmatically w/o the use of any "if
then" statements? At the moment I have a large number of classes
Tensor_N, which doesn't look nice, and doesn't fit to the problem I'm
trying to solve.
for rank one I need *array, for 2 **array, for 3 ***array, etc.
Is there any way to make it as a black box?
For instance, create a string beginning with n stars and use it in
the code??? A tiny code-snippet would be extremely helpful to catch the
general idea. Certainly, if it is possible at all.
Cheers.
Akyl.