Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
e-strauss committed Aug 7, 2023
1 parent 8afdd65 commit 4d952f2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4216,7 +4216,7 @@ public MatrixBlock slice(int rl, int ru, int cl, int cu, boolean deep, MatrixBlo

// Output matrix will have the same sparsity as that of the input matrix.
// (assuming a uniform distribution of non-zeros in the input)
MatrixBlock result=checkType((MatrixBlock)ret);
MatrixBlock result=checkType(ret);
long estnnz= (long) ((double)this.nonZeros/rlen/clen*(ru-rl+1)*(cu-cl+1));
boolean result_sparsity = this.sparse && MatrixBlock.evalSparseFormatInMemory(ru-rl+1, cu-cl+1, estnnz);
if(result==null)
Expand Down Expand Up @@ -5260,7 +5260,11 @@ public MatrixBlock replaceOperations(MatrixValue result, double pattern, double
return ret;
if( !containsValue(pattern) )
return this; //avoid allocation + copy

if( isEmpty() && pattern==0 ) {
ret.reset(rlen, clen, replacement);
return ret;
}

boolean NaNpattern = Double.isNaN(pattern);
if( sparse ) //SPARSE
{
Expand Down

0 comments on commit 4d952f2

Please sign in to comment.