octave-maintainers
[Top][All Lists]
Advanced

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

Re: diagonal matrices specializations


From: Jaroslav Hajek
Subject: Re: diagonal matrices specializations
Date: Thu, 11 Dec 2008 08:50:55 +0100

On Wed, Dec 10, 2008 at 7:17 PM, Jaroslav Hajek <address@hidden> wrote:
> On Wed, Dec 10, 2008 at 2:16 PM, John W. Eaton <address@hidden> wrote:
>> On 10-Dec-2008, Jaroslav Hajek wrote:
>>
>> | I see. Is it OK if I just leave it in the current state (no saving of
>> | diagonal matrices) and wait until it gets fixed?
>>
>> Would that mean that save would fail with an error if someone
>> attempted to save a workspace that contained a diagonal matrix?  That
>> would be surprising and a regression from previous versions of Octave,
>> so I think we should at least convert them to full matrices that can
>> be saved in the HDF format.
>>
>
> OK, that's right, it will fail. However, the converting is not that
> easy, because what the HDF5 saving code does is that it asks an
> octave_value "what type are you of?", then stores the type name, and
> then calls the value "now save yourself".
> Instead, the sequence needs to be changed to:
> "are you hdf-5 saveable?"
> if yes, then "what type are you of?", write type, "save yourself".
> if not, then "convert yourself" (numeric_conversion), and repeat.
> No big deal, but a little more work.

In particular, it would involve adding an is_hdf5_saveable virtual
method to octave_base_value and
then overriding it in just about every subclass (because making the
default true is a nonsense).
That's why I'm reluctant to do it at once - perhaps it won't be
necessary. Maybe hdf5 format should only recognize a fixed set of
octave's value classes (e.g. array, sparse matrix, scalar...).

> Apparently whoever implemented the hdf5 exporting assumed that
> Octave's types map exactly to the exported data. If David (or someone
> else) wants to rewrite the hdf5 code, then he may want to things in a
> completely different manner, so the work will be useless.
> Perhaps David can comment on whether the above pictured change is the
> way to go, or if he has a different idea.
>
> --
> RNDr. Jaroslav Hajek
> computing expert
> Aeronautical Research and Test Institute (VZLU)
> Prague, Czech Republic
> url: www.highegg.matfyz.cz
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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