Skip to content

Commit

Permalink
fix FMat<--IMat
Browse files Browse the repository at this point in the history
  • Loading branch information
John Canny committed Dec 16, 2017
1 parent d2d6b79 commit 10dfa06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/BIDMat/FMat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,8 @@ case class FMat(dims0:Array[Int], val data:Array[Float]) extends DenseMat[Float]
case aa:GMat => aa.copyFrom(this);
case aa:GDMat => aa.copyFrom(DMat(this));
case out:FMat => copyTo(out):FMat;
case ii:IMat => {Mat.copyToIntArray(data, 0, ii.data, 0, length)}
case ii:LMat => {Mat.copyToLongArray(data, 0, ii.data, 0, length)}
case aa:TMat =>TMat(nrows,ncols,Array(0),Array(0),Array(this))
}
a
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/BIDMat/IMat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ case class IMat(dims0:Array[Int], val data:Array[Int]) extends DenseMat[Int](dim
a match {
case aa:GIMat => aa.copyFrom(this);
case out:IMat => System.arraycopy(data, 0, out.data, 0, length);
case ff:FMat => {Mat.copyToFloatArray(data, 0, ff.data, 0, length)}
case ii:LMat => {Mat.copyToLongArray(data, 0, ii.data, 0, ii.length)}
}
a
}
Expand Down

0 comments on commit 10dfa06

Please # to comment.