Package ca.eandb.jmist.math

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


        /* Get the range of y-values for the ray within the cell, and
         * get the portion of the height matrix within the cell.
         */
        Interval h = Interval.between(p0.y(), p1.y());
        Matrix slice = height.slice(cell.getX(), cell.getZ(), 2, 2);

        boolean hit = false;

        /* If the range of y-values intersect, then there may be an
         * intersection.
         */
        if (h.intersects(slice.range())) {

          Box3 bounds = cell.getBoundingBox();

          /* Get the points on the height field. */
          Point3 p00 = new Point3(bounds.minimumX(), slice.at(0, 0), bounds.minimumZ());
          Point3 p01 = new Point3(bounds.minimumX(), slice.at(0, 1), bounds.maximumZ());
          Point3 p10 = new Point3(bounds.maximumX(), slice.at(1, 0), bounds.minimumZ());
          Point3 p11 = new Point3(bounds.maximumX(), slice.at(1, 1), bounds.maximumZ());

          Plane3 plane;
          double t;

          /* Divide the four points into two triangles and check for
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.math.Matrix

Copyright © 2018 www.massapicom. 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.