Skip to content

ScaledMap issue for Unitful scaling factors #195

@JeffFessler

Description

@JeffFessler

Some of this package works fine with Unitful values thanks to its support for Numbers.
But maybe it hasn't actually been tested with Unitful values.
Now I am trying to use it with some and hit my first issue:

M = ones(3,2) * m
L = LinearMap(M)
Matrix(L) # works fine
S = 1s * L # runs, but has wrong eltype
Matrix(S) # throws

I think the issue is here:

ScaledMap{Base.promote_op(*, typeof(λ), eltype(lmap))}(λ, lmap)

I may know how to fix so I'll aim for a PR.

FWIW, the docstring for promote_op says "Due to its fragility, use of promote_op should be avoided."

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