|
From: Alfred P. R. <al...@ya...> - 2005-10-07 00:30:20
|
Hi Hind,
I'm working on an imaging application that uses structure arrays of sizes of 22K elements to well over 4M depending on image size. My problem usually occurs when mapping an array of floating point elements to array indicies.
Usually, for algorithmic reasons, an array element is in the form vect[i]={x,y,z}, double precision. However for screen plotting I need an array in the form vect[x][y] = z. It is in this conversion that most of my access violations or segment errors occur.
If I have an array of 3-vectors (x,y,z) and then preform a 3d transform (i.e. rotation on multiple axes), occasionally the resultant x and y coordinates will exceed the declared array size. My correction to this is to scan the resultant array of 3-vectors for maximum transformed x and y values, then generate a new array that has those maximum sizes. A further benefit is that it condenses a 3-vector array element of 24 bytes (3 doubles) to an x and y indexed array element of 8 bytes (1 double). Then I can delete[] the original 3-vector array.
Hind Fadel <the...@ho...> wrote:
U're right, probably arrays because i'm using a lot of arrays (this is a
simulation code) but it seems really bizzare :
for the same problem if i use arrays with [20][20] there's no problem but if
i use [40][40] i had the exception!!
>Date: Thu, 6 Oct 2005 23:33:45 +0200 (CEST)
>
>Bad programming - most probably either references to a NULL pointer,
>access to an uninitialized pointer or access outside the bounds of an
>array.
>
>In this case I think you are sending bad parameters to a Win32 API.
>
>/Per W
>
>On Thu, 6 Oct 2005, Hind Fadel wrote:
>
> > Hi everybody
> >
> > I'm developping a big code, sometimes it works but sometimes I had this
> > error : " Unhandled exception (NTDLL) : 0xC0000005 : Access Violation".
> >
> > Does anybody knows wath's the matter???!!
> >
<snip>
Alfred P. Reaud
|