Examples of DoubleList


Examples of com.gs.collections.api.list.primitive.DoubleList

        }
        if (!(otherList instanceof DoubleList))
        {
            return false;
        }
        DoubleList list = (DoubleList) otherList;
        if (this.items.length != list.size())
        {
            return false;
        }
        for (int i = 0; i < this.items.length; i++)
        {
            if (Double.compare(this.items[i], list.get(i)) != 0)
            {
                return false;
            }
        }
        return true;
View Full Code Here

Examples of com.gs.collections.api.list.primitive.DoubleList

        }
        if (!(otherList instanceof DoubleList))
        {
            return false;
        }
        DoubleList list = (DoubleList) otherList;
        if (this.size != list.size())
        {
            return false;
        }
        for (int i = 0; i < this.size; i++)
        {
            if (Double.compare(this.items[i], list.get(i)) != 0)
            {
                return false;
            }
        }
        return true;
View Full Code Here

Examples of com.gs.collections.api.list.primitive.DoubleList

        }
        if (!(otherList instanceof DoubleList))
        {
            return false;
        }
        DoubleList list = (DoubleList) otherList;
        return list.isEmpty();
    }
View Full Code Here

Examples of com.gs.collections.api.list.primitive.DoubleList

        }
        if (!(otherList instanceof DoubleList))
        {
            return false;
        }
        DoubleList list = (DoubleList) otherList;
        if (list.size() != 1)
        {
            return false;
        }
        return Double.compare(this.element1, list.get(0)) == 0;
    }
View Full Code Here

Examples of it.unimi.dsi.fastutil.doubles.DoubleList

        } else {
            chans = Collections.emptyMap();
            typedChans = Collections.emptyMap();
        }
        LongList builtIds;
        DoubleList builtScores;
        if (reuse) {
            ids.trim();
            builtIds = ids;
            scores.trim();
            builtScores = scores;
View Full Code Here

Examples of it.unimi.dsi.fastutil.doubles.DoubleList

            }
        }

        @Override
        public double getUnboxedChannelValue(Symbol sym) {
            DoubleList array = unboxedChannels.get(sym);
            if (array != null) {
                return array.get(index);
            } else {
                throw new NullPointerException("no symbol " + sym);
            }
        }
View Full Code Here

Examples of it.unimi.dsi.fastutil.doubles.DoubleList

    }

    @Test
    public void testAddMany() {
        Random rng = new Random();
        DoubleList vals = new DoubleArrayList(25);
        for (int i = 0; i < 25; i++) {
            double v = rng.nextGaussian() + Math.PI;
            builder.add(i, v);
            vals.add(v);
        }
        assertThat(builder.size(), equalTo(25));
        PackedScoredIdList list = builder.build();
        assertThat(list, hasSize(25));
        for (int i = 0; i < 25; i++) {
            ScoredId id = new ScoredIdBuilder(i, vals.getDouble(i)).build();
            assertThat(list.get(i), equalTo(id));
        }
    }
View Full Code Here

Examples of org.apache.commons.collections.primitives.DoubleList

      }
   }

   private int findClaster(Sample sample, int clastersCount)
   {
      DoubleList clasters = new ArrayDoubleList();

      int inputsCount = sample.getInput().size();
      for (int i = 0; i < clastersCount; ++i)
      {
         clasters.add(sample.getInput().get(sample.getInput().size() - clastersCount + i));
      }

      return JNMFMathUtils.indexOfMaxElement(clasters);
   }
View Full Code Here

Examples of org.apache.commons.collections.primitives.DoubleList

   public DoubleList transform(DoubleList vector, VariableType type)
   {
      Validate.isTrue(inClassValue != outClassValue, "inClassValue == outClassValue");
      Validate.isTrue(vector.size() > 0, "Vector calcCountOfItems is 0");

      DoubleList result = new ArrayDoubleList();

      int closestValueIndex = -1;
      double minDisnance = Double.MAX_VALUE;
      for (int i = 0; i < vector.size(); ++i)
      {
         double distance = Math.abs(vector.get(i) - inClassValue);
         if (distance < minDisnance)
         {
            closestValueIndex = i;
            minDisnance = distance;
         }
      }

      double res = closestValueIndex + 1;

      if (classToValueTable != null)
      {
         res = classToValueTable.get(res);
      }

      result.add(res);

      return result;
   }
View Full Code Here

Examples of org.apache.commons.collections.primitives.DoubleList

   }


   public boolean hasNextStep()
   {
      DoubleList currentResult = getResult();
      for (int i = 0; i < currentResult.size(); ++i)
      {
         System.out.print(currentResult.get(i) + ", ");
      }
      System.out.println();

      drawResult(currentResult);
      if (isEquals(lastResult, currentResult))
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.