Skip to content

Eager vs lazy composition, and transform_deriv_params #5

Closed
@c42f

Description

@c42f

I started implementing AffineTransformation which is pretty easy, except for one tricky design decision: should composition of specific AffineTransformation types eagerly compose into a composite AffineTransformation, or should they remain apart?

For most uses, I'm guessing eager composition is better since it'll be more efficient if you're just applying the transformation to many points. However, it's not a good idea if you want to optimize the parameters of one part of the transformation chain.

My current thought is that composition should be eager by default, but we could add a wrapper type for transformations to mark them as lazy. Come to think of it, maybe the wrapper type should be the signal that we're going to want derivative information in transform_deriv_params()? Currently there's no way to indicate which parts of a transformation chain should be differentiated...

Usage musings...

V = Translation(1.0, 2.0, 3.0)
R = ParameterizedTransform->RotationXY(θ))

# R1 = apply_params(R, 1.0) # RotationXY(1.0) ?

T = R  V

dTdθ = transform_deriv_params(trans, 1.0) # Evaluates derivative of T at θ = 1.0 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions