Returns the {@link SparseDoubleVector} at index {@code row}.  If one does
not exist, a new vector will be created and stored in the mapping.
549333
private SparseDoubleVector updateRow(int row) {
        SparseDoubleVector rowVec = rowToColumns.get(row);
        if (rowVec == null) {
            rowVec = emptyVector.instanceCopy();
            rowToColumns.put(row, rowVec);
        }

        return rowVec;
    }
143813
public VectorIterator nonZeroIteratorOfColumn(int j) {
        final int jj = j;
        return new VectorIterator(rows) {
            private int i = -1;

            @Override
            public int index() {
                return i;
            }

            @Override
            public double get() {
                return SparseMatrix.this.get(i, jj);
            }

            @Override
            public void set(double value) {
                SparseMatrix.this.set(i, jj, value);
            }

            @Override
            public boolean hasNext() {
                while (i + 1 < rows && SparseMatrix.this.isZeroAt(i + 1, jj)) {
                    i++;
                }

                return i + 1 < rows;
            }

            @Override
            public Double next() {
                if(!hasNext()) {
                    throw new NoSuchElementException();
                }
                i++;
                return get();
            }
        };
    }
789497
public static SparseVector fromMatrixMarket(InputStream is) throws IOException {
        return Vector.fromMatrixMarket(is).to(Vectors.SPARSE);
    }
963748
public SparseDoubleVector getColumnVector(int column) {
        checkIndices(0, column);
        rowReadLock.lock();
        SparseDoubleVector values = new SparseHashDoubleVector(rows.get());
        for (int row = 0; row < rows.get(); ++row) {
            AtomicSparseVector rowEntry = getRow(row, -1, false);            
            double value = 0;
            if (rowEntry != null && (value = rowEntry.get(column)) != 0)
                values.set(row, value);
        }
        rowReadLock.unlock();
        return values;
    }
1318846
public INDArray getVector(@NonNull Integer key, int rowIdx) {
        /**
         * we create VoidMessage, send it, and block until it gets responded
         */

        VectorRequestMessage message = new VectorRequestMessage(key, rowIdx);

        MeaningfulMessage response = transport.sendMessageAndGetResponse(message);

        return response.getPayload();
    }
354365
public static ImmutableVector2 createVector(final double x, final double y) {
		return new ImmutableVector2(new ImmutableData(2, 1) {
			@Override
			public double getQuick(int row, int col) {
				if (row == 0)
					return x;
				else
					return y;
			}
		});
	}
97672
public double[] dataVector(V p) {
    return strongEigenvectors.length > 0 ? times(strongEigenvectors, transposeTimes(strongEigenvectors, minusEquals(p.toArray(), centroid))) : EMPTY_VECTOR;
  }
116899
public static SparseVector random(int length, double density, Random random) {
        return CompressedVector.random(length, density, random);
    }
393746
public double dot(SparseVector b) {
		SparseVector a = this;
		if (a.N != b.N) throw new IllegalArgumentException("Vector lengths disagree. " + a.N + " != " + b.N);
		double sum = 0.0;

		// iterate over the vector with the fewest nonzeros
		if (a.symbolTable.size() <= b.symbolTable.size()) {
			for (int i : a.symbolTable)
				if (b.symbolTable.contains(i)) sum += a.get(i) * b.get(i);
		}
		else  {
			for (int i : b.symbolTable)
				if (a.symbolTable.contains(i)) sum += a.get(i) * b.get(i);
		}
		return sum;
	}
1075985
public static <T> Vector<T> getVector(int capacity, T... values) {
        return new Vector<T>() {{addAll(Arrays.asList(values));}};
    }
319247
protected Object getTopRowBean(final List<Integer> row) {
		// Get root level
		List<?> lvl = getBeanList();
		if (lvl == null || lvl.isEmpty()) {
			return null;
		}

		// Get root row bean (ie top level)
		int rowIdx = row.get(0);
		Object rowData = lvl.get(rowIdx);
		return rowData;
	}
107069
public static TransformedInputRow of(final InputRow row) {
        if (row instanceof TransformedInputRow) {
            // re-use existing transformed input row.
            return (TransformedInputRow) row;
        } else {
            return new TransformedInputRow(row, row.getId());
        }
    }
626155
public synchronized DoubleVector generate() {
        DoubleVector termVector = new DenseVector(indexVectorLength);
        for (int i = 0; i < indexVectorLength; i++)
            termVector.set(i, mean + (randomGenerator.nextGaussian() * stdev));
        return termVector;
    }
1334864
public int[] getRow(int rowIndex) {
        if (isCompacted) {
            throw new IllegalStateException(
                    "Illegal Invocation of the method after compact()");
        }
        if (rowIndex < 0 || rowIndex > rows) {
            throw new IllegalArgumentException("rowIndex out of bound!");
        }
        int[] rowToReturn = new int[columns - 2];
        System.arraycopy(v, rowIndex * columns + 2, rowToReturn, 0,
                         columns - 2);
        return rowToReturn;
    }
730454
public Vector<Vector> getRecordsAsDataVector() {
		final Vector<Vector> data = new Vector<Vector>();
		for (final JKTableRecord rec : this.records) {
			data.add(rec.toValuesVector());
		}
		return data;
	}
1019331
@InternalApi
  public Row createRowFromProto(com.google.bigtable.v2.Row row) {
    RowBuilder<Row> builder = createRowBuilder();
    builder.startRow(row.getKey());

    for (Family family : row.getFamiliesList()) {
      for (Column column : family.getColumnsList()) {
        for (Cell cell : column.getCellsList()) {
          builder.startCell(
              family.getName(),
              column.getQualifier(),
              cell.getTimestampMicros(),
              cell.getLabelsList(),
              cell.getValue().size());
          builder.cellValue(cell.getValue());
          builder.finishCell();
        }
      }
    }

    return builder.finishRow();
  }
1203410
public static ImmutableVector4 createVector(final double x, final double y, final double z, final double h) {
		return new ImmutableVector4(new ImmutableData(4, 1) {
			@Override
			public double getQuick(int row, int col) {
				switch (row) {
					case 0:
						return x;
					case 1:
						return y;
					case 2:
						return z;
					default:
						return h;
				}
			}
		});
	}