added source set functions

This commit is contained in:
Christina Vaz 2018-05-25 23:43:59 -04:00
parent aba4792ce7
commit b58b22e7cc
1 changed files with 46 additions and 9 deletions

View File

@ -17,7 +17,7 @@
// SPDX-License-Identifier: GPL-3.0+ // SPDX-License-Identifier: GPL-3.0+
// //
// //
// Author(s) : Christina Cruz, Keenan Crane, Andreas Fabri // Author(s) : Christina Vaz, Keenan Crane, Andreas Fabri
#ifndef CGAL_HEAT_METHOD_3_HEAT_METHOD_3_H #ifndef CGAL_HEAT_METHOD_3_HEAT_METHOD_3_H
#define CGAL_HEAT_METHOD_3_HEAT_METHOD_3_H #define CGAL_HEAT_METHOD_3_HEAT_METHOD_3_H
@ -93,6 +93,43 @@ namespace Heat_method_3 {
return sources.insert(vd).second; return sources.insert(vd).second;
} }
/**
*remove 'vd' from the source set, returning 'true' if 'vd' was in the set
*/
bool remove_source(vertex_descriptor vd)
{
if(sources.find(vd))
{
sources.erase(vd);
return true;
}
else
{
return false;
}
}
vertex_descriptor getSources()
{
return sources;
}
void clearSources()
{
sources.clear();
return;
}
vertex_descriptor sourcesBegin()
{
return sources.begin();
}
vertex_descriptor sourcesEnd()
{
return sources.end();
}
/** /**
* get distance from the current source set to a vertex ` vd`. * get distance from the current source set to a vertex ` vd`.
*/ */