Skip to content

Flatten PMMatrix #79

Closed
Closed

Description

@SergeStinckwich

Transform a 2D arrays (PMMatrix) as an 1D vector (PMVector).

a := PMMatrix rows:#((1 2) (3 4) (5 6)).
a flatten.

=> a PMVector (1 2 3 4 5 6)

Activity

  1. SergeStinckwich commented on Aug 3, 2018

    @SergeStinckwich
    MemberAuthor
    testFlattenOnColumns
    	| m |
    	m := PMMatrix rows: #(#(1 2 3) #(4 5 6) #(7 8 9)).
    	self assert: m flattenOnColumns equals: #(1 4 7 2 5 8 3 6 9) asPMVector
    testFlattenOnRows
    	| m |
    	m := PMMatrix rows: #(#(1 2 3) #(4 5 6) #(7 8 9)).
    	self assert: m flattenOnRows equals: #(1 2 3 4 5 6 7 8 9) asPMVector
  2. nicolas-cellier-aka-nice commented on Aug 3, 2018

    @nicolas-cellier-aka-nice
    Contributor

    Hi Serge, why not just flattenRows and flattenColumns?

  3. SergeStinckwich commented on Aug 3, 2018

    @SergeStinckwich
    MemberAuthor

    yes sure !

  4. added a commit that references this issue on Aug 3, 2018
  5. added a commit that references this issue on Aug 21, 2019
    6a3657a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions