1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
int main()
{
double *gleichm_stuetzstellenx;
double *tscheby_stuetzstellenx;
double *gleichm_stuetzstelleny;
double *tscheby_stuetzstelleny;
double *gleichm_koeff;
double *tscheby_koeff;
int i;
int j;
printf("Die Werte des Interpolationspolynoms an der Stelle x = pi/4 sind:\n\n");
printf("n\tGleichmäßige Verteilung\tTschebyscheff-Verteilung\n");
for (i = 0; i <= sizeof(narray) - 1; i++)
{
gleichm_stuetzstellenx = new double[narray[i]];
tscheby_stuetzstellenx = new double[narray[i]];
gleichm_stuetzstelleny = new double[narray[i]];
tscheby_stuetzstelleny = new double[narray[i]];
gleichm_koeff = new double[narray[i]];
tscheby_koeff = new double[narray[i]];
calcstuetzstellen(narray[i], gleichm_stuetzstellenx, gleichm_stuetzstelleny, tscheby_stuetzstellenx, tscheby_stuetzstelleny );
calcdivdifferenz(narray[i], gleichm_stuetzstellenx, gleichm_stuetzstelleny, tscheby_stuetzstellenx, tscheby_stuetzstelleny, gleichm_koeff, tscheby_koeff);
printf("%i\t%.8E\t%.8E\n", narray[i], calcpolynom_gleichm(PI / 4, narray[i], gleichm_stuetzstellenx, gleichm_koeff), calcpolynom_tscheby(PI / 4, narray[i], tscheby_stuetzstellenx, tscheby_koeff));
delete [] gleichm_stuetzstellenx;
delete [] tscheby_stuetzstelleny;
delete [] gleichm_stuetzstellenx;
delete [] tscheby_stuetzstelleny;
delete [] gleichm_koeff;
delete [] tscheby_koeff;
}
return 0;
}
(...)
|