Variable indices are not supported for array rank > 1 (Migrated from community.research.microsoft.com) RRS feed

  • Question

  • laura posted on 01-29-2009 12:19 PM



    I just got an exception "Variable indices are not supported for array rank > 1" at the second line of the following snippet and am wondering if I get the meaning right.....

            m.[uRange] <- Variable.Discrete(xi)

            let alphaPsiForURange = alphaPsi.[uRange,m.[uRange]]  // <----- throws exception

            psi.[uRange] <- Variable.Random(alphaPsiForURange)


    xi is a DirichletUniform(fPowerRange)

    alphaPsi is a 2D array of dirichlets of dimensions  uRange.SizeAsInt  and fPowerRange.SizeAsInt

    psi.[uRange] should be a discrete.


    The code works if alphaPsi is only ranging over uRange...


    Does the error message mean that alphaPsi is not allowed to be two dimensional?

    Would JaggedArrays work?




    Friday, June 3, 2011 4:42 PM


  • minka replied on 01-29-2009 12:43 PM

    Yes, the problem is that alphaPsi is two dimensional.  Making alphaPsi a jagged array should work.

    Friday, June 3, 2011 4:42 PM