\subsection{Data reduction: B-spline surface as input.}
\funclabel{s1345}
\begin{minipg1}
  To remove knots from a tensor-product B-spline (i.e.\ NOT rational)
  surface and calculate an approximation to the original surface on the
  reduced knot vectors.
  The output is represented as a B-spline surface.
\end{minipg1} \\ \\
SYNOPSIS\\
        \>void s1345(\begin{minipg3}
                        {\fov surf}, {\fov eps}, {\fov edgefix}, {\fov edgeps}, {\fov epsco}, {\fov optim}, {\fov itmax}, {\fov newsurf},
                        {\fov maxerr}, {\fov stat})
                        \end{minipg3}\\[0.3ex]

                \>\>    SISLSurf        \>      *{\fov surf};\\
                \>\>    double  \>      {\fov eps}[\,];\\
                \>\>    int     \>      {\fov edgefix}[\,];\\
                \>\>    double  \>      {\fov edgeps}[\,];\\
                \>\>    double  \>      {\fov epsco};\\
                \>\>    int     \>      {\fov optim};\\
                \>\>    int     \>      {\fov itmax};\\
                \>\>    SISLSurf        \>      **{\fov newsurf};\\
                \>\>    double  \>      {\fov maxerr}[\,];\\
                \>\>    int     \>      *{\fov stat};\\
\\
ARGUMENTS\\
        \>Input Arguments:\\
        \>\>    {\fov surf}\> - \>      \begin{minipg2}
                                Pointer to the original B-spline surface.
                                \end{minipg2}\\
        \>\>    {\fov eps}\> - \>       \begin{minipg2}
                                Array with length dim (dim=geometrical dimension)
                                containing the
                                maximum deviation which is
                                acceptable in each of the dim
                                components of the surface (except
                                possibly along the edges).
                                \end{minipg2}\\[0.3ex]
        \>\>    {\fov edgefix}\> - \>   \begin{minipg2}
                                Array (length 4) containing the no. of derivatives to be
                                kept "fixed" along each edge of the surface. The
                                numbering of the edges is the same as for edgeps
                                below. All the derivatives of
                                $order<\mbox{edgefix}[i]-1$ will
                                be kept "fixed" along edge no. $i$.
                                Hence $\mbox{edgefix}[i]=0$
                                indicates that nothing is to be kept fixed along edge
                                no. $i$. To be kept fixed means to have error of approximation less
                                than edges. In general, it is impossible to remove any
                                knots and keep an edge completely fixed.
                                \end{minipg2}\\
        \>\>    {\fov edgeps}\> - \>    \begin{minipg2}
                                Array with length dim*4
                                (dim=geometrical dimension)  containing the max.
                                deviation which is acceptable along the edges of
                                the surfaces.
                                \end{minipg2}\\[0.3ex]
                \>\>\>\>        \begin{minipg2}
                                $edgeps[dim*i],\ldots,edgeps[(dim*(i+1)-1]$
                                gives the
                                tolerance along the edge nr. $i$ corresponding to the
                                following:
                                \end{minipg2}\\[0.3ex]
                \>\>\>\>        \begin{minipg2}
                                \begin{center}
                                        \begin{picture}(180,110)(0,0)
                                        \put(50,15){\framebox(80,80)}
                                        \put(40,55){\makebox(0,0){0}}
                                        \put(140,55){\makebox(0,0){1}}
                                        \put(90,5){\makebox(0,0){2}}
                                        \put(90,105){\makebox(0,0){3}}

                                        \put(60,20){\vector(1,0){40}}
                                        \put(85,28){\makebox(0,0){$(i)$}}
                                        \put(55,25){\vector(0,1){40}}
                                        \put(65,50){\makebox(0,0){$(ii)$}}
                                        \end{picture}\\
                                        $(i) \; \; \;$ first parameter direction of surface.\\
                                        $(ii)$   second parameter direction of surface.\\
                                \end{center}
                                $edgeps[dim*i],\ldots,edgeps[(dim*(i+1)-1]$
                                will only have any significance if $\mbox{edgefix}[i]>0$.
                                \end{minipg2} \\[0.3ex]
        \>\>    {\fov epsco}\> - \>             \begin{minipg2}
                                Two numbers differing by a relative amount less than
                                epsco will in some cases be considered equal. A suitable
                                value is just above the unit roundoff of the machine.
                                A reasonable choice might be $10^{-15}$. The
                                computations are not guaranteed to have relative
                                accuracy less than epsco.
                                Not used anymore.
                                \end{minipg2} \\[0.3ex]
        \>\>    {\fov optim}\> - \>             \begin{minipg2}
                                Flag indicating the order in which the data
                                reduction is to be performed.
                                \end{minipg2}\\[0.3ex]
                \>\>\>\>\>      $= 1$ :\>\begin{minipg5}
                                Remove knots in parameter-direction 1 only.
                                \end{minipg5}\\[0.3ex]
                \>\>\>\>\>      $= 2$ : \>\begin{minipg5}
                                Remove knots in parameter-direction 2 only.
                                \end{minipg5}\\[0.3ex]
                \>\>\>\>\>      $= 3$ : \>\begin{minipg5}
                                        Remove knots in parameter-direction 1
                                                and then in parameter-direction 2.
                                \end{minipg5}\\[0.3ex]
                \>\>\>\>\>      $= 4$ : \>\begin{minipg5}
                                        Remove knots in parameter-direction 2
                                                and then in parameter-direction 1.
                                \end{minipg5}\\[0.3ex]
        \>\>    {\fov itmax}\> - \>     \begin{minipg2}
                                Max. no. of iterations.
                                \end{minipg2}\\
\\
        \>Output Arguments:\\
        \>\>    {\fov newsurf}\> - \>   \begin{minipg2}
                                Pointer to the produced B-spline surface.
                                \end{minipg2}\\
        \>\>    {\fov maxerr}\> - \>    \begin{minipg2}
                                Array with length dim (dim=geometrical dimension)
                                allocated outside this routine and
                                containing an upper bound for the pointwise error in
                                each of the components of the spline-approximation.
                                \end{minipg2}\\[0.3ex]
        \>\>    stat    \> - \> Status messages\\
                \>\>\>\>\>              $> 0$   : warning\\
                \>\>\>\>\>              $= 0$   : ok\\
                \>\>\>\>\>              $< 0$   : error\\
\newpagetabs
EXAMPLE OF USE\\
                \>      \{ \\
                \>\>    SISLSurf        \>      *{\fov surf};\\
                \>\>    double  \>      {\fov eps}[3];\\
                \>\>    int     \>      {\fov edgefix}[4];\\
                \>\>    double  \>      {\fov edgeps}[12];\\
                \>\>    double  \>      {\fov epsco};\\
                \>\>    int     \>      {\fov optim};\\
                \>\>    int     \>      {\fov itmax};\\
                \>\>    SISLSurf        \>      *{\fov newsurf};\\
                \>\>    double  \>      {\fov maxerr}[3];\\
                \>\>    int     \>      {\fov stat};\\
                \>\>    \ldots \\
        \>\>s1345(\begin{minipg4}
                        {\fov surf}, {\fov eps}, {\fov edgefix}, {\fov edgeps}, {\fov epsco}, {\fov optim},
                        {\fov itmax}, \&{\fov newsurf}, {\fov maxerr}, \&{\fov stat});
                        \end{minipg4}\\
                \>\>    \ldots \\
                \>      \} \\
\end{tabbing}
