#ifndef T222_H
# define T222_H
# ifndef GPK_STD_H
#  include <gpk_std.h>
# endif
# include <stdio.h>
# include <math.h>
# include "m22.h"
# include "v2.h"
// # include <iostream.h>

class tensor222 {
	double d[2][2][2];

	public:
	double operator()(int i, int j, int k) C	{return d[i][j][k];}
	tensor222(C tensor222& a);
	tensor222();
	tensor222(double a000, double a001, double a010, double a011,
		double a100, double a101, double a110, double a111);
	tensor222& operator=(C tensor222& a);

	BOOL ok() C	{return TRUE;}
	static tensor222 zero;
	tensor222 operator-() C;
	tensor222& operator+=(C tensor222& a);
	tensor222& operator-=(C tensor222& a);
	double max() C;
	// friend ostream& operator<<(ostream& s, C tensor222& a);
	};

tensor222 operator-(C tensor222& a, C tensor222& b);
tensor222 operator-(C tensor222& a);
matrix22 operator*(C tensor222& a, C vector2& b);
matrix22 operator*(C vector2& a, C tensor222& b);
matrix22 mid(C tensor222& b, C vector2& a);
tensor222 mid(C tensor222& b, C matrix22& a);
tensor222 tail(C tensor222& b, C matrix22& a);
tensor222 operator+(C tensor222& a, C tensor222& b);
tensor222 operator*(C tensor222& b, double a);
tensor222 operator*(C tensor222& b, C matrix22& a);
tensor222 operator*(C matrix22& b, C tensor222& a);
/* tensor222 operator*(double a, C tensor222& b); */
// ostream& operator<<(ostream& s, C tensor222& a);


inline tensor222 operator*(double a, C tensor222& b)
		{return b*a;}
#endif
