SCM

[#6829] Support for Integer Formatted Matrices

Date:
2023-11-19 04:03
Priority:
3
State:
Open
Submitted by:
Steve Mayher (sxm980)
Assigned to:
Nobody (None)
Product:
None
Operating System:
None
Component:
None
Summary:
Support for Integer Formatted Matrices

Detailed description
Hi Matrix development team,

After working with this package a bit and examining its source code, I noticed that integer classes haven't been implemented (i.e. igeMatrix, igCMatrix, igTMatrix, etc.), and I was wondering if these could be implemented. As of right now, if integer data is supplied to a Matrix package matrix constructor (i.e. Matrix::Matrix(), as()), the data is converted to and stored as a vector of type double in the resultant Matrix package object (i.e. as @x in dgeMatrix, dgCMatrix, dgTMatrix, etc.), and while conversion to a double may be necessary depending on down stream analyses, this is not always the case. As doubles are significantly more memory intensive than integers in R, providing implementations for storing and operating on integer matrices could have tangible benefits both in memory usage and computational efficiency, the former of which I've demonstrated in a very brief example markdown file I've attached.

Comments:

Message  ↓
Date: 2023-11-19 14:54
Sender: Mikael Jagan

Support for iMatrix and zMatrix is more or less planned for Matrix 2.y-z and will likely happen at the same time. Most of the source code is "ready" for the expansion but methods for [<- and Ops still need work. Much less trivial than iMatrix is zMatrix, for which we must also consider how to represent complex factorizations for each of QR, LU, Bunch-Kaufman, Cholesky, and Schur. The main question is whether to define new factorization classes or to allow the 'x' slot of the existing classes to be double _or_ complex. (I am leaning towards the latter, but that may require some changes to CHMfactor where we have classes named dCHMsimpl and dCHMsuper ...)

Other hurdles are that R's headers do not declare all of the complex LAPACK routines that we need for a complete implementation and that cholmod_ssmult does not support products of complex matrices.

Of course none of that is relevant to your request for iMatrix. Mostly notes to myself ...

Attached Files:

Attachments:
Size Name Date By Download
1 KiBInteger vs Double Matrices Example.Rmd2023-11-19 04:03sxm980Integer vs Double Matrices Example.Rmd
612 KiBInteger-vs-Double-Matrices-Example.html2023-11-19 04:03sxm980Integer-vs-Double-Matrices-Example.html

Changes

Field Old Value Date By
File Added5222: Integer vs Double Matrices Example.Rmd2023-11-19 04:03sxm980
File Added5223: Integer-vs-Double-Matrices-Example.html2023-11-19 04:03sxm980
Thanks to:
Vienna University of Economics and Business Powered By FusionForge