Tensor.Map Method
Definition
Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.1
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.1
Overload List
Map<T, TResult>(Func<T, TResult>, Tensor<T>, Tensor<Boolean>, TensorElementOrder) | Applies a function to the corresponding elements of two tensors and returns the result in a third tensor. |
Map<T, U, TResult>(Func<T, U, TResult>, Tensor<T>, Tensor<U>, Tensor<Boolean>, TensorElementOrder) | Applies a function to the corresponding elements of two tensors and returns the result in a third tensor. |
Map<T, TResult>(Func<T, TResult>, Tensor<T>, Tensor<Boolean>, TensorElementOrder)
Applies a function to the corresponding elements of two tensors
and returns the result in a third tensor.
public static Tensor<TResult> Map<T, TResult>(
Func<T, TResult> function,
Tensor<T> operand,
Tensor<bool>? mask = null,
TensorElementOrder order = TensorElementOrder.Automatic
)
Parameters
- function Func<T, TResult>
- A delegate that represents a function of two variables
- operand Tensor<T>
- A tensor whose elements serve as the argument to the function.
- mask Tensor<Boolean> (Optional)
- Optional. A boolean that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
- order TensorElementOrder (Optional)
- Optional. Specifies the element order of the result. By default, elements are stored in the order of operand.
Type Parameters
- T
- TResult
Return Value
Tensor<TResult>A tensor whose elements are the result of applying function to the elements of operand.
Exceptions
Argument | function is null.
-or- operand is null |
Map<T, U, TResult>(Func<T, U, TResult>, Tensor<T>, Tensor<U>, Tensor<Boolean>, TensorElementOrder)
Applies a function to the corresponding elements of two tensors
and returns the result in a third tensor.
public static Tensor<TResult> Map<T, U, TResult>(
Func<T, U, TResult> function,
Tensor<T> first,
Tensor<U> second,
Tensor<bool>? mask = null,
TensorElementOrder order = TensorElementOrder.Automatic
)
Parameters
- function Func<T, U, TResult>
- A delegate that represents a function of two variables
- first Tensor<T>
- A tensor whose elements serve as the first argument to the function.
- second Tensor<U>
- A tensor whose elements serve as the second argument to the function.
- mask Tensor<Boolean> (Optional)
- Optional. A boolean that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
- order TensorElementOrder (Optional)
- Optional. Specifies the element order of the result. By default, elements are stored in the order of first and second.
Type Parameters
- T
- U
- TResult
Return Value
Tensor<TResult>A tensor whose elements are the result of applying function to the corresponding elements of first and second.
Exceptions
Argument | function is null.
-or- first is null -or- second is null |
Dimension | The length of first does not equal the length of second. |