# m.v.MandelbrotValuer(object) : class documentation

Part of mcmandelbrot.valuer
View In Hierarchy **•** Source for `valuer.py`

**•** Project Page for `AsynQueue`

Returns the values (number of iterations to escape, if at all, inverted) of the Mandelbrot set at point cr + i*ci in the complex plane, for a range of real values with a constant imaginary component.

C code adapted from Ilan Schnell's `iterations`

function
at:

https://svn.enthought.com/svn/enthought/Mayavi/ branches/3.0.4/examples/mayavi/mandelbrot.py}

with periodicity testing and test-interval updating adapted from Simpsons's code contribution at:

http://en.wikipedia.org/wiki/User:Simpsons_contributor/ periodicity_checking

and period-2 bulb testing from Wikibooks:

http://en.wikibooks.org/wiki/Fractals/ Iterations_in_the_complex_plane/Mandelbrot_set

The values are inverted, i.e., subtracted from the maximum value, so that no-escape points (technically, the only points actually in the Mandelbrot Set) have zero value and points that escape immediately have the maximum value. This allows simple mapping to the classic image with a black area in the middle. Then they are scaled to the 0.0-1.0 range, and an exponent is applied to emphasize changes at shorter escape times. Finally, they are mapped to RGB triples and returned.

Instance Variable | cm | A callable object that converts `NumPy` array inputs in the
0.0-1.0 range to an unsigned-int8 Python array of RGB triples. |

Method | __init__ | Constructor: |

Method | __call__ | Computes values for N points along the real (horizontal) axis
from crMin to crMax, with the constant imaginary component
ci. |

Method | computeValues | Computes and returns a row vector of escape iterations, integer values. |

Method | transform | Transforms the input vector x by taking it to a power, which is
zero (no transform) or odd-numbered. |

`NumPy`

array inputs in the
0.0-1.0 range to an unsigned-int8 Python array of RGB triples.
Constructor:

Parameters | N_values | The number of iterations to try, hence the range of integer values, for a
single call to `computeValues` .
Because a 5-point star around each point is evaluated with the values
summed, the actual range of values for each point is 5 times greater. |

Computes values for *N* points along the real (horizontal) axis
from *crMin* to *crMax*, with the constant imaginary component
*ci*.

Returns | A Python B-array 3*N containing RGB triples for an image
representing the escape values. |

Computes and returns a row vector of escape iterations, integer values.

Transforms the input vector *x* by taking it to a power, which is
zero (no transform) or odd-numbered.