Skip to content

Commit

Permalink
Avoid use of \texttt in arrays.tex
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jun 1, 2020
1 parent 4b272fd commit b68df7d
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -295,35 +295,35 @@ \subsection{Specialized Array Constructor Functions}\doublelabel{specialized-arr
\hline
\tablehead{Modelica} & \tablehead{Explanation}\\ \hline
\endhead
\lstinline!identity(n)!
\lstinline[mathescape=true]!identity($n$)!
&
Returns the n x n Integer identity matrix, with ones on the diagonal and
Returns the $n \times n$ \lstinline!Integer! identity matrix, with ones on the diagonal and
zeros at the other places.\\ \hline
\lstinline!diagonal(v)!
&
Returns a square matrix with the elements of vector v on the diagonal
and all other elements zero.\\ \hline
\texttt{zeros(n\textsubscript 1,n\textsubscript 2,n\textsubscript 3,...)} &
Returns the $n_1$ x $n_2$ x $n_3$ x ... \lstinline!Integer! array with all elements equal to zero ($n_i \geq 0$).
The function need one or more arguments, that is \lstinline!zeros()! is not legal.\\ \hline
\texttt{ones(n\textsubscript 1,n\textsubscript 2,n\textsubscript 3,...)} &
Return the $n_1$ x $n_2$ x $n_3$ x ... Integer array with all elements equal to one ($n_i \geq 0$).
The function need one or more arguments, that is \lstinline!ones()! is not legal.\\ \hline
\texttt{fill(s,n\textsubscript 1,n\textsubscript 2,n\textsubscript 3,...)} &
Returns the $n_1$ x $n_2$ x $n_3$ x ... array with all elements equal to scalar or array expression s
($n_i \geq 0$). The returned array has the same type as \lstinline!s!.
\lstinline[mathescape=true]!zeros($n_{1}$, $n_{2}$, $n_{3}$, $\ldots$)! &
Returns the $n_{1} \times n_{2} \times n_{3} \times \ldots$ \lstinline!Integer! array with all elements equal to zero ($n_{i} \geq 0$).
The function needs one or more arguments, that is \lstinline!zeros()! is not legal.\\ \hline
\lstinline[mathescape=true]!ones($n_{1}$, $n_{2}$, $n_{3}$, $\ldots$)! &
Return the $n_{1} \times n_{2} \times n_{3} \times \ldots$ \lstinline!Integer! array with all elements equal to one ($n_{i} \geq 0$).
The function needs one or more arguments, that is \lstinline!ones()! is not legal.\\ \hline
\lstinline[mathescape=true]!fill(s, $n_{1}$, $n_{2}$, $n_{3}$, $\ldots$)! &
Returns the $n_{1} \times n_{2} \times n_{3} \times \ldots$ array with all elements equal to scalar or array expression $s$
($n_{i} \geq 0$). The returned array has the same type as \lstinline!s!.
Recursive definition:
\lstinline!fill!(s,$n_1$,$n_2$,$n_3$,...) =
\lstinline!fill!(\lstinline!fill!(s,$n_2$,$n_3$, ...),
$n_1$,); \lstinline!fill!(s,n)=\{s,s,\ldots{}, s\}
\lstinline[mathescape=true]!fill(s, $n_{1}$, $n_{2}$, $n_{3}$, $\ldots$)! =
\lstinline[mathescape=true]!fill(fill(s, $n_{2}$, $n_{3}$, $\ldots$), $n_{1}$)!;
\lstinline[mathescape=true]!fill(s, $n$)! = \lstinline[mathescape=true]!{s, s, $\ldots$, s}!

The function needs two or more arguments; that is \lstinline!fill(s)! is not legal.\\ \hline
\lstinline!linspace(x1,x2,n)!
\lstinline[mathescape=true]!linspace(x1, x2, $n$)!
&
Returns a \lstinline!Real! vector with \lstinline!n! equally spaced elements, such that
$v = \text{\lstinline!linspace(x1, x2, n)!}$ results in
\lstinline!v[i] = x1 + (x2-x1)*(i-1)/(n-1)! for $1 \leq \text{\lstinline!i!} \leq \text{\lstinline!n!}$.
It is required that $\text{\lstinline!n!} \geq 2$. The arguments \lstinline!x1! and \lstinline!x2! shall
Returns a \lstinline!Real! vector with $n$ equally spaced elements, such that
\lstinline[mathescape=true]!v = linspace(x1, x2, $n$)! results in
\lstinline[mathescape=true]!v[$i$] = x1 + (x2-x1)*($i$-1)/($n$-1)! for $1 \leq i \leq n$.
It is required that $n \geq 2$. The arguments \lstinline!x1! and \lstinline!x2! shall
be numeric scalar expressions.\\ \hline
\end{longtable}

Expand Down

0 comments on commit b68df7d

Please sign in to comment.