source: trunk/misc/tools/acceptance_tests/mandelbrot/mandel_sequential.py @ 7877

Last change on this file since 7877 was 7276, checked in by ole, 16 years ago

Merged numpy branch back into the trunk.

In ~/sandpit/anuga/anuga_core/source
svn merge -r 6246:HEAD ../../branches/numpy .

In ~/sandpit/anuga/anuga_validation
svn merge -r 6417:HEAD ../branches/numpy_anuga_validation .

In ~/sandpit/anuga/misc
svn merge -r 6809:HEAD ../branches/numpy_misc .

For all merges, I used numpy version where conflicts existed

The suites test_all.py (in source/anuga) and validate_all.py passed using Python2.5 with numpy on my Ubuntu Linux box.

  • Property svn:executable set to *
File size: 706 bytes
Line 
1#!/usr/bin/env python
2
3"""Sequential program computing the Mandelbrot set.
4
5Ole Nielsen, SUT 2003
6"""
7
8from mandelbrot import calculate_region
9from mandelplot import plot
10import time
11
12# User definable parameters
13kmax = 2**15  # Maximal number of iterations (=number of colors)
14M = N = 700   # width = height = N (200, 400, 600, 700 are good)
15#M = N = 400   # width = height = N (200, 400, 600, 700 are good)
16
17# Region in complex plane
18real_min = -2.0
19real_max =  1.0
20imag_min = -1.5
21imag_max =  1.5
22
23# Compute Mandelbrot set
24t0 = time.time()
25A = calculate_region(real_min, real_max, imag_min, imag_max, kmax, M, N)
26print 'Computed region in %.2f seconds' %(time.time()-t0)
27
28# Plot result
29plot(A, kmax)
30
31
32
33
Note: See TracBrowser for help on using the repository browser.