help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Order of matrix multiplication


From: Mike Miller
Subject: Re: Order of matrix multiplication
Date: Mon, 12 Sep 2016 14:27:13 -0700
User-agent: NeoMutt/ (1.7.0)

On Mon, Sep 12, 2016 at 18:05:26 -0300, Bernardo Sulzbach wrote:
> numpy/linalg/linalg.py is a great resource. It seems to me definitely worth
> trying to perform such optimizations. Even if we in the end preserve mtimes
> (lack of) parenthesization for some reason, having another function which
> would figure out an optimal parenthesization by solving the matrix chain
> ordering problem (assuming it doesn't already exists around these parts)
> would be a nice thing.

Agreed. IMHO mtimes and the * operator would retain the expected
left-associativity property, but another function could be introduced
that determines a different order to perform pairwise multiplications
for performance.

> I think it could definitely be a function of its own. See that the algorithm
> may introduce some noticeable overhead when determining how to best multiply
> the matrices while not giving anything back in return. Maybe mtimes docs
> should then point to this function saying that it does attempt to optimize
> parenthesization before multiplying the matrices. Also, if this was made
> into another function, the aforementioned ticked would not be an
> implementation blocking issue.

Would you care to file this as a wishlist item on our bug tracker?
Alternatively (or also) it could be described on the wiki under Project
Ideas. Otherwise it will be forgotten.

https://savannah.gnu.org/bugs/?func=additem&group=octave

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]