Skip to content
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

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Features/subtensor #126

wants to merge 9 commits into from

Conversation

amitsingh19975
Copy link
Collaborator

No description provided.

Copy link

@github-actions github-actions bot left a 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(),"");

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(),"");

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(),"");

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(),"");

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>

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 {

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

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_

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);

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);

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.

@bassoy bassoy force-pushed the features/subtensor branch from 87ee607 to 50e19e5 Compare December 11, 2022 22:14
Copy link

@github-actions github-actions bot left a 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

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_ ()

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)

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_ ()

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);

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.

@freifrauvonbleifrei
Copy link

Hi, I just wanted to let you know that I would be interested in trying this feature!

@github-actions
Copy link

This Pull request Passed all of clang-tidy tests. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants