code: @Override public double magnitude() {
          // Check whether the current magnitude is valid and if not, recompute it
          if (magnitude < 0) {
              double m = 0;
              for (int i = vectorOffset; i < vectorOffset + vectorLength; ++i) {
                  double d = doubleVector.get(i);
                  m += d * d;
              }
              magnitude = Math.sqrt(m);
          }
          return magnitude;
      }
docs: {@inheritDoc}