[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: need reducing of structures content output
From: |
Muthiah Annamalai |
Subject: |
Re: need reducing of structures content output |
Date: |
Sat, 10 Feb 2007 11:35:13 -0600 |
On Sat, 2007-02-10 at 04:15 -0800, address@hidden wrote:
> Hi all,
> I have very big structures with multiple recursive fields.
> While MATLAB shows it content very well, like
> >>r
> r =
> alg: 'Naum Z. Shor r-algorithm with AST & some
> modifications'
> ralg_info: [1x134 char]
> df: [1000x1 double]
> advanced: [1x1 struct]
> lambda: [4x1 double]
> mu: [8x1 double]
> maxConstrViolation: 1.8025e-007
> nFunEvals: 527
> nGradEvals: 529
> nCEvals: 529
> nDCEvals: 529
> nDHEvals: 529
> prob: [1x1 struct]
> nIter: 254
> CPUTimeElapsed: 1.8594
> TimeElapsed: 2.1400
> solver: 'ralg'
> istop: 4
> msg: 'norm(f[k+1]-f[k]) less than prob.TolFun'
> isFeasible: 1
> xf: [1000x1 double]
> ff: 0.0265
> randInfo: 'increasing prob.TolCon, prob.TolGrad, prob.TolFun,
> prob.TolX can be very helpfull!'
> Octave starts to give output all of fields recursively, i.e. 1000 coords of
> r.df & 1000 of r.xf, + recursive output of subfields r.advanced, r.prob, so
> it's VERY HARD to find usefull information, for example r.isFeasible.
Maybe you could still write a 'display' function for your structure,
that can just show the useful parts of this structure. Is that possible?
I would like to think that, maybe it could work, even if you take it to
Matlab or something.
> Espesially it's hard because normal terminal scrooling is absent (as a rule)
> in Octave text output terminals.
Formatting output yourself will free you from depending on default
behaviour of Matlab or Octave. This is a fix at the moment.
> I guess it will not take much efforts to implement MATLAB-like style of
> structure content output, isn't it?
No that its not impossible; just need to write some mroe new code in the
ov-struct.c/octave_struct::print_raw(...) as one wanted it to be.
It seems Octave, does a DFS print on this, and you want a Breadth first
print out?
Anyway, I would like some pretty-printer module, that can solve a whole
lot of issues, like this without actually touching any of the code in
Octave itself. I like the way Python pretty-printer works, and can
custom-format the lists (deeply-nested ones too), dict's(?) etc
Thanks,
-Muthiah