//---------------------------------------------------------------------------
#ifndef AffineTransformation_H
#define AffineTransformation_H
#include "LinearAlgebra.h"
//---------------------------------------------------------------------------

using namespace std;


// ---------------------------------------------------------------------------
//
//                                 StaticAffineTransformation
//
// ---------------------------------------------------------------------------

class Affine3d 
{   
private:

	// Translation is the vector
	// followed by a dim x dim matrix
	Vector3d v[4];
public:
	// ---- constructors
	inline Affine3d();
	inline Affine3d(double *velocity);

	inline Vector3d& operator[](const unsigned &index);
	inline const Vector3d& operator[](const unsigned &index) const;

	//  ----  operators +, -, *, /
	inline Affine3d operator+(const Affine3d &op) const;
	inline Affine3d operator-(const Affine3d &op) const;
	inline Affine3d operator-() const;
	inline Affine3d operator*(const double &s) const;
	inline Affine3d operator*(const Affine3d &op) const ;

	inline Affine3d operator/(const double &s) const;

	//  ---- operators +=, -=, *=, /=
	inline Affine3d operator+=(const Affine3d &op);
	inline Affine3d operator-=(const Affine3d &op);
	inline Affine3d operator*=(const double &op);
	inline Affine3d operator*=(const Affine3d &op);
	inline Affine3d operator/=(const double &op);
	inline Affine3d operator=(const Affine3d &op);
	inline Affine3d	inverse();

	inline void initialize();
	inline void setZero();
	inline double det();
	// ---- multiplying with vectors
	inline Vector3d operator*(const Vector3d &v) const;
};


#include "AffineTransformation_templCode.h"

#endif
