Skip to content

Commit

Permalink
Various code style fixes. refs #3868
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcampbell committed Dec 28, 2011
1 parent a1f4347 commit 688ba48
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Mantid
struct findID : public std::unary_function <Mantid::Geometry::IMDDimension_sptr, bool>
{
const std::string m_id;
findID(const std::string id) : m_id(id){ }
findID(const std::string & id) : m_id(id){ }

bool operator ()(const Mantid::Geometry::IMDDimension_sptr obj) const
{
Expand Down
10 changes: 6 additions & 4 deletions Code/Mantid/Framework/Geometry/src/Math/Acomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,10 @@ namespace Mantid

std::map<int,int> Gmap; // get map of literals and frequency
G.getLiterals(Gmap);
if (!Gmap.size())
if (Gmap.empty())
{
return std::pair<Acomp,Acomp>(Acomp(),Acomp());
}
// Make two lists.
// U == set of elements in F (item to be divided) (this)
// V == set of elements in G
Expand Down Expand Up @@ -1642,7 +1644,7 @@ namespace Mantid
}
if (bLevel)
throw std::invalid_argument("Acomp::setString error in line Ln\"" + Ln + "\"");
std::string Part= Ln.substr(sPos,ePos-sPos);
//std::string Part= Ln.substr(sPos,ePos-sPos);
CM.setString(Ln.substr(sPos+2,ePos-sPos-3));
CM.complement();
Ln.replace(sPos,ePos-sPos,"("+CM.display()+")");
Expand Down Expand Up @@ -1768,7 +1770,7 @@ namespace Mantid
@return Full string of the output in abc+efg type form
*/
{
std::string out;
//std::string out;
std::stringstream cx;
std::vector<int>::const_iterator ic;
int sign,val; // sign and value of unit
Expand Down Expand Up @@ -1811,7 +1813,7 @@ namespace Mantid
@return Full string of print line
*/
{
std::string out;
//std::string out;
std::stringstream cx;
std::vector<int>::const_iterator ic;
int sign,val; // sign and value of unit
Expand Down
8 changes: 5 additions & 3 deletions Code/Mantid/Framework/Geometry/src/Math/PolyBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,9 @@ PolyBase::solveCubic(std::complex<double>& AnsA,std::complex<double>& AnsB,

{
double q,r; /* solution parameters */
double s,t,termR,termI,discrim;
double q3,r13;
std::pair<std::complex<double>,std::complex<double> > SQ;
double termR,discrim;
double r13;
//std::pair<std::complex<double>,std::complex<double> > SQ;

const double b = afCoeff[2];
const double c = afCoeff[1];
Expand All @@ -616,6 +616,7 @@ PolyBase::solveCubic(std::complex<double>& AnsA,std::complex<double>& AnsB,

if (discrim > 1e-13) /* one root real, two are complex */
{
double s, t, termI;
s = r + sqrt(discrim);
s = ((s < 0) ? -pow(-s, (1.0/3.0)) : pow(s, (1.0/3.0)));
t = r - sqrt(discrim);
Expand All @@ -633,6 +634,7 @@ PolyBase::solveCubic(std::complex<double>& AnsA,std::complex<double>& AnsB,

if (discrim<1e-13) // All roots real
{
double q3;
q = -q;
q3 = q*q*q;
q3 = acos(-r/sqrt(q3));
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Geometry/src/Objects/ShapeFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ boost::shared_ptr<Object> ShapeFactory::createShape(Poco::XML::Element* pElem)
// Translate algebra string defined by the user into something Mantid can
// understand

std::string algebra; // to hold algebra in a way Mantid can understand
//std::string algebra; // to hold algebra in a way Mantid can understand
std::map<std::string,std::string>::iterator iter;
size_t found;
std::map<size_t,std::string, std::greater<size_t> > allFound;
Expand Down Expand Up @@ -270,7 +270,7 @@ boost::shared_ptr<Object> ShapeFactory::createShape(Poco::XML::Element* pElem)
std::map<size_t,std::string, std::greater<size_t> >::iterator iter2;
for( iter2 = allFound.begin(); iter2 != allFound.end(); ++iter2 )
{
std::string kuse = iter2->second;
//std::string kuse = iter2->second;
algebraFromUser.replace(iter2->first, (iter2->second).size(), idMatching[iter2->second]);
}
}
Expand Down

0 comments on commit 688ba48

Please sign in to comment.