Skip to content

[RFC]: add blas/ext/base/gscale-norm #658

@kgryte

Description

@kgryte

This API implements

$$y = \frac{x}{||x||_p}$$

This API divides each element in x by p-norm and assigns the results to elements in y.

API signatures:

gscaleNorm( N, p, x, strideX, y, strideY )
gscaleNorm.ndarray( N, p, x, strideX, offsetX, y, strideY, offsetY )

where

  • N: number of indexed elements.
  • p: order of the norm.
  • x: input strided array.
  • strideX: stride length for x.
  • offsetX: starting index for x.
  • y: output strided array.
  • strideY: stride length for y.
  • offsetY: starting index for y.

Notes

  • To implement, if provided a special value of p, delegate to specialized APIs; otherwise, compute the p-norm, followed by blas/ext/base/*wax with alpha = 1 / norm(x).
  • p should be greater than 0, with the single exception being -infinity. For this case, normalize by minabs(x).

Follow-on Work

Once completed and merged, the following packages can be added

  • [RFC]: add blas/ext/base/dscale-norm
  • [RFC]: add blas/ext/base/sscale-norm
  • [RFC]: add blas/ext/base/ndarray/dscale-norm
  • [RFC]: add blas/ext/base/ndarray/sscale-norm
  • [RFC]: add blas/ext/base/ndarray/gscale-norm
  • [RFC]: add blas/ext/scale-norm

Metadata

Metadata

Assignees

Labels

FeatureTask to add a new feature.difficulty: 2May require some initial design or R&D, but should be straightforward to resolve and/or implement.priority: NormalNormal priority concern or feature request.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions