Method ConditionalSelect
- Namespace
- Zyl.VectorTraits
- Assembly
- VectorTraits.dll
ConditionalSelect<T>(Vector256<T>, Vector256<T>, Vector256<T>)
Conditionally selects a value from two vectors on a bitwise basis (按条件从两个向量中按位选择值).
Mnemonic: rt[i] := (left[i] & condition[i]) | (right[i] & ~condition[i])
.
public static Vector256<T> ConditionalSelect<T>(Vector256<T> condition, Vector256<T> left, Vector256<T> right) where T : struct
Parameters
condition
Vector256<T>The mask that is used to select a value from
left
orright
(用于从left
或right
中选择值的掩码).left
Vector256<T>The vector that is selected when the corresponding bit in
condition
is one (当condition
中的对应位为 1 时选择的向量).right
Vector256<T>The vector that is selected when the corresponding bit in
condition
is zero (当condition
中的对应位为 0 时选择的向量).
Returns
- Vector256<T>
A vector whose bits come from
left
orright
based on the value ofcondition
(一个向量,其二进制位是根据condition
由left
orright
组合而成).
Type Parameters
T
The vector element type (向量中的元素的类型).
- See Also
ConditionalSelect(Vector256<int>, Vector256<float>, Vector256<float>)
Conditionally selects a value from two vectors on a bitwise basis (按条件从两个向量中按位选择值).
Mnemonic: rt[i] := (left[i] & condition[i]) | (right[i] & ~condition[i])
.
public static Vector256<float> ConditionalSelect(Vector256<int> condition, Vector256<float> left, Vector256<float> right)
Parameters
condition
Vector256<int>The mask that is used to select a value from
left
orright
(用于从left
或right
中选择值的掩码).left
Vector256<float>The vector that is selected when the corresponding bit in
condition
is one (当condition
中的对应位为 1 时选择的向量).right
Vector256<float>The vector that is selected when the corresponding bit in
condition
is zero (当condition
中的对应位为 0 时选择的向量).
Returns
- Vector256<float>
A vector whose bits come from
left
orright
based on the value ofcondition
(一个向量,其二进制位是根据condition
由left
orright
组合而成).
- See Also
ConditionalSelect(Vector256<long>, Vector256<double>, Vector256<double>)
Conditionally selects a value from two vectors on a bitwise basis (按条件从两个向量中按位选择值).
Mnemonic: rt[i] := (left[i] & condition[i]) | (right[i] & ~condition[i])
.
public static Vector256<double> ConditionalSelect(Vector256<long> condition, Vector256<double> left, Vector256<double> right)
Parameters
condition
Vector256<long>The mask that is used to select a value from
left
orright
(用于从left
或right
中选择值的掩码).left
Vector256<double>The vector that is selected when the corresponding bit in
condition
is one (当condition
中的对应位为 1 时选择的向量).right
Vector256<double>The vector that is selected when the corresponding bit in
condition
is zero (当condition
中的对应位为 0 时选择的向量).
Returns
- Vector256<double>
A vector whose bits come from
left
orright
based on the value ofcondition
(一个向量,其二进制位是根据condition
由left
orright
组合而成).
- See Also