octave-maintainers
[Top][All Lists]
Advanced

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

making element_type NDArray parent classes of element_type Matrix


From: Carnë Draug
Subject: making element_type NDArray parent classes of element_type Matrix
Date: Wed, 22 Oct 2014 00:00:33 +0100

Hi

at the moment, both Matrix and NDArray classes are derived from
Array<element_type>.  I may be missing something but I think it makes
more sense to have the Matrix classes derive from a NDArray of the
corresponding element_type.

For starters, I did this for boolMatrix and boolNDArray [1]. It is
building fine and make check is successful.  I would continue this but
maybe others have different opinions on what things should derive
from.

There is also the case to have Matrix classes inherit from both an
AbstractMatrix and element_type NDArray, but that may complicate
things too much for very little gain (or any gain?).

The specific thing that triggered this was trying to implement the
bitpack and bitunpack as boolNDArray methods [2].  That's when I
noticed that implementing on boolNDArray would not make it available
for boolMatrix

Could anyone comment on this change?  If we are going to change where
things derive from, we may as well go for broke and make other bigger
changes that may have been hold back to not break existing code.

Carnë

[1] https://bpaste.net/show/6b5a03b8bda3
[2] http://lists.gnu.org/archive/html/octave-maintainers/2014-10/msg00053.html



reply via email to

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