monomial.c File Reference

Fast implementation of monomials for multivariate polynomial rings. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "monomial.h"

Defines

#define _MON_EXP_LENGTH_(e)   ((e) < 10 ? 1 : (e) < 100 ? 2 : (e) < 1000 ? 3 : (e) < 10000 ? 4 : (e) < 100000 ? 5 : (e) < 1000000 ? 6 : (e) < 10000000 ? 7 : (e) < 100000000 ? 8 : (e) < 1000000000 ? 9 : 10)

Functions

uint32_t _binom_ (uint32_t n, uint32_t k)
uint32_t mon_degree (monomial_t op)
int32_t mon_divides (monomial_t x, monomial_t y)
char * mon_to_string (monomial_t x, const uint8_t n)
char * mon_to_string_pretty (monomial_t x, const uint8_t n, const char *vars)
monomial_t mon_from_string (char *str)
monomial_tmon_generate_by_degree (uint32_t *len, const uint8_t n, const uint32_t d)


Detailed Description

Fast implementation of monomials for multivariate polynomial rings.

Author:
Sebastian Pancratz
Date:
Oct--Nov 2009
All methods support aliasing of their inputs and outputs unless explicitly stated otherwise.

Todo:
Implement further monomial orderings.

Define Documentation

#define _MON_EXP_LENGTH_ (  )     ((e) < 10 ? 1 : (e) < 100 ? 2 : (e) < 1000 ? 3 : (e) < 10000 ? 4 : (e) < 100000 ? 5 : (e) < 1000000 ? 6 : (e) < 10000000 ? 7 : (e) < 100000000 ? 8 : (e) < 1000000000 ? 9 : 10)

Number of digits (in base 10) for the exponent e.

Warning:
This macro possibly evaluates its arguments multiple times.


Function Documentation

uint32_t _binom_ ( uint32_t  n,
uint32_t  k 
)

Returns the binomial coefficient $\binom{n}{k}$.

Special cases are handled as follows. If $n < k$, returns $0$. If $k = 0$ or $k = n$, returns $1$.


Generated on Sat Nov 14 23:24:27 2009 for MONF by  doxygen 1.5.6