本文整理汇总了C++中in::VecDeriv::size方法的典型用法代码示例。如果您正苦于以下问题:C++ VecDeriv::size方法的具体用法?C++ VecDeriv::size怎么用?C++ VecDeriv::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类in::VecDeriv
的用法示例。
在下文中一共展示了VecDeriv::size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildTranslate
void BarycentricMapperSparseGridTopology<CudaVec3fTypes,CudaVec3fTypes>::applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
buildTranslate(out.size());
SparseGridMapperCuda3f_applyJT(out.size(), CudaTnb.deviceRead(),CudaTst.deviceRead(),CudaTid.deviceRead(),CudaTVal.deviceRead(), out.deviceWrite(), in.deviceRead());
/*
for ( unsigned int i=0;i<map.size();i++ ) {
Out::Deriv v = in[i];
const topology::SparseGridTopology::Hexa cube = this->topology->getHexahedron ( map[i].in_index );
const OutReal fx = ( OutReal ) map[i].baryCoords[0];
const OutReal fy = ( OutReal ) map[i].baryCoords[1];
const OutReal fz = ( OutReal ) map[i].baryCoords[2];
out[cube[0]] += v * ( ( 1-fx ) * ( 1-fy ) * ( 1-fz ) );
out[cube[1]] += v * ( ( fx ) * ( 1-fy ) * ( 1-fz ) );
out[cube[3]] += v * ( ( 1-fx ) * ( fy ) * ( 1-fz ) );
out[cube[2]] += v * ( ( fx ) * ( fy ) * ( 1-fz ) );
out[cube[4]] += v * ( ( 1-fx ) * ( 1-fy ) * ( fz ) );
out[cube[5]] += v * ( ( fx ) * ( 1-fy ) * ( fz ) );
out[cube[7]] += v * ( ( 1-fx ) * ( fy ) * ( fz ) );
out[cube[6]] += v * ( ( fx ) * ( fy ) * ( fz ) );
}
*/
// for ( unsigned int o=0;o<out.size();o++ ) {
// for (unsigned n=CudaTst[o];n<CudaTst[o]+CudaTnb[o];n++) {
// out[o] += in[CudaTid[n]] * CudaTVal[n];
// }
// }
}
示例2: calcMapT
void BarycentricMapperRegularGridTopology<CudaVec3f1Types,CudaVec3f1Types>::applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
calcMapT();
if (map.size() == 0) return;
unsigned int gridsize[3] = { (unsigned int)topology->getNx(), (unsigned int)topology->getNy(), (unsigned int)topology->getNz() };
unsigned int insize = out.size();
RegularGridMapperCuda3f1_applyJT(insize, maxNOut, gridsize, mapT.deviceRead(), out.deviceWrite(), in.deviceRead());
}
示例3: buildTranslate
void BarycentricMapperSparseGridTopology<CudaVec3f1Types,CudaVec3f1Types>::applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
buildTranslate(out.size());
SparseGridMapperCuda3f1_applyJT(out.size(), CudaTnb.deviceRead(),CudaTst.deviceRead(),CudaTid.deviceRead(),CudaTVal.deviceRead(), out.deviceWrite(), in.deviceRead());
}
示例4: applyJT
void applyJT( In::VecDeriv& out, const Out::VecDeriv& in )
{
for(unsigned int i=0; i<out.size(); i++)
out[i] += dx[i]*in[i];
}
示例5: applyJ
void applyJ( Out::VecDeriv& out, const In::VecDeriv& in )
{
out.resize(in.size());
for(unsigned int i=0; i<out.size(); i++)
out[i] = dx[i]*in[i];
}