Skip to content

Commit

Permalink
Re #1790 made object_lookup.m use the same hash function and approach…
Browse files Browse the repository at this point in the history
… as hashable classes. Small simplification to sort method.
  • Loading branch information
abuts committed Dec 23, 2024
1 parent 226be86 commit 761c95b
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 118 deletions.
6 changes: 3 additions & 3 deletions _test/test_multifit/test_multifit_horace_1.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@
% Test against saved or store to save later; ingnore string
% changes - these are filepaths
tol = [3e-5,3e-5];
assertEqualToTolWithSave (obj, fitpar_1, 'tol', tol, 'ignore_str', 1)
assertEqualToTolWithSave (obj, wsim_1, 'tol', tol, 'ignore_str', 1, '-ignore_date')
assertEqualToTolWithSave (obj, wfit_1, 'tol', tol, 'ignore_str', 1, '-ignore_date')
assertEqualToTolWithSave (obj, fitpar_1, 'tol', tol, '-ignore_str')
assertEqualToTolWithSave (obj, wsim_1, 'tol', tol, '-ignore_str', '-ignore_date')
assertEqualToTolWithSave (obj, wfit_1, 'tol', tol, '-ignore_str', '-ignore_date')

end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
% Recursively turn hashable fields values into array which defines
% object's hash
arr = cell (1,numel(field_names)*numel(obj)+1);
arr{1} = uint8(class(obj))';
arr{1} = uint8(class(obj))'; % ensure hashable array never empty
% and two different empty objects do not have the same hashes.
ic = 1;
for j = 1:numel(obj)
obj_tmp = obj(j); % get cow pointer to j-th object to save expensive indexing
Expand Down
Loading

0 comments on commit 761c95b

Please sign in to comment.