Examples of Matrix


Examples of org.apache.pdfbox.util.Matrix

        }
        int imageWidth = awtImage.getWidth();
        int imageHeight = awtImage.getHeight();
        double pageHeight = pageSize.getHeight();
       
        Matrix ctm = drawer.getGraphicsState().getCurrentTransformationMatrix();
        int pageRotation = page.findRotation();

        AffineTransform ctmAT = ctm.createAffineTransform();
        ctmAT.scale(1f/imageWidth, 1f/imageHeight);
        Matrix rotationMatrix = new Matrix();
        rotationMatrix.setFromAffineTransform( ctmAT );
        if (pageRotation == 0 || pageRotation == 180)
        {
            rotationMatrix.setValue(2,1,(float)pageHeight-ctm.getYPosition()-ctm.getYScale());
        }
        else if (pageRotation == 90 || pageRotation == 270)
        {
            rotationMatrix.setValue(2,0,(float)ctm.getXPosition()-ctm.getYScale());
            rotationMatrix.setValue(2,1,(float)pageHeight-ctm.getYPosition());
        }
        rotationMatrix.setValue(0, 1, (-1)*rotationMatrix.getValue(0, 1));
        rotationMatrix.setValue(1, 0, (-1)*rotationMatrix.getValue(1, 0));
        AffineTransform at = new AffineTransform(
                rotationMatrix.getValue(0,0),rotationMatrix.getValue(0,1),
                rotationMatrix.getValue(1,0), rotationMatrix.getValue( 1, 1),
                rotationMatrix.getValue(2,0),rotationMatrix.getValue(2,1)
                );
        Shape clip = context.getGraphicsState().getCurrentClippingPath();
        // If the pdf is printed, sometimes a NPE occurs, see PDFBOX-552 for details
        // As a workaround we have to replace a possible null-value with a rectangle having
        // the same dimension than the page to be printed
View Full Code Here

Examples of org.cipres.treebase.domain.matrix.Matrix

   * (non-Javadoc)
   * @see org.cipres.treebase.web.controllers.PhyloWSController#getObjectQueryParameters(java.lang.Long)
   */
  @Override
  Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException {
    Matrix matrix = getMatrixService().findByID(objectId);
    if ( matrix == null ) {
      throw new ObjectNotFoundException("Can't find matrix " + objectId);
    }
    Study study = matrix.getStudy();
   
    if ( study == null ) {
      throw new ObjectNotFoundException("Can't find study for matrix "+objectId);
    }
   
    setStudy(matrix.getStudy());
   
    Map<String,String> params = new HashMap<String,String>();
    params.put("id", ""+study.getId());
    params.put("matrixid", ""+objectId);
    return params;
View Full Code Here

Examples of org.earth3d.jearth.math.Matrix

        quat.createFromAxisAngle((float) axis.x, (float) axis.y, (float) axis.z, len);
        quat.createMatrix(matrix);

        nav.stopAutoNavigation();

        Matrix mMatrix = new Matrix(matrix);

        setViewer(mMatrix.multvector(nav.viewer));

        nav.setDirection(mMatrix.multvector(nav.getDirection()));
        nav.setUp(mMatrix.multvector(nav.getUp()));

        old_sd = sd;

        updateScreen();
View Full Code Here

Examples of org.emftrace.quarc.core.gssquery.ratingscalculator.Matrix

   
    PrincipleGoalImpactMatrixCreator mappingMatrixCreator = new PrincipleGoalImpactMatrixCreator(gssQuery, queryResultSet,
        accessLayer, cacheManager);

    mappingMatrixCreator.runWithoutUnicaseCommand();
    Matrix mappingMatrix = mappingMatrixCreator.getMatrix();
   
     
    PrincipleRatingsCalculator principleRatingsCalculator = new PrincipleRatingsCalculator(gssQuery, queryResultSet, accessLayer, cacheManager );

    principleRatingsCalculator.runWithoutUnicaseCommand();
    Matrix principleMatrix = principleRatingsCalculator.getMatrix();
   
    GoalRatingsCalculator goalRatingsCalculator = new GoalRatingsCalculator(gssQuery, queryResultSet, accessLayer, cacheManager, mappingMatrix, principleMatrix);
    goalRatingsCalculator.runWithoutUnicaseCommand();
      goalMatrix = goalRatingsCalculator.getMatrix();
  }
View Full Code Here

Examples of org.encog.mathutil.matrices.Matrix

    EncogFileSection section;
    int inputCount = 0;
    int instarCount = 0;
    int outputCount = 0;
    int winnerCount = 0;
    Matrix m1 = null;
    Matrix m2 = null;

    while ((section = in.readNextSection()) != null) {
      if (section.getSectionName().equals("CPN")
          && section.getSubSectionName().equals("PARAMS")) {
        networkParams = section.parseParams();
View Full Code Here

Examples of org.geomajas.gwt.client.spatial.Matrix

    IButton button8 = new IButton(I18nProvider.getSampleMessages().renderingTransform());
    button8.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1,
            new Matrix(0, 0, 0, 0, 150, 00));
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2,
            new Matrix(0, 0, 0, 0, 0, 100));
      }
    });
    button8.setWidth100();
    column3.addMember(button8);
View Full Code Here

Examples of org.geomajas.puregwt.client.spatial.Matrix

  // ------------------------------------------------------------------------
  // MapResizedHandler implementation:
  // ------------------------------------------------------------------------

  public void onMapResized(MapResizedEvent event) {
    Matrix translation = viewPort.getTranslationMatrix(RenderSpace.WORLD, RenderSpace.SCREEN);
    int dx = (int) Math.round(translation.getDx());
    int dy = (int) Math.round(translation.getDy());
    htmlContainer.setTop(dy);
    htmlContainer.setLeft(dx);
    vectorContainer.transform(translation);

    for (int i = 0; i < layersModel.getLayerCount(); i++) {
View Full Code Here

Examples of org.jamesii.core.math.Matrix

   *          the covariance matrix of the assets
   * @return the mean and variance
   */
  public static Pair<Double, Double> calcMeanAndVariance(double[] weights,
      Double[] avgPerf, Double[][] covMat) {
    Matrix w = new Matrix(weights);
    Matrix s = new Matrix(covMat);
    Matrix r = new Matrix(avgPerf);
    return new Pair<>(r.transpose().mult(w).getElement(0, 0), w
        .transpose().mult(s.mult(w)).getElement(0, 0));
  }
View Full Code Here

Examples of org.jquantlib.math.matrixutilities.Matrix

    }

    @Override
    // TODO: review iterators
    public Matrix diffusion(/*@Time*/ final double t, final Array x){
        final Matrix pca = corrModel_.pseudoSqrt(t, x);
        // TODO: code review :: use of clone()
        final Array  vol = volaModel_.volatility(t, x);
        for (int i=0; i<size_; ++i) {
            pca.rangeRow(i).mulAssign(vol.get(i));
        }
        return pca;
    }
View Full Code Here

Examples of org.jquantlib.math.matrixutilities.Matrix

    public Matrix diffusion(/* @Time */final double t) {
        return diffusion(t, new Array());
    }

    public Matrix covariance(/* @Time */final double t, final Array x) {
        final Matrix sigma = this.diffusion(t, x);
        return sigma.mul(sigma.transpose());
    }
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.