We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following OptiML code looks ok to me, but produces a violated ordering of effect error:
val slice = (Matrix.rand(3,3)*100).map(_.AsInstanceOf[Int]) val histogram = DenseVector[Int](256, true) var row = 0 while (row < slice.numRows) { var col = 0 while (col < slice.numCols) { histogram(slice(row,col)) = histogram(slice(row,col))+1 col += 1 } row += 1 } // this produces violated error: if (histogram.max > 1) histogram.maxIndex else 0 histogram.maxIndex
However, if we replace the last two lines with: histogram.max
Or: val htest = histogram.unsafeImmutable if (htest.max > 1) htest.maxIndex else 0
the error goes away.
The text was updated successfully, but these errors were encountered:
This code exists and is runnable in Scratchpad.scala in the optiml-beta branch (under the comment "Bug 1").
Sorry, something went wrong.
asujeeth
No branches or pull requests
The following OptiML code looks ok to me, but produces a violated ordering of effect error:
However, if we replace the last two lines with:
histogram.max
Or:
val htest = histogram.unsafeImmutable
if (htest.max > 1) htest.maxIndex else 0
the error goes away.
The text was updated successfully, but these errors were encountered: