generated from karl/cpp-template
Add simple testing script to main
This commit is contained in:
parent
2105e2619e
commit
ab2adf4173
6
Makefile
6
Makefile
@ -1,10 +1,10 @@
|
|||||||
CXX = g++
|
CXX = g++
|
||||||
CXXFLAGS = -Wall -O3
|
CXXFLAGS = -Wall -O3
|
||||||
|
|
||||||
program: main.o
|
kdtree: main.o
|
||||||
$(CXX) $(CXXFLAGS) -o program.out main.o
|
$(CXX) $(CXXFLAGS) -o kdtree.out main.o
|
||||||
|
|
||||||
main.o: main.cpp
|
main.o: main.cpp kdtree.h
|
||||||
$(CXX) $(CXXFLAGS) -c main.cpp
|
$(CXX) $(CXXFLAGS) -c main.cpp
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
|
11
main.cpp
11
main.cpp
@ -1,7 +1,18 @@
|
|||||||
|
#include "kdtree.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
std::cout << "Hello World!" << std::endl;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user