ajtree.c
Creates a new general tree.
Synopsis
Prototype
AjPTree ajTreeNew (
void
);
Type | Name | Read/Write | Description |
AjPTree | | RETURN | new tree; |
Returns
Description
Creates a new general tree.
See Also
See other functions in this section
Availability
In release 6.4.0
Creates a new general tree using a Newick's format phylogenetic tree
as input
Synopsis
Prototype
AjPTree ajTreeNewNewick (
const AjPStr newick
);
Type | Name | Read/Write | Description |
const AjPStr | newick | Input | Newick's format tree |
AjPTree | | RETURN | new tree; |
Input
newick: | (Input) | Newick's format tree |
Returns
Description
Creates a new general tree using a Newick's format phylogenetic tree
as input
See Also
See other functions in this section
Availability
In release 6.4.0
Creates a new string tree.
Synopsis
Prototype
AjPTree ajTreestrNew (
void
);
Type | Name | Read/Write | Description |
AjPTree | | RETURN | new tree; |
Returns
Description
Creates a new string tree.
See Also
See other functions in this section
Availability
In release 6.4.0
Copy a string tree.
WARNING: pointers to the data are copied, NOT the data
so be careful when cleaning up after copy.
Synopsis
Prototype
AjPTree ajTreestrCopy (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Tree to be copied |
AjPTree | | RETURN | New, copied, tree. |
Input
thys: | (Input) | Tree to be copied |
Returns
AjPTree: | New, copied, tree. |
Description
Copy a string tree.
WARNING: pointers to the data are copied, NOT the data
so be careful when cleaning up after copy.
See Also
See other functions in this section
Availability
In release 6.4.0
Copy a tree.
WARNING: pointers to the data are copied, NOT the data
so be careful when cleaning up after copy.
Synopsis
Prototype
AjPTree ajTreeCopy (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | tree to be copied |
AjPTree | | RETURN | new copied tree. |
Input
thys: | (Input) | tree to be copied |
Returns
Description
Copy a tree.
WARNING: pointers to the data are copied, NOT the data
so be careful when cleaning up after copy.
See Also
See other functions in this section
Availability
In release 6.4.0
get the number of nodes in the linked tree.
Synopsis
Prototype
ajuint ajTreeLength (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Tree |
ajuint | | RETURN | Number of nodes in tree. |
Input
Returns
ajuint: | Number of nodes in tree. |
Description
get the number of nodes in the linked tree.
See Also
See other functions in this section
Availability
In release 6.4.0
get the number of nodes in the linked tree.
Synopsis
Prototype
ajuint ajTreestrLength (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Tree |
ajuint | | RETURN | Number of nodes in tree. |
Input
Returns
ajuint: | Number of nodes in tree. |
Description
get the number of nodes in the linked tree.
See Also
See other functions in this section
Availability
In release 6.4.0
Free all nodes in the tree.
NOTE: The data is only freed with a specified tree type.
For undefined data types we recommend you to
use ajTreeMap with a routine to free the memory.
Synopsis
Prototype
void ajTreeFree (
AjPTree* pthis
);
Type | Name | Read/Write | Description |
AjPTree* | pthis | Delete | Tree |
void | | RETURN | |
Output
Returns
Description
Free all nodes in the tree.
NOTE: The data is only freed with a specified tree type.
For undefined data types we recommend you to
use ajTreeMap with a routine to free the memory.
See Also
See other functions in this section
Availability
In release 6.4.0
Free all nodes in a string tree.
Also deletes all the strings. If these are to be preserved,
use ajTreestrDel instead.
Synopsis
Prototype
void ajTreestrFree (
AjPTree* pthis
);
Type | Name | Read/Write | Description |
AjPTree* | pthis | Delete | Tree |
void | | RETURN | |
Output
Returns
Description
Free all nodes in a string tree.
Also deletes all the strings. If these are to be preserved,
use ajTreestrDel instead.
See Also
See other functions in this section
Availability
In release 6.4.0
Free the tree. Do not attempt to free the nodes.
For use where the node data has been saved elsewhere, for example
by ajTreeToArray or where the tree is a temporary structure
referring to permanent data.
Synopsis
Prototype
void ajTreeDel (
AjPTree* pthis
);
Type | Name | Read/Write | Description |
AjPTree* | pthis | Delete | Tree |
void | | RETURN | |
Output
Returns
Description
Free the tree. Do not attempt to free the nodes.
For use where the node data has been saved elsewhere, for example
by ajTreeToArray or where the tree is a temporary structure
referring to permanent data.
See Also
See other functions in this section
Availability
In release 6.4.0
Free the tree. Do not attempt to free the nodes.
For use where the node data has been saved elsewhere, for example
by ajTreeToArray or where the tree is a temporary structure
referring to permanent data.
Synopsis
Prototype
void ajTreestrDel (
AjPTree* pthis
);
Type | Name | Read/Write | Description |
AjPTree* | pthis | Delete | Tree |
void | | RETURN | |
Output
Returns
Description
Free the tree. Do not attempt to free the nodes.
For use where the node data has been saved elsewhere, for example
by ajTreeToArray or where the tree is a temporary structure
referring to permanent data.
See Also
See other functions in this section
Availability
In release 6.4.0
For each data node in the tree call function apply.
Synopsis
Prototype
void ajTreeMap (
AjPTree thys,
void function apply,
void* cl
);
Type | Name | Read/Write | Description |
AjPTree | thys | Modify | Tree. |
void function | apply | Function | Function to call for each tree item. |
void* | cl | Modify | Standard, usually NULL. |
void | | RETURN | |
Input
apply: | (Function) | Function to call for each tree item. |
Input & Output
thys: | (Modify) | Tree. |
cl: | (Modify) | Standard, usually NULL. |
Returns
Description
For each data node in the tree call function apply.
See Also
See other functions in this section
Availability
In release 6.4.0
For each node in the tree call function apply,
with the address of the string and a client pointer.
Synopsis
Prototype
void ajTreestrMap (
AjPTree thys,
void function apply,
void* cl
);
Type | Name | Read/Write | Description |
AjPTree | thys | Modify | Tree. |
void function | apply | Function | Function to call for each tree item. |
void* | cl | Modify | Standard, usually NULL. |
void | | RETURN | |
Input
apply: | (Function) | Function to call for each tree item. |
Input & Output
thys: | (Modify) | Tree. |
cl: | (Modify) | Standard, usually NULL. |
Returns
Description
For each node in the tree call function apply,
with the address of the string and a client pointer.
See Also
See other functions in this section
Availability
In release 6.4.0
Create an array of the pointers to the data.
Synopsis
Prototype
ajuint ajTreeToArray (
const AjPTree thys,
void*** array
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Tree |
void*** | array | Output | Array of pointers to tree items. |
ajuint | | RETURN | Size of array of pointers. |
Input
Output
array: | (Output) | Array of pointers to tree items. |
Returns
ajuint: | Size of array of pointers. |
Description
Create an array of the pointers to the data.
See Also
See other functions in this section
Availability
In release 6.4.0
Create an array of the pointers to the data.
Synopsis
Prototype
ajuint ajTreestrToArray (
const AjPTree thys,
AjPStr** array
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Tree |
AjPStr** | array | Output | Array of Strings. |
ajuint | | RETURN | Size of array of pointers. |
Input
Output
array: | (Output) | Array of Strings. |
Returns
ajuint: | Size of array of pointers. |
Description
Create an array of the pointers to the data.
See Also
See other functions in this section
Availability
In release 6.4.0
Dummy function to catch all unused functions defined in ajtree
Synopsis
Prototype
void ajTreeDummyFunction (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Dummy function to catch all unused functions defined in ajtree
See Also
See other functions in this section
Availability
In release 6.4.0
Sets the data value in a terminal tree node.
Synopsis
Prototype
AjBool ajTreeAddData (
AjPTree thys,
const AjPStr name,
void* data
);
Type | Name | Read/Write | Description |
AjPTree | thys | Modify | Terminal tree node. Must have no descendants |
const AjPStr | name | Input | Leaf name |
void* | data | Unknown | Data value |
AjBool | | RETURN | ajTrue on success |
Input
Input & Output
thys: | (Modify) | Terminal tree node. Must have no descendants |
Returns
Description
Sets the data value in a terminal tree node.
See Also
See other functions in this section
Availability
In release 6.4.0
Sets the data value in a terminal string tree node.
Synopsis
Prototype
AjBool ajTreestrAddData (
AjPTree thys,
const AjPStr name,
AjPStr data
);
Type | Name | Read/Write | Description |
AjPTree | thys | Modify | Terminal tree node. Must have no descendants |
const AjPStr | name | Input | Leaf name |
AjPStr | data | Unknown | Data value |
AjBool | | RETURN | ajTrue on success |
Input
Input & Output
thys: | (Modify) | Terminal tree node. Must have no descendants |
Returns
Description
Sets the data value in a terminal string tree node.
See Also
See other functions in this section
Availability
In release 6.4.0
Creates a new child node of the parent
Synopsis
Prototype
AjPTree ajTreeAddNode (
AjPTree thys
);
Type | Name | Read/Write | Description |
AjPTree | thys | Modify | Parent tree node |
AjPTree | | RETURN | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Input & Output
thys: | (Modify) | Parent tree node |
Returns
AjPTree: | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Description
Creates a new child node of the parent
See Also
See other functions in this section
Availability
In release 6.4.0
Creates a new sibling node of the parent
Synopsis
Prototype
AjPTree ajTreeAddSubNode (
AjPTree thys
);
Type | Name | Read/Write | Description |
AjPTree | thys | Modify | Left tree node |
AjPTree | | RETURN | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Input & Output
thys: | (Modify) | Left tree node |
Returns
AjPTree: | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Description
Creates a new sibling node of the parent
See Also
See other functions in this section
Availability
In release 6.4.0
Prints a trace of a tree to debug output
Synopsis
Prototype
void ajTreeToNewick (
const AjPTree thys,
AjPStr* Pnewick
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Tree object |
AjPStr* | Pnewick | Output | Newick format string |
void | | RETURN | |
Input
Output
Pnewick: | (Output) | Newick format string |
Returns
Description
Prints a trace of a tree to debug output
See Also
See other functions in this section
Availability
In release 6.4.0
Prints a trace of a tree to debug output
Synopsis
Prototype
void ajTreeTrace (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Tree object |
void | | RETURN | |
Input
Returns
Description
Prints a trace of a tree to debug output
See Also
See other functions in this section
Availability
In release 6.4.0
Prints a trace of a string tree to debug output
Synopsis
Prototype
void ajTreestrTrace (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Tree object |
void | | RETURN | |
Input
Returns
Description
Prints a trace of a string tree to debug output
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the next node through the tree.
Step down to children, and follow siblings to the right.
When done at any level, go up and right.
Stop when back up at the original parent node.
Synopsis
Prototype
AjPTree ajTreeFollow (
const AjPTree thys,
const AjPTree parent
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Current tree node |
const AjPTree | parent | Input | Parent tree node |
AjPTree | | RETURN | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Input
thys: | (Input) | Current tree node |
parent: | (Input) | Parent tree node |
Returns
AjPTree: | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Description
Returns the next node through the tree.
Step down to children, and follow siblings to the right.
When done at any level, go up and right.
Stop when back up at the original parent node.
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the next node at the same level
Synopsis
Prototype
AjPTree ajTreeNext (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Parent tree node |
AjPTree | | RETURN | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Input
thys: | (Input) | Parent tree node |
Returns
AjPTree: | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Description
Returns the next node at the same level
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the previous node at the same level
Synopsis
Prototype
AjPTree ajTreePrev (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Parent tree node |
AjPTree | | RETURN | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Input
thys: | (Input) | Parent tree node |
Returns
AjPTree: | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Description
Returns the previous node at the same level
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the next node down 1 level
Synopsis
Prototype
AjPTree ajTreeDown (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Parent tree node |
AjPTree | | RETURN | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Input
thys: | (Input) | Parent tree node |
Returns
AjPTree: | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Description
Returns the next node down 1 level
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the parent of the present node
Synopsis
Prototype
AjPTree ajTreeUp (
const AjPTree thys
);
Type | Name | Read/Write | Description |
const AjPTree | thys | Input | Child tree node |
AjPTree | | RETURN | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Input
thys: | (Input) | Child tree node |
Returns
AjPTree: | New tree node created. It has no data value so far,
so ajTreeAddNode or ajTreeAddData should be called to
define data or further nodes. |
Description
Returns the parent of the present node
See Also
See other functions in this section
Availability
In release 6.4.0
Prints a summary of tree usage with debug calls
Synopsis
Prototype
void ajTreeExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Prints a summary of tree usage with debug calls
See Also
See other functions in this section
Availability
In release 6.4.0