mdspan


1. Dynamic Multidimensional Array Allocation

// Create a 3-dimensional array with 2x3x4 dimensions
mdspan<int> arr(2, 3, 4);

2. Accessing Elements

// Get the value at position (0, 1, 2)
auto value = arr(0, 1, 2);

3. Iterating over Elements

for (auto& e : arr) {
  // Process each element
}

4. Slicing

// Get a slice of the array corresponding to the second row
mdspan<int> row = arr[1];

5. Concatenation

// Concatenate two 2-dimensional arrays into a 3-dimensional array
mdspan<int> arr1 = mdspan<int>(2, 3);
mdspan<int> arr2 = mdspan<int>(2, 3);
mdspan<int> arr3 = mdspan<int>(2, 2, 3);
arr3.insert(0, arr1);
arr3.insert(1, arr2);

6. Index Translation

7. Index Translation (Reverse)

8. Converting to and from Eigen::Tensor

9. Converting to and from std::vector

10. Creating an mdspan from a Buffer

11. Creating an mdspan from a Pointer

12. Reshaping

13. Broadcasting

14. Transposing

15. Element-wise Operations

16. Reductions

17. Filtering

18. Sorting

19. Creating an mdspan from an STL Container

20. Creating an mdspan from a Range

21. Index Selection

22. Strided Access

23. Element-wise Logical Operations

24. Element-wise Bitwise Operations

25. Element-wise Comparisons

26. Element-wise Mathematical Functions

27. Element-wise Rounding

28. Reductions with Masks

29. Transposing Irregular Arrays

30. Element-wise Comparisons with Masks

31. Striding with Masks

32. Element-wise Bitwise Shifts

33. Element-wise Absolute Values

34. Element-wise Clipping

35. Element-wise Modulus

36. Element-wise Exponents

37. Element-wise Maximums

38. Element-wise Minimums

39. Element-wise Rounding to Nearest

40. Element-wise Floating-Point Comparisons

41. Element-wise Trigonometric Functions

42. Element-wise Hyperbolic Functions

43. Element-wise Logarithmic Functions

44. Element-wise Power Functions

45. Element-wise Square Roots

46. Element-wise Reciprocal

47. Element-wise Special Functions

48. Element-wise NaN and Infinity Checks

49. Element-wise Finite Checks

50. Element-wise Fused Multiply-Add