FORM 4.3
Macros | Functions
dollar.c File Reference
#include "form3.h"

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 2948 of file dollar.c.

Function Documentation

◆ CatchDollar()

int CatchDollar ( int par)

Definition at line 54 of file dollar.c.

◆ AssignDollar()

int AssignDollar ( PHEAD WORD * term,
WORD level )

Definition at line 209 of file dollar.c.

◆ WriteDollarToBuffer()

UBYTE * WriteDollarToBuffer ( WORD numdollar,
WORD par )

Definition at line 596 of file dollar.c.

◆ WriteDollarFactorToBuffer()

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

Definition at line 687 of file dollar.c.

◆ AddToDollarBuffer()

void AddToDollarBuffer ( UBYTE * s)

Definition at line 762 of file dollar.c.

◆ TermAssign()

void TermAssign ( WORD * term)

Definition at line 803 of file dollar.c.

◆ PutTermInDollar()

int PutTermInDollar ( WORD * term,
WORD numdollar )

Definition at line 863 of file dollar.c.

◆ WildDollars()

void WildDollars ( PHEAD WORD * term)

Definition at line 893 of file dollar.c.

◆ DolToTensor()

WORD DolToTensor ( PHEAD WORD numdollar)

Definition at line 1086 of file dollar.c.

◆ DolToFunction()

WORD DolToFunction ( PHEAD WORD numdollar)

Definition at line 1147 of file dollar.c.

◆ DolToVector()

WORD DolToVector ( PHEAD WORD numdollar)

Definition at line 1204 of file dollar.c.

◆ DolToNumber()

WORD DolToNumber ( PHEAD WORD numdollar)

Definition at line 1268 of file dollar.c.

◆ DolToSymbol()

WORD DolToSymbol ( PHEAD WORD numdollar)

Definition at line 1327 of file dollar.c.

◆ DolToIndex()

WORD DolToIndex ( PHEAD WORD numdollar)

Definition at line 1381 of file dollar.c.

◆ DolToTerms()

DOLLARS DolToTerms ( PHEAD WORD numdollar)

Definition at line 1462 of file dollar.c.

◆ DolToLong()

LONG DolToLong ( PHEAD WORD numdollar)

Definition at line 1610 of file dollar.c.

◆ ExecInside()

int ExecInside ( UBYTE * s)

Definition at line 1685 of file dollar.c.

◆ InsideDollar()

int InsideDollar ( PHEAD WORD * ll,
WORD level )

Definition at line 1750 of file dollar.c.

◆ ExchangeDollars()

void ExchangeDollars ( int num1,
int num2 )

Definition at line 1844 of file dollar.c.

◆ TermsInDollar()

LONG TermsInDollar ( WORD num)

Definition at line 1862 of file dollar.c.

◆ SizeOfDollar()

LONG SizeOfDollar ( WORD num)

Definition at line 1911 of file dollar.c.

◆ PreIfDollarEval()

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

Definition at line 1973 of file dollar.c.

◆ TranslateExpression()

WORD * TranslateExpression ( UBYTE * s)

Definition at line 2155 of file dollar.c.

◆ IsSetMember()

int IsSetMember ( WORD * buffer,
WORD numset )

Definition at line 2212 of file dollar.c.

◆ IsMultipleOf()

int IsMultipleOf ( WORD * buf1,
WORD * buf2 )

Definition at line 2393 of file dollar.c.

◆ TwoExprCompare()

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

Definition at line 2468 of file dollar.c.

◆ DollarRaiseLow()

int DollarRaiseLow ( UBYTE * name,
LONG value )

Definition at line 2547 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 preceeding 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 2646 of file dollar.c.

References EvalDoLoopArg().

Referenced by EvalDoLoopArg().

◆ TestDoLoop()

WORD TestDoLoop ( PHEAD WORD * lhsbuf,
WORD level )

Definition at line 2757 of file dollar.c.

◆ TestEndDoLoop()

WORD TestEndDoLoop ( PHEAD WORD * lhsbuf,
WORD level )

Definition at line 2835 of file dollar.c.

◆ DollarFactorize()

int DollarFactorize ( PHEAD WORD numdollar)

Definition at line 2950 of file dollar.c.

◆ CleanDollarFactors()

void CleanDollarFactors ( DOLLARS d)

Definition at line 3549 of file dollar.c.

◆ TakeDollarContent()

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

Definition at line 3570 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 3622 of file dollar.c.

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

◆ 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 3796 of file dollar.c.

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

◆ GetDolNum()

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

Definition at line 3841 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 3954 of file dollar.c.