:param phase_inc: amount of rotation applied for next clock cycle, must be normalized to -1 to 1.
        :rtype: Complex
514150
def main(self, phase_inc):
        
        self.phase_acc = self.phase_acc + phase_inc

        start_x = self.INIT_X
        start_y = Sfix(0.0, 0, -17)

        x, y, phase = self.cordic.main(start_x, start_y, self.phase_acc)

        self.out.real = x
        self.out.imag = y

        return self.out
1141557
def adjustPhase(self, adjustment):
        
        self.phase = self.phase._replace(val = self.phase.val + adjustment)
1263415
private int internalAwaitAdvance(int phase, QNode node) {
        // assert root == this;
        releaseWaiters(phase-1);          // ensure old queue clean
        boolean queued = false;           // true when node is enqueued
        int lastUnarrived = 0;            // to increase spins upon change
        int spins = SPINS_PER_ARRIVAL;
        long s;
        int p;
        while ((p = (int)((s = state) >>> PHASE_SHIFT)) == phase) {
            if (node == null) {           // spinning in noninterruptible mode
                int unarrived = (int)s & UNARRIVED_MASK;
                if (unarrived != lastUnarrived &&
                    (lastUnarrived = unarrived) < NCPU)
                    spins += SPINS_PER_ARRIVAL;
                boolean interrupted = Thread.interrupted();
                if (interrupted || --spins < 0) { // need node to record intr
                    node = new QNode(this, phase, false, false, 0L);
                    node.wasInterrupted = interrupted;
                }
            }
            else if (node.isReleasable()) // done or aborted
                break;
            else if (!queued) {           // push onto queue
                AtomicReference<QNode> head = (phase & 1) == 0 ? evenQ : oddQ;
                QNode q = node.next = head.get();
                if ((q == null || q.phase == phase) &&
                    (int)(state >>> PHASE_SHIFT) == phase) // avoid stale enq
                    queued = head.compareAndSet(q, node);
            }
            else {
                try {
                    ForkJoinPool.managedBlock(node);
                } catch (InterruptedException cantHappen) {
                    node.wasInterrupted = true;
                }
            }
        }

        if (node != null) {
            if (node.thread != null)
                node.thread = null;       // avoid need for unpark()
            if (node.wasInterrupted && !node.interruptible)
                Thread.currentThread().interrupt();
            if (p == phase && (p = (int)(state >>> PHASE_SHIFT)) == phase)
                return abortWait(phase); // possibly clean up on abort
        }
        releaseWaiters(phase);
        return p;
    }
591320
def transform_vector_coorb_to_inertial(vec_coorb, orbPhase, quat_copr):
    

    # Transform to coprecessing frame
    vec_copr = rotate_in_plane(vec_coorb, -orbPhase)

    # Transform to inertial frame
    vec = transformTimeDependentVector(np.array([quat_copr]).T,
        np.array([vec_copr]).T).T[0]

    return np.array(vec)
506778
def incr(**vars):
    
    for k, v in vars:
        current_context.vars.setdefault(k, 0)
        current_context[k] += v
913110
def rotateInDeclination(v1, theta_deg):
    """"""
    axis = np.array([0,-1,0])
    return rotateAroundVector(v1, axis, theta_deg)
258103
def _initSymbols(ptc):
    
    ptc.timeSep  = [ u':' ]
    ptc.dateSep  = [ u'/' ]
    ptc.meridian = [ u'AM', u'PM' ]

    ptc.usesMeridian = True
    ptc.uses24       = False

    if pyicu and ptc.usePyICU:
        am = u''
        pm = u''
        ts = ''

        # ICU doesn't seem to provide directly the
        # date or time seperator - so we have to
        # figure it out
        o = ptc.icu_tf['short']
        s = ptc.timeFormats['short']

        ptc.usesMeridian = u'a' in s
        ptc.uses24       = u'H' in s

        # '11:45 AM' or '11:45'
        s = o.format(datetime.datetime(2003, 10, 30, 11, 45))

        # ': AM' or ':'
        s = s.replace('11', '').replace('45', '')

        if len(s) > 0:
            ts = s[0]

        if ptc.usesMeridian:
            # '23:45 AM' or '23:45'
            am = s[1:].strip()
            s  = o.format(datetime.datetime(2003, 10, 30, 23, 45))

            if ptc.uses24:
                s = s.replace('23', '')
            else:
                s = s.replace('11', '')

            # 'PM' or ''
            pm = s.replace('45', '').replace(ts, '').strip()

        ptc.timeSep  = [ ts ]
        ptc.meridian = [ am, pm ]

        o = ptc.icu_df['short']
        s = o.format(datetime.datetime(2003, 10, 30, 11, 45))
        s = s.replace('10', '').replace('30', '').replace('03', '').replace('2003', '')

        if len(s) > 0:
            ds = s[0]
        else:
            ds = '/'

        ptc.dateSep = [ ds ]
        s           = ptc.dateFormats['short']
        l           = s.lower().split(ds)
        dp_order    = []

        for s in l:
            if len(s) > 0:
                dp_order.append(s[:1])

        ptc.dp_order = dp_order
    else:
        ptc.timeSep      = ptc.locale.timeSep
        ptc.dateSep      = ptc.locale.dateSep
        ptc.meridian     = ptc.locale.meridian
        ptc.usesMeridian = ptc.locale.usesMeridian
        ptc.uses24       = ptc.locale.uses24
        ptc.dp_order     = ptc.locale.dp_order

      # build am and pm lists to contain
      # original case, lowercase and first-char
      # versions of the meridian text

    if len(ptc.meridian) > 0:
        am     = ptc.meridian[0]
        ptc.am = [ am ]

        if len(am) > 0:
            ptc.am.append(am[0])
            am = am.lower()
            ptc.am.append(am)
            ptc.am.append(am[0])
    else:
        am     = ''
        ptc.am = [ '', '' ]

    if len(ptc.meridian) > 1:
        pm     = ptc.meridian[1]
        ptc.pm = [ pm ]

        if len(pm) > 0:
            ptc.pm.append(pm[0])
            pm = pm.lower()
            ptc.pm.append(pm)
            ptc.pm.append(pm[0])
    else:
        pm     = ''
        ptc.pm = [ '', '' ]
844173
def phase_type(self, value):
        ''''''
        self._params.phase_type = value
        self._overwrite_lock.disable()
1076179
def main(self, x, y, phase):
        
        self.initial_step(phase, x, y)

        # pipelined CORDIC
        for i in range(self.ITERATIONS - 1):
            if self.MODE == CordicMode.ROTATION:
                direction = self.phase[i] > 0
            elif self.MODE == CordicMode.VECTORING:
                direction = self.y[i] < 0

            if direction:
                self.x[i + 1] = self.x[i] - (self.y[i] >> i)
                self.y[i + 1] = self.y[i] + (self.x[i] >> i)
                self.phase[i + 1] = self.phase[i] - self.PHASE_LUT[i]
            else:
                self.x[i + 1] = self.x[i] + (self.y[i] >> i)
                self.y[i + 1] = self.y[i] - (self.x[i] >> i)
                self.phase[i + 1] = self.phase[i] + self.PHASE_LUT[i]

        return self.x[-1], self.y[-1], self.phase[-1]
28105
def set_phases(self, literals=[]):
        

        if self.minisat:
            pysolvers.minisatgh_setphases(self.minisat, literals)
228076
def _rotate(self, angles, dj_matrix):
        """"""
        # Note that the current method is EXTREMELY inefficient. The complex
        # coefficients are expanded onto real and imaginary grids, each of
        # the two components are rotated separately as real data, the rotated
        # real data are re-expanded on new real and complex grids, they are
        # combined to make a complex grid, and the resultant is expanded
        # in complex spherical harmonics.
        if dj_matrix is None:
            dj_matrix = _shtools.djpi2(self.lmax + 1)

        cgrid = self.expand(grid='DH')
        rgrid, igrid = cgrid.data.real, cgrid.data.imag
        rgridcoeffs = _shtools.SHExpandDH(rgrid, norm=1, sampling=1, csphase=1)
        igridcoeffs = _shtools.SHExpandDH(igrid, norm=1, sampling=1, csphase=1)

        rgridcoeffs_rot = _shtools.SHRotateRealCoef(
            rgridcoeffs, angles, dj_matrix)
        igridcoeffs_rot = _shtools.SHRotateRealCoef(
            igridcoeffs, angles, dj_matrix)

        rgrid_rot = _shtools.MakeGridDH(rgridcoeffs_rot, norm=1,
                                        sampling=1, csphase=1)
        igrid_rot = _shtools.MakeGridDH(igridcoeffs_rot, norm=1,
                                        sampling=1, csphase=1)
        grid_rot = rgrid_rot + 1j * igrid_rot

        if self.normalization == '4pi':
            norm = 1
        elif self.normalization == 'schmidt':
            norm = 2
        elif self.normalization == 'unnorm':
            norm = 3
        elif self.normalization == 'ortho':
            norm = 4
        else:
            raise ValueError(
                "Normalization must be '4pi', 'ortho', 'schmidt', or " +
                "'unnorm'. Input value was {:s}"
                .format(repr(self.normalization)))

        coeffs_rot = _shtools.SHExpandDHC(grid_rot, norm=norm,
                                          csphase=self.csphase)

        return SHCoeffs.from_array(coeffs_rot,
                                   normalization=self.normalization,
                                   csphase=self.csphase, copy=False)
1340720
def __cnc(cls, calib, we_c):
        
        if we_c is None:
            return None

        offset_v = calib.pid_elc_mv / 1000.0

        response_c = we_c - offset_v                # remove electronic zero
        cnc = response_c / calib.pid_sens_mv        # pid_sens_mv set for ppb or ppm - see PID.init()

        return cnc
319574
public void setPhaseId(int v) {
    if (ProcessingStep_Type.featOkTst && ((ProcessingStep_Type)jcasType).casFeat_phaseId == null)
      jcasType.jcas.throwFeatMissing("phaseId", "edu.cmu.lti.oaqa.framework.types.ProcessingStep");
    jcasType.ll_cas.ll_setIntValue(addr, ((ProcessingStep_Type)jcasType).casFeatCode_phaseId, v);}
955249
def inc(self):
        """"""
        self.lock.acquire()
        cur = self.counter
        self.counter += 1
        self.lock.release()
        return cur
403653
public static void multiplyComplex( ImageInterleaved complexA , ImageInterleaved complexB , ImageInterleaved complexC ) {
		if( complexB instanceof InterleavedF32 ) {
			DiscreteFourierTransformOps.multiplyComplex((InterleavedF32) complexA, (InterleavedF32) complexB, (InterleavedF32) complexC);
		} else if( complexB instanceof InterleavedF64 ) {
			DiscreteFourierTransformOps.multiplyComplex((InterleavedF64) complexA, (InterleavedF64) complexB, (InterleavedF64) complexC);
		} else {
			throw new IllegalArgumentException("Unknown image type");
		}
	}
730814
def set_phases(self, literals=[]):
        

        if self.maplesat:
            pysolvers.maplecm_setphases(self.maplesat, literals)
1155668
def phase_transformation(Ne, Nl, r, Lij, omega_laser, phase):
    

    """
    ph = find_phase_transformation(Ne, Nl, r, Lij)

    return {phase[i]: sum([ph[i][j]*omega_laser[j] for j in range(Nl)])
            for i in range(Ne)}