At Thu, 4 Jan 2007 17:59:44 -0500, Michael Braun wrote: > > I am having some trouble working with vector views, and I am hoping someone > can point me in the right direction (I am a relatively new C programmer, so I > am still learning some new tricks). > > Below is a function that computes the log density of a multivariate normal > distribution using gsl vectors and matrices. The eventual result is correct > (i.e., consistent with other sources). The problem is that the matrix sigma > is changed in the calling function (the top left corner element changes to > something else). I find this odd, since I never change any part of sigma in > this function. > > In addition, I draw your attention to the two fprintf statements in the lines > marked A and B. If both are commented out, there is no problem other than > what I just described. If the fprintf statement is inserted at line A *or > before*, again there is no additional problem. However, if I call the > fprintf function at line B or later, I get a segmentation fault with the > message > > *** caught segfault *** > address 0x4, cause 'memory not mapped' >
Hello, For memory problems I'd recommend the testing the code with the 'valgrind' memory checker. e.g. $ valgrind --tool=memcheck a.out It should help in tracking down any errors. -- best regards, Brian Gough (GSL Maintainer) Network Theory Ltd, Commercial support for GSL --- http://www.network-theory.com/gsl/ _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
