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

Add Chebyshev function support for more efficient calculations. #9

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lagoon/desk/lib/lagoon.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
~/ %submatrix
|= [sli=(list slice) a=ray]
::
:: example: sli=~[`[`1 `3] `[`1 ~] ~] is equivalent to a[1:4,1:]
:: example: sli=~[`[`1 `3] `[`1 ~] ~] is equivalent to a[1:3,1:,:]
::
^- ray
::
Expand Down Expand Up @@ -100,14 +100,13 @@
::
:: calculate the shape of the result
=/ out-shape=(list @)
%+ turn
%+ turn
out-indices
|=(inds=(list (list @)) (lent inds))
::
:: grab submatrix entries from cartesian product
=/ new-dat=@ux
%+ rep bloq.meta.a
%- flop
%+ turn
(gather out-indices)
|= dex=(list @)
Expand Down Expand Up @@ -213,8 +212,7 @@
++ get-item-number :: convert n-dimensional index to scalar index
|= [shape=(list @) dex=(list @)]
^- @
:: =. dex (flop dex)
=/ sap (flop shape)
=/ sap shape
=/ cof 1
=/ ret 0
|- ^+ ret
Expand Down
101 changes: 101 additions & 0 deletions lib3d/desk/dat/sphere-100.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
:~ ~[.0.0 .1.0 .0.0]
~[.-0.147 .0.98 .0.135]
~[.0.0246 .0.96 .-0.28]
~[.0.209 .0.939 .0.272]
~[.-0.388 .0.919 .-0.0686]
~[.0.37 .0.899 .-0.235]
~[.-0.124 .0.879 .0.461]
~[.-0.236 .0.859 .-0.455]
~[.0.512 .0.838 .0.187]
~[.-0.531 .0.818 .0.219]
~[.0.255 .0.798 .-0.546]
~[.0.188 .0.778 .0.6]
~[.-0.565 .0.758 .-0.327]
~[.0.66 .0.737 .-0.145]
~[.-0.401 .0.717 .0.57]
~[.-0.0922 .0.697 .-0.711]
~[.0.563 .0.677 .0.474]
~[.-0.754 .0.657 .0.0312]
~[.0.547 .0.636 .-0.544]
~[.-0.0364 .0.616 .0.787]
~[.-0.514 .0.596 .-0.617]
~[.0.81 .0.576 .0.109]
~[.-0.683 .0.556 .0.475]
~[.0.185 .0.535 .-0.824]
~[.0.426 .0.515 .0.744]
~[.-0.828 .0.495 .-0.264]
~[.0.799 .0.475 .-0.369]
~[.-0.344 .0.455 .0.822]
~[.-0.305 .0.434 .-0.848]
~[.0.806 .0.414 .0.423]
~[.-0.889 .0.394 .0.234]
~[.0.502 .0.374 .-0.78]
~[.0.158 .0.354 .0.922]
~[.-0.745 .0.333 .-0.577]
~[.0.946 .0.313 .-0.0784]
~[.-0.649 .0.293 .0.702]
~[.0.00469 .0.273 .-0.962]
~[.0.65 .0.253 .0.717]
~[.-0.968 .0.232 .-0.0898]
~[.0.778 .0.212 .-0.591]
~[.-0.176 .0.192 .0.966]
~[.-0.525 .0.172 .-0.834]
~[.0.953 .0.152 .0.261]
~[.-0.882 .0.131 .0.453]
~[.0.345 .0.111 .-0.932]
~[.0.375 .0.0909 .0.922]
~[.-0.901 .0.0707 .-0.427]
~[.0.954 .0.0505 .-0.294]
~[.-0.505 .0.0303 .0.862]
~[.-0.21 .0.0101 .-0.978]
~[.0.815 .-0.0101 .0.579]
~[.-0.992 .-0.0303 .0.124]
~[.0.647 .-0.0505 .-0.761]
~[.0.0364 .-0.0707 .0.997]
~[.-0.699 .-0.0909 .-0.709]
~[.0.993 .-0.111 .0.0507]
~[.-0.764 .-0.131 .0.631]
~[.0.137 .-0.152 .-0.979]
~[.0.559 .-0.172 .0.811]
~[.-0.956 .-0.192 .-0.22]
~[.0.85 .-0.212 .-0.482]
~[.-0.3 .-0.232 .0.925]
~[.-0.402 .-0.253 .-0.88]
~[.0.886 .-0.273 .0.376]
~[.-0.901 .-0.293 .0.319]
~[.0.446 .-0.313 .-0.839]
~[.0.236 .-0.333 .0.913]
~[.-0.784 .-0.354 .-0.51]
~[.0.915 .-0.374 .-0.153]
~[.-0.566 .-0.394 .0.724]
~[.-0.0707 .-0.414 .-0.907]
~[.0.658 .-0.434 .0.615]
~[.-0.891 .-0.455 .-0.00869]
~[.0.655 .-0.475 .-0.588]
~[.-0.0844 .-0.495 .0.865]
~[.-0.515 .-0.515 .-0.685]
~[.0.83 .-0.535 .0.155]
~[.-0.706 .-0.556 .0.439]
~[.0.22 .-0.576 .-0.787]
~[.0.363 .-0.596 .0.716]
~[.-0.737 .-0.616 .-0.277]
~[.0.716 .-0.636 .-0.287]
~[.-0.326 .-0.657 .0.68]
~[.-0.213 .-0.677 .-0.705]
~[.0.617 .-0.697 .0.366]
~[.-0.682 .-0.717 .0.143]
~[.0.394 .-0.737 .-0.549]
~[.0.0776 .-0.758 .0.648]
~[.-0.477 .-0.778 .-0.41]
~[.0.602 .-0.798 .-0.019]
~[.-0.411 .-0.818 .0.402]
~[.0.0305 .-0.838 .-0.544]
~[.0.325 .-0.859 .0.397]
~[.-0.472 .-0.879 .-0.0682]
~[.0.362 .-0.899 .-0.247]
~[.-0.0902 .-0.919 .0.383]
~[.-0.168 .-0.939 .-0.299]
~[.0.267 .-0.96 .0.0881]
~[.-0.182 .-0.98 .0.0821]
~[.0.0 .-1.0 .-0.0]
==
Loading