• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ e1函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: p0

dgBigVector dgCollisionConvexHull::FaceNormal (const dgEdge *face, const dgBigVector* const pool) const
{
	const dgEdge* edge = face;
	dgBigVector p0 (pool[edge->m_incidentVertex]);
	edge = edge->m_next;

	dgBigVector p1 (pool[edge->m_incidentVertex]);
	dgBigVector e1 (p1 - p0);

	dgBigVector normal (dgFloat32 (0.0f));
	for (edge = edge->m_next; edge != face; edge = edge->m_next) {
		dgBigVector p2 (pool[edge->m_incidentVertex]);
		dgBigVector e2 (p2 - p0);
		dgBigVector n1 (e1.CrossProduct(e2));
#ifdef _DEBUG
		dgAssert(n1.m_w == dgFloat32(0.0f));
		dgFloat64 mag = normal.DotProduct(n1).GetScalar();
		dgAssert ( mag >= -dgFloat32 (0.1f));
#endif
		normal += n1;
		e1 = e2;
	} 

	dgFloat64 den = sqrt (normal.DotProduct(normal).GetScalar()) + dgFloat64 (1.0e-24f);
	normal = normal.Scale (dgFloat64 (1.0f)/ den);

#ifdef _DEBUG
	edge = face;
	dgBigVector e0 (pool[edge->m_incidentVertex] - pool[edge->m_prev->m_incidentVertex]);	
	do {
		dgBigVector de1 (pool[edge->m_next->m_incidentVertex] - pool[edge->m_incidentVertex]);	
		dgBigVector dn1 (e0.CrossProduct(de1));
		dgFloat64 x = normal.DotProduct(dn1).GetScalar();
		dgAssert (x > -dgFloat64 (0.01f));
		e0 = de1;
		edge = edge->m_next;
	} while (edge != face);
#endif
	return normal;
}
开发者ID:AntonSynytsia,项目名称:MSPhysics,代码行数:40,代码来源:dgCollisionConvexHull.cpp


示例2: e0

void dgCollisionDeformableMesh::UpdateVisualNormals()
{
	for (dgInt32 i = 0; i < m_trianglesCount; i ++)	{
		dgInt32 i0 = m_indexList[i * 3];
		dgInt32 i1 = m_indexList[i * 3 + 1];
		dgInt32 i2 = m_indexList[i * 3 + 2];
		dgVector e0 (m_particles.m_posit[i1] - m_particles.m_posit[i0]);
		dgVector e1 (m_particles.m_posit[i2] - m_particles.m_posit[i0]);
		dgVector n = e0 * e1;
		n = n.Scale3(dgRsqrt (n % n));
		m_faceNormals[i] = n;
	} 

	dgAssert (m_visualVertexData);
	for (dgInt32 i = 0; i < m_visualVertexCount; i ++)	{
		m_visualVertexData[i].m_normals[0] = dgFloat32 (0.0f);
		m_visualVertexData[i].m_normals[1] = dgFloat32 (0.0f);
		m_visualVertexData[i].m_normals[2] = dgFloat32 (0.0f);
	}

	for (dgList<dgMeshSegment>::dgListNode* node = m_visualSegments.GetFirst(); node; node = node->GetNext() ) {
		const dgMeshSegment& segment = node->GetInfo();

		for (dgInt32 i = 0; i < segment.m_indexCount; i ++) {
			dgInt32 index = segment.m_indexList[i];
			dgInt32 faceIndexNormal = i / 3;
			m_visualVertexData[index].m_normals[0] += m_faceNormals[faceIndexNormal].m_x;
			m_visualVertexData[index].m_normals[1] += m_faceNormals[faceIndexNormal].m_y;
			m_visualVertexData[index].m_normals[2] += m_faceNormals[faceIndexNormal].m_z;
		}
	}

	for (dgInt32 i = 0; i < m_visualVertexCount; i ++)	{
		dgVector n (m_visualVertexData[i].m_normals[0], m_visualVertexData[i].m_normals[1], m_visualVertexData[i].m_normals[2],  dgFloat32 (0.0f));
		n = n.Scale3(dgRsqrt (n % n));
		m_visualVertexData[i].m_normals[0] = n.m_x;
		m_visualVertexData[i].m_normals[1] = n.m_y;
		m_visualVertexData[i].m_normals[2] = n.m_z;
	}
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:40,代码来源:dgCollisionDeformableMesh.cpp


示例3: e5

static integer e5(void)
{
  integer result;
  char* name;
  {
    if (scan_test(NULL, SCAN_P_ID, NULL))
    {
      scan_test(NULL, SCAN_P_ID, &e5_stop);
      name = SCAN_CAST->id;
      scan_();
       if (symbol_lookup_key(mini, &name, NULL) == NULL)\
                 {\
                   text_message(TEXT_ERROR, "Undeclared variable '%s'\n", name);\
                   symbol_insert_key(mini, &name, sizeof(char*), sizeof(mini_data));\
                 }\
              
 result = mini_cast(symbol_lookup_key(mini, &name, NULL))->i; 
    }
    else
    if (scan_test(NULL, SCAN_P_INTEGER, NULL))
    {
      scan_test(NULL, SCAN_P_INTEGER, &e5_stop);
      result = SCAN_CAST->data.i;
      scan_();
    }
    else
    if (scan_test(NULL, RDP_T_40 /* ( */, NULL))
    {
      scan_test(NULL, RDP_T_40 /* ( */, &e5_stop);
      scan_();
      result = e1();
      scan_test(NULL, RDP_T_41 /* ) */, &e5_stop);
      scan_();
    }
    else
      scan_test_set(NULL, &e5_first, &e5_stop)    ;
    scan_test_set(NULL, &e5_stop, &e5_stop);
   }
  return result;
}
开发者ID:dsholla,项目名称:rdp1_6,代码行数:40,代码来源:minicalc.c


示例4: assert

void VertexNormalAttribute::compute_vertex_normals_from_edge(Mesh& mesh) {
    const size_t dim = mesh.get_dim();
    assert(dim == 2);
    const size_t num_vertices = mesh.get_num_vertices();
    const size_t num_faces = mesh.get_num_faces();
    const size_t vertex_per_face = mesh.get_vertex_per_face();

    const VectorF& normals = get_attribute(mesh, "face_normal");

    VectorF& v_normals = m_values;
    v_normals = VectorF::Zero(dim * num_vertices);

    for (size_t i=0; i<num_faces; i++) {
        VectorI face = mesh.get_face(i);
        for (size_t j=0; j<vertex_per_face; j++) {
            size_t prev = (j-1+vertex_per_face) % vertex_per_face;
            size_t next = (j+1) % vertex_per_face;
            Vector2F prev_edge = mesh.get_vertex(face[j]) -
                mesh.get_vertex(face[prev]);
            Vector2F next_edge = mesh.get_vertex(face[next]) -
                mesh.get_vertex(face[j]);

            Vector3F n = normals.segment(i*3, 3);
            Vector3F e1(prev_edge[0], prev_edge[1], 0);
            Vector3F e2(next_edge[0], next_edge[1], 0);
            Vector3F n1 = e1.cross(n);
            Vector3F n2 = e2.cross(n);

            v_normals.segment(face[j]*dim, dim) += (n1 + n2).segment(0, dim);
        }
    }

    for (size_t i=0; i<num_vertices; i++) {
        Float norm = v_normals.segment(i*dim, dim).norm();
        if (norm > 1e-6) {
            v_normals.segment(i*dim, dim) /= norm;
        }
    }
}
开发者ID:gaoyue17,项目名称:PyMesh,代码行数:39,代码来源:VertexNormalAttribute.cpp


示例5: e1

std::vector<ShapeState::Point> ShapeState::assignLTC(const std::vector<ShapeState::Point>& _points, float ltcr)
{
    std::random_device rd;
    std::default_random_engine e1(rd());
    std::uniform_real_distribution<float> ltcrRnd(0, 1);

    std::vector<Point> points = _points;

    for (auto& p: points)
    {
        if (ltcrRnd(e1) >= ltcr)
        {
            p.t = 0.f;
        }
        else
        {
            p.t = m_curviness;
        }
    }

    return points;
}
开发者ID:porkmarks,项目名称:mthesis,代码行数:22,代码来源:ShapeState.cpp


示例6: test_feature

bool test_feature()
{
    int edata[_rank];
    for (int i = 0; i < _rank; i++)
        edata[i] = i+1;
    extent<_rank> e1(edata);

    _type *data = NULL;
    data = new _type[e1.size()];
    for (unsigned int i = 0; i < e1.size(); i++)
        data[i] = (_type)rand();

    {
        bool pass = test_feature_itr<_type, _rank>(e1, data, data+e1.size()) &&
            test_feature_itr<_type, _rank>(e1, data);

        if (!pass)
            return false;
    }

    return true;
}
开发者ID:pathscale,项目名称:amp-testsuite,代码行数:22,代码来源:test.cpp


示例7: main

int main(int argc, char * argv[]) {
    std::array<double, 16>
        t1 = {{ 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, }},
        t2 = {{ 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, }};

    // IN
    Eigen::Map<Eigen::Matrix<double, 4, 4, Eigen::RowMajor>> e1((double*)t1.data());

    Eigen::Quaternionf q1 = Eigen::Quaternionf( e1.topLeftCorner<3,3>().cast<float>() );
    Eigen::Vector4f v1 = Eigen::Vector4f( e1.topRightCorner<4,1>().cast<float>() );

    // OUT
    Eigen::Map<Eigen::Matrix<double, 4, 4, Eigen::RowMajor>> e2((double*)t2.data());

    e2.topLeftCorner<3,3>() = q1.toRotationMatrix().cast<double>();
    e2.topRightCorner<4,1>() = v1.cast<double>();

    // DISP
    std::cout<<e1<<std::endl;
    std::cout<<e2<<std::endl;
    return 0;
}
开发者ID:Ellon,项目名称:atlaas,代码行数:22,代码来源:eigen_test.cpp


示例8: H2

Z H2(e2){
  I z;
  I isWritableFile();
  CX cx=Cx;
  ND2;
  z=*a->p;
  if (It==a->t||qz(a)) 
  { 
    if(dbg_txeq)xeqtrc((C *)w->p,3);
    if(w->c||isWritableFile((I)w))z=pexm((I)w->p,APL);
    else 
    {
      C *buf=(C *)mab(w->n+1);
      memmove(buf,w->p,w->n+1);
      z=pexm((I)buf,APL);
      mf((I *)buf);
    }
    if(dbg_txeq)xeqtrc((C *)w->p,2);
    R z;
  }
  else R QS(z)?(Cx=cxi(XS(z)),z=e1(w),Cx=cx,z):(q=6,0);
}
开发者ID:PlanetAPL,项目名称:a-plus,代码行数:22,代码来源:f.c


示例9: origSrc

Msg* OneToAllMsg::copy( Id origSrc, Id newSrc, Id newTgt,
			FuncId fid, unsigned int b, unsigned int n ) const
{
	const Element* orig = origSrc();
	if ( n <= 1 ) {
		OneToAllMsg* ret = 0;
		if ( orig == e1() ) {
			ret = new OneToAllMsg( Msg::nextMsgId(), Eref( newSrc(), i1_ ), newTgt() );
			ret->e1()->addMsgAndFunc( ret->mid(), fid, b );
		} else if ( orig == e2() ) {
			ret = new OneToAllMsg( Msg::nextMsgId(), Eref( newTgt(), i1_ ), newSrc() );
			ret->e2()->addMsgAndFunc( ret->mid(), fid, b );
		} else {
			assert( 0 );
		}
		return ret;
	} else {
		// Here we need a SliceMsg which goes from one 2-d array to another.
		cout << "Error: OneToAllMsg::copy: SliceToSliceMsg not yet implemented\n";
		return 0;
	}
}
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:22,代码来源:OneToAllMsg.cpp


示例10: nodeFromId

Node FlowGraph::_demandKariz(Demand d, Edge& srcEdge, Edge& trgEdge, Identifier demandId) {
    // We find the kariz belong to demandId using three characteristics
    //  1- A Kariz is only connected to its demand source and target
    //  2- IsKariz is true for this node
    //  3- A Kariz has the same id as the demand d.
    Node src = nodeFromId(d.source());
    Node trg = nodeFromId(d.target());
    
    Node kariz = INVALID;
    for (OutArcIt e1(*this, src); e1 != INVALID; ++e1) {
        for (OutArcIt e2(*this, trg); e2 != INVALID; ++e2) {
            Node tmp = this->target(e1);
            if (tmp == this->target(e2) && isKariz_[tmp] && demandId_[tmp] == demandId) {
                kariz = tmp;
                srcEdge = e1; trgEdge = e2;
                break;
            }//if
        }//if
    }//for
    
    return kariz;
}
开发者ID:miladghaznavi,项目名称:Elastic-VNF-Placement,代码行数:22,代码来源:flowgraph.cpp


示例11: sn

void Foam::myHeatFluxFvPatchVectorField::updateCoeffs()
{
    if (this->updated())
    {
        return;
    }

    // VARIABLEN/FELDER
    scalarField sn(patch().size()),
                st(patch().size()),
                sct(patch().size()),
                gt(patch().size());
    vectorField t(patch().size()),
                n(patch().size());
    vectorField& s = *this;

    // Berechnung von Richtungen
    n = this->patch().nf();
    t = g0/mag(g0);

    // Betrag in normalen Richtung n
    fvPatchField<scalar> boundaryTheta = interpolateBoundaryTheta();
    sn = alpha * (boundaryTheta - Theta_wall);

    // Betrag in tangentiale Richtung t (Approximation durch einseitige FD)
    vector e1(1,0,0);
    vector e2(0,1,0);
    vector e3(0,0,1);
    vectorField sc = this->patchInternalField();
    scalarField d = 1.0/this->patch().deltaCoeffs();
    gt  = ( (g0 ^ n) & e2 );
    sct = ( (sc ^ n) & e2 );
    st = ( sct - d*gt ) / ( 1 + d*gamma );

    // gesamter Wärmestrom s
    s = sn*n + st*t;

    fixedValueFvPatchVectorField::updateCoeffs();
}
开发者ID:JonasBuenger,项目名称:myFoamStuff,代码行数:39,代码来源:myHeatFluxFvPatchVectorField.C


示例12: TEST_F

TEST_F(FunctionTests, TestThatLikeFunctionsAgree)
{
  FunctionPtr u_prev = Teuchos::rcp( new UPrev );
  
  vector<double> e1(2); // (1,0)
  e1[0] = 1;
  vector<double> e2(2); // (0,1)
  e2[1] = 1;
  
  FunctionPtr beta = e1 * u_prev + Teuchos::rcp( new ConstantVectorFunction( e2 ) );
  
  FunctionPtr u_prev_squared_div2 = 0.5 * u_prev * u_prev;
  
  checkFunctionsAgree(e2 * u_prev, 
      Teuchos::rcp( new ConstantVectorFunction( e2 ) ) * u_prev,
      _basisCache);
  
  FunctionPtr e1_f = Teuchos::rcp( new ConstantVectorFunction( e1 ) );
  FunctionPtr e2_f = Teuchos::rcp( new ConstantVectorFunction( e2 ) );
  FunctionPtr one  = Teuchos::rcp( new ConstantScalarFunction( 1.0 ) );
  checkFunctionsAgree( Teuchos::rcp( new ProductFunction(e1_f, (e1_f + e2_f)) ), // e1_f * (e1_f + e2_f)
      one,
      _basisCache);
  
  vector<double> e1_div2 = e1;
  e1_div2[0] /= 2.0;
  
  checkFunctionsAgree(u_prev_squared_div2, 
      (e1_div2 * beta) * u_prev,
      _basisCache);
  
  checkFunctionsAgree(e1 * u_prev_squared_div2, 
      (e1_div2 * beta * e1) * u_prev,
      _basisCache);
  
  checkFunctionsAgree(e1 * u_prev_squared_div2 + e2 * u_prev, 
      (e1_div2 * beta * e1 + Teuchos::rcp( new ConstantVectorFunction( e2 ) )) * u_prev,
      _basisCache);
}
开发者ID:Kun-Qu,项目名称:Camellia,代码行数:39,代码来源:FunctionTests.cpp


示例13: test_timed_sharable_mutex

void test_timed_sharable_mutex()
{
   SM mtx;
   data<SM> s1(1,1*BaseSeconds);
   data<SM> s2(2,3*BaseSeconds);
   data<SM> e1(3,3*BaseSeconds);
   data<SM> e2(4,1*BaseSeconds);

   // We begin with some specialized tests for "timed" behavior

   shared_val = 0;

   // Writer one will hold the lock for 3*BaseSeconds seconds.
   boost::thread tw1(thread_adapter<SM>(timed_exclusive,&e1,mtx));

   boost::thread::sleep(xsecs(1*BaseSeconds));
   // Writer two will "clearly" try for the lock after the readers
   //  have tried for it.  Writer will wait up 1*BaseSeconds seconds for the lock.
   //  This write will fail.
   boost::thread tw2(thread_adapter<SM>(timed_exclusive,&e2,mtx));

   // Readers one and two will "clearly" try for the lock after writer
   //   one already holds it.  1st reader will wait 1*BaseSeconds seconds, and will fail
   //   to get the lock.  2nd reader will wait 3*BaseSeconds seconds, and will get
   //   the lock.

   boost::thread thr1(thread_adapter<SM>(timed_shared,&s1,mtx));
   boost::thread thr2(thread_adapter<SM>(timed_shared,&s2,mtx));

   tw1.join();
   thr1.join();
   thr2.join();
   tw2.join();

   BOOST_INTERPROCES_CHECK(e1.m_value == 10);
   BOOST_INTERPROCES_CHECK(s1.m_value == -1);
   BOOST_INTERPROCES_CHECK(s2.m_value == 10);
   BOOST_INTERPROCES_CHECK(e2.m_value == -1);
}
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:39,代码来源:sharable_mutex_test_template.hpp


示例14: perp

    void Cone::draw(bool debug) {
        Point c = apex.translate(axis);
        Vector e0 = perp(axis);

        Vector v3 = e0.cross(axis);

        Point e1(v3.getX(), v3.getY(), v3.getZ());

        std::vector <Point> pts;
        for (int i = 0; i < meridians; ++i) {
            double rad = 2 * M_PI * i / meridians;
            double x = c.getX() + (e0.getX() * cos(rad) + e1.getX() * sin(rad)) * rayon;
            double y = c.getY() + (e0.getY() * cos(rad) + e1.getY() * sin(rad)) * rayon;
            double z = c.getZ() + (e0.getZ() * cos(rad) + e1.getZ() * sin(rad)) * rayon;
            Point p(x, y, z);
            pts.push_back(p);
        }

// draw cone top
        glBegin(GL_TRIANGLE_FAN);
        glPoint(apex);
        for (int i = 0; i < meridians; ++i) {
            glPoint(pts.at(i));
        }
        glPoint(pts.at(0));
        glEnd();

        if (debug) {
            glColor3f(1.0f, 0.0f, 0.0f);
            for (int i = 0; i < meridians; ++i) {
                glBegin(GL_LINES);
                glPoint(apex);
                glPoint(pts.at(i));
                glEnd();
            }
        }

    }
开发者ID:rascal222,项目名称:ProgrammationCPP3D,代码行数:38,代码来源:Cone.cpp


示例15: TEST

TEST(HashedSetAbstractDomainTest, latticeOperations) {
  Domain e1("a");
  Domain e2({"a", "b", "c"});
  Domain e3({"b", "c", "d"});

  EXPECT_THAT(e1.elements(), ::testing::UnorderedElementsAre("a"));
  EXPECT_THAT(e2.elements(), ::testing::UnorderedElementsAre("a", "b", "c"));
  EXPECT_THAT(e3.elements(), ::testing::UnorderedElementsAre("b", "c", "d"));

  std::ostringstream out;
  out << e1;
  EXPECT_EQ("[#1]{a}", out.str());

  EXPECT_TRUE(e1.leq(e2));
  EXPECT_FALSE(e1.leq(e3));
  EXPECT_TRUE(e2.equals(Domain({"b", "c", "a"})));
  EXPECT_FALSE(e2.equals(e3));

  EXPECT_THAT(e2.join(e3).elements(),
              ::testing::UnorderedElementsAre("a", "b", "c", "d"));
  EXPECT_TRUE(e1.join(e2).equals(e2));
  EXPECT_TRUE(e1.widening(e2).equals(e2));

  EXPECT_THAT(e2.meet(e3).elements(),
              ::testing::UnorderedElementsAre("b", "c"));
  EXPECT_TRUE(e1.meet(e2).equals(e1));
  EXPECT_FALSE(e1.meet(e3).is_bottom());
  EXPECT_TRUE(e1.meet(e3).elements().empty());
  EXPECT_TRUE(e1.narrowing(e2).equals(e1));

  EXPECT_TRUE(e2.contains("a"));
  EXPECT_FALSE(e3.contains("a"));

  // Making sure no side effect happened.
  EXPECT_THAT(e1.elements(), ::testing::UnorderedElementsAre("a"));
  EXPECT_THAT(e2.elements(), ::testing::UnorderedElementsAre("a", "b", "c"));
  EXPECT_THAT(e3.elements(), ::testing::UnorderedElementsAre("b", "c", "d"));
}
开发者ID:plast-lab,项目名称:redex,代码行数:38,代码来源:HashedSetAbstractDomainTest.cpp


示例16: var_dec

static void var_dec(void)
{
  char* name;
  integer val;
  {
    scan_test(NULL, RDP_T_int, &var_dec_stop);
    scan_();
    { /* Start of rdp_var_dec_3 */
      while (1)
      {
        scan_test(NULL, SCAN_P_ID, &var_dec_stop);
        {
          scan_test(NULL, SCAN_P_ID, &var_dec_stop);
          name = SCAN_CAST->id;
          scan_();
          if (scan_test(NULL, RDP_T_61 /* = */, NULL))
          { /* Start of rdp_var_dec_1 */
            while (1)
            {
              {
                scan_test(NULL, RDP_T_61 /* = */, &var_dec_stop);
                scan_();
                val = e1();
                }
              break;   /* hi limit is 1! */
            }
          } /* end of rdp_var_dec_1 */
           mini_cast(symbol_insert_key(mini, &name, sizeof(char*), sizeof(mini_data)))\
                   ->i = val; \
                
          }
        if (SCAN_CAST->token != RDP_T_44 /* , */) break;
        scan_();
      }
    } /* end of rdp_var_dec_3 */
    scan_test_set(NULL, &var_dec_stop, &var_dec_stop);
   }
}
开发者ID:dsholla,项目名称:rdp1_6,代码行数:38,代码来源:minicalc.c


示例17: Optimize

void dgPolygonSoupDatabaseBuilder::End(bool optimize)
{
  Optimize(optimize);

  // build the normal array and adjacency array
  // calculate all face the normals
  dgInt32 indexCount = 0;
  m_normalPoints[m_faceCount].m_x = dgFloat64(0.0f);
  for (dgInt32 i = 0; i < m_faceCount; i++)
  {
    dgInt32 faceIndexCount = m_faceVertexCount[i];

    dgInt32* const ptr = &m_vertexIndex[indexCount + 1];
    dgBigVector v0(&m_vertexPoints[ptr[0]].m_x);
    dgBigVector v1(&m_vertexPoints[ptr[1]].m_x);
    dgBigVector e0(v1 - v0);
    dgBigVector normal(dgFloat32(0.0f), dgFloat32(0.0f), dgFloat32(0.0f),
        dgFloat32(0.0f));
    for (dgInt32 j = 2; j < faceIndexCount - 1; j++)
    {
      dgBigVector v2(&m_vertexPoints[ptr[j]].m_x);
      dgBigVector e1(v2 - v0);
      normal += e0 * e1;
      e0 = e1;
    }
    normal = normal.Scale(dgRsqrt (normal % normal));

    m_normalPoints[i].m_x = normal.m_x;
    m_normalPoints[i].m_y = normal.m_y;
    m_normalPoints[i].m_z = normal.m_z;
    indexCount += faceIndexCount;
  }
  // compress normals array
  m_normalIndex[m_faceCount] = 0;
  m_normalCount = dgVertexListToIndexList(&m_normalPoints[0].m_x,
      sizeof(dgBigVector), 3, m_faceCount, &m_normalIndex[0],
      dgFloat32(1.0e-4f));
}
开发者ID:Evil-Spirit,项目名称:Nutmeg,代码行数:38,代码来源:dgPolygonSoupBuilder.cpp


示例18: siman_solve_2d

void siman_solve_2d ( double x, double y, 
		      double e1(double, double), 
		      double m1(double, double, double, double),
		      int n_tries, 
		      int iters_fixed_t, 
		      double step_size, 
		      double k, 
		      double t_initial, 
		      double mu_t, 
		      double t_min, 
		      double* rx, 
		      double* ry) 
{
  gsl_siman_params_t params = { n_tries, iters_fixed_t, step_size, k, t_initial, mu_t, t_min };

  double E1(void *xp)
  {
    double *xarr = (double *) xp;
    double x = xarr[0] ; 
    double y = xarr[1]; 

    return e1(x,y) ; 
  }
开发者ID:wavewave,项目名称:simann,代码行数:23,代码来源:simann.c


示例19: test_feature

bool test_feature()
{
    int edata[_rank];
    for (int i = 0; i < _rank; i++)
        edata[i] = i+1;
    extent<_rank> e1(edata);

    std::vector<_type> data(e1.size());
    for (size_t i = 0; i < e1.size(); i++)
        data[i] = (_type)rand();

    {
        bool pass = test_feature_itr<_type, _rank>(e1, data.begin(), data.end()) &&
            test_feature_itr<_type, _rank>(e1, data.rbegin(), data.rend()) &&
            test_feature_itr<_type, _rank>(e1, data.cbegin(), data.cend()) &&
            test_feature_itr<_type, _rank>(e1, data.crbegin(), data.crend());

        if (!pass)
            return false;
    }

    return true;
}
开发者ID:UncleHandsome,项目名称:hcc,代码行数:23,代码来源:test.cpp


示例20: SparseMsg

Msg* SparseMsg::copy( Id origSrc, Id newSrc, Id newTgt,
			FuncId fid, unsigned int b, unsigned int n ) const
{
	const Element* orig = origSrc.element();
	if ( n <= 1 ) {
		SparseMsg* ret = 0;
		if ( orig == e1() ) {
			ret = new SparseMsg( newSrc.element(), newTgt.element(), 0 );
			ret->e1()->addMsgAndFunc( ret->mid(), fid, b );
		} else if ( orig == e2() ) {
			ret = new SparseMsg( newTgt.element(), newSrc.element(), 0 );
			ret->e2()->addMsgAndFunc( ret->mid(), fid, b );
		} else {
			assert( 0 );
		}
		ret->setMatrix( matrix_ );
		ret->nrows_ = nrows_;
		return ret;
	} else {
		// Here we need a SliceMsg which goes from one 2-d array to another.
		cout << "Error: SparseMsg::copy: SparseSliceMsg not yet implemented\n";
		return 0;
	}
}
开发者ID:subhacom,项目名称:moose-core,代码行数:24,代码来源:SparseMsg.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ eCmd函数代码示例发布时间:2022-05-30
下一篇:
C++ dynshape函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap