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

Introduce an ArrayLike trait#1469

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
akern40 wants to merge4 commits intorust-ndarray:master
base:master
Choose a base branch
Loading
fromakern40:arraylike

Conversation

akern40
Copy link
Collaborator

@akern40akern40 commentedDec 26, 2024
edited
Loading

This is one of two PRs I'm working on that start to "traitify" ndarray. This trait is like theNdarray trait suggested by@bluss in#339, but is slightly broader: it's meant to encapsulate not just actualndarray types, but anything that could actlike a multidimensional array. This includes Vecs, slices, arrays, and (critically) scalars that implementScalarOperand.

The motivation for me was trying to design a set of methods expanded numerical methods, addressing#1462 (and others). My goal was to have these methods

  1. Work for types that implement the associatednum_traits traits, i.e.,abs forT: Signed.
  2. Have both array-creating and array-mutating variants
  3. Broadcast amongst all arguments
  4. Work for arrays and scalars interchangeably

I was able to accomplish 1-3 with existing infrastructure, but you can see in#1462 that I was struggling with (4). This trait would allow me to accomplish all of these tasks.

Feedback is greatly welcome. Keep an eye out for two more upcoming PRs:

  1. An implementation of the math stuff above that usesArrayLike, to close #14632
  2. A PR with theNdarray trait, following the design ofNdArray trait #339

Note: This PR uses#1440 so should be merged after that.

Sh3mm and bluss reacted with heart emoji
This was referencedDec 26, 2024
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.

1 participant
@akern40

[8]ページ先頭

©2009-2025 Movatter.jp