Update the map :math:`\pi` keeping the output :math:`g` fixed

        Use Eq. (7) and below in [GR04]_
327156
def _refit(self):
        
        # temporary variables for manipulation
        mu_diff = np.empty_like(self.f.components[0].mu)
        sigma   = np.empty_like(self.f.components[0].sigma)
        mean    = np.empty_like(mu_diff)
        cov     = np.empty_like(sigma)

        for j, c in enumerate(self.g.components):
            # stop if inv_map is empty for j-th comp.
            if not self.inv_map[j]:
                self.g.weights[j] = 0.
                continue

            # (re-)initialize new mean/cov to zero
            mean[:] = 0.0
            cov[:] = 0.0

            # compute total weight and mean
            self.g.weights[j] = self.f.weights[self.inv_map[j]].sum()
            for i in self.inv_map[j]:
                mean += self.f.weights[i] * self.f.components[i].mu

            # rescale by total weight
            mean /= self.g.weights[j]

            # update covariance
            for i in self.inv_map[j]:
                # mu_diff = mu'_j - mu_i
                mu_diff[:] = mean
                mu_diff -= self.f.components[i].mu

                # sigma = (mu'_j - mu_i) (mu'_j - mu_i)^T
                sigma[:] = np.outer(mu_diff, mu_diff)

                # sigma += sigma_i
                sigma += self.f.components[i].sigma

                # multiply with alpha_i
                sigma *= self.f.weights[i]

                # sigma_j += alpha_i * (sigma_i + (mu'_j - mu_i) (mu'_j - mu_i)^T
                cov += sigma

            # 1 / beta_j
            cov /= self.g.weights[j]

            # update the Mixture
            c.update(mean, cov)
1370679
def map(cls, latitudes, longitudes, labels=None, colors=None, areas=None, **kwargs):
        
        assert len(latitudes) == len(longitudes)
        assert areas is None or hasattr(cls, '_has_radius'), "A " + cls.__name__ + " has no radius"
        inputs = [latitudes, longitudes]
        if labels is not None:
            assert len(labels) == len(latitudes)
            inputs.append(labels)
        else:
            inputs.append(("",) * len(latitudes))
        if colors is not None:
            assert len(colors) == len(latitudes)
            inputs.append(colors)
        if areas is not None:
            assert len(areas) == len(latitudes)
            inputs.append(np.array(areas) ** 0.5 / math.pi)
        ms = [cls(*args, **kwargs) for args in zip(*inputs)]
        return Map(ms)
559865
def _update_Prxy_diag(self):
        """"""
        for r in range(self.nsites):
            pr_half = self.prx[r]**0.5
            pr_neghalf = self.prx[r]**-0.5
            #symm_pr = scipy.dot(scipy.diag(pr_half), scipy.dot(self.Prxy[r], scipy.diag(pr_neghalf)))
            symm_pr = (pr_half * (self.Prxy[r] * pr_neghalf).transpose()).transpose()
            # assert scipy.allclose(symm_pr, symm_pr.transpose())
            (evals, evecs) = scipy.linalg.eigh(symm_pr)
            # assert scipy.allclose(scipy.linalg.inv(evecs), evecs.transpose())
            # assert scipy.allclose(symm_pr, scipy.dot(evecs, scipy.dot(scipy.diag(evals), evecs.transpose())))
            self.D[r] = evals
            self.Ainv[r] = evecs.transpose() * pr_half
            self.A[r] = (pr_neghalf * evecs.transpose()).transpose()
429090
def update(d, e):
    """"""
    res = copy.copy(d)
    res.update(e)
    return res
577791
def _update_xyz(self, change):
        
        self.x,self.y,self.z = self.position.X(),self.position.Y(),self.position.Z()
821465
private void updateCompoundBounds(Glyph parent,List<Glyph> childGlyphs)
    {
        float PAD = (float) 2.0;
        float minX = Float.MAX_VALUE; float minY = Float.MAX_VALUE;
        float maxX = Float.MIN_VALUE; float maxY = Float.MIN_VALUE;

        for (Glyph tmpGlyph : childGlyphs)
        {
            if(!glyphClazzOneOf(tmpGlyph, GlyphClazz.UNIT_OF_INFORMATION, GlyphClazz.STATE_VARIABLE))
            {
                if(tmpGlyph.getGlyph().size() > 0)
                    updateCompoundBounds(tmpGlyph, tmpGlyph.getGlyph());

                float w = tmpGlyph.getBbox().getW();
                float h = tmpGlyph.getBbox().getH();

                // Verify MIN and MAX x/y again:
                minX = Math.min(minX, (tmpGlyph.getBbox().getX()));
                minY = Math.min(minY, (tmpGlyph.getBbox().getY()));
                maxX = Math.max(maxX, (tmpGlyph.getBbox().getX())+w);
                maxY = Math.max(maxY, (tmpGlyph.getBbox().getY())+h);

                if (minX == Float.MAX_VALUE) minX = 0;
                if (minY == Float.MAX_VALUE) minY = 0;
                if (maxX == Float.MIN_VALUE) maxX = 0;
                if (maxY == Float.MIN_VALUE) maxY = 0;

                parent.getBbox().setX(minX - PAD);
                parent.getBbox().setY(minY - PAD);
                parent.getBbox().setW(maxX -  parent.getBbox().getX() + PAD);
                parent.getBbox().setH(maxY -  parent.getBbox().getY() + PAD);
            }
        }
    }
1153938
def _update(self):
        '''
        
        '''
        self.decimal_degree = self._calc_decimaldegree(self.degree, self.minute, self.second)
        self.degree, self.minute, self.decimal_minute, self.second = self._calc_degreeminutes(self.decimal_degree)
979509
private synchronized void updateMetric(String value, Group group, Set<String>[] groupKeys, int index){
		group.update(value);
		if (index < groupKeys.length){
			for (String key : groupKeys[index]){
				Group subgroup = group.subgroup(key);
				updateMetric(value, subgroup, groupKeys, index + 1);
			}
		}
	}
142197
def pi (self, data):
        
        data = data.encode(self.encoding, "ignore")
        self.fd.write("<?%s?>" % data)
1247531
def update(self, mapping, prefix=""):
        
        for k, v in mapping.items():
            self.set("%s%s" % (prefix, k), v)
604244
def set(self, r, g, b, intensity=None):
        """"""
        self.r = r
        self.g = g
        self.b = b
        if intensity:
            self.intensity = intensity
1263571
private void update() {
        if (!predefinedPriori) {
            for (int c = 0; c < k; c++) {
                priori[c] = (nc[c] + EPSILON) / (n + k * EPSILON);
            }
        }

        if (model == Model.MULTINOMIAL || model == Model.POLYAURN) {
            for (int c = 0; c < k; c++) {
                for (int t = 0; t < p; t++) {
                    condprob[c][t] = (ntc[c][t] + sigma) / (nt[c] + sigma * p);
                }
            }
        } else {
            for (int c = 0; c < k; c++) {
                for (int t = 0; t < p; t++) {
                    condprob[c][t] = (ntc[c][t] + sigma) / (nc[c] + sigma * 2);
                }
            }
        }
    }
700102
def _map(value, istart, istop, ostart, ostop):
    
    return ostart + (ostop - ostart) * ((value - istart) / (istop - istart))
150248
function ecp_pubkey(Q, p, a, G, d, l) {
	var R = ecp_new(l);
	ecp_proj(Q, ecp_mul(R, d, G, a, p, l), p, l);
}
1013581
private void updateMovementVector() {
		dirX = (float) Math.sin(Math.toRadians(ang));
		dirY = (float) -Math.cos(Math.toRadians(ang));
	}
922125
function toLatLng()
	{
		$wgs84 = new ReferenceEllipsoid(ReferenceEllipsoid::WGS84_MAJ, ReferenceEllipsoid::WGS84_MIN);

		$UTM_F0	 = 0.9996;
		$a = $wgs84->maj;
		$eSquared = $wgs84->ecc;
		$ePrimeSquared = $eSquared / (1.0 - $eSquared);
		$e1 = (1 - sqrt(1 - $eSquared)) / (1 + sqrt(1 - $eSquared));

		$x = $this->easting - 500000.0;;
		$y = $this->northing;

		$zoneNumber = $this->lngZone;
		$zoneLetter = $this->latZone;

		$longitudeOrigin = ($zoneNumber - 1.0) * 6.0 - 180.0 + 3.0;

		// Correct y for southern hemisphere
		if ((ord($zoneLetter) - ord("N")) < 0) {
			$y -= 10000000.0;
		}

		$m = $y / $UTM_F0;

		$mu = $m
			/ ($a
			* (1.0
				- $eSquared / 4.0
				- 3.0 * $eSquared * $eSquared / 64.0
				- 5.0
				* pow($eSquared, 3.0)
				/ 256.0));

		$phi1Rad = $mu
			+ (3.0 * $e1 / 2.0 - 27.0 * pow($e1, 3.0) / 32.0) * sin(2.0 * $mu)
			+ (21.0 * $e1 * $e1 / 16.0 - 55.0 * pow($e1, 4.0) / 32.0)
			* sin(4.0 * $mu)
			+ (151.0 * pow($e1, 3.0) / 96.0) * sin(6.0 * $mu);

		$n = $a / sqrt(1.0 - $eSquared * sin($phi1Rad) * sin($phi1Rad));

		$t = tan($phi1Rad) * tan($phi1Rad);
		$c = $ePrimeSquared * cos($phi1Rad) * cos($phi1Rad);

		$r = $a
			* (1.0 - $eSquared)
			/ pow(
			1.0 - $eSquared * sin($phi1Rad) * sin($phi1Rad),
			1.5);

		$d = $x / ($n * $UTM_F0);

		$latitude = ($phi1Rad
			- ($n * tan($phi1Rad) / $r)
			* ($d * $d / 2.0
				- (5.0
				+ (3.0 * $t)
				+ (10.0 * $c)
				- (4.0 * $c * $c)
				- (9.0 * $ePrimeSquared))
				* pow($d, 4.0)
				/ 24.0
				+ (61.0
				+ (90.0 * $t)
				+ (298.0 * $c)
				+ (45.0 * $t * $t)
				- (252.0 * $ePrimeSquared)
				- (3.0 * $c * $c))
				* pow($d, 6.0)
				/ 720.0)) * (180.0 / pi());

		$longitude = $longitudeOrigin + (($d
			- (1.0 + 2.0 * $t + $c) * pow($d, 3.0) / 6.0
			+ (5.0
			- (2.0 * $c)
			+ (28.0 * $t)
			- (3.0 * $c * $c)
			+ (8.0 * $ePrimeSquared)
			+ (24.0 * $t * $t))
			* pow($d, 5.0)
			/ 120.0)
			/ cos($phi1Rad)) * (180.0 / pi());

		return new LatLng($latitude, $longitude);
	}
772899
def set_fg(self, r, g, b):
        
        self.img_fg = (r, g, b)
        self.redraw(whence=3)