View Single Post
Old 07-06-2005, 01:05 PM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
How about a loop through your matrix, checking every 2.nd dimension item up against your comparison 2.nd dimesnion item.
Using the bool operator== (const container& c1, const container& c2);, it is described as:
Code:
 Performing a comparison one vector to another takes linear time.
Two `containers` are equal if:

   1. Their size is the same, and
   2. Each member in location i in one vector is equal to the
       member in location i in the other vector.

Comparisons among vectors are done lexicographically.
As described in the C++ reference
It will require a nested loop, but you could do a quick check uppon starting the outer loop, to make sure the item run through the inner loop will allways contain the least items, keeping that as fast as possible.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote