private void prepareDayUserWords() { final MLSparse arr = (MLSparse) this.content.get(mainMatrixKey); final Double[] realVals = arr.exportReal(); final int[] rows = arr.getIR(); final int[] cols = arr.getIC(); if(voc == null){ this.nwords = arr.getN(); } else{ this.nwords = this.voc.size(); } this.nusers = arr.getM() / this.ndays; dayWords = new ArrayList<Matrix>(); for (int i = 0; i < ndays; i++) { final Matrix userWord = SparseMatrixFactoryMTJ.INSTANCE.createMatrix(this.nwords, this.nusers); dayWords.add(userWord); } for (int i = 0; i < rows.length; i++) { if (filter && !this.keepIndex.contains(cols[i])) continue; int wordIndex = cols[i]; if(this.indexToVoc!=null){ wordIndex = this.indexToVoc.get(wordIndex); } final int dayIndex = rows[i] / this.nusers; final int userIndex = rows[i] - (dayIndex * this.nusers); dayWords.get(dayIndex).setElement(wordIndex, userIndex, realVals[i]); } }