The following standard data types are defined in AccuBEM library:

## vec3 class

vec3 class represents the vector with 3 components, i.e. the point in $\mathbb{R}^3$.

// the class that implements the vector holding the 3 components
class vec3 {

public:

vec3();
vec3( const vec3& other );
vec3( double _x, double _y, double _z );

vec3& operator = ( const vec3& other );
vec3& operator += ( const vec3& other );
vec3& operator -= ( const vec3& other );
vec3& operator *= ( double c );
vec3& operator /= ( double c );

double mag() const;	// magnitude of the vector

public:
double x;
double y;
double z;
};

// operators for vec3

vec3 operator + ( const vec3& a, const vec3& b );
vec3 operator - ( const vec3& a, const vec3& b );
vec3 operator * ( const vec3& a, double c );
vec3 operator * ( double c, const vec3& a );
vec3 operator / ( const vec3& a, double c );

double dot( const vec3& a, const vec3& b ); // dot product
vec3 cross( const vec3& a, const vec3& b ); // cross product
vec3 norm( const vec3& a ); // normalize vector


## dcomplex class

The dcomplex class holds two double type elements that represent real and imaginary components of the complex number. It defines stanard operators over complex number such as +,-,*,/ and the complex conjugate operator ~.

// the class implements the complex number which has both
// real and imaginary part defined in IEEE double format
class dcomplex {

public:

dcomplex();
dcomplex( double real, double imaginary );
dcomplex( double real );
dcomplex( const dcomplex& o );

dcomplex& operator = ( const dcomplex& other );
dcomplex& operator = ( double other );
dcomplex& operator += ( const dcomplex& other );
dcomplex& operator -= ( const dcomplex& other );
dcomplex& operator *= ( const dcomplex& other );
dcomplex& operator /= ( const dcomplex& other );

double mag() const;

public:

double re;
double im;
};

// operators for dcomplex
dcomplex operator ~ ( const dcomplex& o ); // complex conjugate operator
dcomplex operator + ( const dcomplex& a, const dcomplex& b );
dcomplex operator - ( const dcomplex& a, const dcomplex& b );
dcomplex operator * ( const dcomplex& a, const dcomplex& b );
dcomplex operator / ( const dcomplex& a, const dcomplex& b );