Commit d640fabf authored by Iakov Davydov's avatar Iakov Davydov
Browse files

apply formatting to 5e1e24c9

parent 14e81146
......@@ -27,12 +27,12 @@ void *alignedMalloc(size_t aSize, size_t aAlignment) {
#ifdef _MSC_VER
#if 0
--aAlignment;
uintptr_t r = reinterpret_cast<uintptr_t>(malloc(aSize + aAlignment + sizeof(uintptr_t)));
if(!r) return NULL;
uintptr_t t = r + sizeof(uintptr_t);
uintptr_t o = (t + aAlignment) & ~static_cast<uintptr_t>(aAlignment);
reinterpret_cast<uintptr_t*>(o)[-1] = r;
return reinterpret_cast<void*>(o);
uintptr_t r = reinterpret_cast<uintptr_t>(malloc(aSize + aAlignment + sizeof(uintptr_t)));
if(!r) return NULL;
uintptr_t t = r + sizeof(uintptr_t);
uintptr_t o = (t + aAlignment) & ~static_cast<uintptr_t>(aAlignment);
reinterpret_cast<uintptr_t*>(o)[-1] = r;
return reinterpret_cast<void*>(o);
#endif
return _aligned_malloc(aSize, aAlignment);
#else
......@@ -48,7 +48,7 @@ void alignedFree(void *aPtr) {
return;
#ifdef _MSC_VER
#if 0
free(reinterpret_cast<void*>(reinterpret_cast<uintptr_t*>(aPtr)[-1]));
free(reinterpret_cast<void*>(reinterpret_cast<uintptr_t*>(aPtr)[-1]));
#endif
_aligned_free(aPtr);
#else
......@@ -66,32 +66,32 @@ void alignedFree(void *aPtr) {
int main()
{
using namespace std;
using namespace std;
cout << "Constructing l:" << endl;
cout << "Constructing l:" << endl;
vector<double, AlignedAllocator<double, 8> > l;
vector<double, AlignedAllocator<double, 8> > l;
l.reserve(10);
cout << endl << "l.push_back(1729):" << endl;
cout << endl << "l.push_back(1729):" << endl;
l.push_back(1729.);
l.push_back(1729.);
cout << endl << "l.push_back(2161):" << endl;
cout << endl << "l.push_back(2161):" << endl;
l.push_back(2161.);
l.push_back(2161.);
cout << endl;
cout << endl;
double* p = &l[0];
int x = reinterpret_cast<int>(p);
cout << "Aligned on 16: " << x%16 << endl;
cout << "Aligned on 8: " << x%8 << endl;
cout << "Aligned on 4: " << x%4 << endl;
cout << endl;
cout << "Aligned on 8: " << x%8 << endl;
cout << "Aligned on 4: " << x%4 << endl;
cout << endl;
for (vector<double, AlignedAllocator<double, 8> >::const_iterator i = l.begin(); i != l.end(); ++i) {
cout << "Element: " << *i << endl;
}
for (vector<double, AlignedAllocator<double, 8> >::const_iterator i = l.begin(); i != l.end(); ++i) {
cout << "Element: " << *i << endl;
}
cout << endl << "Destroying l:" << endl;
cout << endl << "Destroying l:" << endl;
}
#endif
......@@ -4,7 +4,7 @@
// The following headers are required for all allocators.
#include <cstddef> // Required for size_t and ptrdiff_t and NULL
//#include <new> // Required for placement new and std::bad_alloc
//#include <new> // Required for placement new and std::bad_alloc
#include <stdexcept> // Required for std::length_error
#include "AlignedMalloc.h"
......@@ -14,9 +14,9 @@
/// Example allocation aligned to 64: std::vector<double,
/// AlignedAllocator<double, 64> > aligned_vector;
///
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-22 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-22 (initial version)
/// @version 1.1
///
template <typename T, size_t A> class AlignedAllocator {
public:
......@@ -96,7 +96,7 @@ public:
// AlignedAllocator prints a diagnostic message to demonstrate
// what it's doing. Real allocators won't do this.
// std::cout << "Allocating " << n << (n == 1 ? " object" : " objects")
// << " of size " << sizeof(T) << " aligned on " << A << std::endl;
// << " of size " << sizeof(T) << " aligned on " << A << std::endl;
// The return value of allocate(0) is unspecified.
// AlignedAllocator returns NULL in order to avoid depending
......@@ -129,7 +129,7 @@ public:
// AlignedAllocator prints a diagnostic message to demonstrate
// what it's doing. Real allocators won't do this.
// std::cout << "Deallocating " << n << (n == 1 ? " object" : " objects")
// << " of size " << sizeof(T) << "." << std::endl;
// << " of size " << sizeof(T) << "." << std::endl;
// AlignedAllocator wraps aligned free().
alignedFree(p);
......
......@@ -46,11 +46,11 @@ double BayesTest::getGridParams(const std::vector<double> &aVars,
// Calculating f(x_h|w)
// Order of site classes for iw or f(x_h|w):
// back fore #sets
// site class 0: w0 w0 10
// site class 1: w1=1 w1=1 1
// site class 2a: w0 w2 100
// site class 2b: w1=1 w2 10
// back fore #sets
// site class 0: w0 w0 10
// site class 1: w1=1 w1=1 1
// site class 2a: w0 w2 100
// site class 2b: w1=1 w2 10
//
for (unsigned int iw = 0; iw < BEB_NUM_CAT; ++iw) {
if (iw < BEB_N1D) // class 0: w0 w0
......@@ -219,8 +219,7 @@ void BayesTest::computeBEB(const std::vector<double> &aVars, size_t aFgBranch,
}
}
// Calculate marginal prob of data, fX, and postpara[]. scale2 is
// scale.
// Calculate marginal prob of data, fX, and postpara[]. scale2 is scale.
if (mVerbose >= VERBOSE_ONLY_RESULTS)
std::cout << std::endl
<< "Calculating f(X), the marginal probability of data."
......@@ -337,7 +336,7 @@ void BayesTest::computeBEB(const std::vector<double> &aVars, size_t aFgBranch,
if (mVerbose >= VERBOSE_ONLY_RESULTS)
std::cout << "log(fX) = " << (fX + scale1 - BEB_DIMS * log(BEB_N1D * 1.))
<< " Scales = " << scale1 << " " << scale2 << std::endl;
<< " Scales = " << scale1 << " " << scale2 << std::endl;
// Calculate posterior probabilities for sites. scale1 is scale factor
if (mVerbose >= VERBOSE_ONLY_RESULTS)
......
......@@ -35,9 +35,9 @@ public:
/// Tests to find the sites under positive selection.
///
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-22 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-22 (initial version)
/// @version 1.1
///
class BayesTest {
public:
......@@ -102,19 +102,18 @@ private:
///
///@verbatim
/// Order of site classes for iw or f(x_h|w):
/// back fore num.sets
/// back fore num.sets
/// Branchsite A (121 sets)
/// site class 0: w0 w0 10
/// site class 1: w1=1 w1=1 1
/// site class 2a: w0 w2 100
/// site class 2b: w1=1 w2 10
/// site class 0: w0 w0 10
/// site class 1: w1=1 w1=1 1
/// site class 2a: w0 w2 100
/// site class 2b: w1=1 w2 10
///@endverbatim
///
/// @param[in] aVars The variables optimized at the end of the H1 run.
/// @param[in] aSiteMultiplicity The site multiplicity vector.
/// @param[in] aFgBranch The foreground branch under test.
/// @param[in] aScales The two scales ([0] bg; [1] fg) to rescale the
/// branch
/// @param[in] aScales The two scales ([0] bg; [1] fg) to rescale the branch
/// lengths. They are computed in H1.
///
/// @return The computed scale.
......
......@@ -210,17 +210,16 @@ void BranchSiteModel::printVar(const std::vector<double> &aVars, double aLnl,
aOut << " w0: " << *ix;
break;
case 3:
aOut << " k: " << *ix;
aOut << " k: " << *ix;
break;
case 4:
aOut << " w2: " << *ix;
break;
/*default:
aOut << *ix << ' ';
++per_linea;
if(per_linea == 10) {if(k != -1) aOut << std::endl; per_linea =
0;}
break;*/
aOut << *ix << ' ';
++per_linea;
if(per_linea == 10) {if(k != -1) aOut << std::endl; per_linea = 0;}
break;*/
}
}
} else {
......@@ -244,7 +243,7 @@ void BranchSiteModel::printVar(const std::vector<double> &aVars, double aLnl,
aOut << " w0: " << *ix;
break;
case 3:
aOut << " k: " << *ix;
aOut << " k: " << *ix;
break;
case 4:
aOut << " w2: " << *ix;
......@@ -954,9 +953,9 @@ double BranchSiteModelNullHyp::combineSiteLikelihoods(void) {
for (size_t site = 0; site < num_sites; ++site) {
// The following computation is split to avoid negative values
// double p = mProportions[0]*mLikelihoods[0*num_sites+site] +
// (mProportions[1]+mProportions[3])*mLikelihoods[1*num_sites+site]
// (mProportions[1]+mProportions[3])*mLikelihoods[1*num_sites+site]
//+
// mProportions[2]*mLikelihoods[2*num_sites+site];
// mProportions[2]*mLikelihoods[2*num_sites+site];
double p = likelihoods[0 * num_sites + site];
if (p < 0)
p = 0;
......@@ -1476,9 +1475,9 @@ double BranchSiteModelAltHyp::combineSiteLikelihoods(void) {
for (size_t site = 0; site < num_sites; ++site) {
// The following computation is split to avoid negative values
// double p = mProportions[0]*mLikelihoods[0*num_sites+site] +
// mProportions[1]*mLikelihoods[1*num_sites+site] +
// mProportions[2]*mLikelihoods[2*num_sites+site] +
// mProportions[3]*mLikelihoods[3*num_sites+site];
// mProportions[1]*mLikelihoods[1*num_sites+site] +
// mProportions[2]*mLikelihoods[2*num_sites+site] +
// mProportions[3]*mLikelihoods[3*num_sites+site];
//
double p = likelihoods[0 * num_sites + site];
if (p < 0)
......@@ -1534,10 +1533,9 @@ void BranchSiteModel::verifyOptimizerAlgo(unsigned int aOptimizationAlgo) {
/// Adapter class to pass the routine to the optimizer.
///
/// @author Mario Valle - Swiss National Supercomputing Centre
///(CSCS)
/// @date 2011-01-13 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2011-01-13 (initial version)
/// @version 1.1
///
///
class MaximizerFunction {
......@@ -1749,7 +1747,7 @@ double BranchSiteModel::maximizeLikelihood(size_t aFgBranch, bool aStopIfBigger,
if (mTrace) {
std::cout << std::endl
<< "Function invocations: " << mNumEvaluations
<< "Function invocations: " << mNumEvaluations
<< std::endl;
std::cout << "Final log-likelihood value: " << maxl << std::endl;
printVar(mVar);
......@@ -1865,7 +1863,7 @@ double BranchSiteModel::maximizeLikelihood(size_t aFgBranch, bool aStopIfBigger,
// Print the final optimum value
if (mTrace) {
std::cout << std::endl
<< "Function invocations: " << mNumEvaluations
<< "Function invocations: " << mNumEvaluations
<< std::endl;
switch (result) {
case nlopt::SUCCESS:
......@@ -1952,7 +1950,7 @@ double BranchSiteModel::maximizeLikelihood(size_t aFgBranch, bool aStopIfBigger,
/// @section w0_sect Omega 0
/// The `w0` value is at index `mNumTimes+2`
///
/// @section k_sect Kappa
/// @section k_sect Kappa
/// The `k` value is at index `mNumTimes+3`
///
/// @section w2_sect Omega 2
......
......@@ -16,10 +16,9 @@ static const double THRESHOLD_FOR_LRT = 1.92072941034706202;
/// Common routines for testing the two hypotheses (H0 and H1).
///
/// @author Mario Valle - Swiss National Supercomputing Centre
///(CSCS)
/// @date 2010-12-23 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-23 (initial version)
/// @version 1.1
///
class BranchSiteModel {
protected:
......@@ -395,10 +394,9 @@ private:
/// Null Hypothesis test.
///
/// @author Mario Valle - Swiss National Supercomputing Centre
///(CSCS)
/// @date 2010-12-23 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-23 (initial version)
/// @version 1.1
///
///
class BranchSiteModelNullHyp : public BranchSiteModel {
......@@ -497,10 +495,9 @@ private:
/// Alternate Hypothesis test.
///
/// @author Mario Valle - Swiss National Supercomputing Centre
///(CSCS)
/// @date 2010-12-23 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-23 (initial version)
/// @version 1.1
///
///
class BranchSiteModelAltHyp : public BranchSiteModel {
......
......@@ -67,7 +67,7 @@ void CmdLine::CmdLineImpl::showHelp(const CSimpleOpt::SOption *aParserOptions) {
if (done[j] || aParserOptions[j].nId != aParserOptions[i].nId)
continue;
done[j] = true;
std::cout << " " << aParserOptions[j].pszArg;
std::cout << " " << aParserOptions[j].pszArg;
}
// Translate the kind of argument
......@@ -96,7 +96,7 @@ void CmdLine::CmdLineImpl::showHelp(const CSimpleOpt::SOption *aParserOptions) {
}
std::cout << " " << type << std::endl;
std::cout << " " << aParserOptions[i].pszHelp << std::endl
std::cout << " " << aParserOptions[i].pszHelp << std::endl
<< std::endl;
}
}
......@@ -291,7 +291,7 @@ void CmdLine::parseCmdLine(int aCnt, char **aVal) {
<< "FastCodeML V" << version << std::endl
<< "------------------" << std::endl;
std::cout << "Usage:" << std::endl;
std::cout << " " << usage_msg << std::endl
std::cout << " " << usage_msg << std::endl
<< std::endl;
mCmdLineImpl->showHelp(parser_options);
throw FastCodeMLSuccess();
......@@ -425,7 +425,7 @@ void CmdLine::parseCmdLine(int aCnt, char **aVal) {
case OPT_NUM_THREADS:
mNumThreads = static_cast<unsigned int>(atoi(args.OptionArg()));
/* if (mNumThreads == 1)
mForceSerial = true;*/
mForceSerial = true;*/
if (mNumThreads <= 0)
throw FastCodeMLFatal("Invalid number of threads");
break;
......@@ -455,7 +455,7 @@ void CmdLine::parseCmdLine(int aCnt, char **aVal) {
<< "FastCodeML V" << version << std::endl
<< "------------------" << std::endl;
std::cout << "Usage:" << std::endl;
std::cout << " " << usage_msg << std::endl
std::cout << " " << usage_msg << std::endl
<< std::endl;
mCmdLineImpl->showHelp(parser_options);
throw FastCodeMLFatal();
......
......@@ -15,10 +15,9 @@ static const unsigned int MAX_ITERATIONS = 10000;
/// Parse the command line flags.
///
/// @author Mario Valle - Swiss National Supercomputing Centre
///(CSCS)
/// @date 2010-12-22 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-22 (initial version)
/// @version 1.1
///
///
class CmdLine {
......
......@@ -82,10 +82,10 @@ int Ming2::ming2(FILE *fout, double *f, double x[], const double xl[],
const double xu[], double space[], int ispace[],
double rel_error, int n) {
/* n-variate minimization with bounds using the BFGS algorithm
g0[n] g[n] p[n] x0[n] y[n] s[n] z[n] H[n*n] C[n*n] tv[2*n]
xmark[n],ix[n]
g0[n] g[n] p[n] x0[n] y[n] s[n] z[n] H[n*n] C[n*n] tv[2*n]
xmark[n],ix[n]
Size of space should be (check carefully?)
#define spaceming2(n) ((n)*((n)*2+9+2)*sizeof(double))
#define spaceming2(n) ((n)*((n)*2+9+2)*sizeof(double))
nfree: # free variables
xmark[i]=0 for inside space; -1 for lower boundary; 1 for upper boundary.
x[] has initial values at input and returns the estimates in return.
......@@ -120,8 +120,8 @@ int Ming2::ming2(FILE *fout, double *f, double x[], const double xl[],
// Initialize the two integer workspaces
// for(i = 0; i < n; i++)
//{
// xmark[i] = 0;
// ix[i] = i;
// xmark[i] = 0;
// ix[i] = i;
//}
memset(ispace, 0, 2 * n * sizeof(int));
......@@ -333,10 +333,10 @@ int Ming2::ming2(FILE *fout, double *f, double x[], const double xl[],
}
// for(i=0; i < n; ++i)
// {
// g0[i] = g[i];
// x0[i] = x[i];
// }
// {
// g0[i] = g[i];
// x0[i] = x[i];
// }
memcpy(g0, g, n * sizeof(double));
memcpy(x0, x, n * sizeof(double));
/* renewal of H varies with different algorithms */
......@@ -425,12 +425,12 @@ double Ming2::LineSearch2(double *f, const double x0[], const double p[],
int iround, int n) {
/* linear search using quadratic interpolation
from x0[] in the direction of p[],
x = x0 + a*p a ~(0,limit)
returns (a). *f: f(x0) for input and f(x) for output
x = x0 + a*p a ~(0,limit)
returns (a). *f: f(x0) for input and f(x) for output
x0[n] x[n] p[n] space[n]
adapted from Wolfe M. A. 1978. Numerical methods for unconstrained
adapted from Wolfe M. A. 1978. Numerical methods for unconstrained
optimization: An introduction. Van Nostrand Reinhold Company, New York.
pp. 62-73.
step is used to find the bracket and is increased or reduced as necessary,
......@@ -530,7 +530,7 @@ double Ming2::LineSearch2(double *f, const double x0[], const double p[],
/* iteration by quadratic interpolation, fig 2.2.9-10 (pp 71-71) */
for (ii = 0; ii < maxround; ii++) {
/* a4 is the minimum from the parabola over (a1,a2,a3) */
/* a4 is the minimum from the parabola over (a1,a2,a3) */
a4 = (a2 - a3) * f1 + (a3 - a1) * f2 + (a1 - a2) * f3;
if (fabs(a4) > 1e-100)
......@@ -751,7 +751,7 @@ void Ming2::gradientB(int n, const double x[], double f0, double g[],
(eh * 2.0);
} else /* forward or backward */
{
// for(j=0; j < n; ++j) x1[j] = x[j];
// for(j=0; j < n; ++j) x1[j] = x[j];
memcpy(x1, x, n * sizeof(double));
if (xmark[i]) {
......
......@@ -8,11 +8,10 @@
/// Minimizer from CodeML.
///
/// @author Mario Valle - Swiss National Supercomputing Centre
///(CSCS)
/// based on code from Ziheng Yang CodeML.
/// @date 2012-01-11 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS) based
/// on code from Ziheng Yang CodeML.
/// @date 2012-01-11 (initial version)
/// @version 1.1
///
class Ming2 {
public:
......@@ -129,10 +128,10 @@ private:
/// Linear search using quadratic interpolation from x0[] in the direction of
/// p[].
/// The formula used is:
/// x = x0 + a*p a ~(0,limit)
/// x = x0 + a*p a ~(0,limit)
///
/// Adapted from: Wolfe M. A. 1978. Numerical methods for unconstrained
/// optimization: An introduction. Van Nostrand Reinhold Company, New York.
/// optimization: An introduction. Van Nostrand Reinhold Company, New York.
/// pp. 62-73.
///
/// @param[in,out] f Contains f(x0) for input and f(x) for output
......@@ -146,7 +145,7 @@ private:
/// @param[in] iround Iteration number just for reporting
/// @param[in] n Number of coordinates
///
/// @return The value of a as in: x = x0 + a*p a ~(0,limit)
/// @return The value of a as in: x = x0 + a*p a ~(0,limit)
///
double LineSearch2(double *f, const double x0[], const double p[],
double step, double limit, double e, double space[],
......
......@@ -16,10 +16,9 @@ static const double GOOD_CODON_THRESHOLD = 1e-100;
/// Compute and distribute codon empirical frequencies.
///
/// @author Mario Valle - Swiss National Supercomputing Centre
///(CSCS)
/// @date 2011-10-24 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2011-10-24 (initial version)
/// @version 1.1
///
class CodonFrequencies {
public:
......
......@@ -4,16 +4,16 @@
#if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || \
defined(__ECC)
// Intel
// Intel
#define ALIGN64 __declspec(align(64))
#define RESTRICT restrict
//#define PURE __declspec(const)
//#define PURE __declspec(const)
#elif defined(__GNUC__)
// GNU C++
// GNU C++
#define ALIGN64 __attribute__((aligned(64)))
#define RESTRICT __restrict__
//#define PURE __attribute__ ((pure))
//#define PURE __attribute__ ((pure))
#elif defined(_MSC_VER)
// Microsoft Visual C++
......@@ -22,16 +22,16 @@
//#define PURE
#elif defined(__PGI)
// PGI C++
// PGI C++
#define ALIGN64 //__attribute__ ((aligned (64)))
#define RESTRICT restrict
//#define PURE __attribute__ ((pure))
//#define PURE __attribute__ ((pure))
#elif defined(_CRAYC)
// Cray C++
// Cray C++
#define ALIGN64 __attribute__((aligned(64)))
#define RESTRICT restrict
//#define PURE __attribute__ ((pure))
//#define PURE __attribute__ ((pure))
#elif defined(__MTA__)
// Cray XMT
......
......@@ -9,9 +9,9 @@
/// The high-performance DAG scheduler. Visits the DAG obeying the dependencies.
///
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2012-05-14 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2012-05-14 (initial version)
/// @version 1.1
///
class DAGScheduler {
public:
......
......@@ -269,7 +269,7 @@ void FatVectorTransform::printCommands(void) const {
<< icr->to << std::endl;
}
std::cout << "L from: " << mLimits[b].first
std::cout << "L from: " << mLimits[b].first
<< " cnt: " << mLimits[b].second << std::endl;
}
}
......
......@@ -9,10 +9,9 @@
/// Manipulations on the per-branch probability vector array.
///
/// @author Mario Valle - Swiss National Supercomputing Centre
///(CSCS)
/// @date 2011-09-31 (initial version)
/// @version 1.1
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2011-09-31 (initial version)
/// @version 1.1
///
class FatVectorTransform {
public:
......
......@@ -195,7 +195,7 @@ void Forest::postLoad(void) {
std::vector<ForestNode*>::const_iterator ifn;
for(ifn=rinbl->begin(); ifn != rinbl->end(); ++ifn)
{
std::cout << (*ifn)->mBranchId << ((*ifn)->mChildrenList.empty() ? "* " : " ");
std::cout << (*ifn)->mBranchId << ((*ifn)->mChildrenList.empty() ? "* " : " ");
}
std::cout << std::endl;
}
......@@ -259,7 +259,7 @@ void Forest::postLoad(void) {
std::vector<ForestNode*>::const_iterator ifn;
for(ifn=rinbl->begin(); ifn != rinbl->end(); ++ifn)
{
std::cout << (*ifn)->mBranchId << ((*ifn)->mChildrenList.empty() ? "* " : " ");
std::cout << (*ifn)->mBranchId << ((*ifn)->mChildrenList.empty() ? "* " : " ");
}
std::cout << std::endl;
}
......@@ -414,13 +414,13 @@ void Forest::cleanReductionWorkingData(ForestNode *aNode) {
std::ostream &operator<<(std::ostream &aOut, const Forest &aForest) {
// General forest statistics
aOut << std::endl;
aOut << "Num branches: " << std::setw(7)
<< aForest.mNumBranches << std::endl;
aOut << "Internal branches: " << std::setw(7)
<< aForest.mNumInternalBranches << std::endl;
aOut << "Unique sites: " << std::setw(7) << aForest.mNumSites
aOut << "Num branches: " << std::setw(7) << aForest.mNumBranches
<< std::endl;
aOut << "Total branches: " << std::setw(7)
aOut << "Internal branches: " << std::setw(7) << aForest.mNumInternalBranches
<< std::endl;
aOut << "Unique sites: " << std::setw(7) << aForest.mNumSites
<< std::endl;
aOut << "Total branches: " << std::setw(7)
<< aForest.mNumBranches * aForest.mNumSites << std::endl;
// Count total branches on the reduced forest
......@@ -432,7 +432,7 @@ std::ostream &operator<<(std::ostream &aOut, const Forest &aForest) {
cnt += n.countBranches();
cntAggressive += n.countBranches(true);
}
aOut << "Reduced branches: " << std::fixed << std::setw(7) << cnt
aOut << "Reduced branches: " << std::fixed << std::setw(7) << cnt
<< std::setw(8) << std::setprecision(2)
<< static_cast<double>(cnt * 100.) /
static_cast<double>(aForest.mNumBranches * aForest.mNumSites)
......
......@@ -25,9 +25,9 @@
/// This class encapsulates the forest of phylogenetic tree that will be used