locked
difference between arrays of random variables (of type Variable<T>[]) and random variable arrays (VariableArray<T>()) RRS feed

  • Question

  • Hi

    Can you please explain what is the difference between arrays of random variables (of type Variable<T>[]) and random variable arrays (VariableArray<T>()) ? Also when we have jagged arrays?

    What is the reason that they should be chosen carefully - like this example?

    Thanks.

    Monday, August 11, 2014 2:35 PM

Answers

  • Hi Zahra,

    Variable<T>[] is a C# array of random variables. You should avoid using these. There are very few cases when such arrays come in handy, and there will be even fewer after our next release.

    VariableArray<T> is an Infer.NET array of random variables. You should always try to use these, because our compiler understands them as whole arrays and can process them more efficiently. The User Guide explains how to use them.

    As to your jagged array question, I think it's answered here.

    -Yordan

    • Marked as answer by RazinR Tuesday, August 12, 2014 11:49 AM
    Tuesday, August 12, 2014 10:41 AM