Home > functions > internal > dsGetLinearIndependentDs.m

dsGetLinearIndependentDs

PURPOSE ^

[Asubs, Abasis, Abasisi] = getLinearIndependentDs(data,ignore_constant_shift,varargin)

SYNOPSIS ^

function [Abasis, Abasisi, Asubs] = dsGetLinearIndependentDs(data,ignore_constant_shift,varargin)

DESCRIPTION ^

 [Asubs, Abasis, Abasisi] = getLinearIndependentDs(data,ignore_constant_shift,varargin)

 Purpose: Takes in DynaSim Data structure and identifies
 subsets varied parameters that are linearly dependent upon each other.
 This is a wrapper for getLinearIndependent (see documentation for 
 getLinearIndependentCell for full explanation).

 Usage:
   [Asubs, Abasis, Abasisi] = getLinearIndependentDs(data)
   [Asubs, Abasis, Abasisi] = getLinearIndependentDs(data,ignore_constant_shift)

 Inputs:
   data: DynaSim data structure

 Inputs (Optional):
   ignore_constant_shift: Flag (true / false [default]) for ignoring a 
   constant term in determining independence.

 Outputs:
   Abasis: A subset data.varied values that are linearly independent 
   across simulations
 
   Abasisi: Corresponding index locations in data(1).varied of varied 
   values given in Abasis.
 
   Asub: Index locations in data(1).varied of clusters of linearly
   dependent (e.g. covaried) varied parameters. (One cluster for each
   basis vector in Abasis)

 Examples:
 See documentation for getLinearIndependentCell.
 
 Submodules: getLinearIndependent, getLinearIndependentCell uniqueCellGeneralized, iscellnum

 Author: David Stanley, Boston University, 2017

 See also: getLinearIndependent, getLinearIndependentCell, rref, unique

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Abasis, Abasisi, Asubs] = dsGetLinearIndependentDs(data,ignore_constant_shift,varargin)
0002 % [Asubs, Abasis, Abasisi] = getLinearIndependentDs(data,ignore_constant_shift,varargin)
0003 %
0004 % Purpose: Takes in DynaSim Data structure and identifies
0005 % subsets varied parameters that are linearly dependent upon each other.
0006 % This is a wrapper for getLinearIndependent (see documentation for
0007 % getLinearIndependentCell for full explanation).
0008 %
0009 % Usage:
0010 %   [Asubs, Abasis, Abasisi] = getLinearIndependentDs(data)
0011 %   [Asubs, Abasis, Abasisi] = getLinearIndependentDs(data,ignore_constant_shift)
0012 %
0013 % Inputs:
0014 %   data: DynaSim data structure
0015 %
0016 % Inputs (Optional):
0017 %   ignore_constant_shift: Flag (true / false [default]) for ignoring a
0018 %   constant term in determining independence.
0019 %
0020 % Outputs:
0021 %   Abasis: A subset data.varied values that are linearly independent
0022 %   across simulations
0023 %
0024 %   Abasisi: Corresponding index locations in data(1).varied of varied
0025 %   values given in Abasis.
0026 %
0027 %   Asub: Index locations in data(1).varied of clusters of linearly
0028 %   dependent (e.g. covaried) varied parameters. (One cluster for each
0029 %   basis vector in Abasis)
0030 %
0031 % Examples:
0032 % See documentation for getLinearIndependentCell.
0033 %
0034 % Submodules: getLinearIndependent, getLinearIndependentCell uniqueCellGeneralized, iscellnum
0035 %
0036 % Author: David Stanley, Boston University, 2017
0037 %
0038 % See also: getLinearIndependent, getLinearIndependentCell, rref, unique
0039 
0040 %% auto_gen_test_data_flag argin
0041 options = dsCheckOptions(varargin,{'auto_gen_test_data_flag',0,{0,1}},false);
0042 if options.auto_gen_test_data_flag
0043     varargs = varargin;
0044     varargs{find(strcmp(varargs, 'auto_gen_test_data_flag'))+1} = 0;
0045     varargs(end+1:end+2) = {'unit_test_flag',1};
0046     argin = [{vary_lengths}, {data_length}, varargs]; % specific to this function
0047 end
0048 
0049 if nargin < 2; ignore_constant_shift = false; end
0050 
0051 N = length(data);
0052 vary_labels = data(1).varied; % data(1).simulator_options.vary;
0053 Nlabels = length(vary_labels);
0054 
0055 % Get varied list
0056 for i = 1:N
0057     for j = 1:Nlabels
0058         vary_params{i,j} = data(i).(vary_labels{j});
0059     end
0060 end
0061 
0062 [Abasis, Abasisi, Asubs] = getLinearIndependentCell(vary_params,ignore_constant_shift);
0063 
0064 
0065 %% auto_gen_test_data_flag argout
0066 if options.auto_gen_test_data_flag
0067     argout = {linked_indices, non_linked_indices}; % specific to this function
0068     
0069     dsUnitSaveAutoGenTestDataLocalFn(argin, argout); % localfn
0070 end
0071 
0072 end

Generated on Tue 12-Dec-2017 11:32:10 by m2html © 2005