661662663664665666667668669670671
if (dims ==0) { data[offset]+=get(); } else { int n=sliceCount(); INDArray s0=slice(0); int ec=(int) s0.elementCount(); s0.addToArray(data, offset); for (int i=1; i<n; i++) { slice(i).addToArray(data, offset+i*ec); } }
11011102110311041105110611071108110911101111
} int sc=sliceCount(); for (int i=0; i<sc; i++) { INDArray s=slice(i); s.getElements(dest,offset); offset+=s.elementCount(); } } @Override public void copyTo(double[] arr) {
569570571572573574575576577578579
int dims=m.dimensionality(); int[] shape=m.getShape(); int[] strides=m.getStrides(); if (m.elementCount()==0) return; if (mm.isMutable()) { double[] data=m.getArray(); for (int i=0; i<dims; i++) { assertEquals(m.getStride(i),strides[i]);
2829303132333435363738
return sm; } public static void main(String[] args) { SparseRowMatrix sm=createMatrix(); System.out.println(sm.nonZeroCount() +" elements are non-zero out of " + sm.elementCount()+" total elements"); AMatrix smm=sm.innerProduct(sm); System.out.println(smm.nonZeroCount() +" elements are non-zero in the product."); }
12081209121012111212121312141215121612171218
case Index.INDEX_UNIQUE : if (operation == OpTypes.EQUAL) { factor = 1; } else { factor = store.elementCount() / 2.0; } break; case Index.INDEX_NON_UNIQUE : if (operation == OpTypes.EQUAL) {
12141215121612171218121912201221122212231224
} break; case Index.INDEX_NON_UNIQUE : if (operation == OpTypes.EQUAL) { factor = store.elementCount() / 8.0; if (factor > 1024) { factor = 1024; } } else {
12201221122212231224122512261227122812291230
if (factor > 1024) { factor = 1024; } } else { factor = store.elementCount() / 2.0; } break; case Index.INDEX_NONE : default :
12261227122812291230123112321233123412351236
} break; case Index.INDEX_NONE : default : factor = store.elementCount(); break; } return factor < Index.minimumSelectivity ? Index.minimumSelectivity : factor;
18361837183818391840184118421843184418451846
it = index.findFirstRow(session, store, data); if (opType == OpTypes.EQUAL) { if (it.hasNext()) { return store.elementCount(session) == 1 ? Boolean.TRUE : Boolean .FALSE; } else { return Boolean.FALSE; }
22472248224922502251225222532254225522562257
case OpTypes.MATCH_UNIQUE_FULL : case OpTypes.NOT_DISTINCT : { PersistentStore store = rangeVar.rangeTable.getRowStore(session); cost = store.elementCount(); if (cost < Index.minimumSelectivity) { cost = Index.minimumSelectivity; }