René's URL Explorer Experiment


Title: How to do point point look up in arrayfire's array? · arrayfire/arrayfire-rust · Discussion #342 · GitHub

Open Graph Title: How to do point point look up in arrayfire's array? · arrayfire/arrayfire-rust · Discussion #342

X Title: How to do point point look up in arrayfire's array? · arrayfire/arrayfire-rust · Discussion #342

Description: How to do point point look up in arrayfire's array?

Open Graph Description: Let say, I have a 3d array called f mat = f(x,y,z) I want to look up from a list of points (x0,y0,z0).....(xn,yn,zn); by spliting it up into arr_x = x0, x1, ....xn; arr_y = y0, y1,....yn; arr_z = z...

X Description: Let say, I have a 3d array called f mat = f(x,y,z) I want to look up from a list of points (x0,y0,z0).....(xn,yn,zn); by spliting it up into arr_x = x0, x1, ....xn; arr_y = y0, y1,....yn; arr_z = z...

Opengraph URL: https://github.com/arrayfire/arrayfire-rust/discussions/342

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"How to do point point look up in arrayfire's array?","text":"

Let say, I have a 3d array called f
\nmat = f(x,y,z)
\nI want to look up from a list of points (x0,y0,z0).....(xn,yn,zn);
\nby spliting it up into
\narr_x = x0, x1, ....xn;
\narr_y = y0, y1,....yn;
\narr_z = z0, z1.... zn;

\n

I want to get the output like
\noutput = f(arr_x, arr_y, arr_z)

\n

Since arr_x, arr_y, arr_z are random points, I have difficult to use \"lookup\", \"locate\", \"view!\", \"index_gen\", \"assign_seq\" to generate the \"output\" without converting the array \"f\" to a 1d array.

\n

The following code will not work as of my expectation because view! will do a permutation mapping of xs and ys. It will expand the dimension of output instead of doing point to point lookup.

\n

Thank in advance for your help.

\n

Eli

\n
\nuse arrayfire::*;\n\nfn main() {\n    let (h, w, ch) = (4, 2, 3);\n    let x = range::<i32>(dim4!(1, w), 1);\n    let y = range::<i32>(dim4!(h), 0);\n    let z = range::<i32>(dim4!(1, 1, ch), 2);\n    let xs = tile(&x, dim4!(h));\n    let ys = tile(&y, dim4!(1, w));\n    let zs = tile(&z, dim4!(h, w, 1));\n\n    af_print!(\"xs=\", &xs);\n    af_print!(\"ys=\", &ys);\n    af_print!(\"zs=\", &zs);\n    let out = view!(zs[xs, ys]);\n    af_print!(\"out=\", &out);\n\n}\n
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

should use \"approx1\"

","upvoteCount":1,"url":"https://github.com/arrayfire/arrayfire-rust/discussions/342#discussioncomment-3546048"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:dc343a8d-455e-1961-0d17-c7706273f179
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-idA772:374646:69D926:93205E:696E5C6C
html-safe-noncea484ddee01b59532883ef137b1f9ab4b6888cb55c63f398da6420ced84cff7d6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzcyOjM3NDY0Njo2OUQ5MjY6OTMyMDVFOjY5NkU1QzZDIiwidmlzaXRvcl9pZCI6IjQ5MzY3MTUzMTQxMDI1MDg2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbf780a6061f13238e69059a1fd3d53abd51cf7c489dc885a4f2cd7d9f750ca88
hovercard-subject-tagdiscussion:4359888
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/arrayfire/arrayfire-rust/342/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/3afdb21d47969b5bd8cd4c6b358871ee3c00c8ccd078a46613568f3231e8ea6c/arrayfire/arrayfire-rust/discussions/342
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3afdb21d47969b5bd8cd4c6b358871ee3c00c8ccd078a46613568f3231e8ea6c/arrayfire/arrayfire-rust/discussions/342
og:image:altLet say, I have a 3d array called f mat = f(x,y,z) I want to look up from a list of points (x0,y0,z0).....(xn,yn,zn); by spliting it up into arr_x = x0, x1, ....xn; arr_y = y0, y1,....yn; arr_z = z...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef68b42d371252b0f236260d6234f4304a806fe5ac43d59faa21fb59d80df103b
turbo-cache-controlno-preview
go-importgithub.com/arrayfire/arrayfire-rust git https://github.com/arrayfire/arrayfire-rust.git
octolytics-dimension-user_id5395442
octolytics-dimension-user_loginarrayfire
octolytics-dimension-repository_id35817370
octolytics-dimension-repository_nwoarrayfire/arrayfire-rust
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35817370
octolytics-dimension-repository_network_root_nwoarrayfire/arrayfire-rust
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release6b74bc8dbcd10b5d69fd9ee9d2cfdc8b35e18a4c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Farrayfire%2Farrayfire-rust%2Fdiscussions%2F342
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Farrayfire%2Farrayfire-rust%2Fdiscussions%2F342
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=arrayfire%2Farrayfire-rust
Reloadhttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
Reloadhttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
Reloadhttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
arrayfire https://patch-diff.githubusercontent.com/arrayfire
arrayfire-rusthttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Farrayfire%2Farrayfire-rust
Fork 58 https://patch-diff.githubusercontent.com/login?return_to=%2Farrayfire%2Farrayfire-rust
Star 827 https://patch-diff.githubusercontent.com/login?return_to=%2Farrayfire%2Farrayfire-rust
Code https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust
Issues 22 https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/issues
Pull requests 2 https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/pulls
Discussions https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions
Actions https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/actions
Projects 1 https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/security
Please reload this pagehttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
Insights https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/pulse
Code https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust
Issues https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/issues
Pull requests https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/pulls
Discussions https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions
Actions https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/actions
Projects https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/projects
Security https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/security
Insights https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/pulse
Answered https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342#discussioncomment-3546048
3togohttps://patch-diff.githubusercontent.com/3togo
3togo https://patch-diff.githubusercontent.com/3togo
Q&Ahttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/categories/q-a
How to do point point look up in arrayfire's array? https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342#top
3togo https://patch-diff.githubusercontent.com/3togo
Answered https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342#discussioncomment-3546048
3togohttps://patch-diff.githubusercontent.com/3togo
Return to tophttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342#top
Please reload this pagehttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
3togo https://patch-diff.githubusercontent.com/3togo
Sep 4, 2022 https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342#discussion-4359888
Give feedback.https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
3togo https://patch-diff.githubusercontent.com/3togo
Sep 4, 2022 https://github.com/arrayfire/arrayfire-rust/discussions/342#discussioncomment-3546048
View full answer https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342#discussioncomment-3546048
Oldest https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342?sort=old
Newest https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342?sort=new
Top https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342?sort=top
Please reload this pagehttps://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
3togo https://patch-diff.githubusercontent.com/3togo
Sep 4, 2022 https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342#discussioncomment-3546048
Give feedback.https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
3togohttps://patch-diff.githubusercontent.com/3togo
Sign up for freehttps://patch-diff.githubusercontent.com/join?source=comment-repo
Sign in to commenthttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Farrayfire%2Farrayfire-rust%2Fdiscussions%2F342
🙏 Q&A https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/categories/q-a
https://patch-diff.githubusercontent.com/3togo
https://patch-diff.githubusercontent.com/arrayfire/arrayfire-rust/discussions/342
https://patch-diff.githubusercontent.com/settings/replies?return_to=1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.