473,398 Members | 2,335 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,398 software developers and data experts.

STL algorithm problem vector<vector<double> > and find

Hi

I'm trying to implement a vector of vectors where find can be used to
find a vector<double> in the vectors of vectors, that is hard to
understand i guess.
What I mean is that I got a vector foo containing vectors of the size
3. I then want to compare a vector<double> of size 3 (coord) with foo to find
a sequence of elements in foo that equals coord. However, when I try
this it returns when just one of the element of coord equals one
element in foo.

I just can't figure this out, is it possible to do this in any way ?
Example of what I want:

vector<double> coord(3,1);
vector<vector<double> > foo;
//fill foo with coordinates .......
vector<vector<double> >::iterator findIte =
find(foo.begin(),foo.end(),coord);
an example of foo:
1 1 0
0 0 1
0 0 2
1 1 1 <------- coord = (1 1 1), this is where findIte should point
1 0 1
1 0 0

I hope it makes a little sense what i'm trying to do.

Best Regards

Dennis

Jul 22 '05 #1
1 2243
Dennis <dl*******@control.auc.dk> writes:
I hope it makes a little sense what i'm trying to do.


My mistake it was just my f.... debug code that didn't work as
expected, everything is as it should be.

Dennis
Jul 22 '05 #2

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

Similar topics

3
by: Ivan Paganini | last post by:
Hello all. I'm trying to use a vector<double> to alocate de data that i need, and I am passing by reference to the function to receive the values. The code goes like this: //code void...
2
by: Pepijn Kenter | last post by:
Dear experts. I have a vector<float> and want to convert that to a vector<double>. I optimistically tried: #include <vector> #include <iostream> using namespace std; int main() {
20
by: Anonymous | last post by:
Is there a non-brute force method of doing this? transform() looked likely but had no predefined function object. std::vector<double> src; std::vector<int> dest; ...
10
by: bluekite2000 | last post by:
and why doesnt the standard vector have such conversion available?
14
by: LumisROB | last post by:
Is it possible to create matrixes with vector <vector <double >> ? If it is possible which is the element m23 ? You excuse but I am not an expert Thanks ROB
7
by: utab | last post by:
Dear all, I tried sth like this, compiles but segmentation fault error. In my reasoning field_values holds a vector<double> but when I tried, I understood that it is not the case :-). ...
9
by: richard_lavoie | last post by:
Hi, I have something like this: vector<floatvec1; and I want to cast it, so I use vector vec2<double= static_cast< vector<double(vec1); I always become a error: syntax error before `>'...
32
by: T. Crane | last post by:
Hi, I'm struggling with how to initialize a vector<vector<double>> object. I'm pulling data out of a file and storing it in the vector<vector<double>object. Because any given file will have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.