[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is this code correct in the GMPL implementation ?
From: |
Domingo Alvarez Duarte |
Subject: |
Is this code correct in the GMPL implementation ? |
Date: |
Sat, 25 Jul 2020 13:35:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hello !
Trying to change the actual TUPLE structure by:
====
#ifndef TUPLE_SIZE_T
#define TUPLE_SIZE_T int
#endif
struct TUPLE
{
TUPLE_SIZE_T size;
TUPLE_SIZE_T refcount;
SYMBOL sym[1];
/* symbol, which the component refers to; cannot be NULL */
};
====
I found the code bellow (in src/mpl/mpl3.c) that I'm not sure I
understand it,
it seems that it's only testing the last tuple against
"code->arg.arg.y", shouldn't it be testing inside the loop for every tuple ?
I would appreciate someone could help understand this code !
====
int is_member(MPL *mpl, CODE *code, const TUPLE *tuple)
{ int value;
...
case O_CROSS:
{ int j;
value = is_member(mpl, code->arg.arg.x, tuple);
if (value)
{ for (j = 1; j <= code->arg.arg.x->dim; j++)
{ xassert(tuple != NULL);
tuple = tuple->next;
}
value = is_member(mpl, code->arg.arg.y, tuple);
}
}
break;
====
Cheers !
- Re: Excessive copies of set elements in GMPL, (continued)
- Re: Excessive copies of set elements in GMPL, Andrew Makhorin, 2020/07/16
- Re: Excessive copies of set elements in GMPL, Domingo Alvarez Duarte, 2020/07/17
- Re: Excessive copies of set elements in GMPL, Michael Hennebry, 2020/07/21
- Re: Excessive copies of set elements in GMPL, Domingo Alvarez Duarte, 2020/07/21
- Re: Excessive copies of set elements in GMPL, Michael Hennebry, 2020/07/23
- Re: Excessive copies of set elements in GMPL, Domingo Alvarez Duarte, 2020/07/24
- Re: Excessive copies of set elements in GMPL, Domingo Alvarez Duarte, 2020/07/24
- Re: Excessive copies of set elements in GMPL, Domingo Alvarez Duarte, 2020/07/24
- Re: Excessive copies of set elements in GMPL, Andrew Makhorin, 2020/07/24
- Re: Excessive copies of set elements in GMPL, Andrew Makhorin, 2020/07/24
- Is this code correct in the GMPL implementation ?,
Domingo Alvarez Duarte <=
- Re: Is this code correct in the GMPL implementation ?, Andrew Makhorin, 2020/07/25
- Re: Excessive copies of set elements in GMPL, Domingo Alvarez Duarte, 2020/07/24
- Re: Excessive copies of set elements in GMPL, Michael Hennebry, 2020/07/24
- Re: Excessive copies of set elements in GMPL, Andrew Makhorin, 2020/07/25