/* MTRPJJ.f -- translated by f2c (version 19960827).
   You must link the resulting object file with the libraries:
	-lf2c -lm   (in that order)
*/

#include "Data_f2c.h"
#ifdef WNT
#include <MathBase.h>
#else 
#define  __MathBase_API
#endif
/* Subroutine */ __MathBase_API int mmtrpjj_(ncofmx, ndimen, ncoeff, epsi3d, iordre, crvlgd, 
	ycvmax, errmax, ncfnew)
integer *ncofmx, *ndimen, *ncoeff;
doublereal *epsi3d;
integer *iordre;
doublereal *crvlgd, *ycvmax, *errmax;
integer *ncfnew;
{
    /* System generated locals */
    integer crvlgd_dim1, crvlgd_offset;

    /* Local variables */
    static integer ia;
    extern /* Subroutine */ int mmtrpj0_(), mmtrpj2_(), mmtrpj4_(), mmtrpj6_()
	    ;



/* < */
/* **NOTICE */
/*  THIS SOFTWARE IS THE PROPERTY OF CISIGRAPH. */
/*  THIS CODE MUST NOT BE DISTRIBUTED OR COPIED WITHOUT THE PRIOR */
/*  WRITTEN PERMISSION OF CISIGRAPH AND IS ONLY TO BE USED ON THE */
/*  SITE WHERE IT IS INSTALLED BY CISIGRAPH */
/* **NOTICE */

/* ***********************************************************************
 */

/*     FONCTION : */
/*     ---------- */
/*        Baisse le degre d' une courbe definie sur (-1,1) au sens de */
/*        Legendre a une precision donnee. */

/*     MOTS CLES : */
/*     ----------- */
/*        LEGENDRE,POLYGONE,TRONCONNAGE,COURBE,LISSAGE. */

/*     ARGUMENTS D'ENTREE : */
/*     ------------------ */
/*        NCOFMX : Nbre maxi de coeff. de la courbe (dimensionnement). */
/*        NDIMEN : Dimension de l' espace. */
/*        NCOEFF : Le degre +1 du polynome. */
/*        EPSI3D : La precision demandee pour l' approximation. */
/*        IORDRE : Ordre de continuite aux extremites. */
/*        CRVLGD : La courbe dont on veut baisser le degre. */

/*     ARGUMENTS DE SORTIE : */
/*     ------------------- */
/*        ERRMAX : La precision de l' approximation. */
/*        NCFNEW : Le degre +1 du polynome resultat. */

/*     COMMONS UTILISES   : */
/*     ---------------- */

/*     REFERENCES APPELEES   : */
/*     ----------------------- */

/*     DESCRIPTION/REMARQUES/LIMITATIONS : */
/*     ----------------------------------- */

/* $    HISTORIQUE DES MODIFICATIONS   : */
/*     -------------------------------- */
/*     06-08-91 : RBD; Declaration de dimension de YCVMAX. */
/*     18-01-90 : RBD; Creation. */

/* > */
/* ***********************************************************************
 */


    /* Parameter adjustments */
    --ycvmax;
    crvlgd_dim1 = *ncofmx;
    crvlgd_offset = crvlgd_dim1 + 1;
    crvlgd -= crvlgd_offset;

    /* Function Body */
    ia = (*iordre + 1) << 1;

    if (ia == 0) {
	mmtrpj0_(ncofmx, ndimen, ncoeff, epsi3d, &crvlgd[crvlgd_offset], &
		ycvmax[1], errmax, ncfnew);
    } else if (ia == 2) {
	mmtrpj2_(ncofmx, ndimen, ncoeff, epsi3d, &crvlgd[crvlgd_offset], &
		ycvmax[1], errmax, ncfnew);
    } else if (ia == 4) {
	mmtrpj4_(ncofmx, ndimen, ncoeff, epsi3d, &crvlgd[crvlgd_offset], &
		ycvmax[1], errmax, ncfnew);
    } else {
	mmtrpj6_(ncofmx, ndimen, ncoeff, epsi3d, &crvlgd[crvlgd_offset], &
		ycvmax[1], errmax, ncfnew);
    }

/* ------------------------ Fin ----------------------------------------- 
*/

    return 0;
} /* mmtrpjj_ */

