Ignore:
Timestamp:
06/21/20 21:48:26 (5 years ago)
Author:
jdquinn
Message:

CHG: Cleanup; saving progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/qmu/histogram_bin_uncertain.m

    r25078 r25090  
    1 % %  definition for the histogram_bin_uncertain class.
     1%HISTOGRAM BIN UNCERTAIN class definition
    22%
    3 %  [hbu]=histogram_bin_uncertain(varargin)
     3%       [hbu]=histogram_bin_uncertain(varargin)
    44%
    5 %  where the required varargin are:
    6 %    descriptor    (char, description, '')
    7 %    pairs_per_variable          (double vector, [])
    8 %    abscissas          (double vector, [])
    9 %    counts          (int vector, [])
     5%       where the required varargin are:
     6%               descriptor                      (char, description, '')
     7%               pairs_per_variable      (double vector, [])
     8%               abscissas                       (double vector, [])
     9%               counts                          (int vector, [])
    1010%
    11 %  note that zero arguments constructs a default instance; one
    12 %  argument of the class copies the instance; and three or more
    13 %  arguments constructs a new instance from the arguments.
     11%       NOTE: A call to the constructor with zero arguments will return a default
     12%       instance; one argument of the class copies the instance; three or more
     13%       arguments constructs a new instance from the arguments.
    1414%
    1515classdef histogram_bin_uncertain
    16     properties
    17         descriptor='';
     16        properties
     17                descriptor='';
    1818                pairs_per_variable=[];
    19         abscissas = [];
    20         counts = [];
    21     end
    22 
    23     methods
    24         function [hbu]=histogram_bin_uncertain(varargin) % {{{
    25 
    26             switch nargin
    27                 case 0 %  create a default object
    28                 case 1 %  copy the object
    29                     if isa(varargin{1},'histogram_bin_uncertain')
    30                         hbu=varargin{1};
    31                     else
    32                         error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
    33                             inputname(1),class(varargin{1}),'histogram_bin_uncertain');
    34                     end
    35                 case {2,3} %  not enough arguments
    36                     error('Construction of ''%s'' class object requires at least %d inputs.',...
    37                         'histogram_bin_uncertain',4)
    38                 case 4 %
     19                abscissas = [];
     20                counts = [];
     21        end
     22        methods
     23                function [hbu]=histogram_bin_uncertain(varargin) % {{{
     24                        switch nargin
     25                                case 0 % create a default object
     26                                case 1 % copy the object
     27                                        if isa(varargin{1},'histogram_bin_uncertain')
     28                                                hbu=varargin{1};
     29                                        else
     30                                                error('Object ''%s'' is a ''%s'' class object, not ''%s''.',...
     31                                                        inputname(1),class(varargin{1}),'histogram_bin_uncertain');
     32                                        end
     33                                case {2,3} %  not enough arguments
     34                                        error('Construction of ''histogram_bin_uncertain'' class object requires at least %d inputs.',4)
     35                                case 4 %
    3936                                        %  create the object from the input
    4037                                        hbu = histogram_bin_uncertain;
     
    4441                                        hbu.counts=varargin{4};
    4542
    46                 otherwise
    47                                         error('Construction of histogram_bin_uncertain class object requires three arguments, descriptor, abscissas and counts');
    48             end
    49 
    50         end % }}}
     43                                otherwise
     44                                        error('Construction of histogram_bin_uncertain class object requires either (1) no arguments, (2) a histogram_bin_uncertain instance to copy from, or (3) a descriptor and pairs per variable, abscissas, and counts lists');
     45                        end
     46                end % }}}
    5147                function md=checkconsistency(self,md,solution,analyses) % {{{
    5248                end % }}}
    53         function []=disp(hbu) % {{{
    54 
    55 %  display the object
    56 
    57             disp(sprintf('\n'));
    58             for i=1:numel(hbu)
     49                function []=disp(hbu) % {{{
     50                        % display the object
     51                        disp(sprintf('\n'));
     52                        for i=1:numel(hbu)
    5953                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
    6054                    class(hbu),inputname(1),string_dim(hbu,i)));
     
    6458                disp(sprintf('        counts: %g'      ,hbu(i).counts));
    6559            end
    66 
    6760        end % }}}
    68         function [desc]  =prop_desc(hbu,dstr) % {{{
     61        function [desc]=prop_desc(hbu,dstr) % {{{
    6962            desc=cell(1,numel(hbu));
    7063            for i=1:numel(hbu)
     
    8477            initpt=[];
    8578        end % }}}
    86         function [lower] =prop_lower(hbu) % {{{
     79        function [lower]=prop_lower(hbu) % {{{
    8780            lower=[];
    8881        end % }}}
    89         function [upper] =prop_upper(hbu) % {{{
     82        function [upper]=prop_upper(hbu) % {{{
    9083            upper=[];
    9184        end % }}}
    92         function [mean]  =prop_mean(hbu) % {{{
     85        function [mean]=prop_mean(hbu) % {{{
    9386            mean=[];
    9487        end % }}}
     
    9992            initst=[];
    10093        end % }}}
    101         function [stype] =prop_stype(hbu) % {{{
     94        function [stype]=prop_stype(hbu) % {{{
    10295            stype={};
    10396        end % }}}
    104         function [scale] =prop_scale(hbu) % {{{
     97        function [scale]=prop_scale(hbu) % {{{
    10598            scale=[];
    10699        end % }}}
    107                 function [abscissas] =prop_abscissas(hbu) % {{{
    108                 abscissas=[];
    109                 for i=1:numel(hbu)
    110                         abscissas=[abscissas hbu(i).abscissas];
    111                 end
    112                 abscissas=allequal(abscissas,-Inf);
    113 
    114         end % }}}
     100                function [abscissas]=prop_abscissas(hbu) % {{{
     101                        abscissas=[];
     102                        for i=1:numel(hbu)
     103                                abscissas=[abscissas hbu(i).abscissas];
     104                        end
     105                        abscissas=allequal(abscissas,-Inf);
     106                end % }}}
    115107                function [pairs_per_variable] =prop_pairs_per_variable(hbu) % {{{
    116108                        pairs_per_variable=zeros(1,numel(hbu));
     
    121113        end % }}}
    122114                function [counts] =prop_counts(hbu) % {{{
    123                 counts=[];
    124                 for i=1:numel(hbu)
    125                         counts=[counts hbu(i).counts];
    126                 end
    127                 counts=allequal(counts,-Inf);
    128 
     115                        counts=[];
     116                        for i=1:numel(hbu)
     117                                counts=[counts hbu(i).counts];
     118                        end
     119                        counts=allequal(counts,-Inf);
    129120        end % }}}
    130121                function scaled=isscaled(self) % {{{
     
    138129    methods (Static)
    139130        function []=dakota_write(fidi,dvar) % {{{
     131                        % collect only the variables of the appropriate class
     132                        hbu=struc_class(dvar,'histogram_bin_uncertain');
    140133
    141 %  collect only the variables of the appropriate class
    142 
    143             hbu=struc_class(dvar,'histogram_bin_uncertain');
    144 
    145 %  write variables
    146 
     134                        % write variables
    147135            vlist_write(fidi,'histogram_bin_uncertain','hbu',hbu);
    148136        end % }}}
Note: See TracChangeset for help on using the changeset viewer.