Commit ae2838a3 authored by Jens Petit's avatar Jens Petit

clang-tidy readability-identifier-naming fixes

parent fe4260bb
Pipeline #171537 passed with stages
in 2 minutes and 12 seconds
......@@ -16,11 +16,11 @@ namespace elsa::detail
* for it.
*/
template <typename T>
class ptr_iterator
class PtrIterator
{
public:
/// alias for iterator type
using self_type = ptr_iterator;
using self_type = PtrIterator;
/// the iterator category
using iterator_category = std::random_access_iterator_tag;
......@@ -34,7 +34,7 @@ namespace elsa::detail
using difference_type = typename T::difference_type;
/// constructor taking a non-owning pointer to the data
explicit ptr_iterator(pointer ptr) : _ptr(ptr) {}
explicit PtrIterator(pointer ptr) : _ptr(ptr) {}
/// de-referencing operator
reference operator*() { return *_ptr; }
......@@ -98,20 +98,20 @@ namespace elsa::detail
}
/// return the difference between iterators
difference_type operator-(ptr_iterator const& r) const { return _ptr - r._ptr; }
difference_type operator-(PtrIterator const& r) const { return _ptr - r._ptr; }
/// compare < with other iterator
bool operator<(const ptr_iterator& r) const { return _ptr < r._ptr; }
bool operator<(const PtrIterator& r) const { return _ptr < r._ptr; }
/// compare <= with other iterator
bool operator<=(const ptr_iterator& r) const { return _ptr <= r._ptr; }
bool operator<=(const PtrIterator& r) const { return _ptr <= r._ptr; }
/// compare > with other iterator
bool operator>(const ptr_iterator& r) const { return _ptr > r._ptr; }
bool operator>(const PtrIterator& r) const { return _ptr > r._ptr; }
/// compare >= with other iterator
bool operator>=(const ptr_iterator& r) const { return _ptr >= r._ptr; }
bool operator>=(const PtrIterator& r) const { return _ptr >= r._ptr; }
/// compare != with other iterator
bool operator!=(const ptr_iterator& r) const { return _ptr != r._ptr; }
bool operator!=(const PtrIterator& r) const { return _ptr != r._ptr; }
/// compare == with other iterator
bool operator==(const ptr_iterator& r) const { return _ptr == r._ptr; }
bool operator==(const PtrIterator& r) const { return _ptr == r._ptr; }
private:
/// non-owning (!) pointer to data (do not clean up or anything)
......@@ -131,11 +131,11 @@ namespace elsa::detail
* for it.
*/
template <typename T>
class const_ptr_iterator
class ConstPtrIterator
{
public:
/// alias for iterator type
using self_type = const_ptr_iterator;
using self_type = ConstPtrIterator;
/// the iterator category
using iterator_category = std::random_access_iterator_tag;
......@@ -149,7 +149,7 @@ namespace elsa::detail
using difference_type = typename T::difference_type;
/// constructor taking a non-owning pointer to the data
explicit const_ptr_iterator(pointer ptr) : _ptr(ptr) {}
explicit ConstPtrIterator(pointer ptr) : _ptr(ptr) {}
/// de-referencing operator
reference operator*() { return *_ptr; }
......@@ -213,7 +213,7 @@ namespace elsa::detail
}
/// return the difference between iterators
difference_type operator-(const_ptr_iterator const& r) const { return _ptr - r._ptr; }
difference_type operator-(ConstPtrIterator const& r) const { return _ptr - r._ptr; }
/// compare < with other iterator
bool operator<(const self_type& r) const { return _ptr < r._ptr; }
......@@ -239,9 +239,9 @@ namespace elsa
{
/// alias for the iterator for DataContainer
template <typename T>
using DataContainerIterator = detail::ptr_iterator<T>;
using DataContainerIterator = detail::PtrIterator<T>;
/// alias for the constant iterator for DataContainer
template <typename T>
using ConstDataContainerIterator = detail::const_ptr_iterator<T>;
using ConstDataContainerIterator = detail::ConstPtrIterator<T>;
} // end namespace elsa
......@@ -107,7 +107,7 @@ namespace elsa
}
if (_isComposite) {
if (_mode == compositeMode::add) {
if (_mode == CompositeMode::ADD) {
// sanity check the arguments for the intended evaluation tree leaf operation
if (_rhs->getDomainDescriptor().getNumberOfCoefficients() != x.getSize()
|| _rhs->getRangeDescriptor().getNumberOfCoefficients() != Ax.getSize()
......@@ -121,7 +121,7 @@ namespace elsa
return;
}
if (_mode == compositeMode::mult) {
if (_mode == CompositeMode::MULT) {
// sanity check the arguments for the intended evaluation tree leaf operation
if (_rhs->getDomainDescriptor().getNumberOfCoefficients() != x.getSize()
|| _lhs->getRangeDescriptor().getNumberOfCoefficients() != Ax.getSize())
......@@ -180,7 +180,7 @@ namespace elsa
}
if (_isComposite) {
if (_mode == compositeMode::add) {
if (_mode == CompositeMode::ADD) {
// sanity check the arguments for the intended evaluation tree leaf operation
if (_rhs->getRangeDescriptor().getNumberOfCoefficients() != y.getSize()
|| _rhs->getDomainDescriptor().getNumberOfCoefficients() != Aty.getSize()
......@@ -194,7 +194,7 @@ namespace elsa
return;
}
if (_mode == compositeMode::mult) {
if (_mode == CompositeMode::MULT) {
// sanity check the arguments for the intended evaluation tree leaf operation
if (_lhs->getRangeDescriptor().getNumberOfCoefficients() != y.getSize()
|| _rhs->getDomainDescriptor().getNumberOfCoefficients() != Aty.getSize())
......@@ -254,7 +254,7 @@ namespace elsa
template <typename data_t>
LinearOperator<data_t>::LinearOperator(const LinearOperator<data_t>& lhs,
const LinearOperator<data_t>& rhs, compositeMode mode)
const LinearOperator<data_t>& rhs, CompositeMode mode)
: _domainDescriptor{rhs.getDomainDescriptor().clone()},
_rangeDescriptor{lhs.getRangeDescriptor().clone()},
_lhs{lhs.clone()},
......@@ -264,7 +264,7 @@ namespace elsa
{
// sanity check the descriptors
switch (_mode) {
case compositeMode::add:
case CompositeMode::ADD:
// for addition, both domains and ranges should match
if (_lhs->getDomainDescriptor() != _rhs->getDomainDescriptor()
|| _lhs->getRangeDescriptor() != _rhs->getRangeDescriptor())
......@@ -272,7 +272,7 @@ namespace elsa
"LinearOperator: composite add domain/range mismatch");
break;
case compositeMode::mult:
case CompositeMode::MULT:
// for multiplication, domain of _lhs should match range of _rhs
if (_lhs->getDomainDescriptor() != _rhs->getRangeDescriptor())
throw std::invalid_argument(
......
......@@ -113,14 +113,14 @@ namespace elsa
friend LinearOperator<data_t> operator+(const LinearOperator<data_t>& lhs,
const LinearOperator<data_t>& rhs)
{
return LinearOperator(lhs, rhs, compositeMode::add);
return LinearOperator(lhs, rhs, CompositeMode::ADD);
}
/// friend operator* to support composition of LinearOperators (and its derivatives)
friend LinearOperator<data_t> operator*(const LinearOperator<data_t>& lhs,
const LinearOperator<data_t>& rhs)
{
return LinearOperator(lhs, rhs, compositeMode::mult);
return LinearOperator(lhs, rhs, CompositeMode::MULT);
}
/// friend function to return the adjoint of a LinearOperator (and its derivatives)
......@@ -169,17 +169,17 @@ namespace elsa
bool _isComposite{false};
/// enum class denoting the mode of composition (+, *)
enum class compositeMode { add, mult };
enum class CompositeMode { ADD, MULT };
/// variable storing the composition mode (+, *)
compositeMode _mode{compositeMode::mult};
CompositeMode _mode{CompositeMode::MULT};
/// constructor to produce an adjoint leaf node
LinearOperator(const LinearOperator<data_t>& op, bool isAdjoint);
/// constructor to produce a composite (internal node) of the evaluation tree
LinearOperator(const LinearOperator<data_t>& lhs, const LinearOperator<data_t>& rhs,
compositeMode mode);
CompositeMode mode);
};
} // namespace elsa
......@@ -40,7 +40,7 @@ namespace elsa
enum class ByteOrder { LOW_BYTE_FIRST, HIGH_BYTE_FIRST };
/// our default byte order is little endian (low byte first)
static const ByteOrder defaultByteOrder = ByteOrder::LOW_BYTE_FIRST;
static const ByteOrder DEFAULT_BYTE_ORDER = ByteOrder::LOW_BYTE_FIRST;
/// data types
enum class DataType { INT8, UINT8, INT16, UINT16, INT32, UINT32, FLOAT32, FLOAT64 };
......
......@@ -110,7 +110,7 @@ namespace elsa
{
RealVector_t tdelta = _stepDirection.template cast<real_t>().cwiseQuotient(rd);
_tDelta = (Eigen::abs(rd.array()) > EPS.array()).select(tdelta, MAX);
_tDelta = (Eigen::abs(rd.array()) > _EPS.array()).select(tdelta, _MAX);
}
void TraverseAABB::initMax(const RealVector_t& rd)
......@@ -121,7 +121,7 @@ namespace elsa
.cwiseQuotient(rd)
.matrix();
_tMax = (Eigen::abs(rd.array()) > EPS.array()).select(tmax, MAX);
_tMax = (Eigen::abs(rd.array()) > _EPS.array()).select(tmax, _MAX);
}
bool TraverseAABB::isCurrentPositionInAABB(index_t index) const
......
......@@ -81,13 +81,13 @@ namespace elsa
real_t _tExit{0.0};
/// constant vector containing epsilon
const RealVector_t EPS{
const RealVector_t _EPS{
RealVector_t(_aabb._dim).setConstant(std::numeric_limits<real_t>::epsilon())};
/// constant vector containing the maximum number
const RealVector_t MAX{
const RealVector_t _MAX{
RealVector_t(_aabb._dim).setConstant(std::numeric_limits<real_t>::max())};
/// constant to decide whether we are in next voxel
const real_t NEXT_VOXEL_THRESHOLD{0.01};
const real_t _NEXT_VOXEL_THRESHOLD{0.01};
/// compute the entry and exit points of ray r with the volume (aabb)
void calculateAABBIntersections(const Ray& r);
......
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