Mercurial > repos > public > sbplib_julia
comparison src/LazyTensors/tuple_manipulation.jl @ 1594:d68d02dd882f feature/boundary_conditions
Merge with default
author | Vidar Stiernström <vidar.stiernstrom@gmail.com> |
---|---|
date | Sat, 25 May 2024 16:07:10 -0700 |
parents | d7bc11053951 |
children |
comparison
equal
deleted
inserted
replaced
1591:615eeb6e662e | 1594:d68d02dd882f |
---|---|
1 """ | 1 """ |
2 split_index(dim_before, dim_view, dim_index, dim_after, I...) | 2 split_index(dim_before, dim_view, dim_index, dim_after, I...) |
3 | 3 |
4 Splits the multi-index `I` into two parts. One part which is expected to be | 4 Splits the multi-index `I` into two parts. One part which is expected to be |
5 used as a view, and one which is expected to be used as an index. | 5 used as a view, and one which is expected to be used as an index. |
6 Eg. | 6 E.g. |
7 ```julia-repl | 7 ```julia-repl |
8 julia> LazyTensors.split_index(1, 3, 2, 1, (1,2,3,4)...) | 8 julia> LazyTensors.split_index(1, 3, 2, 1, (1,2,3,4)...) |
9 ((1, Colon(), Colon(), Colon(), 4), (2, 3)) | 9 ((1, Colon(), Colon(), Colon(), 4), (2, 3)) |
10 ``` | 10 ``` |
11 | 11 |
31 | 31 |
32 """ | 32 """ |
33 split_tuple(t, szs) | 33 split_tuple(t, szs) |
34 | 34 |
35 Split the tuple `t` into a set of tuples of the sizes given in `szs`. | 35 Split the tuple `t` into a set of tuples of the sizes given in `szs`. |
36 `sum(szs)` should equal `lenght(t)`. | 36 `sum(szs)` should equal `length(t)`. |
37 | 37 |
38 E.g | 38 E.g |
39 ```julia-repl | 39 ```julia-repl |
40 julia> LazyTensors.split_tuple((1,2,3,4,5,6), (3,1,2)) | 40 julia> LazyTensors.split_tuple((1,2,3,4,5,6), (3,1,2)) |
41 ((1, 2, 3), (4,), (5, 6)) | 41 ((1, 2, 3), (4,), (5, 6)) |