]> ruin.nu Git - germs.git/commitdiff
Added more doxygen documentation
authorMichael Andreen <harv@ruin.nu>
Thu, 23 Aug 2007 16:59:29 +0000 (16:59 +0000)
committerMichael Andreen <harv@ruin.nu>
Thu, 23 Aug 2007 16:59:29 +0000 (16:59 +0000)
doc/doxygen
src/componenttree.h
src/genealgorithms.h
src/misc.h
src/model.h
src/models.h
src/sortaction.h

index a671140fa504b32875b4855be7dcb8fd55a8d75e..216a78c0f33300facbb7695cdad54668e25d21d5 100644 (file)
@@ -1126,7 +1126,7 @@ UML_LOOK               = NO
 # If set to YES, the inheritance and collaboration graphs will show the 
 # relations between templates and their instances.
 
 # If set to YES, the inheritance and collaboration graphs will show the 
 # relations between templates and their instances.
 
-TEMPLATE_RELATIONS     = NO
+TEMPLATE_RELATIONS     = YES
 
 # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
 # tags are set to YES then doxygen will generate a graph for each documented 
 
 # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
 # tags are set to YES then doxygen will generate a graph for each documented 
@@ -1148,7 +1148,7 @@ INCLUDED_BY_GRAPH      = YES
 # So in most cases it will be better to enable call graphs for selected 
 # functions only using the \callgraph command.
 
 # So in most cases it will be better to enable call graphs for selected 
 # functions only using the \callgraph command.
 
-CALL_GRAPH             = NO
+CALL_GRAPH             = YES
 
 # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
 # generate a caller dependency graph for every global function or class method. 
 
 # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
 # generate a caller dependency graph for every global function or class method. 
index 816059c29b7fe3c14463bbaf023c905b2907f834..84d6270218101fbde5c71c01468837d577dae18d 100644 (file)
 #include <map>
 #include "misc.h"
 
 #include <map>
 #include "misc.h"
 
+/**
+ * Creates and holds a component tree.
+ */
 class ComponentTree {
        public:
 class ComponentTree {
        public:
+               /**
+                * A node in the component tree.
+                */
                struct Node {
                        Node(Node* parent, Component comp);
                        ~Node();
                struct Node {
                        Node(Node* parent, Component comp);
                        ~Node();
@@ -49,8 +55,17 @@ class ComponentTree {
                 */
                void makeUnoriented();
 
                 */
                void makeUnoriented();
 
+               /**
+                * Count the number of leaves in the component tree.
+                * This is the number of hurdles, if makeUnoriented has been called.
+                */
                size_t countLeaves();
 
                size_t countLeaves();
 
+               /**
+                * Number of short branches.
+                * If makeUnoriented has been called and countLeaves is >= 3
+                * then we have a super hurdle if short branches = 0.
+                */
                size_t shortBranches();
 
        private:
                size_t shortBranches();
 
        private:
index 1d74e7130862188d4ff8e0ad57bf8a656e7d6023..a91f67ddcae2345497c24841ff93dc6d6d5ebf82 100644 (file)
 class GeneOrder;
 struct Component;
 
 class GeneOrder;
 struct Component;
 
-
+/**
+ * Simple interval struct, holds the indexes + information if the interval is
+ * oriented or not.
+ */
 struct Interval{
        Interval(size_t f,size_t s,bool o = false):first(f),second(s),oriented(o){}
        bool operator==(const Interval& i){
 struct Interval{
        Interval(size_t f,size_t s,bool o = false):first(f),second(s),oriented(o){}
        bool operator==(const Interval& i){
@@ -44,6 +47,8 @@ struct Interval{
 std::pair<int,int> longestSequences(const GeneOrder& go);
 
 /**
 std::pair<int,int> longestSequences(const GeneOrder& go);
 
 /**
+ * Uses the Robinson-Schensted algorithm on the gene order. Gives the longest
+ * increasing and decreasing subsequences.
  */
 std::vector<std::vector<int> > robinsonSchensted(const GeneOrder& go);
 
  */
 std::vector<std::vector<int> > robinsonSchensted(const GeneOrder& go);
 
index ee0b57814bbd0874d3569621a950e725356ec66f..76f722f05ad75212af17613999cdf8a1aeae75c9 100644 (file)
 #ifndef __MISC_H__
 #define __MISC_H__
 
 #ifndef __MISC_H__
 #define __MISC_H__
 
+/**
+ * The type we use for genes, has to be a signed integer type.
+ */
 typedef int Gene;
 
 typedef int Gene;
 
+/**
+ * Simple struct for components. Holds the indexes, the first and last genes
+ * + information if the component is unoriented.
+ */
 struct Component{
        Component(int b = 0,int e = 0,int s = 0,size_t i1 = 0, size_t i2 = 0):begin(b),end(e),sign(s),i1(i1), i2(i2){}
        bool operator==(const Component& c){
 struct Component{
        Component(int b = 0,int e = 0,int s = 0,size_t i1 = 0, size_t i2 = 0):begin(b),end(e),sign(s),i1(i1), i2(i2){}
        bool operator==(const Component& c){
index 4869793c407fe7bb2800136df715b03733588089..4c5f46a8005956dd523cd4edabcf04aa1b2b23b9 100644 (file)
@@ -49,11 +49,19 @@ class Model{
                Model(Models::ModelImpl* model);
 
                /**
                Model(Models::ModelImpl* model);
 
                /**
+                * Gives the score for the action on a given gene order.
+                * A better match for this model gives a higher score.
                 */
                double score(const SortAction& sa, const GeneOrder& go) const;
 
                 */
                double score(const SortAction& sa, const GeneOrder& go) const;
 
+               /**
+                * The name for the model used.
+                */
                const char* name() const;
 
                const char* name() const;
 
+               /**
+                * Creates a model from a name.
+                */
                static Model modelFactory(const std::string& name);
 
        private:
                static Model modelFactory(const std::string& name);
 
        private:
index 8d7f9e8a7a7980ffe10634dcc7eb732de43ae2de..f037071b0843684ce16ccb2e29e94aaac38aeb9a 100644 (file)
@@ -26,41 +26,97 @@ class GeneOrder;
 
 namespace Models {
 
 
 namespace Models {
 
+/**
+ * Basic implementation of a model. All sort actions are considered equal.
+ */
 class ModelImpl {
        public:
                virtual ~ModelImpl();
 
 class ModelImpl {
        public:
                virtual ~ModelImpl();
 
+               /**
+                * All actions return 1 in this model.
+                *
+                * \see Model::score
+                */
                virtual double score(const SortAction& sa, const GeneOrder& go);
 
                virtual double score(const SortAction& sa, const GeneOrder& go);
 
+               /**
+                * \see Model::name
+                */
                virtual const char* name();
 };
 
 
                virtual const char* name();
 };
 
 
+/**
+ * A model that favors symmetric reversal, resulting in an X-like
+ * picture in a dot plot.
+ */
 class X : public ModelImpl {
        public:
 class X : public ModelImpl {
        public:
+               /**
+                * Returns a higher score for reversals around the center
+                *
+                * \see Model::score
+                */
                double score(const SortAction& sa, const GeneOrder& go);
 
                double score(const SortAction& sa, const GeneOrder& go);
 
+               /**
+                * \see Model::name
+                */
                const char* name();
 };
 
                const char* name();
 };
 
+/**
+ * A model that favors short reversals, resulting in a zipper-like
+ * picture in a dot plot
+ */
 class Zipper : public ModelImpl {
        public:
 class Zipper : public ModelImpl {
        public:
+               /**
+                * Returns higher score for shorter reversals.
+                *
+                * \see Model::score
+                */
                double score(const SortAction& sa, const GeneOrder& go);
 
                double score(const SortAction& sa, const GeneOrder& go);
 
+               /**
+                * \see Model::name
+                */
                const char* name();
 };
 
                const char* name();
 };
 
+/**
+ * A model that favors single gene transpositions, resulting in a
+ * very scattered dot plot.
+ */
 class Cloud : public ModelImpl {
        public:
 class Cloud : public ModelImpl {
        public:
+               /**
+                * \todo has to be implemented
+                * \see Model::score
+                */
                double score(const SortAction& sa, const GeneOrder& go);
 
                double score(const SortAction& sa, const GeneOrder& go);
 
+               /**
+                * \see Model::name
+                */
                const char* name();
 };
 
                const char* name();
 };
 
+/**
+ * A model similar to X, but a wider X in the dot plot.
+ */
 class FatX : public ModelImpl {
        public:
 class FatX : public ModelImpl {
        public:
+               /**
+                * \todo has to be implemented
+                * \see Model::score
+                */
                double score(const SortAction& sa, const GeneOrder& go);
 
                double score(const SortAction& sa, const GeneOrder& go);
 
+               /**
+                * \see Model::name
+                */
                const char* name();
 };
 
                const char* name();
 };
 
index 5b810500c2dbea3ab454415eb0cebc17361efea8..ec9a023710961ee0978651fe46f1520d6d18039d 100644 (file)
 class GeneOrder;
 
 
 class GeneOrder;
 
 
+/**
+ * Abstraction for a sort action implementation, this is the base that other
+ * actions inherits from.
+ */
 class SortActionImpl{
        public:
 
 class SortActionImpl{
        public:
 
@@ -48,7 +52,7 @@ class SortActionImpl{
 };
 
 /**
 };
 
 /**
- * Abstraction of a sort action, all child actions has to be immutable.
+ * Abstraction of a sort action, all SortActionImpls has to be immutable.
  *
  * \author Michael Andreen
  */
  *
  * \author Michael Andreen
  */