Package com.matrix

Examples of com.matrix.ColMajorCell


   public ColMajorCell get(int index)
   {
      if ( (index>this.size()) || (index<0) )
         throw new NoSuchElementException();
      else
         return new ColMajorCell(((Integer)tsIindexes.get(index)).intValue(),
                                 ((Integer)tsJindexes.get(index)).intValue());
   }
View Full Code Here


      // For each part of the low-resolution warp path, project that path to the higher resolution by filling in the
      //    path's corresponding cells at the higher resolution.
      for (int w=0; w<shrunkWarpPath.size(); w++)
      {
         final ColMajorCell currentCell = shrunkWarpPath.get(w);
         final int warpedI = currentCell.getCol();
         final int warpedJ = currentCell.getRow();

         final int blockISize = shrunkI.aggregatePtSize(warpedI);
         final int blockJSize = shrunkJ.aggregatePtSize(warpedJ);

         // If the path moved up or diagonally, then the next cell's values on the J axis will be larger.
View Full Code Here

      //    (first to last row (1..maxI), bottom to top (1..MaxJ)
      final Iterator matrixIterator = window.iterator();

      while (matrixIterator.hasNext())
      {
         final ColMajorCell currentCell = (ColMajorCell)matrixIterator.next()// current cell being filled
         final int i = currentCell.getCol();
         final int j = currentCell.getRow();

         if ( (i==0) && (j==0) )      // bottom left cell (first row AND first column)
            costMatrix.put(i, j, distFn.calcDistance(tsI.getMeasurementVector(0), tsJ.getMeasurementVector(0)));
         else if (i == 0)             // first column
         {
View Full Code Here

      //    (first to last row (1..maxI), bottom to top (1..MaxJ)
      final Iterator matrixIterator = window.iterator();

      while (matrixIterator.hasNext())
      {
         final ColMajorCell currentCell = (ColMajorCell)matrixIterator.next()// current cell being filled
         final int i = currentCell.getCol();
         final int j = currentCell.getRow();

         if ( (i==0) && (j==0) )      // bottom left cell (first row AND first column)
            costMatrix.put(i, j, distFn.calcDistance(tsI.getMeasurementVector(0), tsJ.getMeasurementVector(0)));
         else if (i == 0)             // first column
         {
View Full Code Here

            windowCells.add(cellIter.next());


         for (int cell=0; cell<windowCells.size(); cell++)
         {
            final ColMajorCell currentCell = (ColMajorCell)windowCells.get(cell);

            if ( (currentCell.getCol() != minI()) && (currentCell.getRow() != maxJ()) )// move to upper left if possible
            {
               // Either extend full search radius or some fraction until edges of matrix are met.
               final int targetCol = currentCell.getCol()-radius;
               final int targetRow = currentCell.getRow()+radius;

               if ( (targetCol>=minI()) && (targetRow<=maxJ()))
                  markVisited(targetCol, targetRow);
               else
               {
                  // Expand the window only to the edge of the matrix.
                  final int cellsPastEdge = Math.max(minI()-targetCol, targetRow-maxJ());
                  markVisited(targetCol+cellsPastEdge, targetRow-cellsPastEdge);
               // end if
            // end if

            if (currentCell.getRow() != maxJ())  // move up if possible
            {
               // Either extend full search radius or some fraction until edges of matrix are met.
               final int targetCol = currentCell.getCol();
               final int targetRow = currentCell.getRow()+radius;

               if (targetRow <= maxJ())
                  markVisited(targetCol, targetRow)// radius does not go past the edges of the matrix
               else
               {
                  // Expand the window only to the edge of the matrix.
                  final int cellsPastEdge = targetRow-maxJ();
                  markVisited(targetCol, targetRow-cellsPastEdge);
               // end if
            // end if

            if ((currentCell.getCol() != maxI()) && (currentCell.getRow() != maxJ())) // move to upper-right if possible
            {
               // Either extend full search radius or some fraction until edges of matrix are met.
               final int targetCol = currentCell.getCol()+radius;
               final int targetRow = currentCell.getRow()+radius;

               if ( (targetCol<=maxI()) && (targetRow<=maxJ()))
                  markVisited(targetCol, targetRow)// radius does not go past the edges of the matrix
               else
               {
                  // Expand the window only to the edge of the matrix.
                  final int cellsPastEdge = Math.max(targetCol-maxI(), targetRow-maxJ());
                  markVisited(targetCol-cellsPastEdge, targetRow-cellsPastEdge);
               // end if
            // end if

            if (currentCell.getCol() != minI())  // move left if possible
            {
               // Either extend full search radius or some fraction until edges of matrix are met.
               final int targetCol = currentCell.getCol()-radius;
               final int targetRow = currentCell.getRow();

               if (targetCol >= minI())
                  markVisited(targetCol, targetRow)// radius does not go past the edges of the matrix
               else
               {
                  // Expand the window only to the edge of the matrix.
                  final int cellsPastEdge = minI()-targetCol;
                  markVisited(targetCol+cellsPastEdge, targetRow);
               // end if
            // end if

            if (currentCell.getCol() != maxI())  // move right if possible
            {
               // Either extend full search radius or some fraction until edges of matrix are met.
               final int targetCol = currentCell.getCol()+radius;
               final int targetRow = currentCell.getRow();

               if (targetCol <= maxI())
                  markVisited(targetCol, targetRow)// radius does not go past the edges of the matrix
               else
               {
                  // Expand the window only to the edge of the matrix.
                  final int cellsPastEdge = targetCol-maxI();
                  markVisited(targetCol-cellsPastEdge, targetRow);
               // end if
            // end if

            if ( (currentCell.getCol() != minI()) && (currentCell.getRow() != minJ()) )  // move to lower-left if possible
            {
               // Either extend full search radius or some fraction until edges of matrix are met.
               final int targetCol = currentCell.getCol()-radius;
               final int targetRow = currentCell.getRow()-radius;

               if ( (targetCol>=minI()) && (targetRow>=minJ()))
                  markVisited(targetCol, targetRow)// radius does not go past the edges of the matrix
               else
               {
                  // Expand the window only to the edge of the matrix.
                  final int cellsPastEdge = Math.max(minI()-targetCol, minJ()-targetRow);
                  markVisited(targetCol+cellsPastEdge, targetRow+cellsPastEdge);
               // end if
            // end if

            if (currentCell.getRow() != minJ())  // move down if possible
            {
               // Either extend full search radius or some fraction until edges of matrix are met.
               final int targetCol = currentCell.getCol();
               final int targetRow = currentCell.getRow()-radius;

               if (targetRow >= minJ())
                  markVisited(targetCol, targetRow)// radius does not go past the edges of the matrix
               else
               {
                  // Expand the window only to the edge of the matrix.
                  final int cellsPastEdge = minJ()-targetRow;
                  markVisited(targetCol, targetRow+cellsPastEdge);
               // end if
            // end if

            if ((currentCell.getCol() != maxI()) && (currentCell.getRow() != minJ()))  // move to lower-right if possible
            {
               // Either extend full search radius or some fraction until edges of matrix are met.
               final int targetCol = currentCell.getCol()+radius;
               final int targetRow = currentCell.getRow()-radius;

               if ( (targetCol<=maxI()) && (targetRow>=minJ()))
                  markVisited(targetCol, targetRow)// radius does not go past the edges of the matrix
               else
               {
View Full Code Here

            throw new ConcurrentModificationException();
         else if (!hasMoreElements)
            throw new NoSuchElementException();
         else
         {
            final ColMajorCell cell = new ColMajorCell(currentI, currentJ);
            if (++currentJ > window.maxJforI(currentI))
            {
               if (++currentI <= window.maxI())
                  currentJ = window.minJforI(currentI);
               else
View Full Code Here

TOP

Related Classes of com.matrix.ColMajorCell

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.