Tensor.Pow Method

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.0

Overload List

Pow<T>(Tensor<T>, T, Tensor<T>, Tensor<Boolean>, TensorElementOrder)

Raises the elements of a tensor to a power..
C#
public static Tensor<T> Pow<T>(
	Tensor<T> left,
	T right,
	Tensor<T>? result = null,
	Tensor<bool>? mask = null,
	TensorElementOrder order = TensorElementOrder.Automatic
)

Parameters

left  Tensor<T>
A tensor that serves as the left operand.
right  T
A scalar that serves as the right operand.
result  Tensor<T>  (Optional)
Optional. The tensor that is to hold the result. May be null.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean tensor that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
order  TensorElementOrder  (Optional)
Optional. If result is null, the desired ordering in memory of the result.

Type Parameters

T
The type of the elements of the tensor.

Return Value

Tensor<T>
A tensor of the same shape as left whose elements are equal to the power of the corresponding elements of left and right.

Exceptions

Pow<T>(Tensor<T>, Tensor<T>, Tensor<T>, Tensor<Boolean>, TensorElementOrder)

Raises the elements of a tensor to a power.
C#
public static Tensor<T> Pow<T>(
	Tensor<T> left,
	Tensor<T> right,
	Tensor<T>? result = null,
	Tensor<bool>? mask = null,
	TensorElementOrder order = TensorElementOrder.Automatic
)

Parameters

left  Tensor<T>
A tensor that serves as the left operand.
right  Tensor<T>
A tensor that serves as the right operand.
result  Tensor<T>  (Optional)
Optional. The tensor that is to hold the result. May be null.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean tensor that specifies for which elements should be included in the operation. If null (the default), the operation is applied everywhere.
order  TensorElementOrder  (Optional)
Optional. If result is null, the desired ordering in memory of the result.

Type Parameters

T
The type of the elements of the tensors.

Return Value

Tensor<T>
A tensor of the same shape as left and right whose elements are equal to the power of the corresponding elements of left and right.

Exceptions

ArgumentNullException

left is null.

-or-

right is null.

Pow<T>(Tensor<T>, Tensor<Int32>, Tensor<T>, Tensor<Boolean>, TensorElementOrder)

Raises the elements of a tensor to an integer power.
C#
public static Tensor<T> Pow<T>(
	Tensor<T> left,
	Tensor<int> right,
	Tensor<T>? result = null,
	Tensor<bool>? mask = null,
	TensorElementOrder order = TensorElementOrder.Automatic
)

Parameters

left  Tensor<T>
A tensor that serves as the left operand.
right  Tensor<Int32>
A tensor that serves as the right operand.
result  Tensor<T>  (Optional)
Optional. The tensor that is to hold the result. May be null.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean tensor that specifies for which elements should be included in the operation. If null (the default), the operation is applied everywhere.
order  TensorElementOrder  (Optional)
Optional. If result is null, the desired ordering in memory of the result.

Type Parameters

T
The type of the elements of the tensors.

Return Value

Tensor<T>
A tensor of the same shape as left and right whose elements are equal to the power of the corresponding elements of left and right.

Exceptions

ArgumentNullException

left is null.

-or-

right is null.

Pow<T>(Tensor<T>, Int32, Tensor<T>, Tensor<Boolean>, TensorElementOrder)

Raises the elements of a tensor to an integer power..
C#
public static Tensor<T> Pow<T>(
	Tensor<T> left,
	int right,
	Tensor<T>? result = null,
	Tensor<bool>? mask = null,
	TensorElementOrder order = TensorElementOrder.Automatic
)

Parameters

left  Tensor<T>
A tensor that serves as the left operand.
right  Int32
A scalar that serves as the right operand.
result  Tensor<T>  (Optional)
Optional. The tensor that is to hold the result. May be null.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean tensor that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
order  TensorElementOrder  (Optional)
Optional. If result is null, the desired ordering in memory of the result.

Type Parameters

T
The type of the elements of the tensor.

Return Value

Tensor<T>
A tensor of the same shape as left whose elements are equal to the power of the corresponding elements of left and right.

Exceptions

Pow<T>(T, Tensor<T>, Tensor<T>, Tensor<Boolean>, TensorElementOrder)

Raises a scalar to a power..
C#
public static Tensor<T> Pow<T>(
	T left,
	Tensor<T> right,
	Tensor<T>? result = null,
	Tensor<bool>? mask = null,
	TensorElementOrder order = TensorElementOrder.Automatic
)

Parameters

left  T
A scalar that serves as the left operand.
right  Tensor<T>
A tensor that serves as the right operand.
result  Tensor<T>  (Optional)
Optional. The tensor that is to hold the result. May be null.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean tensor that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
order  TensorElementOrder  (Optional)
Optional. If result is null, the desired ordering in memory of the result.

Type Parameters

T
The type of the elements of the tensor.

Return Value

Tensor<T>
A tensor of the same shape as right whose elements are equal to the power of left and the corresponding elements of right.

Exceptions

ArgumentNullException

right is null.

Pow<T>(T, Tensor<Int32>, Tensor<T>, Tensor<Boolean>, TensorElementOrder)

Raises a scalar to an integer power..
C#
public static Tensor<T> Pow<T>(
	T left,
	Tensor<int> right,
	Tensor<T>? result = null,
	Tensor<bool>? mask = null,
	TensorElementOrder order = TensorElementOrder.Automatic
)

Parameters

left  T
A scalar that serves as the left operand.
right  Tensor<Int32>
A tensor that serves as the right operand.
result  Tensor<T>  (Optional)
Optional. The tensor that is to hold the result. May be null.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean tensor that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
order  TensorElementOrder  (Optional)
Optional. If result is null, the desired ordering in memory of the result.

Type Parameters

T
The type of the elements of the tensor.

Return Value

Tensor<T>
A tensor of the same shape as right whose elements are equal to the power of left and the corresponding elements of right.

Exceptions

ArgumentNullException

right is null.

See Also