// This file is part of BULL, a program for phylogenetic simulations // most of the code was written by Mark T. Holder. // This program is for internal use by the lab of Dr. Tandy Warnow only. // Do not redistribute the code. It is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // // Some of the code is from publically available source by Paul Lewis, Ziheng Yang, // John Huelsenbeck, David Swofford , and others (as noted in the code). // In fact the main structure of the program was created by modifying Paul Lewis' // basiccmdline.cpp from his NCL // // This code was used in Mark's dissertation, some changes were made in order to // get it to compile on gcc. It is possible that this porting introduced bugs (very // little debugging has been done on UNIX platforms). I would suggest checking // the simulator by generating data on trees with short branches, etc. // This file is part of BULL, a program for phylogenetic simulations // most of the code was written by Mark T. Holder. // This program is for internal use by the lab of Dr. Tandy Warnow only. // Do not redistribute the code. It is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // // Some of the code is from publically available source by Paul Lewis, Ziheng Yang, // John Huelsenbeck, David Swofford , and others (as noted in the code). // In fact the main structure of the program was created by modifying Paul Lewis' // basiccmdline.cpp from his NCL // // This code was used in Mark's dissertation, some changes were made in order to // get it to compile on gcc. It is possible that this porting introduced bugs (very // little debugging has been done on UNIX platforms). I would suggest checking // the simulator by generating data on trees with short branches, etc. #ifndef SETSOFLIKEATTRIBUTES #define SETSOFLIKEATTRIBUTES #if defined HAVE_CONFIG_H && HAVE_CONFIG_H # include #endif #include "like_attributes.hpp" #include "part_mod_index.hpp" namespace bull { class SetOfLikeAttr { public: SetOfLikeAttr(int i); ~SetOfLikeAttr(); Model *GetModel(int p,int m) {return likeAttribs[p][m]->GetModel();} void SetNumModsInPart(int partnum,int modnum); void AddLikeAtt(int p,int m,LikeAttr *); int GetNParts() {return nparts;} int GetNModels(int i) {return nmods[i];} LikeAttr *GetLikeAtt(int p,int m) {return likeAttribs[p][m];} SetOfLikeAttr *Copy(); protected: int nmodparts; // number of partiotions+models int nparts;// number of partitions int *nmods; LikeAttr*** likeAttribs; }; class SetOfTreeSimAttr { public: int maxReps,nparts,*nmods,*nChar; SetOfTreeSimAttr(int i); ~SetOfTreeSimAttr(); void SetNumModsInPart(int partnum,int modnum); void AddAtt(int p,int m,TreeSimAttr *tsa); int GetNParts() {return nparts;} int GetNModels(int i) {return nmods[i];} Model *GetModel(int p,int m) {return simAttribs[p][m]->GetModel();} TreeSimAttr *GetSimAtt(int p,int m) {return simAttribs[p][m];} void SetModelMixingParam(int i,FreqParamGroup *mmp) { assert(modelMixingParam && i < nparts); modelMixingParam[i]=mmp; } void InitializeModelMixingParams(); void InitializeLikeAttrStatics(int partnum,int modn); int GetNCharInSimAttr(int p,int m) //should be NCharInEachDataSet * maxReps {return simAttribs[p][m]->GetNChar();} int GetNCharInEachDataSet(int p) {return nChar[p];} void SetNCharInEachDataSet(int p,int nc) { nChar[p]=nc; } int GetNStates(int p,int m) { return simAttribs[p][m]->GetNStates(); } void PrintModel(std::ostream &usrstream); bool GetOwnsBrLengths(bull::PartModIndex pmi) { return simAttribs[pmi.partNum][pmi.modNum]->GetOwnsBrLen(); } protected: int nmodparts;//number of partitions+models, and number of partitions TreeSimAttr*** simAttribs; FreqParamGroup **modelMixingParam; friend class Tree; }; } // namespace bull #endif