-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features/subtensor #126
base: develop
Are you sure you want to change the base?
Features/subtensor #126
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reports by clang tidy
|
||
fixture() | ||
{ | ||
static_assert(shapes.size() == multi_index.size(),""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use unary static_assert
when the string literal is an empty string [modernize-unary-static-assert]
static_assert(shapes.size() == multi_index.size(),"");
^ ~~
Reported as warning by clang-tidy.
fixture() | ||
{ | ||
static_assert(shapes.size() == multi_index.size(),""); | ||
static_assert(shapes.size() == indexf.size(),""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use unary static_assert
when the string literal is an empty string [modernize-unary-static-assert]
static_assert(shapes.size() == indexf.size(),"");
^ ~~
Reported as warning by clang-tidy.
{ | ||
static_assert(shapes.size() == multi_index.size(),""); | ||
static_assert(shapes.size() == indexf.size(),""); | ||
static_assert(shapes.size() == indexl.size(),""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use unary static_assert
when the string literal is an empty string [modernize-unary-static-assert]
static_assert(shapes.size() == indexl.size(),"");
^ ~~
Reported as warning by clang-tidy.
static_assert(shapes.size() == multi_index.size(),""); | ||
static_assert(shapes.size() == indexf.size(),""); | ||
static_assert(shapes.size() == indexl.size(),""); | ||
static_assert(shapes.size() == ranks.size(),""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use unary static_assert
when the string literal is an empty string [modernize-unary-static-assert]
static_assert(shapes.size() == ranks.size(),"");
^ ~~
Reported as warning by clang-tidy.
} | ||
|
||
|
||
static inline auto shapes = std::array<extents_t,15> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
15 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
static inline auto shapes = std::array<extents_t,15>
^
Reported as warning by clang-tidy.
} | ||
|
||
/** @brief Returns the span strides of the subtensor */ | ||
inline auto const& spans () const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function spans
should be marked [[nodiscard]] [modernize-use-nodiscard]
inline auto const& spans () const {
^
[[nodiscard]]
Reported as warning by clang-tidy.
}; | ||
|
||
|
||
} // namespaces boost::numeric::ublas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace boost::numeric::ublas
ends with an unrecognized comment [google-readability-namespace-comments]
} // namespaces boost::numeric::ublas
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// namespace boost::numeric::ublas
include/boost/numeric/ublas/tensor/subtensor.hpp:26:11: note: namespace 'boost::numeric::ublas' starts here
namespace boost::numeric::ublas {
^
Reported as warning by clang-tidy.
/// \file subtensor_utility.hpp Definition for the tensor template class | ||
|
||
#ifndef _BOOST_NUMERIC_UBLAS_TENSOR_SUBTENSOR_UTILITY_HPP_ | ||
#define _BOOST_NUMERIC_UBLAS_TENSOR_SUBTENSOR_UTILITY_HPP_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declaration uses identifier _BOOST_NUMERIC_UBLAS_TENSOR_SUBTENSOR_UTILITY_HPP_
, which is a reserved identifier [bugprone-reserved-identifier]
#define _BOOST_NUMERIC_UBLAS_TENSOR_SUBTENSOR_UTILITY_HPP_
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BOOST_NUMERIC_UBLAS_TENSOR_SUBTENSOR_UTILITY_HPP_
Reported as warning by clang-tidy.
|
||
if constexpr ( is_sliced ){ | ||
if(size == 0) return span_type(0 , extent0); | ||
else if(first== max) return span_type(extent0 , extent0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use else
after return
[readability-else-after-return]
else if(first== max) return span_type(extent0 , extent0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reported as warning by clang-tidy.
else { | ||
size_type step = s.step (); | ||
if(size == 0) return span_type(0 , size_type(1), extent0); | ||
else if(first== max) return span_type(extent0 , step, extent0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use else
after return
[readability-else-after-return]
else if(first== max) return span_type(extent0 , step, extent0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reported as warning by clang-tidy.
87ee607
to
50e19e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reports by clang tidy
|
||
using sspan = span<std::size_t>; | ||
|
||
} // namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
namespace boost::numeric::ublas
ends with a comment that refers to a wrong namespace `` [google-readability-namespace-comments]
} // namespace
^~~~~~~~~~~~~
// namespace boost::numeric::ublas
include/boost/numeric/ublas/tensor/span.hpp:25:11: note: namespace 'boost::numeric::ublas' starts here
namespace boost::numeric::ublas {
^
Reported as warning by clang-tidy.
BOOST_UBLAS_INLINE | ||
subtensor (tensor_type& t) | ||
: super_type () | ||
, spans_ () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializer for member spans_
is redundant [readability-redundant-member-init]
, spans_ ()
^~~~~~~~~~~~~~~~
Reported as warning by clang-tidy.
} | ||
|
||
template<typename ... span_types> | ||
subtensor(tensor_type& t, span_types&& ... spans) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructors that are callable with a single argument must be marked explicit to avoid unintentional implicit conversions [hicpp-explicit-conversions]
subtensor(tensor_type& t, span_types&& ... spans)
^
explicit
Reported as warning by clang-tidy.
explicit | ||
subtensor (tensor_type const& t) | ||
: super_type () | ||
, spans_ () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializer for member spans_
is redundant [readability-redundant-member-init]
, spans_ ()
^~~~~~~~~~~~~~~~
Reported as warning by clang-tidy.
|
||
size_type step = s.step (); | ||
if(size == 0) return span_type(0 , 1u, extent0); | ||
else if(first== span_type::max) return span_type(extent0 , step, extent0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use else
after return
[readability-else-after-return]
else if(first== span_type::max) return span_type(extent0 , step, extent0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reported as warning by clang-tidy.
Hi, I just wanted to let you know that I would be interested in trying this feature! |
This Pull request Passed all of clang-tidy tests. 👍 |
No description provided.