Given the set of betas it computes a new set of control points and adjust sthe scale
using the {@llin #matchScale} function.
5821
private void refine( double betas[] ) {
		for( int i = 0; i < numControl; i++ ) {
			double x=0,y=0,z=0;

			for( int j = 0; j < numControl; j++ ) {
				Point3D_F64 p = nullPts[j].get(i);
				x += betas[j]*p.x;
				y += betas[j]*p.y;
				z += betas[j]*p.z;
			}

			tempPts0.get(i).set(x,y,z);
		}

		double adj = matchScale(tempPts0,controlWorldPts);
		adj = adjustBetaSign(adj,tempPts0);

		for( int i = 0; i < 4; i++ ) {
			betas[i] *= adj;
		}
	}
208749
def update(self):
        """"""
        con = self.subpars.pars.control
        self(con.ypoints.shape[0])
687729
function adjustColumnWidths(allColumns, expectedWidth) {
    var columnsWidth = column_1.columnsTotalWidth(allColumns);
    var totalFlexGrow = getTotalFlexGrow(allColumns);
    var colsByGroup = column_1.columnsByPin(allColumns);
    if (columnsWidth !== expectedWidth) {
        scaleColumns(colsByGroup, expectedWidth, totalFlexGrow);
    }
}
90309
def adjust(numeral, round_up)
      check_base numeral
      point, digits = Flt::Support.adjust_digits(
        numeral.point, numeral.digits.digits_array,
        round_mode: @mode,
        negative: numeral.sign == -1,
        round_up: round_up,
        base: numeral.base
      )
      if numeral.zero? && simplifying?
        digits = []
        point = 0
      end
      normalization = simplifying? ? :exact : :approximate
      Numeral[digits, point: point, base: numeral.base, sign: numeral.sign, normalize: normalization]
    end
315414
def _adjust(hsl, attribute, percent):
    """"""
    hsl = list(hsl)
    if attribute > 0:
        hsl[attribute] = _clamp(hsl[attribute] + percent)
    else:
        hsl[attribute] += percent

    return hsl
887519
function buildScales() {
            const decidedRange = isReverse ? [chartWidth, 0] : [0, chartWidth];

            xScale = d3Scale.scaleLinear()
                .domain([0, Math.max(ranges[0], markers[0], measures[0])])
                .rangeRound(decidedRange)
                .nice();

            // Derive width scales from x scales
            barWidth = bulletWidth(xScale);

            // set up opacity scale based on ranges and measures
            rangeOpacityScale = ranges.map((d, i) => startMaxRangeOpacity - (i * rangeOpacifyDiff)).reverse();
            measureOpacityScale = ranges.map((d, i) => 0.9 - (i * measureOpacifyDiff)).reverse();

            // initialize range and measure bars and marker line colors
            rangeColor = colorSchema[0];
            measureColor = colorSchema[1];
        }
480845
public boolean refine(List<AssociatedTriple> listObs , DMatrixRMaj P2 , DMatrixRMaj P3 )
	{
		CommonOps_DDRM.setIdentity(P1);
		initializeStructure(listObs, P2, P3);

		if( scale ) {
			scaler.applyScale(structure,observations);
		}

//		sba.setVerbose(System.out,0);
		sba.setParameters(structure,observations);
		sba.configure(converge.ftol,converge.gtol,converge.maxIterations);

		if( !sba.optimize(structure) ) {
			return false;
		}

		// save the results
		P2.set(structure.views[1].worldToView);
		P3.set(structure.views[2].worldToView);

		if( scale ) {
			// don't use built in unscaling function because it undoes scaling on points. Those are disposable
			scaler.pixelScaling.get(1).remove(P2,P2);
			scaler.pixelScaling.get(2).remove(P3,P3);
		}

		return true;
	}
616082
private void setTargets(TrellisNode[][] trellis, double[] scaling, int[] label) {
        TrellisNode[] t0 = trellis[0];

        // Finding the normalizer for our first 'column' in the matrix
        double normalizer = 0.0;
        for (int i = 0; i < numClasses; i++) {
            normalizer += t0[i].expScores[0] * t0[i].beta;
        }

        for (int i = 0; i < numClasses; i++) {
            if (label[0] == i) {
                t0[i].target[0] = 1 - t0[i].expScores[0] * t0[i].beta / normalizer;
            } else {
                t0[i].target[0] = -t0[i].expScores[0] * t0[i].beta / normalizer;
            }
        }

        for (int t = 1; t < label.length; t++) {
            normalizer = 0.0;
            TrellisNode[] tt = trellis[t];
            TrellisNode[] tt1 = trellis[t-1];
            for (int i = 0; i < numClasses; i++) {
                normalizer += tt[i].alpha * tt[i].beta;
            }
            normalizer *= scaling[t];

            for (int i = 0; i < numClasses; i++) {
                TrellisNode tti = tt[i];
                for (int j = 0; j < numClasses; j++) {
                    if (label[t] == i && label[t - 1] == j) {
                        tti.target[j] = 1 - tti.expScores[j] * tt1[j].alpha * tti.beta / normalizer;
                    } else {
                        tti.target[j] = -tti.expScores[j] * tt1[j].alpha * tti.beta / normalizer;
                    }
                }
            }
        }
    }
14537
protected void estimateCase3_planar( double betas[] ) {
		relinearizeBeta.setNumberControl(3);
		relinearizeBeta.process(L_full,y,betas);

		refine(betas);
	}
199727
def _scale_y_values(self, values, new_min, new_max, scale_old_from_zero=True):
        '''
        
        '''
        # Scale Y values - Create a scaled list of values to use for the visual graph
        scaled_values = []
        y_min_value = min(values)
        if scale_old_from_zero:
            y_min_value = 0
        y_max_value = max(values)
        new_min = 0
        OldRange = (y_max_value - y_min_value) or 1  # Prevents division by zero if all values are the same
        NewRange = (new_max - new_min)  # max_height is new_max
        for old_value in values:
            new_value = (((old_value - y_min_value) * NewRange) / OldRange) + new_min
            scaled_values.append(new_value)
        return scaled_values
1006618
public void updateScale() {
        scaleX = targetPpiX / Gdx.graphics.getPpiX();
        scaleY = targetPpiY / Gdx.graphics.getPpiY();
    }
1229081
function scale(x, y) {
         return this._set(this.x * x, this.y * (typeof y !== "undefined" ? y : x));
       }
284075
public static void scale( double alpha , DMatrix4x4 a ) {
        a.a11 *= alpha; a.a12 *= alpha; a.a13 *= alpha; a.a14 *= alpha;
        a.a21 *= alpha; a.a22 *= alpha; a.a23 *= alpha; a.a24 *= alpha;
        a.a31 *= alpha; a.a32 *= alpha; a.a33 *= alpha; a.a34 *= alpha;
        a.a41 *= alpha; a.a42 *= alpha; a.a43 *= alpha; a.a44 *= alpha;
    }
595945
public void setScales(final double[] newScaleDenominators) {
        TreeSet<Double> sortedSet = new TreeSet<>(Collections.reverseOrder());
        for (final double newScaleDenominator: newScaleDenominators) {
            sortedSet.add(newScaleDenominator);
        }
        this.scaleDenominators = new double[sortedSet.size()];
        int i = 0;
        for (Double scaleDenominator: sortedSet) {
            this.scaleDenominators[i] = scaleDenominator;
            i++;
        }
    }
549488
def scale(self, selections, factor):
        '''

        '''
        if 'atoms' in selections:
            atms = selections['atoms'].mask
            if factor is None:
                    self.scale_factors[atms] = 1.0
            else:
                self.scale_factors[atms] = factor
    
        self.update_scale_factors(self.scale_factors)
1251716
def adjustButtons( self ):
        
        y = 1
        
        for btn in self.buttons():
            btn.setIconSize(self.iconSize())
            btn.setFixedSize(QSize(self.height() - 2, self.height() - 2))
        
        # adjust the location for the left buttons
        left_buttons = self._buttons.get(Qt.AlignLeft, [])
        x = (self.cornerRadius() / 2.0) + 2
        
        for btn in left_buttons:
            btn.move(x, y)
            x += btn.width()
        
        # adjust the location for the right buttons
        right_buttons = self._buttons.get(Qt.AlignRight, [])
        
        w       = self.width()
        bwidth  = sum([btn.width() for btn in right_buttons])
        bwidth  += (self.cornerRadius() / 2.0) + 1
        
        for btn in right_buttons:
            btn.move(w - bwidth, y)
            bwidth -= btn.width()
        
        self._buttonWidth = sum([btn.width() for btn in self.buttons()])
        self.adjustTextMargins()
1292340
public static void scale( double alpha , DMatrix2x2 a ) {
        a.a11 *= alpha; a.a12 *= alpha;
        a.a21 *= alpha; a.a22 *= alpha;
    }