/**
  * Construct a new vector from a key set and value array.
  *
  * @param ks The key set. Used as-is, and will be modified. Pass a clone, usually.
  * @param vs The value array.
  */
 @SuppressWarnings("PMD.ArrayIsStoredDirectly")
 SparseVector(LongKeyDomain ks, double[] vs) {
   assert vs.length >= ks.domainSize();
   keys = ks;
   keys.acquire();
   values = vs;
 }