initialize the numpositive and the numnegative arrays
554103
void init() {
    numnegative = new int[numSamples() + 1];
    numpositive = new int[numSamples() + 1];
    numnegative[0] = 0;
    numpositive[0] = 0;
    int num = numSamples();
    for (int i = 1; i <= num; i++) {
      numnegative[i] = numnegative[i - 1] + (classes[i - 1] == 0 ? 1 : 0);
    }
    for (int i = 1; i <= num; i++) {
      numpositive[i] = numpositive[i - 1] + (classes[num - i] == 0 ? 0 : 1);
    }
    System.err.println("total positive " + numpositive[num] + " total negative " + numnegative[num] + " total " + num);
    for (int i = 1; i < numpositive.length; i++) {
      //System.out.println(i + " positive " + numpositive[i] + " negative " + numnegative[i] + " classes " + classes[i - 1] + " " + classes[num - i]);
    }
  }
369377
private void init() {
        writers.put(Boolean.class, new BooleanDataWriter());
        writers.put(Calendar.class, new CalendarDataWriter());
        writers.put(Date.class, new DateDataWriter());
        writers.put(Enum.class, new EnumDataWriter());
        writers.put(Number.class, new NumberDataWriter());
        writers.put(String.class, new StringDataWriter());
    }
1219146
def _init_lsr(n_items, alpha, initial_params):
    """"""
    if initial_params is None:
        weights = np.ones(n_items)
    else:
        weights = exp_transform(initial_params)
    chain = alpha * np.ones((n_items, n_items), dtype=float)
    return weights, chain
957455
public void init( double diag[] ,
                      double off[],
                      int numCols ) {
        reset(numCols);

        this.diag = diag;
        this.off = off;
    }
375691
protected void init() {
        for (int i = 0; i < config.getFilter().getInclusions().size(); i++) {
            inclusions.add(Pattern.compile(config.getFilter().getInclusions().get(i)).asPredicate());
        }
        for (int i = 0; i < config.getFilter().getExclusions().size(); i++) {
            exclusions.add(Pattern.compile(config.getFilter().getExclusions().get(i)).asPredicate());
        }
    }
1371695
@Override void init0() {
    _sums = MemoryManager.malloc8d(_nbin);
    _ssqs = MemoryManager.malloc8d(_nbin);
  }
1302397
def _init(self):
        
        if self.num_samples:
            assert len(self.realizations) == self.num_samples, (
                len(self.realizations), self.num_samples)
            for rlz in self.realizations:
                for k in rlz.weight.dic:
                    rlz.weight.dic[k] = 1. / self.num_samples
        else:
            tot_weight = sum(rlz.weight for rlz in self.realizations)
            if not tot_weight.is_one():
                # this may happen for rounding errors or because of the
                # logic tree reduction; we ensure the sum of the weights is 1
                for rlz in self.realizations:
                    rlz.weight = rlz.weight / tot_weight
164282
public function init()
    {
        $this->values      = Enum66::getValues();
        $this->enumerators = Enum66::getEnumerators();

        $this->emptySet = new EnumSet(Enum66::class);
        $this->fullSet  = new EnumSet(Enum66::class, $this->enumerators);
    }
216112
@Override
	public void initialize(double[] initial, int numberOfParameters, double minimumFunctionValue) {
		super.initialize(initial, numberOfParameters,minimumFunctionValue);
		y.reshape(numberOfParameters,1);

		xPrevious.reshape(numberOfParameters,1);
		x.reshape(numberOfParameters,1);

		// set the previous gradient to zero
		gradientPrevious.reshape(numberOfParameters,1);
		gradientPrevious.zero();

		firstIteration = true;
	}
1024055
def _initialize(cls):
    
    op_symbols = """
      + add radd pos
      - sub rsub neg
      * mul rmul
      / truediv rtruediv
      // floordiv rfloordiv
      % mod rmod
      ** pow rpow
      >> rshift rrshift
      << lshift rlshift
      ~ invert
      & and rand
      | or ror
      ^ xor rxor
      < lt
      <= le
      == eq
      != ne
      > gt
      >= ge
    """.strip().splitlines()
    if HAS_MATMUL:
      op_symbols.append("@ matmul rmatmul")
    for op_line in op_symbols:
      symbol, names = op_line.split(None, 1)
      for name in names.split():
        cls._insert(name, symbol)
517206
protected function initCounters()
    {
        $pos = 0;
        while ($pos < strlen($this->pattern)) {
            $char = $this->pattern[$pos];
            if ($char == "{") {
                $this->uriVars++;
                $pos++;
            } else if ($char == "*") {
                if (($pos + 1) < strlen($this->pattern) && $this->pattern[$pos + 1] == "*") {
                    $this->doubleWildcards++;
                    $pos += 2;
                } else if (!substr($this->pattern, $pos - 1) == ".*") {
                    $this->singleWildcards++;
                    $pos++;
                } else {
                    $pos++;
                }
            } else {
                $pos++;
            }
        }
    }
710203
private static void initialize()
	{
		for (int i = 0; i < 256; ++i)
		{
			long crc = i;
			for (int j = 8; j > 0; j--)
			{
				if ((crc & 1) == 1)
					crc = (crc >>> 1) ^ polynomial;
				else
					crc >>>= 1;
			}
			values[i] = crc;
		}
		init_done = true;
	}
42151
protected function initializeIterator()
    {
        $this->results = $this->getResults();
        $this->resultsCounter = \count($this->results);
    }
3332
private static function init()
    {
        $day = Calendar::getFirstWeekday();
        $day = $day == 0 ? 7 : $day;
        self::$weekStartsAt = $day;

        $days = self::$days;
        while (array_keys($days)[0] != $day) {
            $key = array_keys($days)[0];
            $value = $days[$key];
            unset($days[$key]);
            $days[$key] = $value;
        }

        self::$init = true;
    }
1145265
def _initialize_with_array(self, data, rowBased=True):
        """"""
        if rowBased:
            self.matrix = []
            if len(data) != self._rows:
                raise ValueError("Size of Matrix does not match")
            for col in xrange(self._columns):
                self.matrix.append([])
                for row in xrange(self._rows):
                    if len(data[row]) != self._columns:
                        raise ValueError("Size of Matrix does not match")
                    self.matrix[col].append(data[row][col])
        else:
            if len(data) != self._columns:
                raise ValueError("Size of Matrix does not match")
            for col in data:
                if len(col) != self._rows:
                    raise ValueError("Size of Matrix does not match")
            self.matrix = copy.deepcopy(data)
1117623
def init(self):
        ""

        self.length = 0L
        self.input = []

        # Load magic initialization constants.
        self.A = 0x67452301L
        self.B = 0xefcdab89L
        self.C = 0x98badcfeL
        self.D = 0x10325476L
1268934
private Node[][][] initialLattice(Instance inst) {
		int[][][] data = (int[][][]) inst.getData();
		length = inst.length();

		Node[][][] lattice = new Node[2][length][];
		for (int i = 0; i < length; i++) {
			lattice[0][i] = new Node[ysize[0]];
			for (int j = 0; j < ysize[0]; j++) {
				lattice[0][i][j] = new Node(ysize[0], ysize[1]);
			}
			initialClique(lattice[0][i], data[0][i], orders[0], ysize[0],
					ysize[1]);

			lattice[1][i] = new Node[ysize[1]];
			for (int j = 0; j < ysize[1]; j++) {
				lattice[1][i][j] = new Node(ysize[1], ysize[0]);
			}
			initialClique(lattice[1][i], data[1][i], orders[1], ysize[1],
					ysize[0]);
		}

		return lattice;
	}