Skip to content

Commit

Permalink
Clang Format
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Jun 26, 2024
1 parent c2f8cfd commit d9d63da
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Result<> ComputeMisorientations::operator()()
auto& outMisorientationList = m_DataStructure.getDataRefAs<NeighborList<float32>>(m_InputValues->MisorientationListArrayName);
outMisorientationList.setLists(tempMisorientationLists);
// Set the vector for each list into the NeighborList Object
//for(size_t i = 1; i < totalFeatures; i++)
// for(size_t i = 1; i < totalFeatures; i++)
//{
// // Construct a shared vector<float> through the std::vector<> copy constructor.
// NeighborList<float>::SharedVectorType sharedMisorientationList(new std::vector<float>(tempMisorientationLists[i]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ Result<> ComputeSlipTransmissionMetrics::operator()()
F7L.setLists(F7Lists);
mPrimeL.setLists(mPrimeLists);

//for(usize i = 1; i < totalFeatures; i++)
// for(usize i = 1; i < totalFeatures; i++)
//{
// Float32NeighborList::SharedVectorType f1L(new std::vector<float32>(F1Lists[i]));
// F1L.setList(static_cast<int32>(i), f1L);
// Float32NeighborList::SharedVectorType f1L(new std::vector<float32>(F1Lists[i]));
// F1L.setList(static_cast<int32>(i), f1L);

// Float32NeighborList::SharedVectorType f1sptL(new std::vector<float32>(F1sPtLists[i]));
// F1sptL.setList(static_cast<int32>(i), f1sptL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ Result<> ComputeFeatureClustering::operator()()

clusteringList.setLists(clusters);

//for(usize i = 1; i < totalFeatures; i++)
// for(usize i = 1; i < totalFeatures; i++)
//{
// // Set the vector for each list into the Clustering Object
// NeighborList<float32>::SharedVectorType sharedClusterLst(new std::vector<float32>);
// sharedClusterLst->assign(clusters[i].begin(), clusters[i].end());
// clusteringList.setList(static_cast<int>(i), sharedClusterLst);
//}
// // Set the vector for each list into the Clustering Object
// NeighborList<float32>::SharedVectorType sharedClusterLst(new std::vector<float32>);
// sharedClusterLst->assign(clusters[i].begin(), clusters[i].end());
// clusteringList.setList(static_cast<int>(i), sharedClusterLst);
// }
return {};
}
2 changes: 1 addition & 1 deletion src/simplnx/DataStructure/AbstractDataStore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class AbstractDataStore : public IDataStore
index_type numComponents = getNumberOfComponents();
index_type offset = tupleIndex * numComponents;
usize count = values.size();
for (usize i = 0; i < count; i++)
for(usize i = 0; i < count; i++)
{
setValue(offset + i, values[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/simplnx/DataStructure/AbstractListStore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class AbstractListStore
{
usize count = lists.size();
usize maxSize = 0;
for (const auto& list : lists)
for(const auto& list : lists)
{
maxSize = std::max(maxSize, list.size());
}
Expand Down
6 changes: 3 additions & 3 deletions src/simplnx/DataStructure/AbstractStringStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ bool AbstractStringStore::operator==(const std::vector<std::string>& values) con
{
return false;
}
for (usize i = 0; i < count; i++)
for(usize i = 0; i < count; i++)
{
if (values[i] != getValue(i))
if(values[i] != getValue(i))
{
return false;
}
Expand All @@ -86,4 +86,4 @@ bool AbstractStringStore::operator!=(const std::vector<std::string>& values) con
bool equals = (*this) == values;
return !equals;
}
}
} // namespace nx::core
2 changes: 1 addition & 1 deletion src/simplnx/DataStructure/DataMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ bool DataMap::contains(const std::string& name) const
{
for(auto& iter : m_Map)
{
if (iter.second == nullptr)
if(iter.second == nullptr)
{
continue;
}
Expand Down
38 changes: 19 additions & 19 deletions src/simplnx/DataStructure/ListStore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class ListStore : public AbstractListStore<T>
using shape_type = typename std::vector<uint64>;

/**
* @brief Constructs a ListStore using the specified tuple shape and list size.
* @param tupleShape
* @param listSize
* @brief Constructs a ListStore using the specified tuple shape and list size.
* @param tupleShape
* @param listSize
*/
ListStore(shape_type tupleShape, usize listSize = 10)
: parent_type()
Expand All @@ -37,18 +37,18 @@ class ListStore : public AbstractListStore<T>
}

/**
* @brief Creates a ListStore from a vector of vectors.
* @param vectors
*/
* @brief Creates a ListStore from a vector of vectors.
* @param vectors
*/
ListStore(const typename std::vector<shared_vector_type>& vectors)
: parent_type()
{
this->setData(vectors);
}

/**
* @brief Copy constructor
*/
* @brief Copy constructor
*/
ListStore(const ListStore& other)
: parent_type(other)
, m_XtensorListSize(other.m_XtensorListSize)
Expand All @@ -57,8 +57,8 @@ class ListStore : public AbstractListStore<T>
}

/**
* @brief Move constructor
*/
* @brief Move constructor
*/
ListStore(ListStore&& copy) noexcept
: parent_type(std::move(copy))
, m_Array(std::move(copy.m_Array))
Expand All @@ -68,18 +68,18 @@ class ListStore : public AbstractListStore<T>
~ListStore() = default;

/**
* @brief Returns a reference to the underlying xtensor array.
* @return xarray_type&
* @brief Returns a reference to the underlying xtensor array.
* @return xarray_type&
*/
xarray_type& xarray() override
{
return *m_Array.get();
}

/**
* @brief Returns a const reference to the underlying xtensor array.
* @return const xarray_type&
*/
* @brief Returns a const reference to the underlying xtensor array.
* @return const xarray_type&
*/
const xarray_type& xarray() const override
{
return *m_Array.get();
Expand Down Expand Up @@ -107,7 +107,7 @@ class ListStore : public AbstractListStore<T>

usize numTuples = this->getNumberOfLists();
usize newTupleCount = std::accumulate(tupleShape.begin(), tupleShape.end(), static_cast<usize>(1), std::multiplies<usize>());

// Avoid size 0
if(newTupleCount == 0)
{
Expand All @@ -126,7 +126,7 @@ class ListStore : public AbstractListStore<T>
{
for(usize tuple = 0; tuple < numTuples && tuple < newTupleCount; tuple++)
{
usize offset = tuple * (internalSize); // New xarray
usize offset = tuple * (internalSize); // New xarray
usize offset2 = tuple * (m_XtensorListSize); // Current xarray
// Copy individual list at tuple
for(usize i = 0; i < m_XtensorListSize && i < internalSize; i++)
Expand Down Expand Up @@ -154,12 +154,12 @@ class ListStore : public AbstractListStore<T>
usize newTupleCount = std::accumulate(tupleShape.begin(), tupleShape.end(), static_cast<usize>(1), std::multiplies<usize>());

// Avoid size 0
if (newTupleCount == 0)
if(newTupleCount == 0)
{
tupleShape = {1};
newTupleCount = 1;
}
if (internalSize == 0)
if(internalSize == 0)
{
internalSize = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/simplnx/DataStructure/NeighborList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ std::vector<typename NeighborList<T>::VectorType> NeighborList<T>::getVectors()
{
usize count = m_Store->size();
std::vector<typename NeighborList<T>::VectorType> vectors(count);
for (usize i = 0; i < count; i++)
for(usize i = 0; i < count; i++)
{
vectors[i] = m_Store->at(i);
}
Expand Down
2 changes: 1 addition & 1 deletion src/simplnx/DataStructure/StringArray.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "simplnx/DataStructure/IArray.hpp"
#include "simplnx/DataStructure/AbstractStringStore.hpp"
#include "simplnx/DataStructure/IArray.hpp"

#include <mutex>

Expand Down
6 changes: 3 additions & 3 deletions src/simplnx/DataStructure/StringStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ StringStore::StringStore(const std::vector<std::string>& strings)
{
usize count = strings.size();
m_xarray.resize({count});
for (usize i = 0; i < count; i++)
for(usize i = 0; i < count; i++)
{
m_xarray.flat(i) = strings[i];
}
Expand All @@ -35,7 +35,7 @@ void StringStore::resize(usize count)
{
usize oldSize = size();
auto data = xt::xarray<std::string>::from_shape({count});
for (usize i = 0; i < count && i < oldSize; i++)
for(usize i = 0; i < count && i < oldSize; i++)
{
data.flat(i) = m_xarray.flat(i);
}
Expand All @@ -58,7 +58,7 @@ AbstractStringStore& StringStore::operator=(const std::vector<std::string>& valu
{
usize count = values.size();
m_xarray = xt::xarray<std::string>::from_shape({count});
for (usize i = 0; i < count; i++)
for(usize i = 0; i < count; i++)
{
m_xarray.flat(i) = values[i];
}
Expand Down

0 comments on commit d9d63da

Please sign in to comment.