Vector<T>.Map Core Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.7.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.7.0
Overload List
| Map | Applies a function to the elements of a vector. |
| Map | Applies a function to the elements of a vector. |
| Map | Applies a stateful function to the elements of a vector. |
MapCore<U>(Func<T, U>, Vector<U>)
Applies a function to the elements of a vector.
protected virtual Vector<U> MapCore<U>(
Func<T, U> function,
Vector<U>? result
)
Parameters
- function Func<T, U>
- A function of one variable
- result Vector<U>
- The vector that is to hold the result. May be null.
Type Parameters
- U
Return Value
Vector<U>The vector result.
MapCore<U>(Func<Int32, T, U>, Vector<U>)
Applies a function to the elements of a vector.
protected virtual Vector<U> MapCore<U>(
Func<int, T, U> function,
Vector<U>? result
)
Parameters
- function Func<Int32, T, U>
- A function of one variable
- result Vector<U>
- The vector that is to hold the result. May be null.
Type Parameters
- U
Return Value
Vector<U>The vector result.
MapCore<TState, U>(Func<T, TState, U>, TState, Vector<U>)
Applies a stateful function to the elements of a vector.
protected virtual Vector<U> MapCore<TState, U>(
Func<T, TState, U> function,
TState state,
Vector<U>? result
)
Parameters
- function Func<T, TState, U>
- A function of one value and one state value.
- state TState
- The state value passed to function.
- result Vector<U>
- The vector that is to hold the result. May be null.
Type Parameters
- TState
- The type of state passed to function.
- U
- The element type of the result vector.
Return Value
Vector<U>The vector result.
Remarks
This overload is an allocation-free extension point for operations that carry scalar or other immutable state separately from the delegate. The default implementation preserves compatibility with derived classes that override only MapCore<U>(Func<T, U>, Vector<U>).