Class MathHelper

java.lang.Object
net.simplace.core.service.MathHelper

public class MathHelper extends Object
Author:
XPMUser
  • Constructor Details

    • MathHelper

      public MathHelper()
  • Method Details

    • MAX

      public static Number MAX(LinkedList aLinkedList, int i)
      Calculates the maximum of a list of values
      Parameters:
      aLinkedList - list of values
      i -
      Returns:
      the maximum
    • MIN

      public static Number MIN(LinkedList aLinkedList, int i)
      Calculates the minimum of a list of values
      Parameters:
      aLinkedList - list of values
      i -
      Returns:
      the minimum
    • AVG

      public static Number AVG(LinkedList aLinkedList, FWSimVariable.DATA_TYPE aDataType, int i)
      Calculates the average of a list of values
      Parameters:
      aLinkedList - list of values
      aDataType -
      i -
      Returns:
      the average
    • SUM

      public static Number SUM(LinkedList aLinkedList, FWSimVariable.DATA_TYPE aDataType, int i)
      Calculates the sum of a list of values
      Parameters:
      aLinkedList - list of values
      aDataType -
      i -
      Returns:
      the sum
    • COUNT

      public static Integer COUNT(LinkedList aLinkedList)
      Parameters:
      aLinkedList -
      aDataType -
      aI -
      Returns:
    • ADD

      public static Double[] ADD(Double[] aFirstObjectToCalculateWith, Double[] aSecondObjectToCalculateWith)
      Calculates the sum of a list of values
      Parameters:
      aFirstObjectToCalculateWith -
      aSecondObjectToCalculateWith - two values to sum up
      Returns:
      the sum
    • ADD

      public static Integer[] ADD(Integer[] aFirstObjectToCalculateWith, Integer[] aSecondObjectToCalculateWith)
      Calculates the sum of a list of values
      Parameters:
      aFirstObjectToCalculateWith -
      aSecondObjectToCalculateWith - two values to sum up
      Returns:
      the sum
    • MULTIPLY

      public static Double[] MULTIPLY(Double[] aFirstObjectToCalculateWith, Object aSecondObjectToCalculateWith)
      Calculates the product of a list of values
      Parameters:
      aFirstObjectToCalculateWith -
      aSecondObjectToCalculateWith - two values to multiply
      Returns:
      the sum
    • MULTIPLY

      public static Integer[] MULTIPLY(Integer[] aFirstObjectToCalculateWith, Object aSecondObjectToCalculateWith)
      Calculates the product of a list of values
      Parameters:
      aFirstObjectToCalculateWith -
      aSecondObjectToCalculateWith - two values to multiply
      Returns:
      the sum
    • GaussIntegrationWeight

      public static double GaussIntegrationWeight(int n, int i)
      Returns the weights for Gauß-Legendre-Integration
      Parameters:
      n - degree of polynomial
      i - number of weight
      Returns:
      weight
    • GaussIntegrationX

      public static double GaussIntegrationX(int n, int i)
      Returns the locations (x-values) for Gauß-Legendre-Integration
      Parameters:
      n - degree of polynomial
      i - number of location
      Returns:
      x-value
    • calulateLinearRegression

      public static void calulateLinearRegression(int ind, double[] x, double[] y, FWSimVariable<Double> aRegressionM, FWSimVariable<Double> aRegressionB)
      Calculates linear regression
      Parameters:
      ind - length of vector
      x - vector with x-values
      y - vector with y-values
      aRegressionM - stores the calculated m (slope)
      aRegressionB - stores the calculated b