Create a new bounds by transforming this bounds with the specified tranformation matrix.

@param t
the transformation matrix
@return the transformed bounds
19991
public Bbox transform(Matrix t) {
		Coordinate c1 = transform(t, new Coordinate(x, y));
		Coordinate c2 = transform(t, new Coordinate(x + width, y + height));
		Coordinate origin = new Coordinate(Math.min(c1.getX(), c2.getX()), Math.min(c1.getY(), c2.getY()));
		Coordinate endPoint = new Coordinate(Math.max(c1.getX(), c2.getX()), Math.max(c1.getY(), c2.getY()));
		return new Bbox(origin.getX(), origin.getY(), endPoint.getX() - origin.getX(), endPoint.getY() - origin.getY());
	}
1274238
public T transpose() {
        T ret = createMatrix(mat.getNumCols(),mat.getNumRows(), mat.getType());

        ops.transpose(mat,ret.mat);

        return ret;
    }
554853
public float[] t4(float[] z, int k, int M) {
    float[] result = new float[M];
    float[] w = new float[z.length];

    for (int i = 0; i < z.length; i++) {
      w[i] = (float) 2.0 * (i + 1);
    }

    for (int i = 1; i <= M - 1; i++) {
      int head = (i - 1) * k / (M - 1) + 1;
      int tail = i * k / (M - 1);
      float[] subZ = subVector(z, head - 1, tail - 1);
      float[] subW = subVector(w, head - 1, tail - 1);

      result[i - 1] = (new Transformations()).rSum(subZ, subW);
    }

    int head = k + 1 - 1;
    int tail = z.length - 1;
    float[] subZ = subVector(z, head, tail);
    float[] subW = subVector(w, head, tail);
    result[M - 1] = (new Transformations()).rSum(subZ, subW);

    return result;
  }
857861
@Override
    public DMatrixRMaj getT(DMatrixRMaj T ) {
        T = UtilDecompositons_DDRM.checkZeros(T,N,N);

        T.data[0] = QT.data[0];

        for( int i = 1; i < N; i++ ) {
            T.set(i,i, QT.get(i,i));
            double a = QT.get(i-1,i);
            T.set(i-1,i,a);
            T.set(i,i-1,a);
        }

        if( N > 1 ) {
            T.data[(N-1)*N+N-1] = QT.data[(N-1)*N+N-1];
            T.data[(N-1)*N+N-2] = QT.data[(N-2)*N+N-1];
        }
            
        return T;
    }
449718
private boolean cCreateFromScratch(Bounds i, int from, int to) {
		//Conversion
		long max = i.max;
		long min = i.min;
		if (i.max == APSPSolver.INF) max = H-O;
		if (i.min == -APSPSolver.INF) min = -1 * (H - O);
		i = new Bounds(min,max);

		// Checks
		if (i.min > i.max) return false; 
		if (from == to) return false;
		if (tPoints[from] == null) return false;

		//Already existing edge
		SimpleDistanceConstraint con = tPoints[from].getOut(to);
		if (con != null) {
			//check intersection between active con and new con
			if ( (con.getMinimum() > i.max) || (con.getMaximum() < i.min) ) return false;
			//check con does not contain active con
			if ( (con.getMinimum() > i.min) && (con.getMaximum() < i.max) ) {
				//OK it is. I save con without doing anything else
				if (!con.addInterval(i)) return false;
				return true;
			}
			//Update active con
			long oldd = con.getMinimum();
			long oldD = con.getMaximum();
			if (con.getMinimum() < i.min) con.setMinimum(i.min);
			if (con.getMaximum() > i.max) con.setMaximum(i.max);

			if (!con.addInterval(i)) return false;
			
			if (backupDMatrixSimple) saveDMatrixInternal();
			if (!fromScratchDistanceMatrixComputation()) {
				//Inconsistency. Rollback
				con.removeInterval(i);
				if (backupDMatrixSimple) restoreDMatrixInternal();
				return false;
			}

			//[lb,ub] = [-di0,d0i]
			for (int j = 0; j < MAX_USED+1; j++)
				if (tPoints[j].isUsed()) {
					tPoints[j].setLowerBound(sum(-distance[j][0],O));
					tPoints[j].setUpperBound(sum(distance[0][j],O));
				}
		}				
		else {
			con = new SimpleDistanceConstraint();
			con.setFrom(this.getVariable(from));
			con.setTo(this.getVariable(to));
			con.setMinimum(i.min);
			con.setMaximum(i.max);
			con.addInterval(new Bounds(i.min,i.max));
			//Add edge to tp
			tPoints[from].setOut(to,con);

			if (backupDMatrixSimple) saveDMatrixInternal();
			if (!fromScratchDistanceMatrixComputation()) {
				tPoints[from].setOut(to,null);
				if (backupDMatrixSimple) restoreDMatrixInternal();
				return false;
			}

			//[lb,ub] = [-di0,d0i]
			for (int j = 0; j < MAX_USED+1; j++) {
				if (tPoints[j].isUsed() == true) {
					tPoints[j].setLowerBound (sum(-distance[j][0],O));
					tPoints[j].setUpperBound (sum(distance[0][j],O));
				}
			}
		}
		return true;	
	}
291435
@Override
  public void getTransform(Matrix transform) {
    getParentTransform(transform);
    // IMPORTANT: {@code configureBounds} should be called after {@code getParentTransform},
    // because the parent may have to change our bounds.
    configureBoundsIfUnderlyingChanged();
    if (mDrawMatrix != null) {
      transform.preConcat(mDrawMatrix);
    }
  }
1353687
public static AffineTransform createScreenTransform(Rectangle2D userBounds, Rectangle2D screenBounds, boolean keepAspectRatio)
    {
        return createScreenTransform(userBounds, screenBounds, keepAspectRatio, new AffineTransform());
    }
141490
public static <T> T[] copyOfRange(final T[] original, final int from, final int to, final int step) {
        return copyOfRange(original, from, to, step, (Class<T[]>) original.getClass());
    }
285226
private boolean cCreate(Bounds[] in, int[] from, int[] to) {
		long[] old_d = new long[in.length];
		long[] old_D = new long[in.length];
		boolean[] added = new boolean[in.length];
		for (int i = 0; i < added.length; i++) added[i] = false;
		boolean rollback = false;
		int rollBackPoint = -1;

		for (int i = 0; i < in.length; i++) {
			//Conversion
			long min = in[i].min;
			long max = in[i].max;
			if (in[i].max == APSPSolver.INF) max = H-O;
			if (in[i].min == -APSPSolver.INF) min = -1 * (H - O);
			in[i] = new Bounds(min,max);
			//Checks
			if (in[i].min > in[i].max) { rollback = true; rollBackPoint = i; break; /*return false;*/ }
			if (from[i] == to[i]) { rollback = true; rollBackPoint = i; break; /*return false;*/ }

			SimpleDistanceConstraint con = tPoints[from[i]].getOut(to[i]);
			if (con != null) {
				//Already existing edge
				//check intersection between active con and new con
				//added[i] = false;
				if ( (con.getMinimum() > in[i].max) || (con.getMaximum() < in[i].min) ) { rollback = true; rollBackPoint = i; break; /*return false;*/ }
				//Update active con
				old_d[i] = con.getMinimum();
				old_D[i] = con.getMaximum();
				if (con.getMinimum() < in[i].min) con.setMinimum(in[i].min);
				if (con.getMaximum() > in[i].max) con.setMaximum(in[i].max);
			} 
			else {          
				//Non-existing arc
				//Adding tentative constraint
				added[i] = true;
				con = new SimpleDistanceConstraint();
				con.setFrom(this.getVariable(from[i]));
				con.setTo(this.getVariable(to[i]));
				con.setMinimum(in[i].min);
				con.setMaximum(in[i].max);
				con.addInterval(new Bounds(in[i].min,in[i].max));
				tPoints[from[i]].setOut(to[i], con);
			}
		}

		if (rollback) {
			for (int i = rollBackPoint-1; i >= 0; i--) {
				SimpleDistanceConstraint con = tPoints[from[i]].getOut(to[i]);
				if (!added[i]) {
					//Rollback in case of already existing edge
					con.setMinimum(old_d[i]);
					con.setMaximum(old_D[i]);
				}
				else {
					//Rollback in case of new edge
					con.removeInterval(in[i]);
					tPoints[from[i]].setOut(to[i], null);
				}
			}
			return false;
		}

		if (backupDMatrixSimple) saveDMatrixInternal();
		if (!this.fromScratchDistanceMatrixComputation()) {
			if (backupDMatrixSimple) restoreDMatrixInternal();
			return false;
		}
		
		//Ok update
		for (int i = in.length-1; i >= 0; i--) {
			if (!added[i]) {
				SimpleDistanceConstraint con = tPoints[from[i]].getOut(to[i]);
				con.addInterval(in[i]);
			}
		}

		//[lb,ub] = [-di0,d0i]
		for (int j = 0; j < MAX_USED+1; j++)
			if (tPoints[j].isUsed() == true) {
				tPoints[j].setLowerBound(sum(-distance[j][0],O));
				tPoints[j].setUpperBound(sum(distance[0][j],O));
			}
		
		return true;    
	}
1180877
public static long max(LongTuple t)
    {
        return LongTupleFunctions.reduce(
            t, Long.MIN_VALUE, Math::max);
    }
810201
public static <T, U> T[] copyOfRange(final U[] original, final int from, final int to, final Class<? extends T[]> newType) {
        final int newLength = to - from;
        final T[] copy = Object[].class.equals(newType) ? (T[]) new Object[newLength] : (T[]) N.newArray(newType.getComponentType(), newLength);
        copy(original, from, copy, 0, Math.min(original.length - from, newLength));
        return copy;
    }
1343403
private <T> Collection<Integer> transformSource(SourceTransformation<T> source) {
		String slotSharingGroup = determineSlotSharingGroup(source.getSlotSharingGroup(), Collections.emptyList());

		streamGraph.addSource(source.getId(),
				slotSharingGroup,
				source.getCoLocationGroupKey(),
				source.getOperator(),
				null,
				source.getOutputType(),
				"Source: " + source.getName());
		if (source.getOperator().getUserFunction() instanceof InputFormatSourceFunction) {
			InputFormatSourceFunction<T> fs = (InputFormatSourceFunction<T>) source.getOperator().getUserFunction();
			streamGraph.setInputFormat(source.getId(), fs.getFormat());
		}
		streamGraph.setParallelism(source.getId(), source.getParallelism());
		streamGraph.setMaxParallelism(source.getId(), source.getMaxParallelism());
		return Collections.singleton(source.getId());
	}
1145838
public static <T> Observable.Transformer<T,ImmutableList<T>> toImmutableList() {
        return new Observable.Transformer<T, ImmutableList<T>>() {
            @Override
            public Observable<ImmutableList<T>> call(Observable<T> source) {
                return source.collect(new Func0<ImmutableList.Builder<T>>() {
                    @Override
                    public ImmutableList.Builder<T> call() {
                        return ImmutableList.builder();
                    }
                }, new Action2<ImmutableList.Builder<T>, T>() {
                    @Override
                    public void call(ImmutableList.Builder<T> builder, T t) {
                        builder.add(t);
                    }
                })
                .map(new Func1<ImmutableList.Builder<T>, ImmutableList<T>>() {
                    @Override
                    public ImmutableList<T> call(ImmutableList.Builder<T> builder) {
                        return builder.build();
                    }
                });
            }
        };
    }
856714
public static long min(LongTuple t)
    {
        return LongTupleFunctions.reduce(
            t, Long.MAX_VALUE, Math::min);
    }
1199377
private Rectangle2D transformedBounds(Shape shape) {
        Rectangle2D rectangle2D = shape.getBounds2D();
        Point2D minPoint = new Point2D.Double(rectangle2D.getMinX(), rectangle2D.getMinY());
        Point2D maxPoint = new Point2D.Double(rectangle2D.getMaxX(), rectangle2D.getMaxY());

        transform.transform(minPoint, minPoint);
        transform.transform(maxPoint, maxPoint);

        // may be flipped by transformation
        double minX = Math.min(minPoint.getX(), maxPoint.getX());
        double maxX = Math.max(minPoint.getX(), maxPoint.getX());
        double minY = Math.min(minPoint.getY(), maxPoint.getY());
        double maxY = Math.max(minPoint.getY(), maxPoint.getY());

        return new Rectangle2D.Double(minX, minY, maxX - minX, maxY - minY);
    }
787514
def _transformBy(self, matrix, **kwargs):
        
        t = transform.Transform(*matrix)
        transformation = t.transform(self.transformation)
        self.transformation = tuple(transformation)
419368
private org.geomajas.geometry.Bbox toBbox(Bbox bounds) {
		return new org.geomajas.geometry.Bbox(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
	}