Comments (3)
This ended up being a corner case that happens due to only the way the as_list
function works relative to the internal BFS traversal, written eons ago.
I've removed it, since philosophically one has better control over simplex retrieval using the as.list.st_traversal
S3 generic, which is also more uniform in that it always reports one simplex per entry in a list form. Indeed, though matrix formats are nice an compact, there is no standard on row vs column orientation, row being more familiar to data scientists and column more familiar to scientific computing and combinatorics people (and more efficient to report, since R is column major)
You can emulate that function now by rolling your own:
library(simplextree)
#>
#> Attaching package: 'simplextree'
#> The following object is masked from 'package:utils':
#>
#> find
#> The following objects are masked from 'package:base':
#>
#> remove, serialize
st <- simplex_tree(list(1:3, 2:5, c(6, 7, 9), 7:8, 10))
lapply(seq(0L, st$dimension), function(d){
do.call(cbind, as.list(k_simplices(st, d)))
})
#> [[1]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 1 2 3 4 5 6 7 8 9 10
#>
#> [[2]]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
#> [1,] 1 1 2 2 2 3 3 4 6 6 7 7
#> [2,] 2 3 3 4 5 4 5 5 7 9 8 9
#>
#> [[3]]
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 1 2 2 2 3 6
#> [2,] 2 3 3 4 4 7
#> [3,] 3 4 5 5 5 9
#>
#> [[4]]
#> [,1]
#> [1,] 2
#> [2,] 3
#> [3,] 4
#> [4,] 5
Created on 2021-07-21 by the reprex package (v2.0.0)
Replacing cbind
w/ rbind
as needed. Note the use of as.list
method dispatch here.
The row-oriented outputs for low dimensional simplices like st$edges
should still remain attached at the module level.
from simplextree.
This makes sense! I'll close the issue once i've tried it out on my machine.
from simplextree.
This has been fully resolved in #13 (implementation) and #16 (debugging).
from simplextree.
Related Issues (8)
- collapse interprets vertices starting at 0 HOT 2
- handling, shifting, & permuting vertex indices HOT 4
- random generators / samplers HOT 3
- Several reported installation issues HOT 2
- vertex-level operations HOT 2
- analogs of graph-theoretic / network-analytic measures HOT 1
- Add templated and/or runtime level support simplex properties
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplextree.