Examples of FastIndex


Examples of de.torstennahm.integrate.sparse.index.FastIndex

        }
       
        if (! abort) {
          int i = k - j;
          if (task.dim0 != task.dim1 || i == j) {
            Index index = new FastIndex();
            index = index.set(task.dim0, i);
            index = index.set(task.dim1, j);
           
            boolean done = false;
           
            synchronized (task.valueMap) {
              if (task.valueMap.containsKey(index)) {
View Full Code Here

Examples of de.torstennahm.integrate.sparse.index.FastIndex

    }
   
    for (int i = 0; i < gridSize; i++) {
      for (int j = 0; j < gridSize; j++) {
        if (dim0 != dim1 || i == j) {
          Index index = new FastIndex();
          index = index.set(dim0, i);
          index = index.set(dim1, j);
          List<StatusData> indexList;
          synchronized (lock) {
            indexList = statusMap.get(index);
         
            if (indexList != null) {
              DecimalFormat df = new DecimalFormat("0.###E0");
             
              int[] pos = new int[] { index.get(dim0), index.get(dim1) };
              int[] pixel = positionToPixel(pos);
             
              StringBuffer statusText = new StringBuffer();
              int statusCount = 0;
              for (StatusData statusData : indexList) {
View Full Code Here

Examples of de.torstennahm.integrate.sparse.index.FastIndex

   
    Index v;
    synchronized (this) {
      if (! (dim0 == dim1 && x != y)) {
        EvalData data;
        v = new FastIndex();
        v = v.set(dim0, x);
        v = v.set(dim1, y);
       
        synchronized (contributionPanel.valueMap) {
          data = contributionPanel.valueMap.get(v);
View Full Code Here

Examples of de.torstennahm.integrate.sparse.index.FastIndex

    boolean calc = false;
   
    for (int i = 0; i < GridVisualizer.GRIDSIZE; i++) {
      for (int j = 0; j < GridVisualizer.GRIDSIZE; j++) {
        if (dim0 != dim1 || i == j) {
          Index index = new FastIndex();
          index = index.set(dim0, i);
          index = index.set(dim1, j);
         
          int[] pixel = positionToPixel(new int[] {i, j});
         
          EvalData data;
          synchronized (valueMap) {
            data = valueMap.get(index);
          }
          if (data == null) {
            calc = true;
          } else {
            double contribution = data.contribution;
            if (! Double.isNaN(contribution)) {
              double b = 0.0;
              double integrate = Math.abs(contribution);
              int evals = evaluator.pointsForIndex(index);
             
              if (mode == 0) {
                b = 0.7 - 0.7 * MathTN.log10(integrate) / MathTN.log10(MathTN.FUDGE);
              } else if (mode == 1) {
                b = 0.4 + 0.1 * MathTN.log10(evals);
              } else if (mode == 2) {
                b = 0.7 - 0.7 * MathTN.log10(integrate / evals) / MathTN.log10(MathTN.FUDGE);
              }
             
              g.setColor(colorScale.getColor((b + colorOffset) * colorFactor));
              g.fillRect(pixel[0], pixel[1], boxSize, boxSize);
//              if (contribution > 0) {
//                g.setColor(Color.BLACK);
//                g.fillRect(pixel[0] + (boxSize * 3) / 8, pixel[1] + (boxSize * 3) / 8, boxSize / 4, boxSize / 4);
//              }
            }
          }
        }
      }
    }
   
    g.setColor(Color.RED);
   
    for (int i = 0; i < GridVisualizer.GRIDSIZE; i++) {
      for (int j = 0; j < GridVisualizer.GRIDSIZE; j++) {
        if (dim0 != dim1 || i == j) {
          Index index = new FastIndex();           
          index = index.set(dim0, i);
          index = index.set(dim1, j);
         
          int[] pixel = positionToPixel(new int[] {i, j});
         
          boolean borderX = false, borderY = false;
          boolean evaluated;
          synchronized (indicesEvaluated) {
             evaluated = isEvaluatedInTimeLimit(index, timeLimit);
             if (! evaluated) {
              if (isEvaluatedInTimeLimit(index.add(dim0, -1), timeLimit)) {
                borderX = true;
              }
             
              if (isEvaluatedInTimeLimit(index.add(dim1, -1), timeLimit)) {
                borderY = true;
              }
             }
          }
         
View Full Code Here

Examples of de.torstennahm.integrate.sparse.index.FastIndex

      primaryCompleted = false;
    }
   
    IntegrationResult integrate() throws IntegrationFailedException {
      result = new SparseResult();
      Index zeroIndex = new FastIndex();
     
      Visualizers.submitToList(visualizers, new Integrand(evaluator));
      Visualizers.submitToList(visualizers, new StartIntegration());
     
      if (dimension == 0) {
        currentDimension = 1;
      } else {
        currentDimension = dimension;
      }
     
      if (! condition.stop(result)) {
        activateIndex(zeroIndex, Double.POSITIVE_INFINITY);
      }
     
      while (! condition.stop(result)) {
        Index index = hybridManager.nextIndex();
        if (index == null) {
          throw new IntegrationFailedException("Could not expand index set");
        }
        EvalData evalData = indexMap.get(index);
       
        evalData.completed = true;
       
        double estimate = index.equals(zeroIndex) ? Double.POSITIVE_INFINITY : Math.abs(evalData.contribution);
        boolean couldExpandFully = true;
        for (int i = 0; i < currentDimension; i++) {
          Index succIndex = index.add(i, 1);
          if (isValid(indexMap, succIndex)) {
            if (evaluator.canEvaluate(succIndex)) {
              activateIndex(succIndex, estimate);
            } else {
              couldExpandFully = false;
              IntegrationInfo info = new CouldNotEvaluateInfo(evaluator, succIndex);
              result.supplementalInfo.add(info);
            }
          }
        }
       
        if (dimension == 0 && index.lastEntry() == currentDimension - 1) {
          currentDimension++;
          activateIndex(zeroIndex.set(currentDimension - 1, 1), Double.POSITIVE_INFINITY);
        }
       
        if (couldExpandFully) {
          errorEstimate -= Math.abs(evalData.contribution);
        }
View Full Code Here

Examples of de.torstennahm.integrate.sparse.index.FastIndex

    Map<Index, IndexData> indexMap = new HashMap<Index, IndexData>();
   
    Visualizers.submitToList(visualizers, new Integrand(evaluator));
    Visualizers.submitToList(visualizers, new StartIntegration());
   
    Index zeroIndex = new FastIndex();
   
    if (! condition.stop(result)) {
      IndexData indexData = evaluateIndex(zeroIndex, evaluator, result, visualizers);
      indexMap.put(zeroIndex, indexData);
      indexData.priority = 0.0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.