Skip to content

DiGi.ComputeSharp.Core

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

DiGi.ComputeSharp.Core Namespace

Classes

Create Class

public static class Create

Inheritance System.Object → Create

Methods

Create.List<T>(this Buffer<T>, Func<Nullable<T>,bool>) Method

Converts the contents of a ComputeSharp.Resources.Buffer<> into a managed List<T>(this Buffer<T>, Func<Nullable<T>,bool>), optionally filtering elements based on the provided predicate.

public static System.Collections.Generic.List<T>? List<T>(this ComputeSharp.Resources.Buffer<T> buffer, System.Func<System.Nullable<T>,bool>? func=null)
    where T : unmanaged;

Type parameters

T

The unmanaged type of the elements contained in the buffer.

Parameters

buffer ComputeSharp.Resources.Buffer<T>

The source ComputeSharp buffer to convert.

func System.Func<System.Nullable<T>,System.Boolean>

An optional predicate used to determine whether an element should be included in the resulting list.

Returns

System.Collections.Generic.List<T>
A list containing the elements from the buffer that satisfy the predicate, or null if the source buffer is null.

Query Class

public static class Query

Inheritance System.Object → Query

Methods

Query.Abs(double) Method

Returns the absolute value of a specified number.

public static double Abs(double value);

Parameters

value System.Double

The number to get the absolute value of.

Returns

System.Double
The absolute value of the specified number.

Query.Count(bool, bool, bool, bool, bool, bool, bool) Method

Counts how many of the provided boolean values match a specified target value.

public static int Count(bool value, bool value_1, bool value_2, bool value_3, bool value_4, bool value_5, bool value_6);

Parameters

value System.Boolean

The target boolean value to compare against.

value_1 System.Boolean

The first boolean value to evaluate.

value_2 System.Boolean

The second boolean value to evaluate.

value_3 System.Boolean

The third boolean value to evaluate.

value_4 System.Boolean

The fourth boolean value to evaluate.

value_5 System.Boolean

The fifth boolean value to evaluate.

value_6 System.Boolean

The sixth boolean value to evaluate.

Returns

System.Int32
The number of values among the six provided that are equal to the target value.

Query.IsValid(double) Method

Determines whether the specified double-precision floating-point value is valid and finite.

public static bool IsValid(double value);

Parameters

value System.Double

The double-precision floating-point number to validate.

Returns

System.Boolean
True if the value is valid; otherwise, false.

Query.Sqrt(double, double) Method

Calculates the square root of a specified value using an iterative approximation method until the result is within the given tolerance.

public static double Sqrt(double value, double tolerance);

Parameters

value System.Double

The number to calculate the square root of.

tolerance System.Double

The maximum allowable difference between the squared result and the original value for convergence.

Returns

System.Double
The approximate square root of the value, or System.Double.NaN if the value is negative.

Clone this wiki locally