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
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;
}
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++) {
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++) {
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
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
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
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
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]