53 template<
typename dtype>
68 if (arraySize != inArray2.
size() || arraySize < 2 || arraySize > 3)
80 NdArray<dtype> returnArray = { in1[0] * in2[1] - in1[1] * in2[0] };
85 dtype i = in1[1] * in2[2] - in1[2] * in2[1];
86 dtype
j = -(in1[0] * in2[2] - in1[2] * in2[0]);
87 dtype k = in1[0] * in2[1] - in1[1] * in2[0];
102 if (arrayShape != inArray2.
shape() || arrayShape.
rows < 2 || arrayShape.
rows > 3)
107 Shape returnArrayShape;
108 returnArrayShape.
cols = arrayShape.
cols;
109 if (arrayShape.
rows == 2)
111 returnArrayShape.
rows = 1;
115 returnArrayShape.
rows = 3;
119 for (
uint32 col = 0; col < arrayShape.
cols; ++col)
121 const auto theCol =
static_cast<int32>(col);
126 returnArray.
put({ 0,
static_cast<int32>(returnArrayShape.
rows) }, { theCol, theCol + 1 }, vecCross);
134 if (arrayShape != inArray2.
shape() || arrayShape.
cols < 2 || arrayShape.
cols > 3)
139 Shape returnArrayShape;
140 returnArrayShape.
rows = arrayShape.
rows;
141 if (arrayShape.
cols == 2)
143 returnArrayShape.
cols = 1;
147 returnArrayShape.
cols = 3;
151 for (
uint32 row = 0; row < arrayShape.
rows; ++row)
153 const auto theRow =
static_cast<int32>(row);
158 returnArray.
put({ theRow, theRow + 1 }, { 0,
static_cast<int32>(returnArrayShape.
cols) }, vecCross);