[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] matrix and matrix views
From: |
Brian Gough |
Subject: |
Re: [Help-gsl] matrix and matrix views |
Date: |
Fri, 27 Aug 2004 17:31:03 +0100 |
Joakim Hove writes:
> o Would it not be simpler to let gsl_matrix_submatrix return a
> pointer to a matrix struct which only had shared memory?
If I remember correctly, the problem is that this doesn't preserve
"const" property. Originally I did use the method you suggest but it
broke down when I wanted to have constant vectors.
> o Can I let m_part_view go out of scope and continue to use m_part,
> or will m_part then loose it's size/stride information?
You must keep the view itself in scope, otherwise m_part will point to
undefined memory (it is a pointer to an element of the view struct).
>From a safety point of view, it would be sensible to always write
&view.matrix.
--
Brian Gough
Network Theory Ltd,
Commercial support for GSL --- http://www.network-theory.co.uk/gsl/