public void setDim(int dim) throws ConnectException {
		int maxDim = dim;
		for (InputConnector ic : new InputConnector[] { pi, mi }) {
			if (ic.isConnected()) {
				if (dim != 0 && ic.getSource().getDim() != dim)
					throw new ConnectException(ic, dim);
				if (maxDim < ic.getDim())
					maxDim = ic.getDim();
			}
		}
		if (output.getDim() != maxDim) {
			output.setDim(maxDim);
			for (InputConnector ic : output.getConnected()) {
				ic.getParent().setDim(maxDim);
			}
		}
	}