Examples of Matrix


Examples of Jama.Matrix

        super(source, new ImageLayout(source), config, true);
        permitInPlaceOperation();
        this.angle = angle;

        ICC_ProfileRGB sRGB = (ICC_ProfileRGB) JAIContext.sRGBColorProfile;
        toSRGB = new Matrix(sRGB.getMatrix()).inverse().times(new Matrix(((ICC_ProfileRGB) JAIContext.linearProfile).getMatrix())).getArrayFloat();
        toLinearRGB = new Matrix(sRGB.getMatrix()).inverse().times(new Matrix(((ICC_ProfileRGB) JAIContext.linearProfile).getMatrix())).inverse().getArrayFloat();
    }
View Full Code Here

Examples of aima.core.util.math.Matrix

  public List<CategoricalDistribution> forwardBackward(
      List<List<AssignmentProposition>> ev, CategoricalDistribution prior) {
    // local variables: fv, a vector of forward messages for steps 0,...,t
    List<Matrix> fv = new ArrayList<Matrix>(ev.size() + 1);
    // b, a representation of the backward message, initially all 1s
    Matrix b = hmm.createUnitMessage();
    // sv, a vector of smoothed estimates for steps 1,...,t
    List<Matrix> sv = new ArrayList<Matrix>(ev.size());

    // fv[0] <- prior
    fv.add(hmm.convert(prior));
View Full Code Here

Examples of android.graphics.Matrix

    }
   
    if (!forward)
      degrees = -degrees;
   
    final Matrix matrix = t.getMatrix();

    camera.save();
    camera.translate(0.0f, 0.0f, (float)(310.0 * Math.sin(radians)));
    camera.rotateY(degrees);
    camera.getMatrix(matrix);
    camera.restore();

    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
  }
View Full Code Here

Examples of at.bestsolution.efxclipse.formats.fxg.fxg.Matrix

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetMatrix(Matrix newMatrix, NotificationChain msgs) {
    Matrix oldMatrix = matrix;
    matrix = newMatrix;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FxgPackage.RADIAL_GRADIENT__MATRIX, oldMatrix, newMatrix);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

Examples of ca.eandb.jmist.math.Matrix

    if (index < data.length) {
      throw new IllegalArgumentException("Not enough data");
    }

    Matrix F[] = new Matrix[outerTerms];
    Matrix G[] = new Matrix[outerTerms];
    Matrix u[][] = new Matrix[outerTerms][];
    Matrix v[][] = new Matrix[outerTerms][];

    Matrix Fc[] = new Matrix[3];
    Matrix Gc[] = new Matrix[3];

    index = 0;
    for (int i = 0; i < outerTerms; i++) {
      F[i] = new Matrix(new MatrixBuffer(
          data, thetaOutCount, phiOutCount, index, phiOutCount, 1));
      index += thetaOutCount * phiOutCount;

      G[i] = new Matrix(new MatrixBuffer(
          data, thetaPCount, phiPCount, index, phiPCount, 1));
      index += thetaPCount * phiPCount;

      u[i] = new Matrix[innerTerms];
      v[i] = new Matrix[innerTerms];

      for (int j = 0; j < innerTerms; j++) {
        u[i][j] = new Matrix(new MatrixBuffer(
            data, thetaPCount, 1, index, 1, 1));
        index += thetaPCount;

        v[i][j] = new Matrix(new MatrixBuffer(
            data, phiPCount, 1, index, 1, 1));
        index += phiPCount;
      }
    }

    int FcOffset = index;
    int GcOffset = index + thetaOutCount * phiOutCount * 3;

    for (int i = 0; i < 3; i++) {
      Fc[i] = new Matrix(new MatrixBuffer(
          data, thetaOutCount, phiOutCount, FcOffset + i, 3 * phiOutCount, 3));
      Gc[i] = new Matrix(new MatrixBuffer(
          data, thetaPCount, phiPCount, GcOffset + i, 3 * phiPCount, 3));
    }

    return new FactoredMaterial(F, G, u, v, Fc, Gc, cm);

View Full Code Here

Examples of cc.mallet.types.Matrix

  private Factor sliceForAlpha (Assignment assn)
  {
    double alph = assn.getDouble (alpha);
    int[] sizes = sizesFromVarSet (xs);
    Matrix diag = Matrices.diag (sizes, alph);
    Matrix matrix = Matrices.constant (sizes, -alph);
    matrix.plusEquals (diag);
    return LogTableFactor.makeFromLogMatrix (xs.toVariableArray (), (SparseMatrixn) matrix);
  }
View Full Code Here

Examples of ch.akuhn.hapax.linalg.Matrix

        Hapax hapax = Hapax.newCorpus()
        .useTFIDF()
        .useCamelCaseScanner()
        .addFiles(folder, ".java")
        .build();
        Matrix corr = hapax.getIndex().documentCorrelation();
        PrintWriter f = new PrintWriter("data.xml");
        f.println("<?xml version=\"1.0\"?>");
        f.println("<!DOCTYPE ggobidata SYSTEM \"ggobi.dtd\">");
        f.println("<ggobidata count=\"2\">");
        f.println("<data name=\"points\">");
        f.println("<variables count=\"1\">");
        f.println("  <realvariable name=\"x\" nickname=\"x\" />");
        f.println("</variables>");
        f.printf("<records count=\"%d\">\n", hapax.getIndex().documentCount());
        int n = 0;
        for (String doc: hapax.getIndex().documents()) {
            f.printf("<record id=\"%d\" label=\"%s\"> 0 </record>\n",
                    ++n,
                    new File(doc).getName());
        }
        f.print("</records>\n</data>\n\n");
        f.println("<data name=\"distance\">");
        f.println("<variables count=\"1\">");
        f.println("  <realvariable name=\"D\" nickname=\"D\" />");
        f.println("</variables>");
        int tally = 0;
        for (Vector row: corr.rows()) {
            for (Entry each: row.entries()) {
                if (Matrix.indexOf(row) >= each.index) continue;
                if (each.value > THRESHOLD) tally++;
            }
        }
        System.out.println(tally);
        f.printf("<records count=\"%d\" glyph=\"fr 1\" color=\"0\">\n", tally);
        for (Vector row: corr.rows()) {
            for (Entry each: row.entries()) {
                if (Matrix.indexOf(row) >= each.index) continue;
                if (each.value > THRESHOLD) {
                    f.printf("<record source=\"%d\" destination=\"%d\"> %f </record>\n",
                            Matrix.indexOf(row)+1,
View Full Code Here

Examples of ch.akuhn.matrix.Matrix

  private static final double epsilon = 1e-9;

  @Test
  public void shouldFindEigenvalues() {
    Matrix A = Matrix.from(3, 3,
        0, 1, -1,
        1, 1, 0,
        -1, 0, 1);
    Eigenvalues eigen = new AllEigenvalues(A).run();
   
    assertEquals(-1, eigen.value[0], epsilon);
    assertEquals(1, eigen.value[1], epsilon);
    assertEquals(2, eigen.value[2], epsilon);

    assert A.mult(eigen.vector[0]).equals(eigen.vector[0].times(eigen.value[0]), epsilon);
    assert A.mult(eigen.vector[1]).equals(eigen.vector[1].times(eigen.value[1]), epsilon);
    assert A.mult(eigen.vector[2]).equals(eigen.vector[2].times(eigen.value[2]), epsilon);
  }
View Full Code Here

Examples of chunmap.util.math.Matrix

  public AffineTransform(Matrix m) {
    this.m = m;
  }

  public AffineTransform() {
    m = new Matrix(3, 3);
  }
View Full Code Here

Examples of com.CompPad.model.Matrix

            // strings that will be used to set x and y labels
            String xUnitString;
            String yUnitString;
            com.CompPad.model.EvalUnit xEvalUnit = null;
            com.CompPad.model.EvalUnit yEvalUnit = null;
            Matrix mmatrix = (Matrix) plot.getObject();
            int m = (int) Math.round(mmatrix.getNumberOfRows().getReal(Unit.ONE));
            int n = (int) Math.round(mmatrix.getNumberOfColumns().getReal(Unit.ONE)) / 2;
            String[] colDescriptions = new String[n+1];
            colDescriptions[0] = "x";
            List<Double[]> x = new ArrayList(); /* List of x/y pairs */
            Double newRow[];
            int mm = 0; /* Total number of rows after loop */
            // iterate columns
            for (int j=0; j<n; ++j){
                /* Create column label sequence */
                colDescriptions[j+1] = "series "+(j+1);
                // iterate rows
                for (int i=0; i<m;++i){
                    if (mmatrix.get(i,2*j)==null){
                        /* Set "no data" value */
                    }
                    else {
                        newRow = new Double[n+1];
//                        Arrays.fill(newRow,Double.MIN_NORMAL);
                        Arrays.fill(newRow,Math.pow(2.0, -1022.0));
                        // x value
                        ComplexAmount a1 = (ComplexAmount)mmatrix.get(i,2*j);
                        // y value
                        ComplexAmount a2 = (ComplexAmount)mmatrix.get(i,2*j+1);
                        // Check whether units have been defined
                        if (xunits==null){
                            // if not then define x and y units
                            xunits = a1.getUnit();
                            yunits = a2.getUnit();
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.