#include #include #include #include #include #include #include #include #include "lodepng.h" #ifndef CMPLX #define CMPLX(r,i) ((r) + (i)*I) #endif const int MAXITER=200; const double EPS=1e-1; static double complex att_func(double complex x,double exponent){ #if 0 static const int N=9; double complex r=1,y=x; for(int i=1;iystart; int yend=th_info->yend; unsigned char *img=th_info->img; bool do_basins=th_info->do_basins; struct config cfg=th_info->cfg; int nbasins=0,bsz=0; double complex *basins=NULL; if(do_basins){ bsz=16; basins=malloc(bsz*sizeof(double complex)); assert(basins); } printf("Thread: y in [%d,%d)\n",ystart,yend); for(int iy=ystart;iy=999||nthreads<1)nthreads=1; fprintf(stderr,"Using %d thread%s\n",nthreads,nthreads==1?"":"s"); pthread_attr_t attr; if(pthread_attr_init(&attr)!=0){ perror("pthread_attr_init"); return 1; } struct thread_info ths[nthreads]; for(int i=0;i