moved timing scripts back to main directory, added timeCalibratedCamera

release/4.3a0
Frank Dellaert 2010-08-08 18:46:56 +00:00
parent 4bc3229670
commit 4b6eb67340
4 changed files with 1086 additions and 1046 deletions

2086
.cproject

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@ sources += projectiveGeometry.cpp tensorInterface.cpp
check_PROGRAMS += tests/testTensors tests/testHomography2 tests/testTrifocal
# Timing tests
noinst_PROGRAMS = tests/timeRot3
noinst_PROGRAMS = timeRot3 timeCalibratedCamera
#----------------------------------------------------------------------------------------------------
# Create a libtool library that is not installed

View File

@ -0,0 +1,44 @@
/**
* @file timeCalibratedCamera.cpp
* @brief time CalibratedCamera derivatives
* @author Frank Dellaert
*/
#include <time.h>
#include <iostream>
#include "CalibratedCamera.h"
using namespace std;
using namespace gtsam;
int main()
{
int n = 100000;
Matrix computed;
const Pose3 pose1(Matrix_(3,3,
1., 0., 0.,
0.,-1., 0.,
0., 0.,-1.
),
Point3(0,0,0.5));
const CalibratedCamera camera(pose1);
const Point3 point1(-0.08,-0.08, 0.0);
// Aug 8, iMac 3.06GHz Core i3
// 0.263943 seconds
// 378870 calls/second
// 2.63943 musecs/call
long timeLog = clock();
for(int i = 0; i < n; i++)
computed = Dproject_pose(camera, point1);
long timeLog2 = clock();
double seconds = (double)(timeLog2-timeLog)/CLOCKS_PER_SEC;
cout << ((double)n/seconds) << " calls/second" << endl;
cout << ((double)seconds*1000000/n) << " musecs/call" << endl;
return 0;
}