source: branches/port5/AWT/awt_nei.hxx

Last change on this file was 5708, checked in by westram, 15 years ago
  • backtrace gets printed to console from
    • GB_internal_error
    • SIGSEGV (currently GB_login installs the handler using GBK_install_SIGSEGV_handler. Most likely needs to be called manually for some executables)
    • GBK_terminate
  • added GBK_dump_backtrace, GBK_terminate and GBK_assert_msg
  • Default assertion dumps backtrace now
  • added -rdynamic and —export-dynamic compiler/linker flags, leaving symbols in code. This raises size of executables by approx. 8%, but we will get meaningful backtraces from users.
  • removed old inactive SIGSEGV code
  • replaced GB_CORE either by xx_assert() or GBK_terminate()
  • removed GBS_do_core (was used conditionally together with GB_CORE)
  • disabled crash provoked via arb_panic (using 'core' as savename)
  • Linkage changed:
    • The future plan is to try some kind of emergency save on open DBs when GBK_terminate or similar is called.
    • Since arb_assert calls GBK_terminate this affects ALL applications.
    • The drawback is all executables have to be linked vs ARBDB (done with: arb_help2xml and arb_convert_aln, all others already had ARBDB linked)
    • Molphy uses #define SIMPLE_ARB_ASSERT before including arb_assert.h
  • renamed define GBL_INCLUDED → ADLOCAL_H
  • added arbdb_base.h (defining some types and including ad_k_prot.h, which contains all GBK_*-functions). Intended as minimal and seldom changed interface to libARBDB as needed by arb_assert(), to keep build dependencies low.
  • arb_assert.h now automatically includes arbdb_base.h
  • trigger compilation of test functions in parsimony via define
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1// ================================================================ //
2//                                                                  //
3//   File      : awt_nei.hxx                                        //
4//   Purpose   :                                                    //
5//                                                                  //
6//   Institute of Microbiology (Technical University Munich)        //
7//   http://www.arb-home.de/                                        //
8//                                                                  //
9// ================================================================ //
10
11#ifndef AWT_NEI_HXX
12#define AWT_NEI_HXX
13
14#ifndef ARB_ASSERT_H
15#include <arb_assert.h>
16#endif
17
18#define ph_assert(cond) arb_assert(cond)
19
20class PH_NEIGHBOUR_DIST {
21public:
22    PH_NEIGHBOUR_DIST(void);
23    long    i,j;
24    AP_FLOAT val;
25    PH_NEIGHBOUR_DIST *next, *previous;
26    void remove(void) {
27        ph_assert(previous); // already removed
28        if (next) {next->previous = previous;}
29        previous->next = next;previous = 0;
30    };
31
32    void add(PH_NEIGHBOUR_DIST *root) {
33        next = root->next;
34        root->next = this;
35        previous = root;
36        if (next) next->previous = this;
37    };
38};
39
40class PH_NEIGHBOURJOINING {
41    PH_NEIGHBOUR_DIST **dist_matrix;
42    PH_NEIGHBOUR_DIST  *dist_list;   // array of dist_list lists
43    long                dist_list_size;
44    AP_FLOAT            dist_list_corr;
45    AP_FLOAT           *net_divergence;
46
47    long  size;
48    long *swap_tab;
49    long  swap_size;
50
51    AP_FLOAT get_max_di(AP_FLOAT **m);
52    void     remove_taxa_from_dist_list(long i);
53    void     add_taxa_to_dist_list(long j);
54    AP_FLOAT get_max_net_divergence(void);
55    void     remove_taxa_from_swap_tab(long i);
56
57public:
58
59    PH_NEIGHBOURJOINING(AP_FLOAT **m, long size);
60    ~PH_NEIGHBOURJOINING(void);
61
62    void     join_nodes(long i,long j,AP_FLOAT &leftl,AP_FLOAT& rightlen);
63    void     get_min_ij(long& i, long& j);
64    void     get_last_ij(long& i, long& j);
65    AP_FLOAT get_dist(long i, long j);
66};
67
68#else
69#error awt_nei.hxx included twice
70#endif // AWT_NEI_HXX
Note: See TracBrowser for help on using the repository browser.