Project

General

Profile

Feature #1436

Flatten for a matrix

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

Status:
Closed
Priority:
Low
Assignee:
Category:
New Function
Target version:
Start date:
04 Mar 2020
Due date:
% Done:

100%

Estimated time:
1.41 h
Spent time:

Description

I happened to see in SparsePolyOps-MinPoly.C that there is a function for "flattening" a matrix.

Do we want to make official functions for flattening?
Suggested names: FlattenMatByRows and FlattenMatByCols
Return type: vector<RingElem>

Note that we already have MatByRows and MatByCols which are the opposite functions.

History

#1 Updated by John Abbott over 3 years ago

  • Priority changed from Normal to Low
  • Target version changed from CoCoALib-0.99800 to CoCoALib-0.99850
Some notes:
  • (A) there are already the functions GetRows and GetCols which return a vector<vector<RingElem>>
  • (B) the current fn is MatrixFlatten around lines 116-125 in SparsePolyOps-MinPoly.C

In its current "private" form MatrixFlatten is a "nasty" impl: it requires that the vector into which the result is copied be of the right size.
We could either use resize inside the function, or else write a function which creates a new vector and returns that (returning should not copy the vector).

I think this is not urgent, so am postponing to 0.99750.

#2 Updated by Anna Maria Bigatti over 3 years ago

it is only used in RingElem MinPoly(ConstMatrixView M, ConstRefRingElem x).

#3 Updated by John Abbott over 3 years ago

  • Status changed from New to Resolved
  • Assignee set to John Abbott
  • % Done changed from 0 to 50

I have written a first impl (in MatrixOps-flatten.C).
Added doc.
No tests yet.

#4 Updated by John Abbott over 3 years ago

  • % Done changed from 50 to 60

I have checked in the code.
The fn names are FlattenByRows and FlattenByCols; it seems unnecessary to have Mat in the fn names!

#5 Updated by John Abbott over 3 years ago

  • Target version changed from CoCoALib-0.99850 to CoCoALib-0.99800

#6 Updated by John Abbott over 3 years ago

  • Status changed from Resolved to Feedback
  • % Done changed from 60 to 90

I have added a test to test-matrix4.C

#7 Updated by John Abbott over 3 years ago

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

Also available in: Atom PDF