Commit 4b4757ee by Maarten L. Hekkelman

removed using namespace std;

parent ac088dd0
......@@ -97,7 +97,6 @@ LIBCIF_SRC = AtomType.cpp \
CifUtils.cpp \
CifValidator.cpp \
Compound.cpp \
FixDMC.cpp \
PDB2Cif.cpp \
PDB2CifRemark3.cpp \
Point.cpp \
......
......@@ -29,8 +29,6 @@
#include "cif++/AtomType.hpp"
#include "cif++/Cif++.hpp"
using namespace std;
namespace mmcif
{
......@@ -1237,7 +1235,7 @@ SFDataArrayElement kELSFData[] = {
// --------------------------------------------------------------------
// AtomTypeTraits
AtomTypeTraits::AtomTypeTraits(const string& symbol)
AtomTypeTraits::AtomTypeTraits(const std::string& symbol)
: mInfo(nullptr)
{
for (auto& i: data::kKnownAtoms)
......@@ -1250,20 +1248,20 @@ AtomTypeTraits::AtomTypeTraits(const string& symbol)
}
if (mInfo == nullptr)
throw invalid_argument("Not a known element: " + symbol);
throw std::invalid_argument("Not a known element: " + symbol);
}
AtomTypeTraits::AtomTypeTraits(AtomType t)
{
if (t < H or t >= data::kKnownAtomsCount)
throw invalid_argument("atomType out of range");
throw std::invalid_argument("atomType out of range");
mInfo = &data::kKnownAtoms[t];
assert(mInfo->type == t);
}
bool AtomTypeTraits::isElement(const string& symbol)
bool AtomTypeTraits::isElement(const std::string& symbol)
{
bool result = false;
......@@ -1279,7 +1277,7 @@ bool AtomTypeTraits::isElement(const string& symbol)
return result;
}
bool AtomTypeTraits::isMetal(const string& symbol)
bool AtomTypeTraits::isMetal(const std::string& symbol)
{
bool result = false;
......@@ -1303,7 +1301,7 @@ auto AtomTypeTraits::wksf(int charge) const -> const SFData&
return sf.sf;
}
throw runtime_error("No scattering factor found for " + name() + to_string(charge));
throw std::runtime_error("No scattering factor found for " + name() + std::to_string(charge));
}
auto AtomTypeTraits::elsf() const -> const SFData&
......@@ -1314,7 +1312,7 @@ auto AtomTypeTraits::elsf() const -> const SFData&
return sf.sf;
}
throw runtime_error("No scattering factor found for " + name());
throw std::runtime_error("No scattering factor found for " + name());
}
}
......@@ -47,7 +47,6 @@
#include "cif++/CifUtils.hpp"
using namespace std;
namespace ba = boost::algorithm;
namespace cif
......@@ -80,7 +79,7 @@ const uint8_t kCharToLowerMap[256] =
// --------------------------------------------------------------------
bool iequals(const string& a, const string& b)
bool iequals(const std::string& a, const std::string& b)
{
bool result = a.length() == b.length();
for (auto ai = a.begin(), bi = b.begin(); result and ai != a.end() and bi != b.end(); ++ai, ++bi)
......@@ -97,7 +96,7 @@ bool iequals(const char* a, const char* b)
return result and *a == *b;
}
int icompare(const string& a, const string& b)
int icompare(const std::string& a, const std::string& b)
{
int d = 0;
auto ai = a.begin(), bi = b.begin();
......@@ -134,15 +133,15 @@ int icompare(const char* a, const char* b)
return d;
}
void toLower(string& s)
void toLower(std::string& s)
{
for (auto& c: s)
c = tolower(c);
}
string toLowerCopy(const string& s)
std::string toLowerCopy(const std::string& s)
{
string result(s);
std::string result(s);
for (auto& c: result)
c = tolower(c);
return result;
......@@ -150,17 +149,17 @@ string toLowerCopy(const string& s)
// --------------------------------------------------------------------
tuple<string,string> splitTagName(const string& tag)
std::tuple<std::string,std::string> splitTagName(const std::string& tag)
{
if (tag.empty())
throw runtime_error("empty tag");
throw std::runtime_error("empty tag");
if (tag[0] != '_')
throw runtime_error("tag does not start with underscore");
throw std::runtime_error("tag does not start with underscore");
auto s = tag.find('.');
if (s == string::npos)
throw runtime_error("tag does not contain dot");
return tuple<string,string>{
if (s == std::string::npos)
throw std::runtime_error("tag does not contain dot");
return std::tuple<std::string,std::string>{
tag.substr(1, s - 1), tag.substr(s + 1)
};
}
......@@ -236,7 +235,7 @@ const LineBreakClass kASCII_LBTable[128] =
kLBC_Alphabetic, kLBC_Alphabetic, kLBC_Alphabetic, kLBC_OpenPunctuation, kLBC_BreakAfter, kLBC_ClosePunctuation, kLBC_Alphabetic, kLBC_CombiningMark
};
string::const_iterator nextLineBreak(string::const_iterator text, string::const_iterator end)
std::string::const_iterator nextLineBreak(std::string::const_iterator text, std::string::const_iterator end)
{
if (text == end)
return text;
......@@ -329,10 +328,10 @@ string::const_iterator nextLineBreak(string::const_iterator text, string::const_
return text;
}
vector<string> wrapLine(const string& text, unsigned int width)
std::vector<std::string> wrapLine(const std::string& text, unsigned int width)
{
vector<string> result;
vector<size_t> offsets = { 0 };
std::vector<std::string> result;
std::vector<size_t> offsets = { 0 };
auto b = text.begin();
while (b != text.end())
......@@ -346,9 +345,9 @@ vector<string> wrapLine(const string& text, unsigned int width)
size_t count = offsets.size() - 1;
vector<size_t> minima(count + 1, 1000000);
std::vector<size_t> minima(count + 1, 1000000);
minima[0] = 0;
vector<size_t> breaks(count + 1, 0);
std::vector<size_t> breaks(count + 1, 0);
for (size_t i = 0; i < count; ++i)
{
......@@ -390,12 +389,12 @@ vector<string> wrapLine(const string& text, unsigned int width)
return result;
}
vector<string> wordWrap(const string& text, unsigned int width)
std::vector<std::string> wordWrap(const std::string& text, unsigned int width)
{
vector<string> paragraphs;
std::vector<std::string> paragraphs;
ba::split(paragraphs, text, ba::is_any_of("\n"));
vector<string> result;
std::vector<std::string> result;
for (auto& p: paragraphs)
{
if (p.empty())
......@@ -420,7 +419,7 @@ uint32_t get_terminal_width()
}
// I don't have a windows machine to test the following code, please accept my apologies in case it fails...
string GetExecutablePath()
std::string GetExecutablePath()
{
WCHAR buffer[4096];
......@@ -430,7 +429,7 @@ string GetExecutablePath()
wstring ws(buffer);
return string(ws.begin(), ws.end());
return std::string(ws.begin(), ws.end());
}
#else
......@@ -447,11 +446,13 @@ uint32_t get_terminal_width()
return result;
}
string get_executable_path()
std::string get_executable_path()
{
using namespace std::literals;
char path[PATH_MAX] = "";
if (readlink("/proc/self/exe", path, sizeof(path)) == -1)
throw runtime_error("could not get exe path "s + strerror(errno));
throw std::runtime_error("could not get exe path "s + strerror(errno));
return { path };
}
......@@ -461,7 +462,7 @@ string get_executable_path()
struct ProgressImpl
{
ProgressImpl(int64_t inMax, const string& inAction)
ProgressImpl(int64_t inMax, const std::string& inAction)
: mMax(inMax), mConsumed(0), mAction(inAction), mMessage(inAction)
, mThread(std::bind(&ProgressImpl::Run, this))
, mStart(boost::posix_time::second_clock::local_time()) {}
......@@ -478,10 +479,10 @@ struct ProgressImpl
void PrintDone();
int64_t mMax;
atomic<int64_t> mConsumed;
std::atomic<int64_t> mConsumed;
int64_t mLastConsumed = 0;
int mSpinnerIndex = 0;
string mAction, mMessage;
std::string mAction, mMessage;
std::mutex mMutex;
std::thread mThread;
boost::timer::cpu_timer mTimer;
......@@ -549,7 +550,7 @@ void ProgressImpl::PrintProgress()
uint32_t width = get_terminal_width();
string msg;
std::string msg;
msg.reserve(width + 1);
if (mMessage.length() <= 20)
{
......@@ -604,23 +605,23 @@ void ProgressImpl::PrintProgress()
// msg += to_string(perc);
// msg += '%';
cout << '\r' << msg;
cout.flush();
std::cout << '\r' << msg;
std::cout.flush();
}
void ProgressImpl::PrintDone()
{
string msg = mAction + " done in " + mTimer.format(0, "%ts cpu / %ws wall");
std::string msg = mAction + " done in " + mTimer.format(0, "%ts cpu / %ws wall");
uint32_t width = get_terminal_width();
if (msg.length() < width)
msg += string(width - msg.length(), ' ');
msg += std::string(width - msg.length(), ' ');
cout << '\r' << msg << endl;
std::cout << '\r' << msg << std::endl;
}
Progress::Progress(int64_t inMax, const string& inAction)
Progress::Progress(int64_t inMax, const std::string& inAction)
: mImpl(nullptr)
{
if (isatty(STDOUT_FILENO))
......
......@@ -34,7 +34,6 @@
#include "cif++/CifParser.hpp"
#include "cif++/CifValidator.hpp"
using namespace std;
namespace ba = boost::algorithm;
extern int VERBOSE;
......@@ -42,19 +41,19 @@ extern int VERBOSE;
namespace cif
{
ValidationError::ValidationError(const string& msg)
ValidationError::ValidationError(const std::string& msg)
: mMsg(msg)
{
}
ValidationError::ValidationError(const string& cat, const string& item, const string& msg)
ValidationError::ValidationError(const std::string& cat, const std::string& item, const std::string& msg)
: mMsg("When validating _" + cat + '.' + item + ": " + msg)
{
}
// --------------------------------------------------------------------
DDL_PrimitiveType mapToPrimitiveType(const string& s)
DDL_PrimitiveType mapToPrimitiveType(const std::string& s)
{
DDL_PrimitiveType result;
if (iequals(s, "char"))
......@@ -90,7 +89,7 @@ int ValidateType::compare(const char* a, const char* b) const
double db = strtod(b, nullptr);
auto d = da - db;
if (abs(d) > numeric_limits<double>::epsilon())
if (std::abs(d) > std::numeric_limits<double>::epsilon())
{
if (d > 0)
result = 1;
......@@ -177,12 +176,12 @@ int ValidateType::compare(const char* a, const char* b) const
//
// parent->mChildren.insert(this);
////
//// if (mCategory->mKeys == vector<string>{mTag})
//// if (mCategory->mKeys == std::vector<std::string>{mTag})
//// parent->mForeignKeys.insert(this);
// }
//}
void ValidateItem::operator()(string value) const
void ValidateItem::operator()(std::string value) const
{
if (not value.empty() and value != "?" and value != ".")
{
......@@ -206,19 +205,19 @@ void ValidateCategory::addItemValidator(ValidateItem&& v)
v.mCategory = this;
auto r = mItemValidators.insert(move(v));
auto r = mItemValidators.insert(std::move(v));
if (not r.second and VERBOSE >= 4)
cout << "Could not add validator for item " << v.mTag << " to category " << mName << endl;
std::cout << "Could not add validator for item " << v.mTag << " to category " << mName << std::endl;
}
const ValidateItem* ValidateCategory::getValidatorForItem(string tag) const
const ValidateItem* ValidateCategory::getValidatorForItem(std::string tag) const
{
const ValidateItem* result = nullptr;
auto i = mItemValidators.find(ValidateItem{tag});
if (i != mItemValidators.end())
result = &*i;
else if (VERBOSE > 4)
cout << "No validator for tag " << tag << endl;
std::cout << "No validator for tag " << tag << std::endl;
return result;
}
......@@ -234,12 +233,12 @@ Validator::~Validator()
void Validator::addTypeValidator(ValidateType&& v)
{
auto r = mTypeValidators.insert(move(v));
auto r = mTypeValidators.insert(std::move(v));
if (not r.second and VERBOSE > 4)
cout << "Could not add validator for type " << v.mName << endl;
std::cout << "Could not add validator for type " << v.mName << std::endl;
}
const ValidateType* Validator::getValidatorForType(string typeCode) const
const ValidateType* Validator::getValidatorForType(std::string typeCode) const
{
const ValidateType* result = nullptr;
......@@ -247,33 +246,33 @@ const ValidateType* Validator::getValidatorForType(string typeCode) const
if (i != mTypeValidators.end())
result = &*i;
else if (VERBOSE > 4)
cout << "No validator for type " << typeCode << endl;
std::cout << "No validator for type " << typeCode << std::endl;
return result;
}
void Validator::addCategoryValidator(ValidateCategory&& v)
{
auto r = mCategoryValidators.insert(move(v));
auto r = mCategoryValidators.insert(std::move(v));
if (not r.second and VERBOSE > 4)
cout << "Could not add validator for category " << v.mName << endl;
std::cout << "Could not add validator for category " << v.mName << std::endl;
}
const ValidateCategory* Validator::getValidatorForCategory(string category) const
const ValidateCategory* Validator::getValidatorForCategory(std::string category) const
{
const ValidateCategory* result = nullptr;
auto i = mCategoryValidators.find(ValidateCategory{category});
if (i != mCategoryValidators.end())
result = &*i;
else if (VERBOSE > 4)
cout << "No validator for category " << category << endl;
std::cout << "No validator for category " << category << std::endl;
return result;
}
ValidateItem* Validator::getValidatorForItem(string tag) const
ValidateItem* Validator::getValidatorForItem(std::string tag) const
{
ValidateItem* result = nullptr;
string cat, item;
std::string cat, item;
std::tie(cat, item) = splitTagName(tag);
auto* cv = getValidatorForCategory(cat);
......@@ -281,7 +280,7 @@ ValidateItem* Validator::getValidatorForItem(string tag) const
result = const_cast<ValidateItem*>(cv->getValidatorForItem(item));
if (result == nullptr and VERBOSE > 4)
cout << "No validator for item " << tag << endl;
std::cout << "No validator for item " << tag << std::endl;
return result;
}
......@@ -290,38 +289,38 @@ void Validator::addLinkValidator(ValidateLink&& v)
{
assert(v.mParentKeys.size() == v.mChildKeys.size());
if (v.mParentKeys.size() != v.mChildKeys.size())
throw runtime_error("unequal number of keys for parent and child in link");
throw std::runtime_error("unequal number of keys for parent and child in link");
auto pcv = getValidatorForCategory(v.mParentCategory);
auto ccv = getValidatorForCategory(v.mChildCategory);
if (pcv == nullptr)
throw runtime_error("unknown parent category " + v.mParentCategory);
throw std::runtime_error("unknown parent category " + v.mParentCategory);
if (ccv == nullptr)
throw runtime_error("unknown child category " + v.mChildCategory);
throw std::runtime_error("unknown child category " + v.mChildCategory);
for (size_t i = 0; i < v.mParentKeys.size(); ++i)
{
auto piv = pcv->getValidatorForItem(v.mParentKeys[i]);
if (piv == nullptr)
throw runtime_error("unknown parent tag _" + v.mParentCategory + '.' + v.mParentKeys[i]);
throw std::runtime_error("unknown parent tag _" + v.mParentCategory + '.' + v.mParentKeys[i]);
auto civ = ccv->getValidatorForItem(v.mChildKeys[i]);
if (civ == nullptr)
throw runtime_error("unknown child tag _" + v.mChildCategory + '.' + v.mChildKeys[i]);
throw std::runtime_error("unknown child tag _" + v.mChildCategory + '.' + v.mChildKeys[i]);
if (civ->mType == nullptr and piv->mType != nullptr)
const_cast<ValidateItem*>(civ)->mType = piv->mType;
}
mLinkValidators.emplace_back(move(v));
mLinkValidators.emplace_back(std::move(v));
}
vector<const ValidateLink*> Validator::getLinksForParent(const string& category) const
std::vector<const ValidateLink*> Validator::getLinksForParent(const std::string& category) const
{
vector<const ValidateLink*> result;
std::vector<const ValidateLink*> result;
for (auto& l: mLinkValidators)
{
......@@ -332,9 +331,9 @@ vector<const ValidateLink*> Validator::getLinksForParent(const string& category)
return result;
}
vector<const ValidateLink*> Validator::getLinksForChild(const string& category) const
std::vector<const ValidateLink*> Validator::getLinksForChild(const std::string& category) const
{
vector<const ValidateLink*> result;
std::vector<const ValidateLink*> result;
for (auto& l: mLinkValidators)
{
......@@ -345,12 +344,12 @@ vector<const ValidateLink*> Validator::getLinksForChild(const string& category)
return result;
}
void Validator::reportError(const string& msg, bool fatal)
void Validator::reportError(const std::string& msg, bool fatal)
{
if (mStrict or fatal)
throw ValidationError(msg);
else if (VERBOSE)
cerr << msg << endl;
std::cerr << msg << std::endl;
}
}
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 NKI/AVL, Netherlands Cancer Institute
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <set>
#include <cif++/Structure.hpp>
namespace mmcif
{
void addC(Monomer& mon)
{
}
void addCA(Monomer& mon)
{
}
void addN(Monomer& mon)
{
}
void addO(Monomer& mon)
{
}
void CreateMissingBackboneAtoms(Structure& structure, bool simplified)
{
for (auto& poly: structure.polymers())
{
for (auto& mon: poly)
{
if (mon.isComplete() or mon.hasAlternateBackboneAtoms())
continue;
auto atomC = mon.atomByID("C");
auto atomCA = mon.atomByID("CA");
auto atomN = mon.atomByID("N");
auto atomO = mon.atomByID("O");
int missing = (atomC ? 0 : 1) + (atomCA ? 0 : 1) + (atomN ? 0 : 1) + (atomO ? 0 : 1);
switch (missing)
{
case 1:
if (not atomO)
addO(mon);
else if (not atomN)
addN(mon);
else if (not atomCA)
addCA(mon);
else if (not atomC)
addC(mon);
break;
}
}
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -29,8 +29,6 @@
#include "cif++/Point.hpp"
using namespace std;
namespace mmcif
{
......@@ -38,7 +36,7 @@ namespace mmcif
quaternion Normalize(quaternion q)
{
valarray<double> t(4);
std::valarray<double> t(4);
t[0] = q.R_component_1();
t[1] = q.R_component_2();
......@@ -59,7 +57,7 @@ quaternion Normalize(quaternion q)
// --------------------------------------------------------------------
tuple<double,Point> QuaternionToAngleAxis(quaternion q)
std::tuple<double,Point> QuaternionToAngleAxis(quaternion q)
{
if (q.R_component_1() > 1)
q = Normalize(q);
......@@ -75,10 +73,10 @@ tuple<double,Point> QuaternionToAngleAxis(quaternion q)
Point axis(q.R_component_2() / s, q.R_component_3() / s, q.R_component_4() / s);
return make_tuple(angle, axis);
return std::make_tuple(angle, axis);
}
Point CenterPoints(vector<Point>& Points)
Point CenterPoints(std::vector<Point>& Points)
{
Point t;
......@@ -103,7 +101,7 @@ Point CenterPoints(vector<Point>& Points)
return t;
}
Point Centroid(vector<Point>& Points)
Point Centroid(std::vector<Point>& Points)
{
Point result;
......@@ -115,12 +113,12 @@ Point Centroid(vector<Point>& Points)
return result;
}
double RMSd(const vector<Point>& a, const vector<Point>& b)
double RMSd(const std::vector<Point>& a, const std::vector<Point>& b)
{
double sum = 0;
for (uint32_t i = 0; i < a.size(); ++i)
{
valarray<double> d(3);
std::valarray<double> d(3);
d[0] = b[i].mX - a[i].mX;
d[1] = b[i].mY - a[i].mY;
......@@ -131,7 +129,7 @@ double RMSd(const vector<Point>& a, const vector<Point>& b)
sum += d.sum();
}
return sqrt(sum / a.size());
return std::sqrt(sum / a.size());
}
// The next function returns the largest solution for a quartic equation
......@@ -145,30 +143,30 @@ double RMSd(const vector<Point>& a, const vector<Point>& b)
// sqrt of a negative number)
double LargestDepressedQuarticSolution(double a, double b, double c)
{
complex<double> P = - (a * a) / 12 - c;
complex<double> Q = - (a * a * a) / 108 + (a * c) / 3 - (b * b) / 8;
complex<double> R = - Q / 2.0 + sqrt((Q * Q) / 4.0 + (P * P * P) / 27.0);
std::complex<double> P = - (a * a) / 12 - c;
std::complex<double> Q = - (a * a * a) / 108 + (a * c) / 3 - (b * b) / 8;
std::complex<double> R = - Q / 2.0 + std::sqrt((Q * Q) / 4.0 + (P * P * P) / 27.0);
complex<double> U = pow(R, 1 / 3.0);
std::complex<double> U = std::pow(R, 1 / 3.0);
complex<double> y;
std::complex<double> y;
if (U == 0.0)
y = -5.0 * a / 6.0 + U - pow(Q, 1.0 / 3.0);
y = -5.0 * a / 6.0 + U - std::pow(Q, 1.0 / 3.0);
else
y = -5.0 * a / 6.0 + U - P / (3.0 * U);
complex<double> W = sqrt(a + 2.0 * y);
std::complex<double> W = std::sqrt(a + 2.0 * y);
// And to get the final result:
// result = (±W + sqrt(-(3 * alpha + 2 * y ± 2 * beta / W))) / 2;
// We want the largest result, so:
valarray<double> t(4);
std::valarray<double> t(4);
t[0] = (( W + sqrt(-(3.0 * a + 2.0 * y + 2.0 * b / W))) / 2.0).real();
t[1] = (( W + sqrt(-(3.0 * a + 2.0 * y - 2.0 * b / W))) / 2.0).real();
t[2] = ((-W + sqrt(-(3.0 * a + 2.0 * y + 2.0 * b / W))) / 2.0).real();
t[3] = ((-W + sqrt(-(3.0 * a + 2.0 * y - 2.0 * b / W))) / 2.0).real();
t[0] = (( W + std::sqrt(-(3.0 * a + 2.0 * y + 2.0 * b / W))) / 2.0).real();
t[1] = (( W + std::sqrt(-(3.0 * a + 2.0 * y - 2.0 * b / W))) / 2.0).real();
t[2] = ((-W + std::sqrt(-(3.0 * a + 2.0 * y + 2.0 * b / W))) / 2.0).real();
t[3] = ((-W + std::sqrt(-(3.0 * a + 2.0 * y - 2.0 * b / W))) / 2.0).real();
return t.max();
}
......@@ -286,10 +284,10 @@ double LargestDepressedQuarticSolution(double a, double b, double c)
Point Nudge(Point p, float offset)
{
static std::random_device rd;
static mt19937_64 rng(rd());
static std::mt19937_64 rng(rd());
uniform_real_distribution<> randomAngle(0, 2 * kPI);
normal_distribution<> randomOffset(0, offset);
std::uniform_real_distribution<> randomAngle(0, 2 * kPI);
std::normal_distribution<> randomOffset(0, offset);
float theta = randomAngle(rng);
float phi1 = randomAngle(rng) - kPI;
......
......@@ -32,8 +32,6 @@
#include "cif++/Symmetry.hpp"
#include "cif++/CifUtils.hpp"
using namespace std;
namespace mmcif
{
......@@ -51,7 +49,7 @@ int GetSpacegroupNumber(std::string spacegroup)
if (spacegroup == "P 21 21 2 A")
spacegroup = "P 21 21 2 (a)";
else if (spacegroup.empty())
throw runtime_error("No spacegroup, cannot continue");
throw std::runtime_error("No spacegroup, cannot continue");
int result = 0;
......@@ -88,7 +86,7 @@ int GetSpacegroupNumber(std::string spacegroup)
}
if (result == 0)
throw runtime_error("Spacegroup name " + spacegroup + " was not found in table");
throw std::runtime_error("Spacegroup name " + spacegroup + " was not found in table");
return result;
}
......
Markdown is supported
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