code: public double setValue(int idx, double val) {
          int vSize = MVecArray.count(varBeliefs);
          if (idx < vSize) {
              return MVecArray.setValue(idx, val, varBeliefs);
          } else {
              return MVecArray.setValue(idx - vSize, val, facBeliefs);
          }
      }
docs: Sets a particular value by treating this object as a vector.
  
  NOTE: This implementation is O(n).
  
  @param idx The index of the value to set.
  @param val The value to set.
  @return The previous value at that index.