Skip to content

Commit 2df5ff5

Browse files
committed
[ad] Store (scaled) unit vectors inline
This introduces sparsity to the autodiff partials storage. If only one partial is non-zero, we can avoid using the heap.
1 parent ca73b45 commit 2df5ff5

6 files changed

Lines changed: 451 additions & 73 deletions

File tree

common/ad/auto_diff.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ namespace ad {
1414
Drake's AutoDiff is not templated; it only supports dynamically-sized
1515
derivatives using floating-point doubles.
1616
17-
However, by using a careful representation trick (maintaining a separate scale
18-
factor) it runs faster than `Eigen::AutoDiffScalar<Eigen::VectorXd>`. */
17+
However, by using careful representation tricks (maintaining a separate scale
18+
factor, and using inline storage in case only one partial is non-zero) it runs
19+
faster than `Eigen::AutoDiffScalar<Eigen::VectorXd>`. */
1920
class AutoDiff {
2021
public:
2122
DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN(AutoDiff);

0 commit comments

Comments
 (0)