Documentation of 'edu.rit.smp.fractal.MandelbrotSetSmp2' Java class
MandelbrotSetSmp2
edu.rit.smp.fractal

Class MandelbrotSetSmp2



  • public class MandelbrotSetSmp2
    extends java.lang.Object
    Class MandelbrotSetSmp2 is an SMP parallel program that calculates the Mandelbrot Set.

    Usage: java -Dpj.nt=K edu.rit.smp.fractal.MandelbrotSetSmp2 width height xcenter ycenter resolution maxiter gamma filename
    K = Number of processors
    width = Image width (pixels)
    height = Image height (pixels)
    xcenter = X coordinate of center point
    ycenter = Y coordinate of center point
    resolution = Pixels per unit
    maxiter = Maximum number of iterations
    gamma = Used to calculate pixel hues
    filename = PJG image file name

    The program considers a rectangular region of the complex plane centered at (xcenter,ycenter) of width pixels by height pixels, where the distance between adjacent pixels is 1/resolution. The program takes each pixel's location as a complex number c and performs the following iteration:

    z0 = 0
    zi+1 = zi2 + c

    until zi's magnitude becomes greater than or equal to 2, or i reaches a limit of maxiter. The complex numbers c where i reaches a limit of maxiter are considered to be in the Mandelbrot Set. (Actually, a number is in the Mandelbrot Set only if the iteration would continue forever without zi becoming infinite; the foregoing is just an approximation.) The program creates an image with the pixels corresponding to the complex numbers c and the pixels' colors corresponding to the value of i achieved by the iteration. Following the traditional practice, points in the Mandelbrot set are black, and the other points are brightly colored in a range of colors depending on i. The exact hue of each pixel is (i/maxiter)gamma. The image is stored in a Parallel Java Graphics (PJG) file specified on the command line.

    The computation is performed in parallel in multiple processors. The program measures the computation's running time, including the time to write the image file. The program also measures the running time for each parallel team thread and for each chunk of indexes computed by the parallel for loop.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void main(java.lang.String[] args)
      Mandelbrot Set main program.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Mandelbrot Set main program.
        Throws:
        java.lang.Exception

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.