Changeset 3094
- Timestamp:
- 02/23/10 15:47:32 (15 years ago)
- Location:
- issm/trunk/src/m/classes
- Files:
-
- 7 added
- 11 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/@continuous_design/continuous_design.m
r905 r3094 21 21 % acknowledged. Any commercial use must be negotiated with 22 22 % the Office of Technology Transfer at the California Institute 23 % of Technology. ( NTR 47078)23 % of Technology. (J. Schiermeier, NTR 47078) 24 24 % 25 25 % This software may be subject to U.S. export control laws. … … 87 87 88 88 end 89 function [desc] =prop_desc(cdv) 90 desc=cell(size(cdv)); 89 90 function []=disp(cdv) 91 92 % display the object 93 94 disp(sprintf('\n')); 91 95 for i=1:numel(cdv) 92 desc(i)=cellstr(cdv(i).descriptor); 96 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 97 class(cdv),inputname(1),string_dim(cdv,i))); 98 disp(sprintf(' descriptor: ''%s''' ,cdv(i).descriptor)); 99 disp(sprintf(' initpt: %g' ,cdv(i).initpt)); 100 disp(sprintf(' lower: %g' ,cdv(i).lower)); 101 disp(sprintf(' upper: %g' ,cdv(i).upper)); 102 disp(sprintf(' scale_type: ''%s''' ,cdv(i).scale_type)); 103 disp(sprintf(' scale: %g' ,cdv(i).scale)); 104 end 105 106 end 107 108 function [desc] =prop_desc(cdv,dstr) 109 desc=cell(1,numel(cdv)); 110 for i=1:numel(cdv) 111 if ~isempty(cdv(i).descriptor) 112 desc(i)=cellstr(cdv(i).descriptor); 113 elseif ~isempty(inputname(1)) 114 desc(i)=cellstr([inputname(1) string_dim(cdv,i)]); 115 elseif exist('dstr','var') 116 desc(i)=cellstr([dstr string_dim(cdv,i)]); 117 else 118 desc(i)=cellstr(['cdv' string_dim(cdv,i)]); 119 end 93 120 end 94 121 desc=allempty(desc); 95 122 end 96 123 function [initpt]=prop_initpt(cdv) 97 initpt=zeros( size(cdv));124 initpt=zeros(1,numel(cdv)); 98 125 for i=1:numel(cdv) 99 126 initpt(i)=cdv(i).initpt; … … 102 129 end 103 130 function [lower] =prop_lower(cdv) 104 lower=zeros( size(cdv));131 lower=zeros(1,numel(cdv)); 105 132 for i=1:numel(cdv) 106 133 lower(i)=cdv(i).lower; … … 109 136 end 110 137 function [upper] =prop_upper(cdv) 111 upper=zeros( size(cdv));138 upper=zeros(1,numel(cdv)); 112 139 for i=1:numel(cdv) 113 140 upper(i)=cdv(i).upper; … … 125 152 end 126 153 function [stype] =prop_stype(cdv) 127 stype=cell( size(cdv));154 stype=cell(1,numel(cdv)); 128 155 for i=1:numel(cdv) 129 156 stype(i)=cellstr(cdv(i).scale_type); … … 132 159 end 133 160 function [scale] =prop_scale(cdv) 134 scale=zeros( size(cdv));161 scale=zeros(1,numel(cdv)); 135 162 for i=1:numel(cdv) 136 163 scale(i)=cdv(i).scale; … … 139 166 end 140 167 end 168 169 methods (Static) 170 function []=dakota_write(fidi,dvar) 171 172 % collect only the variables of the appropriate class 173 174 cdv=struc_class(dvar,'continuous_design'); 175 176 % write variables 177 178 vlist_write(fidi,'continuous_design','cdv',cdv); 179 end 180 end 141 181 end -
issm/trunk/src/m/classes/@continuous_state/continuous_state.m
r905 r3094 19 19 % acknowledged. Any commercial use must be negotiated with 20 20 % the Office of Technology Transfer at the California Institute 21 % of Technology. ( NTR 47078)21 % of Technology. (J. Schiermeier, NTR 47078) 22 22 % 23 23 % This software may be subject to U.S. export control laws. … … 77 77 78 78 end 79 function [desc] =prop_desc(csv) 80 desc=cell(size(csv)); 79 80 function []=disp(csv) 81 82 % display the object 83 84 disp(sprintf('\n')); 81 85 for i=1:numel(csv) 82 desc(i)=cellstr(csv(i).descriptor); 86 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 87 class(csv),inputname(1),string_dim(csv,i))); 88 disp(sprintf(' descriptor: ''%s''' ,csv(i).descriptor)); 89 disp(sprintf(' initst: %g' ,csv(i).initst)); 90 disp(sprintf(' lower: %g' ,csv(i).lower)); 91 disp(sprintf(' upper: %g\n' ,csv(i).upper)); 92 end 93 94 end 95 96 function [desc] =prop_desc(csv,dstr) 97 desc=cell(1,numel(csv)); 98 for i=1:numel(csv) 99 if ~isempty(csv(i).descriptor) 100 desc(i)=cellstr(csv(i).descriptor); 101 elseif ~isempty(inputname(1)) 102 desc(i)=cellstr([inputname(1) string_dim(csv,i)]); 103 elseif exist('dstr','var') 104 desc(i)=cellstr([dstr string_dim(csv,i)]); 105 else 106 desc(i)=cellstr(['csv' string_dim(csv,i)]); 107 end 83 108 end 84 109 desc=allempty(desc); … … 88 113 end 89 114 function [lower] =prop_lower(csv) 90 lower=zeros( size(csv));115 lower=zeros(1,numel(csv)); 91 116 for i=1:numel(csv) 92 117 lower(i)=csv(i).lower; … … 95 120 end 96 121 function [upper] =prop_upper(csv) 97 upper=zeros( size(csv));122 upper=zeros(1,numel(csv)); 98 123 for i=1:numel(csv) 99 124 upper(i)=csv(i).upper; … … 108 133 end 109 134 function [initst]=prop_initst(csv) 110 initst=zeros( size(csv));135 initst=zeros(1,numel(csv)); 111 136 for i=1:numel(csv) 112 137 initst(i)=csv(i).initst; … … 121 146 end 122 147 end 148 149 methods (Static) 150 function []=dakota_write(fidi,dvar) 151 152 % collect only the variables of the appropriate class 153 154 csv=struc_class(dvar,'continuous_state'); 155 156 % write variables 157 158 vlist_write(fidi,'continuous_state','csv',csv); 159 end 160 end 123 161 end -
issm/trunk/src/m/classes/@dakota_method/dakota_method.m
r2122 r3094 28 28 % acknowledged. Any commercial use must be negotiated with 29 29 % the Office of Technology Transfer at the California Institute 30 % of Technology. ( NTR 47078)30 % of Technology. (J. Schiermeier, NTR 47078) 31 31 % 32 32 % This software may be subject to U.S. export control laws. … … 38 38 % 39 39 classdef dakota_method 40 properties 40 properties (SetAccess=private) 41 41 method =''; 42 42 type =''; … … 45 45 responses={}; 46 46 ghspec ={}; 47 end 48 properties 47 49 params =struct(); 48 50 end … … 132 134 'dot_frcg'} 133 135 dm.type ='dot'; 134 dm.variables={'cdv','csv'}; 135 dm.lcspec ={}; 136 dm.responses={'of'}; 136 dm.variables={'continuous_design',... 137 'continuous_state'}; 138 dm.lcspec ={}; 139 dm.responses={'objective_function'}; 137 140 dm.ghspec ={'grad'}; 138 141 dm.params.max_iterations=false; … … 148 151 'dot_sqp'} 149 152 dm.type ='dot'; 150 dm.variables={'cdv','csv'}; 151 dm.lcspec ={'lic','lec'}; 152 dm.responses={'of','nic','nec'}; 153 dm.variables={'continuous_design',... 154 'continuous_state'}; 155 dm.lcspec ={'linear_inequality_constraint',... 156 'linear_equality_constraint'}; 157 dm.responses={'objective_function',... 158 'nonlinear_inequality_constraint',... 159 'nonlinear_equality_constraint'}; 153 160 dm.ghspec ={'grad'}; 154 161 dm.params.max_iterations=false; … … 163 170 case {'npsol_sqp'} 164 171 dm.type ='npsol'; 165 dm.variables={'cdv','csv'}; 166 dm.lcspec ={'lic','lec'}; 167 dm.responses={'of','nic','nec'}; 172 dm.variables={'continuous_design',... 173 'continuous_state'}; 174 dm.lcspec ={'linear_inequality_constraint',... 175 'linear_equality_constraint'}; 176 dm.responses={'objective_function',... 177 'nonlinear_inequality_constraint',... 178 'nonlinear_equality_constraint'}; 168 179 dm.ghspec ={'grad'}; 169 180 dm.params.max_iterations=false; … … 180 191 case {'conmin_frcg'} 181 192 dm.type ='conmin'; 182 dm.variables={'cdv','csv'}; 183 dm.lcspec ={}; 184 dm.responses={'of'}; 193 dm.variables={'continuous_design',... 194 'continuous_state'}; 195 dm.lcspec ={}; 196 dm.responses={'objective_function'}; 185 197 dm.ghspec ={'grad'}; 186 198 dm.params.max_iterations=false; … … 193 205 case {'conmin_mfd'} 194 206 dm.type ='conmin'; 195 dm.variables={'cdv','csv'}; 196 dm.lcspec ={'lic','lec'}; 197 dm.responses={'of','nic','nec'}; 207 dm.variables={'continuous_design',... 208 'continuous_state'}; 209 dm.lcspec ={'linear_inequality_constraint',... 210 'linear_equality_constraint'}; 211 dm.responses={'objective_function',... 212 'nonlinear_inequality_constraint',... 213 'nonlinear_equality_constraint'}; 198 214 dm.ghspec ={'grad'}; 199 215 dm.params.max_iterations=false; … … 207 223 case {'optpp_cg'} 208 224 dm.type ='optpp'; 209 dm.variables={'cdv','csv'}; 210 dm.lcspec ={}; 211 dm.responses={'of'}; 225 dm.variables={'continuous_design',... 226 'continuous_state'}; 227 dm.lcspec ={}; 228 dm.responses={'objective_function'}; 212 229 dm.ghspec ={'grad'}; 213 230 dm.params.max_iterations=false; … … 223 240 'optpp_newton'} 224 241 dm.type ='optpp'; 225 dm.variables={'cdv','csv'}; 226 dm.lcspec ={'lic','lec'}; 227 dm.responses={'of','nic','nec'}; 242 dm.variables={'continuous_design',... 243 'continuous_state'}; 244 dm.lcspec ={'linear_inequality_constraint',... 245 'linear_equality_constraint'}; 246 dm.responses={'objective_function',... 247 'nonlinear_inequality_constraint',... 248 'nonlinear_equality_constraint'}; 228 249 dm.ghspec ={'grad'}; 229 250 dm.params.max_iterations=false; … … 245 266 case {'optpp_pds'} 246 267 dm.type ='optpp'; 247 dm.variables={'cdv','csv'}; 248 dm.lcspec ={}; 249 dm.responses={'of'}; 268 dm.variables={'continuous_design',... 269 'continuous_state'}; 270 dm.lcspec ={}; 271 dm.responses={'objective_function'}; 250 272 dm.ghspec ={'grad'}; 251 273 dm.params.max_iterations=false; … … 259 281 case {'asynch_pattern_search'} 260 282 dm.type ='apps'; 261 dm.variables={'cdv','csv'}; 262 dm.lcspec ={'lic','lec'}; 263 dm.responses={'of','nic','nec'}; 283 dm.variables={'continuous_design',... 284 'continuous_state'}; 285 dm.lcspec ={'linear_inequality_constraint',... 286 'linear_equality_constraint'}; 287 dm.responses={'objective_function',... 288 'nonlinear_inequality_constraint',... 289 'nonlinear_equality_constraint'}; 264 290 dm.ghspec ={'grad'}; 265 291 dm.params.max_function_evaluations=false; … … 278 304 case {'coliny_cobyla'} 279 305 dm.type ='coliny'; 280 dm.variables={'cdv','csv'}; 281 dm.lcspec ={}; 282 dm.responses={'of','nic','nec'}; 306 dm.variables={'continuous_design',... 307 'continuous_state'}; 308 dm.lcspec ={}; 309 dm.responses={'objective_function',... 310 'nonlinear_inequality_constraint',... 311 'nonlinear_equality_constraint'}; 283 312 dm.ghspec ={'grad'}; 284 313 dm.params.max_iterations=false; … … 294 323 case {'coliny_direct'} 295 324 dm.type ='coliny'; 296 dm.variables={'cdv','csv'}; 297 dm.lcspec ={}; 298 dm.responses={'of','nic','nec'}; 325 dm.variables={'continuous_design',... 326 'continuous_state'}; 327 dm.lcspec ={}; 328 dm.responses={'objective_function',... 329 'nonlinear_inequality_constraint',... 330 'nonlinear_equality_constraint'}; 299 331 dm.ghspec ={'grad'}; 300 332 dm.params.max_iterations=false; … … 314 346 case {'coliny_ea'} 315 347 dm.type ='coliny'; 316 dm.variables={'cdv','csv'}; 317 dm.lcspec ={}; 318 dm.responses={'of','nic','nec'}; 348 dm.variables={'continuous_design',... 349 'continuous_state'}; 350 dm.lcspec ={}; 351 dm.responses={'objective_function',... 352 'nonlinear_inequality_constraint',... 353 'nonlinear_equality_constraint'}; 319 354 dm.ghspec ={'grad'}; 320 355 dm.params.max_iterations=false; … … 345 380 case {'coliny_pattern_search'} 346 381 dm.type ='coliny'; 347 dm.variables={'cdv','csv'}; 348 dm.lcspec ={}; 349 dm.responses={'of','nic','nec'}; 382 dm.variables={'continuous_design',... 383 'continuous_state'}; 384 dm.lcspec ={}; 385 dm.responses={'objective_function',... 386 'nonlinear_inequality_constraint',... 387 'nonlinear_equality_constraint'}; 350 388 dm.ghspec ={'grad'}; 351 389 dm.params.max_iterations=false; … … 372 410 case {'coliny_solis_wets'} 373 411 dm.type ='coliny'; 374 dm.variables={'cdv','csv'}; 375 dm.lcspec ={}; 376 dm.responses={'of','nic','nec'}; 412 dm.variables={'continuous_design',... 413 'continuous_state'}; 414 dm.lcspec ={}; 415 dm.responses={'objective_function',... 416 'nonlinear_inequality_constraint',... 417 'nonlinear_equality_constraint'}; 377 418 dm.ghspec ={'grad'}; 378 419 dm.params.max_iterations=false; … … 396 437 case {'ncsu_direct'} 397 438 dm.type ='ncsu'; 398 dm.variables={'cdv','csv'}; 399 dm.lcspec ={'lic','lec'}; % ? 400 dm.responses={'of','nic','nec'}; % ? 439 dm.variables={'continuous_design',... 440 'continuous_state'}; 441 dm.lcspec ={'linear_inequality_constraint',... 442 'linear_equality_constraint'}; % ? 443 dm.responses={'objective_function',... 444 'nonlinear_inequality_constraint',... 445 'nonlinear_equality_constraint'}; % ? 401 446 dm.ghspec ={'grad'}; 402 447 dm.params.max_iterations=false; … … 412 457 case {'moga'} 413 458 dm.type ='jega'; 414 dm.variables={'cdv','csv'}; 415 dm.lcspec ={'lic','lec'}; 416 dm.responses={'of','nic','nec'}; 459 dm.variables={'continuous_design',... 460 'continuous_state'}; 461 dm.lcspec ={'linear_inequality_constraint',... 462 'linear_equality_constraint'}; 463 dm.responses={'objective_function',... 464 'nonlinear_inequality_constraint',... 465 'nonlinear_equality_constraint'}; 417 466 dm.ghspec ={'grad'}; 418 467 dm.params.max_iterations=false; … … 452 501 case {'soga'} 453 502 dm.type ='jega'; 454 dm.variables={'cdv','csv'}; 455 dm.lcspec ={'lic','lec'}; 456 dm.responses={'of','nic','nec'}; 503 dm.variables={'continuous_design',... 504 'continuous_state'}; 505 dm.lcspec ={'linear_inequality_constraint',... 506 'linear_equality_constraint'}; 507 dm.responses={'objective_function',... 508 'nonlinear_inequality_constraint',... 509 'nonlinear_equality_constraint'}; 457 510 dm.ghspec ={'grad'}; 458 511 dm.params.max_iterations=false; … … 489 542 case {'nl2sol'} 490 543 dm.type ='lsq'; 491 dm.variables={'cdv','csv'}; 492 dm.lcspec ={}; 493 dm.responses={'lst'}; 544 dm.variables={'continuous_design',... 545 'continuous_state'}; 546 dm.lcspec ={}; 547 dm.responses={'least_squares_term'}; 494 548 dm.ghspec ={'grad'}; 495 549 dm.params.max_iterations=false; … … 509 563 case {'nlssol_sqp'} 510 564 dm.type ='lsq'; 511 dm.variables={'cdv','csv'}; 512 dm.lcspec ={'lic','lec'}; 513 dm.responses={'lst','nic','nec'}; 565 dm.variables={'continuous_design',... 566 'continuous_state'}; 567 dm.lcspec ={'linear_inequality_constraint',... 568 'linear_equality_constraint'}; 569 dm.responses={'least_squares_term',... 570 'nonlinear_inequality_constraint',... 571 'nonlinear_equality_constraint'}; 514 572 dm.ghspec ={'grad'}; 515 573 dm.params.max_iterations=false; … … 525 583 case {'optpp_g_newton'} 526 584 dm.type ='lsq'; 527 dm.variables={'cdv','csv'}; 528 dm.lcspec ={'lic','lec'}; 529 dm.responses={'lst','nic','nec'}; 585 dm.variables={'continuous_design',... 586 'continuous_state'}; 587 dm.lcspec ={'linear_inequality_constraint',... 588 'linear_equality_constraint'}; 589 dm.responses={'least_squares_term',... 590 'nonlinear_inequality_constraint',... 591 'nonlinear_equality_constraint'}; 530 592 dm.ghspec ={'grad'}; 531 593 dm.params.max_iterations=false; … … 548 610 case {'nond_sampling'} 549 611 dm.type ='nond'; 550 dm.variables={'nuv','csv'}; 551 dm.lcspec ={}; 552 dm.responses={'rf'}; 612 dm.variables={'normal_uncertain',... 613 'uniform_uncertain',... 614 'continuous_state'}; 615 dm.lcspec ={}; 616 dm.responses={'response_function'}; 553 617 dm.ghspec ={}; 554 618 % not documented, but apparently works … … 563 627 case {'nond_local_reliability'} 564 628 dm.type ='nond'; 565 dm.variables={'nuv','csv'}; 566 dm.lcspec ={}; 567 dm.responses={'rf'}; 629 dm.variables={'normal_uncertain',... 630 'uniform_uncertain',... 631 'continuous_state'}; 632 dm.lcspec ={}; 633 dm.responses={'response_function'}; 568 634 dm.ghspec ={'grad'}; 569 635 % not documented, but may work … … 580 646 case {'nond_global_reliability'} 581 647 dm.type ='nond'; 582 dm.variables={'nuv','csv'}; 583 dm.lcspec ={}; 584 dm.responses={'rf'}; 648 dm.variables={'normal_uncertain',... 649 'uniform_uncertain',... 650 'continuous_state'}; 651 dm.lcspec ={}; 652 dm.responses={'response_function'}; 585 653 dm.ghspec ={'grad'}; 586 654 % not documented, but may work … … 592 660 case {'nond_polynomial_chaos'} 593 661 dm.type ='nond'; 594 dm.variables={'nuv','csv'}; 595 dm.lcspec ={}; 596 dm.responses={'rf'}; 662 dm.variables={'normal_uncertain',... 663 'uniform_uncertain',... 664 'continuous_state'}; 665 dm.lcspec ={}; 666 dm.responses={'response_function'}; 597 667 dm.ghspec ={'grad'}; 598 668 % not documented, but may work … … 615 685 case {'nond_stoch_collocation'} 616 686 dm.type ='nond'; 617 dm.variables={'nuv','csv'}; 618 dm.lcspec ={}; 619 dm.responses={'rf'}; 687 dm.variables={'normal_uncertain',... 688 'uniform_uncertain',... 689 'continuous_state'}; 690 dm.lcspec ={}; 691 dm.responses={'response_function'}; 620 692 dm.ghspec ={'grad'}; 621 693 % not documented, but may work … … 630 702 case {'nond_evidence'} 631 703 dm.type ='nond'; 632 dm.variables={'nuv','csv'}; 633 dm.lcspec ={}; 634 dm.responses={'rf'}; 704 dm.variables={'normal_uncertain',... 705 'uniform_uncertain',... 706 'continuous_state'}; 707 dm.lcspec ={}; 708 dm.responses={'response_function'}; 635 709 dm.ghspec ={'grad'}; 636 710 % not documented, but may work … … 641 715 case {'dace'} 642 716 dm.type ='dace'; 643 dm.variables={'cdv','csv'}; 644 dm.lcspec ={}; 645 dm.responses={'rf'}; 717 dm.variables={'continuous_design',... 718 'continuous_state'}; 719 dm.lcspec ={}; 720 dm.responses={'objective_function',... 721 'response_function'}; 646 722 dm.ghspec ={}; 647 723 dm.params.grid=false; … … 660 736 case {'fsu_quasi_mc'} 661 737 dm.type ='dace'; 662 dm.variables={'cdv','csv'}; 663 dm.lcspec ={}; 664 dm.responses={'rf'}; 738 dm.variables={'continuous_design',... 739 'continuous_state'}; 740 dm.lcspec ={}; 741 dm.responses={'objective_function',... 742 'response_function'}; 665 743 dm.ghspec ={}; 666 744 dm.params.halton=false; … … 676 754 case {'fsu_cvt'} 677 755 dm.type ='dace'; 678 dm.variables={'cdv','csv'}; 679 dm.lcspec ={}; 680 dm.responses={'rf'}; 756 dm.variables={'continuous_design',... 757 'continuous_state'}; 758 dm.lcspec ={}; 759 dm.responses={'objective_function',... 760 'response_function'}; 681 761 dm.ghspec ={}; 682 762 dm.params.seed=false; … … 691 771 case {'vector_parameter_study'} 692 772 dm.type ='param'; 693 dm.variables={'cdv','nuv','csv'}; 694 dm.lcspec ={}; 695 dm.responses={'rf'}; 773 dm.variables={'continuous_design',... 774 'normal_uncertain',... 775 'uniform_uncertain',... 776 'continuous_state'}; 777 dm.lcspec ={}; 778 dm.responses={'objective_function',... 779 'response_function'}; 696 780 dm.ghspec ={}; 697 781 dm.params.output=false; … … 703 787 case {'list_parameter_study'} 704 788 dm.type ='param'; 705 dm.variables={'cdv','nuv','csv'}; 706 dm.lcspec ={}; 707 dm.responses={'rf'}; 789 dm.variables={'continuous_design',... 790 'normal_uncertain',... 791 'uniform_uncertain',... 792 'continuous_state'}; 793 dm.lcspec ={}; 794 dm.responses={'objective_function',... 795 'response_function'}; 708 796 dm.ghspec ={}; 709 797 dm.params.output=false; … … 711 799 case {'centered_parameter_study'} 712 800 dm.type ='param'; 713 dm.variables={'cdv','nuv','csv'}; 714 dm.lcspec ={}; 715 dm.responses={'rf'}; 801 dm.variables={'continuous_design',... 802 'normal_uncertain',... 803 'uniform_uncertain',... 804 'continuous_state'}; 805 dm.lcspec ={}; 806 dm.responses={'objective_function',... 807 'response_function'}; 716 808 dm.ghspec ={}; 717 809 dm.params.output=false; … … 720 812 case {'multidim_parameter_study'} 721 813 dm.type ='param'; 722 dm.variables={'cdv','nuv','csv'}; 723 dm.lcspec ={}; 724 dm.responses={'rf'}; 814 dm.variables={'continuous_design',... 815 'normal_uncertain',... 816 'uniform_uncertain',... 817 'continuous_state'}; 818 dm.lcspec ={}; 819 dm.responses={'objective_function',... 820 'response_function'}; 725 821 dm.ghspec ={}; 726 822 dm.params.output=false; … … 742 838 743 839 end 840 841 function []=disp(dm) 842 843 % display the object 844 845 for i=1:numel(dm) 846 disp(sprintf('\nclass ''%s'' object ''%s%s'' = \n',... 847 class(dm),inputname(1),string_dim(dm,i))); 848 disp(sprintf(' method: ''%s''' ,dm(i).method)); 849 disp(sprintf(' type: ''%s''' ,dm(i).type)); 850 disp(sprintf(' variables: %s' ,string_cell(dm(i).variables))); 851 disp(sprintf(' lcspec: %s' ,string_cell(dm(i).lcspec))); 852 disp(sprintf(' responses: %s' ,string_cell(dm(i).responses))); 853 disp(sprintf(' ghspec: %s\n' ,string_cell(dm(i).ghspec))); 854 855 % display the parameters within the object 856 857 fnames=fieldnames(dm(i).params); 858 maxlen=0; 859 for j=1:numel(fnames) 860 maxlen=max(maxlen,length(fnames{j})); 861 end 862 863 for j=1:numel(fnames) 864 disp(sprintf([' params.%-' num2str(maxlen+1) 's: %s'],... 865 fnames{j},any2str(dm(i).params.(fnames{j})))); 866 end 867 end 868 869 end 744 870 end 745 871 end 872 -
issm/trunk/src/m/classes/@least_squares_term/least_squares_term.m
r905 r3094 19 19 % acknowledged. Any commercial use must be negotiated with 20 20 % the Office of Technology Transfer at the California Institute 21 % of Technology. ( NTR 47078)21 % of Technology. (J. Schiermeier, NTR 47078) 22 22 % 23 23 % This software may be subject to U.S. export control laws. … … 61 61 62 62 if (nargin > 4) 63 warning(' objective_function:extra_arg',...63 warning('least_squares_term:extra_arg',... 64 64 'Extra arguments for object of class ''%s''.',... 65 65 class(lst)); … … 72 72 73 73 end 74 function [desc] =prop_desc(lst) 75 desc=cell(size(lst)); 74 75 function []=disp(lst) 76 77 % display the object 78 79 disp(sprintf('\n')); 76 80 for i=1:numel(lst) 77 desc(i)=cellstr(lst(i).descriptor); 81 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 82 class(lst),inputname(1),string_dim(lst,i))); 83 disp(sprintf(' descriptor: ''%s''' ,lst(i).descriptor)); 84 disp(sprintf(' scale_type: ''%s''' ,lst(i).scale_type)); 85 disp(sprintf(' scale: %g' ,lst(i).scale)); 86 disp(sprintf(' weight: %g\n' ,lst(i).weight)); 87 end 88 89 end 90 91 function [desc] =prop_desc(lst,dstr) 92 desc=cell(1,numel(lst)); 93 for i=1:numel(lst) 94 if ~isempty(lst(i).descriptor) 95 desc(i)=cellstr(lst(i).descriptor); 96 elseif ~isempty(inputname(1)) 97 desc(i)=cellstr([inputname(1) string_dim(lst,i)]); 98 elseif exist('dstr','var') 99 desc(i)=cellstr([dstr string_dim(lst,i)]); 100 else 101 desc(i)=cellstr(['lst' string_dim(lst,i)]); 102 end 78 103 end 79 104 desc=allempty(desc); 80 105 end 81 106 function [stype] =prop_stype(lst) 82 stype=cell( size(lst));107 stype=cell(1,numel(lst)); 83 108 for i=1:numel(lst) 84 109 stype(i)=cellstr(lst(i).scale_type); … … 87 112 end 88 113 function [scale] =prop_scale(lst) 89 scale=zeros( size(lst));114 scale=zeros(1,numel(lst)); 90 115 for i=1:numel(lst) 91 116 scale(i)=lst(i).scale; … … 94 119 end 95 120 function [weight]=prop_weight(lst) 96 weight=zeros( size(lst));121 weight=zeros(1,numel(lst)); 97 122 for i=1:numel(lst) 98 123 weight(i)=lst(i).weight; … … 110 135 end 111 136 end 137 138 methods (Static) 139 function [rdesc]=dakota_write(fidi,dresp,rdesc) 140 141 % collect only the responses of the appropriate class 142 143 lst=struc_class(dresp,'least_squares_term'); 144 145 % write responses 146 147 [rdesc]=rlist_write(fidi,'least_squares_terms','least_squares_term',lst,rdesc); 148 end 149 150 function []=dakota_rlev_write(fidi,dresp,params) 151 end 152 end 112 153 end -
issm/trunk/src/m/classes/@linear_equality_constraint/linear_equality_constraint.m
r905 r3094 19 19 % acknowledged. Any commercial use must be negotiated with 20 20 % the Office of Technology Transfer at the California Institute 21 % of Technology. ( NTR 47078)21 % of Technology. (J. Schiermeier, NTR 47078) 22 22 % 23 23 % This software may be subject to U.S. export control laws. … … 83 83 end 84 84 85 function []=disp(lec) 86 87 % display the object 88 89 disp(sprintf('\n')); 90 for i=1:numel(lec) 91 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 92 class(lec),inputname(1),string_dim(lec,i))); 93 disp(sprintf(' matrix: %s' ,string_vec(lec(i).matrix))); 94 disp(sprintf(' target: %g' ,lec(i).target)); 95 disp(sprintf(' scale_type: ''%s''' ,lec(i).scale_type)); 96 disp(sprintf(' scale: %g\n' ,lec(i).scale)); 97 end 98 99 end 100 85 101 function [matrix]=prop_matrix(lec) 86 102 matrix=zeros(numel(lec),0); … … 117 133 end 118 134 end 135 136 methods (Static) 137 function []=dakota_write(fidi,dvar) 138 139 % collect only the variables of the appropriate class 140 141 lec=struc_class(dvar,'linear_equality_constraint'); 142 143 % write constraints 144 145 lclist_write(fidi,'linear_equality_constraints','linear_equality',lec); 146 end 147 end 119 148 end -
issm/trunk/src/m/classes/@linear_inequality_constraint/linear_inequality_constraint.m
r905 r3094 20 20 % acknowledged. Any commercial use must be negotiated with 21 21 % the Office of Technology Transfer at the California Institute 22 % of Technology. ( NTR 47078)22 % of Technology. (J. Schiermeier, NTR 47078) 23 23 % 24 24 % This software may be subject to U.S. export control laws. … … 94 94 end 95 95 96 function []=disp(lic) 97 98 % display the object 99 100 disp(sprintf('\n')); 101 for i=1:numel(lic) 102 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 103 class(lic),inputname(1),string_dim(lic,i))); 104 disp(sprintf(' matrix: %s' ,string_vec(lic(i).matrix))); 105 disp(sprintf(' lower: %g' ,lic(i).lower)); 106 disp(sprintf(' upper: %g' ,lic(i).upper)); 107 disp(sprintf(' scale_type: ''%s''' ,lic(i).scale_type)); 108 disp(sprintf(' scale: %g\n' ,lic(i).scale)); 109 end 110 111 end 112 96 113 function [matrix]=prop_matrix(lic) 97 114 matrix=zeros(numel(lic),0); … … 132 149 end 133 150 end 151 152 methods (Static) 153 function []=dakota_write(fidi,dvar) 154 155 % collect only the variables of the appropriate class 156 157 lic=struc_class(dvar,'linear_inequality_constraint'); 158 159 % write constraints 160 161 lclist_write(fidi,'linear_inequality_constraints','linear_inequality',lic); 162 end 163 end 134 164 end 135 165 -
issm/trunk/src/m/classes/@nonlinear_equality_constraint/nonlinear_equality_constraint.m
r905 r3094 19 19 % acknowledged. Any commercial use must be negotiated with 20 20 % the Office of Technology Transfer at the California Institute 21 % of Technology. ( NTR 47078)21 % of Technology. (J. Schiermeier, NTR 47078) 22 22 % 23 23 % This software may be subject to U.S. export control laws. … … 76 76 77 77 end 78 function [desc] =prop_desc(nec) 79 desc=cell(size(nec)); 78 79 function []=disp(nec) 80 81 % display the object 82 83 disp(sprintf('\n')); 80 84 for i=1:numel(nec) 81 desc(i)=cellstr(nec(i).descriptor); 85 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 86 class(nec),inputname(1),string_dim(nec,i))); 87 disp(sprintf(' descriptor: ''%s''' ,nec(i).descriptor)); 88 disp(sprintf(' target: %g' ,nec(i).target)); 89 disp(sprintf(' scale_type: ''%s''' ,nec(i).scale_type)); 90 disp(sprintf(' scale: %g\n' ,nec(i).scale)); 91 end 92 93 end 94 95 function [desc] =prop_desc(nec,dstr) 96 desc=cell(1,numel(nec)); 97 for i=1:numel(nec) 98 if ~isempty(nec(i).descriptor) 99 desc(i)=cellstr(nec(i).descriptor); 100 elseif ~isempty(inputname(1)) 101 desc(i)=cellstr([inputname(1) string_dim(nec,i)]); 102 elseif exist('dstr','var') 103 desc(i)=cellstr([dstr string_dim(nec,i)]); 104 else 105 desc(i)=cellstr(['nec' string_dim(nec,i)]); 106 end 82 107 end 83 108 desc=allempty(desc); … … 114 139 end 115 140 end 141 142 methods (Static) 143 function [rdesc]=dakota_write(fidi,dresp,rdesc) 144 145 % collect only the responses of the appropriate class 146 147 nec=struc_class(dresp,'nonlinear_equality_constraint'); 148 149 % write responses 150 151 [rdesc]=rlist_write(fidi,'nonlinear_equality_constraints','nonlinear_equality',nec,rdesc); 152 end 153 154 function []=dakota_rlev_write(fidi,dresp,params) 155 end 156 end 116 157 end -
issm/trunk/src/m/classes/@nonlinear_inequality_constraint/nonlinear_inequality_constraint.m
r905 r3094 20 20 % acknowledged. Any commercial use must be negotiated with 21 21 % the Office of Technology Transfer at the California Institute 22 % of Technology. ( NTR 47078)22 % of Technology. (J. Schiermeier, NTR 47078) 23 23 % 24 24 % This software may be subject to U.S. export control laws. … … 85 85 86 86 end 87 function [desc] =prop_desc(nic) 88 desc=cell(size(nic)); 87 88 function []=disp(nic) 89 90 % display the object 91 92 disp(sprintf('\n')); 89 93 for i=1:numel(nic) 90 desc(i)=cellstr(nic(i).descriptor); 94 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 95 class(nic),inputname(1),string_dim(nic,i))); 96 disp(sprintf(' descriptor: ''%s''' ,nic(i).descriptor)); 97 disp(sprintf(' lower: %g' ,nic(i).lower)); 98 disp(sprintf(' upper: %g' ,nic(i).upper)); 99 disp(sprintf(' scale_type: ''%s''' ,nic(i).scale_type)); 100 disp(sprintf(' scale: %g\n' ,nic(i).scale)); 101 end 102 103 end 104 105 function [desc] =prop_desc(nic,dstr) 106 desc=cell(1,numel(nic)); 107 for i=1:numel(nic) 108 if ~isempty(nic(i).descriptor) 109 desc(i)=cellstr(nic(i).descriptor); 110 elseif ~isempty(inputname(1)) 111 desc(i)=cellstr([inputname(1) string_dim(nic,i)]); 112 elseif exist('dstr','var') 113 desc(i)=cellstr([dstr string_dim(nic,i)]); 114 else 115 desc(i)=cellstr(['nic' string_dim(nic,i)]); 116 end 91 117 end 92 118 desc=allempty(desc); … … 127 153 end 128 154 end 155 156 methods (Static) 157 function [rdesc]=dakota_write(fidi,dresp,rdesc) 158 159 % collect only the responses of the appropriate class 160 161 nic=struc_class(dresp,'nonlinear_inequality_constraint'); 162 163 % write responses 164 165 [rdesc]=rlist_write(fidi,'nonlinear_inequality_constraints','nonlinear_inequality',nic,rdesc); 166 end 167 168 function []=dakota_rlev_write(fidi,dresp,params) 169 end 170 end 129 171 end -
issm/trunk/src/m/classes/@normal_uncertain/normal_uncertain.m
r905 r3094 20 20 % acknowledged. Any commercial use must be negotiated with 21 21 % the Office of Technology Transfer at the California Institute 22 % of Technology. ( NTR 47078)22 % of Technology. (J. Schiermeier, NTR 47078) 23 23 % 24 24 % This software may be subject to U.S. export control laws. … … 84 84 85 85 end 86 function [desc] =prop_desc(nuv) 87 desc=cell(size(nuv)); 86 87 function []=disp(nuv) 88 89 % display the object 90 91 disp(sprintf('\n')); 88 92 for i=1:numel(nuv) 89 desc(i)=cellstr(nuv(i).descriptor); 93 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 94 class(nuv),inputname(1),string_dim(nuv,i))); 95 disp(sprintf(' descriptor: ''%s''' ,nuv(i).descriptor)); 96 disp(sprintf(' mean: %g' ,nuv(i).mean)); 97 disp(sprintf(' stddev: %g' ,nuv(i).stddev)); 98 disp(sprintf(' lower: %g' ,nuv(i).lower)); 99 disp(sprintf(' upper: %g\n' ,nuv(i).upper)); 100 end 101 102 end 103 104 function [desc] =prop_desc(nuv,dstr) 105 desc=cell(1,numel(nuv)); 106 for i=1:numel(nuv) 107 if ~isempty(nuv(i).descriptor) 108 desc(i)=cellstr(nuv(i).descriptor); 109 elseif ~isempty(inputname(1)) 110 desc(i)=cellstr([inputname(1) string_dim(nuv,i)]); 111 elseif exist('dstr','var') 112 desc(i)=cellstr([dstr string_dim(nuv,i)]); 113 else 114 desc(i)=cellstr(['nuv' string_dim(nuv,i)]); 115 end 90 116 end 91 117 desc=allempty(desc); … … 95 121 end 96 122 function [lower] =prop_lower(nuv) 97 lower=zeros( size(nuv));123 lower=zeros(1,numel(nuv)); 98 124 for i=1:numel(nuv) 99 125 lower(i)=nuv(i).lower; … … 102 128 end 103 129 function [upper] =prop_upper(nuv) 104 upper=zeros( size(nuv));130 upper=zeros(1,numel(nuv)); 105 131 for i=1:numel(nuv) 106 132 upper(i)=nuv(i).upper; … … 109 135 end 110 136 function [mean] =prop_mean(nuv) 111 mean=zeros( size(nuv));137 mean=zeros(1,numel(nuv)); 112 138 for i=1:numel(nuv) 113 139 mean(i)=nuv(i).mean; … … 115 141 end 116 142 function [stddev]=prop_stddev(nuv) 117 stddev=zeros( size(nuv));143 stddev=zeros(1,numel(nuv)); 118 144 for i=1:numel(nuv) 119 145 stddev(i)=nuv(i).stddev; … … 130 156 end 131 157 end 158 159 methods (Static) 160 function []=dakota_write(fidi,dvar) 161 162 % collect only the variables of the appropriate class 163 164 nuv=struc_class(dvar,'normal_uncertain'); 165 166 % write variables 167 168 vlist_write(fidi,'normal_uncertain','nuv',nuv); 169 end 170 end 132 171 end -
issm/trunk/src/m/classes/@objective_function/objective_function.m
r905 r3094 19 19 % acknowledged. Any commercial use must be negotiated with 20 20 % the Office of Technology Transfer at the California Institute 21 % of Technology. ( NTR 47078)21 % of Technology. (J. Schiermeier, NTR 47078) 22 22 % 23 23 % This software may be subject to U.S. export control laws. … … 72 72 73 73 end 74 function [desc] =prop_desc(of) 75 desc=cell(size(of)); 74 75 function []=disp(of) 76 77 % display the object 78 79 disp(sprintf('\n')); 76 80 for i=1:numel(of) 77 desc(i)=cellstr(of(i).descriptor); 81 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 82 class(of),inputname(1),string_dim(of,i))); 83 disp(sprintf(' descriptor: ''%s''' ,of(i).descriptor)); 84 disp(sprintf(' scale_type: ''%s''' ,of(i).scale_type)); 85 disp(sprintf(' scale: %g' ,of(i).scale)); 86 disp(sprintf(' weight: %g\n' ,of(i).weight)); 87 end 88 89 end 90 91 function [desc] =prop_desc(of,dstr) 92 desc=cell(1,numel(of)); 93 for i=1:numel(of) 94 if ~isempty(of(i).descriptor) 95 desc(i)=cellstr(of(i).descriptor); 96 elseif ~isempty(inputname(1)) 97 desc(i)=cellstr([inputname(1) string_dim(of,i)]); 98 elseif exist('dstr','var') 99 desc(i)=cellstr([dstr string_dim(of,i)]); 100 else 101 desc(i)=cellstr(['of' string_dim(of,i)]); 102 end 78 103 end 79 104 desc=allempty(desc); 80 105 end 81 106 function [stype] =prop_stype(of) 82 stype=cell( size(of));107 stype=cell(1,numel(of)); 83 108 for i=1:numel(of) 84 109 stype(i)=cellstr(of(i).scale_type); … … 87 112 end 88 113 function [scale] =prop_scale(of) 89 scale=zeros( size(of));114 scale=zeros(1,numel(of)); 90 115 for i=1:numel(of) 91 116 scale(i)=of(i).scale; … … 94 119 end 95 120 function [weight]=prop_weight(of) 96 weight=zeros( size(of));121 weight=zeros(1,numel(of)); 97 122 for i=1:numel(of) 98 123 weight(i)=of(i).weight; … … 110 135 end 111 136 end 137 138 methods (Static) 139 function [rdesc]=dakota_write(fidi,dresp,rdesc) 140 141 % collect only the responses of the appropriate class 142 143 of=struc_class(dresp,'objective_function'); 144 145 % write responses 146 147 [rdesc]=rlist_write(fidi,'objective_functions','objective_function',of,rdesc); 148 end 149 150 function []=dakota_rlev_write(fidi,dresp,params) 151 end 152 end 112 153 end -
issm/trunk/src/m/classes/@response_function/response_function.m
r905 r3094 20 20 % acknowledged. Any commercial use must be negotiated with 21 21 % the Office of Technology Transfer at the California Institute 22 % of Technology. ( NTR 47078)22 % of Technology. (J. Schiermeier, NTR 47078) 23 23 % 24 24 % This software may be subject to U.S. export control laws. … … 77 77 78 78 end 79 function [desc] =prop_desc(rf) 80 desc=cell(size(rf)); 79 80 function []=disp(rf) 81 82 % display the object 83 84 disp(sprintf('\n')); 81 85 for i=1:numel(rf) 82 desc(i)=cellstr(rf(i).descriptor); 86 disp(sprintf('class ''%s'' object ''%s%s'' = \n',... 87 class(rf),inputname(1),string_dim(rf,i))); 88 disp(sprintf(' descriptor: ''%s''' ,rf(i).descriptor)); 89 disp(sprintf(' respl: %s' ,string_vec(rf(i).respl))); 90 disp(sprintf(' probl: %s' ,string_vec(rf(i).probl))); 91 disp(sprintf(' rell: %s' ,string_vec(rf(i).rell))); 92 disp(sprintf(' grell: %s\n' ,string_vec(rf(i).grell))); 93 end 94 95 end 96 97 function [desc] =prop_desc(rf,dstr) 98 desc=cell(1,numel(rf)); 99 for i=1:numel(rf) 100 if ~isempty(rf(i).descriptor) 101 desc(i)=cellstr(rf(i).descriptor); 102 elseif ~isempty(inputname(1)) 103 desc(i)=cellstr([inputname(1) string_dim(rf,i)]); 104 elseif exist('dstr','var') 105 desc(i)=cellstr([dstr string_dim(rf,i)]); 106 else 107 desc(i)=cellstr(['rf' string_dim(rf,i)]); 108 end 83 109 end 84 110 desc=allempty(desc); … … 103 129 end 104 130 function [respl,probl,rell,grell]=prop_levels(rf) 105 respl=cell( size(rf));106 probl=cell( size(rf));107 rell =cell( size(rf));108 grell=cell( size(rf));131 respl=cell(1,numel(rf)); 132 probl=cell(1,numel(rf)); 133 rell =cell(1,numel(rf)); 134 grell=cell(1,numel(rf)); 109 135 for i=1:numel(rf) 110 136 respl(i)={rf(i).respl}; … … 119 145 end 120 146 end 147 148 methods (Static) 149 function [rdesc]=dakota_write(fidi,dresp,rdesc) 150 151 % collect only the responses of the appropriate class 152 153 rf=struc_class(dresp,'response_function'); 154 155 % write responses 156 157 [rdesc]=rlist_write(fidi,'response_functions','response_function',rf,rdesc); 158 end 159 160 function []=dakota_rlev_write(fidi,dresp,params) 161 162 % collect only the responses of the appropriate class 163 164 rf=struc_class(dresp,'response_function'); 165 166 % write response levels 167 168 rlev_write(fidi,rf,params); 169 end 170 end 121 171 end
Note:
See TracChangeset
for help on using the changeset viewer.