Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

BaseDefinitions.cpp File Reference

#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "BaseDefinitions.h"

Include dependency graph for BaseDefinitions.cpp:

Include dependency graph

Functions

Zahl AsymErfc (Zahl zsq)
void WriteDoubleArray (ofstream &str, long len, double *vals, char *endchar, long dim)
long binom (long i, long k)
long power (long m, long n)
double power (double m, long n)
double vectabs (double a1, double a2, double a3)
bool IsPrimitiveRoot (long proot, long base)
double Phi (long base, long x)
double CoeffToDouble (long base, long *cfs, long cflen)
double CoeffToDoubleModified (long base, long *cfs, long cflen, long modfact)
long LongToCoeff (long nr, long base, long *cfs, long cflen)

Variables

long ERFCMAXREK = 7

Function Documentation

Zahl AsymErfc ( Zahl zsq )
 

Calculates the Erfc by means of its asymptotic expansion.

Parameters:
zsq   The variable z^2 in the expansion.

double CoeffToDouble ( long base,
long * cfs,
long cflen )
 

returns the double-representation of the cofficients in base "base" given in cfs.

E.g. cfs={1,2,1,2,1}, base=3 => returns 1/3 + 2/9 + 1/27 + 2/81 + 1/243

double CoeffToDoubleModified ( long base,
long * cfs,
long cflen,
long modfact )
 

returns the double-representation of the cofficients in base "base" given in cfs.

E.g. cfs={1,2,1,2,1}, base=3 => returns 1/3 + 2/9 + 1/27 + 2/81 + 1/243 This is the modified version, needed by Atanassov's sequence. (Not quite implemented yet ...)

bool IsPrimitiveRoot ( long proot,
long base )
 

Checks if proot is a primitive root modulo base.

long LongToCoeff ( long nr,
long base,
long * cfs,
long cflen )
 

Expands n in base "base".

Parameters:
nr   the number to develop in base
base   Which base to use for the expansion
cfs   long-array where the coefficients should be stored
cflen   length of the buffer cfs
Returns:
Returns the number of coefficients (lowest n s.t. nr<base^n) or cflen, depending in which one is smaller

double Phi ( long base,
long x )
 

The digit inversion function.

This inverts x (written down in base "base") at the comma. E.g. Phi(3, 25): 25=2*9+2*3+1=221_3 => 0.112_3=1/3 + 1/9 + 2/27

void WriteDoubleArray ( ofstream & str,
long len,
double * vals,
char * endchar,
long dim )
 

Writes the "dim"-dimensional array vals in Mathematica-List format to the file str.

Parameters:
endchar   defines a string which should be written out after the list, e.g. ";" or "//MatrixForm"
len  
vals   The dim-dimensional array of double-Values
endchar   String that is appended to the file after the List is written out.
dim  

long binom ( long i,
long k )
 

Returns the binomial coefficient (i k).

double power ( double m,
long n )
 

Returns m^n where n and m are double variable.

The result is of type double, too.

long power ( long m,
long n )
 

Returns m^n, where n and m are long variables.

The result, of course, is also of type long.

double vectabs ( double a1,
double a2,
double a3 )
 

Returns the length of the 3-dimensional vector (a1, a2, a3) (just sqrt(a1*a1 + a2*a2 + a3*a3) ).


Variable Documentation

long ERFCMAXREK = 7
 

Defines how many term in the asymptotic expansion of erfc=1-erf should be used for the calculation.


Generated at Wed Jun 20 19:47:42 2001 for LDSequences by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001