Re: [Lapackpp-devel] Updating operator<< for matlab, maple, etc.
Status: Beta
Brought to you by:
cstim
From: Jacob \(Jack\) G. <jg...@cs...> - 2005-03-16 15:07:54
|
I like the reasoning of putting it LaException since it's an "exceptional" case. :) I may try the LaPref class. BTW, there is a class variable for each matrix type called info_ or something like that; this is also looked at when printing matrices, shall this possibly be moved into LaPref? I may just end up doing it the easy way with LaException, I guess I'll let you know once it's done. Thanks Jack -----Original Message----- From: Christian Stimming [mailto:sti...@tu...] Sent: Wednesday, March 16, 2005 9:52 AM To: Jacob (Jack) Gryn Cc: lap...@li... Subject: Re: [Lapackpp-devel] Updating operator<< for matlab, maple, etc. Jacob (Jack) Gryn schrieb: > I guess I can put it in LaException, but that would be kind of wrong, since > exceptions generally have nothing to do with the display of matrices. Maybe > it would be better to create a globals.h file or put it in lafnames.h ? I know, I know. On the other hand so far we avoided any extra globals.h file or a corresponding concept. There simply isn't anything global for the lapackpp library so far (except for LaException::_print). I'd therefore stick with this place so far unless we have more than this single reason for introducing more "globality" :-) On the other hand, Lapackpp is meant for high-performance numerics, and "printing" a matrix is therefore quite "exceptional" because it is no longer concerned with high-performance and/or numerics in general. Anyway, for now I'd ask to stick with the LaException class, with many explanations that if there is more than this single global flag then this might be moved to a separate LaPreference class, which should be added in a separate lapref.h header file (source in src/lapref.cc). Well, if you are up to adding this, you can just as well go ahead with that right now. I'm too lazy, but feel free to do this. Christian > > Jack > > -----Original Message----- > From: Christian Stimming [mailto:sti...@tu...] > Sent: Wednesday, March 16, 2005 3:28 AM > To: Jacob (Jack) Gryn > Cc: lap...@li... > Subject: Re: [Lapackpp-devel] Updating operator<< for matlab, maple, etc. > > Hi, > > Jacob (Jack) Gryn schrieb: > >>I've been pretty busy with projects lately, so I haven't had a chance to >>properly implement this into lapackpp; > > > No problem. Take your time :-)) as we all do. > > >>but now that I have an >>opportunity, as I mentioned a few months back, I would like to change >>the operator<< output to give a display that can easily be copied/pasted >>into matlab or maple (or any other math software people may wish to use). > > > Ok. > > >>My question is this: >> >>I would like to make some sort of a global variable called something >>like DISP_FORMAT, that can be set to one of the following: {NORMAL, >>MATLAB, MAPLE, .} > > > Where should I put this variable that it can be accessible to the matrix > >>classes and most programs? > > > So far we don't have any global variables *except* for the > LaException::_print variable. > > Each of the matrix classes also has a static flag whether debug mode is > turned on or not, but a matrix class would probably be the wrong place > for the disp_format flag because that one should affect all matrix > classes at once. > > >>Maybe it should be a member or class variable of the matrix classes >>instead, calling something like myGMD.setDisplay(MATLAB), or >>LaGenMatDouble::setDisplay(MATLAB). ? > > > Probably not quite the best idea, because if you're using several > different matrix classes you would have to call > LaGenMatDouble::setDisplay(bla); > LaGenMatComplex::setDisplay(bla); > LaSymmMatDouble::setDisplay(bla); > > and so on. I would rather want to have only one single library-wide flag > for this and this means there is also only one single library-wide > function to set this. Hm... that one should either go into > LaGenMatDouble because that's the central matrix class, or we abuse the > LaException class for this because that's the only class in lapackpp > that is (potentially) in use by everything. I might actually prefer > LaException::setMatrixDisplay()... do you think that would work? > > Christian > > > > |