private RealVector Shorten(RealVector x, int dimensions) {
   return new RealVector(x.Take(dimensions).ToArray());
 }