#include #if defined QHULL5 #include #warning qhull5 #else #include #warning qhull6 #endif int main(void) { int dim = 2; int n = 100; double pt_array[] = {-0.17154839687769707, 0.24376194992062095, -0.43460932272066988, 0.88772015727798625, -0.265757644323242, 0.49084796101844885, -0.97753435703118197, -0.064884055694141129, 0.78619630624753412, 0.15618054064300213, -0.89890878286806275, 0.68518988951761584, -0.22429508002524245, -0.15811961233358962, -0.46412150496278215, -0.62774093270958498, -0.22686263162945763, 0.65026123447387829, -0.28569419567016519, 0.28928610802124011, 0.37108698250694339, 0.64125540023607042, 0.39624207028367064, -0.78682294616686244, 0.5694726837621884, -0.29816914900519775, -0.9613298783605283, -0.58909625390257536, -0.6939492834674329, 0.87735564280147993, -0.84614140108231928, 0.21326835445164316, 0.17054447484478596, -0.72965073422566851, 0.26468010104185646, 0.077461224360406478, 0.34475767924247491, -0.42633660538784135, -0.98265137829719496, 0.20347839192011596, 0.87876663698634583, -0.92386996270501698, -0.19187650384666421, 0.30543468641370564, 0.47297465144048756, -0.33216820513046474, -0.40311799744453725, 0.30121537819530353, -0.80436669732691224, -0.092168823132381061, -0.27557232961565059, -0.81100820267997464, -0.41944038334874956, -0.30039491100802074, 0.56710111834264754, -0.15133772983664617, -0.9768290027103711, 0.9779598896251156, -0.48038762849992167, -0.99108892906510115, -0.43321909207359954, -0.38489843119226841, -0.16663466742302646, -0.77627775233215923, 0.99413102464058456, 0.32838098652416425, 0.30264232063857666, 0.29784429764164999, 0.9891397646077611, 0.87684047851126734, -0.26556155108008783, 0.3695693563753697, 0.51949242631017944, -0.83391554727975559, 0.65474842043569481, -0.10738563019389613, -0.4295801201509476, 0.75638028265803281, -0.81062843999178369, -0.74447295702596439, -0.786290378230455, -0.26418148355024462, 0.5197764487761849, 0.72590093059068006, -0.93182324973140751, -0.20655006004388132, 0.5809715878197621, 0.90181731048685787, -0.54732132040153181, -0.97751229251601945, -0.24766546523165534, 0.76665216623169918, -0.98727044117747431, -0.62145621973405862, 0.64809804079175959, -0.34612441487111034, 0.53985935494452231, -0.14932618606956172, -0.75043932177526573, -0.13100386483337634, 0.97543403282208363, 0.85708685359358316, -0.2409107191043437, -0.0090196586196816808, 0.94557139214771424, 0.55034350600554416, -0.039529977837903796, -0.62127926927097421, -0.0061503383859987659, -0.49179469414769483, 0.98875874353538595, -0.95505804789649218, -0.0082407770141320613, -0.8194240261183775, 0.38876313658399453, 0.56690990375684547, 0.075637038432075698, -0.37090713289454269, 0.36908704637332668, -0.72582814356843783, 0.47300230806250654, -0.38807926307304841, -0.20174752159160547, 0.33048764953420395, -0.21719973589104613, -0.51281353830567922, 0.18217523235762734, -0.61897030724749114, 0.49818336749397485, -0.1986607509324344, 0.23149041166662787, -0.85356425039241735, -0.30404303393819132, -0.65746141392916846, -0.31728437255298447, 0.25824232250800416, -0.037466288796155101, -0.24261068627284643, -0.4719329411470784, -0.22392560535620343, 0.97300094352616928, -0.91632648656472349, 0.49608421003122039, 0.43876758506208757, 0.16873030867408589, -0.73796136317117955, -0.26392313341586082, 0.062384375472448461, 0.38673844118735423, 0.54135446013920685, -0.89824742604727204, -0.54556501096920196, -0.90684284857207975, -0.82001780766706844, 0.81488960550973388, -0.13726716306392739, 0.92183531556770038, -0.3665862074783951, 0.3235374737597243, -0.28314884751518454, -0.19196853045598694, 0.75865314737193712, -0.51065845318378333, 0.40565585055066666, -0.66034810945094058, 0.56562025485381451, 0.084477226619536383, 0.62371358848924618, -0.94212502699448752, -0.419609415777631, -0.47895545321704092, -0.49741708113548, -0.23378397905338655, -0.6566388324894622, -0.47014087977780383, 0.25768605525243493, -0.62845758826872988, 0.71618750465958558, -0.39024505492223416, 0.50322141389403452, 0.21175068493591431, -0.31521671321036482, -0.041142347427185588, -0.65466607564032298, 0.9842566500470189, -0.73729829290471771, -0.63402111781746939, 0.29994605530311569, 0.63067522135747534, 0.081651752423168134, -0.20562635433307286, 0.025949196934645036, -0.11195343753735532, 0.25283217332671604, 0.57874275070441783, 0.53948434001811951, -0.30241308738275097, -0.78759533679208549, -0.78475507098587294, -0.62492934182079829}; boolT ismalloc = False; char *flags = "qhull d Qt Qbb Qc"; FILE *outfile = 0; FILE *errfile = stderr; int i = 0, nf = 0; facetT *facet; vertexT *vertex, **vertexp; if (! qh_new_qhull (dim, n, pt_array, ismalloc, flags, outfile, errfile)) { qh_triangulate (); FORALLfacets { if (! facet->upperdelaunay) nf++; } } else printf("Something wrong with setup.\n"); FORALLfacets { if (! facet->upperdelaunay) { int j = 0; FOREACHvertex_ (facet->vertices) { printf ("%d ", 1 + qh_pointid(vertex->point)); } i++; putchar('\n'); } } }