\hypertarget{polywrap_8cc}{}\doxysection{polywrap.\+cc File Reference}
\label{polywrap_8cc}\index{polywrap.cc@{polywrap.cc}}
{\ttfamily \#include \char`\"{}poly.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}polygcd.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}polyfact.\+h\char`\"{}}\newline
{\ttfamily \#include $<$iostream$>$}\newline
{\ttfamily \#include $<$vector$>$}\newline
{\ttfamily \#include $<$map$>$}\newline
{\ttfamily \#include $<$climits$>$}\newline
{\ttfamily \#include $<$cassert$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
W\+O\+RD \mbox{\hyperlink{polywrap_8cc_a75c23223ae9742ae826abe52e272321a}{poly\+\_\+determine\+\_\+modulus}} (P\+H\+E\+AD bool multi\+\_\+error, bool is\+\_\+fun\+\_\+arg, string message)
\item 
W\+O\+RD $\ast$ \mbox{\hyperlink{polywrap_8cc_ab9217433c034ab241802a86b353cf459}{poly\+\_\+gcd}} (P\+H\+E\+AD W\+O\+RD $\ast$a, W\+O\+RD $\ast$b, W\+O\+RD fit)
\item 
\mbox{\Hypertarget{polywrap_8cc_a701dfe281458879fb4d7e151cc2263f6}\label{polywrap_8cc_a701dfe281458879fb4d7e151cc2263f6}} 
W\+O\+RD $\ast$ {\bfseries poly\+\_\+divmod} (P\+H\+E\+AD W\+O\+RD $\ast$a, W\+O\+RD $\ast$b, int divmod, W\+O\+RD fit)
\item 
\mbox{\Hypertarget{polywrap_8cc_a92fdfbc28f8442d2066ba21bb95b4b8c}\label{polywrap_8cc_a92fdfbc28f8442d2066ba21bb95b4b8c}} 
W\+O\+RD $\ast$ {\bfseries poly\+\_\+div} (P\+H\+E\+AD W\+O\+RD $\ast$a, W\+O\+RD $\ast$b, W\+O\+RD fit)
\item 
\mbox{\Hypertarget{polywrap_8cc_a5da106f1cefd9366b2c516cee8d2738e}\label{polywrap_8cc_a5da106f1cefd9366b2c516cee8d2738e}} 
W\+O\+RD $\ast$ {\bfseries poly\+\_\+rem} (P\+H\+E\+AD W\+O\+RD $\ast$a, W\+O\+RD $\ast$b, W\+O\+RD fit)
\item 
void \mbox{\hyperlink{polywrap_8cc_ab18b8c32490b7922b8efcbfd7bbd4514}{poly\+\_\+ratfun\+\_\+read}} (W\+O\+RD $\ast$a, \mbox{\hyperlink{classpoly}{poly}} \&num, \mbox{\hyperlink{classpoly}{poly}} \&den)
\item 
void \mbox{\hyperlink{polywrap_8cc_ac2ffe2bbb33b5788b45063935716fcf9}{poly\+\_\+sort}} (P\+H\+E\+AD W\+O\+RD $\ast$a)
\item 
W\+O\+RD $\ast$ \mbox{\hyperlink{polywrap_8cc_ac564c30dc24c2978c8c2ef7f71517fae}{poly\+\_\+ratfun\+\_\+add}} (P\+H\+E\+AD W\+O\+RD $\ast$t1, W\+O\+RD $\ast$t2)
\item 
int \mbox{\hyperlink{polywrap_8cc_acf81520132fe759ee15e4566f88bbb21}{poly\+\_\+ratfun\+\_\+normalize}} (P\+H\+E\+AD W\+O\+RD $\ast$term)
\item 
\mbox{\Hypertarget{polywrap_8cc_a67a53b0719c3b541a33f42f463fa357c}\label{polywrap_8cc_a67a53b0719c3b541a33f42f463fa357c}} 
void {\bfseries poly\+\_\+fix\+\_\+minus\+\_\+signs} (\mbox{\hyperlink{classfactorized__poly}{factorized\+\_\+poly}} \&a)
\item 
W\+O\+RD $\ast$ \mbox{\hyperlink{polywrap_8cc_ae23f4bec264da2c88211f95d087a70d8}{poly\+\_\+factorize}} (P\+H\+E\+AD W\+O\+RD $\ast$argin, W\+O\+RD $\ast$argout, bool with\+\_\+arghead, bool is\+\_\+fun\+\_\+arg)
\item 
int \mbox{\hyperlink{polywrap_8cc_af5fff83bb5dd7cee9750beb422793a6a}{poly\+\_\+factorize\+\_\+argument}} (P\+H\+E\+AD W\+O\+RD $\ast$argin, W\+O\+RD $\ast$argout)
\item 
W\+O\+RD $\ast$ \mbox{\hyperlink{polywrap_8cc_a0b01fa2df53bef9cacab34835fae99bc}{poly\+\_\+factorize\+\_\+dollar}} (P\+H\+E\+AD W\+O\+RD $\ast$argin)
\item 
int \mbox{\hyperlink{polywrap_8cc_a476b7a43f6a86f034d8c2df28d282b71}{poly\+\_\+factorize\+\_\+expression}} (\mbox{\hyperlink{structExPrEsSiOn}{E\+X\+P\+R\+E\+S\+S\+I\+O\+NS}} expr)
\item 
\mbox{\Hypertarget{polywrap_8cc_ae8cbb4a670f635fc8fac11109d859d34}\label{polywrap_8cc_ae8cbb4a670f635fc8fac11109d859d34}} 
int {\bfseries poly\+\_\+unfactorize\+\_\+expression} (\mbox{\hyperlink{structExPrEsSiOn}{E\+X\+P\+R\+E\+S\+S\+I\+O\+NS}} expr)
\item 
\mbox{\Hypertarget{polywrap_8cc_a9070533a5a7b1d08cd30657e5edbb05b}\label{polywrap_8cc_a9070533a5a7b1d08cd30657e5edbb05b}} 
W\+O\+RD $\ast$ {\bfseries poly\+\_\+inverse} (P\+H\+E\+AD W\+O\+RD $\ast$arga, W\+O\+RD $\ast$argb)
\item 
\mbox{\Hypertarget{polywrap_8cc_a8bae5010147ef0e3df7032a4d5bdaccd}\label{polywrap_8cc_a8bae5010147ef0e3df7032a4d5bdaccd}} 
W\+O\+RD $\ast$ {\bfseries poly\+\_\+mul} (P\+H\+E\+AD W\+O\+RD $\ast$a, W\+O\+RD $\ast$b)
\item 
\mbox{\Hypertarget{polywrap_8cc_a7a774601d6523a171fa3aafc2b2540a4}\label{polywrap_8cc_a7a774601d6523a171fa3aafc2b2540a4}} 
void {\bfseries poly\+\_\+free\+\_\+poly\+\_\+vars} (P\+H\+E\+AD const char $\ast$text)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{polywrap_8cc_a943a0a4dd84f47e2b4a5291711eb8baf}\label{polywrap_8cc_a943a0a4dd84f47e2b4a5291711eb8baf}} 
const int {\bfseries P\+O\+L\+Y\+W\+R\+A\+P\+\_\+\+D\+E\+N\+O\+M\+P\+O\+W\+E\+R\+\_\+\+I\+N\+C\+R\+E\+A\+S\+E\+\_\+\+F\+A\+C\+T\+OR} = 2
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Contains methods to call the polynomial methods (written in C++) from the rest of Form (written in C). These include polynomial gcd computation, factorization and polyratfuns. 

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{polywrap_8cc_a75c23223ae9742ae826abe52e272321a}\label{polywrap_8cc_a75c23223ae9742ae826abe52e272321a}} 
\index{polywrap.cc@{polywrap.cc}!poly\_determine\_modulus@{poly\_determine\_modulus}}
\index{poly\_determine\_modulus@{poly\_determine\_modulus}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_determine\_modulus()}{poly\_determine\_modulus()}}
{\footnotesize\ttfamily W\+O\+RD poly\+\_\+determine\+\_\+modulus (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD bool}]{multi\+\_\+error,  }\item[{bool}]{is\+\_\+fun\+\_\+arg,  }\item[{string}]{message }\end{DoxyParamCaption})}

Modulus for polynomial algebra\hypertarget{polywrap_8cc_autotoc_md96}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md96}
This method determines whether polynomial algebra is done with a modulus or not. This depends on A\+C.\+ncmod. If only\+\_\+funargs is set it also depends on (A\+C.\+modmode \& A\+L\+S\+O\+F\+U\+N\+A\+R\+GS).

The program terminates if the feature is not implemented. Polynomial algebra modulo M $>$ W\+O\+R\+D\+S\+I\+ZE in not implemented. If multi\+\_\+error is set, multivariate algebra mod M is not implemented.\hypertarget{polywrap_8cc_autotoc_md97}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md97}

\begin{DoxyItemize}
\item If A\+C.\+ncmod$>$0 and only\+\_\+funargs=true and A\+C.\+modmode\&A\+L\+S\+O\+F\+U\+N\+A\+R\+GS=false, A\+N.\+ncmod is set to zero, for otherwise Rais\+Pow calculates mod M. 
\end{DoxyItemize}

Definition at line 79 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_ab9217433c034ab241802a86b353cf459}\label{polywrap_8cc_ab9217433c034ab241802a86b353cf459}} 
\index{polywrap.cc@{polywrap.cc}!poly\_gcd@{poly\_gcd}}
\index{poly\_gcd@{poly\_gcd}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_gcd()}{poly\_gcd()}}
{\footnotesize\ttfamily W\+O\+RD$\ast$ poly\+\_\+gcd (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD $\ast$}]{a,  }\item[{W\+O\+RD $\ast$}]{b,  }\item[{W\+O\+RD}]{fit }\end{DoxyParamCaption})}

Polynomial gcd\hypertarget{polywrap_8cc_autotoc_md98}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md98}
This method calculates the greatest common divisor of two polynomials, given by two zero-\/terminated Form-\/style term lists.\hypertarget{polywrap_8cc_autotoc_md99}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md99}

\begin{DoxyItemize}
\item The result is written at newly allocated memory
\item Called from \mbox{\hyperlink{ratio_8c}{ratio.\+c}}
\item Calls polygcd\+::gcd 
\end{DoxyItemize}

Definition at line 124 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_ab18b8c32490b7922b8efcbfd7bbd4514}\label{polywrap_8cc_ab18b8c32490b7922b8efcbfd7bbd4514}} 
\index{polywrap.cc@{polywrap.cc}!poly\_ratfun\_read@{poly\_ratfun\_read}}
\index{poly\_ratfun\_read@{poly\_ratfun\_read}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_ratfun\_read()}{poly\_ratfun\_read()}}
{\footnotesize\ttfamily void poly\+\_\+ratfun\+\_\+read (\begin{DoxyParamCaption}\item[{W\+O\+RD $\ast$}]{a,  }\item[{\mbox{\hyperlink{classpoly}{poly}} \&}]{num,  }\item[{\mbox{\hyperlink{classpoly}{poly}} \&}]{den }\end{DoxyParamCaption})}

Read a Poly\+Rat\+Fun\hypertarget{polywrap_8cc_autotoc_md100}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md100}
This method reads a polyratfun starting at the pointer a. The resulting numerator and denominator are written in num and den. If M\+U\+S\+T\+C\+L\+E\+A\+N\+P\+RF, the result is normalized.\hypertarget{polywrap_8cc_autotoc_md101}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md101}

\begin{DoxyItemize}
\item Calls polygcd\+::gcd 
\end{DoxyItemize}

Definition at line 471 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_ac2ffe2bbb33b5788b45063935716fcf9}\label{polywrap_8cc_ac2ffe2bbb33b5788b45063935716fcf9}} 
\index{polywrap.cc@{polywrap.cc}!poly\_sort@{poly\_sort}}
\index{poly\_sort@{poly\_sort}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_sort()}{poly\_sort()}}
{\footnotesize\ttfamily void poly\+\_\+sort (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD $\ast$}]{a }\end{DoxyParamCaption})}

Sort the polynomial terms\hypertarget{polywrap_8cc_autotoc_md102}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md102}
Sorts the terms of a polynomial in Form \mbox{\hyperlink{classpoly}{poly(rat)}}fun order, i.\+e. lexicographical order with highest degree first.\hypertarget{polywrap_8cc_autotoc_md103}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md103}

\begin{DoxyItemize}
\item Uses Form sort routines with custom compare 
\end{DoxyItemize}

Definition at line 557 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_ac564c30dc24c2978c8c2ef7f71517fae}\label{polywrap_8cc_ac564c30dc24c2978c8c2ef7f71517fae}} 
\index{polywrap.cc@{polywrap.cc}!poly\_ratfun\_add@{poly\_ratfun\_add}}
\index{poly\_ratfun\_add@{poly\_ratfun\_add}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_ratfun\_add()}{poly\_ratfun\_add()}}
{\footnotesize\ttfamily W\+O\+RD$\ast$ poly\+\_\+ratfun\+\_\+add (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD $\ast$}]{t1,  }\item[{W\+O\+RD $\ast$}]{t2 }\end{DoxyParamCaption})}

Addition of Poly\+Rat\+Funs\hypertarget{polywrap_8cc_autotoc_md104}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md104}
This method gets two pointers to polyratfuns with up to two arguments each and calculates the sum.\hypertarget{polywrap_8cc_autotoc_md105}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md105}

\begin{DoxyItemize}
\item The result is written at the workpointer
\item Called from \mbox{\hyperlink{sort_8c}{sort.\+c}} and \mbox{\hyperlink{threads_8c}{threads.\+c}}
\item Calls poly\+::operators and polygcd\+::gcd 
\end{DoxyItemize}

Definition at line 600 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_acf81520132fe759ee15e4566f88bbb21}\label{polywrap_8cc_acf81520132fe759ee15e4566f88bbb21}} 
\index{polywrap.cc@{polywrap.cc}!poly\_ratfun\_normalize@{poly\_ratfun\_normalize}}
\index{poly\_ratfun\_normalize@{poly\_ratfun\_normalize}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_ratfun\_normalize()}{poly\_ratfun\_normalize()}}
{\footnotesize\ttfamily int poly\+\_\+ratfun\+\_\+normalize (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD $\ast$}]{term }\end{DoxyParamCaption})}

Multiplication/normalization of Poly\+Rat\+Funs\hypertarget{polywrap_8cc_autotoc_md106}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md106}
This method seaches a term for multiple polyratfuns and multiplies their contents. The result is properly normalized. Normalization also works for terms with a single polyratfun.\hypertarget{polywrap_8cc_autotoc_md107}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md107}

\begin{DoxyItemize}
\item The result overwrites the original term
\item Called from \mbox{\hyperlink{proces_8c}{proces.\+c}}
\item Calls poly\+::operators and polygcd\+::gcd 
\end{DoxyItemize}

Definition at line 719 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_ae23f4bec264da2c88211f95d087a70d8}\label{polywrap_8cc_ae23f4bec264da2c88211f95d087a70d8}} 
\index{polywrap.cc@{polywrap.cc}!poly\_factorize@{poly\_factorize}}
\index{poly\_factorize@{poly\_factorize}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_factorize()}{poly\_factorize()}}
{\footnotesize\ttfamily W\+O\+RD$\ast$ poly\+\_\+factorize (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD $\ast$}]{argin,  }\item[{W\+O\+RD $\ast$}]{argout,  }\item[{bool}]{with\+\_\+arghead,  }\item[{bool}]{is\+\_\+fun\+\_\+arg }\end{DoxyParamCaption})}

Factorization of function arguments / dollars\hypertarget{polywrap_8cc_autotoc_md108}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md108}
This method factorizes a Form style argument or zero-\/terminated term list.\hypertarget{polywrap_8cc_autotoc_md109}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md109}

\begin{DoxyItemize}
\item Called from poly\+\_\+factorize\+\_\+\{argument,dollar\}
\item Calls polyfact\+::factorize 
\end{DoxyItemize}

Definition at line 922 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_af5fff83bb5dd7cee9750beb422793a6a}\label{polywrap_8cc_af5fff83bb5dd7cee9750beb422793a6a}} 
\index{polywrap.cc@{polywrap.cc}!poly\_factorize\_argument@{poly\_factorize\_argument}}
\index{poly\_factorize\_argument@{poly\_factorize\_argument}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_factorize\_argument()}{poly\_factorize\_argument()}}
{\footnotesize\ttfamily int poly\+\_\+factorize\+\_\+argument (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD $\ast$}]{argin,  }\item[{W\+O\+RD $\ast$}]{argout }\end{DoxyParamCaption})}

Factorization of function arguments\hypertarget{polywrap_8cc_autotoc_md110}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md110}
This method factorizes the Form-\/style argument argin.\hypertarget{polywrap_8cc_autotoc_md111}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md111}

\begin{DoxyItemize}
\item The result is written at argout
\item Called from \mbox{\hyperlink{argument_8c}{argument.\+c}}
\item Calls poly\+\_\+factorize 
\end{DoxyItemize}

Definition at line 1047 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_a0b01fa2df53bef9cacab34835fae99bc}\label{polywrap_8cc_a0b01fa2df53bef9cacab34835fae99bc}} 
\index{polywrap.cc@{polywrap.cc}!poly\_factorize\_dollar@{poly\_factorize\_dollar}}
\index{poly\_factorize\_dollar@{poly\_factorize\_dollar}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_factorize\_dollar()}{poly\_factorize\_dollar()}}
{\footnotesize\ttfamily W\+O\+RD$\ast$ poly\+\_\+factorize\+\_\+dollar (\begin{DoxyParamCaption}\item[{P\+H\+E\+AD W\+O\+RD $\ast$}]{argin }\end{DoxyParamCaption})}

Factorization of dollar variables\hypertarget{polywrap_8cc_autotoc_md112}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md112}
This method factorizes a dollar variable.\hypertarget{polywrap_8cc_autotoc_md113}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md113}

\begin{DoxyItemize}
\item The result is written at newly allocated memory.
\item Called from \mbox{\hyperlink{dollar_8c}{dollar.\+c}}
\item Calls poly\+\_\+factorize 
\end{DoxyItemize}

Definition at line 1074 of file polywrap.\+cc.

\mbox{\Hypertarget{polywrap_8cc_a476b7a43f6a86f034d8c2df28d282b71}\label{polywrap_8cc_a476b7a43f6a86f034d8c2df28d282b71}} 
\index{polywrap.cc@{polywrap.cc}!poly\_factorize\_expression@{poly\_factorize\_expression}}
\index{poly\_factorize\_expression@{poly\_factorize\_expression}!polywrap.cc@{polywrap.cc}}
\doxysubsubsection{\texorpdfstring{poly\_factorize\_expression()}{poly\_factorize\_expression()}}
{\footnotesize\ttfamily int poly\+\_\+factorize\+\_\+expression (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structExPrEsSiOn}{E\+X\+P\+R\+E\+S\+S\+I\+O\+NS}}}]{expr }\end{DoxyParamCaption})}

Factorization of expressions\hypertarget{polywrap_8cc_autotoc_md114}{}\doxysubsection{Description}\label{polywrap_8cc_autotoc_md114}
This method factorizes an expression.\hypertarget{polywrap_8cc_autotoc_md115}{}\doxysubsection{Notes}\label{polywrap_8cc_autotoc_md115}

\begin{DoxyItemize}
\item The result overwrites the input expression
\item Called from \mbox{\hyperlink{proces_8c}{proces.\+c}}
\item Calls polyfact\+::factorize 
\end{DoxyItemize}

Definition at line 1100 of file polywrap.\+cc.

