add IsElementOf + ColumnVector
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "Vect.h"
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
void TestVect() {
|
||||
Vect vect1 {{3, 2, {
|
||||
1, 2,
|
||||
3, 4,
|
||||
@@ -27,5 +27,21 @@ int main() {
|
||||
assert(vect1 != vect2);
|
||||
assert(vect2 != vect3);
|
||||
assert(vect3 != vect4);
|
||||
|
||||
assert(vect1.IsElementOf(Matrix::ColumnVector({3, 7, 11})));
|
||||
assert(!vect1.IsElementOf(Matrix::ColumnVector({3, 7, 12})));
|
||||
}
|
||||
|
||||
void TestVectAffine() {
|
||||
VectAffine aff {Matrix {3, 1, {-2, 3, 7}}, Matrix::ColumnVector({5, 2, -8})};
|
||||
|
||||
assert(aff.IsElementOf(Matrix::ColumnVector({5, 2, -8})));
|
||||
assert(aff.IsElementOf(Matrix::ColumnVector({3, 5, -1})));
|
||||
assert(!aff.IsElementOf(Matrix::ColumnVector({1, 2, 3})));
|
||||
}
|
||||
|
||||
int main() {
|
||||
TestVect();
|
||||
TestVectAffine();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user