Re: Matrix question

From: Minti (mintispamblock_at_yahoo.com)
Date: 09/06/04


Date: Mon, 6 Sep 2004 23:18:52 +0530


"Kitty" <No spam> wrote in message news:41394ff7_3@rain.i-cable.com...
> Given a matrix A[n], n is very large, I want to sum all the elements up.
> What is the fastest method to do that? Do you for-loop is the best one?
> Thanks.
>
>

The first solution that comes to my mind is to create n' number of threads.
Where n will be based on the value of n. Maybe n/4 or n/2.

Compute the sum for each of the threads.

Compute the total.

HTH

--
Imanpreet Singh Arora
isingh AT acm DOT org
      If I would have only known, I would have been a locksmith.
        -- Albert Einstein


Relevant Pages

  • Re: Can someone recommend a product?
    ... Matthew Kitchin (Usenet/Lists) wrote: ... The first solution that comes to mind is to whitelist ...
    (microsoft.public.exchange.admin)
  • Re: increasing counter whithin loop?
    ... You missed to read my mind; my explanation was very unclear. ... but I can't change the i in the for-loop. ...
    (comp.lang.ruby)
  • Re: Welding mats
    ... The first solution that comes to mind is to wear shoes with thick, ...
    (sci.engr.joining.welding)
  • Re: something like a convolution, how to do it fast in Matlab?
    ... that the for-loop algorithm is very likely more efficient for large values ... 'conv' has to do a total of n^2 multiplications and ... 3*n multiplications and 2*n additions. ... number as large as n = 50000, never mind the for-loop's overhead. ...
    (comp.soft-sys.matlab)
  • Re: something like a convolution, how to do it fast in Matlab?
    ... that the for-loop algorithm is very likely more efficient for large values ... 3*n multiplications and 2*n additions. ... number as large as n = 50000, never mind the for-loop's overhead. ...
    (comp.soft-sys.matlab)