> 1. How can we determine if a gsl matrix is free or not?
Not to confident in being useful... but I'll try.  A gsl_matrix has a data
pointer, a block pointer, and an owner flag.  If the owner flag is 1, then the
block pointer is assumed to be valid, and should be freed (using gsl_block_free)
when the matrix is freed.  gsl_block_free calls free() on *its* data pointer,
not the matrix data pointer, which releases the big block of doubles back to the
OS.  The matrix data pointer should not, in general, be freed.

Of course, if the matrix structure is free itself, then it doesn't make sense to
accesses any of these variables.

> 2. Does gsl_matrix_swap_rows work by copying memory or by some other
> (possibly similar to pointer in spirit) mechanism.
It copies.  The big differences between C matrices and gsl matrices is that the
gsl_matrix assumes that each row is in a certain physical location in memory,
relative to the first row.  This makes many operations fast and easy, but
row-swapping isn't one of them.

-- 
James Bergstra
http://www-etud.iro.umontreal.ca/~bergstrj



_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to