Generated on Sat Feb 7 2015 02:01:38 for Gecode by doxygen 1.8.9.1
IndSet Class Reference

Example: Independent sets in a graph More...

Public Member Functions

 IndSet (const SizeOptions &opt)
 Actual model. More...
 
 IndSet (bool share, IndSet &s)
 Constructor for cloning s. More...
 
virtual Spacecopy (bool share)
 Copy during cloning. More...
 
virtual void print (std::ostream &os) const
 Print solution. More...
 
virtual IntVar cost (void) const
 Return solution cost. More...
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (void)
 Default constructor. More...
 
 ScriptBase (bool share, ScriptBase &e)
 Constructor used for cloning. More...
 
virtual void compare (const Space &, std::ostream &os) const
 Compare with s. More...
 

Protected Attributes

const Graphg
 Graph used More...
 
BoolVarArray v
 Whether vertex included in independent set. More...
 
IntVar k
 How many elements has indipendent set. More...
 

Related Functions

(Note that these are not member functions.)

int main (int argc, char *argv[])
 Main-function. More...
 

Graph specification for independent sets

const int e_20_10 []
 
const Graph g_20_10 (20, 10, e_20_10)
 
const int e_40_20 []
 
const Graph g_40_20 (40, 20, e_40_20)
 

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
static std::ostream & select_ostream (const char *name, std::ofstream &ofs)
 Choose output stream according to name. More...
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

Detailed Description

Example: Independent sets in a graph

Definition at line 84 of file ind-set.cpp.

Constructor & Destructor Documentation

IndSet::IndSet ( const SizeOptions opt)
inline

Actual model.

Definition at line 94 of file ind-set.cpp.

IndSet::IndSet ( bool  share,
IndSet s 
)
inline

Constructor for cloning s.

Definition at line 107 of file ind-set.cpp.

Member Function Documentation

virtual Space* IndSet::copy ( bool  share)
inlinevirtual

Copy during cloning.

Definition at line 113 of file ind-set.cpp.

virtual void IndSet::print ( std::ostream &  os) const
inlinevirtual

Print solution.

Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.

Definition at line 118 of file ind-set.cpp.

virtual IntVar IndSet::cost ( void  ) const
inlinevirtual

Return solution cost.

Definition at line 123 of file ind-set.cpp.

Friends And Related Function Documentation

const int e_20_10[]
related
Initial value:
= {
0, 4, 2,12, 12,14, 18,19, 7,10,
9,12, 5,11, 6,15, 3,18, 7,16
}

Definition at line 60 of file ind-set.cpp.

const Graph g_20_10(20, 10, e_20_10)
related
const int e_40_20[]
related
Initial value:
= {
21,30, 11,30, 19,38, 20,25, 11,24,
20,33, 8,39, 4, 5, 6,16, 5,32,
0, 9, 5,24, 25,28, 36,38, 14,20,
19,25, 11,22, 13,30, 7,36, 15,33
}

Definition at line 67 of file ind-set.cpp.

const Graph g_40_20(40, 20, e_40_20)
related
int main ( int  argc,
char *  argv[] 
)
related

Main-function.

Definition at line 133 of file ind-set.cpp.

Member Data Documentation

const Graph& IndSet::g
protected

Graph used

Definition at line 87 of file ind-set.cpp.

BoolVarArray IndSet::v
protected

Whether vertex included in independent set.

Definition at line 89 of file ind-set.cpp.

IntVar IndSet::k
protected

How many elements has indipendent set.

Definition at line 91 of file ind-set.cpp.


The documentation for this class was generated from the following file: