Commit a14347c5 authored by Jakob Gabriel's avatar Jakob Gabriel
Browse files

quantity.Symbolic: clean-up

- removed defaultSymVar property and replaced with comparison of strings in getVariable() - this should improve performance, since no sym("z") is called for every quantity.Symbolic.
- as 'variable' input argument is obsolete, replaced the default element with empty [] to improve performance.
parent 0a981dd4
......@@ -4,9 +4,7 @@ classdef Symbolic < quantity.Function
valueSymbolic sym;
variable sym;
end
properties (Constant)
defaultSymVar = sym('z', 'real');
end
properties
symbolicEvaluation = false;
end
......@@ -30,7 +28,7 @@ classdef Symbolic < quantity.Function
end
variableParser = misc.Parser();
variableParser.addParameter('variable', quantity.Symbolic.getVariable(valueContinuous));
variableParser.addParameter('variable', []);
variableParser.addParameter('symbolicEvaluation', false);
variableParser.parse(varargin{:});
......@@ -838,19 +836,13 @@ classdef Symbolic < quantity.Function
if misc.issym(symbolicFunction(:).')
var = symvar(symbolicFunction(:).');
else
var = [];
end
if isempty(var)
% var = quantity.Symbolic.defaultSymVar;
else
if var(1) ~= quantity.Symbolic.defaultSymVar
if ~isempty(var) && ~strcmp(string(var(1)), "z")
% fast solution to order the spatial and temporal variable
% in the common order: (z, t)
var = flip(var);
end
else
var = [];
end
end % getVariable()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment