GoldenSpiral Class Reference
[Example scripts (models)]
Example: Golden spiral More...
Public Member Functions | |
GoldenSpiral (const Options &opt) | |
Actual model. | |
GoldenSpiral (bool share, GoldenSpiral &p) | |
Constructor for cloning p. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
virtual FloatVar | cost (void) const |
Cost function. | |
virtual void | print (std::ostream &os) const |
Print solution coordinates. | |
Protected Attributes | |
FloatVarArray | f |
The numbers. |
Detailed Description
Example: Golden spiral
The Golden Spiral is a logarithmic spiral whose growth factor is the golden ratio .
It is defined by the polar equation:
where
To get cartesian coordinates, it can be solved for and in terms of and . By setting , it yields to the equation:
with
The tuple is related to the position for and on the curve. and are positive numbers.
To get reasonable interval starting sizes, and are restricted to .
Definition at line 81 of file golden-spiral.cpp.
Constructor & Destructor Documentation
GoldenSpiral::GoldenSpiral | ( | const Options & | opt | ) | [inline] |
Actual model.
Definition at line 87 of file golden-spiral.cpp.
GoldenSpiral::GoldenSpiral | ( | bool | share, | |
GoldenSpiral & | p | |||
) | [inline] |
Constructor for cloning p.
Definition at line 103 of file golden-spiral.cpp.
Member Function Documentation
virtual Space* GoldenSpiral::copy | ( | bool | share | ) | [inline, virtual] |
Copy during cloning.
Definition at line 108 of file golden-spiral.cpp.
virtual FloatVar GoldenSpiral::cost | ( | void | ) | const [inline, virtual] |
Cost function.
Definition at line 112 of file golden-spiral.cpp.
virtual void GoldenSpiral::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print solution coordinates.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 116 of file golden-spiral.cpp.
Member Data Documentation
FloatVarArray GoldenSpiral::f [protected] |
The numbers.
Definition at line 84 of file golden-spiral.cpp.
The documentation for this class was generated from the following file:
- examples/golden-spiral.cpp (Revision: 14967)