Skip to content

Comment to explain _inner #5

@goretkin

Description

@goretkin

_inner(x, v1, v2) = v1 === v2 ? LinearAlgebra.norm(v1)^2 : LinearAlgebra.dot(v1, v2)

This is really just for my curiosity. If appropriate, can you include a comment about why not just _inner(x, v1, v2) = LinearAlgebra.dot(v1, v2)? I can't tell if it's about accuracy, or performance, or ....

I know that LinearAlgebra.generic_norm2 does some rescaling for better numerical accuracy, and maybe dot does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions