예제 #1
0
 public void setItemVector(String item, float[] vector) {
   Preconditions.checkNotNull(vector);
   Preconditions.checkArgument(vector.length == features);
   Lock lock = yLock.writeLock();
   lock.lock();
   try {
     Y.put(item, vector);
   } finally {
     lock.unlock();
   }
 }
예제 #2
0
 public void setUserVector(String user, float[] vector) {
   Preconditions.checkNotNull(vector);
   Preconditions.checkArgument(vector.length == features);
   Lock lock = xLock.writeLock();
   lock.lock();
   try {
     X.put(user, vector);
   } finally {
     lock.unlock();
   }
 }