Skip to content

Instantly share code, notes, and snippets.

@darrenjw
Created January 24, 2018 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenjw/e8f9ce44292574cc48455011c2555177 to your computer and use it in GitHub Desktop.
Save darrenjw/e8f9ce44292574cc48455011c2555177 to your computer and use it in GitHub Desktop.
Matrices with zero dimensions
import breeze.linalg._
val cv = new DenseMatrix(2,0,Array[Double]())
val rv = new DenseMatrix(0,2,Array[Double]())
rv * cv
// res1: breeze.linalg.DenseMatrix[Double] =
cv * rv
// res0: breeze.linalg.DenseMatrix[Double] =
// 0.0 0.0
// 0.0 0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment