[R] package:Matrix handling of data with identical indices

Martin Maechler maechler at stat.math.ethz.ch
Mon Jul 10 15:58:38 CEST 2006


>>>>> "roger" == roger koenker <roger at ysidro.econ.uiuc.edu>
>>>>>     on Sun, 9 Jul 2006 12:31:16 -0500 writes:

    roger> On Jul 9, 2006, at 11:06 AM, Douglas Bates wrote:

    >> Your matrix Mc should be flagged as invalid.  Martin and
    >> I should discuss whether we want to add such a test to
    >> the validity method.  It is not difficult to add the test
    >> but there will be a penalty in that it will slow down all
    >> operations on such matrices and I'm not sure if we want
    >> to pay that price to catch a rather infrequently occuring
    >> problem.

    roger> Elaborating the validity procedure to flag such
    roger> instances seems to be well worth the speed penalty in
    roger> my view.  Of course, anticipating every such misstep
    roger> imposes a heavy burden on developers and constitutes
    roger> the real "cost" of more elaborate validity checking.

As I found, we already *have* a validate_dgCMatrix  in C code,
and adding an improved test for the validity of the 'p' slot,
solves ``all problems'' mentioned above --- without any
performance penalty.
Hence., in the upcoming next version of 'Matrix' (0.95-12),
John will get a proper error message immediately from
calling new(...) with the wrong 'p' (or 'Dim').

Martin

    roger> [My 2cents based on experience with SparseM.]

    roger> url: www.econ.uiuc.edu/~roger Roger Koenker email
    roger> rkoenker at uiuc.edu Department of Economics vox:
    roger> 217-333-4558 University of Illinois fax: 217-244-6678
    roger> Champaign, IL 61820



More information about the R-help mailing list