Code like the following makes two copy operations instead of one. This allows better logical separation with the structure of the vector model, but it caries a cost. Maybe a constructor that accepts a scalar multiplier as a optional argument could allow future improvements. Maybe vectors could carry a scalar in their structure, to be multiplied in when appropriate. This would be quite complex and would affect every access though.
libalgebra/tensor.h:
inline shuffle_tensor operator*(const SCA& rhs) const { shuffle_tensor result(*this); result *= rhs; return result; }
Code like the following makes two copy operations instead of one. This allows better logical separation with the structure of the vector model, but it caries a cost. Maybe a constructor that accepts a scalar multiplier as a optional argument could allow future improvements. Maybe vectors could carry a scalar in their structure, to be multiplied in when appropriate. This would be quite complex and would affect every access though.
libalgebra/tensor.h:
inline shuffle_tensor operator*(const SCA& rhs) const { shuffle_tensor result(*this); result *= rhs; return result; }