polyno.hxx

来自「不错的国外的有限元程序代码,附带详细的manual,可以节省很多的底层工作.」· HXX 代码 · 共 50 行

HXX
50
字号
//   ************************
//   *** CLASS POLYNOMIAL ***
//   ************************
 

#ifndef polyno_hxx

#include "flotarry.hxx"
#include <stdio.h>


class Polynomial
/*
   This abstract class is the superclass of the classes that implement
   polynomials : polynomials with one variable (X), with two variables
   (X,Y), etc.
 DESCRIPTION :
   The degree of a polynomial is stored in attribute 'degree ; for example,
   P(X,Y) = 2 + 4 X + 5 XY has degree 2.
   The coefficients of the polynomial are stored in 'coefficients' ; their
   sequence depends on the the polynomial's type (PolynomialXY, etc).
 TASKS :
   The task of a polynomial is to return its value at a given point (method
   'evaluatedAt').
*/
{
   protected :
      int          degree ;
      FloatArray*  coefficients ;

   public :
      Polynomial ()                       { }
      virtual ~Polynomial ()              { delete coefficients;}

      double&         at (int i)          { return coefficients -> at(i) ;}
      virtual double  evaluatedAt (FloatArray*)  = NULL ;
      virtual void    printYourself ()           = NULL ;
} ;

#define polyno_hxx
#endif








⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?