Click or drag to resize
VariableIf Method
Microsoft Research
Opens a stochastic if statement, active when the argument is true.

Namespace: MicrosoftResearch.Infer.Models
Assembly: Infer.Compiler (in Infer.Compiler.dll) Version: 2.6.41128.1 (2.6.41128.1)
Syntax
public static IfBlock If(
	Variable<bool> b
)

Parameters

b
Type: MicrosoftResearch.Infer.ModelsVariableBoolean
The condition of the if block

Return Value

Type: IfBlock
An IfBlock object which must be closed before inference is performed.
Remarks
This method should be used as the argument to a using() statement, so that the if statement is automatically closed. If this is not possible, the returned IfBlock must be closed manually by calling CloseBlock().
See Also