本文整理汇总了C++中Compute::lock_length方法的典型用法代码示例。如果您正苦于以下问题:C++ Compute::lock_length方法的具体用法?C++ Compute::lock_length怎么用?C++ Compute::lock_length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Compute
的用法示例。
在下文中一共展示了Compute::lock_length方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: column_length
int FixAveTime::column_length(int dynamic)
{
int m,length,lengthone;
// determine nrows for static values
if (!dynamic) {
length = 0;
for (int i = 0; i < nvalues; i++) {
if (varlen[i]) continue;
if (which[i] == COMPUTE) {
int icompute = modify->find_compute(ids[i]);
if (argindex[i] == 0)
lengthone = modify->compute[icompute]->size_vector;
else lengthone = modify->compute[icompute]->size_array_rows;
} else if (which[i] == FIX) {
int ifix = modify->find_fix(ids[i]);
if (argindex[i] == 0) lengthone = modify->fix[ifix]->size_vector;
else lengthone = modify->fix[ifix]->size_array_rows;
} else if (which[i] == VARIABLE) {
// variables are always varlen = 1, so dynamic
}
if (length == 0) length = lengthone;
else if (lengthone != length)
error->all(FLERR,"Fix ave/time columns are inconsistent lengths");
}
}
// determine new nrows for dynamic values
// either all must be the same
// or must match other static values
// don't need to check if not MODE = VECTOR, just invoke lock_length()
if (dynamic) {
length = 0;
for (int i = 0; i < nvalues; i++) {
if (varlen[i] == 0) continue;
m = value2index[i];
if (which[i] == COMPUTE) {
Compute *compute = modify->compute[m];
lengthone = compute->lock_length();
} else if (which[i] == VARIABLE) {
double *varvec;
lengthone = input->variable->compute_vector(m,&varvec);
}
if (mode == SCALAR) continue;
if (all_variable_length) {
if (length == 0) length = lengthone;
else if (lengthone != length)
error->all(FLERR,"Fix ave/time columns are inconsistent lengths");
} else {
if (lengthone != nrows)
error->all(FLERR,"Fix ave/time columns are inconsistent lengths");
}
}
}
return length;
}