/** * Gets column indices. * * <tt>jc</tt> points to an integer array of length N+1 that contains column index information. * For j, in the range <tt>0<=j<=N</tt>, <tt>jc[j]</tt> is the index in ir and <tt>pr</tt> (and <tt>pi</tt> * if it exists) of the first nonzero entry in the jth column and <tt>jc[j+1]?????????1</tt> index * of the last nonzero entry. As a result, <tt>jc[N]</tt> is also equal to nnz, the number * of nonzero entries in the matrix. If nnz is less than nzmax, then more nonzero * entries can be inserted in the array without allocating additional storage * * @return */ public int[] getJC() { int[] jc = new int[getN() + 1]; // jc[j] is the number of nonzero elements in all preceeding columns for (IndexMN index : indexSet) { for (int column = index.n + 1; column < jc.length; column++) { jc[column]++; } } return jc; }
/** * Gets column indices. * * <tt>jc</tt> points to an integer array of length N+1 that contains column index information. * For j, in the range <tt>0<=j<=N1</tt>, <tt>jc[j]</tt> is the index in ir and <tt>pr</tt> (and <tt>pi</tt> * if it exists) of the first nonzero entry in the jth column and <tt>jc[j+1]1</tt> index * of the last nonzero entry. As a result, <tt>jc[N]</tt> is also equal to nnz, the number * of nonzero entries in the matrix. If nnz is less than nzmax, then more nonzero * entries can be inserted in the array without allocating additional storage * * @return */ public int[] getJC() { int[] jc = new int[getN()+1]; // jc[j] is the number of nonzero elements in all preceeding columns for ( IndexMN index : indexSet ) { for (int column = index.n + 1; column < jc.length; column++) { jc[column]++; } } return jc; }
/** * Gets column indices. * * <tt>jc</tt> points to an integer array of length N+1 that contains column index information. * For j, in the range <tt>0<=j<=N</tt>, <tt>jc[j]</tt> is the index in ir and <tt>pr</tt> (and <tt>pi</tt> * if it exists) of the first nonzero entry in the jth column and <tt>jc[j+1]?????????1</tt> index * of the last nonzero entry. As a result, <tt>jc[N]</tt> is also equal to nnz, the number * of nonzero entries in the matrix. If nnz is less than nzmax, then more nonzero * entries can be inserted in the array without allocating additional storage * * @return */ public int[] getJC() { int[] jc = new int[getN() + 1]; // jc[j] is the number of nonzero elements in all preceeding columns for (IndexMN index : indexSet) { for (int column = index.n + 1; column < jc.length; column++) { jc[column]++; } } return jc; }
/** * Gets column indices. * * <kbd>jc</kbd> points to an integer array of length N+1 that contains column index information. * For j, in the range <kbd>0<=j<=N 1</kbd>, <kbd>jc[j]</kbd> is the index in ir and <kbd>pr</kbd> (and <kbd>pi</kbd> * if it exists) of the first nonzero entry in the jth column and <kbd>jc[j+1] 1</kbd> index * of the last nonzero entry. As a result, <kbd>jc[N]</kbd> is also equal to nnz, the number * of nonzero entries in the matrix. If nnz is less than nzmax, then more nonzero * entries can be inserted in the array without allocating additional storage * * @return column indices */ public int[] getJC() { int[] jc = new int[getN()+1]; // jc[j] is the number of nonzero elements in all preceeding columns for ( IndexMN index : indexSet ) { for (int column = index.n + 1; column < jc.length; column++) { jc[column]++; } } return jc; }
/** * Gets column indices. * * <tt>jc</tt> points to an integer array of length N+1 that contains column index information. * For j, in the range <tt>0<=j<=N1</tt>, <tt>jc[j]</tt> is the index in ir and <tt>pr</tt> (and <tt>pi</tt> * if it exists) of the first nonzero entry in the jth column and <tt>jc[j+1]1</tt> index * of the last nonzero entry. As a result, <tt>jc[N]</tt> is also equal to nnz, the number * of nonzero entries in the matrix. If nnz is less than nzmax, then more nonzero * entries can be inserted in the array without allocating additional storage * * @return */ public int[] getJC() { int[] jc = new int[getN()+1]; // jc[j] is the number of nonzero elements in all preceeding columns for ( IndexMN index : indexSet ) { for (int column = index.n + 1; column < jc.length; column++) { jc[column]++; } } return jc; }
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]); } }
double[] ad1 = tag.readToDoubleArray(); int count = 0; for (int column = 0; column < sparse.getN(); column++) { while (count < jc[column + 1]) { sparse.setReal(ad1[count], ir[count], column); for (int column = 0; column < sparse.getN(); column++) { while (count < jc[column + 1]) { sparse.setImaginary(ad2[count], ir[count], column); double[] ad1 = tag.readToDoubleArray(); int count = 0; for (int column = 0; column < sparse.getN(); column++) { while (count < jc[column + 1]) { sparse.set(ad1[count], ir[count], column);
double[] ad1 = tag.readToDoubleArray(); int count = 0; for (int column = 0; column < sparse.getN(); column++) { while (count < jc[column + 1]) { sparse.setReal(ad1[count], ir[count], column); for (int column = 0; column < sparse.getN(); column++) { while (count < jc[column + 1]) { sparse.setImaginary(ad2[count], ir[count], column); double[] ad1 = tag.readToDoubleArray(); int count = 0; for (int column = 0; column < sparse.getN(); column++) { while (count < jc[column + 1]) { sparse.set(ad1[count], ir[count], column);
double[] ad1 = tag.readToDoubleArray(); int count = 0; for (int column = 0; column < sparse.getN(); column++) { while(count < jc[column+1]) { sparse.setReal(ad1[count], ir[count], column); for (int column = 0; column < sparse.getN(); column++) { while(count < jc[column+1]) { sparse.setImaginary(ad2[count], ir[count], column);
double[] ad1 = tag.readToDoubleArray(); int count = 0; for (int column = 0; column < sparse.getN(); column++) { while(count < jc[column+1]) { sparse.setReal(ad1[count], ir[count], column); for (int column = 0; column < sparse.getN(); column++) { while(count < jc[column+1]) { sparse.setImaginary(ad2[count], ir[count], column);
double[] ad1 = tag.readToDoubleArray(); int count = 0; for (int column = 0; column < sparse.getN(); column++) { while (count < jc[column + 1]) { sparse.setReal(ad1[count], ir[count], column); for (int column = 0; column < sparse.getN(); column++) { while (count < jc[column + 1]) { sparse.setImaginary(ad2[count], ir[count], column);