Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dseries
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sébastien Villemot
dseries
Commits
0281ffe7
Commit
0281ffe7
authored
Dec 01, 2014
by
Stéphane Adjemian (Charybdis)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added initialization script and missing routines (if Dynare is not in the path). Fixes
#1
.
parent
56133950
Changes
7
Hide whitespace changes
Inline
Sidebyside
Showing
7 changed files
with
189 additions
and
0 deletions
+189
0
src/initialize_dates_toolbox.m
src/initialize_dates_toolbox.m
+31
0
src/utilities/missing/dims/columns.m
src/utilities/missing/dims/columns.m
+20
0
src/utilities/missing/dims/rows.m
src/utilities/missing/dims/rows.m
+20
0
src/utilities/missing/isint/isint.m
src/utilities/missing/isint/isint.m
+45
0
src/utilities/missing/isoctave/isoctave.m
src/utilities/missing/isoctave/isoctave.m
+20
0
src/utilities/missing/matlab_ver_less_than/matlab_ver_less_than.m
...ities/missing/matlab_ver_less_than/matlab_ver_less_than.m
+29
0
src/utilities/missing/shiftS/shiftS.m
src/utilities/missing/shiftS/shiftS.m
+24
0
No files found.
src/initialize_dates_toolbox.m
0 → 100644
View file @
0281ffe7
% Get the path to the dates/src folder.
dates_src_root
=
strrep
(
which
(
'initialize_dates_toolbox'
),
'initialize_dates_toolbox.m'
,
''
);
% Add some subfolders to the path.
addpath
([
dates_src_root
'/utilities/is'
])
addpath
([
dates_src_root
'/utilities/op'
])
addpath
([
dates_src_root
'/utilities/convert'
])
% Add empty dates object in the base workspace
dates
(
'initialize'
);
% Add missing routines if dynare is not in the path
if
~
exist
(
'isint'
,
'file'
)
addpath
([
dates_src_root
'/utilities/missing/isint'
])
end
if
~
exist
(
'rows'
,
'file'
)

~
exist
(
'columns'
,
'file'
)
addpath
([
dates_src_root
'/utilities/missing/dims'
])
end
if
~
exist
(
'isoctave'
,
'file'
)
addpath
([
dates_src_root
'/utilities/missing/isoctave'
])
end
if
~
exist
(
'shiftS'
,
'file'
)
addpath
([
dates_src_root
'/utilities/missing/shiftS'
])
end
if
~
exist
(
'matlab_ver_less_than'
,
'file'
)
addpath
([
dates_src_root
'/utilities/missing/matlab_ver_less_than'
])
end
\ No newline at end of file
src/utilities/missing/dims/columns.m
0 → 100644
View file @
0281ffe7
function
c
=
columns
(
M
)
% Computes the number of columns of a matrix
% Copyright (C) 20052014 Dynare Team
%
% This code 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.
%
% Dynare dates submodule is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
c
=
size
(
M
,
2
);
\ No newline at end of file
src/utilities/missing/dims/rows.m
0 → 100644
View file @
0281ffe7
function
r
=
rows
(
x
)
% Computes the number of rows of a matrix
% Copyright (C) 20052014 Dynare Team
%
% This code 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.
%
% Dynare dates submodule is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
r
=
size
(
x
,
1
);
src/utilities/missing/isint/isint.m
0 → 100644
View file @
0281ffe7
function
[
l
,
c
,
d
]
=
isint
(
a
)
% This function tests if the input argument is an integer.
%
% INPUT
%  a [double] m*n matrix.
%
% OUTPUT
%  l [logical] m*n matrix of true and false (1 and 0). l(i,j)=true if a(i,j) is an integer.
%  c [integer] p*1 vector of indices pointing to the integer elements of a.
%  d [integer] q*1 vector of indices pointing to the non integer elements of a.
%
% REMARKS
% p+q is equal to the product of m by n.
% Copyright (C) 20092014 Dynare Team
%
% This code 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.
%
% Dynare dates submodule is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if
~
isnumeric
(
a
)
b
=
false
;
if
nargout
>
1
c
=
[];
d
=
[];
end
return
end
l
=
abs
(
fix
(
a
)

a
)
<
1e15
;
if
nargout
>
1
c
=
find
(
b
==
1
);
d
=
find
(
b
==
0
);
end
\ No newline at end of file
src/utilities/missing/isoctave/isoctave.m
0 → 100644
View file @
0281ffe7
function
l
=
isoctave
()
% Tests if Octave is used.
% Copyright (C) 20132014 Dynare Team
%
% This code 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.
%
% Dynare dates submodule is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
l
=
exist
(
'OCTAVE_VERSION'
);
\ No newline at end of file
src/utilities/missing/matlab_ver_less_than/matlab_ver_less_than.m
0 → 100644
View file @
0281ffe7
function
r
=
matlab_ver_less_than
(
verstr
)
% Returns 1 if current Matlab version is strictly older than the one given in argument.
%
% INPUTS
%  verstr [string] Matlab's version as 'x.y' or 'x.y.z'
%
% OUTPUTS
%  r [logical] true or false (0 or 1)
%
% REMARKS
% 1. This function will fail under Octave.
% Copyright (C) 20082014 Dynare Team
%
% This code 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.
%
% Dynare dates submodule is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
r
=
verLessThan
(
'matlab'
,
verstr
);
\ No newline at end of file
src/utilities/missing/shiftS/shiftS.m
0 → 100644
View file @
0281ffe7
function
S
=
shiftS
(
S
,
n
)
% Removes the first n elements of a one dimensional cell array.
% Copyright (C) 20092014 Dynare Team
%
% This code 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.
%
% Dynare dates submodule is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if
length
(
S
)
>=
n
+
1
S
=
S
(
n
+
1
:
end
);
else
S
=
{};
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment