Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add traits for generic norms and distances#130

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Nuramon27 wants to merge4 commits intorust-num:master
base:master
Choose a base branch
Loading
fromNuramon27:dist

Conversation

@Nuramon27
Copy link

This is the implementation mentioned in#121.
Regarding the issue that there are many possible norms for a certain type (see comment#121 (comment) ): I think these traits would only be intended to be implemented on very basic types for which there is some notion of astandard norm, like the absolute value on floating point numbers and the euclidean norm on complex numbers and one-dimensional arrays.

Indeed in the meantime I started working a separate crateNorman which handles exactly this issue and provides a set of different norms on a single type.

I hoped that both might go well with each other: having num-traits for a simple answer to the question “how far are these two vectors apart” and a dedicated crate if full control is necessary over how this distance is calculated.

… of distances between numbers.The `Norm` trait provides a `norm` function for types that represent a normed vector space – e.g. the absolute value of a float or the norm of a complex number.The `Distance` trait provides a `distance` function to still calculate the distance between two values if no sensible norm can be defined.
@jsmith628
Copy link

You could check out mymaths-traits crate. While it doesn'tcurrently haveimpls for the structs in thenum collection, there are norm, metric, and inner product traits, and I'd be open to contributions or feature requests.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Nuramon27@jsmith628

[8]ページ先頭

©2009-2025 Movatter.jp