Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0

Example: All-interval series More...

Public Member Functions

 AllInterval (const SizeOptions &opt)
 Actual model.
 
 AllInterval (AllInterval &s)
 Constructor for cloning e.
 
virtual Spacecopy (void)
 Copy during cloning.
 
virtual void print (std::ostream &os) const
 Print solution.
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (const Options &opt)
 Constructor.
 
 ScriptBase (ScriptBase &e)
 Constructor used for cloning.
 
virtual void compare (const Space &home, std::ostream &os) const
 Compare with s.
 

Related Symbols

(Note that these are not member symbols.)

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

Additional Inherited Members

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

Detailed Description

Example: All-interval series

An all-interval series of length $n$ is a sequence

\[
(x_0,x_1,\ldots,x_{n-1})
\]

where each $x_i$ is an integer between $0$ and $n-1$ such that the following conditions hold:

  • the $x_i$ are a permutation of $\{0,1,\ldots,n-1\}$ (that is, they are pairwise distinct and take values from $\{0,1,\ldots,n-1\}$).
  • the differences between adjacent values $(d_1,d_2,\ldots,d_{n-1})$ with $d_i=\operatorname{abs}(x_i-x_{i-1})$ form a permutation of $\{1,2,\ldots,n-1\}$.

See also problem 7 at http://www.csplib.org/.

Definition at line 62 of file all-interval.cpp.

Constructor & Destructor Documentation

◆ AllInterval() [1/2]

AllInterval::AllInterval ( const SizeOptions & opt)
inline

Actual model.

Definition at line 70 of file all-interval.cpp.

◆ AllInterval() [2/2]

AllInterval::AllInterval ( AllInterval & s)
inline

Constructor for cloning e.

Definition at line 91 of file all-interval.cpp.

Member Function Documentation

◆ copy()

virtual Space * AllInterval::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 98 of file all-interval.cpp.

◆ print()

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

Print solution.

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

Definition at line 103 of file all-interval.cpp.

Friends And Related Symbol Documentation

◆ main()

int main ( int argc,
char * argv[] )
related

Main-function.

Definition at line 117 of file all-interval.cpp.


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