本文整理汇总了C++中Array2D::getCols方法的典型用法代码示例。如果您正苦于以下问题:C++ Array2D::getCols方法的具体用法?C++ Array2D::getCols怎么用?C++ Array2D::getCols使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Array2D
的用法示例。
在下文中一共展示了Array2D::getCols方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateTentative
void updateTentative(int i, int j,
std::map<Coordinate, Node<DataType> *> & tentative,
std::map<Coordinate, DataType> & accepted,
Heap<DataType> & heap,
Array2D<DataType, IndexType> & A,
const DataType & bandwidth,
bool inside)
{
// Check bounds
if (i < 0 || i > A.getRows()-1 || j < 0 || j > A.getCols()-1)
return;
Coordinate coord(i,j,inside);
// Exit if already accepted
if (accepted.find(coord) != accepted.end()) return;
// Find the tentative value and see if it's been deleted
// (it was outside the narrow band)
typename std::map<Coordinate, Node<DataType> *>::iterator iter = tentative.find(coord);
if (iter != tentative.end() && (*iter).second == NULL) return;
// Otherwise, compute tentative value
DataType value = computeTentativeValue(i,j, accepted);
// The point is new and within the narrowband
if (iter == tentative.end() && value <= bandwidth) {
//mexPrintf("Adding (%i,%i) as new tentative point", i,j);
Node<DataType> * node = new Node<DataType>(coord);
node->cost = value;
heap.push(node);
tentative[coord] = node;
}
// The point is not new and within the narrowband
else if (value <= bandwidth) {
//mexPrintf("Updating tentative point (%i,%i)", i,j);
Node<DataType> * node = (*iter).second;
node->cost = value;
heap.update(node);
}
// The point is outside the narrowband and should be deleted
// if possible
else if (iter != tentative.end()) {
Node<DataType> * node = (*iter).second;
heap.remove(node);
delete node;
(*iter).second = NULL;
}
//mexPrintf(" with value %f\n", value);
}