Advertisement
Guest User

MoniRosen

a guest
Oct 19th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.34 KB | None | 0 0
  1. def rosen(point: PointND): Double = {
  2.         val c: Double = point.getDim / 2
  3.         val dimR = c.asInstanceOf[Int]
  4.  
  5.         for (i <- 0 until dimR) {
  6.             r = r + (100 * (Math.pow(point.getData(2*i), 2) - point
  7.                 .getData(2*i+1)) + Math.pow( Math.pow(point.getData(2*i), 2)-
  8.                 1, 2))
  9.  
  10.         }
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement