/* MFUNJ2.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"

/* Common Block Declarations */

extern struct {
    integer nelbas, orherm;
} mmcheba_;

#define mmcheba_1 mmcheba_

/* Subroutine */ int mmfunj2_(ninteg, parame, vfunj2, iercod)
integer *ninteg;
doublereal *parame, *vfunj2;
integer *iercod;
{
    /* System generated locals */
    integer i__1, i__2;

    /* Local variables */
    static logical ldbg;
    static integer i__, j, k;
    static doublereal tbase[63];
    static integer i0, i1, orderi, ier;
    extern integer mnfndeb_();
    extern /* Subroutine */ int maermsg_(), mgenmsg_(), mmpobas_(), mgsomsg_()
	    ;



/* < */
/* **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 : */
/*     ---------- */
/*     CALCUL DES VALEURS DE LA FONCTION : */
/*     PRODUIT DE DEUX DERIVEES DE DEUX POLYNOMES (ELEMENTS D'UNE BASE */
/*     HERMITE-JACOBI) ,APPLIQUEE AU PARAMETRE PARAME */


/*     MOTS CLES : */
/*     ----------- */
/*      POSITONEMENT, FLEXION, HERIMTE, JACOBI */

/*     ARGUMENTS D'ENTREE : */
/*     -------------------- */
/*       NINTEG:NOMBRE DE PRODUIT A CALCULER */
/*       PARAME:PARAMETRE DES POLYNOMES */

/*     ARGUMENTS DE SORTIE : */
/*     --------------------- */
/*       VFUNJ2:TABLE DE VALEURS DES NINTEG PRODUITS */
/*       IERCOD:CODE ERREUR */

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


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


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


/* $    HISTORIQUE DES MODIFICATIONS : */
/*     ------------------------------ */
/*     04-08-95 : KHN; ECRITURE VERSION ORIGINALE. */
/* > */
/* ***********************************************************************
 */
/*                            DECLARATIONS */
/* ***********************************************************************
 */


/*      INCLUDE MMCHEBA */

/* < */
/* **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 : */
/*     ---------- */
/*       Contient les parametres necessaires a l' integration par */
/*     MMGAUS1, des criteres variationnel des lissage de courbes */

/*     MOTS CLES : */
/*     ----------- */
/*     RESERVE, INTEGRATION, DERIVATION, LISSAGE */

/*     DEMSCRIPTION/REMARQUES/LIMITATIONS : */
/*     ----------------------------------- */

/*     NELBAS : Nombre de coefficients dans la base d'Hermite-Jacobi */
/*     ORHERM : Ordre des polynomes d'Hermite. */

/* $    HISTORIQUE DES MODIFICATIONS : */
/*     ------------------------------ */
/*      20-09-1995: KHN; CREATION VERSION ORIGINALE. */

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



/* ***********************************************************************
 */
/*                      INITIALISATIONS */
/* ***********************************************************************
 */

    /* Parameter adjustments */
    --vfunj2;

    /* Function Body */
    ldbg = mnfndeb_() >= 2;
    if (ldbg) {
	mgenmsg_("MMFUNJ2", 7L);
    }
    *iercod = 0;
    ier = 0;

/* ***********************************************************************
 */
/*                     TRAITEMENT */
/* ***********************************************************************
 */

    if (mmcheba_1.nelbas > 21) {
	goto L9101;
    }

    orderi = 2;
    mmpobas_(parame, &mmcheba_1.orherm, &mmcheba_1.nelbas, &orderi, tbase, &
	    ier);
    if (ier > 0) {
	goto L9102;
    }

    k = 0;
    i0 = (mmcheba_1.nelbas << 1) + 1;
    i1 = mmcheba_1.nelbas * 3;
    i__1 = i1;
    for (i__ = i0; i__ <= i__1; ++i__) {
	i__2 = i__;
	for (j = i0; j <= i__2; ++j) {
	    ++k;
	    vfunj2[k] = tbase[i__ - 1] * tbase[j - 1];
	}
    }
    goto L9999;

/* ***********************************************************************
 */
/*                   TRAITEMENT DES ERREURS */
/* ***********************************************************************
 */

L9101:
    *iercod = 1;
    goto L9999;

L9102:
    *iercod = 2;
    goto L9999;

/* ***********************************************************************
 */
/*                   RETOUR PROGRAMME APPELANT */
/* ***********************************************************************
 */
L9999:

    maermsg_("MMFUNJ2", iercod, 7L);
    if (ldbg) {
	mgsomsg_("MMFUNJ2", 7L);
    }
 return 0 ;
} /* mmfunj2_ */

