Use Matrix::Constant or Vector::Constant where appropriate.
parent
d9d8e4be6e
commit
df2693d2ae
|
@ -88,7 +88,7 @@ typename internal::FixedSizeMatrix<X>::type numericalGradient(boost::function<do
|
||||||
TangentX d;
|
TangentX d;
|
||||||
d.setZero();
|
d.setZero();
|
||||||
|
|
||||||
Vector g = Vector::Zero(N); // Can be fixed size
|
Eigen::Matrix<double,N,1> g; g.setZero(); // Can be fixed size
|
||||||
for (int j = 0; j < N; j++) {
|
for (int j = 0; j < N; j++) {
|
||||||
d(j) = delta;
|
d(j) = delta;
|
||||||
double hxplus = h(traits<X>::Retract(x, d));
|
double hxplus = h(traits<X>::Retract(x, d));
|
||||||
|
|
|
@ -154,7 +154,7 @@ namespace gtsam {
|
||||||
if (throwCheirality_)
|
if (throwCheirality_)
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
return Vector::Ones(2) * 2.0 * K_->fx();
|
return Vector2::Constant(2.0 * K_->fx());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** return the measurement */
|
/** return the measurement */
|
||||||
|
|
|
@ -146,7 +146,7 @@ public:
|
||||||
if (throwCheirality_)
|
if (throwCheirality_)
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
return Vector::Ones(3) * 2.0 * K_->fx();
|
return Vector3::Constant(2.0 * K_->fx());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** return the measured */
|
/** return the measured */
|
||||||
|
|
|
@ -131,7 +131,7 @@ public:
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
if (throwCheirality_)
|
if (throwCheirality_)
|
||||||
throw e;
|
throw e;
|
||||||
return Vector::Ones(Measurement::dimension) * 2.0 * camera_.calibration().fx();
|
return Eigen::Matrix<double,Measurement::dimension,1>::Constant(2.0 * camera_.calibration().fx());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue