当前位置: 首页>>代码示例>>C++>>正文


C++ Measurement类代码示例

本文整理汇总了C++中Measurement的典型用法代码示例。如果您正苦于以下问题:C++ Measurement类的具体用法?C++ Measurement怎么用?C++ Measurement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Measurement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetTimeSeriesData

void InputStation::GetTimeSeriesData(time_t time, string type, int *nRow, float **data)
{
    Measurement *m = m_measurement[type];
    *nRow = m->NumberOfSites();
    //cout << type << "\t" << *nRow << endl;
    *data = m->GetSiteDataByTime(time);
}
开发者ID:Shenfang1993,项目名称:SEIMS,代码行数:7,代码来源:InputStation.cpp

示例2: do_rand_gen

double do_rand_gen(int size_input, mpz_t *vec, mpz_t prime) {
    Measurement m;
    m.begin_with_init();
    crypto->get_random_vec_priv(size_input, vec, prime);
    m.end();
    return m.get_ru_elapsed_time();
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: do_decrypt

double do_decrypt(int size_input, mpz_t *plain, mpz_t *cipher,
                  int prime_size, mpz_t prime) {

    Measurement m;
    m.begin_with_init();
    for (int i=0; i<size_input; i++)
        crypto->elgamal_dec(plain[i], cipher[2*i], cipher[2*i+1]);
    m.end();
    return m.get_ru_elapsed_time();
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例4: QObject

Measurement::Measurement(QObject * parent)
	: QObject(parent)
{
	m_callback = vtkCallbackCommand::New();
	m_callback->SetClientData(this);
	m_callback->SetCallback([](vtkObject *caller, unsigned long eid,
		void *clientdata, void *calldata) {
		Measurement* self = static_cast<Measurement*>(clientdata);
		self->update();
	});
}
开发者ID:wuzhuobin,项目名称:blood_vessel,代码行数:11,代码来源:Measurement.cpp

示例5: do_encrypt

// ======== cost of ciphertext operations ======
double do_encrypt(int size_input, mpz_t *plain, mpz_t *cipher,
                  int prime_size, mpz_t prime) {

    Measurement m;
    crypto->get_random_vec_priv(size_input, plain, prime);

    m.begin_with_init();
    for (int i=0; i<size_input; i++)
        crypto->elgamal_enc(cipher[2*i], cipher[2*i+1], plain[i]);
    m.end();
    return m.get_ru_elapsed_time();
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例6: do_regular_ciphermul

double do_regular_ciphermul(int size_input, mpz_t *plain, mpz_t *cipher,
                            int prime_size, mpz_t prime) {
    mpz_t out1, out2;
    alloc_init_scalar(out1);
    alloc_init_scalar(out2);

    Measurement m;
    m.begin_with_init();
    crypto->dot_product_regular_enc(size_input, cipher, plain, out1, out2);
    m.end();

    clear_scalar(out1);
    clear_scalar(out2);
    return m.get_ru_elapsed_time();
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例7: init

 void Entity::init(int id, Measurement &meas)
 {
      occluded_dead_age_ = 10;
      id_ = id;
      age_ = 0;
      tracker_.set_measurement(meas.position());          
 }
开发者ID:SyllogismRXS,项目名称:openmht,代码行数:7,代码来源:Entity.cpp

示例8: do_div

double do_div(int size_input, mpz_t *vec1,
              mpz_t *vec2, mpz_t *vec3, int operand_size1, int operand_size2,
              mpz_t prime) {
    Measurement m;

    crypto->get_random_vec_priv(size_input, vec1, operand_size1);
    crypto->get_random_vec_priv(size_input, vec2, operand_size2);

    m.begin_with_init();
    for (int i=0; i<size_input; i++) {
        mpz_invert(vec3[i], vec2[i], prime);
        mpz_mul(vec3[i], vec3[i], vec1[i]);
        mpz_mod(vec3[i], vec3[i], prime);
    }
    m.end();
    return m.get_ru_elapsed_time();
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例9: switch

void G2ODriver::AddEdge(int edgeId, Vertex* point, Vertex* keyFrame, const Measurement& meas)
{
  Edge* e = nullptr;
  switch ( meas.GetType() )
  {
    case Measurement::LEFT :
      // Left-only measurements
      e = BuildMonoEdge( {meas.GetKeypoints()[0].pt.x, meas.GetKeypoints()[0].pt.y} );
      break;
    case Measurement::STEREO :
      // Stereo measurements (x1,y1,x2) as cameras are rectified, left and right meas share the same y-axis
      e = BuildStereoEdge( {meas.GetKeypoints()[0].pt.x, meas.GetKeypoints()[0].pt.y, meas.GetKeypoints()[1].pt.x} );
      break;
    case Measurement::RIGHT :
      // Right-only measurements
      e = BuildMonoEdgeRight( {meas.GetKeypoints()[0].pt.x, meas.GetKeypoints()[0].pt.y} );
      break;
    default:
      // TODO throw an exception (tfischer)
      assert( false );
      break;
  }

  e->vertices()[0] = point;
  e->vertices()[1] = keyFrame;

  g2o::RobustKernelHuber* rk = new g2o::RobustKernelHuber;
  e->setRobustKernel(rk);
  rk->setDelta(robust_cost_function_delta_);

  e->setId( edgeId );

  optimizer_.addEdge( e );
}
开发者ID:snooble,项目名称:sptam,代码行数:34,代码来源:g2o_driver.cpp

示例10: solveWithPlanes

void MultiSolver::solveWithPlanes(SolverInput *input, int currentIdx)
{
	if ((size_t)currentIdx == input->measurements.size())
	{
		inputList.push_back(MultiSolverInput(input));
		//end condition
		return;
	}
	Measurement *measurement = input->measurements[currentIdx];
	measurement->resetIterator();
	while(measurement->nextVBeacon())
	{	
		// check measured distance is long enough to reflect corresponding wall
		if (!measurement->isValidDistance())
			continue;

		// check optimization
		if (condition.cutBranch1)
		{
			if (checkCutBranch1(input, currentIdx))
			{
				continue;
			}
		}

		// optimization 2 is not added
#if 0
		if (condition.cutBranch2)
		{
			if (checkBranchCutoffCylinder(input, currentIdx))
			{
				if (condition.gatherData)
					input->setInvalidButGather(1);

				else continue;
			}
		}
#endif

		solveWithPlanes(input, currentIdx + 1);
	}
}
开发者ID:idaohang,项目名称:PVA-ULT-simulator,代码行数:42,代码来源:MultiSolver.cpp

示例11: do_field_mult

// ======== cost of plaintext operations =========
double do_field_mult(int size_input, mpz_t *vec1,
                     mpz_t *vec2, mpz_t *vec3, mpz_t prime) {
    Measurement m;

    crypto->get_random_vec_priv(size_input, vec1, prime);
    crypto->get_random_vec_priv(size_input, vec2, prime);

    m.begin_with_init();
    for (int i=0; i<size_input; i++) {
        mpz_mul(vec3[i], vec1[i], vec2[i]);
        mpz_mod(vec3[i], vec3[i], prime);
    }

    for (int i=0; i<size_input; i++) {
        mpz_add(vec3[i], vec1[i], vec2[i]);
        mpz_mod(vec3[i], vec3[i], prime);
    }
    m.end();
    return m.get_ru_elapsed_time();
}
开发者ID:,项目名称:,代码行数:21,代码来源:

示例12: getMeasurement

Measurement* getMeasurement(bhep::hit& hit)
{
  EVector hit_pos(2,0);
  EVector meas_pos(3,0);
  
  meas_pos[0] = hit.x()[0];
  meas_pos[1] = hit.x()[1];
  meas_pos[2] = hit.x()[2];
  
  hit_pos[0] = meas_pos[0];
  hit_pos[1] = meas_pos[1];

  //covariance and meastype hardwired for now.
  EMatrix cov(2,2,0);
  cov[0][0] = 1.; cov[1][1] = 1.;
  string meastype = "xy";

  Measurement* me = new Measurement();
  me->set_name(meastype);
  me->set_hv(HyperVector(hit_pos,cov));
  me->set_name("volume", "Detector");
  me->set_position( meas_pos );

  //Add the hit energy deposit as a key to the Measurement.
  const dict::Key Edep = "E_dep";
  const dict::Key EdepVal = hit.data("E_dep");
  me->set_name(Edep, EdepVal);

  return me;
}
开发者ID:nuSTORM,项目名称:mind_rec,代码行数:30,代码来源:rec_had_show.cpp

示例13: ComputeSingleShapeError

double CTRCalibration::ComputeSingleShapeError(CTR* robot, MechanicsBasedKinematics* kinematics, const Measurement& meas, double& max_error_current, bool solveKin)
{
	double rotation[3] = {0};
	double translation[3] = {0};
	double relativeConf[5];

	memcpy(relativeConf, meas.GetConfiguration().data(), sizeof(double) * 5);
	relativeConf[0] *= M_PI/180.0;
	relativeConf[1] *= M_PI/180.0;
	relativeConf[3] *= M_PI/180.0;

	::std::vector<::Eigen::Vector3d> positionsAlongRobotExp = meas.GetShapeEig();
	::std::vector<::Eigen::Vector3d> positionsAlongRobotModel;
	::Eigen::Vector3d error;

	MechanicsBasedKinematics::RelativeToAbsolute(robot, relativeConf, rotation, translation);

	::std::vector<double> robot_length_parameter = meas.GetArcLength();
	
	if(solveKin)
		if(!kinematics->ComputeKinematics(rotation, translation))
			return -1.0;

	kinematics->GetRobotShape(robot_length_parameter, positionsAlongRobotModel);

	double sum = 0;

	for(int i = 0; i < positionsAlongRobotModel.size(); ++i)
	{
		error = positionsAlongRobotExp[i] - positionsAlongRobotModel[i];
		if (error.norm() > max_error_current)
			max_error_current = error.norm();
		sum += error.norm() * error.norm();
	}

	return sum/positionsAlongRobotModel.size();
	//error = positionsAlongRobotExp[positionsAlongRobotExp.size() - 1] - positionsAlongRobotModel[positionsAlongRobotModel.size() - 1];
	//max_error_current = error.norm();
	//return max_error_current;
}
开发者ID:hjhdog1,项目名称:ConcentricTubes,代码行数:40,代码来源:CTRCalibration.cpp

示例14: BasicDistributions

void BasicDistributions(){

	Measurement *basics = new Measurement("basics","_FSQJets3_2015C_data_13TeV_LowPU");

	basics->IncludeFunction(pt);
	basics->IncludeFunction(cor);
	basics->IncludeFunction(unc);
	basics->IncludeFunction(eta);
	basics->IncludeFunction(rap);
	basics->IncludeFunction(phi);

	basics->IncludeObject(incl);

	basics->IncludeSample(merged_pt35_eta2d1);

	basics->ReadDataset(data);

	basics->CalculateResult(pt_spectrum);

	basics->WriteToFile("./basics_", 1 /* 1 - only results, 2 - results and observables */);

};
开发者ID:ipozdnyakov,项目名称:small_x_dijets,代码行数:22,代码来源:main.cpp

示例15: buildDefUrl

void VectorMeas::writeXML(XMLWriter& w)
{
    // Vector
    w.tagStart(w.buildTagName(SWE_PREFIX, ELT_VECTOR));

    // definition attribute
    char defUri[80];
    if (this->Definition != NULL)
    {
        buildDefUrl(this->Definition, defUri);
        w.tagField(w.buildTagName(NULL, ATT_DEFINITION), defUri);
    }

    // ref frame attribute
    if (this->RefFrame != NULL)
    {
        buildDefUrl(this->RefFrame, defUri);
        w.tagField(w.buildTagName(NULL, ATT_REFRAME), defUri);
    }

    w.tagEnd(true, false);

    // label
    if (this->Label != NULL)
        w.writeNode(w.buildTagName(SWE_PREFIX, ELT_LABEL), this->Label);

    // coordinates
    for (int i = 0; i < numCoords; i++)
    {
        Measurement* m = coords[i];
        w.tagStart(w.buildTagName(SWE_PREFIX, ELT_COORDINATE));
        w.tagField(w.buildTagName(NULL, ATT_NAME), m->getName());
        w.tagEnd(true, false);
        m->writeXML(w);
        w.tagClose();
    }

    w.tagClose();
}
开发者ID:opensensorhub,项目名称:osh-arduino,代码行数:39,代码来源:Measurement.cpp


注:本文中的Measurement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。