MCPcopy Create free account
hub / github.com/Singular/Singular / equal_set

Function equal_set

misc/intset.cc:163–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163BOOLEAN equal_set (leftv result, leftv arg)
164{
165 if ((arg==NULL)
166 ||(arg->next==NULL)
167 ||(arg->Typ()!=si_intset_type_id)
168 ||(arg->next->Typ()!=si_intset_type_id))
169 {
170 WerrorS("syntax: equal_set(<intset>,<intset>)");
171 return TRUE;
172 }
173 si_intset *a=(si_intset*)arg->Data();
174 si_intset *b=(si_intset*)arg->next->Data();
175 for (si_intset::const_iterator it = b->begin(); it != b->end(); it++)
176 {
177 if (a->find(*it) != a->end())
178 {
179 result->data= (void *) (FALSE);
180 result->rtyp= INT_CMD;
181 return FALSE;
182 }
183 }
184 for (si_intset::const_iterator it = a->begin(); it != a->end(); it++)
185 {
186 if (b->find(*it) != b->end())
187 {
188 result->data= (void *) (FALSE);
189 result->rtyp= INT_CMD;
190 return FALSE;
191 }
192 }
193 result->data= (void *) (TRUE);
194 result->rtyp= INT_CMD;
195 return FALSE;
196}
197
198extern "C" int mod_init(SModulFunctions* psModulFunctions)
199{

Callers

nothing calls this directly

Calls 6

WerrorSFunction · 0.85
TypMethod · 0.45
DataMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected