| | |
| | | for(i=0;i<N;i++) { |
| | | vlist->vtx[i]=(ts_vertex *)calloc(1,sizeof(ts_vertex)); |
| | | vlist->vtx[i]->idx=i; |
| | | |
| | | vlist->vtx[i]->locked=(ts_uint *)calloc(1,sizeof(ts_vertex)); |
| | | /* initialize Ylm for spherical hamonics DONE in sh.c */ |
| | | /* for(i=0;i<l;i++){ |
| | | vlist->vtx[i]->Ylm[i]=(ts_double **)calloc(2*i+1,sizeof(ts_double *)); |
| | |
| | | |
| | | ts_bool vertex_taint(ts_vertex *vtx, ts_uint level){ |
| | | ts_uint i; |
| | | vtx->locked++; //lock current vertex |
| | | (*(vtx->locked))=1; //lock current vertex |
| | | if(level==0){ //if we reach last in recursion exit |
| | | return TS_SUCCESS; |
| | | } |
| | |
| | | } |
| | | |
| | | ts_bool vertex_untaint(ts_vertex *vtx, ts_uint level){ |
| | | vtx->locked--; |
| | | (*(vtx->locked))=0; |
| | | if(level==0){ |
| | | return TS_SUCCESS; |
| | | } |
| | |
| | | } |
| | | |
| | | inline ts_bool vertex_tainted(ts_vertex *vtx, ts_uint level, ts_uint amount){ |
| | | if(vtx->locked>amount) return 1; |
| | | if(*(vtx->locked)>amount) return 1; |
| | | if(level==0){ |
| | | return 0; |
| | | } |