- introduced CallRecordMaxVirtualStaticRows for keeping CallRecord.h and testCallRecord.cpp in sync with respect to this.
- reactivated the fully dynamically sized matrix support in CallRecord.h - small cleanupsrelease/4.3a0
parent
e2e29dac68
commit
6c62609737
|
|
@ -99,10 +99,12 @@ struct CallRecord {
|
||||||
jacobians);
|
jacobians);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove once Hannes agrees this is never called as handled by above
|
// This overload supports matrices with both rows and columns dynamically sized.
|
||||||
// inline void reverseAD2(const Matrix & dFdT, JacobianMap& jacobians) const {
|
// The template version above would be slower by introducing an extra conversion
|
||||||
// _reverseAD3(dFdT, jacobians);
|
// to statically sized columns.
|
||||||
// }
|
inline void reverseAD2(const Matrix & dFdT, JacobianMap& jacobians) const {
|
||||||
|
_reverseAD3(dFdT, jacobians);
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~CallRecord() {
|
virtual ~CallRecord() {
|
||||||
}
|
}
|
||||||
|
|
@ -131,6 +133,13 @@ private:
|
||||||
JacobianMap& jacobians) const = 0;
|
JacobianMap& jacobians) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CallRecordMaxVirtualStaticRows tells which separate virtual reverseAD with specific
|
||||||
|
* static rows (1..CallRecordMaxVirtualStaticRows) methods are part of the CallRecord
|
||||||
|
* interface. It is used to keep the testCallRecord unit test in sync.
|
||||||
|
*/
|
||||||
|
const int CallRecordMaxVirtualStaticRows = 5;
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
/**
|
/**
|
||||||
* The CallRecordImplementor implements the CallRecord interface for a Derived class by
|
* The CallRecordImplementor implements the CallRecord interface for a Derived class by
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ static const int Cols = 3;
|
||||||
|
|
||||||
|
|
||||||
int dynamicIfAboveMax(int i){
|
int dynamicIfAboveMax(int i){
|
||||||
if(i > 5){
|
if(i > CallRecordMaxVirtualStaticRows){
|
||||||
return Eigen::Dynamic;
|
return Eigen::Dynamic;
|
||||||
}
|
}
|
||||||
else return i;
|
else return i;
|
||||||
|
|
@ -43,7 +43,6 @@ struct CallConfig {
|
||||||
int compTimeCols;
|
int compTimeCols;
|
||||||
int runTimeRows;
|
int runTimeRows;
|
||||||
int runTimeCols;
|
int runTimeCols;
|
||||||
CallConfig() {}
|
|
||||||
CallConfig(int rows, int cols):
|
CallConfig(int rows, int cols):
|
||||||
compTimeRows(dynamicIfAboveMax(rows)),
|
compTimeRows(dynamicIfAboveMax(rows)),
|
||||||
compTimeCols(cols),
|
compTimeCols(cols),
|
||||||
|
|
@ -72,6 +71,7 @@ struct CallConfig {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Record: public internal::CallRecordImplementor<Record, Cols> {
|
struct Record: public internal::CallRecordImplementor<Record, Cols> {
|
||||||
|
Record() : cc(0, 0) {}
|
||||||
virtual ~Record() {
|
virtual ~Record() {
|
||||||
}
|
}
|
||||||
void print(const std::string& indent) const {
|
void print(const std::string& indent) const {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue