biomcmc-lib  0.1
low level library for phylogenetic analysis
empirical_frequency.h
Go to the documentation of this file.
1 /*
2  * This file is part of biomcmc-lib, a low-level library for phylogenomic analysis.
3  * Copyright (C) 2019-today Leonardo de Oliveira Martins [ leomrtns at gmail.com; http://www.leomartins.org ]
4  *
5  * biomcmc is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
6  * License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
7  * version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
10  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11  * details (file "COPYING" or http://www.gnu.org/copyleft/gpl.html).
12  */
13 
21 #ifndef _biomcmc_empirical_frequency_h_
22 #define _biomcmc_empirical_frequency_h_
23 
24 #include "char_vector.h"
25 
26 typedef struct empfreq_struct* empfreq;
28 
29 typedef struct
30 {
31  int freq;
32  int idx;
34 
35 typedef struct
36 {
37  double freq;
38  int idx;
40 
42 {
43  empfreq_element *i;
44  int n;
45  int min;
46  int max;
48 };
49 
51 {
53  int n;
54  double min;
55  double max;
57 };
58 
59 void sort_empfreq_decreasing (empfreq ef);
60 void sort_empfreq_increasing (empfreq ef);
61 void sort_empfreq_double_decreasing (empfreq_double efd);
62 void sort_empfreq_double_increasing (empfreq_double efd);
63 
64 empfreq new_empfreq (int n_elements);
65 void del_empfreq (empfreq ef);
66 empfreq_double new_empfreq_double (int n_elements);
67 void del_empfreq_double (empfreq_double efd);
68 
69 empfreq new_empfreq_sort_decreasing (void *vec, int n, char type);
70 empfreq new_empfreq_sort_increasing (void *vec, int n, char type);
71 empfreq_double new_empfreq_double_sort_decreasing (double *vec, int n);
72 empfreq_double new_empfreq_double_sort_increasing (double *vec, int n);
73 
74 empfreq new_empfreq_from_int (int *vec, int n);
75 empfreq new_empfreq_from_int_weighted (int *vec, int n, int *weight);
76 int find_mode_int (int *vec, int n);
77 int find_mode_int_weighted (int *vec, int n, int *weight);
78 
79 
80 #endif
int max
Min value for index.
Definition: empirical_frequency.h:46
Definition: empirical_frequency.h:29
Definition: empirical_frequency.h:35
Definition: empirical_frequency.h:41
Definition: empirical_frequency.h:50
int ref_counter
Max value for index.
Definition: empirical_frequency.h:56
double max
Min value for index.
Definition: empirical_frequency.h:55
list of strings (each string is a vector of chars)
int ref_counter
Max value for index.
Definition: empirical_frequency.h:47