Project

General

Profile

Feature #303

Rows and Columns of a matrix

Added by John Abbott about 11 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
New Function
Target version:
Start date:
11 Feb 2013
Due date:
% Done:

100%

Estimated time:
1.66 h
Spent time:

Description

Two new fns rows(M) and cols(M) -- or should its name be columns?

These take a matrix and return a list of lists.

JAA notes that MakeMatByRows and MakeMatByCols take a "flattened" list of entries, so they are not quite inverses to rows and cols.


Related issues

Related to CoCoALib - Feature #206: Matrix equation solving: LinKerIn Progress2012-07-10

History

#1 Updated by Anna Maria Bigatti about 11 years ago

I prefer cols (always the same abbreviation).
Or should it be GetCols?
Which name represents better it is making a copy?

There are some functions in CoCoALibSupplement:
  • GetRow_long (indexed from 0)
  • GetRow
  • GetCol
  • GetRows.
    Update also these when making the new functions in CoCoALib.

#2 Updated by Anna Maria Bigatti over 9 years ago

  • Target version set to CoCoALib-1.0

#3 Updated by John Abbott almost 5 years ago

  • Category set to New Function
  • Status changed from New to Resolved
  • Assignee set to John Abbott
  • Target version changed from CoCoALib-1.0 to CoCoALib-0.99700
  • % Done changed from 0 to 70

I have just implemented GetRow, GetCol, GetRows and GetCols.

Perhaps the names are not ideal, but they are compatible with the names in CoCoA-5 (but indexes must be changed by 1).

I wonder whether a "flatten" function might be useful: read matrix elems row-by-row (or col-by-col) and put them into a std::vector<RingElem>. Anyway, I have not implemented this.

#4 Updated by John Abbott almost 5 years ago

  • % Done changed from 70 to 80

I have now added GetRow, GetCol, GetRows and GetCols to MatrixOps.txt

Fixed a couple of minor bugs. Is it really worth writing a test?
(GetCol is effectively tested in anna.cocoa5)

#5 Updated by John Abbott over 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 80 to 100
  • Estimated time set to 1.66 h

Last comment was 8 months ago. The code is there (presumably added then); it is documented.
A comment says there are no tests, but that is probably not so important.
Closing.

Also available in: Atom PDF