PasMatLib
Class Tree
Index
Previous (uDynObjAlg)
Next

Unit
  uMatTypes

Description
  PasMatLib - Basic Math Types, Interfaces, Constants and Math utilities
ŠNikolai V. Shokhirev, 2001-2007

Author
 

Nikolai V. Shokhirev <nikolai@shokhirev.com> http://www.shokhirev.com/nikolai.html


Version
 

2003.01.01 - created
2005.01.22: added TInterfaceArray and ICompare from Delphi COM Programming By Eric Harmon
2004.01.01: Incorporated some definitions, names and functions from
Earl F. Glynn's ComplexMathlibrary unit (labeled "From EFG Unit" below).
Ref: www.efg2.com/Lab/Mathematics/ComplexMath.htm
NOTE: the type Complex differs from TComplex in EFG Unit
2007.06.06 - Added constructor to TComment; Added Read Only Name
2007.07.15 - Added DelphiCodeToDoc comments


Classes
 
Class Description
Complex complex number Re,Im: TFloat;
EComplexinvalidop From EFG Unit
EComplexLnZero From EFG Unit
EComplexZerodivide From EFG Unit
EComplexZerotoZero From EFG Unit
IComment Interface for Comment: string
ICompare Interface for sorting arrays of ICompare from "Delphi COM Programming" By Eric Harmon
IRestore Interface for the Restore objects
IROName Interface for Read Only Name: string}
TComment Object Comment: string
TROName Object Read Only Name: string

Types
 
Type Description
TArrayType (atGeneric, atNatural, atZeroBased, atCentered)
TBasisFunction Float function of n, x}
TCompareArray Array of ICompare
TComplexfunction From EFG Unit
TFloat currently = double
TFloatFunc1D Float function of x
TFloatFunction1D Float function of const x
TFloatFunction2D Float function of x, y
TFloatFunction3D Float function of x, y, z}
TInt currently = longint
TInterfaceArray Array of IInterface;

Constants
 
Constant Description
cMachEps for double = 2.22044604925031e-16
Cmplx0 cmplx(0.0, 0.0)
Cmplx1 cmplx(1.0, 0.0)
CmplxIm1 cmplx(0.0, 1.0)
ComplexOne cmplx(1.0, 0.0) [From EFG Unit]
ComplexZero cmplx(0.0, 0.0) [From EFG Unit]
CRLF CRLF = #13#10
cSqrtMachEps for double = 1.49011611938476e-8
ExpArg for double = 709.0 ~ 308*ln(10)
HalfLn2PI HalfLn2PI = 0.5*(Ln(TwoPI)); [From EFG Unit]
HighInt HighInt = 2147483647
iNaN Not a nimber for integers
LowInt LowInt = -2147483647
MaxExp for double = 308.0
MaxFloat for double = 1.7e+308
MinFloat for double = 1.7e-308
NegMaxFloat for double = -1.7e+308
RS_IndexError 'Subscript %d out of range [%d, %d]';
RS_RangeError 'Demension %d is illegal';
SafeFactor Safe Factor = 1024.0
SqrtMaxFloat for double = 1.3e+154
SqrtMinFloat for double = 1.3e-154
SqrtSqrtMinFloat for double = 1.1e-77
TwoPI TwoPI = 2.0*PI; [From EFG Unit]

Variables
 
Variable Description
MachEps 1 + MachEps > 1
SqrtMachEps SqrtMachEps = Sqrt(MachEps)

Functions
 
Function Description
amax2 FORTRAN amax2(x1, x2) = max(x1, x2) [Math]
amin2 FORTRAN amin2(x1, x2) = min(x1, x2) [Math]
BoolToStr boolean to string conversion
Cabs result = sqrt(sqr(z.Re)+sqr(x.Im)) = |z|
Cabs0 max(abs(z.re),abs(z.im))
Cabs1 result = abs(z.Re) + abs(z.Im)
Cabs2 result = sqr(z.Re)+ sqr(z.Im) = |z|^2
CAbsSqr result = sqr(z.Re)+ sqr(z.Im) = |z|^2 same as Cabs2 [From EFG Unit]
Cadd result = x + w
Cadd result = z + w
Cadd result = z + x
Cconjugate result = z.Re -i*z.Im same as conjug [From EFG Unit]
Cdiv result = z / x
Cdiv result = x / w
Cdiv result = z / w
cer result = er(z) }
Cexp result = exp(v)
CexpIm result = exp(i*f)
Cinv result = 1/z
CLn complex natural log: result = ln(a) NOTE: principal value only [From EFG Unit]
cmplx result = x + i*y
CmplxToStr Conversion: zero Im is not diaplayed
CmplxToStr0 Conversion: zero Im is diaplayed
Cmul result = z * w
Cmul result = x * w
Cmul result = z * x
Cneg result = -z
Combinations n!/(m!(n-m)!
ComplexToPolar Complex To Polar Conversion: (Re, Im) -> (r, angle)
ComplexToStr Basic Conversion functions for Complex
conjug result = z.Re -i*z.Im
Cset result = x + i*y - same as cmplx [From EFG Unit]
CSqr result = SQR(a) [From EFG Unit]
Csqrt result = sqrt(z), result.Re > 0
Csqrt result = sqrt(z), result.Re > 0
Csub result = z - w
Csub result = z - x
Csub result = x - w
Csum s := s + x
Csum s := s + z
Cunit result = z/r r := Cabs (z)
delta Kroneker delta : if x1 = x2 then result := 1 else result := 0
Diff0 result = max(|z1.re-z2.re|,|z1.im-z2.im|)
exp1 obsolete exp1 = exp}
Fac n!
FixAngle -PI < theta <= PI [From EFG Unit]
Im result = z.Im
IPower m**n
iSign if x > 0 then result := 1 else if x = 0 then result := 0 else result := -1;
ISign2 #No TAG found in source code#
iSwap Swap of integer numbers
lg lg(x) = log10(x) [Math]
MachEpsMinus MachEpsMinus = 1.11022302462516E-16 for double
MachinEps Calculation of the machine epsilon
PolarToComplex Polar To Complex Conversion: (r, angle) -> (Re, Im)
power10 10**x or 10^x = Power(10.0, x) [Math]
pythag finds dsqrt(a**2+b**2) without overflow or destructive underflow;
Re result = z.Re
RndBool random true/false
RndComplex r1 <= re < r2, i1 <= im < i2
RndFloat random number r1 <= r < r2
RndNum random number N1 <= result <= N2
RndNumEx random number N1 <= r <= N2, r <> r1
SameComplex abs(c1.Re-c2.Re) < eps And abs(c1.Im-c2.Im) < eps
Sign0 if x > 0.0 then result := 1.0
Sign1 if X >= 0.0 then result := 1.0 else result := -1.0;
Sign2 FORTRAN signum: |a|*signum(b)
sqroot1 safe sqrt(x + y); it is assumed that (x+y) > 0
sqroot2 safe sqrt(x*x+y*y); functionally the same as pythag
StrToBool string to boolean conversion
StrToCmplx Conversion
Swap Swap of float numbers

PasMatLib
Class Tree
Index
Previous (uDynObjAlg)
Next


ŠNikolai V. Shokhirev, 2001-2007
Created with DelphiCodeToDoc. To obtain the latest revision, please visit http://dephicodetodoc.sourceforge.net/