C++ main module for emicrom Package  1.0
MATH_P0.h
Go to the documentation of this file.
1 #ifndef MATH_P0_H
2 #define MATH_P0_H
3 
4 #include "MATH_Pn.h"
5 
14 
15 class MATH_P0 : public MATH_Pn{
16 
17 
19 
20  // ATTRIBUTES
21 
22 
23 
24 private:
25 
26 
27 public:
28  // METHODS
29 
30  // CONSTRUCTORS
31 
34  MATH_P0(void): MATH_Pn(0) {
35  }
36 protected:
41  MATH_P0(const tUIndex& n): MATH_Pn(n) {
42  }
43 
44 
45 
46  // DESTRUCTORS
47 
48 public:
51  virtual ~MATH_P0(void) {
52  }
53 
54 
55 public:
56 
57  // CONSTRUCTORS
58 
61  inline static SP::MATH_P0 New() {
62  SP::MATH_P0 ret(new MATH_P0(),
63  MATH_P0::Delete());
64  ret->setThis(ret);
65  return ret;
66  };
71  inline static SP::MATH_P0 New(const tReal a[]) {
72  SP::MATH_P0 p=New();
73  p->setCoefficients(a);
74  return p;
75  };
76 
77 
78 public:
79 
80 
81 
82  // GET methods
83 
84 
85 
86 public:
87 
88 
93  virtual tUInteger solve(tReal x[]) const {
94  const tReal *a=getCoefficients();
95  if (a[0]==0) return CORE_Object::getMaxUInteger();
96  return 0;
97  }
98 
99 
100 
101 
102 
103 
104 
105 };
106 
107 #endif
DEFINE_SPTR(MATH_P0)
This class describes a polynom of degre 0.
Definition: MATH_P0.h:15
#define tUInteger
Definition: types.h:91
virtual ~MATH_P0(void)
destroy
Definition: MATH_P0.h:51
const tReal * getCoefficients() const
get the coefficients
Definition: MATH_Pn.h:117
static SP::MATH_P0 New(const tReal a[])
builds a Polynome of 1-degree with coefficients
Definition: MATH_P0.h:71
MATH_P0(void)
create a polynom of degree 0
Definition: MATH_P0.h:34
SP_OBJECT(MATH_P0)
virtual tUInteger solve(tReal x[]) const
solve the equation P(x)=0.
Definition: MATH_P0.h:93
static SP::MATH_P0 New()
builds a Polynome of 1-degree
Definition: MATH_P0.h:61
static tUInteger getMaxUInteger()
get the max value for the unsigned integer type
Definition: CORE_Object.h:590
#define tUIndex
Definition: types.h:126
This class describes a polynom of degree n .
Definition: MATH_Pn.h:20
MATH_P0(const tUIndex &n)
create a polynom of degre n
Definition: MATH_P0.h:41
#define tReal
Definition: types.h:118
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141