Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize docs need expansion #1360

Open
alice-i-cecile opened this issue Feb 9, 2024 · 1 comment
Open

normalize docs need expansion #1360

alice-i-cecile opened this issue Feb 9, 2024 · 1 comment

Comments

@alice-i-cecile
Copy link

alice-i-cecile commented Feb 9, 2024

When examining Matrix::normalize
, I have a few questions:

  1. What exactly do you mean by "normalization" here? Does this correspond to setting the length of a vector to 1?
  2. What happens with 0-length vectors (or their matrix equivalents)? Does nothing happen? Does it panic? Do we get infinities / NaN values?
@tpdickso
Copy link
Collaborator

  1. Yes, that should set the length of the vector to 1. However, it will not succeed in all cases; if the magnitude of the initial vector is too small then I believe the result is unspecified.
  2. Good call -- I believe in that case you'll get a vector with magnitude 0 (since its length is the square root of an empty sum.) There shouldn't be any non-real values in the result since the dimension of the input vector remains the same, so it will still contain zero actual scalar dimensions.

These are edge cases that would be good to document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants