Re: [Flightgear-devel] Arrays of doubles

2004-04-14 Thread Gerhard Wesp
On Fri, Apr 09, 2004 at 08:03:49AM -0500, Jon Berndt wrote: class. All I want right now is how do I allocate storage for a 2 dimensional array of doubles, so that I can use the standard accessor operators: myDouble = Data[n][m]; If you insist on the [][] syntax, I'd strongly recommend a

[Flightgear-devel] Arrays of doubles

2004-04-09 Thread Jon Berndt
Is there a better way to allocate storage for an array than this: double** Allocate(void) { Data = new double*[nRows+1]; for (int r=0; r=nRows; r++) { Data[r] = new double[nCols+1]; for (int c=0; c=nCols; c++) { Data[r][c] = 0.0; } } return Data; }

Re: [Flightgear-devel] Arrays of doubles

2004-04-09 Thread Mathias Fröhlich
On Freitag, 9. April 2004 14:26, Jon Berndt wrote: Is there a better way to allocate storage for an array than this: double** Allocate(void) { Data = new double*[nRows+1]; for (int r=0; r=nRows; r++) { Data[r] = new double[nCols+1]; for (int c=0; c=nCols; c++) {

RE: [Flightgear-devel] Arrays of doubles

2004-04-09 Thread Jon Berndt
On Freitag, 9. April 2004 14:26, Jon Berndt wrote: Is there a better way to allocate storage for an array than this: double** Allocate(void) { Data = new double*[nRows+1]; for (int r=0; r=nRows; r++) { Data[r] = new double[nCols+1]; for (int c=0; c=nCols; c++) {

Re: [Flightgear-devel] Arrays of doubles

2004-04-09 Thread Mathias Fröhlich
On Freitag, 9. April 2004 14:39, Jon Berndt wrote: I am afraid it is much simpler than that: all I need is a 2 dimensional array, n X m. For such a simple array it is best to use data = new double[n*m] and have access functions: double Entry(unsigned int i,unsigned int j) const { return

RE: [Flightgear-devel] Arrays of doubles

2004-04-09 Thread Jon Berndt
For such a simple array it is best to use data = new double[n*m] and have access functions: double Entry(unsigned int i,unsigned int j) const { return data[(i-1)*n+j-1]; } double Entry(unsigned int i,unsigned int j) { return data[(i-1)*n+j-1]; } Yes, this may come at some time. I am

Re: [Flightgear-devel] Arrays of doubles

2004-04-09 Thread Mathias Fröhlich
On Freitag, 9. April 2004 15:03, Jon Berndt wrote: I am debuggin the additions to the Table class. All I want right now is how do I allocate storage for a 2 dimensional array of doubles, so that I can use the standard accessor operators: myDouble = Data[n][m]; ?? Hmm, two

RE: [Flightgear-devel] Arrays of doubles

2004-04-09 Thread Jon Berndt
I'll send you the problem offline. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Mathias Fröhlich Sent: Friday, April 09, 2004 8:16 AM To: FlightGear developers discussions Subject: Re: [Flightgear-devel] Arrays of doubles On Freitag, 9. April

Re: [Flightgear-devel] Arrays of doubles

2004-04-09 Thread Mathias Fröhlich
On Freitag, 9. April 2004 15:31, Jon Berndt wrote: I'll send you the problem offline. Ok. Greetings Mathias -- Mathias Fröhlich, email: [EMAIL PROTECTED] ___ Flightgear-devel mailing list [EMAIL PROTECTED]