[system] / trunk / pg / lib / Value / Context / Diagnostics.pm Repository:
ViewVC logotype

View of /trunk/pg/lib/Value/Context/Diagnostics.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4823 - (download) (as text) (annotate)
Sat Mar 3 00:17:12 2007 UTC (12 years, 9 months ago) by dpvc
File size: 1712 byte(s)
Improved Formula diagonstics when adaptive parameters are used.  They
now allow you to graph the functions (they are no longer considered
multi-variable functions), and the values reported are the adapted
values rather then the unadapted correct answers.  This now correctly
reflects the tests that are being performed.

    1 #########################################################################
    2 #
    3 #  Implement the list of Value::Diagnostics types
    4 #
    5 package Value::Context::Diagnostics;
    6 use strict;
    7 use vars qw (@ISA);
    8 @ISA = qw(Value::Context::Data);
    9 
   10 sub new {
   11   my $self = shift; my $parent = shift;
   12   $self->SUPER::new($parent,
   13     formulas => {
   14       show => 0,
   15       showTestPoints => 1,
   16       showParameters => 1,
   17       showAbsoluteErrors => 1,
   18       showRelativeErrors => 1,
   19       showGraphs => 1,
   20       graphRelativeErrors => 1,
   21       graphAbsoluteErrors => 1,
   22       clipRelativeError => 5,
   23       clipAbsoluteError => 5,
   24       plotTestPoints => 1,
   25       combineGraphs => 1,
   26       checkNumericStability => 1,
   27     },
   28     graphs => {
   29       divisions => 75,
   30       limits => undef,
   31       size => 250,
   32       grid => [10,10],
   33       axes => [0,0],
   34     },
   35     @_,
   36   );
   37 }
   38 
   39 sub init {
   40   my $self = shift;
   41   $self->{dataName} = 'diagnostics';
   42   $self->{name} = 'diagnostics';
   43   $self->{Name} = 'Diagnostics';
   44   $self->{namePattern} = '[-\w_.]+';
   45 }
   46 
   47 sub update {} # no pattern needed
   48 
   49 sub merge {
   50   my $self = shift; my $type = shift;
   51   my $merge = {%{$self->{context}{$self->{dataName}}}};
   52   foreach my $object (@_) {
   53     my $data = $object->{$self->{dataName}}; next unless $data;
   54     $data = {$type=>{@{$data}}} if ref($data) eq 'ARRAY';
   55     $data = {$type=>{show=>$data}} unless ref($data) eq 'HASH';
   56     $merge->{$type}{show} = 1 if scalar(keys(%{$data}));
   57     foreach my $x (keys %{$data}) {
   58       if (ref($merge->{$x}) ne 'HASH') {$merge->{$x} = $data->{$x}}
   59         else {$merge->{$x} = {%{$merge->{$x}},%{$data->{$x}}}}
   60     }
   61   }
   62   return $merge;
   63 }
   64 
   65 
   66 #########################################################################
   67 
   68 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9