Git Product home page Git Product logo

Comments (4)

sriram98v avatar sriram98v commented on July 28, 2024

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.

swagle8987 avatar swagle8987 commented on July 28, 2024

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.

sriram98v avatar sriram98v commented on July 28, 2024

I have updated the trait bounds for nodeid on the node trait.

from phylo-rs.

sriram98v avatar sriram98v commented on July 28, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.