Creates a zero {@link Vector} of the given {@code length}.
330017
public static Vector zero(int length) {
        return length > 1000 ? SparseVector.zero(length) : DenseVector.zero(length);
    }
909039
public static GrowQueue_I8 zeros( int length ) {
		GrowQueue_I8 out = new GrowQueue_I8(length);
		out.size = length;
		return out;
	}
1202745
public static GrowQueue_F64 zeros( int length ) {
		GrowQueue_F64 out = new GrowQueue_F64(length);
		out.size = length;
		return out;
	}
1123155
public Object readLengthList(AbstractHessianInput in, int length)
        throws IOException
    {
        Object[] data = createArray(length);

        in.addRef(data);

        if (_componentType != null) {
            for (int i = 0; i < data.length; i++)
                data[i] = in.readObject(_componentType);
        }
        else {
            for (int i = 0; i < data.length; i++)
                data[i] = in.readObject();
        }

        return data;
    }
1206140
public static DenseVector fromMap(Map<Integer, ? extends Number> map, int length) {
        return Vector.fromMap(map, length).to(Vectors.DENSE);
    }
266240
public static String supplyZero(final String str, final int size) {
        
        if(str == null) {
            return "";
        }
        final int length = str.length();
        if(length > size) {
            return str;
        }
        
        StringBuilder sb = new StringBuilder();
        final int appendSize = size - length;
        for(int i=0; i < appendSize; i++) {
            sb.append("0");
        }
        sb.append(str);
        
        return sb.toString();
        
    }
917481
public Vector sub(Vector b) {
        if ((b == null) || (size != b.size)) return null;

        int i;
        Vector result = new Vector(size);
        for (i = 0; i < size; i++)
            result.vector[i] = vector[i] - b.vector[i];
        return result;
    }
193549
def zero_extend(self, new_length):
        
        si = self.copy()
        si._bits = new_length

        return si
1358333
public static byte[] integerToBytes(BigInteger s, int length) {
      byte[] bytes = s.toByteArray();
      if (length < bytes.length) {
         // The length is smaller than the byte representation. Truncate by
         // copying over the least significant bytes
         byte[] tmp = new byte[length];
         System.arraycopy(bytes, bytes.length - tmp.length, tmp, 0, tmp.length);
         return tmp;
      } else if (length > bytes.length) {
         // The length is larger than the byte representation. Copy over all
         // bytes and leave it prefixed by zeros.
         byte[] tmp = new byte[length];
         System.arraycopy(bytes, 0, tmp, tmp.length - bytes.length, bytes.length);
         return tmp;
      }
      return bytes;
   }
1344331
public static byte[] copyOf(byte[] src, int length) {
        byte[] dest = new byte[length];
        System.arraycopy(src, 0, dest, 0, Math.min(src.length, length));
        return dest;
    }
578114
public static IntTuple zero(int size)
    {
        if (size >= 0 && size < ZERO_POOL_SIZE)
        {
            return ZEROS[size];
        }
        return createZero(size);
    }
132261
public Scriptable newArray(Scriptable scope, int length)
    {
        NativeArray result = new NativeArray(length);
        ScriptRuntime.setBuiltinProtoAndParent(result, scope,
                TopLevel.Builtins.Array);
        return result;
    }
142024
public function zeroNumber($number = 0, $length = 5)
    {
        $no = '';
        if (strlen($number) < $length) {
            for ($i = strlen($number); $i < $length; $i++) {
                $no .= '0';
            }
        }

        $no .= $number;
        return $no;
    }
1113379
public Vector slice(int from, int until) {
        if (until - from < 0) {
            fail("Wrong slice range: [" + from + ".." + until + "].");
        }

        Vector result = blankOfLength(until - from);

        for (int i = from; i < until; i++) {
            result.set(i - from, get(i));
        }

        return result;
    }
876271
public Vector<Graph<UserStub>> generateAllNodeDataTypeGraphCombinationsOfMaxLength(int length) {
        Vector<Graph<UserStub>> graphs = super.generateAllNodeDataTypeGraphCombinationsOfMaxLength(length);

        if (WRITE_STRUCTURES_IN_PARALLEL) {
            // Left as an exercise to the student.
            throw new NotImplementedError();
        } else {
            int i = 0;
            for (Iterator<Graph<UserStub>> iter = graphs.toIterator(); iter.hasNext();) {
                Graph<UserStub> graph = iter.next();
                graph.setGraphId("S_" + ++i + "_" + graph.allNodes().size());
                graph.writeDotFile(outDir + graph.graphId() + ".gv", false, ALSO_WRITE_AS_PNG);
            }
            System.out.println("Wrote " + i + " graph files in DOT format to " + outDir + "");
        }

        return graphs;
    }
758956
public static byte[] encodeLength(int length, int offset) {
        if (length < SIZE_THRESHOLD) {
            byte firstByte = (byte) (length + offset);
            return new byte[] { firstByte };
        } else if (length < MAX_ITEM_LENGTH) {
            byte[] binaryLength;
            if (length > 0xFF)
                binaryLength = intToBytesNoLeadZeroes(length);
            else
                binaryLength = new byte[] { (byte) length };
            byte firstByte = (byte) (binaryLength.length + offset + SIZE_THRESHOLD - 1);
            return concatenate(new byte[] { firstByte }, binaryLength);
        } else {
            throw new RuntimeException("Input too long");
        }
    }
1075294
def zero_pad(matrix, to_length):
    

    assert matrix.shape[0] <= to_length
    if not matrix.shape[0] <= to_length:
        logger.error("zero_pad cannot be performed on matrix with shape {}"
                     " to length {}".format(matrix.shape[0], to_length))
        raise ValueError
    result = np.zeros((to_length,) + matrix.shape[1:])
    result[:matrix.shape[0]] = matrix
    return result