[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Matrix initialisation
From: |
Søren Hauberg |
Subject: |
Re: Matrix initialisation |
Date: |
Wed, 29 Dec 2010 00:13:55 +0100 |
tir, 28 12 2010 kl. 22:06 +0100, skrev Jaroslav Hajek:
> On Mon, Dec 27, 2010 at 4:53 PM, Søren Hauberg <address@hidden> wrote:
> > Hi
> >
> > I just got a bug report for the image package, where the fix boiled down
> > to changing (in C++)
> >
> > Matrix J (bins_length, thetas_length);
> >
> > to
> >
> > Matrix J (bins_length, thetas_length, 0.0);
> >
> > i.e. initialise the matrix to contain zeros. I always thought that if
> > you did not provide an initial value when constructing a matrix, it
> > would default to zero. Has this ever been the case or is it just
> > something I made up?
> >
>
> The latter, probably. As far as I remember, you always get an
> uninitialized array using the first form.
Ok. I'll just have to check the various functions I have all around and
see if they behave the way they should.
Thank
Søren