void GeneratedVector::changeRange(double x0, double x1, int n) {
  if (n < 2) {
    n = 2;
  }
  if (n != length()) {
    resize(n, false);
  }
  if (x0 > x1) {
    double tx;
    tx = x0;
    x0 = x1;
    x1 = tx;
  } else if (x0 == x1) {
    x1 = x0 + 0.1;
  }

  for (int i = 0; i < n; i++) {
    _v[i] = x0 + double(i) * (x1 - x0) / double(n - 1);
  }

  _scalars["min"]->setValue(x0);
  _scalars["max"]->setValue(x1);

  registerChange();
}
Exemple #2
0
    void* DurRecoveryUnit::writingPtr(void* data, size_t len) {
        invariant(inAUnitOfWork());

        if (len == 0) return data; // Don't need to do anything for empty ranges.

        // Windows requires us to adjust the address space *before* we write to anything.
        MemoryMappedFile::makeWritable(data, len);

        registerChange(new MemoryWrite(static_cast<char*>(data), len));
        return data;
    }
Exemple #3
0
void DataString::reload() {
  Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED);

  if (_dp->dataSource()) {
    _dp->dataSource()->writeLock();
    _dp->dataSource()->reset();
    _dp->dataSource()->unlock();
    reset();
    registerChange();
  }
}
    void* DurRecoveryUnit::writingPtr(void* data, size_t len) {
        invariant(len > 0);
#if ROLLBACK_ENABLED
        invariant(inAUnitOfWork());

        // Windows requires us to adjust the address space *before* we write to anything.
        MemoryMappedFile::makeWritable(data, len);

        registerChange(new MemoryWrite(static_cast<char*>(data), len));
        return data;
#else
        invariant(_txn->lockState()->isWriteLocked());

        return getDur().writingPtr(data, len);
#endif
    }
Exemple #5
0
    void DurRecoveryUnit::recordPreimage(char* data, size_t len) {
        invariant(len > 0);

        registerChange(new MemoryWrite(data, len));
    }