public static void computeScoreRowSad ( GrayF32 left , GrayF32 right , int elementMax , int indexLeft , int indexRight , float elementScore [ ] ) { for ( int rCol = 0 ; rCol < elementMax ; rCol ++ ) { float diff = ( left . data [ indexLeft ++ ] ) - ( right . data [ indexRight ++ ] ) ; elementScore [ rCol ] = Math . abs ( diff ) ; } }
compute the score for each element all at once to encourage the JVM to optimize and encourage the JVM to optimize this section of code .