pspp-dev
[Top][All Lists]
Advanced

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

[patch #6650] one pass covariance algorithm


From: John Darrington
Subject: [patch #6650] one pass covariance algorithm
Date: Thu, 30 Oct 2008 00:08:15 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.15) Gecko/20080612 Iceweasel/2.0.0.15 (Debian-2.0.0.15-0etch1)

Follow-up Comment #14, patch #6650 (project pspp):

I haven't tested it, but it's looking good.  Some minor points:

1. In order to implement commands' /MISSING subcommand, I think it may be
necessary to replace MV_ANY with a variable passed to the constructor.

2. This code:     
          if (var_is_alpha (v_variables[i]))
            {
              cat_value_update (v_variables[i], val1);
            }
          else
            {
              update_moments (cov, i, val1->f);
            }
  sits inside a loop within covariance_accumulate, which typically will be
inside another loop. Both update_moments and cat_value_update both perform a
test, which is invariant to both loops.  That's a lot of unnecessary tests. So
it will improve performance (and readability) if this is replaced with a
single line: cov->update (cov, i, val1); and the value of update can be set in
the constructor.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?6650>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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