Examples of asDoubleArray()


Examples of mikera.arrayz.impl.IStridedArray.asDoubleArray()

      for (int i=0; i<dims; i++) {
        assertEquals(m.getStride(i),strides[i]);
      }
     
      if (m.isPackedArray()) {
        assertNotNull(m.asDoubleArray());
        assertTrue(m.asDoubleArray()==m.getArray());
      } else {
        assertNull(m.asDoubleArray());
      }
     
View Full Code Here

Examples of mikera.arrayz.impl.IStridedArray.asDoubleArray()

        assertEquals(m.getStride(i),strides[i]);
      }
     
      if (m.isPackedArray()) {
        assertNotNull(m.asDoubleArray());
        assertTrue(m.asDoubleArray()==m.getArray());
      } else {
        assertNull(m.asDoubleArray());
      }
     
      int[] ix = IntArrays.rand(shape);
View Full Code Here

Examples of mikera.arrayz.impl.IStridedArray.asDoubleArray()

     
      if (m.isPackedArray()) {
        assertNotNull(m.asDoubleArray());
        assertTrue(m.asDoubleArray()==m.getArray());
      } else {
        assertNull(m.asDoubleArray());
      }
     
      int[] ix = IntArrays.rand(shape);
      int off=m.getArrayOffset()+IntArrays.dotProduct(strides,ix);
      assertEquals(data[off],m.get(ix),0.0);
View Full Code Here

Examples of mikera.matrixx.AMatrix.asDoubleArray()

    @Test
    public void testSolveSquareMatrix() {
        AMatrix m= Matrix.create(new double[][] {{1,2,2},{1,4,1},{5,9,2}});
       
        AMatrix x = Linear.solveLeastSquares(m, Matrix.create(new double[][]{{1},{3},{3}}));
        assertArrayEquals(new double[] {-1.35294117647,1.05882352941,0.11764705882},x.asDoubleArray(), 1e-8);
    }
   
    @Test(expected=IllegalArgumentException.class)
    public void testSolveSquareMatrixRectangular() {
        AMatrix m= Matrix.create(new double[][] {{1,2},{1,4},{5,9}});
View Full Code Here

Examples of mikera.matrixx.AMatrix.asDoubleArray()

    private boolean extractTogether() {
        // extract the orthogonal from the similar transform
//        V = decomp.getQ(V,true);
        AMatrix temp = decomp.getQ(true);
        V = Matrix.wrap(temp.rowCount(), temp.columnCount(), temp.asDoubleArray());

        // tell eigenvector algorithm to update this matrix as it computes the rotators
        helper.setQ(V);

        vector.setFastEigenvalues(false);
View Full Code Here

Examples of mikera.matrixx.AMatrix.asDoubleArray()

        offSaved = helper.swapOff(offSaved);

        // extract the orthogonal from the similar transform
//        V = decomp.getQ(V,true);
        AMatrix temp = decomp.getQ(true);
        V = Matrix.wrap(temp.rowCount(), temp.columnCount(), temp.asDoubleArray());

        // tell eigenvector algorithm to update this matrix as it computes the rotators
        vector.setQ(V);

        // extract eigenvectors
View Full Code Here

Examples of mikera.matrixx.Matrix.asDoubleArray()

            }
            // solve for Rx = b using the standard upper triangular solver
            solveU(R.asDoubleArray(),a.asDoubleArray(),numCols);

            // save the results
            double[]data = X.asDoubleArray();
            for( int i = 0; i < numCols; i++ ) {
//                X.data[i*X.columnCount()+colB] = a.data[i];
                data[i*X.columnCount()+colB] = a.data[i];
            }
        }
View Full Code Here

Examples of mikera.vectorz.Vector.asDoubleArray()

  }

  @Override
  public Matrix transposeInnerProduct(Matrix s) {
    Vector v=vector.innerProduct(s).toVector();
    return Matrix.wrap(1, s.columnCount(), v.asDoubleArray());
  }
 
  @Override
  public boolean hasUncountable() {
      return vector.hasUncountable();
View Full Code Here

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

            System.out.println("Result = "+e+", running eval");
            long r=re.rniEval(e, 0);
            System.out.println("Result = "+r+", building REXP");
            REXP x=new REXP(re, r);
            System.out.println("REXP result = "+x);
            double d[]=x.asDoubleArray();
            if (d!=null) {
                int i=0; while (i<d.length) { System.out.print(((i==0)?"":", ")+d[i]); i++; }
                System.out.println("");
            }
            System.out.println("");
View Full Code Here

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

            System.out.println("Result = "+e+", running eval");
            long r=re.rniEval(e, 0);
            System.out.println("Result = "+r+", building REXP");
            REXP x=new REXP(re, r);
            System.out.println("REXP result = "+x);
            double d[]=x.asDoubleArray();
            if (d!=null) {
                int i=0; while (i<d.length) { System.out.print(((i==0)?"":", ")+d[i]); i++; }
                System.out.println("");
            }
            System.out.println("");
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.