J
jski
First:
$ g++ --version
g++ (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)
I'm using the following declarations:
struct point
{
double alpha, beta;
double Force;
point( double a, double b, double f ) : alpha(a), beta(b), Force(f)
{}
};
struct node
{
int XYZ;
vector<point> pt;
};
map<int, node> AeroDOF2;
I'm looping thru a file to populate AeroDOF2:
for( i=1; i<=AlphaBetaBlocks; ++i)
for( j=1; j<=No_DOF; ++j )
{
AEROfile >> AeroDOF[j] >> alpha >> beta >> Force[j] >>
XYZ[j] >> X[j] >> Y[j] >> Z[j] >> Node[j];
AeroDOF2[ AeroDOF[j] ].XYZ = XYZ[j];
AeroDOF2[ AeroDOF[j] ].pt.push_back( point( alpha, beta,
Force[j] ) );
}
After successful looping for awhile, I get to j == 110 and die with a
SEG FAULT at:
AeroDOF2[ AeroDOF[j] ].XYZ = XYZ[j];
where:
AeroDOF[110] ==415 and XYZ[110] == 1 (according to GDB)
Is there a problem with my use of the STL map template?
---John
$ g++ --version
g++ (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)
I'm using the following declarations:
struct point
{
double alpha, beta;
double Force;
point( double a, double b, double f ) : alpha(a), beta(b), Force(f)
{}
};
struct node
{
int XYZ;
vector<point> pt;
};
map<int, node> AeroDOF2;
I'm looping thru a file to populate AeroDOF2:
for( i=1; i<=AlphaBetaBlocks; ++i)
for( j=1; j<=No_DOF; ++j )
{
AEROfile >> AeroDOF[j] >> alpha >> beta >> Force[j] >>
XYZ[j] >> X[j] >> Y[j] >> Z[j] >> Node[j];
AeroDOF2[ AeroDOF[j] ].XYZ = XYZ[j];
AeroDOF2[ AeroDOF[j] ].pt.push_back( point( alpha, beta,
Force[j] ) );
}
After successful looping for awhile, I get to j == 110 and die with a
SEG FAULT at:
AeroDOF2[ AeroDOF[j] ].XYZ = XYZ[j];
where:
AeroDOF[110] ==415 and XYZ[110] == 1 (according to GDB)
Is there a problem with my use of the STL map template?
---John