Skip to content

Extend the NORM2 intrinsic function to COMPLEX argument #340

Open
@nncarlson

Description

@nncarlson

It would be useful to extend the norm2 intrinsic function to complex arrays, so that
norm2(z) returns sqrt(sum(conjg(z)* z)). Note that dot_product already appropriately handles the case of complex arrays so that in the case of a rank-1 array this is equivalent to sqrt(dot_product(z,z)).

This is such an obvious extension of norm2 that is is puzzling why it wasn't included in the first place. There must be implementation difficulties (e.g., the standard recommendation "that the processor compute the result without undue overflow or underflow") for it to have been omitted.

Edit: sqrt(sum(conjg(z),z)) --> sqrt(sum(conjg(z)*z))

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