/*************************************************************************** * Copyright (C) 2009 by Douglas Castro * * douglas@ime.unicamp.br * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef _NORMAS_H_ #define _NORMAS_H_ #include #include #include #include #include "definicoes.h" #include "imprime.h" #include "arvore.h" /** * devolve a norma L1 entre o erro da solucao exata e da recuperada * @param vetexa [in] vetor com medias exatas * @param vetapr [in] vetor com medias recuperadas * @param ncf [in] numero de folhas * @param cvol [in] volume da celula no nivel mais fino. (supoe que todas as folhas tem mesmo volume) */ double erro_norma_l1(double vetexa[], double vetapr[], int ncf, double cvol); void erro_norma_l1_v2(double vetexa[], No *r, int *pos, double *soma); double vol_cel_folha_malha_uniforme(int d, int niv, double xmin[], double xmax[]); /** * Rotina para calcular a norma infinito entre as medias , nas folhas, * exata e recuperada. * @param vetexa [in] vetor com copia das medias celulares exatas. * @param vetapr [in] vetor com copia das medias celulares reconstruidas * @param niv [in] quantos niveis tem a arvore */ double norma_inf(double vetexa[], double vetapr[],int niv); double erro_l1_analitica_numerica(double vetexa[],double vetunif[], int ncf); double erro_l2_analitica_numerica(double vetexa[],double vetunif[], int ncf); #endif