/* $Id: cpl_bivector-test.c,v 1.25 2008/02/07 10:54:01 llundin Exp $ * * This file is part of the ESO Common Pipeline Library * Copyright (C) 2001-2004 European Southern Observatory * * 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 */ /* * $Author: llundin $ * $Date: 2008/02/07 10:54:01 $ * $Revision: 1.25 $ * $Name: $ */ #include #include #include #include #include #include "cpl_bivector.h" #include "cpl_tools.h" #include "cpl_memory.h" #include "cpl_math_const.h" #define FUNCTION_SIZE 1024 /*----------------------------------------------------------------------------- Main -----------------------------------------------------------------------------*/ int main(void) { cpl_bivector * sinus; cpl_bivector * cosinus; cpl_bivector * tmp_fun; double * data_x, * data_y; cpl_vector * vec1, * vec2; double scale; double error; FILE * f_out; char filename[1024]; int i; cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING); /* Insert actual test code here */ scale = CPL_MATH_2PI / FUNCTION_SIZE; /* Create the first 1d function : sinus function */ cpl_test( sinus = cpl_bivector_new(FUNCTION_SIZE) ); /* Fill the sinus function */ data_x = cpl_bivector_get_x_data(sinus); data_y = cpl_bivector_get_y_data(sinus); for (i=0 ; i