Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgen-lentz committed Oct 11, 2024
1 parent c4ec7a0 commit aeef4c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion amplpy/entity.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ cdef class Entity(object):
entity is not indexed.
"""
cdef size_t indexarity
campl.AMPL_EntityGetIndexarity(self._c_ampl, self._name.encode('utf-8'), &indexarity)
if self._index is not NULL:
indexarity = 0
else:
campl.AMPL_EntityGetIndexarity(self._c_ampl, self._name.encode('utf-8'), &indexarity)
return indexarity

def is_scalar(self):
Expand Down

0 comments on commit aeef4c0

Please sign in to comment.