Evaluates OBV

        Args:
            curr: Dict of current volume and close
            prev: Dict of previous OBV and close

        Returns:
            Float of OBV
430086
def eval_algorithm(curr, prev):
        
        if curr['close'] > prev['close']:
            v = curr['volume']
        elif curr['close'] < prev['close']:
            v = curr['volume'] * -1
        else:
            v = 0
        return prev['obv'] + v
440575
def dump_previous(self, obj):
        """"""
        if self._is_child(obj) and obj.index(self.context['pid']) > 0:
            return self._dump_relative(obj.previous_child(self.context['pid']))
579107
def obfn_g0var(self):
        

        # Use of self.block_sep0(self.AXnr) instead of self.cnst_A0(self.X)
        # reduces number of calls to self.cnst_A0
        return self.var_y0() if self.opt['gEvalY'] else \
            self.block_sep0(self.AXnr)
1152058
public static boolean isEndOfChunk(LabelTagType prev, LabelTagType cur)
  {
    if (prev == null) return false;
    return isEndOfChunk(prev.tag, prev.type, cur.tag, cur.type);
  }
594543
public static int cusolverRfBatchResetValues(
        int batchSize, 
        int n, 
        int nnzA, 
        Pointer csrRowPtrA, 
        Pointer csrColIndA, 
        Pointer csrValA_array, 
        Pointer P, 
        Pointer Q, 
        /** Output */
        cusolverRfHandle handle)
    {
        return checkResult(cusolverRfBatchResetValuesNative(batchSize, n, nnzA, csrRowPtrA, csrColIndA, csrValA_array, P, Q, handle));
    }
49575
def volume(self) -> float:
        
        m = self._matrix
        return float(abs(dot(np.cross(m[0], m[1]), m[2])))
107534
def ROL(self, a):
        
        r = (a << 1) | self.C
        self.clear_NZVC()
        self.update_NZVC_8(a, a, r)
        return r
823653
def var(expr, **kw):
    

    ddof = kw.get('ddof', kw.get('_ddof', 1))

    output_type = _stats_type(expr)
    return _reduction(expr, Var, output_type, _ddof=ddof)
977177
def defValueFuncs(self):
        '''
        
        '''
        MPCnvrs      = self.MPC**(-self.CRRA/(1.0-self.CRRA))
        vFuncNvrs    = LinearInterp(np.array([self.mNrmMin, self.mNrmMin+1.0]),np.array([0.0, MPCnvrs]))
        self.vFunc   = ValueFunc(vFuncNvrs,self.CRRA)
        self.vPfunc  = MargValueFunc(self.cFunc,self.CRRA)
638577
def volume(self):
        
        volume = float(np.product(self.primitive.extents))
        return volume
662644
def eval_objfn(self):
        

        g0v = self.obfn_g0(self.obfn_g0var())
        g1v = self.obfn_g1(self.obfn_g1var())
        rgr = sl.rfl2norm2(np.sqrt(self.GHGf * np.conj(self.Xf) * self.Xf),
                           self.cri.Nv, self.cri.axisN)/2.0
        obj = g0v + self.lmbda*g1v + self.mu*rgr
        return (obj, g0v, g1v, rgr)
496693
def _nest_vars_in_rec(var_items, rec_items, input_order, items_by_key, parallel):
    
    num_items = var_items
    var_items = list(var_items)[0]
    if rec_items:
        rec_items = list(rec_items)[0]
        if ((rec_items == 1 and var_items > 1) or parallel.startswith("batch")):
            num_items = set([rec_items])
            for var_key in (k for (k, t) in input_order.items() if t != "record"):
                var_key = tuple(var_key.split("__"))
                items_by_key[var_key] = [items_by_key[var_key]] * rec_items
        else:
            assert var_items == rec_items, (var_items, rec_items)
    return items_by_key, num_items
25605
def eval_objfn(self):
        
        """

        gvr = self.obfn_gvar()
        dfd = np.sum(np.abs(self.Wdf * gvr))
        reg = 0.5*np.linalg.norm(
            sl.idctii(self.Alpha*sl.dctii(self.X, axes=self.axes),
                      axes=self.axes))**2
        obj = dfd + self.lmbda*reg
        return (obj, dfd, reg)
219357
def eval_objfn(self):
        

        dfd = self.obfn_dfd()
        cns = self.obfn_cns()
        return (dfd, cns)
286836
public static int cusolverRfResetValues(
        int n, 
        int nnzA, 
        Pointer csrRowPtrA, 
        Pointer csrColIndA, 
        Pointer csrValA, 
        Pointer P, 
        Pointer Q, 
        /** Output */
        cusolverRfHandle handle)
    {
        return checkResult(cusolverRfResetValuesNative(n, nnzA, csrRowPtrA, csrColIndA, csrValA, P, Q, handle));
    }
588628
def getEmpTraitCorrCoef(self):
        
        cov = self.getEmpTraitCovar()
        stds=SP.sqrt(cov.diagonal())[:,SP.newaxis]
        RV = cov/stds/stds.T
        return RV
174690
def evaluate(mod, data_iter, epoch, log_interval):
    
    start = time.time()
    total_L = 0.0
    nbatch = 0
    density = 0
    mod.set_states(value=0)
    for batch in data_iter:
        mod.forward(batch, is_train=False)
        outputs = mod.get_outputs(merge_multi_context=False)
        states = outputs[:-1]
        total_L += outputs[-1][0]
        mod.set_states(states=states)
        nbatch += 1
        # don't include padding data in the test perplexity
        density += batch.data[1].mean()
        if (nbatch + 1) % log_interval == 0:
            logging.info("Eval batch %d loss : %.7f" % (nbatch, (total_L / density).asscalar()))
    data_iter.reset()
    loss = (total_L / density).asscalar()
    ppl = math.exp(loss) if loss < 100 else 1e37
    end = time.time()
    logging.info('Iter[%d]\t\t CE loss %.7f, ppl %.7f. Eval duration = %.2f seconds ' % \
                 (epoch, loss, ppl, end - start))
    return loss