Symmetric Polynomials  V3.1
A C++ library for generating symmetric polynomials with relations
HalfIdempotentVariables< T, _deg, N > Struct Template Reference

Variables \(x_1,...,x_n,y_1,...,y_n\) with \(y_i^2=y_i\) and \(|x_i|=1\), \(|y_i|=0\). More...

#include <Half_Idempotent.hpp>

Inheritance diagram for HalfIdempotentVariables< T, _deg, N >:
[legend]
Collaboration diagram for HalfIdempotentVariables< T, _deg, N >:
[legend]

Public Types

typedef _deg deg_t
 Degree typedef. More...
 

Public Member Functions

HalfIdempotentVariables operator+ (const HalfIdempotentVariables &b) const
 Multiplies monomials by adding their exponents. More...
 
HalfIdempotentVariables operator- (const HalfIdempotentVariables &b) const
 Divides monomials by subtracting their exponents. More...
 
deg_t degree () const
 Computes degree of the monomial on the \(x_i,y_i\) with \(|x_i|=1\) and \(|y_i|=0\). More...
 
size_t operator() () const
 Hashes monomial. More...
 

Static Public Member Functions

static std::string name (int i, int num)
 Returns the names of the variables \(x_i,y_i\). More...
 

Detailed Description

template<class T = int64_t, class _deg = int64_t, size_t N = 0>
struct symmp::HalfIdempotentVariables< T, _deg, N >

Variables \(x_1,...,x_n,y_1,...,y_n\) with \(y_i^2=y_i\) and \(|x_i|=1\), \(|y_i|=0\).

Monomial \(x_1^{a_1}\cdots x_n^{a_n}y_1^{a_{n+1}}\cdots y_n^{a_{2n}}\) is stored as vector/array \([a_1,...,a_{2n}]\)

Template Parameters
TThe (integral) value type of the exponent vector.
_degThe (integral) value type used in the degree function.
NThe number of variables in compile-time; set to 0 if unknown (default). Otherwise N= \(2n\).

Member Typedef Documentation

◆ deg_t

typedef _deg deg_t

Degree typedef.

Member Function Documentation

◆ operator+()

HalfIdempotentVariables operator+ ( const HalfIdempotentVariables< T, _deg, N > &  b) const

Multiplies monomials by adding their exponents.

Parameters
bThe exponent \([b_1,...,b_{2n}]\) we add to *this = \([a_1,...,a_{2n}]\)
Returns
Exponent \([a_1+b_1,...,a_n+b_n, \max(a_{n+1},b_{n+1}), ..., \max(a_{2n},b_{2n})]\)

◆ operator-()

HalfIdempotentVariables operator- ( const HalfIdempotentVariables< T, _deg, N > &  b) const

Divides monomials by subtracting their exponents.

Parameters
bThe exponent \([b_1,...,b_{2n}]\) we subtract from *this = \([a_1,...,a_{2n}]\).
Warning
We must have \(b_i\le a_i\) for every \(i\).
Returns
Exponent \([a_1-b_1,...,a_n-b_n, |a_{n+1}-b_{n+1}|, ..., |a_{2n}-b_{2n}|]\)

◆ degree()

deg_t degree ( ) const

Computes degree of the monomial on the \(x_i,y_i\) with \(|x_i|=1\) and \(|y_i|=0\).

Returns
Degree \(\sum_{i=1}^na_i\) for monomial \(x_1^{a_1}\cdots y_n^{a_{2n}}\) (*this= \([a_1,...,a_{2n}]\))

◆ name()

static std::string name ( int  i,
int  num 
)
static

Returns the names of the variables \(x_i,y_i\).

Parameters
iThe variable index
numThe number variables = \(2n\)
Returns
"x_i" if i<n and "y_{i-n}" if i>n

◆ operator()()

size_t operator() ( ) const

Hashes monomial.

Returns
Hash of exponent vector (calls generic_hasher)

The documentation for this struct was generated from the following file: