本文整理汇总了C++中elem函数的典型用法代码示例。如果您正苦于以下问题:C++ elem函数的具体用法?C++ elem怎么用?C++ elem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: elem
/**
* Description not yet available.
* \param
*/
void dmatrix::colfill_randu_ni(const int &j,long int &n)
{
long int nn;
nn=n;
for (int i=rowmin(); i<=rowmax(); i++)
{
elem(i,j)=auto_rand(nn,1);
}
}
开发者ID:colemonnahan,项目名称:admb,代码行数:13,代码来源:ranf_ni.cpp
示例2: get_sizeoftype
int get_sizeoftype(AST ty) {
switch (nodetype(ty)) {
case tFUNC: return 0;
case tARRAY:
return get_ival(ty) * get_sizeoftype(elem(ty));
default:
return 1;
}
}
开发者ID:tungvx,项目名称:FSE,代码行数:9,代码来源:type.c
示例3: ad_exit
/**
* Description not yet available.
* \param
*/
const dmatrix& d5_array::operator()(int i, int j, int k) const
{
if (i<indexmin()||i>indexmax())
{ cerr << "Error index out of bounds in\n"
"d3_array& d5_array::operator ( )" << endl;
ad_exit(1);
}
return elem(i)(j,k);
}
开发者ID:jimianelli,项目名称:admb,代码行数:13,代码来源:d5arr.cpp
示例4: transpose
FgMatrixC<T,ncols,nrows>
transpose() const
{
FgMatrixC<T,ncols,nrows> tMat;
for (uint ii=0; ii<nrows; ii++)
for (uint jj=0; jj<ncols; jj++)
tMat.elem(jj,ii) = elem(ii,jj);
return tMat;
}
开发者ID:SingularInversions,项目名称:FaceGenBaseLibrary,代码行数:9,代码来源:FgMatrixCBase.hpp
示例5: ad_exit
/**
* Description not yet available.
* \param
*/
const dvar_matrix& dvar6_array::operator()(int i, int j, int k, int l) const
{
if (i<indexmin()||i>indexmax())
{ cerr << "Error hslice index out of bounds in\n"
"dvar-vector& dvar4_array::operator ( )" << endl;
ad_exit(1);
}
return elem(i)(j,k,l);
}
开发者ID:jimianelli,项目名称:admb,代码行数:13,代码来源:f6arr.cpp
示例6: fill_matrix_data
/**
* Helper function to fill a matrix with arbitrary data.
*/
void fill_matrix_data(matrix_t *M, precision_t data[][M->cols])
{
int i, j;
for ( i = 0; i < M->rows; i++ ) {
for ( j = 0; j < M->cols; j++ ) {
elem(M, i, j) = data[i][j];
}
}
}
开发者ID:steensply,项目名称:face-recognition,代码行数:12,代码来源:test_matrix.c
示例7: search
void search(Trav *t) {
ElemList *idx;
int i;
ElemId id;
unmatch(&elem(t->match));
t->match = 0;
for (i=t->cur; i<=t->last; i++) {
idx = index(gsp, searchSpaces[i]);
id = traverse(idx, t, t->p);
if (success) {
match( &elem(id) );
t->match = id;
t->cur = i;
return;
}
}
}
开发者ID:ivaylohristakiev,项目名称:GP2,代码行数:18,代码来源:oilrrt.c
示例8: ad_exit
/**
* Description not yet available.
* \param
*/
const dvar3_array& dvar5_array::operator()(int i, int j) const
{
if (i<indexmin()||i>indexmax())
{ cerr << "Error index out of bounds in\n"
"dvar3_array& dvar5_array::operator ( )" << endl;
ad_exit(1);
}
return elem(i)(j);
}
开发者ID:johnrsibert,项目名称:admb,代码行数:13,代码来源:f5arr.cpp
示例9: print
static void print(Rcpp::NumericMatrix A)
{
for (int i = 0; i < A.nrow(); i++) {
for (int j = 0; j < A.ncol(); j++) {
printf("%9f ", elem(A, i, j));
}
putchar('\n');
}
}
开发者ID:kland,项目名称:multitask,代码行数:9,代码来源:multitask.cpp
示例10: domain
namespace boost { namespace hana {
struct Function {
struct hana {
struct operators
: boost::hana::operators::of<Comparable>
{ };
};
};
template <typename Domain, typename Codomain, typename F, typename = operators::adl>
struct function_type {
struct hana { using datatype = Function; };
Domain dom;
Codomain cod;
F def;
friend constexpr auto domain(function_type f)
{ return f.dom; }
friend constexpr auto codomain(function_type f)
{ return f.cod; }
template <typename X>
constexpr auto operator()(X x) const {
if (!elem(domain(*this), x))
throw std::domain_error{"use of a hana::function with an argument out of the domain"};
return def(x);
}
};
BOOST_HANA_CONSTEXPR_LAMBDA auto function = [](auto domain, auto codomain) {
return [=](auto definition) {
return function_type<decltype(domain), decltype(codomain), decltype(definition)>{
domain, codomain, definition
};
};
};
BOOST_HANA_CONSTEXPR_LAMBDA auto frange = [](auto f) {
// Note: that would be better handled by a set data structure, but
// whatever for now.
return foldl(transform(domain(f), f), make<Tuple>(), [](auto xs, auto x) {
return if_(elem(xs, x), xs, prepend(x, xs));
});
};
template <>
struct equal_impl<Function, Function> {
template <typename F, typename G>
static constexpr auto apply(F f, G g) {
return domain(f) == domain(g) && all_of(domain(f), demux(equal)(f, g));
}
};
}} // end namespace boost::hana
开发者ID:josephwinston,项目名称:hana,代码行数:56,代码来源:function.cpp
示例11: fijaElemento
int fijaElemento(matriz * mtz, int fila, int columna, long double _Complex valor)
{
if (!mtz) return -1;
assert(mtz->datos);
if (fila<=0 || fila > mtz->filas || columna<=0 || columna > mtz->columnas)
return -2;
elem(mtz,fila,columna)=valor;
return 0;
}
开发者ID:JAMoreno-Larios,项目名称:calculadoraTitanioZafiro,代码行数:10,代码来源:matrices.c
示例12: elem
void updatefunct_t::execute( const size_t& myidx, global_store& globals )
{
for(size_t c=0; c<lines.size(); ++c)
{
vector<elemptr> trace;
elemptr elem( model, myidx );
trace.push_back( elem );
DOCMD( lines[c], trace, *cmds, globals );
}
}
开发者ID:flyingfalling,项目名称:nsimer4,代码行数:10,代码来源:symmodel.cpp
示例13: showDebug
/*
Properties and methods
*/
HRESULT STDMETHODCALLTYPE QWindowsAccessible::accDoDefaultAction(VARIANT varID)
{
showDebug(__FUNCTION__, accessible);
if (!accessible->isValid())
return E_FAIL;
AccessibleElement elem(varID.lVal, accessible);
const bool res = elem.iface ? elem.iface->doAction(DefaultAction, elem.entry, QVariantList()) : false;
return res ? S_OK : S_FALSE;
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:13,代码来源:qaccessible_win.cpp
示例14: ADMB_ARRAY_BOUNDS_ERROR
/**
* Description not yet available.
* \param
*/
d4_array& d5_array::operator ( ) (int i)
{
if (i < indexmin() || i > indexmax())
{
ADMB_ARRAY_BOUNDS_ERROR("index out of bounds",
"d4_array& d5_array::operator()(int i)", indexmin(), indexmax(), i);
}
//return t[i];
return elem(i);
}
开发者ID:jimianelli,项目名称:admb,代码行数:14,代码来源:d5arr.cpp
示例15: ADMB_ARRAY_BOUNDS_ERROR
/**
* Description not yet available.
* \param
*/
dvar3_array& dvar6_array::operator ( ) (int i,int j,int k)
{
if (i < indexmin() || i > indexmax())
{
ADMB_ARRAY_BOUNDS_ERROR("hslice index out of bounds",
"dvar5_array& dvar6_array::operator()(int i, int j, int k)",
indexmin(), indexmax(), i);
}
return elem(i)(j,k);
}
开发者ID:jimianelli,项目名称:admb,代码行数:14,代码来源:f6arr.cpp
示例16: elem
void SkSVGDevice::drawPath(const SkDraw& draw, const SkPath& path, const SkPaint& paint,
const SkMatrix* prePathMatrix, bool pathIsMutable) {
AutoElement elem("path", fWriter, fResourceBucket, draw, paint);
elem.addPathAttributes(path);
// TODO: inverse fill types?
if (path.getFillType() == SkPath::kEvenOdd_FillType) {
elem.addAttribute("fill-rule", "evenodd");
}
}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:10,代码来源:SkSVGDevice.cpp
示例17: send
void paradiseo::smp::Island<EOAlgo,EOT,bEOT>::check()
{
// Sending
for(PolicyElement<EOT>& elem : migPolicy)
if(!elem(pop))
send(elem.getSelect());
// Receiving
receive();
}
开发者ID:jmp75,项目名称:paradiseo,代码行数:10,代码来源:island.cpp
示例18: pop
T pop()
{
if (c.empty())
{
throw ReadEmptyQueue();
}
T elem(c.front());
c.pop_front();
return elem;
}
开发者ID:faterer,项目名称:groof_off,代码行数:10,代码来源:Queue.hpp
示例19: elem
void SkSVGDevice::drawText(const SkDraw& draw, const void* text, size_t len,
SkScalar x, SkScalar y, const SkPaint& paint) {
AutoElement elem("text", fWriter, fResourceBucket, draw, paint);
elem.addTextAttributes(paint);
SVGTextBuilder builder(text, len, paint, SkPoint::Make(x, y), 0);
elem.addAttribute("x", builder.posX());
elem.addAttribute("y", builder.posY());
elem.addText(builder.text());
}
开发者ID:Jichao,项目名称:skia,代码行数:10,代码来源:SkSVGDevice.cpp
示例20: elem
/**
* Description not yet available.
* \param
*/
void dvar3_array::initialize()
{
if (!(!(*this))) // only initialize allocated objects
{
for (int i=slicemin();i<=slicemax();i++)
{
elem(i).initialize();
}
}
}
开发者ID:johnrsibert,项目名称:admb,代码行数:14,代码来源:f3arr.cpp
注:本文中的elem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论