Package it.unimi.dsi.fastutil.ints

Examples of it.unimi.dsi.fastutil.ints.IntArrayList


    loopname = 0;
    for (final String name : curveNamesSet) { // loop over all curves (by name)
      final YieldAndDiscountCurve curve = bundle.getCurve(name);
      final List<String> underlyingCurveNames = curve.getUnderlyingCurvesNames();
      nbNewParameters[loopname] = curve.getNumberOfParameters();
      final IntArrayList indexOtherList = new IntArrayList();
      for (final String u : underlyingCurveNames) {
        final Integer i = curveNum.get(u);
        if (i != null) {
          indexOtherList.add(i);
          nbNewParameters[loopname] -= nbNewParameters[i];
        }
      }
      indexOther[loopname] = indexOtherList.toIntArray();
      loopname++;
    }
    int nbSensiCurve = 0;
    for (final String name : bundle.getAllNames()) { // loop over all curves (by name)
      if (!fixedCurves.contains(name)) {
        nbSensiCurve++;
      }
    }
    final int[] nbNewParamSensiCurve = new int[nbSensiCurve];
    // Implementation note: nbNewParamSensiCurve
    final int[][] indexOtherSensiCurve = new int[nbSensiCurve][];
    // Implementation note: indexOtherSensiCurve -
    final int[] startCleanParameter = new int[nbSensiCurve];
    // Implementation note: startCleanParameter - for each curve for which the sensitivity should be computed, the index in the total sensitivity vector at which that curve start.
    final int[][] startDirtyParameter = new int[nbSensiCurve][];
    // Implementation note: startDirtyParameter - for each curve for which the sensitivity should be computed, the indexes of the underlying curves.
    int nbSensitivityCurve = 0;
    int nbCleanParameters = 0;
    int currentDirtyStart = 0;
    for (final String name : curveNamesSet) { // loop over all curves (by name)
      if (!fixedCurves.contains(name)) {
        final int num = curveNum.get(name);
        final YieldAndDiscountCurve curve = bundle.getCurve(name);
        final IntArrayList startDirtyParameterList = new IntArrayList();
        final List<String> underlyingCurveNames = curve.getUnderlyingCurvesNames();
        for (final String u : underlyingCurveNames) {
          final Integer i = curveNum.get(u);
          if (i != null) {
            startDirtyParameterList.add(currentDirtyStart);
            currentDirtyStart += nbNewParameters[i];
          }
        }
        startDirtyParameterList.add(currentDirtyStart);
        currentDirtyStart += nbNewParameters[nbSensitivityCurve];
        startDirtyParameter[nbSensitivityCurve] = startDirtyParameterList.toIntArray();
        nbNewParamSensiCurve[nbSensitivityCurve] = nbNewParameters[num];
        indexOtherSensiCurve[nbSensitivityCurve] = indexOther[num];
        startCleanParameter[nbSensitivityCurve] = nbCleanParameters;
        nbCleanParameters += nbNewParamSensiCurve[nbSensitivityCurve];
        nbSensitivityCurve++;
View Full Code Here


    loopname = 0;
    for (final String name : curveNamesSet) { // loop over all curves (by name)
      final YieldAndDiscountCurve curve = bundle.getCurve(name);
      final List<String> underlyingCurveNames = curve.getUnderlyingCurvesNames();
      nbNewParameters[loopname] = curve.getNumberOfParameters();
      final IntArrayList indexOtherList = new IntArrayList();
      for (final String u : underlyingCurveNames) {
        final Integer i = curveNum.get(u);
        if (i != null) {
          indexOtherList.add(i);
          nbNewParameters[loopname] -= nbNewParameters[i];
        }
      }
      indexOther[loopname] = indexOtherList.toIntArray();
      loopname++;
    }
    loopname = 0;
    for (final String name : bundle.getAllNames()) { // loop over all curves (by name)
      if (!fixedCurves.contains(name)) {
        loopname++;
      }
    }
    final int nbSensitivityCurve = loopname;
    final int[] nbNewParamSensiCurve = new int[nbSensitivityCurve];
    // Implementation note: nbNewParamSensiCurve
    final int[][] indexOtherSensiCurve = new int[nbSensitivityCurve][];
    // Implementation note: indexOtherSensiCurve -
    // int[] startCleanParameter = new int[nbSensitivityCurve];
    // Implementation note: startCleanParameter - for each curve for which the sensitivity should be computed, the index in the total sensitivity vector at which that curve start.
    final int[][] startDirtyParameter = new int[nbSensitivityCurve][];
    // Implementation note: startDirtyParameter - for each curve for which the sensitivity should be computed, the indexes of the underlying curves.
    //int nbCleanParameters = 0;
    int currentDirtyStart = 0;
    loopname = 0;
    for (final String name : curveNamesSet) { // loop over all curves (by name)
      if (!fixedCurves.contains(name)) {
        final int num = curveNum.get(name);
        final YieldAndDiscountCurve curve = bundle.getCurve(name);
        final IntArrayList startDirtyParameterList = new IntArrayList();
        final List<String> underlyingCurveNames = curve.getUnderlyingCurvesNames();
        for (final String u : underlyingCurveNames) {
          final Integer i = curveNum.get(u);
          if (i != null) {
            startDirtyParameterList.add(currentDirtyStart);
            currentDirtyStart += nbNewParameters[i];
          }
        }
        startDirtyParameterList.add(currentDirtyStart);
        currentDirtyStart += nbNewParameters[loopname];
        startDirtyParameter[loopname] = startDirtyParameterList.toIntArray();
        nbNewParamSensiCurve[loopname] = nbNewParameters[num];
        indexOtherSensiCurve[loopname] = indexOther[num];
        // startCleanParameter[loopname] = nbCleanParameters;
        //nbCleanParameters += nbNewParamSensiCurve[loopname];
        loopname++;
View Full Code Here

      loopname++;
    }
    loopname = 0;
    for (final String name : curveNamesSet) { // loop over all curves (by name)
      final List<String> underlyingCurveNames = inflation.getUnderlyingCurvesNames(name);
      final IntArrayList indexOtherList = new IntArrayList();
      for (final String u : underlyingCurveNames) {
        final Integer i = curveNum.get(u);
        if (i != null) {
          indexOtherList.add(i);
          nbNewParameters[loopname] -= nbNewParameters[i]; // Only one level: a curve used as an underlying can not have an underlying itself.
        }
      }
      indexOther[loopname] = indexOtherList.toIntArray();
      loopname++;
    }
    final int nbSensiCurve = curvesSet.size();
    //    for (final String name : curveNamesSet) { // loop over all curves (by name)
    //      if (curvesSet.contains(name)) {
    //        nbSensiCurve++;
    //      }
    //    }
    final int[] nbNewParamSensiCurve = new int[nbSensiCurve];
    // Implementation note: nbNewParamSensiCurve
    final int[][] indexOtherSensiCurve = new int[nbSensiCurve][];
    // Implementation note: indexOtherSensiCurve -
    final int[] startCleanParameter = new int[nbSensiCurve];
    // Implementation note: startCleanParameter - for each curve for which the sensitivity should be computed, the index in the total sensitivity vector at which that curve start.
    final int[][] startDirtyParameter = new int[nbSensiCurve][];
    // Implementation note: startDirtyParameter - for each curve for which the sensitivity should be computed, the indexes of the underlying curves.
    int nbSensitivityCurve = 0;
    int nbCleanParameters = 0;
    int currentDirtyStart = 0;
    for (final String name : curvesSet) { // loop over all curves (by name)
      //      if (curvesSet.contains(name)) {
      final int num = curveNum.get(name);
      final IntArrayList startDirtyParameterList = new IntArrayList();
      final List<String> underlyingCurveNames = inflation.getUnderlyingCurvesNames(name);
      for (final String u : underlyingCurveNames) {
        final Integer i = curveNum.get(u);
        if (i != null) {
          startDirtyParameterList.add(currentDirtyStart);
          currentDirtyStart += nbNewParameters[i];
        }
      }
      startDirtyParameterList.add(currentDirtyStart);
      currentDirtyStart += nbNewParameters[num];
      startDirtyParameter[nbSensitivityCurve] = startDirtyParameterList.toIntArray();
      nbNewParamSensiCurve[nbSensitivityCurve] = nbNewParameters[num];
      indexOtherSensiCurve[nbSensitivityCurve] = indexOther[num];
      startCleanParameter[nbSensitivityCurve] = nbCleanParameters;
      nbCleanParameters += nbNewParamSensiCurve[nbSensitivityCurve];
      nbSensitivityCurve++;
View Full Code Here

      loopname++;
    }
    loopname = 0;
    for (final String name : curveNamesSet) { // loop over all curves (by name)
      final List<String> underlyingCurveNames = multicurves.getUnderlyingCurvesNames(name);
      final IntArrayList indexOtherList = new IntArrayList();
      for (final String u : underlyingCurveNames) {
        final Integer i = curveNum.get(u);
        if (i != null) {
          indexOtherList.add(i);
          nbNewParameters[loopname] -= nbNewParameters[i]; // Only one level: a curve used as an underlying can not have an underlying itself.
        }
      }
      indexOther[loopname] = indexOtherList.toIntArray();
      loopname++;
    }
    final int nbSensiCurve = curvesSet.size();
    //    for (final String name : curveNamesSet) { // loop over all curves (by name)
    //      if (curvesSet.contains(name)) {
    //        nbSensiCurve++;
    //      }
    //    }
    final int[] nbNewParamSensiCurve = new int[nbSensiCurve];
    // Implementation note: nbNewParamSensiCurve
    final int[][] indexOtherSensiCurve = new int[nbSensiCurve][];
    // Implementation note: indexOtherSensiCurve -
    final int[] startCleanParameter = new int[nbSensiCurve];
    // Implementation note: startCleanParameter - for each curve for which the sensitivity should be computed, the index in the total sensitivity vector at which that curve start.
    final int[][] startDirtyParameter = new int[nbSensiCurve][];
    // Implementation note: startDirtyParameter - for each curve for which the sensitivity should be computed, the indexes of the underlying curves.
    int nbSensitivityCurve = 0;
    int nbCleanParameters = 0;
    int currentDirtyStart = 0;
    for (final String name : curvesSet) { // loop over all curves (by name)
      //      if (curvesSet.contains(name)) {
      final int num = curveNum.get(name);
      final IntArrayList startDirtyParameterList = new IntArrayList();
      final List<String> underlyingCurveNames = multicurves.getUnderlyingCurvesNames(name);
      for (final String u : underlyingCurveNames) {
        final Integer i = curveNum.get(u);
        if (i != null) {
          startDirtyParameterList.add(currentDirtyStart);
          currentDirtyStart += nbNewParameters[i];
        }
      }
      startDirtyParameterList.add(currentDirtyStart);
      currentDirtyStart += nbNewParameters[num];
      startDirtyParameter[nbSensitivityCurve] = startDirtyParameterList.toIntArray();
      nbNewParamSensiCurve[nbSensitivityCurve] = nbNewParameters[num];
      indexOtherSensiCurve[nbSensitivityCurve] = indexOther[num];
      startCleanParameter[nbSensitivityCurve] = nbCleanParameters;
      nbCleanParameters += nbNewParamSensiCurve[nbSensitivityCurve];
      nbSensitivityCurve++;
View Full Code Here

    Object srcArea = app.find(myUi, "docids");
    String val = app.getString(srcArea, "text");
    if (val!=null && val.length() > 0){
      try{
        String[] docids = val.split(",");
        IntList idList = new IntArrayList(docids.length);
        for (String docid : docids){
          idList.add(Integer.parseInt(docid.trim()));
        }
        int[] idArray = idList.toIntArray();
        StringBuffer sbuf = new StringBuffer();
        ZoieIndexReader zoieReader = getZoieReader();
        boolean first = true;
        for (int docid : idArray){
          long uid;
View Full Code Here

    Object srcArea = app.find(myUi, "uids");
    String val = app.getString(srcArea, "text");
    if (val!=null && val.length() > 0){
      try{
        String[] uids = val.split(",");
        IntList idList = new IntArrayList(uids.length);
        for (String uid : uids){
          idList.add(Integer.parseInt(uid.trim()));
        }
        int[] idArray = idList.toIntArray();
        StringBuffer sbuf = new StringBuffer();
        ZoieIndexReader zoieReader = getZoieReader();
        DocIDMapper mapper = zoieReader.getDocIDMaper();
        boolean first = true;
        for (int uid : idArray){
View Full Code Here

    }

    DocIDMapperImpl mapper = new DocIDMapperImpl(even);
    UIDDocIdSet uidSet = new UIDDocIdSet(even, mapper);
    DocIdSetIterator docidIter = uidSet.iterator();
    IntArrayList intList = new IntArrayList();
    int docid;
    while ((docid = docidIter.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
      intList.add(docid);
    }
    assertTrue("wrong result from iter", Arrays.equals(ans, intList.toIntArray()));

    long[] newidArray = new long[count];
    for (int i = 0; i < count; ++i) {
      newidArray[i] = i;
    }

    mapper = new DocIDMapperImpl(newidArray);
    uidSet = new UIDDocIdSet(newidArray, mapper);
    docidIter = uidSet.iterator();
    intList = new IntArrayList();
    for (int i = 0; i < newidArray.length; ++i) {
      docid = docidIter.advance(i * 10);
      if (docid == DocIdSetIterator.NO_MORE_DOCS) break;
      intList.add(docid);
      docid = docidIter.nextDoc();
      if (docid == DocIdSetIterator.NO_MORE_DOCS) break;
      intList.add(docid);
    }

    int[] answer = new int[] { 0, 1, 10, 11, 20, 21, 30, 31, 40, 41, 50, 51, 60, 61, 70, 71, 80,
        81, 90, 91 };
    assertTrue("wrong result from mix of next and skip",
      Arrays.equals(answer, intList.toIntArray()));
  }
View Full Code Here

    public JoinHash(PagesIndex pagesIndex, List<Integer> hashChannels, OperatorContext operatorContext)
    {
        this.pagesIndex = pagesIndex;
        this.hashStrategy = new PagesHashStrategy(pagesIndex, hashChannels);
        this.addressToPositionMap = new AddressToPositionMap(pagesIndex.getPositionCount(), hashStrategy);
        this.positionLinks = new IntArrayList(new int[pagesIndex.getPositionCount()]);
        Arrays.fill(positionLinks.elements(), -1);

        // index pages
        for (int position = 0; position < pagesIndex.getPositionCount(); position++) {
            operatorContext.setMemoryReservation(getEstimatedSize());
View Full Code Here

            checkNotNull(type, "type is null");

            this.type = type;
            this.slice = Slices.allocate(blockSize);
            this.sliceOutput = slice.getOutput();
            this.positionOffsets = new IntArrayList(1024);
        }
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.ints.IntArrayList

Copyright © 2018 www.massapicom. 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.