diff --git a/.cproject b/.cproject index 97694da3a..2257e397d 100644 --- a/.cproject +++ b/.cproject @@ -468,7 +468,6 @@ make - testBayesTree.run true false @@ -476,6 +475,7 @@ make + testSymbolicBayesNet.run true false @@ -483,7 +483,6 @@ make - testSymbolicFactorGraph.run true false @@ -715,7 +714,6 @@ make - testGraph.run true false @@ -771,11 +769,20 @@ make + testSimulated2D.run true false true + +make +-j2 +timeMatrix.run +true +true +true + make -j2 diff --git a/cpp/Makefile.am b/cpp/Makefile.am index 4d9084f1e..574c1831b 100644 --- a/cpp/Makefile.am +++ b/cpp/Makefile.am @@ -249,13 +249,15 @@ testVSLAMConfig_LDADD = libgtsam.la headers += $(sources:.cpp=.h) # Timing tests -noinst_PROGRAMS = timeGaussianFactor timeGaussianFactorGraph timeRot3 +noinst_PROGRAMS = timeGaussianFactor timeGaussianFactorGraph timeRot3 timeMatrix timeRot3_SOURCES = timeRot3.cpp timeRot3_LDADD = libgtsam.la timeGaussianFactor_SOURCES = timeGaussianFactor.cpp timeGaussianFactor_LDADD = libgtsam.la timeGaussianFactorGraph_SOURCES = timeGaussianFactorGraph.cpp timeGaussianFactorGraph_LDADD = libgtsam.la +timeMatrix_SOURCES = timeMatrix.cpp +timeMatrix_LDADD = libgtsam.la # create both dynamic and static libraries AM_CXXFLAGS = -I$(boost) -fPIC diff --git a/cpp/timeMatrix.cpp b/cpp/timeMatrix.cpp new file mode 100644 index 000000000..201d465a8 --- /dev/null +++ b/cpp/timeMatrix.cpp @@ -0,0 +1,44 @@ +/* + * @file timeMatrix.cpp + * @brief Performs timing and profiling for Matrix operations + * @author Alex Cunningham + */ + +#include +#include +#include "Matrix.h" + +using namespace std; +using namespace gtsam; + +int main(int argc, char ** argv) { + cout << "Starting Matrix::collect() Timing" << endl; + + // create a large number of matrices + size_t n, m, p; + p = 100000; // number of matrices + n = 10; // rows per matrix + m = 12; // columns per matrix + + // fill the matrices with identities + vector matrices; + for (int i=0; i