TensorPrimitives.PopCount 方法

定义

重载

PopCount<T>(ReadOnlySpan<T>, Span<T>)

计算指定张量中的按元素计算数字的计数。

PopCount<T>(ReadOnlySpan<T>)

计算指定张量中的所有元素的总体计数。

PopCount<T>(ReadOnlySpan<T>, Span<T>)

Source:
TensorPrimitives.PopCount.cs
Source:
TensorPrimitives.PopCount.cs

计算指定张量中的按元素计算数字的计数。

public:
generic <typename T>
 where T : System::Numerics::IBinaryInteger<T> static void PopCount(ReadOnlySpan<T> x, Span<T> destination);
public static void PopCount<T> (ReadOnlySpan<T> x, Span<T> destination) where T : System.Numerics.IBinaryInteger<T>;
static member PopCount : ReadOnlySpan<'T (requires 'T :> System.Numerics.IBinaryInteger<'T>)> * Span<'T (requires 'T :> System.Numerics.IBinaryInteger<'T>)> -> unit (requires 'T :> System.Numerics.IBinaryInteger<'T>)
Public Shared Sub PopCount(Of T As IBinaryInteger(Of T)) (x As ReadOnlySpan(Of T), destination As Span(Of T))

类型参数

T

参数

x
ReadOnlySpan<T>

张量,表示为范围。

destination
Span<T>

目标张量,表示为范围。

例外

xdestination 引用重叠的内存位置,并且不在同一位置开始。

注解

此方法有效地计算 destination[i] = T.PopCount(x[i])

适用于

PopCount<T>(ReadOnlySpan<T>)

Source:
TensorPrimitives.PopCount.cs

计算指定张量中的所有元素的总体计数。

public:
generic <typename T>
 where T : System::Numerics::IBinaryInteger<T> static long PopCount(ReadOnlySpan<T> x);
public static long PopCount<T> (ReadOnlySpan<T> x) where T : System.Numerics.IBinaryInteger<T>;
static member PopCount : ReadOnlySpan<'T (requires 'T :> System.Numerics.IBinaryInteger<'T>)> -> int64 (requires 'T :> System.Numerics.IBinaryInteger<'T>)
Public Shared Function PopCount(Of T As IBinaryInteger(Of T)) (x As ReadOnlySpan(Of T)) As Long

类型参数

T

参数

x
ReadOnlySpan<T>

张量,表示为范围。

返回

x中每个元素中设置的位数的总和。

适用于