|
From: | Brian Gough |
Subject: | Re: [Help-gsl] Octave-like indexing with the GSL |
Date: | Thu, 16 Nov 2006 17:40:24 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.6) Gecko/20060815 SeaMonkey/1.0.4 |
Jordi Gutierrez Hermoso wrote:
I was expecting to find just such a method as a matrix view with a clever little hack with the matrix's tda, but I cannot figure out how to do this. Should I just use a number of for-loops with row or column views, or use one of the gsl_matrix view functions for arrays, or is there a more clever intended way of accomplishing this?
You will have to access the memory directly for that access pattern. The gsl_matrix type is designed so that it can always be passed to a BLAS function, which means that the rows of the matrix must have a "stride" of 1.
(Btw, I don't think I understand either the need for a gsl_matrix_view struct, if all it holds is a pointer to a gsl_matrix; is this simply to emphasise syntactically that the view owns the same data as another matrix?)
The implementation allows views of both const and non-const objects without casting. If we had only non-const objects the extra "indirection" wouldn't be necessary.
-- Brian Gough (GSL Maintainer) Network Theory Ltd, Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/
[Prev in Thread] | Current Thread | [Next in Thread] |