Skip to content

Implement argmax on a PMMatrix #80

Closed

Description

@SergeStinckwich

Implement something similar to this one : https://docs.scipy.org/doc/numpy/reference/generated/numpy.argmax.html on PMMatrix

Activity

  1. nicolas-cellier-aka-nice commented on Aug 3, 2018

    @nicolas-cellier-aka-nice
    Contributor

    The numpy example is quite stupid because ambiguous: we don't know if 5 is the 0-based index of the maximum value, or the maximum value itself!

    Also we don't know what happens with negative values... I presume it's the maximum value and not the maximum magnitude, but it would be good to have an example for disambiguating.

    Answering a single index only make sense for an underlying flatten collection like in Smallapack.
    But this is not the case of Didier Besset matrix implementation (Array of Array).
    Can we access a PMMatrix with a single flat index?
    Otherwise we should answer a row and a column index (or alternatively provide a block [:rowIndex :colIndex | ] as argument).

  2. nicolas-cellier-aka-nice commented on Aug 3, 2018

    @nicolas-cellier-aka-nice
    Contributor

    Note that in Smallapack I've implemented findMax: with a block argument which is (self collect: aBlock) argmax.
    I also have findAll: which is equivalent of Matlab find (same as select: but answers the indices rather than the elements).

  3. SergeStinckwich commented on Aug 3, 2018

    @SergeStinckwich
    MemberAuthor

    Yes the Numpy example is quite stupid ... Apparently without axis, the matrix is flattened before finding the argmax.

  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