|
1 | 1 | function [outProblemDef,problem,results,bayesResults] = RATMain(problemDef,problemDefCells,problemDefLimits,controls,priors)
|
2 | 2 |
|
3 | 3 |
|
4 |
| -result = cell(6,1); |
| 4 | +result = cell(1,1); |
| 5 | +result{1} = {1}; |
| 6 | +results = repmat(result,1,6); |
| 7 | + |
5 | 8 | numberOfContrasts = problemDef.numberOfContrasts;
|
6 | 9 | preAlloc = zeros(numberOfContrasts,1);
|
7 | 10 |
|
|
13 | 16 | 'nbsubs',preAlloc,...
|
14 | 17 | 'resolutions',preAlloc,...
|
15 | 18 | 'calculations',struct('all_chis',preAlloc,'sum_chi',0),...
|
16 |
| - 'allSubRough',preAlloc); |
| 19 | + 'allSubRough',preAlloc,... |
| 20 | + 'resample',preAlloc); |
17 | 21 |
|
18 |
| -% Make empty bayes results even though we may not fill it (for output purposes) |
19 |
| -bayesResults.res = []; |
20 |
| -bayesResults.chain = []; |
21 |
| -bayesResults.s2chain = []; |
22 |
| -bayesResults.ssChain = []; |
23 |
| -bayesResults.bestPars = []; |
| 22 | +if strcmpi(problemDef.TF,'domains') |
| 23 | + domains = true; |
| 24 | +else |
| 25 | + domains = false; |
| 26 | +end |
| 27 | +bayesResults = makeEmptyBayesResultsStruct(1e3, problemDef.numberOfContrasts, domains, controls.nChains); |
| 28 | +% bayesResults = struct('bayesRes',[],... |
| 29 | +% 'chain',[],... |
| 30 | +% 's2chain',[],... |
| 31 | +% 'ssChain',[],... |
| 32 | +% 'bestPars_Mean',[],... |
| 33 | +% 'bestFitsMean',[],... |
| 34 | +% 'predLims',[],... |
| 35 | +% 'parConfInts',[]); |
24 | 36 |
|
25 | 37 | outProblemDef = problemDef;
|
26 | 38 |
|
27 | 39 | %Decide what we are doing....
|
28 | 40 | action = controls.proc;
|
29 | 41 | switch lower(action)
|
30 | 42 | case 'calculate' %Just a single reflectivity calculation
|
31 |
| - [problem,results] = reflectivityCalculationWrapper(problemDef,problemDefCells,problemDefLimits,controls); |
| 43 | + [problem,results] = reflectivityCalculation(problemDef,problemDefCells,problemDefLimits,controls); |
32 | 44 | outProblemDef = problemDef;
|
33 | 45 | case 'simplex'
|
34 | 46 | if ~strcmpi(controls.display,'off')
|
|
40 | 52 | sendTextOutput(sprintf('\nRunning Differential Evolution\n\n'));
|
41 | 53 | end
|
42 | 54 | [outProblemDef,problem,results] = runDE(problemDef,problemDefCells,problemDefLimits,controls);
|
43 |
| - case 'ns' |
44 |
| - if ~strcmpi(controls.display,'off') |
45 |
| - sendTextOutput(sprintf('\nRunning Nested Sampler\n\n')); |
46 |
| - end |
47 |
| - [outProblemDef,problem,results,bayesResults] = runNestedSampler(problemDef,problemDefCells,problemDefLimits,controls); |
| 55 | +% case 'ns' |
| 56 | +% if ~strcmpi(controls.display,'off') |
| 57 | +% sendTextOutput(sprintf('\nRunning Nested Sampler\n\n')); |
| 58 | +% end |
| 59 | +% [outProblemDef,problem,results,bayesResults] = runNestedSampler(problemDef,problemDefCells,problemDefLimits,controls); |
48 | 60 | case 'dream'
|
49 | 61 | if ~strcmpi(controls.display,'off')
|
50 | 62 | sendTextOutput(sprintf('\nRunning DREAM\n\n'));
|
|
0 commit comments