Project

General

Profile

Feature #1598

RingHom: implement phi(X) as apply(phi, X) also for X vector and matrix

Added by Anna Maria Bigatti almost 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Improving
Target version:
Start date:
10 Jun 2021
Due date:
% Done:

100%

Estimated time:
8.51 h
Spent time:

Description

phi(f) is equivalent to apply(phi, f).

Implement also for matrix and vector (and export it to CoCoA-5)


Related issues

Related to CoCoA-5 - Design #1568: RMap and image: obsolescent?In Progress2021-01-22

Related to CoCoALib - Feature #1602: Sparse matrix (SparseMat)New2021-07-02

Related to CoCoALib - Bug #1601: Compilation ambiguityClosed2021-06-16

Related to CoCoALib - Design #1467: Change syntax apply(phi,M) into phi(M)?Closed2020-06-22

History

#1 Updated by Anna Maria Bigatti almost 3 years ago

  • Related to Design #1568: RMap and image: obsolescent? added

#2 Updated by John Abbott almost 3 years ago

  • Status changed from New to In Progress

Do we still want to keep apply?
Or should it be moved to "obsolescent"?

#3 Updated by Anna Maria Bigatti almost 3 years ago

  • Assignee set to Anna Maria Bigatti

I'll try doing it!
and think of other involved classes.
(and consider whether making apply obsolescent)

#4 Updated by Anna Maria Bigatti almost 3 years ago

See RingHom.[HC]

  RingElem PartialRingHom::operator()(ConstRefRingElem x) const

and copy/adapt it to other classes

#5 Updated by Anna Maria Bigatti almost 3 years ago

  • % Done changed from 10 to 30

I made a prototype for matrix. Needs to be tested properly.

#6 Updated by John Abbott almost 3 years ago

#7 Updated by Anna Maria Bigatti over 2 years ago

Added phi(matrix).
Prototype. Not entirely certain with it.
CVS'd

#8 Updated by John Abbott over 2 years ago

I have a prototype for list/vector; not checked, not checked-in.
Should I check it in? Would you test it?

#9 Updated by Anna Maria Bigatti over 2 years ago

  • % Done changed from 30 to 50

John Abbott wrote:

I have a prototype for list/vector; not checked, not checked-in.
Should I check it in? Would you test it?

Added test for phi(vector) in test-RingHom1.C (and consequent .out).

I wanted to run valgrind on it, but I don't have it installed and ValgrindTests.sh didn't tell me (??!?).

#10 Updated by John Abbott over 2 years ago

I have updated ValgrindTests.sh --now it should give a helpful error mesg when valgrind is not installed (or not in your PATH).
Checked in!

#11 Updated by Anna Maria Bigatti over 2 years ago

Implemented for vector also in CoCoA-5, where it'll be most useful.
It was much more painful than expected because of the old style on RINGHOM::eval in Interpreter.C.
At the end I've rewrittein it using evalArgAsT1orT2orT3orT4orT5orT6, switch, Value::from, RefTo... and it seems to work fine.
I also added a test in bug-EvalTwice.cocoa5 (OK)

#12 Updated by Anna Maria Bigatti over 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 80

#13 Updated by John Abbott over 2 years ago

The manual entry for "Intro to RingHom" needs to be updated.

Must also add some good tests, e.g.

phi := IdentityHom(R);
phi([1,2,3]);  -->  ***!!!CRASH!!!***  But should work, right?

#14 Updated by John Abbott over 2 years ago

  • Related to Bug #1601: Compilation ambiguity added

#15 Updated by John Abbott over 2 years ago

#16 Updated by John Abbott over 2 years ago

I am not sure whether the following behaviour is what is wanted:

phi := CanonicalHom(R);
phi([1,2,x]); --> works as one might hope; x is indet in R
phi([1,2,3]); --> ERROR: Argument to RingHom must be in domain

Should the second really give error?

#17 Updated by John Abbott over 2 years ago

We should move towards making apply obsolescent in CoCoA-5 now that RINGHOM can be applied directly to LIST and MAT.

Many packages use apply, and several tests use apply too.

#18 Updated by John Abbott over 2 years ago

We should update the doc so that it encourages people to apply RINGHOM directly rather than using apply.
We should also gradually removed uses of apply from the packages.

And, as written in the previous comment, make apply obsolescent.

#19 Updated by John Abbott about 2 years ago

  • Status changed from Resolved to Feedback
  • Target version changed from CoCoALib-0.99850 to CoCoALib-0.99800
  • % Done changed from 80 to 90

I have now made apply obsolescent, and updated the doc.
Hopefully all is OK now... I'd better run the tests (sigh).

#20 Updated by John Abbott about 2 years ago

I have now removed apply from all the packages as well... sigh!
All tests pass now.

#21 Updated by Anna Maria Bigatti about 2 years ago

  • Related to Design #1467: Change syntax apply(phi,M) into phi(M)? added

#22 Updated by Anna Maria Bigatti about 2 years ago

This issue overlaps with Design #1467.

#23 Updated by Anna Maria Bigatti about 2 years ago

  • Related to deleted (Design #1615: apply: remove for RingHom)

#24 Updated by Anna Maria Bigatti about 2 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100
  • Estimated time set to 8.51 h

Also available in: Atom PDF