Skip to content

Commit

Permalink
[bug] force most scalar inputs to be double to avoid incorrect typeca…
Browse files Browse the repository at this point in the history
…sting
  • Loading branch information
fangq committed Dec 4, 2024
1 parent 4b7020d commit 86dcba9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mcxlab/mcxlab.m
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@

if (isstruct(varargin{1}))
for i = 1:length(varargin{1})
castlist = {'srcpattern', 'srcpos', 'detpos', 'prop', 'workload', 'srcdir', 'srciquv'};
castlist = {'srcpattern', 'srcpos', 'detpos', 'prop', 'workload', 'srcdir', 'srciquv', 'isnormalized'
'isreflect', 'nphoton', 'nblocksize', 'nthread', 'tstart', 'tend', 'maxdetphoton', 'maxgate'
'respin', 'isref3', 'isrefint', 'isgpuinfo', 'issrcfrom0', 'autopilot', 'minenergy', 'unitinmm'
'voidtime', 'issavedet', 'issaveseed', 'issaveref', 'issaveexit', 'ismomentum', 'isspecular'
'replaydet', 'maxvoidstep', 'maxjumpdebug', 'gscatter', 'srcnum', 'srcid', 'omega', 'issave2pt'
'lamda', 'steps', 'crop0', 'crop1'};
for j = 1:length(castlist)
if (isfield(varargin{1}(i), castlist{j}))
varargin{1}(i).(castlist{j}) = double(varargin{1}(i).(castlist{j}));
Expand Down

0 comments on commit 86dcba9

Please sign in to comment.