/*! \file tstest.cc * \brief test time series modules * * ---------------------------------------------------------------------------- * * $Id: tstest.cc,v 1.3 2006-06-29 07:11:42 tforb Exp $ * \author Thomas Forbriger * \date 20/12/2003 * * test time series modules * * Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach) * * ---- * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * ---- * * REVISIONS and CHANGES * - 20/12/2003 V1.0 Thomas Forbriger * - 27/06/2006 V1.1 did not work anymore; deleted old code and filled * with convolution test * * ============================================================================ */ #define TSTEST_VERSION \ "TSTEST V1.1 test time series modules" #define TSTEST_CVSID \ "$Id: tstest.cc,v 1.3 2006-06-29 07:11:42 tforb Exp $" #include #include #include #include using std::cout; using std::cerr; using std::endl; int main(int iargc, char* argv[]) { { aff::Series a(-2,2), b(-3,3), c, d; cout << endl; cout << "convolution test 1" << endl; for (int i=a.f(); i<=a.l(); ++i) { a(i)=i; } for (int i=b.f(); i<=b.l(); ++i) { b(i)=i; } DUMP( a ); DUMP( b ); DUMP( ts::convolve(a,b) ); c=a; c.shift(-c.f()); DUMP( c ); DUMP( ts::convolve(c,b) ); d=b; d.shift(-d.f()); DUMP( d ); DUMP( ts::convolve(c,d) ); } { aff::Series a(-2,2), b(-3,3); cout << endl; cout << "convolution test 2" << endl; for (int i=a.f(); i<=a.l(); ++i) { a(i)=1; } for (int i=b.f(); i<=b.l(); ++i) { b(i)=1; } DUMP( a ); DUMP( b ); DUMP( ts::convolve(a,b) ); } } /* ----- END OF tstest.cc ----- */