Add simple testing script to main

This commit is contained in:
karl 2020-12-28 13:55:57 +01:00
parent 2105e2619e
commit ab2adf4173
2 changed files with 14 additions and 3 deletions

View File

@ -1,10 +1,10 @@
CXX = g++
CXXFLAGS = -Wall -O3
program: main.o
$(CXX) $(CXXFLAGS) -o program.out main.o
kdtree: main.o
$(CXX) $(CXXFLAGS) -o kdtree.out main.o
main.o: main.cpp
main.o: main.cpp kdtree.h
$(CXX) $(CXXFLAGS) -c main.cpp
clean :

View File

@ -1,7 +1,18 @@
#include "kdtree.h"
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
// Test points
std::vector<Point *> points{new Point(new float[3]{0.0, 0.0, 0.0}, nullptr),
new Point(new float[3]{0.0, 1.0, 0.0}, nullptr),
new Point(new float[3]{0.0, 2.0, 3.0}, nullptr),
new Point(new float[3]{1.0, 0.0, 4.0}, nullptr)};
KDTree tree = KDTree(points);
std::cout << tree.to_string();
return 0;
}