Project

General

Profile

Design #656

eval: in which ring should the result be?

Added by John Abbott about 9 years ago. Updated about 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
enhancing/improving
Target version:
Start date:
20 Jan 2015
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

Currently eval(f,[xval,yval]) wants xval and yval to be in the same ring as f; and the result is then naturally in that ring too.

It would be quite natural to have evaluation produce a value in the coeff ring (if xval and yval are in the coeff ring, or integers, or rationals).

Do we want this? Do we want both possibilities?

History

#1 Updated by John Abbott about 9 years ago

Currently eval is written in CoCoA-5, and just checks args before calling subst.

I find the version which returns a result in the coeff ring to be more "natural". Unfortunately I cannot simply call LC(eval(...)) because that fails when the result is 0 (and it is less readable than straight eval(...)).

We could make eval accept evaluation coords either in the poly ring or in the coeff ring; and the result would then be in the same ring as the coords. What to do if all the coords are INT or RAT? I suggest putting the result in the coeff ring. This would be backward compatible, but it is a nuisance to document (and might be confusing for users?).

#2 Updated by John Abbott about 9 years ago

We could make obsolescent the version which wants coords in the poly ring -- so it still works but produces a warning message. I wonder how much code would be affected by that.

Or we could have two fns with similar names: one for coords and result in coeff ring, and the other which works as the current fn.

What do you think?

Also available in: Atom PDF