3 * sushivision copyright (C) 2006 Monty <monty@xiph.org>
5 * sushivision is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * sushivision is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with sushivision; see the file COPYING. If not, write to the
17 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "sushivision.h"
29 static void fractal_objective(double *d
, double *ret
){
33 const double c
=d
[0],ci
=d
[1];
37 for(i
=0;i
<max_iter
;i
++){
41 if (z
*z
+ zi
*zi
> 4.0){
42 *ret
= (double)i
/max_iter
;
48 int sushiv_submain(int argc
, char *argv
[]){
50 s
=sushiv_new_instance();
52 sushiv_new_dimension(s
,0,"Re(c)",
53 5,(double []){-2.25,-0.75,0,0.25,0.75},
55 sushiv_new_dimension(s
,1,"Im(c)",
56 5,(double []){-2,-1,0,1,2},
59 sushiv_new_dimension(s
,2,"Re(z0)",
60 5,(double []){-2.25,-1,0,1,2.25},
62 sushiv_new_dimension(s
,3,"Im(z0)",
63 5,(double []){-2.25,-1,0,1,2.25},
66 sushiv_new_dimension_discrete(s
,4,"Iterations",
67 5,(double []){1,10,100,1000,10000},
72 sushiv_new_dimension_picklist(s
,4,"Max Iterations",
74 (double []){100,1000,10000,100000},
75 (char *[]){"one hundred",
78 "one hundred thousand"},
81 sushiv_new_objective(s
,0,"fractal",
82 5,(double []){0, .001, .01, .1, 1.0},
85 sushiv_new_panel_2d(s
,0,"Mandel/Julia Fractal",
87 (int []){0,1,2,3,4,-1},
90 sushiv_new_panel_1d_linked(s
,1,"X Slice",s
->objective_list
[0]->scale
,
94 sushiv_new_panel_1d_linked(s
,2,"Y Slice",s
->objective_list
[0]->scale
,
96 0,SUSHIV_PANEL_LINK_Y
| SUSHIV_PANEL_FLIP
);