At Tue, 22 Jan 2008 23:22:51 -0500, Michael Braun wrote: > For example, is this a legal representation: > > gsl_matrix * A = gsl_matrix_alloc(3,6); > gsl_matrix_view V1 = gsl_matrix_submatrix(A,0,0,2,6); > gsl_matrix_view V2 = gsl_matrix_submatrix(A,0,0,2,4); // the views overlap > gsl_matrix_memcpy(&V1.matrix,X); / X is a 2x6 matrix > > And then, could I set, get and memcpy to &V1.matrix and &V2.matrix freely? > Or, once I create V2, does V1 disappear?
There can be multiple views of the same matrix, it is not a problem. > I have a matrix A, and a view V on a submatrix of A. I then swap two > columns of A. Later, I copy another submatrix B into V (and, in turn, > changing values in A). Is V a view on the same column indices of A as > before? Is it possible that copying B into V after the swap in A is causing > some kind of memory problem? Using gsl functions alone should not cause any error, they all verify that the (sub)matrices are valid when they are called. To find unexplained segmentation faults: 1. eliminate compiler warnings (http://www.network-theory.co.uk/docs/gccintro/gccintro_10.html) 2. try runing the program under "valgrind" (www.valgrind.org) -- Brian Gough _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
