Fixed timing script
parent
0fd1ff7b26
commit
b5a366e8f1
|
@ -65,8 +65,8 @@ class AdaptAutoDiff {
|
|||
// Convert from row-major to columnn-major
|
||||
// TODO: if this is a bottleneck (probably not!) fix Autodiff to be
|
||||
// Column-Major
|
||||
*H1 = Eigen::Map<RowMajor1>(rowMajor1);
|
||||
*H2 = Eigen::Map<RowMajor2>(rowMajor2);
|
||||
if (H1) *H1 = Eigen::Map<RowMajor1>(rowMajor1);
|
||||
if (H2) *H2 = Eigen::Map<RowMajor2>(rowMajor2);
|
||||
|
||||
} else {
|
||||
// Apply the mapping, to get result
|
||||
|
|
|
@ -57,16 +57,19 @@ int main() {
|
|||
f1 = boost::make_shared<GeneralSFMFactor<Camera, Point3> >(z, model, 1, 2);
|
||||
time("GeneralSFMFactor<Camera> : ", f1, values);
|
||||
|
||||
// AdaptAutoDiff
|
||||
typedef AdaptAutoDiff<SnavelyProjection, Point2, Camera, Point3> AdaptedSnavely;
|
||||
Point2_ expression(AdaptedSnavely(), camera, point);
|
||||
f2 = boost::make_shared<ExpressionFactor<Point2> >(model, z, expression);
|
||||
time("Point2_(AdaptedSnavely(), camera, point): ", f2, values);
|
||||
|
||||
// ExpressionFactor
|
||||
Point2_ expression2(camera, &Camera::project2, point);
|
||||
f3 = boost::make_shared<ExpressionFactor<Point2> >(model, z, expression2);
|
||||
time("Point2_(camera, &Camera::project, point): ", f3, values);
|
||||
|
||||
// AdaptAutoDiff
|
||||
values.clear();
|
||||
values.insert(1,Vector9(Vector9::Zero()));
|
||||
values.insert(2,Vector3(0,0,1));
|
||||
typedef AdaptAutoDiff<SnavelyProjection, 2, 9, 3> AdaptedSnavely;
|
||||
Expression<Vector2> expression(AdaptedSnavely(), Expression<Vector9>(1), Expression<Vector3>(2));
|
||||
f2 = boost::make_shared<ExpressionFactor<Vector2> >(model, z.vector(), expression);
|
||||
time("Point2_(AdaptedSnavely(), camera, point): ", f2, values);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue