Generated on Sun Mar 19 2017 08:30:25 for Gecode by doxygen 1.8.13
DescartesFolium Class Reference

Example: Folium of Descartes More...

Public Member Functions

 DescartesFolium (const Options &opt)
 Actual model. More...
 
 DescartesFolium (bool share, DescartesFolium &p)
 Constructor for cloning p. More...
 
virtual Spacecopy (bool share)
 Copy during cloning. More...
 
virtual FloatVar cost (void) const
 Cost function. More...
 
virtual void print (std::ostream &os) const
 Print solution coordinates. More...
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (const Options &opt)
 Constructor. More...
 
 ScriptBase (bool share, ScriptBase &e)
 Constructor used for cloning. More...
 
virtual void compare (const Space &home, std::ostream &os) const
 Compare with s. More...
 

Protected Attributes

FloatVarArray f
 The numbers. More...
 
double step
 Minimum distance between two solutions. More...
 

Related Functions

(Note that these are not member functions.)

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

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: Folium of Descartes

The folium of Descartes is a curve defined by the equation:

\[ x^3 + y^3 - 3axy = 0 \]

A technique to solve it, is to write $y=px$ and solve for $x$ and $y$ in terms of $p$. By setting $a=1$, it yields to the paramatric equation:

\[ x^3 + y^3 - 3xy = 0 \]

\[ x=\frac{3p}{1+p^3},\quad y=\frac{3p^2}{1+p^3} \]

The parameter $p$ is related to the position on the curve and is constrained to get different solutions for $x$ and $y$. To get reasonable interval starting sizes, $p$ and $y$ are restricted to $[-20;20]$ and $x$ is restricted to $[-1;2]$.

Definition at line 72 of file descartes-folium.cpp.

Constructor & Destructor Documentation

◆ DescartesFolium() [1/2]

DescartesFolium::DescartesFolium ( const Options opt)
inline

Actual model.

Definition at line 80 of file descartes-folium.cpp.

◆ DescartesFolium() [2/2]

DescartesFolium::DescartesFolium ( bool  share,
DescartesFolium p 
)
inline

Constructor for cloning p.

Definition at line 94 of file descartes-folium.cpp.

Member Function Documentation

◆ copy()

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

Copy during cloning.

Definition at line 99 of file descartes-folium.cpp.

◆ cost()

virtual FloatVar DescartesFolium::cost ( void  ) const
inlinevirtual

Cost function.

Definition at line 103 of file descartes-folium.cpp.

◆ print()

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

Print solution coordinates.

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

Definition at line 107 of file descartes-folium.cpp.

Friends And Related Function Documentation

◆ main()

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

Main-function.

Definition at line 117 of file descartes-folium.cpp.

Member Data Documentation

◆ f

FloatVarArray DescartesFolium::f
protected

The numbers.

Definition at line 75 of file descartes-folium.cpp.

◆ step

double DescartesFolium::step
protected

Minimum distance between two solutions.

Definition at line 77 of file descartes-folium.cpp.


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