Method CreateByFunc
- Namespace
- Zyl.VectorTraits
- Assembly
- VectorTraits.dll
CreateByFunc<T>(Func<int, T>)
Creates a new Vector256<T> from a from the given Func<T, TResult> (从给定 Func<T, TResult> 创建一个新的 Vector256<T> ) .
public static Vector256<T> CreateByFunc<T>(Func<int, T> func) where T : struct
Parameters
func
Func<int, T>A function that gets the value of each element (获取每个元素值的函数). Prototype:
T func(int index)
,index
is element index.
Returns
- Vector256<T>
A new Vector256<T> from a from the given Func<T, TResult> (一个新Vector256<T>,其元素来 Func<T, TResult>).
Type Parameters
T
The vector element type (向量中的元素的类型).
CreateByFunc<T, TUserdata>(Func<int, TUserdata, T>, TUserdata)
Creates a new Vector256<T> from a from the given Func<T1, T2, TResult> (从给定 Func<T1, T2, TResult> 创建一个新的 Vector256<T> ) .
public static Vector256<T> CreateByFunc<T, TUserdata>(Func<int, TUserdata, T> func, TUserdata userdata) where T : struct
Parameters
func
Func<int, TUserdata, T>A function that gets the value of each element (获取每个元素值的函数). Prototype:
T func(int index, TUserdata userdata)
,index
is element index.userdata
TUserdataThe userdata (用户自定义数据).
Returns
- Vector256<T>
A new Vector256<T> from a from the given Func<T1, T2, TResult> (一个新Vector256<T>,其元素来 Func<T1, T2, TResult>).
Type Parameters
T
The vector element type (向量中的元素的类型).
TUserdata
Type of
userdata
(userdata
的类型).