\subsection{Data reduction: Point data as input.}
\funclabel{s1961}
\begin{minipg1}
To compute a spline-approximation to the data given by the
           points ep, and represent it as a B-spline curve with
           parameterization determined by the parameter ipar.
           The approximation is determined by first forming the piecewise
           linear interpolant to the data, and then performing knot
           removal on this initial approximation.
\end{minipg1} \\ \\
SYNOPSIS\\
        \> void s1961(\begin{minipg3}
            {\fov ep}, {\fov im}, {\fov idim}, {\fov ipar}, {\fov epar}, {\fov eeps}, {\fov ilend}, {\fov irend}, {\fov iopen}, {\fov afctol},
            {\fov itmax}, {\fov ik}, {\fov rc}, {\fov emxerr}, {\fov jstat})
                \end{minipg3}\\
                \>\>    double \> {\fov ep}[\,];\\
                \>\>    int    \>  {\fov im};\\
                \>\>    int    \>  {\fov idim};\\
                \>\>    int    \>  {\fov ipar};\\
                \>\>    double \> {\fov epar}[\,];\\
                \>\>    double \> {\fov eeps}[\,];\\
                \>\>    int    \>  {\fov ilend};\\
                \>\>    int    \>  {\fov irend};\\
                \>\>    int    \>  {\fov iopen};\\
                \>\>    double \> {\fov afctol};\\
                \>\>    int    \>  {\fov itmax};\\
                \>\>    int    \>  {\fov ik};\\
                \>\>    SISLCurve    \>  **{\fov rc};\\
                \>\>    double \> {\fov emxerr}[\,];\\
                \>\>    int    \>  *{\fov jstat};\\
\\
ARGUMENTS\\
	\>Input Arguments:\\
        \>\>    {\fov ep}\> - \>  \begin{minipg2}
                     Array (length $idim*im$) containing the points to
                 be approximated.
                               \end{minipg2}\\[0.8ex]
        \>\>    {\fov im}\> - \>  \begin{minipg2}
                     The no. of data points.
                               \end{minipg2}\\
        \>\>    {\fov idim}\> - \>  \begin{minipg2}
                     The dimension of the euclidean space in which the data
                 points lie, i.e. the number of components of each data point.
                               \end{minipg2}\\
        \>\>    {\fov ipar}\> - \> \begin{minipg2}
                     Flag indicating the type of parameterization to be used:
                               \end{minipg2}\\[0.8ex]
                \>\>\>\>   $= 1$ : Paramterize by accumulated cord length.\\
                \>\>\>\>         (Arc length parametrization for the piecewise\\
                \>\>\>\>         linear interpolant.)\\
                \>\>\>\>   $= 2$ : Uniform parameterization.\\
                \>\>\>\>   $= 3$ : Parametrization given by epar.\\
                \>\>\>\>  If ipar $<1$  or ipar $>3$, it will be set to 1.\\
        \>\>    {\fov epar}\> - \>  \begin{minipg2}
                     Array (length im) containing a parametrization
                 of the given data.
                               \end{minipg2}\\
        \>\>    {\fov eeps}\> - \>  \begin{minipg2}
                     Array (length idim) containing the tolerance to be
                 used during the data reduction stage. The final
                 approximation to the data will deviate less than eeps
                 from the piecewise linear interpolant in each of the
                 idim components.
                               \end{minipg2}\\[0.8ex]
        \>\>    {\fov ilend}\> - \>  \begin{minipg2}
                     The no. of derivatives that are not allowed to change
                 at the left end of the curve.
                 The $0,\ldots,(ilend-1)$ derivatives will be kept fixed.
                 If ilend $<0$, this routine will set it to 0.
                 If ilend $<ik$, this routine will set it to ik.
                               \end{minipg2}\\[0.8ex]
        \>\>    {\fov irend}\> - \>  \begin{minipg2}
                     The no. of derivatives that are not allowed to change
                 at the right end of the curve.
                 The $0,\ldots,(irend-1)$ derivatives will be kept fixed.
                 If irend $<0$, this routine will set it to 0.
                 If irend $<ik$, this routine will set it to ik.
                               \end{minipg2}\\[0.8ex]
        \>\>    {\fov iopen}\> - \>  Open/closed parameter\\
            \>\>\>\>  $= 1$  : Produce open curve.\\
            \>\>\>\>  $= 0$ : Produce closed, non-periodic curve if possible.\\
            \>\>\>\>  $= -1$ : Produce closed, periodic curve if possible.\\
                 \>\>\>\>  \begin{minipg2}
                 If a closed or periodic curve is to be produced and the
                 start- and endpoint is more distant than the length of
                 the tolerance, a new point is added. Note that if the
                 parametrization is given as input, the parametrization
                 if the last point will be arbitrary.
                                \end{minipg2}\\
        \>\>    {\fov afctol}\> - \>  \begin{minipg2}
                 Number indicating how the tolerance is to be shared
                 between the two data reduction stages. For the linear
                 reduction, a tolerance of $afctol*eeps$ will be used,
                 while a tolerance of $(1-afctol)*eeps$ will be used
                 during the final data reduction. (Similarly for edgeps.)
                               \end{minipg2}\\
        \>\>    {\fov itmax}\> - \>  \begin{minipg2}
                    Max. no. of iterations in the data-reduction routine.
                               \end{minipg2}\\
        \>\>    {\fov ik}\> - \>  \begin{minipg2}
                     The polynomial order of the approximation.
                               \end{minipg2}\\
\\
	\>Output Arguments:\\
        \>\>    {\fov rc}\> - \>  \begin{minipg2}
                     Pointer to curve.
                               \end{minipg2}\\
        \>\>    {\fov emxerr}\> - \>  \begin{minipg2}
                     Array (length idim) (allocated outside this routine.)
                 containing for each component an upper bound on the
                 max. deviation of the final approximation from the
                 initial piecewise linear interpolant.
                               \end{minipg2}\\
        \>\>    {\fov jstat}     \> - \> Status messages\\
                \>\>\>\>\>              $> 0$   : Warning.\\
                \>\>\>\>\>              $= 0$   : Ok.\\
                \>\>\>\>\>              $< 0$   : Error.\\
\\
EXAMPLE OF USE\\
		\>      \{ \\

                \>\>    double \> {\fov ep}[\,];\\
                \>\>    int    \>  {\fov im};\\
                \>\>    int    \>  {\fov idim};\\
                \>\>    int    \>  {\fov ipar};\\
                \>\>    double \> {\fov epar}[\,];\\
                \>\>    double \> {\fov eeps}[\,];\\
                \>\>    int    \>  {\fov ilend};\\
                \>\>    int    \>  {\fov irend};\\
                \>\>    int    \>  {\fov iopen};\\
                \>\>    double \> {\fov afctol};\\
                \>\>    int    \>  {\fov itmax};\\
                \>\>    int    \>  {\fov ik};\\
                \>\>    SISLCurve    \>  **{\fov rc};\\
                \>\>    double \> {\fov emxerr}[\,];\\
                \>\>    int    \>  *{\fov jstat};\\                \>\>    \ldots \\
        \>\>s1961(\begin{minipg4}
            {\fov ep}, {\fov im}, {\fov idim}, {\fov ipar}, {\fov epar}, {\fov eeps}, {\fov ilend}, {\fov irend}, {\fov iopen}, {\fov afctol},
            {\fov itmax}, {\fov ik}, {\fov rc}, {\fov emxerr}, {\fov jstat});
                \end{minipg4}\\
                \>\>    \ldots \\
		\>      \}
\end{tabbing}
