Project

General

Profile

Feature #184

MAT/INT ? MAT/RINGELEM ?

Added by Anna Maria Bigatti almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
CoCoA-5 function: new
Target version:
Start date:
11 Jun 2012
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

We can comupte INT*MAT, more recently also MAT*INT.
Should we also allow MAT/INT?
(was not allowed in CoCoA-4)

Also in CoCoALib?


Related issues

Related to CoCoA-5 - Bug #171: Negate LIST, MAT,...New2012-05-31

History

#1 Updated by John Abbott almost 12 years ago

Common sense says that if you can do M*(1/X) then you ought to be able to do M/X (and get the same result!). If multiplication is commutative then (1/X)*M should be the same as well. I'm fairly sure that in vector calculus one happily writes (u+v)/2 where u and v are vectors; so why not for matrices too? (and lists, and others structures)

However, for some reason I am slightly reluctant... perhaps simply because I am now used to CoCoA-4's limitations?

I do recall discovering the hard way that CoCoA-4 does not permit L/2 (where L is a list). So it is an operation that I wanted to do, and so presumably an operation that others might want to do.

#2 Updated by Anna Maria Bigatti almost 12 years ago

John Abbott wrote:

Common sense says that if you can do M*(1/X) then you ought to be able to do M/X (and get the same result!). If multiplication is commutative then (1/X)*M should be the same as well. I'm fairly sure that in vector calculus one happily writes (u+v)/2 where u and v are vectors; so why not for matrices too? (and lists, and others structures)

I have tried that syntax myself a few times.
One thing to be said is that M*(1/X) is rather more tedious to type than M/X!

However, for some reason I am slightly reluctant...

me too... don't knw why. Can it cause ambiguities?

#3 Updated by John Abbott almost 12 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20

I have asked some students (and colleagues) about writing M/2 where M is a matrix. The replies were quite varied. One student said it was absolutely forbidden by some prof here (but now I suspect she may have meant that it was forbidden to have a denominator which is a matrix). Almost nobody liked the notation, but not many would forbid it outright. Everyone guessed correctly what it should mean.

One student pointed out that it is very common to write v/|v| to obtain the unit vector in the directon of v; and there's little difference between vectors and matrices...

I don't believe it can cause any ambiguities. Initially it may be hard (for a person) to read such expressions until one becomes used to the idea that a matrix may be divided by a scalar.

#4 Updated by John Abbott almost 12 years ago

Claudia reports that Matlab allows the user to write M/2 to mean (1/2)*M. JAA finds this reassuring because it suggests that there is little chance of a syntactic nasty surprise.

I'll try modifying the C5 interpreter code...

#5 Updated by John Abbott almost 12 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 20 to 100

I have added "division by a scalar" for matrices and lists; not added anything to the documentation, nor any example/test. The corresponding matrix fns have been added to CoCoALib.

#6 Updated by Anna Maria Bigatti over 11 years ago

  • Assignee set to John Abbott
  • Target version set to CoCoA-5.0.3

Also available in: Atom PDF