Comments (4)
Yep, this can be done. I have pushed some changes to this branch with new implementations of the rooted tree and rooted node trait. Some of the method implementations for each are pending, and more can be added. It also might be a good idea to move methods like SPR, NNI etc to tree instead of PhyloTree as these are not specific to phylogenetic trees....
from phylo-rs.
For future reference
NodeID : Hash + Clone + Drop
Node {
- getid(&self) -> NodeID
- setid (&mut self, NodeID)
- addchild(&mut self, Node)
- setparent(&mut self,Node)
- getparent(&mut self, Node);
- getchildren(&mut self) -> impl Iterator
- isleaf(&self) -> boolean
- removechild(&mut self, NodeID)
}
from phylo-rs.
I have updated the trait bounds for nodeid on the node trait.
from phylo-rs.
It would also make sense to put similar trait bounds on the associated-type taxa as there are for NodeID. Specifically, it would also need to implement Display and Debug as well.
Building on that, the trait bounds of a rooted tree would be as follows:
Tree{
- get_node(&self, NodeID)->Node;
- set_node(&mut self, Node);
- add_child(&mut self, parent_id, Node);
- set_edge(&mut self,parent_id, child_id);
- get_root(&self)->NodeID;
- remove_node(&mut self, NodeID);
- contains_node(&self, NodeID)->bool;
- delete_edge(&mut self, parent_id, child_id);
- clean(&mut self);
}
from phylo-rs.
Related Issues (8)
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 phylo-rs.