commit
2d231edd1b
|
@ -561,8 +561,8 @@ struct GenerateFunctionalNode: Argument<T, A, Base::N + 1>, Base {
|
|||
|
||||
/// Given df/dT, multiply in dT/dA and continue reverse AD process
|
||||
// Cols is always known at compile time
|
||||
template<int Rows, int Cols>
|
||||
void reverseAD4(const Eigen::Matrix<double, Rows, Cols> & dFdT,
|
||||
template<typename SomeMatrix>
|
||||
void reverseAD4(const SomeMatrix & dFdT,
|
||||
JacobianMap& jacobians) const {
|
||||
Base::Record::reverseAD4(dFdT, jacobians);
|
||||
This::trace.reverseAD1(dFdT * This::dTdA, jacobians);
|
||||
|
|
|
@ -206,10 +206,24 @@ private:
|
|||
// with an execution trace, made up entirely of "Record" structs, see
|
||||
// the FunctionalNode class in expression-inl.h
|
||||
size_t size = traceSize();
|
||||
|
||||
// Windows does not support variable length arrays, so memory must be dynamically
|
||||
// allocated on Visual Studio. For more information see the issue below
|
||||
// https://bitbucket.org/gtborg/gtsam/issue/178/vlas-unsupported-in-visual-studio
|
||||
#ifdef _MSC_VER
|
||||
ExecutionTraceStorage* traceStorage = new ExecutionTraceStorage[size];
|
||||
#else
|
||||
ExecutionTraceStorage traceStorage[size];
|
||||
#endif
|
||||
|
||||
ExecutionTrace<T> trace;
|
||||
T value(traceExecution(values, trace, traceStorage));
|
||||
trace.startReverseAD1(jacobians);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
delete[] traceStorage;
|
||||
#endif
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
namespace gtsam {
|
||||
|
||||
// Generics
|
||||
|
||||
template<class T>
|
||||
template<typename T>
|
||||
Expression<T> between(const Expression<T>& t1, const Expression<T>& t2) {
|
||||
return Expression<T>(t1, &T::between, t2);
|
||||
}
|
||||
|
|
|
@ -20,10 +20,7 @@ typedef Expression<Rot2> Rot2_;
|
|||
typedef Expression<Pose2> Pose2_;
|
||||
|
||||
Point2_ transform_to(const Pose2_& x, const Point2_& p) {
|
||||
Point2 (Pose2::*transform)(const Point2& p, OptionalJacobian<2, 3> H1,
|
||||
OptionalJacobian<2, 2> H2) const = &Pose2::transform_to;
|
||||
|
||||
return Point2_(x, transform, p);
|
||||
return Point2_(x, &Pose2::transform_to, p);
|
||||
}
|
||||
|
||||
// 3D Geometry
|
||||
|
@ -33,11 +30,7 @@ typedef Expression<Rot3> Rot3_;
|
|||
typedef Expression<Pose3> Pose3_;
|
||||
|
||||
Point3_ transform_to(const Pose3_& x, const Point3_& p) {
|
||||
|
||||
Point3 (Pose3::*transform)(const Point3& p, OptionalJacobian<3, 6> Dpose,
|
||||
OptionalJacobian<3, 3> Dpoint) const = &Pose3::transform_to;
|
||||
|
||||
return Point3_(x, transform, p);
|
||||
return Point3_(x, &Pose3::transform_to, p);
|
||||
}
|
||||
|
||||
// Projection
|
||||
|
|
Loading…
Reference in New Issue