Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions API/RATMain.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
function [problemStruct,results,bayesResults] = RATMain(problemStruct,controls)
% Select and run the internal RAT procedure.
%
% Parameters
% ----------
% problemStruct : struct
% The project class in struct form (generated from parseClassToStructs)
% controls : struct
% The controls struct (generated from parseClassToStructs)
Comment thread
alexhroom marked this conversation as resolved.
%
% Returns
% -------
% problemStruct : struct
% The output problem struct.
% results : struct
% The calculation results.
% bayesResults : struct
% Additional results from a Bayesian calculation.

% Adds C struct names for inputs
coder.cstructname(problemStruct.names, 'ParamNames');
Expand Down
46 changes: 31 additions & 15 deletions API/projectClass/multiTypeTable.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
classdef multiTypeTable < tableUtilities

% This is the class definition for the backgrounds and resolutions
% tables.

% A multi-type table, used in backgrounds and resolution tables.
properties
typesAutoNameString = 'Row'
end
Expand All @@ -12,7 +9,10 @@
function obj = multiTypeTable()
% Initialises a multi-type table.
%
% multiTable = multiTypeTable();
% Examples
% --------
% >>> multiTable = multiTypeTable();
%
sz = [0 8];
varTypes = {'string','string','string','string','string','string','string','string'};
varNames = {'Name','Type','Source','Value 1','Value 2','Value 3','Value 4','Value 5'};
Expand All @@ -24,7 +24,15 @@
% with up to seven parameters, with empty strings used for
% values that are not specified.
%
% multiTable.addRow({'New Row'});
% Parameters
% ----------
% varargin : keyword arguments
% The parameters to add to the row.
%
% Examples
% --------
% >>> multiTable.addRow({'New Row'});
%
switch length(varargin)

case 0
Expand Down Expand Up @@ -57,17 +65,25 @@
end

function obj = setValue(obj, row, col, value)
% Change the value of a given parameter in the table. The row
% and column of the parameter can both be specified by either
% name or index. The expected input is three values: row,
% column, value
% Change the value of a given parameter in the table.
%
% multiTable.setValue(1, 1, 'origin');
% First parameter needs to be either a row name or number
% Both the row and column of the parameter can both be specified by either
% name or index.
%
% Parameters
% ----------
% row : string or int
% The name or index of the row.
% col : string or int
% The name or index of the column.
% value : any
% The value to change the parameter to.
%
% Examples
% --------
% >>> multiTable.setValue(1, 1, 'origin');
%
row = obj.getValidRow(row);

% Second parameter needs to be either a column name or
% number.
colNames = obj.varTable.Properties.VariableNames;

if isText(col)
Expand Down
13 changes: 13 additions & 0 deletions targetFunctions/reflectivityCalculation.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
function result = reflectivityCalculation(problemStruct,controls)
% Compute the reflectivity and SLD curves for a given model using the Abeles matrix formalism.
%
% Main entry point into the reflectivity calculation for the toolbox.
% This is the main function that is called by any of the minimisers or
% analysis tools from the rest of the toolbox.
Expand All @@ -12,6 +14,17 @@
%
% * domains - Target function for samples consisting of domains which are larger than the beam lateral coherence length.
%
% Parameters
% ----------
% problemStruct : struct
% The project class as a struct (generated via parseClassToStructs)
% controls : struct
% The controls struct (generated via parseClassToStructs)
Comment thread
alexhroom marked this conversation as resolved.
%
% Returns
% -------
% result : struct
% The results of the calculation.

% Decide which target function we are calling and call the relevant routines
targetFunction = problemStruct.TF;
Expand Down