Examples of Vector


Examples of math.Vector

   * calculate the afterwards direction and rotation.
   */
  public static void rotateObject(Matrix dir, Vector rot, double inertia,
      Vector momentum, double timeDelta) {
    // angular acceleration = M / J (like in F = m*a)
    Vector rotAt = momentum.clone().scale(
        (inertia < 0.0005f) ? 0 : (timeDelta / inertia));
    Vector deltaDir = rotAt.clone().scale(0.5f).add(rot).scale(timeDelta);
    dir.set(Matrix.mult(dir, Matrix.getRotationalMatrix(deltaDir)));
    rot.add(rotAt);
  }
View Full Code Here

Examples of mephi.cybernetics.dhcn.common.data.Vector

    @Override
    public IResultSolver execute(DataTask task)
    {
        System.out.println("SolverDataVectorMultNum");
        DataVectorMultNumTask currentTask = (DataVectorMultNumTask) task;
        Vector vector = currentTask.getVector();
        Double num = currentTask.getNum();
        DataTaskSolver tasks = new DataTaskSolver();
        for (int i = 0; i < vector.getCountElem(); i++)
        {
           DataNumMultNumTask newTask = new DataNumMultNumTask(vector.getVectorElem(i), num, -1, i, Config.NODE_SOLVER);
           tasks.addTask(newTask);
        }
        return tasks;
    }
View Full Code Here

Examples of mikera.vectorz.Vector

    return index.indexPosition(i)>=0;
  }
 
  @Override
  public Vector toVector() {
    Vector v=Vector.createLength(length);
    double[] data=this.data;
    int[] ixs=index.data;
    for (int i=0; i<data.length; i++) {
      v.unsafeSet(ixs[i],data[i]);
   
    return v;
  }
View Full Code Here

Examples of net.sf.jcontracts.antlr.collections.impl.Vector

            else
            {
                grammarFileName = incomingArgs[i];
                if (grammars == null)
                {
                    grammars = new Vector(10);
                }
                grammars.appendElement(grammarFileName);
            }
        }
View Full Code Here

Examples of no.uib.cipr.matrix.Vector

        if (!(y instanceof DistVector))
            throw new IllegalArgumentException("Vector must be DistVector");

        checkSize(y);

        Vector yb = ((DistVector) y).getLocal();

        x.set(alpha, yb);

        return this;
    }
View Full Code Here

Examples of nu.fw.jeti.plugins.drawing.geometry.Vector

   */
  public void paste() {
    if (!staticClipboard.isEmpty()) {
      Point2D.Double p = currentPicture
          .getTheMostUpperLeftPointAmongGaveList(staticClipboard);
      Vector v = new Vector(-p.x, -p.y);
      history.addPasteDoneByMe(staticClipboard, v,
          getMyJID().toString(), pictures, receivers,  thread);
    }
  }
View Full Code Here

Examples of org.apache.mahout.math.Vector

    Multiset<String> counts = parse(f);
    return vectorize(counts, w, normalize, dimension);
  }

  static Vector vectorize(Multiset<String> doc, CorpusWeighting w, boolean normalize, int dimension) {
    Vector v = new RandomAccessSparseVector(dimension);
    FeatureVectorEncoder encoder = new StaticWordValueEncoder("text");
    for (String word : doc.elementSet()) {
      encoder.addToVector(word, w.weight(word, doc.count(word)), v);
    }
    if (normalize) {
      return v.assign(Functions.div(v.norm(2)));
    } else {
      return v;
    }
  }
View Full Code Here

Examples of org.apache.mahout.matrix.Vector

  private List<Canopy> canopies;

  @Override
  public void map(WritableComparable<?> key, Text values,
                  OutputCollector<Text, Text> output, Reporter reporter) throws IOException {
    Vector point = AbstractVector.decodeVector(values.toString());
    Canopy.emitPointToExistingCanopies(point, canopies, values, output);
  }
View Full Code Here

Examples of org.apache.pdfbox.util.Vector

    }

    @Override
    public Vector getDisplacement(int code) throws IOException
    {
        return getFontMatrix().transform(new Vector(getWidth(code), 0));
    }
View Full Code Here

Examples of org.apache.spark.mllib.linalg.Vector

      Vectors.dense(1.0, 2.0, 6.0),
      Vectors.dense(1.0, 3.0, 0.0),
      Vectors.dense(1.0, 4.0, 6.0)
    );

    Vector expectedCenter = Vectors.dense(1.0, 3.0, 4.0);

    JavaRDD<Vector> data = sc.parallelize(points, 2);
    KMeansModel model = KMeans.train(data.rdd(), 1, 1, 1, KMeans.K_MEANS_PARALLEL());
    assertEquals(1, model.clusterCenters().length);
    assertEquals(expectedCenter, model.clusterCenters()[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.