The dynamic and static rank tensors have a constructor, which takes the tensor of different layouts, implemented incorrectly with an unknown or unimplemented member function. To fix the issue, we have to use the copy algorithm, but instead, we are just copying the whole container, without considering the layout. Furthermore, we are not asserting or checking the type of the tensor if it matches the current tensor.
Current Implementation
template<typename OTE>
explicit inline tensor_core (const tensor_core<OTE> &other)
: tensor_expression_type<self_type>{}
, _extents (ublas::begin(other.extents ()), ublas::end (other.extents ()))
, _strides (ublas::begin(other.extents ()), ublas::end (other.extents ()))
, _container( std::begin(other.container()), std::end (other.container()))
{
}
To fix:
- use the method
tensor::base instead of unknown method tensor::container
- use the
copy algorithm from the boost/numeric/ublas/tensor/algorithm.hpp
- static assert to check if the types are the same or not.
After the fix, enable the test that tests the construction of the other layout.
The dynamic and static rank tensors have a constructor, which takes the tensor of different layouts, implemented incorrectly with an unknown or unimplemented member function. To fix the issue, we have to use the
copyalgorithm, but instead, we are just copying the whole container, without considering the layout. Furthermore, we are not asserting or checking the type of the tensor if it matches the current tensor.Current Implementation
To fix:
tensor::baseinstead of unknown methodtensor::containercopyalgorithm from theboost/numeric/ublas/tensor/algorithm.hppAfter the fix, enable the test that tests the construction of the other layout.