Class BaseRuleFactory<T extends java.lang.Number>

    • Constructor Summary

      Constructors 
      Constructor Description
      BaseRuleFactory()  
    • Method Summary

      Modifier and Type Method Description
      protected void addRule​(Pair<T[],​T[]> rule)
      Stores a rule.
      protected abstract Pair<T[],​T[]> computeRule​(int numberOfPoints)
      Computes the rule for the given order.
      Pair<double[],​double[]> getRule​(int numberOfPoints)
      Gets a copy of the quadrature rule with the given number of integration points.
      protected Pair<T[],​T[]> getRuleInternal​(int numberOfPoints)
      Gets a rule.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BaseRuleFactory

        public BaseRuleFactory()
    • Method Detail

      • getRuleInternal

        protected Pair<T[],​T[]> getRuleInternal​(int numberOfPoints)
                                               throws DimensionMismatchException
        Gets a rule. Synchronization ensures that rules will be computed and added to the cache at most once. The returned rule is a reference into the cache.
        Parameters:
        numberOfPoints - Order of the rule to be retrieved.
        Returns:
        the points and weights corresponding to the given order.
        Throws:
        DimensionMismatchException - if the elements of the rule pair do not have the same length.
      • computeRule

        protected abstract Pair<T[],​T[]> computeRule​(int numberOfPoints)
                                                    throws DimensionMismatchException
        Computes the rule for the given order.
        Parameters:
        numberOfPoints - Order of the rule to be computed.
        Returns:
        the computed rule.
        Throws:
        DimensionMismatchException - if the elements of the pair do not have the same length.