Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AA << op.plus_times(P.T @ A @ P) ? #132

Open
@ParticularMiner

Description

@ParticularMiner

Hi @eriknw

Oops! I stretched the infix notation a bit too far by testing the following line, which is an expression one would often encounter when transforming matrix-quantities (like graph adjacency-matrices, for example):

AA << op.plus_times(P.T @ A @ P)

where A, AA and P are all matrices. (That is, A is transformed by P into AA. P could be a permutation matrix, for example.)

The expression was executed without throwing an exception, but the result was incorrect. To be precise, the structure of the answer was correct but the values were all 0 (which was incorrect).

Of course, the right way to do it was this:

AA << op.plus_times(P.T @ op.plus_times(A @ P))

which gave the right answer.

But it would be great if the former notation was also possible. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions