Examples of asVector()


Examples of mikera.arrayz.INDArray.asVector()

    return a;
  }
 
  public static boolean validateFullyMutable(INDArray m) {
    INDArray c=m.exactClone();
    AVector v=c.asVector();
    int n=v.length();

    if ((!c.isFullyMutable())) return false;
    if ((!c.isMutable())&&(n>0)) return false
   
View Full Code Here

Examples of mikera.arrayz.INDArray.asVector()

    } else if (o instanceof double[]) {
      return Vectorz.create((double[])o);
    } else if (o instanceof INDArray) {
      INDArray a=(INDArray)o;
      if (a.dimensionality()!=1) throw new IllegalArgumentException("Cannot coerce INDArray with shape "+a.getShape().toString()+" to a vector");
      return a.asVector();
    } else if (o instanceof List<?>) {
      return Vectorz.create((List<Object>)o);
    } else if (o instanceof Iterable<?>) {
      return Vectorz.create((Iterable<Object>)o);
    }
View Full Code Here

Examples of mikera.matrixx.AMatrix.asVector()

        solver.setA(A);
//        create AMatrix from AVector
        AMatrix B = b.asColumnMatrix();
        AMatrix X = solver.solve(B);
//        convert AMatrix into AVector and return
        return X.asVector();
    }
   
    /**
     * Returns the least squares solution to the equation A.X = B
     * Use this in the case of over-determined (more equations than unknowns) or
View Full Code Here

Examples of mikera.matrixx.AMatrix.asVector()

      AMatrix B = b.asColumnMatrix();
      AMatrix X = solver.solve(B);
//      if no solution
      if(X == null)
          return null;
      return X.asVector();
  }
 
  /**
     * For a square matrix A, returns a matrix whose each column is the
     * solution to the equation A.x = b, where b is the corresponsing column
View Full Code Here

Examples of mikera.matrixx.AMatrix.asVector()

    doGenericTests(g4);
  }
   
  @Test public void g_MatrixViews5x5() { 
    AMatrix m1=Matrixx.createRandomSquareMatrix(5);
    doGenericTests(m1.asVector());
    doGenericTests(m1.getRow(4));
    doGenericTests(m1.getColumn(1));
    doGenericTests(m1.getLeadingDiagonal());
  }
   
View Full Code Here

Examples of mikera.matrixx.AMatrix.asVector()

    doGenericTests(m1.getLeadingDiagonal());
  }
   
  @Test public void g_MatrixViews3x3() { 
    AMatrix m2=Matrixx.createRandomSquareMatrix(3);
    doGenericTests(m2.asVector());
    doGenericTests(m2.getRow(1));
    doGenericTests(m2.getColumn(1));
    doGenericTests(m2.getLeadingDiagonal());
    doGenericTests(new MatrixAsVector(m2));
  }
View Full Code Here

Examples of mikera.matrixx.AMatrix.asVector()

    doGenericTests(new MatrixAsVector(m2));
  }

  @Test public void g_MatrixViews4x5() { 
    AMatrix m3=Matrixx.createRandomMatrix(4,5);
    doGenericTests(m3.asVector());
    doGenericTests(m3.getRow(2));
    doGenericTests(m3.getColumn(2));
    doGenericTests(m3.subMatrix(1, 1, 2, 3).asVector());
    doGenericTests(new MatrixAsVector(m3));
  }
View Full Code Here

Examples of org.rosuda.JRI.REXP.asVector()

    try {
      REXP x;
      re.eval("data(iris)",false);
      System.out.println(x=re.eval("iris"));
      // generic vectors are RVector to accomodate names
      RVector v = x.asVector();
      if (v.getNames()!=null) {
        System.out.println("has names:");
        for (Enumeration e = v.getNames().elements() ; e.hasMoreElements() ;) {
          System.out.println(e.nextElement());
        }
View Full Code Here

Examples of org.rosuda.JRI.REXP.asVector()

      re.eval("plot(fmh,displayisolates = FALSE, vertex.col = \"Grade\", vertex.cex = 0.7)");
     
      re.eval("data(iris)",false);
      System.out.println(x=re.eval("iris"));
      // generic vectors are RVector to accomodate names
      RVector v = x.asVector();
      if (v.getNames()!=null) {
        System.out.println("has names:");
        for (Enumeration e = v.getNames().elements() ; e.hasMoreElements() ;) {
          System.out.println(e.nextElement());
        }
View Full Code Here

Examples of org.rosuda.JRI.REXP.asVector()

    try {
      REXP x;
      re.eval("data(iris)",false);
      System.out.println(x=re.eval("iris"));
      // generic vectors are RVector to accomodate names
      RVector v = x.asVector();
      if (v.getNames()!=null) {
        System.out.println("has names:");
        for (Enumeration e = v.getNames().elements() ; e.hasMoreElements() ;) {
          System.out.println(e.nextElement());
        }
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.