Go to the documentation of this file.
35 # pragma warning( disable : 4127)
36 # pragma warning( disable : 4706)
70 oldsize= sizep->
i - 1;
71 if (nth < 0 || nth > oldsize) {
72 qh_fprintf(
qh,
qh->qhmem.ferr, 6171,
"qhull internal error (qh_setaddnth): nth %d is out-of-bounds for set:\n", nth);
79 for (i=oldsize-nth+1; i--; )
80 (newp--)->
p= (oldp--)->p;
107 else if (elem == newelem)
142 count= (sizep->
i)++ - 1;
144 (endp++)->p= newelem;
174 if (!(size= sizep->
i))
175 size= (*setp)->maxsize;
178 if (size + sizeA > (*setp)->maxsize) {
185 sizep->
i= size+sizeA+1;
186 memcpy((
char *)&((*setp)->e[size].p), (
char *)&(setA->
e[0].
p), (
size_t)(sizeA+1) *
SETelemsize);
216 count= (sizep->
i)++ - 1;
242 if (size > maxsize || !maxsize) {
243 qh_fprintf(
qh,
qh->qhmem.ferr, 6172,
"qhull internal error (qh_setcheck): actual size %d of %s%d is greater than max size %d\n",
244 size, tname,
id, maxsize);
246 }
else if (set->
e[size].
p) {
247 qh_fprintf(
qh,
qh->qhmem.ferr, 6173,
"qhull internal error (qh_setcheck): %s%d(size %d max %d) is not null terminated.\n",
248 tname,
id, size-1, maxsize);
278 void **destp, **elemp, **endp, **firstp;
283 destp= elemp= firstp=
SETaddr_(set,
void);
286 if (!(*destp++ = *elemp++)) {
319 memcpy((
char *)&(newset->
e[0].
p), (
char *)&(set->
e[0].
p), (
size_t)(size+1) *
SETelemsize);
352 while (elemp->
p != oldelem && elemp->
p)
390 if (!set || !(set->
e[0].
p))
393 if ((setsize= sizep->
i)) {
394 returnvalue= set->
e[setsize - 2].
p;
395 set->
e[setsize - 2].
p= NULL;
399 returnvalue= set->
e[maxsize - 1].
p;
400 set->
e[maxsize - 1].
p= NULL;
432 if (nth < 0 || nth >= sizep->
i) {
433 qh_fprintf(
qh,
qh->qhmem.ferr, 6174,
"qhull internal error (qh_setdelnth): nth %d is out-of-bounds for set:\n", nth);
471 if (nth < 0 || (sizep->
i && nth >= sizep->
i-1) || nth >= set->
maxsize) {
472 qh_fprintf(
qh,
qh->qhmem.ferr, 6175,
"qhull internal error (qh_setdelnthsorted): nth %d is out-of-bounds for set:\n", nth);
479 while (((newp++)->p= (oldp++)->p))
511 while(newp->
p != oldelem && newp->
p)
515 while (((newp++)->p= (oldp++)->p))
542 void *elem, **elemp, *newElem;
551 memcpy(newElem, elem, (
size_t)elemsize);
570 return (n ? &set->
e[n-1].
p : &sizep->
p);
588 void **elemAp, **elemBp;
589 int sizeA= 0, sizeB= 0;
603 if (!memcmp((
char *)elemAp, (
char *)elemBp, sizeA*
SETelemsize))
630 void **elemA, **elemB;
636 if (*elemA == skipelemA) {
641 if (*elemB == skipelemB) {
645 }
else if (*elemA != *elemB) {
647 if (!(skipelemB= *elemB++))
652 if (*elemA++ != *elemB++)
655 if (skip != 2 || *elemB)
678 void **elemA, **elemB, **skipAp, **skipBp;
691 if (*elemA++ != *elemB++)
775 if (size >
qh->qhmem.LASTsize) {
831 for (i=0; i < size; i++) {
832 if (*elem++ == atelem)
857 setT *newset, *set, **setp, *oldset;
864 qh->qhmem.cntlarger++;
865 qh->qhmem.totlarger += size+1;
869 memcpy((
char *)newp, (
char *)oldp, (
size_t)(size+1) *
SETelemsize);
936 sizereceived=
qh->qhmem.sizetable[
qh->qhmem.indextable[size]];
937 if (sizereceived > size)
943 set->
e[setsize].
i= 1;
970 int tailsize= size - nth -1, newsize;
973 qh_fprintf(
qh,
qh->qhmem.ferr, 6176,
"qhull internal error (qh_setnew_delnthsorted): nth %d is out-of-bounds for set:\n", nth);
977 newsize= size-1 + prepend;
981 newp=
SETaddr_(newset,
void) + prepend;
1004 memcpy((
char *)newp, (
char *)oldp, (
size_t)nth *
SETelemsize);
1032 memcpy((
char *)newp, (
char *)oldp, (
size_t)tailsize *
SETelemsize);
1056 qh_fprintf(
qh, fp, 9347,
"%s set=%p maxsize=%d size=%d elems=",
1057 string, set, set->
maxsize, size);
1060 for (k=0; k < size; k++)
1084 while (*elemp != oldelem && *elemp)
1089 qh_fprintf(
qh,
qh->qhmem.ferr, 6177,
"qhull internal error (qh_setreplace): elem %p not found in set\n",
1118 if ((size= sizep->
i)) {
1121 qh_fprintf(
qh,
qh->qhmem.ferr, 6178,
"qhull internal error (qh_setsize): current set size %d is greater than maximum size %d\n",
1151 if (
qh->qhmem.IStracing >= 5)
1152 qh_fprintf(
qh,
qh->qhmem.ferr, 8123,
"qh_settemp: temp set %p of %d elements, depth %d\n",
1180 if (stackedset != *set) {
1182 qh_fprintf(
qh,
qh->qhmem.ferr, 6179,
"qhull internal error (qh_settempfree): set %p(size %d) was not last temporary allocated(depth %d, set %p, size %d)\n",
1226 qh_fprintf(
qh,
qh->qhmem.ferr, 6180,
"qhull internal error (qh_settemppop): pop from empty temporary stack\n");
1229 if (
qh->qhmem.IStracing >= 5)
1230 qh_fprintf(
qh,
qh->qhmem.ferr, 8124,
"qh_settemppop: depth %d temp set %p of %d elements\n",
1249 qh_fprintf(
qh,
qh->qhmem.ferr, 6267,
"qhull error (qh_settemppush): can not push a NULL temp\n");
1253 if (
qh->qhmem.IStracing >= 5)
1254 qh_fprintf(
qh,
qh->qhmem.ferr, 8125,
"qh_settemppush: depth %d temp set %p of %d elements\n",
1277 if (size < 0 || size > set->
maxsize) {
1278 qh_fprintf(
qh,
qh->qhmem.ferr, 6181,
"qhull internal error (qh_settruncate): size %d out of bounds for set:\n", size);
1283 set->
e[size].
p= NULL;
1330 if (idx < 0 || idx >= size || size > set->
maxsize) {
1331 qh_fprintf(
qh,
qh->qhmem.ferr, 6182,
"qhull internal error (qh_setzero): index %d or size %d out of bounds for set:\n", idx, size);
1336 count= size - idx + 1;
#define FOREACHset_(sets)
int qh_setin(setT *set, void *setelem)
void qh_settruncate(qhT *qh, setT *set, int size)
void qh_setprint(qhT *qh, FILE *fp, const char *string, setT *set)
void * qh_setdelnth(qhT *qh, setT *set, int nth)
setT * qh_setnew_delnthsorted(qhT *qh, setT *set, int size, int nth, int prepend)
#define SETelemaddr_(set, n, type)
setT * qh_settemp(qhT *qh, int setsize)
void qh_setaddsorted(qhT *qh, setT **setp, void *newelem)
void qh_settempfree(qhT *qh, setT **set)
void qh_setlarger(qhT *qh, setT **oldsetp)
void * qh_setlast(setT *set)
void qh_errexit(qhT *qh, int exitcode, facetT *, ridgeT *)
int qh_setequal(setT *setA, setT *setB)
void qh_setfree2(qhT *qh, setT **setp, int elemsize)
void ** qh_setendpointer(setT *set)
#define FOREACHelem_(set)
#define SETreturnsize_(set, size)
void qh_setappend(qhT *qh, setT **setp, void *newelem)
void qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt,...)
int qh_setequal_except(setT *setA, void *skipelemA, setT *setB, void *skipelemB)
setT * qh_settemppop(qhT *qh)
void * qh_memalloc(int insize)
int qh_setsize(qhT *qh, setT *set)
void qh_settempfree_all(qhT *qh)
void * qh_setdelsorted(setT *set, void *oldelem)
int qh_setequal_skip(setT *setA, int skipA, setT *setB, int skipB)
setT * qh_setcopy(qhT *qh, setT *set, int extra)
#define SETaddr_(set, type)
setT * qh_setduplicate(qhT *qh, setT *set, int elemsize)
void qh_setfreelong(qhT *qh, setT **setp)
#define qh_memfree_(object, insize, freelistp)
#define SETsizeaddr_(set)
void qh_setaddnth(qhT *qh, setT **setp, int nth, void *newelem)
#define qh_memalloc_(insize, freelistp, object, type)
void qh_settemppush(qhT *qh, setT *set)
void qh_setcompact(qhT *qh, setT *set)
void qh_setappend2ndlast(qhT *qh, setT **setp, void *newelem)
int qh_setindex(setT *set, void *atelem)
void qh_setcheck(qhT *qh, setT *set, const char *tname, unsigned id)
void qh_setfree(qhT *qh, setT **setp)
void * qh_setdellast(setT *set)
void qh_setzero(qhT *qh, setT *set, int idx, int size)
int qh_setunique(qhT *qh, setT **set, void *elem)
void * qh_setdel(setT *set, void *oldelem)
void qh_setappend_set(qhT *qh, setT **setp, setT *setA)
void qh_setreplace(qhT *qh, setT *set, void *oldelem, void *newelem)
void qh_memfree(void *object, int insize)
void * qh_setdelnthsorted(qhT *qh, setT *set, int nth)
setT * qh_setnew(qhT *qh, int setsize)
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:59