-
Notifications
You must be signed in to change notification settings - Fork 14
/
sglib_addpath.m
98 lines (86 loc) · 3.42 KB
/
sglib_addpath.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
function basepath=sglib_addpath( basepath, restore, add_octave_path )
% SGLIB_ADDPATH Set paths for sglib.
% SGLIB_ADDPATH( BASEPATH, RESTORE, EXPERIMENTAL, OCTAVE ) adds paths for sglib to the
% normal search path. If OCTAVE (default: FALSE) is true the path to the
% octave compatibility directory (octcompat) is added. If EXERIMENTAL
% (default: FALSE) is true the path to experimental directory is added.
% If RESTORE (default: FALSE) is specified, the path is first reset to
% its default.
% This function is usually run rom the startup script SGLIB_STARTUP.
%
% Example (<a href="matlab:run_example sglib_addpath">run</a>)
% % set default paths and return base path
% p=sglib_addpath
% % set default plus experimental path (but no octave)
% sglib_addpath( [], true, true, false )
% % set default plus octave path (but no experimental) resetting the path
% % first
% sglib_addpath( [], true, false, true )
%
% See also SGLIB_STARTUP, ADDPATH, STARTUP
% Elmar Zander
% Copyright 2007, Institute of Scientific Computing, TU Braunschweig.
%
% This program is free software: you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by the
% Free Software Foundation, either version 3 of the License, or (at your
% option) any later version.
% See the GNU General Public License for more details. You should have
% received a copy of the GNU General Public License along with this
% program. If not, see <http://www.gnu.org/licenses/>.
% set default arguments
if nargin<2 || isempty(restore)
restore=true;
end
if nargin<3 || isempty(add_octave_path)
add_octave_path=false;
end
% determine basepath if not given
if nargin<1 || isempty(basepath)
basepath=fileparts( mfilename('fullpath') );
end
% set standard paths
if restore
restoredefaultpath;
end
addpath( basepath );
addpath( fullfile( basepath, 'doc') );
addpath( fullfile( basepath, 'util') );
addpath( fullfile( basepath, 'munit') );
addpath( fullfile( basepath, 'mathutil') );
addpath( fullfile( basepath, 'quadrature') );
addpath( fullfile( basepath, 'pce') );
addpath( fullfile( basepath, 'gpc') );
addpath( fullfile( basepath, 'statistics') );
addpath( fullfile( basepath, 'sampling') );
addpath( fullfile( basepath, 'plotting') );
addpath( fullfile( basepath, 'linalg') );
addpath( fullfile( basepath, 'tensor') );
addpath( fullfile( basepath, 'operator') );
addpath( fullfile( basepath, 'solver') );
addpath( fullfile( basepath, 'sfem') );
addpath( fullfile( basepath, 'fem') );
addpath( fullfile( basepath, 'fem', 'simplefem') );
addpath( fullfile( basepath, 'fem', 'pdetool') );
addpath( fullfile( basepath, 'util', 'paramstudy') )
addpath( fullfile( basepath, 'objects') );
addpath( fullfile( basepath, 'objects', 'operators') );
addpath( fullfile( basepath, 'objects', 'statistics') );
addpath( fullfile( basepath, 'objects', 'bases') );
addpath( fullfile( basepath, 'objects', 'util') );
addpath( fullfile( basepath, 'methods') );
addpath( fullfile( basepath, 'methods', 'spectral') );
%addpath( fullfile( basepath, 'methods', 'direct') );
addpath( fullfile( basepath, 'methods', 'updating') );
if exist( fullfile( basepath, 'contrib'), 'dir' )
addpath( fullfile( basepath, 'contrib') )
addpath( fullfile( basepath, 'contrib', 'distmesh') )
end
if add_octave_path
addpath( fullfile( basepath, 'util', 'octcompat') );
end
rehash;
% suppress output argument if unwanted
if nargout==0
clear basepath;
end