Examples of clone()


Examples of org.apache.mahout.df.mapreduce.partial.TreeID.clone()

      Reader reader = new Reader(fs, path, job);
     
      try {
        while (reader.next(key, value)) {
          if (keys != null) {
            keys[index] = key.clone();
          }
         
          if (trees != null) {
            trees[index] = value.getTree();
          }
View Full Code Here

Examples of org.apache.mahout.math.Centroid.clone()

      // However, if the ratio is less than 1, we want to create a new cluster with probability
      // proportional to the distance to the closest cluster.
      double sample = random.nextDouble();
      if (sample < row.getWeight() * closestPair.getWeight() / distanceCutoff) {
        // Add new centroid, note that the vector is copied because we may mutate it later.
        centroids.add(row.clone());
      } else {
        // Merge the new point with the existing centroid. This will update the centroid's actual
        // position.
        // We know that all the points we inserted in the centroids searcher are (or extend)
        // WeightedVector, so the cast will always succeed.
View Full Code Here

Examples of org.apache.mahout.math.DenseVector.clone()

            updater.update(currentEigen, corpus.getRow(corpusRow), state);
        }
        state.setFirstPass(false);
        if (debug) {
          if (previousEigen == null) {
            previousEigen = currentEigen.clone();
          } else {
            double dot = currentEigen.dot(previousEigen);
            if (dot > 0) {
              dot /= (currentEigen.norm(2) * previousEigen.norm(2));
            }
View Full Code Here

Examples of org.apache.mahout.math.Vector.clone()

      if (r.nextBoolean() || numRows == nonNullRows) {
        m.assignRow(numRows == nonNullRows ? i : c, v);
      } else {
        Vector other = m.getRow(r.nextInt(numRows));
        if (other != null && other.getLengthSquared() > 0) {
          m.assignRow(c, other.clone());
        }
      }
      n += m.getRow(c).getLengthSquared();
    }
    return m;
View Full Code Here

Examples of org.apache.mahout.matrix.Vector.clone()

  public boolean shiftToMean() {
    Vector centroid = computeCentroid();
    converged = new EuclideanDistanceMeasure().distance(centroid, getCenter()) < convergenceDelta;
    setCenter(centroid);
    setNumPoints(1);
    setPointTotal(centroid.clone());
    return converged;
  }

  @Override
  public String toString() {
View Full Code Here

Examples of org.apache.maven.artifact.repository.metadata.Metadata.clone()

    final Metadata metadata = parseMetadata(getClass().getClassLoader().getResourceAsStream(resourceName));

    ArrayList<Metadata> metadatas = new ArrayList<Metadata>(count);

    for (int i = 0; i < count; i++) {
      metadatas.add(metadata.clone());
    }

    return metadatas;
  }
View Full Code Here

Examples of org.apache.maven.model.Activation.clone()

                continue;
            }

            if ( clone )
            {
                activation = activation.clone();
            }

            activations.put( profile.getId(), activation );
        }
View Full Code Here

Examples of org.apache.myfaces.trinidad.model.RowKeySetTreeImpl.clone()

    pathSet.setCollectionModel(model);
    model.setRowKey(_2);
    pathSet.addAll();
    pathSet.add(_011);

    RowKeySet clone = pathSet.clone();
    // mutate clone:
    clone.remove(_2);

    // make sure original has not changed:
    assertFalse(pathSet.contains(_0));
View Full Code Here

Examples of org.apache.nutch.storage.WebPage.clone()

        continue;

      if (requiredMark != null && requiredMark.checkMark(page) == null)
        continue;

      l.add(new URLWebPage(TableUtil.unreverseUrl(url), (WebPage)page.clone()));
    }

    return l;
  }
View Full Code Here

Examples of org.apache.openjpa.conf.OpenJPAConfiguration.clone()

    }

    public void testBeanAccessors()
        throws Exception {
        OpenJPAConfiguration conf = getConfiguration();
        OpenJPAConfigurationImpl simp = (OpenJPAConfigurationImpl) conf.clone();

        Value[] values = simp.getValues();
        PropertyDescriptor[] pds = simp.getPropertyDescriptors();
        List failures = new ArrayList();
        for (int i = 0; i < values.length; i++) {
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.