/usr/include/libphylo/suffStatComponent.h is in rate4site 3.0.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | // $Id: suffStatComponent.h 9253 2011-01-31 01:37:21Z rubi $
#ifndef ___SUFF_STAT_COMPONENT
#define ___SUFF_STAT_COMPONENT
#include "definitions.h"
#include <vector>
using namespace std;
// spec = for a specific node. global = for all the nodes
// hom = no rate variation. gam = with rate variation. gamProportional = with gobal and local rate variation
// pos = for one position
//-------------------------------------------------------------
class suffStatSpecHomPos{ // this is for a specific node.
public:
void set(const int letter,const doubleRep& val) {
_V[letter]=val;
}
doubleRep get(const int letter) const {
doubleRep tmp=_V[letter];
// cout << "tmp =";
// tmp.outputn(cout);
return tmp;
}
void allocatePlace(const int alphabetSize) {
_V.resize(alphabetSize);
}
bool isEmpty (){return (_V.empty());};
int size() const {return _V.size();}
private:
vector<doubleRep> _V;//size = letter
};
//-------------------------------------------------------------
/*
class suffStatSpecGamPos{// this is for a specific node with rates
public:
void set(const int rateCategor,
const int letter,const MDOUBLE val) {
_V[rateCategor].set(letter,val);
}
MDOUBLE get(const int rateCategor,
const int letter) const {
return _V[rateCategor].get(letter);
}
void allocatePlace(const int numberOfrateCategories,const int alphabetSize) {
_V.resize(numberOfrateCategories);
for (int i=0; i < numberOfrateCategories; ++i) {
_V[i].allocatePlace(alphabetSize);
}
}
bool isEmpty (){return (_V.empty());};
private:
vector<suffStatSpecHomPos> _V;//rateCategor,letter
};
*/
//-------------------------------------------------------------
/*
class suffStatSpecGam{// this is for a specific node with rates
public:
void set(const int pos,const int rateCategor,
const int letter,const MDOUBLE val) {
_V[pos].set(rateCategor,letter,val);
}
MDOUBLE get(const int pos,const int rateCategor,
const int letter) const {
return _V[pos].get(rateCategor,letter);
}
void allocatePlace(const int pos,const int numberOfrateCategories,const int alphabetSize) {
_V.resize(pos);
for (int i=0;i<pos;++i) _V[i].allocatePlace(numberOfrateCategories,alphabetSize);
}
bool isEmpty (){return (_V.empty());};
suffStatSpecGamPos& operator[] (int index) {return _V[index];}
const suffStatSpecGamPos& operator[] (int index) const {return _V[index];}
private:
vector<suffStatSpecGamPos> _V;//pos,rateCategor,letter
};
*/
//-------------------------------------------------------------
/*
class suffStatGlobalGam {
public:
MDOUBLE get(const int nodeId, const int pos,const int rateCategor,
const int letter) const {
return _V[nodeId].get(pos,rateCategor,letter);
}
void allocatePlace(const int numOfNodes,
const int pos,
const int numberOfrateCategories,
const int alphabetSize) {
_V.resize(numOfNodes);
for (int i=0;i<numOfNodes;++i) _V[i].allocatePlace(pos,numberOfrateCategories,alphabetSize);
}
int size() const {return _V.size();}
suffStatSpecGam& operator[] (int index) {return _V[index];}
const suffStatSpecGam& operator[] (int index) const {return _V[index];}
private:
vector<suffStatSpecGam> _V;
};
*/
//-------------------------------------------------------------
class suffStatGlobalHomPos{ // this is for all nodes
public:
void set(const int nodeId,const int letter,const doubleRep val) {
_V[nodeId].set(letter,val);
}
doubleRep get(const int nodeId,const int letter) const {
doubleRep tmp(_V[nodeId].get(letter));
// tmp;
// cout << "tmp2=";
// tmp.outputn(cout);
return tmp;
}
void allocatePlace(const int numOnNodes,const int alphabetSize) {
_V.resize(numOnNodes);
for (int i=0;i<_V.size();++i) {_V[i].allocatePlace(alphabetSize);}
}
bool isEmpty (){return (_V.empty());};
int size() const {return _V.size();}
private:
vector<suffStatSpecHomPos> _V;//size = number of nodes.
};
//-------------------------------------------------------------
class suffStatGlobalGamPos{ // this is for all nodes
public:
void set(const int categor,const int nodeId,const int letter,const doubleRep val) {
_V[categor].set(nodeId,letter,val);
}
doubleRep get(const int categor,const int nodeId,const int letter) const {
return _V[categor].get(nodeId,letter);
}
void allocatePlace(const int categor,const int numOnNodes,const int alphabetSize) {
_V.resize(categor);
for (int i=0;i<_V.size();++i) {_V[i].allocatePlace(numOnNodes,alphabetSize);}
}
bool isEmpty (){return (_V.empty());}
int size() const {return _V.size();}
suffStatGlobalHomPos& operator[] (int index) {return _V[index];}
const suffStatGlobalHomPos& operator[] (int index) const {return _V[index];}
private:
vector<suffStatGlobalHomPos> _V;//size = number of categories
};
//-------------------------------------------------------------
class suffStatGlobalGamProportionalPos{ // this is for all nodes
public:
void set(const int globalRateCategor,const int localRateCategor,const int nodeId,const int letter,const doubleRep val) {
_V[globalRateCategor].set(localRateCategor,nodeId,letter,val);
}
doubleRep get(const int globalRateCategor,const int localRateCategor,const int nodeId,const int letter) const {
return _V[globalRateCategor].get(localRateCategor,nodeId,letter);
}
void allocatePlace(const int globalRateCategor,const int localRateCategor,const int numOnNodes,const int alphabetSize) {
_V.resize(globalRateCategor);
for (int i=0;i<_V.size();++i) {_V[i].allocatePlace(localRateCategor,numOnNodes,alphabetSize);}
}
bool isEmpty (){return (_V.empty());}
int size() const {return _V.size();}
suffStatGlobalGamPos& operator[] (int index) {return _V[index];}
const suffStatGlobalGamPos& operator[] (int index) const {return _V[index];}
private:
vector<suffStatGlobalGamPos> _V;//size = number of global rate categories
};
//-------------------------------------------------------------
class suffStatGlobalGam{ // this is for all positions (and for all nodes).
public:
void set(const int pos,const int categor,const int nodeId,const int letter,const doubleRep val) {
_V[pos].set(categor,nodeId,letter,val);
}
doubleRep get(const int pos,const int categor,const int nodeId,const int letter) const {
return _V[pos].get(categor,nodeId,letter);
}
void allocatePlace(const int pos,const int categor,const int numOnNodes,const int alphabetSize) {
_V.resize(pos);
for (int i=0;i<_V.size();++i) {_V[i].allocatePlace(categor,numOnNodes,alphabetSize);}
}
bool isEmpty (){return (_V.empty());}
int size() const {return _V.size();}
suffStatGlobalGamPos& operator[] (int index) {return _V[index];}
const suffStatGlobalGamPos& operator[] (int index) const {return _V[index];}
private:
vector<suffStatGlobalGamPos> _V;
};
//-------------------------------------------------------------
class suffStatGlobalGamProportional{ // this is for all positions (and for all nodes).
public:
void set(const int pos,const int globalRateCategor,const int localRateCategor,const int nodeId,const int letter,const doubleRep val) {
_V[pos].set(globalRateCategor,localRateCategor,nodeId,letter,val);
}
doubleRep get(const int pos,const int globalRateCategor,const int localRateCategor,const int nodeId,const int letter) const {
return _V[pos].get(globalRateCategor,localRateCategor,nodeId,letter);
}
void allocatePlace(const int pos,const int globalRateCategor,const int localRateCategor,const int numOnNodes,const int alphabetSize) {
_V.resize(pos);
for (int i=0;i<_V.size();++i) {_V[i].allocatePlace(globalRateCategor,localRateCategor,numOnNodes,alphabetSize);}
}
bool isEmpty (){return (_V.empty());}
int size() const {return _V.size();}
suffStatGlobalGamProportionalPos& operator[] (int index) {return _V[index];}
const suffStatGlobalGamProportionalPos& operator[] (int index) const {return _V[index];}
private:
vector<suffStatGlobalGamProportionalPos> _V;
};
// from ItayM not to use with the EM algorithm.
class suffStatGlobalHom{ // this is for all positions (and for all nodes).
public:
void set(const int pos, const int nodeId, const int letter,const doubleRep val) {
_V[pos].set(nodeId, letter, val);
}
doubleRep get(const int pos, const int nodeId, const int letter) const {
return _V[pos].get(nodeId, letter);
}
void allocatePlace(const int pos, const int numOnNodes, const int alphabetSize) {
_V.resize(pos);
for (int i=0;i<_V.size();++i) {_V[i].allocatePlace(numOnNodes, alphabetSize);}
}
bool isEmpty (){return (_V.empty());};
suffStatGlobalHomPos& operator[] (int index) {return _V[index];}
const suffStatGlobalHomPos& operator[] (int index) const {return _V[index];}
private:
vector<suffStatGlobalHomPos> _V;
};
#endif
|