// XXX java not support unsigned int.
for (i=0;i<nnvals;i++) a[myran.int32p() % N] = (double)(i);
nnvals=0; // There may be fewer than nnvals non-zero elements
for (i=0;i<N;i++)
if (a[i] != 0.0) nnvals++;
NRsparseCol as = new NRsparseCol(N,nnvals);
k=0;
for (i=0;i<a.length;i++)
if (a[i] != 0.0) {
as.row_ind[k]=i;
as.val[k++]=a[i];