Hlavni update metoda.
        Cinny kod pro gaussovske filtrovani, prahovani, binarni uzavreni a
        otevreni a vraceni nejvetsich nebo oznacenych objektu.
359284
def updateImage(self, val):
        

        # import ipdb
        # ipdb.set_trace()

        # Filtrovani

        # Zjisteni jakou sigmu pouzit
        if(self.firstRun == True and self.inputSigma >= 0):
            sigma = np.round(self.inputSigma, 2)
        elif self.interactivity:
            sigma = np.round(self.ssigma.val, 2)
        else:
            sigma = np.round(self.inputSigma, 2)


        # Prahovani (smin, smax)

        # max_threshold = self.threshold_upper
        # min_threshold = self.threshold

        if self.interactivity:

            self.smin.val = (np.round(self.smin.val, 2))
            self.smin.valtext.set_text('{}'.format(self.smin.val))
            self.smax.val = (np.round(self.smax.val, 2))
            self.smax.valtext.set_text('{}'.format(self.smax.val))

            self.threshold = self.smin.val
            self.threshold_upper = self.smax.val

            closeNum = int(np.round(self.sclose.val, 0))
            openNum = int(np.round(self.sopen.val, 0))
            self.sclose.valtext.set_text('{}'.format(closeNum))
            self.sopen.valtext.set_text('{}'.format(openNum))

        else:

            closeNum = self.ICBinaryClosingIterations
            openNum = self.ICBinaryOpeningIterations

        # make_image_processing(sigma, min_threshold, max_threshold, closeNum, openNum, auto_method=self.)
        self.imgFiltering, self.threshold = make_image_processing(data=self.data, voxelsize_mm=self.voxelsize_mm,
                                                                  seeds=self.seeds, sigma_mm=sigma,
                                                                  min_threshold=self.threshold,
                                                                  max_threshold=self.threshold_upper, closeNum=closeNum,
                                                                  openNum=openNum,
                                                                  min_threshold_auto_method=self.auto_method,
                                                                  fill_holes=self.fillHoles,
                                                                  get_priority_objects=self.get_priority_objects,
                                                                  nObj=self.nObj)
        # Vykresleni dat
        if (self.interactivity == True):
            self.drawVisualization()

        # Nastaveni kontrolnich hodnot
        self.firstRun = False

        garbage.collect()

        self.debugInfo()
262112
public function updateDB()
    {
        if (($fileName = $this->getArchive()) === false) {
            throw new Exception('Ошибка загрузки архива.');
        }
        $zip = new \ZipArchive;
        if ($zip->open($fileName) !== true) {
            @unlink($fileName);
            throw new Exception('Ошибка распаковки.');
        }

        $this->generateIpTable($zip);
        $this->generateCityTables($zip);
        $zip->close();
        @unlink($fileName);
    }
740935
def update(self, pointvol):
        """"""

        # Initialize a K-D Tree to assist nearest neighbor searches.
        if self.use_kdtree:
            kdtree = spatial.KDTree(self.live_u)
        else:
            kdtree = None

        # Check if we should use the provided pool for updating.
        if self.use_pool_update:
            pool = self.pool
        else:
            pool = None

        # Update the N-spheres.
        self.radfriends.update(self.live_u, pointvol=pointvol,
                               rstate=self.rstate, bootstrap=self.bootstrap,
                               pool=pool, kdtree=kdtree)
        if self.enlarge != 1.:
            self.radfriends.scale_to_vol(self.radfriends.vol_ball *
                                         self.enlarge)

        return copy.deepcopy(self.radfriends)
318076
@Override
  public void evaluate(DoubleSolution solution) {

    int hi=0;
    double [] fx = new double[getNumberOfObjectives()] ; // functions

    EBEsElementsTopology(solution); // transforma geometria a caracterÃƒÂ­sticas mecÃƒÂ¡nicas

    EBEsCalculus(); //  metodo matricial de la rigidez para estructuras espaciales (3D)

    // START OBJETIVES FUNCTION
    for(int j=0; j<getNumberOfObjectives(); j++)
    {
      // total weight
      if(OF_[j].equals("W"))
      {
        // START structure total weight ---------------------
        fx[j]=0.0;
        for(int ba=0; ba<numberOfElements_; ba++){
          int idx =(int)Element_[ba][INDEX_];
          fx[j]+=Groups_[idx][AREA]*Element_[ba][L_]*Groups_[idx][SPECIFIC_WEIGHT];
        }
        solution.setObjective(j, fx[j]);
        // END minimizing structure total weight ------------------------
      }
      // summation of deformations
      else if(OF_[j].equals("D"))
      {
        // START maximize displacement nodes ---------------------------------------------
        fx[j] = 0.0;
        for(int i=0;i<nodeCheck_.length;i++){
          double xn=DisplacementNodes_[numberOfLibertyDegree_ * (int)nodeCheck_[i][0]+aX_][hi];
          double yn=DisplacementNodes_[numberOfLibertyDegree_ * (int)nodeCheck_[i][0]+aY_][hi];
          double zn=DisplacementNodes_[numberOfLibertyDegree_ * (int)nodeCheck_[i][0]+aZ_][hi];
          fx[j]+= Math.sqrt(Math.pow(xn,2.0)+Math.pow(yn,2.0)+Math.pow(zn,2.0));
        }
        solution.setObjective(j, fx[j]);
        // END minimizing sum of displacement in nodes ---------------------------------------------
      }
      // stress square absolute error
      else if(OF_[j].equals("SSAE"))
      {
        // START strain residual minimun ---------------------------------------------
        // strain residualt global
        fx[j]=StrainResidualMin_[hi]+StrainResidualMax_[hi];
        solution.setObjective(j, fx[j]);
        // END strain residual minimun ---------------------------------------------
      }
      // Efficiency of Nash-Sutcliffe for stress and compress
      else if(OF_[j].equals("ENS"))
      {
        fx[j]=FunctionENS(0);
        solution.setObjective(j, fx[j]);
      }
      else if(OF_[j].equals("MDV"))
      {
        fx[j]=FunctionsMahalanobis_Distance_With_Variance(0);
        solution.setObjective(j, fx[j]);
      }
      else
      {
        System.out.println("Error: not considerate START OBJECTIVES FUNCTION ");
      }
    }

    numberOfEval_++;

    //if((numberOfEval_ % 1000) == 0) System.out.println(numberOfEval_);

    //  END OBJETIVES FUNCTION

    // maximizing the function objective ------------------------
    // fx[1] *= -1.0;



    // NOT USED -----------------------------------
/*
    double l=0; // longitud total de todos los elementos
    // total deflection of estructure
    fx[1]=0;
    for(int ba=0; ba<numberOfElements_; ba++){
        l+=Element_[ba][L_];
        int ni = (int)Element_[ba][i_];
        int nj = (int)Element_[ba][j_];
        double dxi=DisplacementNodes_[numberOfLibertyDegree_*ni+aX_][hi];
        double dyi=DisplacementNodes_[numberOfLibertyDegree_*ni+aY_][hi];
        double dzi=DisplacementNodes_[numberOfLibertyDegree_*ni+aZ_][hi];
        double dxj=DisplacementNodes_[numberOfLibertyDegree_*nj+aX_][hi];
        double dyj=DisplacementNodes_[numberOfLibertyDegree_*nj+aY_][hi];
        double dzj=DisplacementNodes_[numberOfLibertyDegree_*nj+aZ_][hi];
        // fx[1]+=Math.sqrt(Math.pow((dxi-dxj), 2.0)+Math.pow((dyi-dyj), 2.0)+Math.pow((dzi-dzj), 2.0))/l;
        fx[1]+=(-dxi+dxj)/l;
    }
*/
    // END NOT USED ------------------------------------------------------------------------------

    this.evaluateConstraints(solution);
  }
249814
public function insertProduct($hash, $pid, $price, $params=[], $count=1)
    {
        // Если этот товар еще не в корзине
        if(!$this->isProductInBasket($hash)) {
            $basketProduct = new static;
            $basketProduct->id_user = $this->idUser;
            $basketProduct->storage = $this->owner->storageName;
            $basketProduct->id_product = $pid;
            $basketProduct->hash_product = $hash;
            $basketProduct->count = $count;
            $basketProduct->price = $price;
            $basketProduct->params = Json::encode($params);
            $basketProduct->created_at = time();
            $basketProduct->updated_at = time();

            $basketProduct->save();
        } else {
            $basketProduct = $this->findOne([
                'id_user' => $this->idUser,
                'hash_product' => $hash,
                'storage' => $this->owner->storageName
            ]);

            // Если модель не найдена, генерим Exception
            if(is_null($basketProduct)) {
                throw new HttpException(404, 'Model not found');
            }

            // Если кол-во == 0, то удаляем из корзины
            if(0<$count) {
                $basketProduct->count = $count;
                $basketProduct->price = $price;
                $basketProduct->save();
            } else {
                $basketProduct->delete();
            }
        }

        // После изменения товара в корзине, нужно обновить наш кеш
        $this->owner->cache = $this->getBasketProducts();

        return [
            'global' => [
                'count' => Yii::$app->formatter->asInteger($this->getBasketCount()),
                'total' => Yii::$app->formatter->asInteger($this->getBasketTotal()),
                'cost'  => Yii::$app->formatter->asCurrency($this->getBasketCost()),
            ],
            'current' => [
                'price' => Yii::$app->formatter->asCurrency($price),
                'count' => $count,
                'cost' => Yii::$app->formatter->asCurrency($price*$count),
            ],
            'result' => $this->isProductInBasket($hash)
        ];
    }
1148979
def _updateB(oldB, B, W, degrees, damping, inds, backinds):  # pragma: no cover
  ''''''
  for j,d in enumerate(degrees):
    kk = inds[j]
    bk = backinds[j]

    if d == 0:
      B[kk,bk] = -np.inf
      continue

    belief = W[kk,bk] + W[j]
    oldBj = oldB[j]
    if d == oldBj.shape[0]:
      bth = quickselect(-oldBj, d-1)
      bplus = -1
    else:
      bth,bplus = quickselect(-oldBj, d-1, d)

    belief -= np.where(oldBj >= oldBj[bth], oldBj[bplus], oldBj[bth])
    B[kk,bk] = damping*belief + (1-damping)*oldB[kk,bk]
1237858
def cublasStbmv(handle, uplo, trans, diag, n, k, A, lda, x, incx):
    
    
    status = _libcublas.cublasStbmv_v2(handle, 
                                       _CUBLAS_FILL_MODE[uplo], 
                                       _CUBLAS_OP[trans], 
                                       _CUBLAS_DIAG[diag], 
                                       n, k, int(A), lda, int(x), incx)
    cublasCheckStatus(status)
436528
def update(self, es, function_values, **kwargs):
        
        # TODO: on the linear function, the two mirrored samples lead
        # to a sharp increase of condition of the covariance matrix.
        # They should not be used to update the covariance matrix,
        # if the step-size inreases quickly. This should be fine with
        # negative updates though.
        if not self.initialized:
            self.initialize(es.N, es.opts)
        if 1 < 3:
            # use the ranking difference of the mirrors for adaptation
            # damp = 5 should be fine
            z = np.where(es.fit.idx == 1)[0][0] - np.where(es.fit.idx == 0)[0][0]
            z /= es.popsize - 1  # z in [-1, 1]
        self.s = (1 - self.sp.c) * self.s + self.sp.c * np.sign(z) * np.abs(z)**self.sp.z_exponent
        if self.s > 0:
            es.sigma *= exp(self.s / self.sp.dampup)
        else:
            es.sigma *= exp(self.s / self.sp.dampdown)
105064
private void gaussNewton( double betas[] ) {

		A_temp.reshape(L_full.numRows, numControl);
		v_temp.reshape(L_full.numRows, 1);
		x.reshape(numControl,1,false);

		// don't check numControl inside in hope that the JVM can optimize the code better
		if( numControl == 4 ) {
			for( int i = 0; i < numIterations; i++ ) {
				UtilLepetitEPnP.jacobian_Control4(L_full,betas, A_temp);
				UtilLepetitEPnP.residuals_Control4(L_full,y,betas,v_temp.data);

				if( !solver.setA(A_temp) )
					return;

				solver.solve(v_temp,x);

				for( int j = 0; j < numControl; j++ ) {
					betas[j] -= x.data[j];
				}
			}
		} else {
			for( int i = 0; i < numIterations; i++ ) {
				UtilLepetitEPnP.jacobian_Control3(L_full,betas, A_temp);
				UtilLepetitEPnP.residuals_Control3(L_full,y,betas,v_temp.data);

				if( !solver.setA(A_temp) )
					return;

				solver.solve(v_temp,x);

				for( int j = 0; j < numControl; j++ ) {
					betas[j] -= x.data[j];
				}
			}
		}
	}
909632
function f_urun_teklif_kontrol(_tahta_id, _urun_id) {
        return result.dbQ.smembers(result.kp.urun.ssetTeklifleri(_tahta_id, _urun_id));
    }
1012270
def adupdates_simple(x, g, L, stepsize, inner_stepsizes, niter,
                     random=False):
    
    # Initializations
    length = len(g)
    ranges = [Li.range for Li in L]
    duals = [space.zero() for space in ranges]

    # Iteratively find a solution
    for _ in range(niter):
        # Update x = x - 1/stepsize * sum([ops[i].adjoint(duals[i])
        # for i in range(length)])
        for i in range(length):
            x -= (1.0 / stepsize) * L[i].adjoint(duals[i])

        rng = np.random.permutation(range(length)) if random else range(length)

        for j in rng:
            dual_tmp = ranges[j].element()
            dual_tmp = (g[j].convex_conj.proximal
                        (stepsize * inner_stepsizes[j]
                         if np.isscalar(inner_stepsizes[j])
                         else stepsize * np.asarray(inner_stepsizes[j]))
                        (duals[j] + stepsize * inner_stepsizes[j] * L[j](x)
                         if np.isscalar(inner_stepsizes[j])
                         else duals[j] + stepsize *
                         np.asarray(inner_stepsizes[j]) * L[j](x)))
            x -= 1.0 / stepsize * L[j].adjoint(dual_tmp - duals[j])
            duals[j].assign(dual_tmp)
614097
function diffusionUpdate () {
    var row, col, ind
    var dum = conv2(u, coeffs)
    for (row = 0; row < height; ++row)
      for (col = 0; col < width; ++col) {
        ind = row * width + col
        un[ind] = u[ind] +  c4 * dum[ind]
        u[ind] = un[ind] // new becomes current
      }
    return u
  }
129777
public function filesAction()
    {
        //formularz
        $form = new Form\ConnectorImportFilesForm;
        //formularz zapisany
        if ($form->isSaved()) {
            //przekazanie listy plików do downloadu
            $this->view->files = $form->getOption('data');
            //otwarcie sesji
            $session = new \Mmi\Session\SessionSpace(\Cms\Model\ConnectorModel::SESSION_SPACE);
            $this->view->downloadUrl = base64_encode($session->url);
        } else {
            //form do widoku
            $this->view->form = $form;
        }
    }
521521
def cublasSgbmv(handle, trans, m, n, kl, ku, alpha, A, lda,
                x, incx, beta, y, incy):
    

    status = _libcublas.cublasSgbmv_v2(handle,
                                       trans, m, n, kl, ku,
                                       ctypes.byref(ctypes.c_float(alpha)),
                                       int(A), lda,
                                       int(x), incx,
                                       ctypes.byref(ctypes.c_float(beta)),
                                       int(y), incy)
    cublasCheckStatus(status)
416220
def updateD_H(self, x):
        
        self.precompute(x)
        H = zeros((len(x), len(x)))
        Ai = zeros(self.A.shape[0])
        Aj = zeros(Ai.shape)
        for i in range(len(x)):
            Ai = self.A[:, i]
            ti = dot(self.AD, outer(self.R[:, i], Ai)) + dot(outer(Ai, self.R[i, :]), self.ADt)

            for j in range(i, len(x)):
                Aj = self.A[:, j]
                tj = outer(Ai, Aj)
                H[i, j] = (
                    self.E * (self.R[i, j] * tj + self.R[j, i] * tj.T) -
                    ti * (
                        dot(self.AD, outer(self.R[:, j], Aj)) +
                        dot(outer(Aj, self.R[j, :]), self.ADt)
                    )
                ).sum()
                H[j, i] = H[i, j]
        H *= -2
        e = eigvals(H).min()
        H = H + (eye(H.shape[0]) * e)
        return H
382572
function ecp_proj(R, N, p, l) {
	var x = N[0], y = N[1], z = N[2];
	var xr = R[0], yr = R[1], zr = R[2];
	var t0 = _ecp_t0, t1 = _ecp_t1, t2 = _ecp_t2;
	fp_mul(t2, t0, fp_sqr(t1, fp_inv(t0, z, p, l), p, l), p, l);
	fp_mul(xr, x, t1, p, l);
	fp_mul(yr, y, t2, p, l);
	mpn_zero(zr, l), zr[0] = 1;
	return R;
}
338344
public function updateSettings()
    {
        /*
         * Загрузка логотипа
         */
        if (isset($_FILES['logoImage']['tmp_name']) &&
            is_uploaded_file($_FILES['logoImage']['tmp_name']))
        {
            if (substr($_FILES['logoImage']['name'], -3) == 'png')
            {
                upload('logoImage', $this->getDataDir() .'/logo.png');
            }
            else
            {
                Eresus_Kernel::app()->getPage()
                    ->addErrorMessage('Логотип должен быть в формате PNG');
            }
        }

        try
        {
            $this->templates()->clientWrite('image-list.html', arg('tmplImageList'));
            $this->templates()->clientWrite('image-list.html', arg('tmplImageList'));
            $this->templates()->clientWrite('image-grouped-list.html', arg('tmplImageGroupedList'));
            $this->templates()->clientWrite('image.html', arg('tmplImage'));
            $this->templates()->clientWrite('popup.html', arg('tmplPopup'));
        }
        catch (Exception $e)
        {
            throw new RuntimeException(
                'Не удалось изменить один или несколько шаблонов. Подробная информация доступна в журнале.',
                0,
                $e);
        }

        parent::updateSettings();
    }