EVTypes

   
   
Function returns arguments  
CharSign char VType p Returns corresponding character for sign ('-' for a negative number and '+' for a positive one)
Factorial VType int a) Calculates factorial of a number
NewtonSolve VType VType (*f)(VType)
VType (*df)(VType)
VType point
Solves an equation by the Newton method,  f - function, df - first derivative, point - starting point
QRT VType VType a Returns square of a number
Round long VType Rounds a floating point number. Round (1.5) =2, Round(1.4) = 1;
Sign int VType Determines the sign of a number (returns -1 for a negative number, 0 for nil and +1 for a positive number)

 

TVector: implements TSreamableObj

Constructor     TVector();
TVector(const TVector &);
TVector(int ddim);
Function returns arguments  
CAngle VType TVector &V Calculates the cosine of the angle between the two vectors
Count int   Returns the dimension of the vector
DistanceTo VType TVector &V returns the distance between the two vectors
Length VType   returns the length of the vector
Null void   Assigns all members to zero
Normalise void   Normalises the vector, e.g. Element[i] = Element[i]/Length
operator = void const TVector &a copies the content of the other vector
operator + TVector VType a Returns a vector which is the sum of current vector and a (each element is added a)
operator - TVector VType a Returns a vector which is the difference of current vector and a (each element is subtracted  a)
operator * TVector VType a Returns a vector which is the product of current vector and a (each element is multiplied a)
operator / TVector VType a Returns a vector which is the product of division of current vector and a (each element is divided  by a)
operator += void VType a Adds a number to all member of the current vector
operator -= void VType a Subtracts a number from all member of the current vector
operator *= void VType a Multiplies the current vector by a a number
operator /= void VType a Divides the current vector by a a number
operator + TVector const TVector &a returns a vector(  (this[0]+a[0]), this[1]+a[1], ... )
operator - TVector const TVector &a returns a vector(  (this[0]-a[0]), this[1]-a[1], ... )
operator * TVector const TVector &a returns a vector(  (this[0]*a[0]), this[1]*a[1], ... )
operator / TVector const TVector &a returns a vector(  (this[0]/a[0]), this[1]/a[1], ... )
operator += void const TVector &a Adds a vector to the current vector
operator -= void const TVector &a Subtracts a vector from the current vector
operator *= void const TVector &a Multiplies the current vector by a a vector
operator /= void const TVector &a Divides the current vector by a a vector
operator [] VType& (int offset Returns a reference to a variable at the specified index
operator *= void TMatrix &a Multiplies current vector on a matrix
operator == bool const TVector &a Checks if the vectors are equal
operator != bool const TVector &a Checks if the vectors are not equal
operator >> void TIniStream *S Saves a vector to a stream
operator << void TIniStream *S) Loads vector form a stream
Print void   Prints the content of a vector to console (Console Application only)
Resize void int newsize) Changes the size f the vector
static ArrayMax VType VType * a
int &n
int sz
Returns the maximum value found in an array a of size sz and puts the index of the found value to n
static PolynomValue VType TVector& Coeff
VType a
Calculates the value of a polynomial a + b^2 +c^3 + ..., where  Coeff = {a, b, c, ...}


 

TMatrix: implements TSreamableObj

 
Constructors     TMatrix();
TMatrix( int VectorsNumber, int ElementsNumber);
TMatrix( const TMatrix &M );
Function returns arguments  
AddCols void int s
int to
Adds column s to column to
AddRows void int s
int to
Adds row s to row to. Alternatively, you can do it as M[to] += M[s]
Data TVector& int index Returns a TVector object at the index position
DivCol void  int Which
VType OnWhat
Divides each element of the Which column by a number
DivRow void int Which
VType OnWhat
Divides each element of the Which row by a number. Alternatively, call M[Which] /=  OnWhat
E void   Empties all elements of a matrix and assigns 1 to the elements of the main diagonal (E-matrix)
Elements int   Returns the number of elements in each vector. Also see Vectors.
IsE bool   Checks if the matrix is a E-matrix
MulCol void int Which
VType OnWhat
Multiplies each element of the Which column by a OnWhat number
MulRow void int Which
VType OnWhat
Multiplies each element of the Which row by a OnWhat number. Alternatively, call M[Which] *= OnWhat
LoadFromFile bool const TEString &FN Loads a matrix from a file. Each element of the file should be separated by a space or tab character, whereas each row should be on a new line.
operator * TMatrix const TMatrix& Multiplies a matrix by another one and returns the resulting matrix
operator + TMatrix const TMatrix& Adds each element of one matrix to another one and returns the resulting matrix
operator - TMatrix const TMatrix& Subtracts each element of one matrix to another one and returns the resulting matrix
operator *= void const TMatrix& Multiplies a matrix by another one
operator -= void const TMatrix& Subtracts each element of a matrix from the current
operator += void const TMatrix& Adds each element of a matrix to the current
operator + TMatrix VType V Adds a number to each element of a matrix and returns the result
operator - TMatrix VType V Subtracts a number from each element of a matrix and returns the result
operator * TMatrix VType V Multiplies each element of a matrix by a number and returns the result
operator / TMatrix VType V Divides each element of a matrix by a number and returns the result
operator += void VType V Adds a number to each element of current matrix
operator -= void VType V Subtracts a number from each element of current matrix
operator *= void VType V Multiplies each element of current matrix by a number
operator /= void VType V Divides each element of current matrix by a number
operator == bool const TMatrix & Checks if the two matrices are equal (by size and elements)
void operator = void const TMatrix & Assigns a matrix to the other one
virtual operator << void TIniStream *S Saves the matrix to a stream
virtual operator >> void TIniStream *S Loads the matrix from a stream
operator [] TVector& int index Returns a reference to a vector at the index position
Resize void int Vectors
int Elements
Changes the size of the matrix. The contents of the matrix is erased
SwapRows void int s
int to
Swaps the position of two rows
SwapCols void int s
int to
Swaps the position of two columns
SubRows void int s
int to
Adds elements of the s row to the elements of the to row
SubCols void int s
int to
Adds elements of the s column to the elements of the to column
Transpose void   Swaps all elements the matrix in a way that M[i][j] = M[j][i]
Trace VType   Returns the sum of the elements of the main diagonal of a matrix
SaveToFile bool const TEString &FN Saves a matrix to a file. Each element of a file is seprated by a tab character and each row is on a new line
static EigenValues void TMatrix& A
TMatrix &E
Transforms a symmetrical matrix to the main-diagonal form using Jacoby algorithm. Matrix E is the transformation matrix.
static ColMax VType TMatrix& A
int i
int &j
Returns maximum value (absolute value, |M[j][i]|) of an i column and assigns the position of the maximum to j.
static GauseSolve void TMatrix &arr
TVector &b
TVector &c
Solves a system of linear equations using Gauss method. arr*c=b; The results are placed in c;
static Lagrang VType TMatrix &xy
VType point
Interpolates a set of X-Y values by the Lagrange method and returns the value of the function in the point.
static Lagrang VType TVector &x
TVector &y
VType point
Analogues to the one described above.
static LeastSquares void TMatrix &Points
TVector& Coeff
int extent
Interpolates Points by a polynomial if the extent extend. The coefficients of the polynomial are placed in the Coeff. Use the TVector::PolynomValue function to evaluate the values of the polynomial
static MatrixElementsSort void TMatrix &arr
TVector &b
The function is used by the GauseSolve function to avoid large errors in the calculation.
static MatMax VType TMatrix& A
int &i
int &j
Searches a maximum value of the matrix (by absolute value). Returns the value and assigns i and j to the indexes of the value.
static MatMaxX VType TMatrix& A
int &i
int &j
Searches a maximum value of the matrix (by absolute value) amongst the top-off-diagonal values of the matrix. Returns the value and assigns i and j to the indexes of the value.
static RowMax VType TMatrix& A
int i
int &j
Returns maximum value of an i row and assigns j to the index of the maximum
static RowMin VType TMatrix& A
int i
int &j
Returns minimum value of an i row and assigns j to the index of the maximum
Vectors int   Returns the number of vectors of a matrix


 

TVPoint: implements TVector

Constructor     TVPoint(VType _x, VType _y, VType _z)
TVPoint()
Function returns arguments  
Eq bool TVPoint &V
VType ESD
Returns true if |V-V1|/V*V1 < ESD and false otherwise
void operator = void TEVPoint &v Copies values of a TEVPoint object
operator = void const TVPoint &v Copies values of a TVPoint object

 

TEValue

Constructor     TEValue()
TEValue( VType Value, VType Error)
Use TEValue when operations on numbers with errors are required
Function returns arguments  
Format TEString   Returns a string representation of the object (e.g. "1.23(4)").
operator = void const TEValue &p Assigns values of another TEValue object
operator = void const TEString &S Initialises values V and E from a string of next form: "1.23(4)". In this case V = 1.23, E = 0.04
operator += void const TEValue &S Adds values of another TEValue object. V = V1+V2; E = sqrt(E12+E22);
operator += void VType S Adds S to V
operator *= void const TEValue &S Multiplies two TEValue objects: V = V1*V2; E = (V1*V2)*sqrt((E1/V1)2+(E2/V2)2)
operator *= void VType S Multiplies V by S
operator /= void const TEValue &S Divides two TEValue objects: V = V1/V2; E = (V1/V2)*sqrt((E1/V1)2+(E2/V2)2)
operator /= void VType S Divides V by S
operator -= void const TEValue &S Subtracts two TEValue objects V = V1-V2; E = sqrt(E12+E22);
operator -= void VType S Subtracts S from V
operator + TEValue VType S Returns a sum of current object and S
operator - TEValue VType S Returns a difference between current object and S
operator * TEValue VType S Returns a product of between current object and S
operator / TEValue VType S Returns a product of division of current object and S
operator + TEValue const TEValue &S Returns a sum of current object and S
operator - TEValue const TEValue &S Returns a difference between current object and S
operator * TEValue const TEValue &S Returns a product of between current object and S
operator / TEValue const TEValue &S Returns a product of division of current object and S
Sqrt TEValue   Returns a square root of current object: V = (V1)0.5; E = E1/(V1*2)0.5
PROPERTIES      
VType V     The value part of the object
VType E     The error part of the object




 

TEVPoint: implements TStreamableObj

 
Constructor     TEVPoint(VType _x, VType _y, VType _z, VType ex, VType ey, VType ez)
TEVPoint()
Represent a point with an error in the 3D
Function returns arrguments  
CAngle TEValue TEVPoint p Calculates the cosine of the angle between two TEVPoint objects
DistanceTo TEValue TVPoint p Calculates the distance between current TEVPoint and TVPoint objects
DistanceTo TEValue TEVPoint p Calculates the distance between two TEVPoint objects
Length TEValue   Returns the length of current object
Normalise void   Normalises current object ( V[i] /= length ). Resulting length = 1
Null void   Empties the content of the object
operator [] TEValue& int offset Returns a reference to a TEValue object (there are only three of them);
operator = void const TEVPoint &a Assigns the values of another TEVPoint object
operator = void const TVPoint &a Assigns the values of another TVPoint object (all E=0)
operator + TEVPoint VType a Returns a result of addition of a number to current object
operator - TEVPoint VType a Returns a result of subtraction of a number from current object
operator * TEVPoint VType a Returns a product of a number and current object
operator / TEVPoint VType a Returns a product of division of current object and a number
operator += void VType a Adds a number to current object
operator -= void VType a Subtracts a number from current object
operator *= void VType a Multiplies each element of the object by a number
operator /= void VType a Divides each element of the object by a number
operator + TEVPoint const TVPoint &a Returns a result of addition of a TVPoint object to current object
operator - TEVPoint const TVPoint &a Returns a result of subtraction of a TVPoint object from current object
operator * TEVPoint const TVPoint &a Returns a result of multiplication of a TVPoint object by current object
operator / TEVPoint const TVPoint &a Returns a result of division of current object by a TVPoint object
operator += void const TVPoint &a Adds a TVPoint object to current object
void operator -= void const TVPoint &a Subtracts a TVPoint object to current object
void operator *= void const TVPoint &a Multiplies current object by a TVPoint object
void operator /= void const TVPoint &a Divides current object by a TVPoint object
operator + TEVPoint const TEVPoint &a Returns a result of addition of current object and another TEVPoint object
operator - TEVPoint const TEVPoint &a Returns a result of subtraction of current object and another TEVPoint object
operator * TEVPoint const TEVPoint &a Returns a result of multiplication of current object and another TEVPoint object
operator / TEVPoint const TEVPoint &a Returns a result of division of current object and another TEVPoint object
operator += void const TEVPoint &a Adds a TEVPoint object to current
operator -= void const TEVPoint &a Subtracts a TEVPoint object from current
operator *= void const TEVPoint &a Multiplies current object by another TEVPoint object
operator /= void const TEVPoint &a Divides current object by another TEVPoint object
operator *= void TMatrix &a Multiplies current object by a TMatrix object.
operator == bool const TEVPoint &a Compares two TEVPoint objects and returns true if the objects are equal and false otherwise
bool operator != bool const TEVPoint &a Compares two TEVPoint objects and returns false if the objects are equal and true otherwise
virtual operator >> void TIniStream *S Saves the object to a stream
virtual operator << void TIniStream *S Loads an object from a stream

 


class TEBasis: public TStreamableObj //
public:
    TVPoint Center;        // centre of the basis
    VType RX, RY, RZ, // rotation angles
    Zoom; // zoom          // Zoom
    TMatrix Matrix;        // the rotation matrix

TEBasis();

void operator = (TEBasis &B);               // copies the content of the other TEBasis object
void operator << (class TIniStream *S); // saves the content of the object to a stream
void operator >> (class TIniStream *S); // loads the content of the object fro a stream

void RotateX( VType A);                      // Calculates the rotation matrix to rotate A degrees around X
void RotateY( VType A);                      // Calculates the rotation matrix to rotate A degrees around Y
void RotateZ( VType A);                      // Calculates the rotation matrix to rotate A degrees around Z
void Reset();                                         // Resets the angles and rotation matrix 
VType DistanceTo (TEBasis &B);        // Returns the distance between two TEBasis objects


© Oleg V. Dolomanov, 2004
Last Updated 2004.04.01