I want to add two boost multi-arrays in C++.
- The first challenge is the alignment of the two arrays. One of these arrays is vertically aligned and the other is horizontally aligned as shown in the figure below. They shall be added, resulting in a 3-dimensional array (see also below). The easiest/laziest way would be to duplicate the vertically aligned array along its y-axis until it has the same width as the horizontally aligned array. Additionally duplicating the horizontally aligned array along its x-axis until it has the same height as the vertically aligned array. Then I would need a possibility to add two 3-dimensionally boost multi-arrays.
- The second challenge is, that adding boost multi-arrays is not natively supported by boost, or I am wrong on this point? I want to avoid for-loops and take advantage of the straight allocated memory which makes e.g. copy operations less time intensive.
Does anybody have a good recommendation to handle this quest?