Changeset 25025


Ignore:
Timestamp:
06/12/20 09:11:02 (5 years ago)
Author:
jdquinn
Message:

CHG: Applied changes from normal_uncertain and handling to unique_uncertain

Location:
issm/trunk-jpl/src/m
Files:
3 edited

Legend:

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

    r25022 r25025  
    1818                stddev          = NaN;
    1919                partition       = [];
    20                 nsteps        = 0;
     20                nsteps          = 0;
    2121        end
    2222        methods
     
    2424
    2525                        %recover options:
    26                         options = pairoptions(varargin{:});
     26                        options=pairoptions(varargin{:});
    2727
    2828                        %initialize fields:
     
    106106                %virtual functions needed by qmu processing algorithms:
    107107                %implemented:
    108                 function [desc]  =prop_desc(nuv,dstr) % {{{
     108                function [desc]=prop_desc(nuv,dstr) % {{{
    109109                        desc=cell(1,numel(nuv));
    110110                        for i=1:numel(nuv)
     
    121121                        desc=allempty(desc);
    122122                end %}}}
    123                 function [mean]  =prop_mean(nuv) % {{{
     123                function [mean]=prop_mean(nuv) % {{{
    124124                        mean=zeros(1,numel(nuv));
    125125                        for i=1:numel(nuv)
     
    134134                end % }}}
    135135                %default
    136                 function [abscissas] =prop_abscissas(hbu) % {{{
     136                function [abscissas]=prop_abscissas(hbu) % {{{
    137137                        abscissas=[];
    138138                end % }}}
    139                 function [counts] =prop_counts(hbu) % {{{
     139                function [counts]=prop_counts(hbu) % {{{
    140140                        counts=[];
    141141                end % }}}
    142                 function [pairs_per_variable] =prop_pairs_per_variable(hbu) % {{{
     142                function [pairs_per_variable]=prop_pairs_per_variable(hbu) % {{{
    143143                        pairs_per_variable=[];
    144144                end % }}}
     
    146146                        initpt=[];
    147147                end % }}}
    148                 function [lower]  =prop_lower(nuv) % {{{
     148                function [lower]=prop_lower(nuv) % {{{
    149149                        lower=[];
    150150                end % }}}
    151                 function [upper]  =prop_upper(nuv) % {{{
     151                function [upper]=prop_upper(nuv) % {{{
    152152                        upper=[];
    153153                end % }}}
     
    155155                        initst=[];
    156156                end % }}}
    157                 function [stype] =prop_stype(nuv) % {{{
     157                function [stype]=prop_stype(nuv) % {{{
    158158                        stype={};
    159159                end % }}}
    160                 function [scale] =prop_scale(nuv) % {{{
     160                function [scale]=prop_scale(nuv) % {{{
    161161                        scale=[];
    162162                end % }}}
    163163                %new methods:
    164                 function scaled =isscaled(self) % {{{
     164                function scaled=isscaled(self) % {{{
    165165                        if strncmp(self.descriptor,'scaled_',7),
    166166                                scaled=1;
  • issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.m

    r24870 r25025  
    1818                upper           = Inf;
    1919                partition       = [];
     20                nsteps          = 0;
    2021        end
    2122        methods
     
    2324
    2425                        %recover options:
    25                         options = pairoptions(varargin{:});
     26                        options=pairoptions(varargin{:});
    2627
    2728                        %initialize fields:
     
    3435                        %partitions as the lower and upper vectors:
    3536                        if self.isscaled(),
    36                                 self.partition=getfieldvalue(options,'partition');
    37                                 npart=partition_npart(self.partition);
    38                                 if npart~=length(self.upper),
    39                                         error(['uniform_uncertain constructor: for the scaled variable' self.descriptor ' the upper field is not currently a vector of values for all the partitions described in the partition vector']);
     37                                self.partition=getfieldvalue(options,'partition');
     38                                self.nsteps=getfieldvalue(options,'nsteps',1);
     39                                npart=qmupart2npart(self.partition);
     40                                if npart~=length(self.upper,1),
     41                                        error(['uniform_uncertain constructor: for the scaled variable' self.descriptor ' the row size of the upper field should be identical to the number of partitions']);
    4042                                end
    41                                 if npart~=length(self.lower),
    42                                         error(['uniform_uncertain constructor: for the scaled variable' self.descriptor ' the lower field is not currently a vector of values for all the partitions described in the partition vector']);
     43                                if npart~=length(self.lower,1),
     44                                        error(['uniform_uncertain constructor: for the scaled variable' self.descriptor ' the row size of the lower field should be identical to the number of partitions']);
     45                                end
     46                                if self.nsteps~=size(self.upper,2),
     47                                        error(['uniform_uncertain constructor: for the scaled variable ' self.descriptor ' the col size of the upper field should be identical to the number of time steps']);
     48                                end
     49                                if self.nsteps~=size(self.lower,2),
     50                                        error(['uniform_uncertain constructor: for the scaled variable ' self.descriptor ' the col size of the lower field should be identical to the number of time steps']);
    4351                                end
    4452                        end
     
    5462                                fielddisplay(self,'partition','partition vector defining where sampling will occur');
    5563                        end
     64                        fielddisplay(self,'nsteps','number of time steps');
    5665                end
    5766                %}}}
     
    6574                                end
    6675                                %better have a partition vector that has as many partitions as upper and lower's size:
    67                                 if length(self.upper)~=partition_npart(self.partition),
    68                                         error('uniform_uncertain error message: upper and partition should be vectors of identical size');
     76                                if length(self.upper,1)~=partition_npart(self.partition),
     77                                        error('uniform_uncertain error message: row size of upper and partition size should be identical');
    6978                                end
    70                                 if length(self.lower)~=partition_npart(self.partition),
    71                                         error('uniform_uncertain error message: lower and partition should be vectors of identical size');
     79                                if length(self.lower,1)~=partition_npart(self.partition),
     80                                        error('uniform_uncertain error message: row size of lower and partition size should be identical');
     81                                end
     82                                %we need as steps in stddev and mean as there are time steps:
     83                                if size(self.upper,2)~=self.nsteps,
     84                                        error('uniform_uncertain error message: col size of upper and number of time steps should be identical');
     85                                end
     86                                if size(self.lower,2)~=self.nsteps,
     87                                        error('uniform_uncertain error message: col size of lower and number of time steps should be identical');
    7288                                end
    7389
     
    90106                %virtual functions needed by qmu processing algorithms:
    91107                %implemented:
    92                 function [desc] = prop_desc(uuv,dstr) % {{{
     108                function [desc]=prop_desc(uuv,dstr) % {{{
    93109                        desc=cell(1,numel(uuv));
    94110                        for i=1:numel(uuv)
     
    105121                        desc=allempty(desc);
    106122                end %}}}
    107                 function [lower] = prop_lower(uuv) % {{{
     123                function [lower]=prop_lower(uuv) % {{{
    108124                        lower=zeros(1,numel(uuv));
    109125                        for i=1:numel(uuv)
     
    112128                        lower=allequal(lower,-Inf);
    113129                end %}}}
    114                 function [upper] = prop_upper(uuv) % {{{
     130                function [upper]=prop_upper(uuv) % {{{
    115131                        upper=zeros(1,numel(uuv));
    116132                        for i=1:numel(uuv)
     
    123139                        stddev=[];
    124140                end % }}}
    125                 function [mean]  =prop_mean(nuv) % {{{
     141                function [mean]=prop_mean(nuv) % {{{
    126142                        mean=[];
    127143                end % }}}
     
    132148                        initst=[];
    133149                end %}}}
    134                 function [stype] =prop_stype(uuv) %{{{
     150                function [stype]=prop_stype(uuv) %{{{
    135151                        stype={};
    136152                end %}}}
    137                 function [scale] =prop_scale(uuv) %{{{
     153                function [scale]=prop_scale(uuv) %{{{
    138154                        scale=[];
    139155                end %}}}
    140                 function [abscissas] =prop_abscissas(hbu) % {{{
     156                function [abscissas]=prop_abscissas(hbu) % {{{
    141157                        abscissas=[];
    142158                end % }}}
    143                 function [counts] =prop_counts(hbu) % {{{
     159                function [counts]=prop_counts(hbu) % {{{
    144160                        counts=[];
    145161                end % }}}
    146                 function [pairs_per_variable] =prop_pairs_per_variable(hbu) % {{{
     162                function [pairs_per_variable]=prop_pairs_per_variable(hbu) % {{{
    147163                        pairs_per_variable=[];
    148164                end % }}}
    149165                %new methods:
    150                 function scaled =isscaled(self) % {{{
     166                function scaled=isscaled(self) % {{{
    151167                        if strncmp(self.descriptor,'scaled_',7),
    152168                                scaled=1;
  • issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m

    r25022 r25025  
    1717
    1818        if isa(variables,'uniform_uncertain'),
    19                 nlower=length(variables.lower); nupper=length(variables.upper);
     19                nlower=length(variables.lower,1);
     20                nupper=length(variables.upper,1);
    2021                if (nlower ~= npart || nupper ~=npart),
    21                         error('QmuSetupVariables error message: upper and lower fields should be same size as the number of partitions');
     22                        error('QmuSetupVariables error message: upper and lower fields should have the same number of rows as the number of partitions');
     23                end
     24                nlower=length(variables.lower,2);
     25                nupper=length(variables.upper,2);
     26                if (nstddev ~= nt || nmean ~=nt),
     27                        error('QmuSetupVariables error message: upper and lower fields should have the same number of cols as the number of time steps');
    2228                end
    2329        elseif isa(variables,'normal_uncertain'),
Note: See TracChangeset for help on using the changeset viewer.