예제 #1
0
void CWizardSprayCompletion::UpdateSummary(void)
{
	InitializeValues();
	/*
	CString path = m_data->GetPath();
	bool recurse = m_data->GetRecurse();
	CString filter = m_data->GetFilter();
	TestWizardOutputType outputType = m_data->GetOutputType();

	CString text;
	text.Format(
	_T("Test Wizard: \r\n")
	_T("· Find files in the directory:\r\n")
	_T("\t%s\r\n")
	_T("· %s\r\n")
	_T("· Find files matching the filter '%s'\r\n"),
	path,
	recurse ? _T("Also search sub-directories") : _T("Only search that directory"),
	filter);
	m_editSummary.SetWindowText(text);

	CString outputDescription;
	switch(outputType)
	{
	case eOutput_SendEMail:
	outputDescription = 
	_T("· Send the file list in an e-mail\r\n")
	_T("  (using the default mail client)\r\n");
	break;
	case eOutput_SaveToFile:
	{
	CString outputFileName = m_data->GetOutputFileName();
	TestWizardOutputFileEncoding outputFileEncoding = m_data->GetOutputFileEncoding();

	outputDescription.Format(
	_T("· Save the file list to the file:\r\n")
	_T("\t%s\r\n"),
	outputFileName);
	switch(outputFileEncoding)
	{
	case eEncoding_ASCII:
	outputDescription += _T("  with ASCII encoding\r\n");
	break;
	case eEncoding_UCS2:
	outputDescription += _T("  with Unicode (UCS-2) encoding\r\n");
	break;
	case eEncoding_UTF8:
	outputDescription += _T("  with Unicode (UTF-8) encoding\r\n");
	break;
	}
	}
	break;
	case eOutput_Clipboard:
	default:
	outputDescription = _T("· Copy the file list to the clipboard\r\n");
	break;
	}
	m_editSummary.AppendText(outputDescription);
	*/
}
예제 #2
0
LRESULT CWizardSprayWelcome::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	InitializeControls();
	InitializeValues();

	return 1;
}
예제 #3
0
LRESULT CWizardSprayAnalyze::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	CWaitCursor waitCursor;

	InitializeControls();
	InitializeValues();

	return 1;
}
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
void EffectNodeTrack::InitializeRenderedInstanceGroup(InstanceGroup& instanceGroup, Manager* manager)
{
	InstanceGroupValues& instValues = instanceGroup.rendererValues.track;

	InitializeValues(instValues.ColorLeft, TrackColorLeft, manager);
	InitializeValues(instValues.ColorCenter, TrackColorCenter, manager);
	InitializeValues(instValues.ColorRight, TrackColorRight, manager);

	InitializeValues(instValues.ColorLeftMiddle, TrackColorLeftMiddle, manager);
	InitializeValues(instValues.ColorCenterMiddle, TrackColorCenterMiddle, manager);
	InitializeValues(instValues.ColorRightMiddle, TrackColorRightMiddle, manager);

	InitializeValues(instValues.SizeFor, TrackSizeFor, manager);
	InitializeValues(instValues.SizeBack, TrackSizeBack, manager);
	InitializeValues(instValues.SizeMiddle, TrackSizeMiddle, manager);
}
예제 #5
0
double AltitudeCalc::CalcAltitudeWithLapse(double pressure, int index)
{
    if (is_initialized != ALTITUDE_CALCE_IS_INITIALIZED) {
        InitializeValues();
    }

    double staticTempLapse = StaticValues[index]->Temperature / StaticValues[index]->LapseRate;

    double ratioOfStatic = (pressure / StaticValues[index]->Pressure);

    double gasByLapseRate = -UniversalGasConstant * StaticValues[index]->LapseRate;

    double ratioRaisedToPower = pow(ratioOfStatic,
        (gasByLapseRate / AccelerationByMolarMass));

    double h = StaticValues[index]->Height +
        (staticTempLapse) *
        (ratioRaisedToPower - 1);

    return h;
}
예제 #6
0
int main(int argc, char** argv) {
  int rv = MPI_Init(&argc, &argv);
  assert(rv == MPI_SUCCESS);

  int size;
  rv = MPI_Comm_size(MPI_COMM_WORLD, &size);
  assert(rv == MPI_SUCCESS);

  int rank;
  rv = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  assert(rv == MPI_SUCCESS);

  MPI_Status status;

  assert(size == 2);
  assert(M % 2 == 0);

  double start_time = MPI_Wtime();

  std::vector<Value> A(M + 1);
  std::vector<Value> B(M + 1);
  std::vector<Value> C(M + 1);
  std::vector<Value> F(M + 1);

  A[0] = Value(0.0, 0.0);  // Not used.
  for (int m = 1; m <= M - 1; m++) {
    A[m] = Value(d / h / h, D / h / h);
  }
  A[M] = Value(1.0, 1.0);

  B[0] = Value(1.0, 1.0);
  for (int m = 1; m <= M - 1; m++) {
    B[m] = Value(-2.0 * d / h / h - 1.0 / tau, -2.0 * D / h / h - 1.0 / tau);
  }
  B[M] = Value(-1.0, -1.0);

  C[0] = Value(-1.0, -1.0);
  for (int m = 1; m <= M - 1; m++) {
    C[m] = Value(d / h / h, D / h / h);
  }
  C[M] = Value(0.0, 0.0);  // Not used.

  std::vector<Value> As(M + 1);
  std::vector<Value> Bs(M + 1);
  std::vector<Value> Cs(M + 1);
  std::vector<Value> Fs(M + 1);

  As[0] = Value(0.0, 0.0);
  for (int m = 1; m <= M; m++) {
    As[m] = -A[m] * A[m - 1] / B[m - 1];
  }

  Bs[0] = B[0] - C[0] * A[1] / B[1];
  for (int m = 1; m <= M - 1; m++) {
    Bs[m] = B[m] - A[m] * C[m - 1] / B[m - 1] - C[m] * A[m + 1] / B[m + 1];
  }
  Bs[M] = B[M] - A[M] * C[M - 1] / B[M - 1];

  for (int m = 0; m <= M - 1; m++) {
    Cs[m] = -C[m] * C[m + 1] / B[m + 1];
  }
  Cs[M] = Value(0.0, 0.0);

  std::vector<Value> prev_values(M + 1);
  std::vector<Value> curr_values(M + 1);

  InitializeValues(curr_values);

  std::vector<Value> P(M + 1);
  std::vector<Value> Q(M + 1);

  for (int n = 0; n < N; n++) {
    prev_values.swap(curr_values);

    F[0] = Value(0.0, 0.0);
    for (int m = 1; m <= M - 1; m++) {
      if (m % 2 == rank) {
        F[m].u = -prev_values[m].u / tau - f(prev_values[m]);
        F[m].v = -prev_values[m].v / tau - g(prev_values[m]);
      }
    }
    F[M] = Value(0.0, 0.0);

    for (int m = 1; m <= M - 1; m++) {
      if (m % 2 == rank) {
        rv = MPI_Send(&F[m].u, 1, MPI_DOUBLE, (rank + 1) % 2, m, MPI_COMM_WORLD);
        assert(rv == MPI_SUCCESS);
        rv = MPI_Send(&F[m].v, 1, MPI_DOUBLE, (rank + 1) % 2, m, MPI_COMM_WORLD);
        assert(rv == MPI_SUCCESS);
      } else {
        rv = MPI_Recv(&F[m].u, 1, MPI_DOUBLE, (rank + 1) % 2, m, MPI_COMM_WORLD, &status);
        assert(rv == MPI_SUCCESS);
        rv = MPI_Recv(&F[m].v, 1, MPI_DOUBLE, (rank + 1) % 2, m, MPI_COMM_WORLD, &status);
        assert(rv == MPI_SUCCESS);
      }
    }

    Fs[0] = F[0] - C[0] / B[1] * F[1];
    for (int m = 1; m <= M - 1; m++) {
      if (m % 2 == rank) {
        Fs[m] = F[m] - A[m] / B[m - 1] * F[m - 1] - C[m] / B[m + 1] * F[m + 1];
      }
    }
    Fs[M] = F[M] - A[M] / B[M - 1] * F[M - 1];

    if (rank == 0) {
      P[0] = -Cs[0] / Bs[0];
      Q[0] = Fs[0] / Bs[0];
    } else {
      P[1] = -Cs[1] / Bs[1];
      Q[1] = Fs[1] / Bs[1];
    }

    for (int m = 2; m <= M; m++) {
      if (m % 2 == rank) {
        P[m] = -Cs[m] / (As[m] * P[m - 2] + Bs[m]);
        Q[m] = (Fs[m] - As[m] * Q[m - 2]) / (As[m] * P[m - 2] + Bs[m]);
      }
    }

    if (M % 2 == rank) {
      curr_values[M] = Q[M];
    } else {
      curr_values[M - 1] = Q[M - 1];
    }

    for (int m = M - 2; m >= 0; m--) {
      if (m % 2 == rank) {
        curr_values[m] = P[m] * curr_values[m + 2] + Q[m];
      }
    }
  }

  for (int m = 0; m <= M; m++) {
    if (m % 2 == rank) {
      rv = MPI_Send(&curr_values[m].u, 1, MPI_DOUBLE, (rank + 1) % 2, m, MPI_COMM_WORLD);
      assert(rv == MPI_SUCCESS);
      rv = MPI_Send(&curr_values[m].v, 1, MPI_DOUBLE, (rank + 1) % 2, m, MPI_COMM_WORLD);
      assert(rv == MPI_SUCCESS);
    } else {
      rv = MPI_Recv(&curr_values[m].u, 1, MPI_DOUBLE, (rank + 1) % 2, m, MPI_COMM_WORLD, &status);
      assert(rv == MPI_SUCCESS);
      rv = MPI_Recv(&curr_values[m].v, 1, MPI_DOUBLE, (rank + 1) % 2, m, MPI_COMM_WORLD, &status);
      assert(rv == MPI_SUCCESS);
    }
  }

  if (rank == 0) {
    printf("%lf\n", MPI_Wtime() - start_time);
    /*
    for (int m = 0; m < M; m++) {
      double coord = X * m / M;
      printf("%lf %lf %lf\n", coord, curr_values[m].u, curr_values[m].v);
    }
    */
  }

  rv = MPI_Finalize();
  assert(rv == MPI_SUCCESS);

  return EXIT_SUCCESS;
}
예제 #7
0
    /// Default constructor. Models C1 observations, use TGD,
    /// but doesn't apply atmospheric models
 ModelObsFixedStation()
    : minElev(10.0), useTGD(true), pDefaultIonoModel(NULL),
      pDefaultTropoModel(NULL), defaultObservable(TypeID::C1),
      pDefaultEphemeris(NULL)
 { InitializeValues(); setIndex(); };
예제 #8
0
TextureDescriptor::TextureDescriptor()
{
    isCompressedFile = false;
    InitializeValues();
}
예제 #9
0
AltitudeCalc::AltitudeCalc()
{
    InitializeValues();
}