Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

longpoly Class Reference

This helper class describes polynomials with long coefficients. More...

#include <SimSeqs.h>

List of all members.

Public Methods

 longpoly (long cflen=15, long bs=0)
 ~longpoly ()
long GetDegree ()
long SetDegree (long deg)
long SetCoeff (long k, long val)
long GetCoeff (long k)
longpoly* times (longpoly &poly1)

Protected Attributes

long deg
long base
long* coeff
long coefflen


Detailed Description

This helper class describes polynomials with long coefficients.

I know, this should probably be implemented as a Template class so that arbitrary data types are allowed. I'm just too lazy for now ;-)


Constructor & Destructor Documentation

longpoly::longpoly ( long cflen = 15,
long bs = 0 )
 

initializes the polynomial with the given number of coefficients (order, default is 15) and in base bs (default is 0).

If bs is set <=0, this means: "Don't do any modulo operations on the coefficients",i.e. we are in Z

longpoly::~longpoly ( )
 


Member Function Documentation

long longpoly::GetCoeff ( long k )
 

Gets the k-th coefficient.

long longpoly::GetDegree ( )
 

Returns the degree of the polynomial (memory allocated for the coefficients).

long longpoly::SetCoeff ( long k,
long val )
 

Sets the k-th coefficient to val.

long longpoly::SetDegree ( long deg )
 

Sets a new possible degree for the polynomial by allocating sufficient memory (old coefficients are preserved).

longpoly * longpoly::times ( longpoly & poly1 )
 

multiply this polynomial with another one (poly1).

A new longpoly object is returned, which has to be free manually / by the garbage collection


Member Data Documentation

long longpoly::base [protected]
 

if we are in the Ring Z_n, this is the base for all the modulo operations.

long * longpoly::coeff [protected]
 

this field stores the coefficients of the polynomial.

long longpoly::coefflen [protected]
 

Size of memory allocated for the coefficients.

long longpoly::deg [protected]
 

stores the degree of the polynomial.


The documentation for this class was generated from the following files:
Generated at Wed Jun 20 19:48:29 2001 for LDSequences by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001