473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

vector<vector<Point3D> >

Hi everyone,

Here about what it is.

vector<vector<Point3D> > pVector0;

pVector0 is a vector of vector of 3D points.

pVector0[i] is a vector of 3D points.

pVector0[i][j] is a 3D point.

I wanted to add a point pt3D to the m vector in pVector0, I have
write these two instructions which belong to a C++ program.

vector< vector<Vector3D> > pVector0;
pVector0[m].push_back(pt3D);

I have as error message: Segmentation fault (core dumped)

Could anyone give me suggestions?

Thanks!

hannibal
Jul 23 '05 #1
6 4194
ha************@yahoo.fr wrote:
Here about what it is.

vector<vector<Point3D> > pVector0;

pVector0 is a vector of vector of 3D points.

pVector0[i] is a vector of 3D points.

pVector0[i][j] is a 3D point.

I wanted to add a point pt3D to the m vector in pVector0, I have
write these two instructions which belong to a C++ program.

vector< vector<Vector3D> > pVector0;
pVector0[m].push_back(pt3D);

I have as error message: Segmentation fault (core dumped)

Could anyone give me suggestions?


What's the size of 'pVector0'? You're trying to access the m-th
element of it, do you know if it even exists?

V
Jul 23 '05 #2
Victor Bazarov wrote:
ha************@yahoo.fr wrote:
Here about what it is.

vector<vector<Point3D> > pVector0;

pVector0 is a vector of vector of 3D points.

pVector0[i] is a vector of 3D points.

pVector0[i][j] is a 3D point.

I wanted to add a point pt3D to the m vector in pVector0, I have
write these two instructions which belong to a C++ program.

vector< vector<Vector3D> > pVector0;
pVector0[m].push_back(pt3D);

I have as error message: Segmentation fault (core dumped)

Could anyone give me suggestions?

What's the size of 'pVector0'? You're trying to access the m-th
element of it, do you know if it even exists?

V

The size of pVector0 is not known.
I wanted to add m empty vectors to the vector and to add the point pt3D
to m vector.

vector< vector<Vector3D> > pVector0;
pVector0.insert(pVector0.end(),m);
pVector0[m].push_back(pt3D);
Jul 23 '05 #3
ha************@yahoo.fr wrote:
Victor Bazarov wrote:
ha************@yahoo.fr wrote:
Here about what it is.

vector<vector<Point3D> > pVector0;

pVector0 is a vector of vector of 3D points.

pVector0[i] is a vector of 3D points.

pVector0[i][j] is a 3D point.

I wanted to add a point pt3D to the m vector in pVector0, I have
write these two instructions which belong to a C++ program.

vector< vector<Vector3D> > pVector0;
pVector0[m].push_back(pt3D);

I have as error message: Segmentation fault (core dumped)

Could anyone give me suggestions?
What's the size of 'pVector0'? You're trying to access the m-th
element of it, do you know if it even exists?

V


The size of pVector0 is not known.


REALLY? Have you tried calling pVector0.size()?
I wanted to add m empty vectors to the vector and to add the point pt3D
to m vector.
If you add m vectors to the vector, what's their indices?

vector< vector<Vector3D> > pVector0;
pVector0.insert(pVector0.end(),m);
pVector0[m].push_back(pt3D);


V
Jul 23 '05 #4
ha************@yahoo.fr wrote:
Hi everyone,

Here about what it is.

vector<vector<Point3D> > pVector0;

pVector0 is a vector of vector of 3D points.

pVector0[i] is a vector of 3D points.

pVector0[i][j] is a 3D point.

I wanted to add a point pt3D to the m vector in pVector0,
Are you sure this 'm' vector exists?
I have
write these two instructions which belong to a C++ program.

vector< vector<Vector3D> > pVector0;
pVector0[m].push_back(pt3D);


If that's the only 2 lines you wrote, there's a problem. The vector is
empty and you are trying to access it's mth element. Illegal.

If you want to add a point, you first need to add a vector of points.

std::vector<Vector3D> vector_of_points;
vector_of_points.push_back(a_point);

pVector0.push_back(vector_of_points);

Remember: pVector0 is a vector of vectors of points.
Jonathan

Jul 23 '05 #5
Victor Bazarov wrote:
ha************@yahoo.fr wrote:
Victor Bazarov wrote:
ha************@yahoo.fr wrote:

Here about what it is.

vector<vector<Point3D> > pVector0;

pVector0 is a vector of vector of 3D points.

pVector0[i] is a vector of 3D points.

pVector0[i][j] is a 3D point.

I wanted to add a point pt3D to the m vector in pVector0, I have
write these two instructions which belong to a C++ program.

vector< vector<Vector3D> > pVector0;
pVector0[m].push_back(pt3D);

I have as error message: Segmentation fault (core dumped)

Could anyone give me suggestions?


What's the size of 'pVector0'? You're trying to access the m-th
element of it, do you know if it even exists?

V

The size of pVector0 is not known.

REALLY? Have you tried calling pVector0.size()?


I have tried calling pVector0.size(),
pList0.size() = 0
I wanted to add m empty vectors to the vector and to add the point
pt3D to m vector.

If you add m vectors to the vector, what's their indices?


I added m vectors at the end of the vector.


vector< vector<Vector3D> > pVector0;
pVector0.insert(pVector0.end(),m);
pVector0[m].push_back(pt3D);

V

Jul 23 '05 #6
Jonathan Mcdougall wrote:
ha************@yahoo.fr wrote:
Hi everyone,

Here about what it is.

vector<vector<Point3D> > pVector0;

pVector0 is a vector of vector of 3D points.

pVector0[i] is a vector of 3D points.

pVector0[i][j] is a 3D point.

I wanted to add a point pt3D to the m vector in pVector0,

Are you sure this 'm' vector exists?

I have
write these two instructions which belong to a C++ program.

vector< vector<Vector3D> > pVector0;
pVector0[m].push_back(pt3D);

If that's the only 2 lines you wrote, there's a problem. The vector is
empty and you are trying to access it's mth element. Illegal.

If you want to add a point, you first need to add a vector of points.

std::vector<Vector3D> vector_of_points;
vector_of_points.push_back(a_point);

pVector0.push_back(vector_of_points);

Remember: pVector0 is a vector of vectors of points.
Jonathan

Thank you for your guys idea.

hannibal
Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
0
by: Arne Schirmacher | last post by:
I want to display a MySQL database field that can contain HTML markup. If I use <esql:get-string> then I get all of the database field, but all tags are escaped which is not what I want. If I use...
34
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some...
11
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom,...
2
by: bissatch | last post by:
Hi, I am currently writing a simple PHP program that uses an XML file to output rows for a 'Whats New' page. Once written, I will only require updating the XML file and any pages that use the...
0
by: vdex42 | last post by:
Apologies if this has been asked before, but I haven't been able to find the answer to this yet: My problem is that .NET will not allow me to insert escaped '>' characters (i.e. &gt;) within the...
2
by: santaji | last post by:
I am getting xml string in request attribute in following format &lt;files&gt; &lt;file&gt; &lt;filename&gt;somefile.ext&lt;/filename&gt; &lt;/file&gt; &lt;files&gt; the above string I want to convert to tags. expected...
1
by: VaidehiPawar | last post by:
I am a beginner level in xml..my output page does not convert &gt &lt it shows something like this " &lt;b&gt;Location.&lt;/b&gt;&lt;br /&gt; &lt;UL&gt;&lt;LI&gt;Park Central New York " can anyone help? here is my code ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.