-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re #1786 Minor changes and comment to be nice and push up the build
- Loading branch information
Showing
4 changed files
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
herbert_core/utilities/classes/@fast_map/private/check_combo_arg_.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
herbert_core/utilities/classes/@fast_map/private/optimize_.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function obj = optimize_(obj) | ||
%OPTIMIZE_ % place values into expanded array or cellarray, containing | ||
% NaN or empty where keys are missing and values where | ||
% keys are present. This array/cellarray is optimal for fast | ||
% access to the values as function of keys. | ||
|
||
obj.min_max_key_val_ = min_max(obj.keys_); | ||
obj.key_shif_ = obj.min_max_key_val_(1)-1; | ||
n_places = obj.min_max_key_val_(2)-obj.min_max_key_val_(1)+1; | ||
obj.keyval_optimized_ = nan(1,n_places); | ||
keys_shifted = obj.keys_-obj.min_max_key_val_(1)+1; | ||
obj.keyval_optimized_(keys_shifted) = obj.values_(:); | ||
obj.optimized_ = true; |