code: private Matrix getThisSideMatrix(Matrix B)
      {
          if(this.canBeMutated())
              return this.clone();
          else//so far, only other option in JSAT is a dense matrix
          {
              DenseMatrix dm = new DenseMatrix(rows(), cols());
              dm.mutableAdd(this);
              return dm;
          }
      }
docs: Returns an appropriate matrix to use for some operation A <i>op</i> B,
  where {@code A = this }
  @param B the other matrix, may be null
  @return a matrix that can be mutated to take the place of A