How would you store a vector of N dimensions in a datatable in C#?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For truly n-dimensional stuff, you’re probably going to have to drop to simpler concepts – maybe a multi-dimensional array (
T[,...,]).Things like jagged arrays (
T[]...[]) or wrappers usingList<T>etc are feasible if the number of dimensions is known and constant (but > 1).An example using an
Arrayof unknown dimension:But obviously it is easier if the dimensions are known:
The problem with multi-dimension arrays is that they can quickly get too big for the CLR to touch… which is where jagged arrays or other wrappers come in handy (by splitting it into multiple smaller objects) – but making construction much harder:
Any of these can usually be wrapped inside a class, which is probably the sensible approach.