/* MJACCV.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 mmjaccv_(ncoef, ndim, ider, crvlgd, polaux, crvcan)
integer *ncoef, *ndim, *ider;
doublereal *crvlgd, *polaux, *crvcan;
{
    /* Initialized data */

    static char nomprg[8+1] = "MMJACCV ";

    /* System generated locals */
    integer crvlgd_dim1, crvlgd_offset, crvcan_dim1, crvcan_offset, 
	    polaux_dim1, i__1, i__2;

    /* Local variables */
    static integer ndeg, i__, nd, ii, ibb;
    extern /* Subroutine */ int mmjacan_();
    extern integer mnfndeb_();
    extern /* Subroutine */ int mgenmsg_();



/* < */
/* **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 : */
/*     ---------- */
/*        Passage de la base de Jacobi normalisee a la base canonique. */

/*     MOTS CLES : */
/*     ----------- */
/*        LISSAGE,BASE,LEGENDRE */


/*     ARGUMENTS D'ENTREE : */
/*     ------------------ */
/*        NDIM: Dimension de l' espace. */
/*        NCOEF: Degre +1 du polynome. */
/*        IDER: Ordre des polynomes de Jacobi. */
/*        CRVLGD : La courbe dans la base de Jacobi. */

/*     ARGUMENTS DE SORTIE : */
/*     ------------------- */
/*        POLAUX : Espace auxilliaire. */
/*        CRVCAN : La courbe dans la base canonique [-1,1] */

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

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

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

/* $    HISTORIQUE DES MODIFICATIONS   : */
/*     -------------------------------- */
/*     26-04-1988 : RBD ; Cas de la courbe reduite a 1 point. */
/*     01-03-1988 : JJM ; Creation. */

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

/*   Le nom de la routine */
    /* Parameter adjustments */
    polaux_dim1 = (*ncoef - 1) / 2 + 1;
    crvcan_dim1 = *ncoef - 1 + 1;
    crvcan_offset = crvcan_dim1;
    crvcan -= crvcan_offset;
    crvlgd_dim1 = *ncoef - 1 + 1;
    crvlgd_offset = crvlgd_dim1;
    crvlgd -= crvlgd_offset;

    /* Function Body */

    ibb = mnfndeb_();
    if (ibb >= 3) {
	mgenmsg_(nomprg, 6L);
    }

    ndeg = *ncoef - 1;

    i__1 = *ndim;
    for (nd = 1; nd <= i__1; ++nd) {
/*   Chargement du tableau auxilliaire. */
	ii = 0;
	i__2 = ndeg / 2;
	for (i__ = 0; i__ <= i__2; ++i__) {
	    polaux[i__] = crvlgd[ii + nd * crvlgd_dim1];
	    ii += 2;
/* L310: */
	}

	ii = 1;
	if (ndeg >= 1) {
	    i__2 = (ndeg - 1) / 2;
	    for (i__ = 0; i__ <= i__2; ++i__) {
		polaux[i__ + polaux_dim1] = crvlgd[ii + nd * crvlgd_dim1];
		ii += 2;
/* L320: */
	    }
	}
/*   Appel a la routine de changement de base. */
	mmjacan_(ider, &ndeg, polaux, &crvcan[nd * crvcan_dim1]);
/* L300: */
    }


/* L9999: */
    return 0;
} /* mmjaccv_ */

