Package org.apache.mahout.matrix

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


   */
  void plotRectangle(Graphics2D g2, Vector v, Vector dv) {
    int h = size / 2;
    double[] flip = { 1, -1 };
    Vector v2 = v.copy().assign(new DenseVector(flip), new TimesFunction());
    v2 = v2.minus(dv.divide(2));
    double x = v2.get(0) + h;
    double y = v2.get(1) + h;
    g2.draw(new Rectangle2D.Double(x * ds, y * ds, dv.get(0) * ds, dv.get(1)
        * ds));
  }
View Full Code Here


   */
  void plotEllipse(Graphics2D g2, Vector v, Vector dv) {
    int h = size / 2;
    double[] flip = { 1, -1 };
    Vector v2 = v.copy().assign(new DenseVector(flip), new TimesFunction());
    v2 = v2.minus(dv.divide(2));
    double x = v2.get(0) + h;
    double y = v2.get(1) + h;
    g2
        .draw(new Ellipse2D.Double(x * ds, y * ds, dv.get(0) * ds, dv.get(1)
            * ds));
 
View Full Code Here

   * @param dv a Vector of rectangle sizes
   */
  public static void plotRectangle(Graphics2D g2, Vector v, Vector dv) {
    double[] flip = { 1, -1 };
    Vector v2 = v.clone().assign(new DenseVector(flip), new TimesFunction());
    v2 = v2.minus(dv.divide(2));
    int h = size / 2;
    double x = v2.get(0) + h;
    double y = v2.get(1) + h;
    g2.draw(new Rectangle2D.Double(x * ds, y * ds, dv.get(0) * ds, dv.get(1)
        * ds));
 
View Full Code Here

   * @param dv a Vector of rectangle sizes
   */
  public static void plotEllipse(Graphics2D g2, Vector v, Vector dv) {
    double[] flip = { 1, -1 };
    Vector v2 = v.clone().assign(new DenseVector(flip), new TimesFunction());
    v2 = v2.minus(dv.divide(2));
    int h = size / 2;
    double x = v2.get(0) + h;
    double y = v2.get(1) + h;
    g2
        .draw(new Ellipse2D.Double(x * ds, y * ds, dv.get(0) * ds, dv.get(1)
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.