Generated on Wed Nov 5 2014 05:18:37 for Gecode by doxygen 1.7.6.1
DescartesFolium Class Reference

Example: Folium of Descartes More...

List of all members.

Public Member Functions

 DescartesFolium (const Options &)
 Actual model.
 DescartesFolium (bool share, DescartesFolium &p)
 Constructor for cloning p.
virtual Spacecopy (bool share)
 Copy during cloning.
virtual void constrain (const Space &_b)
 Add constraint to current model to get next solution (not too close)
virtual void print (std::ostream &os) const
 Print solution coordinates.

Protected Attributes

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

Related Functions

(Note that these are not member functions.)

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

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::DescartesFolium ( const Options ) [inline]

Actual model.

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

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

Constructor for cloning p.

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


Member Function Documentation

virtual Space* DescartesFolium::copy ( bool  share) [inline, virtual]

Copy during cloning.

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

virtual void DescartesFolium::constrain ( const Space _b) [inline, virtual]

Add constraint to current model to get next solution (not too close)

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

virtual void DescartesFolium::print ( std::ostream &  os) const [inline, virtual]

Print solution coordinates.

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

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


Friends And Related Function Documentation

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

Main-function.

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


Member Data Documentation

The numbers.

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

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: