Skip to content

Commit

Permalink
last edits to multiarray2 for now
Browse files Browse the repository at this point in the history
  • Loading branch information
jigold committed Dec 3, 2015
1 parent 58076a2 commit dc46651
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/main/scala/org/broadinstitute/hail/utils/MultiArray2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@ class MultiArray2[T](val n1: Int,
class Row(val i:Int) extends IndexedSeq[T] {
require(i >= 0 && i < n1)
def apply(j:Int): T = {
if (j >= 0 && j < length)
a(i*n2 + j)
else
throw new ArrayIndexOutOfBoundsException
if (j < 0 || j >= length) throw new ArrayIndexOutOfBoundsException
a(i*n2 + j)
}
def length: Int = n2
}

class Column(val j:Int) extends IndexedSeq[T] {
require(j >= 0 && j < n2)
def apply(i:Int): T = {
if (i >= 0 && i < length)
a(i*n2 + j)
else
throw new ArrayIndexOutOfBoundsException
if (i < 0 || i >= length) throw new ArrayIndexOutOfBoundsException
a(i*n2 + j)
}
def length: Int = n1
}
Expand Down

0 comments on commit dc46651

Please sign in to comment.