Hello everyone, I wanted to ask a question.
I am currently getting an array of doubles containing matrix = [magnitudes ; angles] where
I have different cases (separated by spaces and “;”):
I would like to be able to make exceptions according to the size of my array (or according to its number of columns) to retrieve information, for example if I have case 1 where the size of the matrix is M1, I only retrieve X1, if case 2 where my matrix is of size M2 get X1 and Y2, if case 3 where the size of the matrix is M3 get x1 y1 z1.
just use if-else, naively Matrix all have the same type information (unless you do some hackery to propagate this information but it’s probably not worth it)
You might want to have these cases as different types, and then dispatch on the appropriate type.
For example in this case, explicit types for 1D2D or 3D, or a single type parametrized by D, as in Point{D}.
This could pay for itself in future with efficiency when this D is known at compile type.