#include "Vect.h"
#include "test_assert.h"

void TestVect() {
	Vect vect1 {{3, 2, {
		1, 2,
		3, 4,
		5, 6,
	}}};
	Vect vect2 {{3, 2, {
		1, 0,
		0, 0,
		0, 1,
	}}};
	Vect vect3 {{3, 2, {
		1, 3,
		3, 7,
		5, 11,
	}}};
	Vect vect4 {{3, 2, {
		1, 0,
		0, 0,
		1, 11,
	}}};

	test_assert(vect1 == vect3);
	test_assert(vect2 == vect4);
	test_assert(vect1 != vect2);
	test_assert(vect2 != vect3);
	test_assert(vect3 != vect4);

	test_assert(vect1.IsElementOf(Matrix::ColumnVector({3, 7, 11})));
	test_assert(!vect1.IsElementOf(Matrix::ColumnVector({3, 7, 12})));
}

void TestVectAffine() {
	VectAffine aff {Matrix::ColumnVector({-2, 3, 7}), Matrix::ColumnVector({5, 2, -8})};

	test_assert(aff.IsElementOf(Matrix::ColumnVector({5, 2, -8})));
	test_assert(aff.IsElementOf(Matrix::ColumnVector({3, 5, -1})));
	test_assert(!aff.IsElementOf(Matrix::ColumnVector({1, 2, 3})));
}

int main() {
	TestVect();
	TestVectAffine();
	return 0;
}