windmaomao
02-13-2003, 03:20 PM
actually i don't see any good using matrix and vector in nr. Instead in my opinion, they should use a wrapper matrix/vector class internally and leave the calling procedure like this
void Spline(int n, DP * input, DP * output)
{
whatever internal vector you want to wrap on the input or output data;
TNT a(input); // just an example
a[1]
}
This gives the user a lot flexiablility and i don't see lot penety here.
For example, i have a data set *x[12], if i want to call nr, i have to first use TNT to wrap it, then use nr vector to wrap it. Or i can just copy the data to nr vector which i don't want to do at any circumstance. And i don't know why nr vector is not designed as a wrapper. ( The way they're doing is neither fortran style or c++ style, very complicated)
OOP or generic code is good, but it has to be flexible; At least i don't feel STL vector is flexible enough for scientific computing. Vector, a math word, what's the point if it can't be used for math stuff in general.
void Spline(int n, DP * input, DP * output)
{
whatever internal vector you want to wrap on the input or output data;
TNT a(input); // just an example
a[1]
}
This gives the user a lot flexiablility and i don't see lot penety here.
For example, i have a data set *x[12], if i want to call nr, i have to first use TNT to wrap it, then use nr vector to wrap it. Or i can just copy the data to nr vector which i don't want to do at any circumstance. And i don't know why nr vector is not designed as a wrapper. ( The way they're doing is neither fortran style or c++ style, very complicated)
OOP or generic code is good, but it has to be flexible; At least i don't feel STL vector is flexible enough for scientific computing. Vector, a math word, what's the point if it can't be used for math stuff in general.