Class ExMSamplers
See ExM. This class contains functions related to subsamplers.
Inheritance
System.Object
ExMSamplers
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Danmokou.DMath.Functions
Assembly: cs.temp.dll.dll
Syntax
public static class ExMSamplers
Methods
SampleIf<T>(ExPred, Func<TExArgCtx, TEx<T>>)
If the condition is true, evaluate the invokee. Otherwise, return the last returned evaluation.
You can call this with a cond of false, and it will sample the invokee once. However, in this case SS0 is preferred.
Declaration
public static Func<TExArgCtx, TEx<T>> SampleIf<T>(ExPred cond, Func<TExArgCtx, TEx<T>> p)
Parameters
| Type | Name | Description |
|---|---|---|
| ExPred | cond | |
| System.Func<TExArgCtx, TEx<T>> | p |
Returns
| Type | Description |
|---|---|
| System.Func<TExArgCtx, TEx<T>> |
Type Parameters
| Name | Description |
|---|---|
| T |
SS0<T>(Func<TExArgCtx, TEx<T>>)
Samples an invokee exactly once.
Declaration
public static Func<TExArgCtx, TEx<T>> SS0<T>(Func<TExArgCtx, TEx<T>> p)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<TExArgCtx, TEx<T>> | p | Target function |
Returns
| Type | Description |
|---|---|
| System.Func<TExArgCtx, TEx<T>> |
Type Parameters
| Name | Description |
|---|---|
| T |
StopSampling<T>(ExBPY, Func<TExArgCtx, TEx<T>>)
If the input time is less than the reference time, evaluate the invokee. Otherwise, return the last returned evaluation.
You can call this with zero sampling time, and it will sample the invokee once. However, in this case SS0 is preferred.
Declaration
public static Func<TExArgCtx, TEx<T>> StopSampling<T>(ExBPY time, Func<TExArgCtx, TEx<T>> p)
Parameters
| Type | Name | Description |
|---|---|---|
| ExBPY | time | Time at which to stop sampling |
| System.Func<TExArgCtx, TEx<T>> | p | Target function |
Returns
| Type | Description |
|---|---|
| System.Func<TExArgCtx, TEx<T>> |
Type Parameters
| Name | Description |
|---|---|
| T |