Example #1
0
//==================================================================
bool DegreeMetric::check(std::string &errorMsg) {
  // check weights validity if it exists
  DoubleProperty *weights = nullptr;

  if (dataSet != nullptr) {
    dataSet->get("metric", weights);

    if (weights && !weights->getEdgeDefaultValue() && !weights->hasNonDefaultValuatedEdges()) {
      errorMsg = "Cannot compute a weighted degree with a null weight value\nfor all edges";
      return false;
    }
  }

  return true;
}