Commit 94715e19 authored by mvalle's avatar mvalle
Browse files

Fixed various typos in doxygen comments and in two exception messages.


git-svn-id: https://svn.vital-it.ch/svn/hp2c/trunk/Codeml_Variants/Fastcodeml@5812 95c5a404-1f88-0410-a6b0-c3f062b6f34a
parent 0d0f30a0
......@@ -6,7 +6,7 @@
/// Alignment must be power of 2 (1,2,4,8,16...)
///
/// @param[in] aSize The size (in bytes) of the block to be allocated
/// @param[in] aAlignment The alingment requested (must be power of 2)
/// @param[in] aAlignment The alignment requested (must be a power of 2)
///
/// @return Pointer to the allocated area
///
......
......@@ -112,7 +112,7 @@ double BayesTest::getGridParams(const std::vector<double>& aVars, const std::vec
omega_fg_is_one = false; omega_bg_is_one = true;
}
// Fill the matrices and compute their eigen decomposition.
// Fill the matrices and compute their eigendecomposition.
#ifdef _MSC_VER
#pragma omp parallel sections default(none) shared(omega_fg, omega_bg, kappa, q_fg, q_bg, omega_fg_is_one, omega_bg_is_one)
#else
......
......@@ -69,8 +69,8 @@ public:
/// Bayes Empirical Bayes (BEB) test.
///
/// @param[in] aVars The variables otimized at the end of H1 run
/// @param[in] aFgBranch The foreground branch under test
/// @param[in] aVars The variables optimized at the end of the H1 run.
/// @param[in] aFgBranch The foreground branch under test.
/// @param[in] aScales The two scales ([0] bg; [1] fg) to rescale the branch lengths. They are computed in H1.
///
void computeBEB(const std::vector<double>& aVars, size_t aFgBranch, const std::vector<double>& aScales);
......@@ -104,9 +104,9 @@ private:
/// site class 2b: w1=1 w2 10
///@endverbatim
///
/// @param[in] aVars The variables otimized at the end of H1 run
/// @param[in] aSiteMultiplicity The site multiplicity vector
/// @param[in] aFgBranch The foreground branch under test
/// @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 lengths. They are computed in H1.
///
/// @return The computed scale.
......@@ -124,14 +124,14 @@ private:
/// aProbX rises when ix goes up, but aProbY decreases when iy increases. (aProbX, aProbY) is the
/// centroid in the ij-th small triangle. aProbX and aProbY each takes on 2*BEB_N1D-1 possible values.
///
/// @param[out] aProbX The p0 value on the X axis of the triangular grid
/// @param[out] aProbY The p1 value on the Y axis of the triangular grid
/// @param[out] aProbX The p0 value on the X axis of the triangular grid.
/// @param[out] aProbY The p1 value on the Y axis of the triangular grid.
/// @param[in] aTriangleIdx The index inside the triangular grid.
///
void getIndexTernary(double* aProbX, double* aProbY, unsigned int aTriangleIdx);
private:
/// Disabled assignment operator to avoid warning on Windows.
/// Disabled assignment operator to avoid warnings on Windows.
///
/// @fn BayesTest& operator=(const BayesTest& aObj)
///
......@@ -151,7 +151,7 @@ private:
Forest& mForest; ///< The forest.
size_t mNumSites; ///< Number of sites.
std::vector<double> mSiteClassProb; ///< Probability of a site to pertain to a given class (one row per class (4 classes), one column per site).
unsigned int mVerbose; ///< If greather than zero prints more info
unsigned int mVerbose; ///< If greater than zero prints more info
std::vector<double> mPriors; ///< Computed priors (each points to a list, one for each site)
TreeAndSetsDependencies mDependencies; ///< Dependency list for likelihood computation
ProbabilityMatrixSetBEB mBEBset; ///< Probability matrix set to be used for likelihood computation
......
......@@ -35,7 +35,7 @@ void BranchSiteModel::printFinalVars(std::ostream& aOut) const
static const std::streamsize VARS_PRECISION = 7;
static const std::streamsize VARS_WIDTH = 11;
// Write the data with an uniform precision
// Write the data with uniform precision
std::streamsize prec = aOut.precision(VARS_PRECISION);
aOut.setf(std::ios::fixed, std::ios::floatfield);
......@@ -89,7 +89,7 @@ void BranchSiteModel::printFinalVars(std::ostream& aOut) const
void BranchSiteModel::printVar(const std::vector<double>& aVars, double aLnl, std::ostream& aOut) const
{
// Write the data with an uniform precision
// Write the data with uniform precision
std::streamsize prec = aOut.precision(7);
aOut.setf(std::ios::fixed, std::ios::floatfield);
......@@ -438,7 +438,7 @@ double BranchSiteModelNullHyp::computeLikelihood(const std::vector<double>& aVar
if(changed_w0) mPrevOmega0 = omega0;
if(changed_k) mPrevK = kappa;
// Fill the matrices and compute their eigen decomposition.
// Fill the matrices and compute their eigendecomposition.
if(changed_k)
{
#ifdef _MSC_VER
......@@ -739,7 +739,7 @@ double BranchSiteModelAltHyp::computeLikelihood(const std::vector<double>& aVar,
if(changed_w2) mPrevOmega2 = omega2;
if(changed_k) mPrevK = kappa;
// Fill the matrices and compute their eigen decomposition.
// Fill the matrices and compute their eigendecomposition.
if(changed_k)
{
#ifdef _MSC_VER
......@@ -950,17 +950,17 @@ public:
///
/// @return The evaluated function
///
/// @exception nlopt::forced_stop To force halt the maximization because LRT it is already not satisfied
/// @exception nlopt::forced_stop To force halt the maximization because LRT is already not satisfied
///
double operator()(const std::vector<double>& aVars, std::vector<double>& aGrad) const
{
// Compute the function at the requested point
double f0 = mModel->computeLikelihood(aVars, mTrace);
// Stop optimization if value is greather or equal to threshold
// Stop optimization if value is greater or equal to threshold
if(mStopIfBigger && f0 >= mThreshold) throw nlopt::forced_stop();
// Compute gradient if requested
// If requested compute the gradient
if(!aGrad.empty()) computeGradient(f0, aVars, aGrad);
return f0;
......@@ -1131,7 +1131,7 @@ double BranchSiteModel::maximizeLikelihood(size_t aFgBranch, bool aStopIfBigger,
break;
default:
throw FastCodeMLFatal("Invalid optimization algorithm identifier on the command line");
throw FastCodeMLFatal("Invalid optimization algorithm identifier on the command line.");
}
// Initialize bounds and termination criteria
......@@ -1194,7 +1194,7 @@ double BranchSiteModel::maximizeLikelihood(size_t aFgBranch, bool aStopIfBigger,
}
catch(const nlopt::roundoff_limited&)
{
throw FastCodeMLFatal("Exception in computation:Halted because roundoff errors limited progress, equivalent to NLOPT_ROUNDOFF_LIMITED.");
throw FastCodeMLFatal("Exception in computation: Halted because roundoff errors limited progress, equivalent to NLOPT_ROUNDOFF_LIMITED.");
}
catch(const std::runtime_error&)
{
......@@ -1222,20 +1222,20 @@ double BranchSiteModel::maximizeLikelihood(size_t aFgBranch, bool aStopIfBigger,
/// The vector containing the independent variables has the following layout
///
/// @section blen_sect Branch lengths
/// The first mNumTimes positions contain the branch lengths. The index varies from 0 to mNumTimes-1.
/// The first `mNumTimes` positions contain the branch lengths. The index varies from `0` to `mNumTimes-1`.
///
/// @section v0_sect Combined proportions v0
/// The v0 (p0+p1) value is at index mNumTimes+0
/// The `v0 = (p0+p1)` value is at index `mNumTimes+0`
///
/// @section v1_sect Combined proportions v1
/// The v1 (p0/(p0+p1)) value is at index mNumTimes+1
/// The `v1 = (p0/(p0+p1))` value is at index `mNumTimes+1`
///
/// @section w0_sect Omega 0
/// The w0 value is at index mNumTimes+2
/// The `w0` value is at index `mNumTimes+2`
///
/// @section k_sect Kappa
/// The k value is at index mNumTimes+3
/// The `k` value is at index `mNumTimes+3`
///
/// @section w2_sect Omega 2
/// The w2 value (if present) is at index mNumTimes+4
/// The `w2` value (if present) is at index `mNumTimes+4`
///
......@@ -14,7 +14,7 @@
//// Value used for the LRT test. It is chisq(.95, df=1)/2
static const double THRESHOLD_FOR_LRT = 1.92072941034706202;
/// Common routines for testing the two hypothesis (H0 and H1).
/// Common routines for testing the two hypotheses (H0 and H1).
///
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
/// @date 2010-12-23 (initial version)
......@@ -175,7 +175,7 @@ public:
///
static bool performLRT(double aLnL0, double aLnL1) {return (aLnL1 - aLnL0) > THRESHOLD_FOR_LRT;}
/// Get site multeplicity values.
/// Get site multiplicity values.
///
/// @return Reference to the array of site multiplicities
///
......@@ -234,7 +234,7 @@ protected:
private:
/// Set upper and lower limits for the maximization domain
///
/// @param[in] aNumTimes Number of times (ie branch lengths)
/// @param[in] aNumTimes Number of times (i.e.\ branch lengths)
/// @param[in] aNumVariables Number of other variables (4 for H0, 5 for H1)
///
void setLimits(size_t aNumTimes, size_t aNumVariables);
......@@ -249,7 +249,7 @@ private:
///
enum OptimAlgoIdentifier
{
OPTIM_LD_LBFGS = 0, ///< Same optimizer as CodeML
OPTIM_LD_LBFGS = 0, ///< Low-storage BFGS (same optimizer method as the one used by CodeML)
OPTIM_LD_VAR1 = 1, ///< Shifted limited-memory variable-metric rank-1 method
OPTIM_LD_VAR2 = 2, ///< Shifted limited-memory variable-metric rank-2 method
OPTIM_LD_SLSQP = 3, ///< Sequential quadratic programming (SQP) algorithm
......@@ -292,7 +292,7 @@ public:
private:
/// Disabled assignment operator to avoid warning on Windows
/// Disabled assignment operator to avoid warnings on Windows
///
/// @fn BranchSiteModel& operator=(const BranchSiteModel& aObj)
///
......@@ -394,7 +394,7 @@ public:
private:
/// Disabled assignment operator to avoid warning on Windows
/// Disabled assignment operator to avoid warnings on Windows
///
/// @fn BranchSiteModelNullHyp& operator=(const BranchSiteModelNullHyp& aObj)
///
......
......@@ -86,7 +86,7 @@ public:
bool mForceSerial; ///< Disable all parallelism
bool mBranchFromFile; ///< Read the foreground branch to use from the phylo tree file (it is marked as #1)
bool mInitH0fromH1; ///< If set starts the H0 computation from the H1 results
bool mInitFromParams; ///< Initialize times from phylo tree and the other from values hardcoded or entered on the comman line
bool mInitFromParams; ///< Initialize times from phylo tree and the other from values hardcoded or entered on the command line
bool mCleanData; ///< Remove ambiguous or missing sites from the MSA (genes)
bool mStopIfNotLRT; ///< Stop H0 maximization when LRT cannot be satisfied
......
......@@ -22,7 +22,7 @@ public:
/// @param[in] aVerbose The verbose level
/// @param[in] aLowerBound Lower limit of the variables to constrain the interval on which the optimum should be computed
/// @param[in] aUpperBound Upper limit of the variables to constrain the interval on which the optimum should be computed
/// @param[in] aDeltaForGradient Delta used to compue the gradient
/// @param[in] aDeltaForGradient Delta used to compute the gradient
/// @param[in] aRelativeError Relative error to stop computation
///
Ming2(BranchSiteModel* aModel, bool aTrace, unsigned int aVerbose, const std::vector<double>& aLowerBound, const std::vector<double>& aUpperBound, double aDeltaForGradient, double aRelativeError) :
......@@ -122,7 +122,7 @@ private:
///
double LineSearch2(double *f, const double x0[], const double p[], double step, double limit, double e, double space[], int iround, int n);
/// Disabled assignment operator to avoid warning on Windows
/// Disabled assignment operator to avoid warnings on Windows
///
/// @fn Ming2& operator=(const Ming2& aObj)
///
......
......@@ -48,7 +48,7 @@ public:
///
void* getNext(void);
/// Signals finished exectution on aItem
/// Signals finished execution on aItem.
///
/// @param[in] aItem Object on which execution has ended.
///
......@@ -67,7 +67,7 @@ private:
std::set<const void*> mNodes; ///< Load the distinct node addresses
std::vector<std::pair<const void*, const void*> > mEdges; ///< Load the edges
std::map<const void*, int> mRefCounter; ///< Reference counter
std::map<const void*, int> mRefCounterSave; ///< Save the referece counter map
std::map<const void*, int> mRefCounterSave; ///< Save the reference counter map
};
#endif
......
......@@ -90,17 +90,17 @@ public:
mNodeStatus[aBranch * mNumSites + aSite] = aReusedSite;
}
/// Prints (on stderr) for each branch the first and last valid positions and the valid entries in this range).
/// Prints (on cout) for each branch the first and last valid positions and the valid entries in this range.
///
/// @exception FastCodeMLFatal No SITE_EXISTS in mNodePresent at branch
///
void printCountGoodElements(void) const;
/// Prints (on stderr) the visit sequence of branches.
/// Prints (on cout) the visit sequence of branches.
///
void printBranchVisitSequence(void) const;
/// Prints (on sterr) for each branch and each site if it is valid, if it is not present and if takes the value from another site
/// Prints (on cout) for each branch and each site if it is valid, if it is not present and if takes the value from another site
///
void printNodeStatus(void) const;
......
......@@ -113,7 +113,7 @@ void Forest::loadTreeAndGenes(const PhyloTree& aTree, const Genes& aGenes, Codon
// Set the number of internal branches
mNumInternalBranches = mNumBranches - num_leaves;
// Set the site multeplicity
// Set the site multiplicity
mSiteMultiplicity.assign(mult.begin(), mult.end());
// Set the codon frequencies and related values needed for the eigensolver
......@@ -198,7 +198,7 @@ void Forest::postLoad(void)
}
#endif
// Try to balance the tree (ie move leaves to fill underfull levels)
// Try to balance the tree (i.e.\ move leaves to fill underfull levels)
for(bool found=true; found;)
{
// Find the level with the maximum number of leaves
......
......@@ -183,7 +183,7 @@ public:
///
size_t getMarkedInternalBranch(void) const {return mMarkedInternalBranch;}
/// Get site multeplicity values.
/// Get site multiplicity values.
///
/// @return Reference to the array of site multiplicities
///
......@@ -375,7 +375,7 @@ private:
#ifdef USE_DAG
DAGScheduler mDAG; ///< DAG Scheduler
#endif
unsigned int mVerbose; ///< If greather than zero prints more info
unsigned int mVerbose; ///< If greater than zero prints more info
std::multimap<size_t, size_t> mSitesMappingToOriginal; ///< Map reduced site num. to list of corresponding original sites.
};
......
......@@ -6,7 +6,7 @@
class Forest;
/// Export the phylogenetic tree's forest.
/// This class encapsulates all the routines needed to export in textual form the the forest of phylogenetic trees.
/// This class encapsulates all the routines needed to export in textual form the forest of phylogenetic trees.
/// It is a friend class of Forest.
///
/// @author Mario Valle - Swiss National Supercomputing Centre (CSCS)
......
......@@ -43,7 +43,7 @@ struct ForestNode
unsigned char mChildrenSameTreeFlags; ///< Bit i set if child i is in the same tree
unsigned char mChildrenCount; ///< Number of children of this node
short mLeafCodon; ///< On a leaf set to the corresponding codon number, otherwise -1
unsigned int mBranchId; ///< An unique index to access the branch length array (starts from zero at the first non-root node)
unsigned int mBranchId; ///< A unique index to access the branch length array (starts from zero at the first non-root node)
unsigned int mOwnTree; ///< Per tree identifier
ForestNode* mParent; ///< Pointer to the node parent (null for the root)
#ifndef NEW_LIKELIHOOD
......
......@@ -100,7 +100,7 @@ public:
private:
/// Convert givend codon in the codons positions after expanding ambiguous characters.
/// Convert given codon in the corresponding codons positions after expanding ambiguous characters.
/// The valid letter are TGKCYSBAWRDMHVN and U that is mapped to T and - that is mapped to N.
/// The full list can be found on http://en.wikipedia.org/wiki/Nucleic_acid_notation
///
......@@ -112,7 +112,7 @@ private:
/// Test if the three letters of the argument represent a valid codon.
///
/// @param[in] aCodon String of three letters repesenting the codon (not null terminated)
/// @param[in] aCodon String of three letters representing the codon (not null terminated)
/// @param[in] aRemoveAmbiguous If true only TCAG codons are valid, else also ambiguous one are valid
///
/// @return True if codon is a valid codon
......@@ -137,8 +137,8 @@ private:
/// Compare two codons.
///
/// @param[in] aCodon1 First codon to be compared (three charactes, no need for zero termination)
/// @param[in] aCodon2 Second codon to be compared (three charactes, no need for zero termination)
/// @param[in] aCodon1 First codon to be compared (three characters, no need for zero termination)
/// @param[in] aCodon2 Second codon to be compared (three characters, no need for zero termination)
///
/// @return True if the codons are valid, equal or if ambiguous expand to the same set of positions.
///
......
......@@ -301,7 +301,7 @@ void HighLevelCoordinator::WorkTable::printVariables(size_t aBranch, unsigned in
static const std::streamsize VARS_PRECISION = 7;
static const std::streamsize VARS_WIDTH = 11;
// Write the data with an uniform precision
// Write the data with uniform precision
std::streamsize prec = aOut.precision(VARS_PRECISION);
aOut.setf(std::ios::fixed, std::ios::floatfield);
......@@ -384,7 +384,7 @@ HighLevelCoordinator::HighLevelCoordinator(int* aRgc, char*** aRgv) : mVerbose(0
int mpi_status = MPI_Init_thread(aRgc, aRgv, requested, &provided);
if(mpi_status != MPI_SUCCESS)
{
throw FastCodeMLFatal("MPI Failed to initalize");
throw FastCodeMLFatal("MPI Failed to initialize");
}
else if(requested > MPI_THREAD_SINGLE && provided < MPI_THREAD_FUNNELED)
{
......
......@@ -26,7 +26,7 @@ public:
/// @param[in,out] aRgc Pointer to the number of arguments
/// @param[in,out] aRgv Pointer to the arguments' list
///
/// @exception FastCodeMLFatal MPI Failed to initalize
/// @exception FastCodeMLFatal MPI Failed to initialize
/// @exception FastCodeMLSuccess To terminate unused worker processes
///
HighLevelCoordinator(int* aRgc, char*** aRgv);
......
......@@ -23,7 +23,7 @@ public:
static ParseParameters* getInstance(void);
/// Change value to a given parameter.
/// The argumenti is a string: name=value or name:value where the name is in (w0, k, p0, p1, w2) and the value is a double value
/// The argument is a string: name=value or name:value where the name is in (w0, k, p0, p1, w2) and the value is a double numerical value
///
/// @param[in] aParamValuePair The string to be parsed for name and value
///
......
......@@ -80,7 +80,7 @@ public:
/// @param[out] aForestNode The ForestNode that becomes the root of the cloned tree
/// @param[in] aTreeId The tree running id.
/// @param[in] aNumSites Total number of sites. Needed to assign pointers to aProbVectors.
/// @param[in] aProbVectors Contiguos storage for the probability vectors for each branch (ignored if NEW_LIKELIHOOD defined).
/// @param[in] aProbVectors Contiguous storage for the probability vectors for each branch (ignored if NEW_LIKELIHOOD defined).
/// @param[in] aTreeNode The node from which to start the cloning in the tree. If not present starts from the root
/// @param[in] aNodeId The node running id. For the root it is UINT_MAX.
///
......
......@@ -255,7 +255,7 @@ public:
/// Set the matrices for branch aBranch from the return value of a getChangedMatrices routine
///
/// @param[in] aBranch The branch for which the matrices are to be accessed
/// @param[in] aMatricesPtr array of pointers as returned by the etChangedMatrices routine
/// @param[in] aMatricesPtr array of pointers as returned by the getChangedMatrices routine
///
void setMatrices(size_t aBranch, const double** aMatricesPtr);
......@@ -331,7 +331,7 @@ public:
/// Set the matrices for branch aBranch from the return value of a getChangedMatrices routine
///
/// @param[in] aBranch The branch for which the matrices are to be accessed
/// @param[in] aMatricesPtr array of pointers as returned by gthe etChangedMatrices routine
/// @param[in] aMatricesPtr array of pointers as returned by the getChangedMatrices routine
///
void setMatrices(size_t aBranch, const double** aMatricesPtr);
......
......@@ -23,8 +23,7 @@
static void EigenSort(double d[], double U[], int n)
{
/* this sorts the eigen values d[] and rearrange the (right) eigen vectors U[]
*/
// This sorts the eigenvalues d[] and rearrange the (right) eigen vectors U[]
int k, j, i;
double p;
......@@ -174,11 +173,11 @@ static void HouseholderRealSym(double a[], int n, double d[], double e[])
static int EigenTridagQLImplicit(double d[], double e[], int n, double z[])
{
/* This finds the eigen solution of a tridiagonal matrix represented by d and e.
/* This finds the eigensolution of a tridiagonal matrix represented by d and e.
d[] is the diagonal (eigenvalues), e[] is the off-diagonal
z[n*n]: as input should have the identity matrix to get the eigen solution of the
z[n*n]: as input should have the identity matrix to get the eigensolution of the
tridiagonal matrix, or the output from HouseholderRealSym() to get the
eigen solution to the original real symmetric matrix.
eigensolution to the original real symmetric matrix.
z[n*n]: has the orthogonal matrix as output
Adapted from routine tqli in Numerical Recipes in C, with reference to
......@@ -302,7 +301,7 @@ static int EigenTridagQLImplicit(double d[], double e[], int n, double z[])
void TransitionMatrix::eigenRealSymm(double* aU, int aDim, double* aR, double* aWork)
{
/* This finds the eigen solution of a real symmetrical matrix aU[aDim*aDim]. In return,
/* This finds the eigensolution of a real symmetrical matrix aU[aDim*aDim]. In return,
aU has the right vectors and aR has the eigenvalues.
aWork[n] is the working space.
The matrix is first reduced to a tridiagonal matrix using HouseholderRealSym(),
......@@ -408,7 +407,7 @@ void TransitionMatrix::eigenRealSymm(double* aU, int aDim, double* aR, double* /
void TransitionMatrix::eigenQREV(void)
{
/*
This finds the eigen solution of the rate matrix Q for a time-reversible
This finds the eigensolution of the rate matrix Q for a time-reversible
Markov process, using the algorithm for a real symmetric matrix.
Rate matrix Q = S * diag{pi} = U * diag{Root} * V,
where S is symmetrical, all elements of pi are positive, and U*V = I.
......@@ -424,7 +423,7 @@ void TransitionMatrix::eigenQREV(void)
try {
if(mNumGoodFreq == N)
{
// The S matrix is defined as Q = S*Pi
// The S matrix is defined as Q = S*pi
// Due to the fact that each Q row should sum to zero, the S diagonal values are so adjusted.
// But also to save multiplications the S diagonal elements are already multiplied by the corresponding codon frequency
// Also the eigensolver use only half the matrix. So S is filled only for half.
......@@ -520,7 +519,7 @@ void TransitionMatrix::eigenQREV(void)
void TransitionMatrix::eigenQREV(void)
{
/*
This finds the eigen solution of the rate matrix Q for a time-reversible
This finds the eigensolution of the rate matrix Q for a time-reversible
Markov process, using the algorithm for a real symmetric matrix.
Rate matrix Q = S * diag{pi} = U * diag{Root} * V,
where S is symmetrical, all elements of pi are positive, and U*V = I.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment