Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Setting or propagating orientation (rowwise or columnwise) of a Matrix #492

Open
Labels
discussionDiscussing a topic with no specific actions yetenhancementImprove existing functionality or make things work better
@eriknw

Description

@eriknw

The default orientation of matrices is rowwise. This can be changed globally in SuiteSparse:GraphBLAS withgb.ss.config["format"] = "by_col", and a single matrix can be changed viaA.ss.config["format"] = "by_col".

Using matrices with non-default orientation may result in surprising behavior. For example, would users expect elementwise operations to result in the orientation changing (such asB = (A + 1).new())? More illustrations below:

In [1]:importgraphblasasgbIn [2]:A=gb.Matrix.from_csc([0,2,3,3,5], [1,3,7,6,20], [10,20,30,40,50])In [3]:A.ss.formatOut[3]:'csc'In [4]:A.ss.orientationOut[4]:'columnwise'In [5]:B= (A+1).new()In [6]:B.ss.orientationOut[6]:'rowwise'In [7]:gb.ss.concat([[A,A]]).ss.orientationOut[7]:'rowwise'In [8]:A[:4, :4].new().ss.orientationOut[8]:'rowwise'

Perhaps this isn't surprising, since a global default means just that: everything is predictable, andnew objects by default will use the default orientation. If you want to control the orientation of the output, then this is possible by first creating the output object and setting its orientation.

Some questions:

  • should we consider ever propagating the orientation of input matrices to the automatically created result matrix?
  • should we consider a way to specify orientation (and other config?) when creating new objects?
    • e.g.B = (A + 1).new(order="col")
    • e.g.B = gb.ss.concat([[A, A]], order="F")
    • e.g.B = A[:4, :4].new(order="columnwise")

It's worth noting that the upcoming GraphBLAS 2.1 specification will introduce the ability to introspect a Matrix for its orientation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionDiscussing a topic with no specific actions yetenhancementImprove existing functionality or make things work better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp