pow method
Calculates pow(a,b)
for each element.
Element i
is calculated with the formula:
x[i] = pow(x[i], right[i]);
If swapArguments
is true
, base and power arguments will be swapped.
Throws ArgumentError if tensor shapes are not equal.
Implementation
@override
void pow(Tensor<double> right, {bool swapArguments = false}) {
final elements = this.elements;
final rightElements = right.elements;
final n = length;
if (swapArguments) {
for (var i = 0; i < n; i++) {
elements[i] = math.pow(rightElements[i], elements[i]).toDouble();
}
} else {
for (var i = 0; i < n; i++) {
elements[i] = math.pow(elements[i], rightElements[i]).toDouble();
}
}
}