summaryrefslogtreecommitdiff
path: root/esolid/wrapper/include/kpoly.h
blob: 5ea6a221831515729bc65dd50fcac2966ebe0e29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//  file:    kpoly.h
//  update:  09/26/02

#ifndef _KPOLY_H
#define _KPOLY_H

#include <cassert>
#include <cstdlib>
#include <iostream>

using namespace std;

class K_POLY
{
//  A base class for polynomials
  
protected:
  
  unsigned long num_vars;    //  Number of variables
  long*         deg;         //  Max. degree in each variable
  unsigned long num_coeffs;  //  Number of coefficients (terms)
  
public:
  
  //  constructor, assignment and destructor
  
	K_POLY();
  K_POLY(const unsigned long, const long* const);
  
  K_POLY(const K_POLY&);
  K_POLY& operator =(const K_POLY&);
  
  virtual ~K_POLY();
  
protected:
  
  long* index_to_powers(const unsigned long i) const;
  //  For an index, i, return the powers, p, of the term
  //  to which the i-th coefficient belongs to.
  
  long* index_to_powers_homog(const unsigned long t,
                              const unsigned long i) const;
  //  For an index, i, return the powers, p, of the term
  //  to which the i-th coefficient belongs to.
  
  unsigned long index_to_deg(const unsigned long i) const;
  //  Return the total degree of the i-th term.
  
  unsigned long powers_to_index(const long* const p) const;
  //  Return the index of the term of the powers p.
};

#endif