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