Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / trajectoryanalysis / topologyinformation.cpp
index 15f100aa9f11f87b357d07fd232c119b433b9d2c..74f1609e51235feea3a2c6c6c33630d42c9cfbae 100644 (file)
 namespace gmx
 {
 
-TopologyInformation::TopologyInformation()
-    : hasLoadedMtop_(false),
-      expandedTopology_(nullptr),
-      atoms_ (nullptr),
-      bTop_(false), ePBC_(-1)
+TopologyInformation::TopologyInformation() :
+    hasLoadedMtop_(false),
+    expandedTopology_(nullptr),
+    atoms_(nullptr),
+    bTop_(false),
+    ePBC_(-1)
 {
 }
 
 
-TopologyInformation::~TopologyInformation()
-{
-}
+TopologyInformation::~TopologyInformation() {}
 
-void TopologyInformation::fillFromInputFile(const std::string &filename)
+void TopologyInformation::fillFromInputFile(const std::stringfilename)
 {
     mtop_ = std::make_unique<gmx_mtop_t>();
     // TODO When filename is not a .tpr, then using readConfAndAtoms
@@ -82,9 +81,7 @@ void TopologyInformation::fillFromInputFile(const std::string &filename)
     // TODO Once there are fewer callers of the file-reading
     // functionality, make them read directly into std::vector.
     rvec *x, *v;
-    readConfAndTopology(filename.c_str(), &bTop_, mtop_.get(),
-                        &ePBC_, &x, &v,
-                        boxtop_);
+    readConfAndTopology(filename.c_str(), &bTop_, mtop_.get(), &ePBC_, &x, &v, boxtop_);
     xtop_.assign(x, x + mtop_->natoms);
     vtop_.assign(v, v + mtop_->natoms);
     sfree(x);
@@ -92,7 +89,7 @@ void TopologyInformation::fillFromInputFile(const std::string &filename)
     hasLoadedMtop_ = true;
     // TODO: Only load this here if the tool actually needs it; selections
     // take care of themselves.
-    for (gmx_moltype_t &moltype : mtop_->moltype)
+    for (gmx_moltype_tmoltype : mtop_->moltype)
     {
         if (!moltype.atoms.haveMass)
         {
@@ -102,7 +99,7 @@ void TopologyInformation::fillFromInputFile(const std::string &filename)
     }
 }
 
-const gmx_localtop_t *TopologyInformation::expandedTopology() const
+const gmx_localtop_tTopologyInformation::expandedTopology() const
 {
     // Do lazy initialization
     if (expandedTopology_ == nullptr && hasTopology())
@@ -118,7 +115,7 @@ namespace
 {
 
 //! Helps implement lazy initialization.
-AtomsDataPtr makeAtoms(const TopologyInformation &top_)
+AtomsDataPtr makeAtoms(const TopologyInformationtop_)
 {
     AtomsDataPtr atoms(new t_atoms);
     if (top_.hasTopology())
@@ -132,9 +129,9 @@ AtomsDataPtr makeAtoms(const TopologyInformation &top_)
     return atoms;
 }
 
-}   // namespace
+} // namespace
 
-const t_atoms *TopologyInformation::atoms() const
+const t_atomsTopologyInformation::atoms() const
 {
     // Do lazy initialization
     if (atoms_ == nullptr)
@@ -154,8 +151,7 @@ AtomsDataPtr TopologyInformation::copyAtoms() const
     return makeAtoms(*this);
 }
 
-ArrayRef<const RVec>
-TopologyInformation::x() const
+ArrayRef<const RVec> TopologyInformation::x() const
 {
     if (xtop_.empty())
     {
@@ -164,8 +160,7 @@ TopologyInformation::x() const
     return xtop_;
 }
 
-ArrayRef<const RVec>
-TopologyInformation::v() const
+ArrayRef<const RVec> TopologyInformation::v() const
 {
     if (vtop_.empty())
     {
@@ -174,15 +169,13 @@ TopologyInformation::v() const
     return vtop_;
 }
 
-void
-TopologyInformation::getBox(matrix box) const
+void TopologyInformation::getBox(matrix box) const
 {
     GMX_RELEASE_ASSERT(box != nullptr, "Must have valid box to fill");
-    copy_mat(const_cast<rvec *>(boxtop_), box);
+    copy_mat(const_cast<rvec*>(boxtop_), box);
 }
 
-const char *
-TopologyInformation::name() const
+const char* TopologyInformation::name() const
 {
     if (hasTopology() && mtop_->name)
     {
@@ -191,7 +184,7 @@ TopologyInformation::name() const
     return nullptr;
 }
 
-gmx_rmpbc_t gmx_rmpbc_init(const gmx::TopologyInformation &topInfo)
+gmx_rmpbc_t gmx_rmpbc_init(const gmx::TopologyInformationtopInfo)
 {
     GMX_RELEASE_ASSERT(topInfo.hasTopology(), "Cannot remove PBC without a topology");