LCOV - code coverage report
Current view: top level - src - spline.h (source / functions) Hit Total Coverage
Test: qucs-core-0.0.19 Code Coverage Lines: 0 1 0.0 %
Date: 2015-01-05 16:01:02 Functions: 0 1 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * spline.h - spline class definitions
       3                 :            :  *
       4                 :            :  * Copyright (C) 2005, 2006, 2009 Stefan Jahn <stefan@lkcc.org>
       5                 :            :  *
       6                 :            :  * This is free software; you can redistribute it and/or modify
       7                 :            :  * it under the terms of the GNU General Public License as published by
       8                 :            :  * the Free Software Foundation; either version 2, or (at your option)
       9                 :            :  * any later version.
      10                 :            :  *
      11                 :            :  * This software is distributed in the hope that it will be useful,
      12                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      13                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14                 :            :  * GNU General Public License for more details.
      15                 :            :  *
      16                 :            :  * You should have received a copy of the GNU General Public License
      17                 :            :  * along with this package; see the file COPYING.  If not, write to
      18                 :            :  * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
      19                 :            :  * Boston, MA 02110-1301, USA.
      20                 :            :  *
      21                 :            :  * $Id$
      22                 :            :  *
      23                 :            :  */
      24                 :            : 
      25                 :            : #ifndef __SPLINE_H__
      26                 :            : #define __SPLINE_H__
      27                 :            : 
      28                 :            : #include "tvector.h"
      29                 :            : 
      30                 :            : namespace qucs {
      31                 :            : 
      32                 :            : // Types of boundary conditions.
      33                 :            : enum spline_boundary_type {
      34                 :            :   SPLINE_BC_UNKNOWN = -1,
      35                 :            :   SPLINE_BC_NATURAL,       // natural splines -- zero derivatives
      36                 :            :   SPLINE_BC_CLAMPED,       // endpoint derivatives given
      37                 :            :   SPLINE_BC_PERIODIC       // periodic splines
      38                 :            : };
      39                 :            : 
      40                 :            : class vector;
      41                 :            : class poly;
      42                 :            : 
      43                 :            : class spline
      44                 :            : {
      45                 :            :  public:
      46                 :            :   spline ();
      47                 :            :   spline (int);
      48                 :            :   spline (qucs::vector, qucs::vector);
      49                 :            :   spline (tvector<nr_double_t>, tvector<nr_double_t>);
      50                 :            :   ~spline ();
      51                 :            : 
      52                 :            :   void vectors (qucs::vector, qucs::vector);
      53                 :            :   void vectors (tvector<nr_double_t>, tvector<nr_double_t>);
      54                 :            :   void vectors (nr_double_t *, nr_double_t *, int);
      55                 :            :   void construct (void);
      56                 :            :   poly evaluate (nr_double_t);
      57                 :          0 :   void setBoundary (int b) { boundary = b; }
      58                 :            :   void setDerivatives (nr_double_t l, nr_double_t r) { d0 = l; dn = r; }
      59                 :            : 
      60                 :            :  private:
      61                 :            :   nr_double_t * upper_bound (nr_double_t *, nr_double_t *, nr_double_t);
      62                 :            :   void realloc (int);
      63                 :            : 
      64                 :            :  private:
      65                 :            :   nr_double_t * x;
      66                 :            :   nr_double_t * f0;
      67                 :            :   nr_double_t * f1;
      68                 :            :   nr_double_t * f2;
      69                 :            :   nr_double_t * f3;
      70                 :            :   nr_double_t d0, dn;
      71                 :            :   int n;
      72                 :            :   int boundary;
      73                 :            : };
      74                 :            : 
      75                 :            : } // namespace qucs
      76                 :            : 
      77                 :            : #endif /* __SPLINE_H__ */

Generated by: LCOV version 1.11