Exemplo n.º 1
0
 ConstMonoRef moduleAdjustment(ConstMonoRef mono) const {
   MATHICGB_ASSERT(hasSchreyerMultipliers());
   const auto component = monoid().component(mono);
   MATHICGB_ASSERT(component < componentCount());
   MATHICGB_ASSERT(mSchreyerMultipliers.size() == componentCount());
   return *mSchreyerMultipliers[component];
 }
AssembledPotentialOperator<BasisFunctionType, ResultType>
ElementaryPotentialOperator<BasisFunctionType, KernelType, ResultType>::
    assemble(
        const shared_ptr<const Space<BasisFunctionType>> &space,
        const shared_ptr<const arma::Mat<CoordinateType>> &evaluationPoints,
        const QuadratureStrategy &quadStrategy,
        const EvaluationOptions &options) const {
  if (!space)
    throw std::invalid_argument("ElementaryPotentialOperator::assemble(): "
                                "the shared pointer 'space' must not be null");
  if (!evaluationPoints)
    throw std::invalid_argument(
        "ElementaryPotentialOperator::assemble(): "
        "the shared pointer 'evaluationPoints' must not be null");
  if (evaluationPoints->n_rows != space->grid()->dimWorld())
    throw std::invalid_argument(
        "ElementaryPotentialOperator::assemble(): "
        "the number of coordinates of each evaluation point must be "
        "equal to the dimension of the space containing the surface "
        "on which the function space 'space' is defined");

  std::unique_ptr<LocalAssembler> assembler =
      makeAssembler(*space, *evaluationPoints, quadStrategy, options);
  shared_ptr<DiscreteBoundaryOperator<ResultType>> discreteOperator =
      assembleOperator(*space, *evaluationPoints /*TODO*/, *assembler, options);
  return AssembledPotentialOperator<BasisFunctionType, ResultType>(
      space, evaluationPoints, discreteOperator, componentCount());
}
Exemplo n.º 3
0
void CSSSelectorList::adopt(CSSSelectorList& list)
{
    deleteSelectors();
    m_selectorArray = list.m_selectorArray;
    list.m_selectorArray = 0;

    ASSERT_WITH_SECURITY_IMPLICATION(componentCount());
}
Exemplo n.º 4
0
  void setSchreyerMultipliers(MonoVector&& moduleAdjustments) {
    MATHICGB_ASSERT(moduleAdjustments.monoid() == monoid());
    MATHICGB_ASSERT(mSchreyerMultipliersMemory.empty() ||
      mSchreyerMultipliersMemory.size() == componentCount());
    mSchreyerMultipliersMemory = std::move(moduleAdjustments);

    mSchreyerMultipliers.clear();
    for (
      auto it = mSchreyerMultipliersMemory.begin();
      it != mSchreyerMultipliersMemory.end();
      ++it
    ) {
      // in the absence of a separate monoid for (non-module) monomials,
      // at least we can check that the component is zero.
      MATHICGB_ASSERT(this->monoid().component(*it) == 0);

      // todo: there should be a better way of indexing into a
      // MonoVector.
      mSchreyerMultipliers.emplace_back((*it).ptr());
    }
  }
Exemplo n.º 5
0
int getCoolness(char *name)
{
   int node;
   int degree;
   int nodeCount;

   // Get the starting node in the network
   node = getNodeByName(name);

   // If this person isn't in the network, their coolness is zero
   if (node < 0)
      return 0;

   // Get the "degree" of this node, which is the number of people
   // directly connected to it.  This is the first part of the coolness
   degree = getDegree(node);

   // Get the number of nodes directly or indirectly connected to this node
   nodeCount = componentCount(node);

   // Return the "coolness", which is the degree plus the node count, minus
   // one (we don't count ourselves in the coolness factor)
   return degree + nodeCount - 1;
}
Exemplo n.º 6
0
bool FilePath::isEmpty() const
{
    return mAbsolute == false && componentCount() == 0;
}
Exemplo n.º 7
0
int DataType::sizeInBytes() const
{
	return componentCount() * SizeOf(m_PrimitiveDataType);
}