Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sébastien Villemot
preprocessor
Commits
34ec8ece
Verified
Commit
34ec8ece
authored
11 months ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
macroprocessor doc: misc changes for summer school 2024
parent
612b2976
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/macroprocessor/macroprocessor.tex
+28
-6
28 additions, 6 deletions
doc/macroprocessor/macroprocessor.tex
with
28 additions
and
6 deletions
doc/macroprocessor/macroprocessor.tex
+
28
−
6
View file @
34ec8ece
...
...
@@ -15,7 +15,7 @@
\pgfdeclareimage
[height=0.8cm]
{
logo
}{
dlogo
}
\institute
[Dynare Team]
{
\pgfuseimage
{
logo
}}
\date
{
2
3 May 202
3
}
\date
{
3
1
May 202
4
}
\AtBeginSection
[]
{
...
...
@@ -156,9 +156,9 @@
\item
comparison operators:
\texttt
{
< > <= >= == !=
}
\item
logical operators:
\verb
+
&& || !
+
\item
range with unit increment:
\texttt
{
1:4
}
is equivalent to
real array
\texttt
{
[1, 2, 3, 4]
}
.
(NB:
\texttt
{
[1:4]
}
is equivalent to an
real array
\texttt
{
[1, 2, 3, 4]
}
\\
(NB:
\texttt
{
[1:4]
}
is equivalent to an
array containing an array of reals,
\textit
{
i.e.
}
\texttt
{
[[1, 2, 3, 4]]
}
)
\item
range with user-defined increment:
\texttt
{
4:-1.1:-1
}
is equivalent to real array
\texttt
{
[4, 2.9, 1.8, 0.7, -0.4]
}
.
\item
range with user-defined increment:
\\
\texttt
{
4:-1.1:-1
}
is equivalent to real array
\texttt
{
[4, 2.9, 1.8, 0.7, -0.4]
}
\end{itemize}
\end{block}
...
...
@@ -314,7 +314,7 @@ Then \texttt{distance(3, 4)} will be equivalent to \texttt{5}.
\end{frame}
\begin{frame}
[fragile=singleslide]
\frametitle
{
Defining macro-variables
}
\frametitle
{
Defining macro-variables
(1/2)
}
The value of a macro-variable can be defined with the
\verb
+
@#define
+
directive.
...
...
@@ -335,9 +335,31 @@ Then \texttt{distance(3, 4)} will be equivalent to \texttt{5}.
@#define t = ("US" in w) // Equals true
\end{verbatim}
\end{block}
NB: You can define macro variables on the Dynare command line by using the
\texttt
{
-D
}
option
\end{frame}
\begin{frame}
[fragile=singleslide]
\frametitle
{
Defining macro-variables (2/2)
}
Macro variables can also be defined on the Dynare command line by using the
\texttt
{
-D
}
option, for easily switching between different flavours of a model.
\begin{block}
{
Example 1
}
\begin{verbatim}
dynare myfile.mod -Dx=5
\end{verbatim}
The macro-variable
\texttt
{
x
}
will be equal to
\texttt
{
5
}
when running
\texttt
{
myfile.mod
}
.
\end{block}
\begin{block}
{
Example 2
}
Use single quotes around the
\texttt
{
-D
}
option when there are spaces or
special characters in the variable definition.
\begin{verbatim}
dynare myfile.mod '-DA=[ i in [1,2,3] when i > 1 ]'
\end{verbatim}
The macro-variable
\texttt
{
A
}
will be equal to
\texttt
{
[2,3]
}
when running
\texttt
{
myfile.mod
}
.
\end{block}
\end{frame}
\begin{frame}
[fragile=singleslide]
\frametitle
{
Expression substitution
}
\framesubtitle
{
Dummy example
}
...
...
@@ -866,7 +888,7 @@ rhos = [ 0.8, 0.9, 1];
\ccbysa
\column
{
0.71
\textwidth
}
\tiny
Copyright © 2008-202
3
Dynare Team
\\
Copyright © 2008-202
4
Dynare Team
\\
License:
\href
{
http://creativecommons.org/licenses/by-sa/4.0/
}{
Creative
Commons Attribution-ShareAlike 4.0
}
\end{columns}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment