Count the number of false negative support elements in
    m_hat in one triangle, not including the diagonal.
488753
def support_false_negative_count(m, m_hat):
    
    m_nnz, m_hat_nnz, intersection_nnz = _nonzero_intersection(m, m_hat)
    return int((m_nnz - intersection_nnz) / 2.0)
71052
public long countNNZ() {
        long count = 0;

        for (int i = 0; i < values.length(); i++) {
            int[] idx = getUnderlyingIndicesOf(i).asInt();
            boolean isIn = true;
            int idxNotFixed = 0;
            for (int dim = 0; dim < idx.length; dim++) {

                if (flags()[dim] == 1) {
                    if (sparseOffsets()[dim] != idx[dim]) {
                        isIn = false;
                        break;
                    }
                } else {
                    int lowerBound = sparseOffsets()[dim];
                    long upperBound = sparseOffsets()[dim] + shape()[idxNotFixed];
                    if (!(idx[dim] >= lowerBound && idx[dim] < upperBound)) {
                        isIn = false;
                        break;
                    }
                    idxNotFixed++;
                }
            }
            count = isIn ? count + 1 : count;
        }
        return count;
    }
132004
public T negative() {
        T A = copy();
        ops.changeSign(A.mat);
        return A;
    }
104758
public static void fe_neg(int[] h,int[] f)
{
  int f0 = f[0];
  int f1 = f[1];
  int f2 = f[2];
  int f3 = f[3];
  int f4 = f[4];
  int f5 = f[5];
  int f6 = f[6];
  int f7 = f[7];
  int f8 = f[8];
  int f9 = f[9];
  int h0 = -f0;
  int h1 = -f1;
  int h2 = -f2;
  int h3 = -f3;
  int h4 = -f4;
  int h5 = -f5;
  int h6 = -f6;
  int h7 = -f7;
  int h8 = -f8;
  int h9 = -f9;
  h[0] = (int)h0;
  h[1] = (int)h1;
  h[2] = (int)h2;
  h[3] = (int)h3;
  h[4] = (int)h4;
  h[5] = (int)h5;
  h[6] = (int)h6;
  h[7] = (int)h7;
  h[8] = (int)h8;
  h[9] = (int)h9;
}
1038238
def get_n_excluded_patches(self):
        
        base = self.get_patches_base()
        if not base:
            return 0
        p = base.rfind('+')
        if p == -1:
            return 0
        try:
            n = int(base[p+1:])
            return n
        except TypeError:
            return 0
1057102
def is_negative(pattern, flags):
    """"""

    if flags & MINUSNEGATE:
        return flags & NEGATE and pattern[0:1] in MINUS_NEGATIVE_SYM
    else:
        return flags & NEGATE and pattern[0:1] in NEGATIVE_SYM
811181
def divmod_neg(a, b):
    """"""
    q, r = divmod(a, b)
    # make sure r is close to zero
    sr = np.sign(r)
    if np.abs(r) > b/2:
        q += sr
        r -= b * sr
    return q, r
1359036
function calculateVertexCount() {

		var count = ( radialSegments + 1 ) * ( heightSegments + 1 );

		if ( openEnded === false ) {

			count += ( ( radialSegments + 1 ) * nbCap ) + ( radialSegments * nbCap );

		}

		return count;

	}
281035
def mag_pmf(matrix):
    
    nmags, ndists, nlons, nlats, neps = matrix.shape
    mag_pmf = numpy.zeros(nmags)
    for i in range(nmags):
        mag_pmf[i] = numpy.prod(
            [1. - matrix[i, j, k, l, m]
             for j in range(ndists)
             for k in range(nlons)
             for l in range(nlats)
             for m in range(neps)])
    return 1. - mag_pmf
1178634
def get_false_negative(self, scalar=True):
        """"""
        ans = pd.Series(PrettyDict([(k, safe_div(np.sum(self.loc[k]) - self[k][k],
                                                 np.sum(self.sum() - self.loc[k]))) for k in self.columns]))
        if (not self._scalar_stats and not scalar) or self._num_classes != 2:
            return ans
        return ans[self._pos_label]
908953
public Vector3f negate(Vector3f dest) {
        dest.x = -x;
        dest.y = -y;
        dest.z = -z;
        return dest;
    }
447159
def mask_negative(self):
        """"""
        self.mask = np.logical_and(self.mask, ~(self.intensity < 0))
623391
public static boolean hasNaN( DMatrixD1 m )
    {
        int length = m.getNumElements();

        for( int i = 0; i < length; i++ ) {
            if( Double.isNaN(m.get(i)))
                return true;
        }
        return false;
    }
815844
def get_vert_opposites_per_edge(mesh_v, mesh_f):
    """"""
    result = {}
    for f in mesh_f:
        for i in range(3):
            key = [f[i], f[(i+1)%3]]
            key.sort()
            key = tuple(key)
            val = f[(i+2)%3]

            if key in result:
                result[key].append(val)
            else:
                result[key] = [val]
    return result
596948
def count_mismatches(read):
    
    if read is False:
        return False
    mm = [int(i.split(':')[2]) for i in read[11:] if i.startswith('NM:i:')]
    if len(mm) > 0:
        return sum(mm)
    else:
        return False
328598
def calc_A_hat(A, S):
    ''''''
    return np.dot(S, np.dot(A, np.transpose(S)))
811556
def vert_opposites_per_edge(self):
        """"""
        result = {}
        for f in self.f:
            for i in range(3):
                key = [f[i], f[(i+1)%3]]
                key.sort()
                key = tuple(key)
                val = f[(i+2)%3]

                if key in result:
                    result[key].append(val)
                else:
                    result[key] = [val]
        return result