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

SupportA.power(0)#518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
eriknw merged 1 commit intopython-graphblas:mainfromeriknw:power0
Dec 12, 2023
Merged

SupportA.power(0)#518

eriknw merged 1 commit intopython-graphblas:mainfromeriknw:power0
Dec 12, 2023

Conversation

@eriknw
Copy link
Member

CC@michelp who requested this.

When n=0, I decided to create a complete diagonal matrix using the identity of the binaryop if the identity exists (and raise if it doesn't).

We want the following equality to hold:

I=A.power(0,semiring)semiring(I @A @I).isequal(A)

We could try to make the diagonal more sparse to better support hypersparse matrices, but this would need to determine both nonempty rows and nonempty columns, becauseI needs to be able to be the left-identity and the right-identity. Creating the complete diagonal matrix is much simpler.

CC@jim22k. When we addedMatrix.power in#483, I believe we discussedn=0, and we decided to punt until it was needed. As we discussed, n=0 is a little awkward b/c the identity value isn't always available (since it ought to come from the binaryop--not the monoid--of the semiring), and we weren't sure whether we should try to return a sparse diagonal or if this is what the user would want and expect. I think the behavior in this PR is the best approach.

@codecov
Copy link

codecovbot commentedNov 4, 2023
edited
Loading

Codecov Report

Merging#518 (5bddc8c) intomain (7935e50) willincrease coverage by0.04%.
The diff coverage is100.00%.

@@            Coverage Diff             @@##             main     #518      +/-   ##==========================================+ Coverage   99.20%   99.24%   +0.04%==========================================  Files          95       95                Lines       21291    21305      +14       Branches     3999     4001       +2     ==========================================+ Hits        21121    21144      +23+ Misses        124      112      -12- Partials       46       49       +3

@eriknweriknw merged commit0bfcb66 intopython-graphblas:mainDec 12, 2023
@eriknweriknw added the enhancementImprove existing functionality or make things work better labelDec 13, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@michelpmichelpmichelp approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

enhancementImprove existing functionality or make things work better

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@eriknw@michelp

[8]ページ先頭

©2009-2025 Movatter.jp