/// <summary> /// Set the variable array to the given value. Should only be invoked on arrays created using Variable.Array() /// where the elements have not yet been filled in. /// </summary> /// <param name="that">A variable array whose definition will be consumed by <c>this</c> and no longer available for use</param> /// <remarks> /// <paramref name="that"/> must have exactly the same set of ranges as <c>this</c>. /// </remarks> public void SetTo(VariableArray <TItem, TArray> that) { base.SetTo(that); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="that"></param> protected VariableArray(VariableArray <TItem, TArray> that) : base(that) { }
/// <summary> /// Creates a 1D jagged array of shared random variables. /// </summary> /// <typeparam name="DistributionArrayType"></typeparam> /// <param name="itemPrototype">A fresh variable object representing an array element.</param> /// <param name="range">Outer range.</param> /// <param name="prior">Prior for the array.</param> /// <param name="divideMessages">Use division (the faster default) for calculating messages to batches</param> /// <returns></returns> public static ISharedVariableArray <VariableArray <DomainType>, DomainType[][]> Random <DistributionArrayType>(VariableArray <DomainType> itemPrototype, Range range, DistributionArrayType prior, bool divideMessages = true) where DistributionArrayType : IDistribution <DomainType[][]>, Sampleable <DomainType[][]>, SettableToProduct <DistributionArrayType>, ICloneable, SettableToUniform, SettableTo <DistributionArrayType>, SettableToRatio <DistributionArrayType>, CanGetLogAverageOf <DistributionArrayType> { return(new SharedVariableArray <VariableArray <DomainType>, DomainType[][], DistributionArrayType>(itemPrototype, range, prior, divideMessages)); }