Skip to content
Snippets Groups Projects
Commit 5a29d461 authored by W. Spencer Smith's avatar W. Spencer Smith
Browse files

Updates to L13 and A2

parent 22ea6aa4
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -203,6 +203,8 @@ Don't have to doxygen test driver program.
Questions - rewrite isInBounds not assuming ascending
- why isInBounds for Data, not for CurveT?
- question about what is needed for cubic
- what is needed for regression?
- maybe add derivatives? integration?
......@@ -289,22 +291,29 @@ SeqServicesModule for isAscending, interp1d and index
\subsection* {Syntax}
\subsubsection* {Exported Constants}
MAX\_ORDER = 2
\subsubsection* {Exported Types}
CurveInterpT = ?
\subsubsection* {Exported Access Programs}
\begin{tabular}{| l | l | l | l |}
\begin{tabular}{| l | l | l | p{5cm} |}
\hline
\textbf{Routine name} & \textbf{In} & \textbf{Out} & \textbf{Exceptions}\\
\hline
new CurveInterpT & $X: \mathbb{R}^n$, $Y: \mathbb{R}^n$ & CurveInterpT & IndepVarNotAscending\\
new CurveInterpT & $X: \mathbb{R}^n$, $Y: \mathbb{R}^n$, $i: \mathbb{N}$ &
CurveInterpT & IndepVarNotAscending,\newline InvalidInterpOrder\\
\hline
minD & ~ & $\mathbb{R}$ & ~\\
\hline
maxD & ~ & $\mathbb{R}$ & ~\\
\hline
order & ~ & $\mathbb{N}$ & ~\\
\hline
eval & $x: \mathbb{R}$ & $\mathbb{R}$ & OutOfDomain\\
\hline
\end{tabular}
......@@ -315,6 +324,7 @@ eval & $x: \mathbb{R}$ & $\mathbb{R}$ & OutOfDomain\\
minx: $\mathbb{R}$\\
maxx: $\mathbb{R}$\\
o: $\mathbb{N}$\\
f: $\mathbb{R} \rightarrow \mathbb{R}$
\subsubsection* {State Invariant}
......@@ -329,11 +339,12 @@ None
\noindent new CurveInterpT($X, Y$):
\begin{itemize}
\item transition: $\mbox{minx}, \mbox{maxx}, f := X_0, X_{|X|-1}, (\lambda v:
\item transition: $\mbox{minx}, \mbox{maxx}, o, f := X_0, X_{|X|-1}, i, (\lambda v:
\mbox{interp}(X, Y, v))$
\item output: $out := \mbox{self}$
\item exception: $(\neg \mbox{isAscending}(X) \Rightarrow \mbox{IndepVarNotAscending})$
\item exception: $(\neg \mbox{isAscending}(X) \Rightarrow
\mbox{IndepVarNotAscending} | i \notin [1..\mbox{MAX\_ORDER}] \Rightarrow \mbox{InvalidInterpOrder})$
\end{itemize}
\noindent minD():
......@@ -348,6 +359,12 @@ None
\item exception: None
\end{itemize}
\noindent order():
\begin{itemize}
\item output: $out := \mbox{o}$
\item exception: None
\end{itemize}
\noindent eval($x$):
\begin{itemize}
\item output: $out := f(x)$
......@@ -356,9 +373,12 @@ None
\subsection*{Local Functions}
interp: $\mathbb{R}^n \times \mathbb{R}^n \rightarrow \mathbb{R}$\\
interp($X$, $Y$, $v$) $\equiv \mbox{interp1d}(X_i, Y_i, X_{i+1}, Y_{i+1}, v)$
where $i = \mbox{index}(X, v)$\\
interp: $\mathbb{R}^n \times \mathbb{R}^n \times \mathbb{R} \times \mathbb{N}
\rightarrow \mathbb{R}$\\
\noindent interp($X$, $Y$, $v$, $o$) $$\equiv (o=1 \Rightarrow \mbox{interpLin}(X_i, Y_i,
X_{i+1}, Y_{i+1}, v) | o = 2 \Rightarrow \mbox{interpQuad}(X_i, Y_i, X_{i+1},
Y_{i+1}, v) )$$ where $i = \mbox{index}(X, v)$\\
\newpage
......@@ -507,7 +527,13 @@ None, unless noted with a particular access program
\item exception: none
\end{itemize}
\noindent interp1d($x_1, y_1, x_2, y_2, x$) \textit{\# assuming isAscending is True}
\noindent interpLin($x_1, y_1, x_2, y_2, x$) \textit{\# assuming isAscending is True}
\begin{itemize}
\item output: $out := \frac{(y_2 - y_1)}{(x_2-x_1)} (x - x_1) + y_1$
\item exception: none
\end{itemize}
\noindent interpQuad($x_1, y_1, x_2, y_2, x$) \textit{\# assuming isAscending is True}
\begin{itemize}
\item output: $out := \frac{(y_2 - y_1)}{(x_2-x_1)} (x - x_1) + y_1$
\item exception: none
......
No preview for this file type
......@@ -386,7 +386,7 @@ Example of raising the exception
\begin{frame}
\frametitle{Quality Criteria}
\frametitle{Quality Criteria (H\&S Section 7.3.2)}
\begin{itemize}
\item Consistent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment