0

I have written a lot of my code using the gsl_vector type from the GSL library. I have created a 3D matrix by simply using vector< vector <gsl_vector * > >. In fact, theoretically one can use any vector class in the inner template: vector< vector < VEC > >, one doesn't necessarily need a pointer, but I would like to avoid making this change for the present.

However, I would like to avoid using the std::vector class in order to avoid the additional overhead it causes, see this answer. Can anyone suggest a convenient way to do this?

NB: I need gsl_vector also to perform BLAS operations.

SUGGESTION: Use vector<gsl_matrix*> and vector views.

Community
  • 1
  • 1
Plamen
  • 650
  • 1
  • 8
  • 27

1 Answers1

0

What about allocating a 2D array of pointers to gsl_vectors. See this answer https://stackoverflow.com/a/1768382/3146587 for an example.

Community
  • 1
  • 1
user3146587
  • 4,250
  • 1
  • 16
  • 25