25 template<
char X,
int D=2,
class T=
int>
37 for(
int i=s-1;
i>=0;
i--)
63 return ((mask)&(
ind>>(D*i)));
70 T tmp1=(
ind>>(D*i+D))<<(D*i+D);
77 for(
int j=0;
j<
i;
j++) tmp2=(tmp2<<D)+mask;
79 ind=tmp1+tmp2+(((T)d)<<(D*
i));
107 bool operator <(const numexp<X,D,T> &A)
const
109 return this->
ind<A.ind;
112 bool operator <(const numexp<X,D,T> &A)
114 return this->
ind<A.ind;
121 template<
char X,
int D,
class T>
131 for(stock=m.
ind;stock>0;stock=stock>>D) d+=(stock&mask);
135 template<
char X,
int D,
class T>
144 return ((A.
ind>>(D*i))&mask);
147 template<
char X,
int D,
class T>
150 T tmp1=(A.
ind>>(D*i+D))<<(D*i+D);
152 for(
int j=0;
j<i*D;
j++) tmp2=(tmp2<<1)+1;
154 A.
ind=tmp1+tmp2+(((T)d)<<(D*
i));
158 template<
char X,
int D,
class T>
164 for(;stock>0;i++,stock=stock>>D);
168 template<
char X,
int D,
class T>
171 template<
char X,
int D,
class T>
177 template<
char X,
int D,
class T>
178 std::ostream & operator<<(std::ostream &os, const numexp<X,D,T> & rep)
183 for(
int j=0;
j<D;
j++) mask=(mask<<1)+1;
187 if((rep.ind>>(D*
i))&mask)
190 if ((tmp=(rep.ind>>(D*i))&mask)>1)
void reserve(int d)
Definition: numexp.hpp:66
numexp< X, D, T > self_t
Definition: numexp.hpp:29
int degree_t
Definition: numexp.hpp:28
void add(numexp< X, D, T > &r, const numexp< X, D, T > &A, const numexp< X, D, T > &B)
Definition: numexp.hpp:172
int Degree(const numexp< X, D, T > &m)
Definition: numexp.hpp:122
int lvar(const numexp< X, D, T > &A)
Definition: numexp.hpp:160
numexp(const self_t &A)
Definition: numexp.hpp:34
self_t & operator/=(const numexp< X, D, T > &A)
Definition: numexp.hpp:97
int SDegree(numexp< X, D, T > &A, int i, int d)
Definition: numexp.hpp:148
Definition: numexp.hpp:26
void erase(numexp< X, D, T > &A)
Definition: numexp.hpp:169
MSKconetypee MSKrealt MSKint32t MSKint32t j
Definition: mosek.h:2421
void setExponent(int i, int d)
Definition: numexp.hpp:68
bool operator==(const numexp< X, D, T > &A) const
Definition: numexp.hpp:102
self_t & operator+=(const self_t &A)
Definition: numexp.hpp:89
int operator!=(const numexp< X, D, T > &m)
Definition: numexp.hpp:46
T exponent_t
Definition: numexp.hpp:27
MSKint32t MSKint32t MSKint32t i
Definition: mosek.h:2278
MSKrescodee r
Definition: mosek.h:2321
T ind
Definition: numexp.hpp:118
numexp()
Definition: numexp.hpp:32
numexp(int s, int *t)
Definition: numexp.hpp:35
exponent_t operator[](int i) const
Definition: numexp.hpp:54
self_t & operator=(const numexp< X, D, T > &A)
Definition: numexp.hpp:84
int GDegree(const numexp< X, D, T > &A, int i)
Definition: numexp.hpp:136
self_t & operator*=(const self_t &A)
Definition: numexp.hpp:93
numexp(int t)
Definition: numexp.hpp:33