Changeset 25025
- Timestamp:
- 06/12/20 09:11:02 (5 years ago)
- 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 18 18 stddev = NaN; 19 19 partition = []; 20 nsteps 20 nsteps = 0; 21 21 end 22 22 methods … … 24 24 25 25 %recover options: 26 options =pairoptions(varargin{:});26 options=pairoptions(varargin{:}); 27 27 28 28 %initialize fields: … … 106 106 %virtual functions needed by qmu processing algorithms: 107 107 %implemented: 108 function [desc] 108 function [desc]=prop_desc(nuv,dstr) % {{{ 109 109 desc=cell(1,numel(nuv)); 110 110 for i=1:numel(nuv) … … 121 121 desc=allempty(desc); 122 122 end %}}} 123 function [mean] 123 function [mean]=prop_mean(nuv) % {{{ 124 124 mean=zeros(1,numel(nuv)); 125 125 for i=1:numel(nuv) … … 134 134 end % }}} 135 135 %default 136 function [abscissas] 136 function [abscissas]=prop_abscissas(hbu) % {{{ 137 137 abscissas=[]; 138 138 end % }}} 139 function [counts] 139 function [counts]=prop_counts(hbu) % {{{ 140 140 counts=[]; 141 141 end % }}} 142 function [pairs_per_variable] 142 function [pairs_per_variable]=prop_pairs_per_variable(hbu) % {{{ 143 143 pairs_per_variable=[]; 144 144 end % }}} … … 146 146 initpt=[]; 147 147 end % }}} 148 function [lower] 148 function [lower]=prop_lower(nuv) % {{{ 149 149 lower=[]; 150 150 end % }}} 151 function [upper] 151 function [upper]=prop_upper(nuv) % {{{ 152 152 upper=[]; 153 153 end % }}} … … 155 155 initst=[]; 156 156 end % }}} 157 function [stype] 157 function [stype]=prop_stype(nuv) % {{{ 158 158 stype={}; 159 159 end % }}} 160 function [scale] 160 function [scale]=prop_scale(nuv) % {{{ 161 161 scale=[]; 162 162 end % }}} 163 163 %new methods: 164 function scaled 164 function scaled=isscaled(self) % {{{ 165 165 if strncmp(self.descriptor,'scaled_',7), 166 166 scaled=1; -
issm/trunk-jpl/src/m/classes/qmu/uniform_uncertain.m
r24870 r25025 18 18 upper = Inf; 19 19 partition = []; 20 nsteps = 0; 20 21 end 21 22 methods … … 23 24 24 25 %recover options: 25 options =pairoptions(varargin{:});26 options=pairoptions(varargin{:}); 26 27 27 28 %initialize fields: … … 34 35 %partitions as the lower and upper vectors: 35 36 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']); 40 42 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']); 43 51 end 44 52 end … … 54 62 fielddisplay(self,'partition','partition vector defining where sampling will occur'); 55 63 end 64 fielddisplay(self,'nsteps','number of time steps'); 56 65 end 57 66 %}}} … … 65 74 end 66 75 %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'); 69 78 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'); 72 88 end 73 89 … … 90 106 %virtual functions needed by qmu processing algorithms: 91 107 %implemented: 92 function [desc] =prop_desc(uuv,dstr) % {{{108 function [desc]=prop_desc(uuv,dstr) % {{{ 93 109 desc=cell(1,numel(uuv)); 94 110 for i=1:numel(uuv) … … 105 121 desc=allempty(desc); 106 122 end %}}} 107 function [lower] =prop_lower(uuv) % {{{123 function [lower]=prop_lower(uuv) % {{{ 108 124 lower=zeros(1,numel(uuv)); 109 125 for i=1:numel(uuv) … … 112 128 lower=allequal(lower,-Inf); 113 129 end %}}} 114 function [upper] =prop_upper(uuv) % {{{130 function [upper]=prop_upper(uuv) % {{{ 115 131 upper=zeros(1,numel(uuv)); 116 132 for i=1:numel(uuv) … … 123 139 stddev=[]; 124 140 end % }}} 125 function [mean] 141 function [mean]=prop_mean(nuv) % {{{ 126 142 mean=[]; 127 143 end % }}} … … 132 148 initst=[]; 133 149 end %}}} 134 function [stype] 150 function [stype]=prop_stype(uuv) %{{{ 135 151 stype={}; 136 152 end %}}} 137 function [scale] 153 function [scale]=prop_scale(uuv) %{{{ 138 154 scale=[]; 139 155 end %}}} 140 function [abscissas] 156 function [abscissas]=prop_abscissas(hbu) % {{{ 141 157 abscissas=[]; 142 158 end % }}} 143 function [counts] 159 function [counts]=prop_counts(hbu) % {{{ 144 160 counts=[]; 145 161 end % }}} 146 function [pairs_per_variable] 162 function [pairs_per_variable]=prop_pairs_per_variable(hbu) % {{{ 147 163 pairs_per_variable=[]; 148 164 end % }}} 149 165 %new methods: 150 function scaled 166 function scaled=isscaled(self) % {{{ 151 167 if strncmp(self.descriptor,'scaled_',7), 152 168 scaled=1; -
issm/trunk-jpl/src/m/qmu/setupdesign/QmuSetupVariables.m
r25022 r25025 17 17 18 18 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); 20 21 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'); 22 28 end 23 29 elseif isa(variables,'normal_uncertain'),
Note:
See TracChangeset
for help on using the changeset viewer.