- 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);
|
||||
}
|
||||
|
||||
// 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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue