- 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 cleanups
release/4.3a0
HannesSommer 2014-11-29 16:03:33 +01:00
parent e2e29dac68
commit 6c62609737
2 changed files with 15 additions and 6 deletions

View File

@ -99,10 +99,12 @@ struct CallRecord {
jacobians);
}
// TODO: remove once Hannes agrees this is never called as handled by above
// inline void reverseAD2(const Matrix & dFdT, JacobianMap& jacobians) const {
// _reverseAD3(dFdT, jacobians);
// }
// This overload supports matrices with both rows and columns dynamically sized.
// The template version above would be slower by introducing an extra conversion
// to statically sized columns.
inline void reverseAD2(const Matrix & dFdT, JacobianMap& jacobians) const {
_reverseAD3(dFdT, jacobians);
}
virtual ~CallRecord() {
}
@ -131,6 +133,13 @@ private:
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 {
/**
* The CallRecordImplementor implements the CallRecord interface for a Derived class by

View File

@ -33,7 +33,7 @@ static const int Cols = 3;
int dynamicIfAboveMax(int i){
if(i > 5){
if(i > CallRecordMaxVirtualStaticRows){
return Eigen::Dynamic;
}
else return i;
@ -43,7 +43,6 @@ struct CallConfig {
int compTimeCols;
int runTimeRows;
int runTimeCols;
CallConfig() {}
CallConfig(int rows, int cols):
compTimeRows(dynamicIfAboveMax(rows)),
compTimeCols(cols),
@ -72,6 +71,7 @@ struct CallConfig {
};
struct Record: public internal::CallRecordImplementor<Record, Cols> {
Record() : cc(0, 0) {}
virtual ~Record() {
}
void print(const std::string& indent) const {