SCM

[#6796] document names/meanings of matrix classes

Date:
2023-02-07 15:32
Priority:
3
State:
Open
Submitted by:
Ben Bolker (bbolker)
Assigned to:
Nobody (None)
Hardware:
All
Product:
None
Operating System:
All
Component:
None
Version:
None
Severity:
None
Resolution:
Wishlist
URL:
Summary:
document names/meanings of matrix classes

Detailed description
Not a bug per se, but I thought this would be the best place for the request.

I'm going a little crazy trying to figure out the class structure/hierarchy in Matrix, and particularly the naming convention. There are lot of "TODO" and "FIXME" in sections 2.3.2, 4. I've been able to reconstruct a certain amount of this (meanings of {d,l,n} x {g, s, t} x {T, R, C} for sparse matrices, haven't ventured too far into the case of dense matrices ...

Comments:

Message  ↓
Date: 2024-03-24 19:43
Sender: Martin Maechler

The current plan is to generalize the naming scheme,
notably also for complex matrices *and* their factorizations
-- which you have not even mentioned...

--> Matrix 1.8-0 (and newer) .. currently only on R-forge

Date: 2023-02-11 23:25
Sender: Mikael Jagan

I do hope that this year I'll be able to sit down and review our vignettes and help pages, and undertake the project of filling in the gaps. It should not be too hard, for instance, to draw some nice trees with tikz to more clearly display the output of showClass("Matrix").

In the mean time ...

The names of the non-virtual subclasses of denseMatrix are [dln](ge|tr|tp|sy|sp|po|pp)Matrix, p?Cholesky, and p?BunchKaufman.

The 'd' in [dln] and the (ge|tr|tp|sy|sp|po|pp) fragment are from LAPACK:

https://netlib.org/lapack/lug/node24.html

p?Cholesky and p?BunchKaufman are subclasses of dtrMatrix or dtpMatrix, reserved for triangular factorizations.

{The BunchKaufman factorization is only "triangular" in the sense that it can be specified by a vector of length n*(n+1)/2. {Well, by that logic, our denseLU class should be a subclass of dgeMatrix, but it isn't ... FIXME??}}

The names of the non-virtual subclasses of sparseMatrix are [dln][gts][CRT]Matrix, [dl]diMatrix, indMatrix, and pMatrix.

The [dln][gts][CRT] code is only LAPACK-like, as LAPACK does not know [CRT]. We are consistent with LAPACK in that we use the third letter to indicate the storage format (cf., dtr* versus dtp*).

The 'di' in [dl]diMatrix _is_ a LAPACK code, but I can't think of any LAPACK routine devoted to diagonal matrices.

indMatrix represents row index matrices and pMatrix is the subclass of indMatrix representing permutation matrices. Neither code is from LAPACK.

{ I'd really like to generalize indMatrix to also encompass column index matrices, by adding a slot named 'margin' (equal to 1L or 2L). It would simplify many of our methods, but also invalidate any serialized indMatrix out there ... sigh ... TODO }

The help page for class <name> is accessed by ?`<name>-class` or help("<name>-class"), the same for all documented S4 classes. Class definitions can be retrieved with getClassDef("<name>").

Attached Files:

Changes

Field Old Value Date By
ResolutionNone2024-03-24 19:43mmaechler
Thanks to:
Vienna University of Economics and Business Powered By FusionForge