octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #62468] quadgk.m should be able to do array-va


From: Michael Leitner
Subject: [Octave-bug-tracker] [bug #62468] quadgk.m should be able to do array-valued integration
Date: Thu, 19 May 2022 15:44:26 -0400 (EDT)

Follow-up Comment #20, bug #62468 (project octave):

I don't think that the double loop is slowing it down so much. At least not
when the dimension of the array returned by a single call to f is massive, as
in your examples -- 150 calls that operate on 1e5 numbers each do not really
take longer than one call that operates on 1.5e7 numbers. But yes, for more
realistic cases it is not efficient, that's why I said it is only the dumbest
solution. Please see my thoughts on possibilities to improve in the original
post: if f uses internally only element-wise operations, it would be possible,
but there is no way to find that out with certainty that I see. If f uses
matrix arithmetic to arrive at its array-valued output and is written
expecting only scalar inputs, then there is definitely no general way to do
this vectorized. And no, that it is a double loop is not a problem, with some
effort one could code that as a single loop, but one wouldn't gain anything.

And I don't really understand what you mean with size(out)==size(in): in the
array-valued code path, out is definitely larger (it has even additional
dimensions) than in. 


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62468>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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