-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinit_sbd.m
33 lines (28 loc) · 1 KB
/
init_sbd.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function [] = init_sbd( mode, setdefconfig )
%INIT_SBD Initializes subdirectories and default config settings.
%
% Optional arguments:
% mode - to turn off messages, set to 'quiet'.
% Verbose by default.
%
% setdefconfig - whether to apply default config settings.
% Default: true.
%
if nargin < 1; mode = 'verbose'; end;
if nargin < 2; setdefconfig = true; end;
% Check if ManOpt has been imported
if exist('trustregions', 'file') ~= 2
error('Manopt needs to be imported: <a href="http://www.manopt.org">http://www.manopt.org</a>.%s','');
end
% Add subdirectories to path
fp = [fileparts(mfilename('fullpath')) '/'];
addpath(fp);
for d = {'core', 'utils', 'config'}
addpath(genpath([fp d{1}]));
end
% Apply default config settings
if setdefconfig; default_config_settings(mode); end;
if ~strcmp(mode, 'quiet')
disp('Subdirectories and config settings initialized.');
end
end