tree modifications
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@512 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
0d2b55437a
commit
61c0424eed
47 changed files with 395 additions and 458 deletions
|
|
@ -1,43 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route_valid.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003-2006
|
||||
|
||||
/* LICENCE TEXT
|
||||
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#include "route_valid.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
bool valid (Route & __route)
|
||||
{
|
||||
|
||||
std::vector<unsigned int> t;
|
||||
t.resize(__route.size());
|
||||
|
||||
for (unsigned int i = 0 ; i < __route.size () ; i ++)
|
||||
{
|
||||
t [i] = 0 ;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0 ; i < __route.size () ; i ++)
|
||||
{
|
||||
t [__route [i]] ++ ;
|
||||
}
|
||||
|
||||
for (unsigned int i = 0 ; i < __route.size () ; i ++)
|
||||
{
|
||||
if (t [i] != 1)
|
||||
{
|
||||
t.clear();
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
t.clear();
|
||||
return true ; // OK.
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue