Right now, you can do matrix multiplication this way:

```
// A = 1 0
// 0 1
const double A[2][2] = { { 1, 0 }, { 1, 0} };
// B = 1 0 0
// 0 1 0
const double B[2][3] = { { 1, 0, 0 }, { 0, 1, 0 } };
double C[2][3]
vtkMath::MultiplyMatrix(A, B, 2 /* rowA*/, 2 /*colA*/, 2 /*rowB*/, 3 /*colB*/, C)
```

You need to put double** or float** as inputs and output. Now, using ranges, one could do that:

```
vtkNew<vtkDoubleArray> arrayOfMatricesA, arrayOfMatricesB, arrayOfMatricesC;
/**
* Depending on the matrix dimensions, fill the arrays.
* One could fill matrices row by row.
*/
// rangeA is a range of 2x2 matrices
auto rangeA = vtk::DataArrayTupleRange<4>(arrayOfMatricesA)
// rangeB is a range of 2x3 matrices
auto rangeB = vtk::DataArrayTupleRange<6>(arrayOfMatricesB);
// rangeC is a range of 2x3 matrices
auto rangeC = vtk::DataArrayTupleRange<6>(arrayOfMatricesC);
using Scalar = typename decltype<rangeC>::value_type;
for (vtkIdType id = 0; id < arrayOfMatricesA->GetNumberOfTuples(); ++id)
{
// transposeA and transposeB would be false by default, but I put them for completeness
vtkMath::MultiplyMatrix<Scalar, 2 /*rowA*/, 2 /*colA == rowB*/, 3 /*colB*/,
false /*transposedA*/, false /*transposedB*/>
(rangeA[id], rangeB[id], rangeC[id]);
}
```

You could use the first example as well by feeding `*A`

, `*B`

, and `*C`

in this templated version.