FORM v5.0.0-35-g6318119
Macros | Functions
dollar.c File Reference
#include "form3.h"
Include dependency graph for dollar.c:

Go to the source code of this file.

Macros

#define STEP2
 

Functions

int CatchDollar (int par)
 
int AssignDollar (PHEAD WORD *term, WORD level)
 
UBYTE * WriteDollarToBuffer (WORD numdollar, WORD par)
 
UBYTE * WriteDollarFactorToBuffer (WORD numdollar, WORD numfac, WORD par)
 
void AddToDollarBuffer (UBYTE *s)
 
void TermAssign (WORD *term)
 
int PutTermInDollar (WORD *term, WORD numdollar)
 
void WildDollars (PHEAD WORD *term)
 
WORD DolToTensor (PHEAD WORD numdollar)
 
WORD DolToFunction (PHEAD WORD numdollar)
 
WORD DolToVector (PHEAD WORD numdollar)
 
WORD DolToNumber (PHEAD WORD numdollar)
 
WORD DolToSymbol (PHEAD WORD numdollar)
 
WORD DolToIndex (PHEAD WORD numdollar)
 
DOLLARS DolToTerms (PHEAD WORD numdollar)
 
LONG DolToLong (PHEAD WORD numdollar)
 
int ExecInside (UBYTE *s)
 
int InsideDollar (PHEAD WORD *ll, WORD level)
 
void ExchangeDollars (int num1, int num2)
 
LONG TermsInDollar (WORD num)
 
LONG SizeOfDollar (WORD num)
 
UBYTE * PreIfDollarEval (UBYTE *s, int *value)
 
WORD * TranslateExpression (UBYTE *s)
 
int IsSetMember (WORD *buffer, WORD numset)
 
int IsMultipleOf (WORD *buf1, WORD *buf2)
 
int TwoExprCompare (WORD *buf1, WORD *buf2, int oprtr)
 
int DollarRaiseLow (UBYTE *name, LONG value)
 
WORD EvalDoLoopArg (PHEAD WORD *arg, WORD par)
 
WORD TestDoLoop (PHEAD WORD *lhsbuf, WORD level)
 
WORD TestEndDoLoop (PHEAD WORD *lhsbuf, WORD level)
 
int DollarFactorize (PHEAD WORD numdollar)
 
void CleanDollarFactors (DOLLARS d)
 
WORD * TakeDollarContent (PHEAD WORD *dollarbuffer, WORD **factor)
 
WORD * MakeDollarInteger (PHEAD WORD *bufin, WORD **bufout)
 
WORD * MakeDollarMod (PHEAD WORD *buffer, WORD **bufout)
 
int GetDolNum (PHEAD WORD *t, WORD *tstop)
 
void AddPotModdollar (WORD numdollar)
 

Detailed Description

The routines that deal with the dollar variables. The name administration is to be found in the file names.c

Definition in file dollar.c.

Macro Definition Documentation

◆ STEP2

#define STEP2

Factors a dollar expression. Notation: d->nfactors becomes nonzero. if the number of factors is one, we leave d->factors zero. Otherwise factors is an array of pointers to the factors. These are pointers of the type FACDOLLAR. fd->where pointer to contents in term notation fd->size size of the buffer fd->where points to fd->type DOLNUMBER or DOLTERMS fd->value value if type is DOLNUMBER and it fits in a WORD.

Definition at line 2935 of file dollar.c.

Function Documentation

◆ CatchDollar()

int CatchDollar ( int  par)

Definition at line 52 of file dollar.c.

◆ AssignDollar()

int AssignDollar ( PHEAD WORD *  term,
WORD  level 
)

Definition at line 207 of file dollar.c.

◆ WriteDollarToBuffer()

UBYTE * WriteDollarToBuffer ( WORD  numdollar,
WORD  par 
)

Definition at line 581 of file dollar.c.

◆ WriteDollarFactorToBuffer()

UBYTE * WriteDollarFactorToBuffer ( WORD  numdollar,
WORD  numfac,
WORD  par 
)

Definition at line 672 of file dollar.c.

◆ AddToDollarBuffer()

void AddToDollarBuffer ( UBYTE *  s)

Definition at line 747 of file dollar.c.

◆ TermAssign()

void TermAssign ( WORD *  term)

Definition at line 788 of file dollar.c.

◆ PutTermInDollar()

int PutTermInDollar ( WORD *  term,
WORD  numdollar 
)

Definition at line 848 of file dollar.c.

◆ WildDollars()

void WildDollars ( PHEAD WORD *  term)

Definition at line 876 of file dollar.c.

◆ DolToTensor()

WORD DolToTensor ( PHEAD WORD  numdollar)

Definition at line 1067 of file dollar.c.

◆ DolToFunction()

WORD DolToFunction ( PHEAD WORD  numdollar)

Definition at line 1128 of file dollar.c.

◆ DolToVector()

WORD DolToVector ( PHEAD WORD  numdollar)

Definition at line 1185 of file dollar.c.

◆ DolToNumber()

WORD DolToNumber ( PHEAD WORD  numdollar)

Definition at line 1249 of file dollar.c.

◆ DolToSymbol()

WORD DolToSymbol ( PHEAD WORD  numdollar)

Definition at line 1308 of file dollar.c.

◆ DolToIndex()

WORD DolToIndex ( PHEAD WORD  numdollar)

Definition at line 1362 of file dollar.c.

◆ DolToTerms()

DOLLARS DolToTerms ( PHEAD WORD  numdollar)

Definition at line 1443 of file dollar.c.

◆ DolToLong()

LONG DolToLong ( PHEAD WORD  numdollar)

Definition at line 1590 of file dollar.c.

◆ ExecInside()

int ExecInside ( UBYTE *  s)

Definition at line 1665 of file dollar.c.

◆ InsideDollar()

int InsideDollar ( PHEAD WORD *  ll,
WORD  level 
)

Definition at line 1730 of file dollar.c.

◆ ExchangeDollars()

void ExchangeDollars ( int  num1,
int  num2 
)

Definition at line 1831 of file dollar.c.

◆ TermsInDollar()

LONG TermsInDollar ( WORD  num)

Definition at line 1849 of file dollar.c.

◆ SizeOfDollar()

LONG SizeOfDollar ( WORD  num)

Definition at line 1898 of file dollar.c.

◆ PreIfDollarEval()

UBYTE * PreIfDollarEval ( UBYTE *  s,
int *  value 
)

Definition at line 1960 of file dollar.c.

◆ TranslateExpression()

WORD * TranslateExpression ( UBYTE *  s)

Definition at line 2142 of file dollar.c.

◆ IsSetMember()

int IsSetMember ( WORD *  buffer,
WORD  numset 
)

Definition at line 2199 of file dollar.c.

◆ IsMultipleOf()

int IsMultipleOf ( WORD *  buf1,
WORD *  buf2 
)

Definition at line 2380 of file dollar.c.

◆ TwoExprCompare()

int TwoExprCompare ( WORD *  buf1,
WORD *  buf2,
int  oprtr 
)

Definition at line 2455 of file dollar.c.

◆ DollarRaiseLow()

int DollarRaiseLow ( UBYTE *  name,
LONG  value 
)

Definition at line 2534 of file dollar.c.

◆ EvalDoLoopArg()

WORD EvalDoLoopArg ( PHEAD WORD *  arg,
WORD  par 
)

Evaluates one argument of a do loop. Such an argument is constructed from SNUMBERs DOLLAREXPRESSIONs and possibly DOLLAREXPR2s which indicate factors of the preceding dollar. Hence we have SNUMBER,num DOLLAREXPRESSION,numdollar DOLLAREXPRESSION,numdollar,DOLLAREXPR2,numfactor DOLLAREXPRESSION,numdollar,DOLLAREXPR2,numfactor,DOLLAREXPR2,numfactor etc. Because we have a do-loop at every stage we should have a number. The notation in DOLLAREXPR2 is that >= 0 is number of yet another dollar and < 0 is -n-1 with n the array element or zero. The return value is the (short) number. The routine works its way through the list in a recursive manner.

Definition at line 2633 of file dollar.c.

References EvalDoLoopArg().

Referenced by EvalDoLoopArg().

Here is the call graph for this function:

◆ TestDoLoop()

WORD TestDoLoop ( PHEAD WORD *  lhsbuf,
WORD  level 
)

Definition at line 2744 of file dollar.c.

◆ TestEndDoLoop()

WORD TestEndDoLoop ( PHEAD WORD *  lhsbuf,
WORD  level 
)

Definition at line 2822 of file dollar.c.

◆ DollarFactorize()

int DollarFactorize ( PHEAD WORD  numdollar)

Definition at line 2937 of file dollar.c.

◆ CleanDollarFactors()

void CleanDollarFactors ( DOLLARS  d)

Definition at line 3536 of file dollar.c.

◆ TakeDollarContent()

WORD * TakeDollarContent ( PHEAD WORD *  dollarbuffer,
WORD **  factor 
)

Definition at line 3558 of file dollar.c.

◆ MakeDollarInteger()

WORD * MakeDollarInteger ( PHEAD WORD *  bufin,
WORD **  bufout 
)

For normalizing everything to integers we have to determine for all elements of this argument the LCM of the denominators and the GCD of the numerators. The input argument is in bufin. The number that comes out is the return value. The normalized argument is in bufout.

Definition at line 3610 of file dollar.c.

References EndSort(), Generator(), and NewSort().

Here is the call graph for this function:

◆ MakeDollarMod()

WORD * MakeDollarMod ( PHEAD WORD *  buffer,
WORD **  bufout 
)

Similar to MakeDollarInteger but now with modulus arithmetic using only a one WORD 'prime'. We make the coefficient of the first term in the argument equal to one. Already the coefficients are taken modulus AN.cmod and AN.ncmod == 1

Definition at line 3784 of file dollar.c.

References EndSort(), Generator(), GetModInverses(), and NewSort().

Here is the call graph for this function:

◆ GetDolNum()

int GetDolNum ( PHEAD WORD *  t,
WORD *  tstop 
)

Definition at line 3829 of file dollar.c.

◆ AddPotModdollar()

void AddPotModdollar ( WORD  numdollar)

Adds a $-variable specified by numdollar to the list of potentially modified $-variables unless it has already been included in the list.

Parameters
numdollarThe index of the $-variable to be added.

Definition at line 3942 of file dollar.c.