![]() |
My Project
debian-1:4.1.2-p1+ds-2
|
Header for factory's main class CanonicalForm. More...
#include <iostream>
#include <stdint.h>
#include "cf_defs.h"
#include "variable.h"
#include "factory/cf_gmp.h"
#include "factory/templates/ftmpl_list.h"
#include "factory/templates/ftmpl_array.h"
#include "factory/templates/ftmpl_afactor.h"
#include "factory/templates/ftmpl_factor.h"
#include "factory/templates/ftmpl_matrix.h"
#include "omalloc/omallocClass.h"
Go to the source code of this file.
Data Structures | |
class | CanonicalForm |
factory's main class More... | |
Macros | |
#define | OSTREAM std::ostream |
#define | ISTREAM std::istream |
#define | CF_INLINE |
#define | CF_NO_INLINE |
#define | CF_INLINE |
Typedefs | |
typedef AFactor< CanonicalForm > | CFAFactor |
typedef List< CFAFactor > | CFAFList |
typedef ListIterator< CFAFactor > | CFAFListIterator |
typedef Factor< CanonicalForm > | CFFactor |
typedef List< CFFactor > | CFFList |
typedef ListIterator< CFFactor > | CFFListIterator |
typedef List< CanonicalForm > | CFList |
typedef ListIterator< CanonicalForm > | CFListIterator |
typedef Array< CanonicalForm > | CFArray |
typedef Matrix< CanonicalForm > | CFMatrix |
typedef List< CFList > | ListCFList |
typedef ListIterator< CFList > | ListCFListIterator |
typedef List< int > | IntList |
typedef ListIterator< int > | IntListIterator |
typedef List< Variable > | Varlist |
typedef ListIterator< Variable > | VarlistIterator |
typedef Array< int > | Intarray |
Header for factory's main class CanonicalForm.
Definition in file canonicalform.h.
#define CF_INLINE |
Definition at line 55 of file canonicalform.h.
#define CF_INLINE |
Definition at line 55 of file canonicalform.h.
#define CF_NO_INLINE |
Definition at line 46 of file canonicalform.h.
#define ISTREAM std::istream |
Definition at line 17 of file canonicalform.h.
#define OSTREAM std::ostream |
Definition at line 16 of file canonicalform.h.
typedef AFactor<CanonicalForm> CFAFactor |
Definition at line 382 of file canonicalform.h.
Definition at line 383 of file canonicalform.h.
typedef ListIterator<CFAFactor> CFAFListIterator |
Definition at line 384 of file canonicalform.h.
typedef Array<CanonicalForm> CFArray |
Definition at line 390 of file canonicalform.h.
typedef Factor<CanonicalForm> CFFactor |
Definition at line 385 of file canonicalform.h.
Definition at line 386 of file canonicalform.h.
typedef ListIterator<CFFactor> CFFListIterator |
Definition at line 387 of file canonicalform.h.
typedef List<CanonicalForm> CFList |
Definition at line 388 of file canonicalform.h.
typedef ListIterator<CanonicalForm> CFListIterator |
Definition at line 389 of file canonicalform.h.
typedef Matrix<CanonicalForm> CFMatrix |
Definition at line 391 of file canonicalform.h.
Definition at line 398 of file canonicalform.h.
Definition at line 394 of file canonicalform.h.
typedef ListIterator<int> IntListIterator |
Definition at line 395 of file canonicalform.h.
typedef List<CFList> ListCFList |
Definition at line 392 of file canonicalform.h.
typedef ListIterator<CFList> ListCFListIterator |
Definition at line 393 of file canonicalform.h.
Definition at line 396 of file canonicalform.h.
typedef ListIterator<Variable> VarlistIterator |
Definition at line 397 of file canonicalform.h.
CanonicalForm apply | ( | const CanonicalForm & | f, |
void(*)(CanonicalForm &, int &) | mf | ||
) |
CanonicalForm apply ( const CanonicalForm & f, void (*mf)( CanonicalForm &, int & ) )
apply() - apply mf to terms of f.
Calls mf( f[i], i ) for each term f[i]*x^i of f and builds a new term from the result. If f is in a coefficient domain, mf( f, i ) should result in an i == 0, since otherwise it is not clear which variable to use for the resulting term.
An example:
Then apply( f, diff ) is differentation of f with respect to the main variable of f.
Definition at line 402 of file cf_ops.cc.
CanonicalForm blcm | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
Definition at line 1757 of file canonicalform.cc.
CanonicalForm content | ( | const CanonicalForm & | f | ) |
CanonicalForm content ( const CanonicalForm & f )
content() - return content(f) with respect to main variable.
Normalizes result.
Definition at line 175 of file cf_gcd.cc.
CanonicalForm content | ( | const CanonicalForm & | f, |
const Variable & | x | ||
) |
CanonicalForm content ( const CanonicalForm & f, const Variable & x )
content() - return content(f) with respect to x.
x should be a polynomial variable.
Definition at line 201 of file cf_gcd.cc.
|
inline |
Definition at line 309 of file canonicalform.h.
|
inline |
Definition at line 312 of file canonicalform.h.
int* degrees | ( | const CanonicalForm & | f, |
int * | degs | ||
) |
int * degrees ( const CanonicalForm & f, int * degs )
degress() - return the degrees of all polynomial variables in f.
Returns 0 if f is in a coefficient domain, the degrees of f in all its polynomial variables in an array of int otherwise:
degrees( f, 0 )[i] = degree( f, Variable(i) )
If degs is not the zero pointer the degrees are stored in this array. In this case degs should be larger than the level of f. If degs is the zero pointer, an array of sufficient size is allocated automatically.
Definition at line 493 of file cf_ops.cc.
|
inline |
Definition at line 333 of file canonicalform.h.
|
inline |
Definition at line 339 of file canonicalform.h.
CF_NO_INLINE CanonicalForm div | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
CF_INLINE CanonicalForm div, mod ( const CanonicalForm & lhs, const CanonicalForm & rhs )
Definition at line 553 of file cf_inline.cc.
CanonicalForm gcd | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
Definition at line 257 of file cf_gcd.cc.
CanonicalForm gcd_poly | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
CanonicalForm gcd_poly ( const CanonicalForm & f, const CanonicalForm & g )
gcd_poly() - calculate polynomial gcd.
This is the dispatcher for polynomial gcd calculation. Different gcd variants get called depending the input, characteristic, and on switches (cf_defs.h)
With the current settings from Singular (i.e. SW_USE_EZGCD= on, SW_USE_EZGCD_P= on, SW_USE_CHINREM_GCD= on, the EZ GCD variants are the default algorithms for multivariate polynomial GCD computations)
Definition at line 91 of file cf_gcd.cc.
int getCharacteristic | ( | ) |
Definition at line 51 of file cf_char.cc.
int getGFDegree | ( | ) |
Definition at line 56 of file cf_char.cc.
CanonicalForm getGFGenerator | ( | ) |
Definition at line 62 of file cf_char.cc.
int getNumVars | ( | const CanonicalForm & | f | ) |
int getNumVars ( const CanonicalForm & f )
getNumVars() - get number of polynomial variables in f.
Definition at line 314 of file cf_ops.cc.
CanonicalForm getVars | ( | const CanonicalForm & | f | ) |
CanonicalForm getVars ( const CanonicalForm & f )
getVars() - get polynomial variables of f.
Return the product of all of them, 1 if there are not any.
Definition at line 350 of file cf_ops.cc.
bool hasFirstAlgVar | ( | const CanonicalForm & | f, |
Variable & | a | ||
) |
check if poly f contains an algebraic variable a
Definition at line 665 of file cf_ops.cc.
|
inline |
Definition at line 353 of file canonicalform.h.
|
inline |
Definition at line 362 of file canonicalform.h.
CanonicalForm icontent | ( | const CanonicalForm & | f | ) |
CanonicalForm icontent ( const CanonicalForm & f )
icontent() - return gcd over all coefficients of f which are in a coefficient domain.
Definition at line 71 of file cf_gcd.cc.
|
inline |
Definition at line 345 of file canonicalform.h.
|
inline |
Definition at line 62 of file canonicalform.h.
bool isOn | ( | int | sw | ) |
|
inline |
Definition at line 297 of file canonicalform.h.
|
inline |
Definition at line 300 of file canonicalform.h.
|
inline |
Definition at line 303 of file canonicalform.h.
|
inline |
Definition at line 306 of file canonicalform.h.
CanonicalForm lcm | ( | const CanonicalForm & | f, |
const CanonicalForm & | g | ||
) |
CanonicalForm lcm ( const CanonicalForm & f, const CanonicalForm & g )
lcm() - return least common multiple of f and g.
The lcm is calculated using the formula lcm(f, g) = f * g / gcd(f, g).
Returns zero if one of f or g equals zero.
CanonicalForm leftShift | ( | const CanonicalForm & | F, |
int | n | ||
) |
left shift the main variable of F by n
Definition at line 683 of file cf_ops.cc.
|
inline |
Definition at line 324 of file canonicalform.h.
CanonicalForm mapdomain | ( | const CanonicalForm & | f, |
CanonicalForm(*)(const CanonicalForm &) | mf | ||
) |
CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) )
mapdomain() - map all coefficients of f through mf.
Recursively descends down through f to the coefficients which are in a coefficient domain mapping each such coefficient through mf and returns the result.
Definition at line 440 of file cf_ops.cc.
|
inline |
Definition at line 348 of file canonicalform.h.
CF_NO_INLINE CanonicalForm mod | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
Definition at line 564 of file cf_inline.cc.
|
inline |
Definition at line 327 of file canonicalform.h.
|
inline |
Definition at line 330 of file canonicalform.h.
void Off | ( | int | sw | ) |
void On | ( | int | sw | ) |
CF_NO_INLINE CanonicalForm operator% | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
Definition at line 540 of file cf_inline.cc.
CF_INLINE CanonicalForm operator* | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
Definition at line 517 of file cf_inline.cc.
CF_INLINE CanonicalForm operator+ | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
CF_INLINE CanonicalForm operator +, -, *, /, % ( const CanonicalForm & lhs, const CanonicalForm & rhs )
operators +, -, *, /, %(), div(), mod() - binary arithmetic operators.
The binary operators have their standard (mathematical) semantics. As explained for the corresponding arithmetic assignment operators, the operators ‘/’ and ‘%’ return the quotient resp. remainder of (polynomial) division with remainder, whereas ‘div()’ and ‘mod()’ may be used for exact division and term-wise remaindering, resp.
It is faster to use the arithmetic assignment operators (e.g., ‘f += g;’) instead of the binary operators (‘f = f+g;’ ).
lhs, rhs: CurrentPP
There are weaker preconditions for some cases (e.g., arithmetic operations with elements from Q or Z work in any domain), but type ‘CurrentPP’ is the only one guaranteed to work for all cases.
All binary operators have their corresponding ‘CanonicalForm’ assignment operators (e.g., ‘operator +()’ corresponds to ‘CanonicalForm::operator +=()’, ‘div()’ corresponds to `CanonicalFormdiv()).
And that is how they are implemented, too: Each of the binary operators first creates a copy of ‘lhs’, adds ‘rhs’ to this copy using the assignment operator, and returns the result.
Definition at line 496 of file cf_inline.cc.
CF_NO_INLINE CanonicalForm operator- | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
Definition at line 505 of file cf_inline.cc.
CF_NO_INLINE CanonicalForm operator/ | ( | const CanonicalForm & | lhs, |
const CanonicalForm & | rhs | ||
) |
Definition at line 529 of file cf_inline.cc.
CanonicalForm power | ( | const CanonicalForm & | f, |
int | n | ||
) |
CanonicalForm power | ( | const Variable & | v, |
int | n | ||
) |
CanonicalForm pp | ( | const CanonicalForm & | f | ) |
CanonicalForm pp ( const CanonicalForm & f )
pp() - return primitive part of f.
Returns zero if f equals zero, otherwise f / content(f).
CanonicalForm reduce | ( | const CanonicalForm & | f, |
const CanonicalForm & | M | ||
) |
polynomials in M.mvar() are considered coefficients M univariate monic polynomial the coefficients of f are reduced modulo M
Definition at line 646 of file cf_ops.cc.
CanonicalForm replacevar | ( | const CanonicalForm & | f, |
const Variable & | x1, | ||
const Variable & | x2 | ||
) |
CanonicalForm replacevar ( const CanonicalForm & f, const Variable & x1, const Variable & x2 )
replacevar() - replace all occurences of x1 in f by x2.
In contrast to swapvar(), x1 may be an algebraic variable, but x2 must be a polynomial variable.
Definition at line 271 of file cf_ops.cc.
void setCharacteristic | ( | int | c | ) |
Definition at line 23 of file cf_char.cc.
void setCharacteristic | ( | int | c, |
int | n | ||
) |
void setCharacteristic | ( | int | c, |
int | n, | ||
char | name | ||
) |
Definition at line 42 of file cf_char.cc.
|
inline |
Definition at line 336 of file canonicalform.h.
int size | ( | const CanonicalForm & | f | ) |
int size ( const CanonicalForm & f )
size() - return number of monomials in f which are in an coefficient domain.
Returns one if f is in an coefficient domain.
Definition at line 628 of file cf_ops.cc.
int size | ( | const CanonicalForm & | f, |
const Variable & | v | ||
) |
int size ( const CanonicalForm & f, const Variable & v )
size() - count number of monomials of f with level higher or equal than level of v.
Returns one if f is in an base domain.
Definition at line 600 of file cf_ops.cc.
|
inline |
Definition at line 342 of file canonicalform.h.
CanonicalForm swapvar | ( | const CanonicalForm & | f, |
const Variable & | x1, | ||
const Variable & | x2 | ||
) |
swapvar() - swap variables x1 and x2 in f.
Returns the image of f under the map which maps x1 to x2 and x2 to x1. This is done quite efficiently because it is used really often. x1 and x2 should be polynomial variables.
Definition at line 168 of file cf_ops.cc.
|
inline |
Definition at line 318 of file canonicalform.h.
|
inline |
Definition at line 321 of file canonicalform.h.
|
inline |
Definition at line 315 of file canonicalform.h.
int totaldegree | ( | const CanonicalForm & | f | ) |
int totaldegree ( const CanonicalForm & f )
totaldegree() - return the total degree of f.
If f is zero, return -1. If f is in a coefficient domain, return 0. Otherwise return the total degree of f in all polynomial variables.
Definition at line 523 of file cf_ops.cc.
int totaldegree ( const CanonicalForm & f, const Variable & v1, const Variable & v2 )
totaldegree() - return the total degree of f as a polynomial in the polynomial variables between v1 and v2 (inclusively).
If f is zero, return -1. If f is in a coefficient domain, return 0. Also, return 0 if v1 > v2. Otherwise, take f to be a polynomial in the polynomial variables between v1 and v2 and return its total degree.
Definition at line 554 of file cf_ops.cc.
CanonicalForm vcontent | ( | const CanonicalForm & | f, |
const Variable & | x | ||
) |
CanonicalForm vcontent ( const CanonicalForm & f, const Variable & x )
vcontent() - return content of f with repect to variables >= x.
The content is recursively calculated over all coefficients in f having level less than x. x should be a polynomial variable.
Definition at line 225 of file cf_gcd.cc.