|
Stratax 0.3.1
|
Version: v0.2.0
Status: Complete
Header: include/stratax/algorithms/Reshape.hpp
Reshape.hpp provides shape-changing copy helpers that preserve flat storage order.
reshape returns a tensor with a requested shape, while flatten returns a rank-1 vector.
The reshape module is responsible for:
The reshape module is not responsible for:
-1 style placeholders)Depends on:
include/stratax/core/dtypes/Concepts.hppinclude/stratax/core/Shape.hppinclude/stratax/containers/Tensor.hppinclude/stratax/containers/Vector.hppThe following conditions are always true:
reshape returns Tensor<value_type>.flatten returns Vector<value_type>.Throws
Exceptions::ShapeError when target shape element count differs from source sizeshape.elements()Complexity
Complexity
| Operation | Complexity |
|---|---|
reshape | O(n + r) |
flatten | O(n) |
n is element count and r is rank.
The module keeps behavior explicit and safe: reshape validates total size first and always performs a full copy.