00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(NXS_C_DISCRETE_MATRIX_H)
00022 #define NXS_C_DISCRETE_MATRIX_H
00023
00024
00025 #if defined (HAVE_CONFIG_H)
00026 # include <config.h>
00027 #endif
00028
00029 #if defined(_MSC_VER)
00030 # undef HAVE_COMPILE_TIME_DISPATCH
00031 #else
00032 # define HAVE_COMPILE_TIME_DISPATCH
00033 #endif
00034
00035
00036 #if HAVE_INTTYPES_H
00037 # include <inttypes.h>
00038 #elif HAVE_STDINT_H
00039 # include <stdint.h>
00040 #elif defined(_MSC_VER) && _MSC_VER >= 1200
00041 # include <basetsd.h>
00042 typedef INT8 int8_t;
00043 typedef UINT8 uint8_t;
00044 typedef INT64 int64_t;
00045 typedef UINT64 uint64_t;
00046 #elif defined(_MSC_VER)
00047 typedef signed char int8_t;
00048 typedef unsigned char uint8_t;
00049 typedef long long int64_t;
00050 typedef unsigned long long uint64_t;
00051 #elif defined(_WIN32)
00052 # include <stdint.h>
00053 #endif
00054
00055
00056 #if defined(HAVE_STDDEF_H)
00057 # include <stddef.h>
00058 #endif
00059
00060
00061 #ifdef __cplusplus
00062 extern "C"
00063 {
00064 #endif
00065
00066
00067 typedef int8_t NxsCDiscreteState_t;
00070 typedef int8_t NxsCDiscreteStateSet;
00074
00075
00076
00077
00078
00079
00080
00081
00082 typedef enum {
00083 NxsAltGeneric_Datatype = 1,
00084 NxsAltDNA_Datatype = 2,
00085 NxsAltRNA_Datatype = 3,
00086 NxsAltNuc_Datatype = 4,
00087 NxsAltAA_Datatype = 5,
00088 NxsAltCodon_Datatype = 6
00089 } NxsAltDatatypes;
00090 const int LowestNxsCDatatype = 1;
00091 const int HighestNxsCDatatype = 6;
00092
00093 typedef struct NxsCDiscreteMatrixStruct
00094 {
00095 NxsCDiscreteState_t *stateList;
00097 unsigned * stateListPos;
00098 NxsCDiscreteStateSet ** matrix;
00099 const char * symbolsList;
00100 unsigned nStates;
00101 unsigned nChar;
00102 unsigned nTax;
00103 unsigned nObservedStateSets;
00104 NxsAltDatatypes datatype;
00105 } NxsCDiscreteMatrix;
00106
00107
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111
00112 #endif
00113