private Class[] types(int[] dims, Class basetype) {
			int i = 0;
			while (dims[i] > -1) {
				i++;
			}
			if (debug) {
				System.out.println(" rank " + i);
			}
			Class[] c = new Class[i];
			c[i - 1] = basetype;
			while (--i > 0) {
				c[i - 1] = Array.newInstance(c[i], 0).getClass();
			}
			if (debug) {
				System.out.println("Types " + java.util.Arrays.toString(c));
			}
			return c;
		}