next up previous contents index
Next: Function spline_value Up: Module spline_module Previous: Subroutine spline_y2calc   Contents   Index

Subroutine spline_compute_matrices


\begin{boxedminipage}{\textwidth}
\begin{verbatim}call spline_compute_matrices(this,y2_matrix1,y2_matrix0)\end{verbatim}
\end{boxedminipage}

The y2 of the spline can also be computed using linear algebra. Following Numerical Recipes,


\begin{displaymath}
A Y'' = BY + C
\end{displaymath}

where $A$, $B$ are matrices, $C$ is a vector so

\begin{displaymath}
Y'' = A^{-1} B Y + A^{-1} C
\end{displaymath}

This subroutine computes these matrices, and stores them in spline%y2_matrix1 = inv(A)*B and spline%y2_matrix0 = inv(A)*C

this -- type(spline), intent(in)

y2_matrix1 -- real(dp), dimension(:,:), intent(out)

y2_matrix0 -- real(dp), dimension(:), intent(out)

spline_value function

gabor 2009-06-30