Opened 9 years ago

Closed 9 years ago

#557 closed proposed feature (wontfix)

deceptive effects of size()

Reported by: kroeker@… Owned by: somebody
Priority: minor Milestone: 4-1-0 and higher
Component: singular-kernel Version: 4-0-0
Keywords: size() behaviour dissonance experience Cc:

Description

For ideals, modules and vectors the behaviour of size() , even if documented, is in dissonance with common experience and thus a fruitful source of mistakes/bugs.

Proposal:

size (ideal), size(module) gives always a warning and has to be replaced either by nNonzeroGens or by nGens

size (vector) gives always a warning and has to be replaced either by nNonzeroEntries or by nrows

Change History (3)

comment:1 Changed 9 years ago by Oleksandr

size ignores zero generators while ncols - counts them. thus i can see no need for nNonzeroGens, nNonzeroEntries or suchlike...

comment:2 Changed 9 years ago by kroeker@…

size ignores zero generators while ncols - counts them. thus i can see no need for nNonzeroGens, nNonzeroEntries or suchlike

its about reasonable naming to prevend bugs.

'size' is highly misleading for number of nonzero generators or nonzero (dense)vector entries.

The bugs caused by incorrect usage of 'size' are my witnesses. The same story we wee for dim() which is more a dimLead() than a dim()

But ok, code reviews or appropriate regression test may detect incorrect usages of size(), too. So at least I would like to have a switch for debugging to turn on warnings on all usages of size(ideal), size(module) and size(vector) instructions.

comment:3 Changed 9 years ago by hannes

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.