Performs an efficient update of each columns' norm
170935
protected void updateNorms( int j ) {
        boolean foundNegative = false;
        for( int col = j; col < numCols; col++ ) {
            double e = dataQR[col][j-1];
            double v = normsCol[col] -= e*e;

            if( v < 0 ) {
                foundNegative = true;
                break;
            }
        }

        // if a negative sum has been found then clearly too much precision has been lost
        // and it should recompute the column norms from scratch
        if( foundNegative ) {
            for( int col = j; col < numCols; col++ ) {
                double u[] = dataQR[col];
                double actual = 0;
                for( int i=j; i < numRows; i++ ) {
                    double v = u[i];
                    actual += v*v;
                }
                normsCol[col] = actual;
            }
        }
    }
1141426
def update(self):
        

        s = self.extract()
        self.mean = s[2][0]

        self.gradient = None
        self.gradient_error = None
        self.gradient_relative_error = None
468358
def normalize(self):
        
        maximum = self.max()
        if maximum:
            self.values = [value / maximum for value in self.values]
154712
def update_from_stats(self, stats):
        """"""

        sd = dict(stats)

        for c in self.columns:

            if c not in sd:
                continue

            stat = sd[c]

            if stat.size and stat.size > c.size:
                c.size = stat.size

            c.lom = stat.lom
17701
def rebalance(self):
        

        # Compute norms along columns for each factor matrix
        norms = [sci.linalg.norm(f, axis=0) for f in self.factors]

        # Multiply norms across all modes
        lam = sci.multiply.reduce(norms) ** (1/self.ndim)

        # Update factors
        self.factors = [f * (lam / fn) for f, fn in zip(self.factors, norms)]
        return self
1046571
def _transform_col(self, x, col):
        

        return norm.ppf(self.ecdfs[col](x) * .998 + .001)
174544
def _write_avg_norm(self, norms:[])->None:
        ""
        avg_norm = sum(norms)/len(self.gradients)
        self._add_gradient_scalar('avg_norm', scalar_value=avg_norm)
100986
def norm(self):
        
        for (k, _) in self.entries.items():
            labelingLen = len(self.entries[k].labeling)
            self.entries[k].prText = self.entries[k].prText ** (1.0 / (labelingLen if labelingLen else 1.0))
186989
def update(data_df, cal_dict, param, bound, start, end):
    ''''''
    from collections import OrderedDict

    if param not in cal_dict['parameters']:
        cal_dict['parameters'][param] = OrderedDict()
    if bound not in cal_dict['parameters'][param]:
        cal_dict['parameters'][param][bound] = OrderedDict()

    cal_dict['parameters'][param][bound]['start'] = start
    cal_dict['parameters'][param][bound]['end']   = end

    return cal_dict
537326
def update_columns_dict(self, kwargs):
        
        super(Mesh, self).update_columns_dict(kwargs)

        # if kwargs.get('vnormals', None) is not None or kwargs.get('tnormals', None) is not None:
            # self._compute_mus()
        if kwargs.get('triangles', None) is not None:
            # reset visibilities and velocities so that they are reset
            # when next queried
            self.update_columns(visibilities=None, velocities=None)
251463
public function normalizeColumns()
	{
		$model_alias = $this->getAlias();
		$ret = array();

		foreach( $this->getColumns() as $descriptor )
		{
			$alias = $descriptor[0];
			if( $alias === $model_alias )
			{
				if( null === $descriptor[2] && $descriptor[1] === '*' )
				{
					foreach( array_keys($this->schemaColumnsGet()) as $column_name )
					{
						$ret []= array($alias, $column_name, null);
					}
				}
				else
				{
					$ret []= $descriptor;
				}
			}
			else
			{
				$ret []= $descriptor;
			}
		}

		$this->resetColumns( $ret );
	}
901846
function adjustColumnName( $columnIndex, $newColumnName )
    {
        $matrix = $this->attribute( 'matrix' );
        $columnDefinition = $matrix['columns']['sequential'][$columnIndex];
        if ( $columnDefinition['name'] != $newColumnName )
        {
            $this->setColumnName( $columnIndex, $newColumnName );
            return true;
        }
        return false;
    }
4560
def update(self, **kwargs):
        
        data = kwargs.get('data')
        if data is not None:
            if (util.pd and isinstance(data, util.pd.DataFrame) and
                list(data.columns) != list(self.data.columns) and self._index):
                data = data.reset_index()
            self.verify(data)
            kwargs['data'] = self._concat(data)
            self._count += 1
        super(Buffer, self).update(**kwargs)
613186
def update_dataframe(self, df, table, validate=False):
        """"""
        df = df.copy()
        recoded_columns = self.recode(table=table, validate=validate)
        return pd.concat([df, recoded_columns], axis=1)
1276306
def set_cols_width(self, array):
        

        self._check_row_size(array)
        try:
            array = map(int, array)
            if reduce(min, array) <= 0:
                raise ValueError
        except ValueError:
            sys.stderr.write("Wrong argument in column width specification\n")
            raise
        self._width = array
434682
def _updateA(X, A, R, P, Z, lmbdaA, orthogonalize):
    """"""
    n, rank = A.shape
    F = zeros((n, rank), dtype=A.dtype)
    E = zeros((rank, rank), dtype=A.dtype)

    AtA = dot(A.T, A)

    for i in range(len(X)):
        F += X[i].dot(dot(A, R[i].T)) + X[i].T.dot(dot(A, R[i]))
        E += dot(R[i], dot(AtA, R[i].T)) + dot(R[i].T, dot(AtA, R[i]))

    # regularization
    I = lmbdaA * eye(rank, dtype=A.dtype)

    # attributes
    for i in range(len(Z)):
        F += P[i].dot(Z[i].T)
        E += dot(Z[i], Z[i].T)

    # finally compute update for A
    A = solve(I + E.T, F.T).T
    return orth(A) if orthogonalize else A
138937
def normalize(v):
    ''''''
    if 0 == np.linalg.norm(v):
        return v
    return v / np.linalg.norm(v)