Returns the log of the gamma of the inputVertex
    
    :param input_vertex: the vertex
558794
def LogGamma(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().LogGammaVertex, label, cast_to_double_vertex(input_vertex))
344967
def DFS(G):
    
    if not G.vertices:
        raise GraphInsertError("This graph have no vertices.")
    color = {}
    pred = {}
    reach = {}
    finish = {}

    def DFSvisit(G, current, time):
        color[current] = 'grey'
        time += 1
        reach[current] = time
        for vertex in G.vertices[current]:
            if color[vertex] == 'white':
                pred[vertex] = current
                time = DFSvisit(G, vertex, time)
        color[current] = 'black'
        time += 1
        finish[current] = time
        return time

    for vertex in G.vertices:
        color[vertex] = 'white'
        pred[vertex] = None
        reach[vertex] = 0
        finish[vertex] = 0
    time = 0
    for vertex in G.vertices:
        if color[vertex] == 'white':
            time = DFSvisit(G, vertex, time)
    # Dictionary for vertex data after DFS
    # -> vertex_data = {vertex: (predecessor, reach, finish), }
    vertex_data = {}
    for vertex in G.vertices:
        vertex_data[vertex] = (pred[vertex], reach[vertex], finish[vertex])
    return vertex_data
894031
def get_gamma_value(self):
        '''
        
        '''
        if isinstance(self.__gamma_value, float) is False:
            raise TypeError("The type of __gamma_value must be float.")
        return self.__gamma_value
996279
def BooleanSlice(input_vertex: vertex_constructor_param_types, dimension: int, index: int, label: Optional[str]=None) -> Vertex:
    
    return Boolean(context.jvm_view().BooleanSliceVertex, label, cast_to_vertex(input_vertex), cast_to_integer(dimension), cast_to_integer(index))
745588
def consume_vertices(self):
        
        while True:
            # Vertex color
            if len(self.values) == 7:
                yield (
                    float(self.values[1]),
                    float(self.values[2]),
                    float(self.values[3]),
                    float(self.values[4]),
                    float(self.values[5]),
                    float(self.values[6]),
                )
            # Positions only
            else:
                yield (
                    float(self.values[1]),
                    float(self.values[2]),
                    float(self.values[3]),
                )

            try:
                self.next_line()
            except StopIteration:
                break

            if not self.values:
                break

            if self.values[0] != "v":
                break
1125990
def Sigmoid(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().SigmoidVertex, label, cast_to_double_vertex(input_vertex))
1346375
def Sum(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().SumVertex, label, cast_to_double_vertex(input_vertex))
429068
def ChiSquared(k: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().ChiSquaredVertex, label, cast_to_integer_vertex(k))
1289204
def IntegerTake(input_vertex: vertex_constructor_param_types, index: Collection[int], label: Optional[str]=None) -> Vertex:
    
    return Integer(context.jvm_view().IntegerTakeVertex, label, cast_to_integer_vertex(input_vertex), cast_to_long_array(index))
1268554
def BFS(G, start):
    
    if start not in G.vertices:
        raise GraphInsertError("Vertex %s doesn't exist." % (start,))
    color = {}
    pred = {}
    dist = {}
    queue = Queue()
    queue.put(start)
    for vertex in G.vertices:
        color[vertex] = 'white'
        pred[vertex] = None
        dist[vertex] = 0
    while queue.qsize() > 0:
        current = queue.get()
        for neighbor in G.vertices[current]:
            if color[neighbor] == 'white':
                color[neighbor] = 'grey'
                pred[neighbor] = current
                dist[neighbor] = dist[current] + 1
                queue.put(neighbor)
        color[current] = 'black'
    return pred
1233893
def afterglow(self, src=None, event=None, dst=None, **kargs):
        """"""
        if src is None:
            src = lambda x: x['IP'].src
        if event is None:
            event = lambda x: x['IP'].dport
        if dst is None:
            dst = lambda x: x['IP'].dst
        sl = {}
        el = {}
        dl = {}
        for i in self.res:
            try:
                s,e,d = src(i),event(i),dst(i)
                if s in sl:
                    n,l = sl[s]
                    n += 1
                    if e not in l:
                        l.append(e)
                    sl[s] = (n,l)
                else:
                    sl[s] = (1,[e])
                if e in el:
                    n,l = el[e]
                    n+=1
                    if d not in l:
                        l.append(d)
                    el[e] = (n,l)
                else:
                    el[e] = (1,[d])
                dl[d] = dl.get(d,0)+1
            except:
                continue

        import math
        def normalize(n):
            return 2+math.log(n)/4.0

        def minmax(x):
            m,M = min(x),max(x)
            if m == M:
                m = 0
            if M == 0:
                M = 1
            return m,M

        #mins,maxs = minmax(map(lambda (x,y): x, sl.values()))
        mins,maxs = minmax([ a[0] for a in sl.values()])
        #mine,maxe = minmax(map(lambda (x,y): x, el.values()))
        mine,maxe = minmax([ a[0] for a in el.values()])
        mind,maxd = minmax(dl.values())
    
        gr = 'digraph "afterglow" {\n\tedge [len=2.5];\n'

        gr += "# src nodes\n"
        for s in sl:
            n,l = sl[s]; n = 1+(n-mins)/(maxs-mins)
            gr += '"src.%s" [label = "%s", shape=box, fillcolor="#FF0000", style=filled, fixedsize=1, height=%.2f,width=%.2f];\n' % (repr(s),repr(s),n,n)
        gr += "# event nodes\n"
        for e in el:
            n,l = el[e]; n = n = 1+(n-mine)/(maxe-mine)
            gr += '"evt.%s" [label = "%s", shape=circle, fillcolor="#00FFFF", style=filled, fixedsize=1, height=%.2f, width=%.2f];\n' % (repr(e),repr(e),n,n)
        for d in dl:
            n = dl[d]; n = n = 1+(n-mind)/(maxd-mind)
            gr += '"dst.%s" [label = "%s", shape=triangle, fillcolor="#0000ff", style=filled, fixedsize=1, height=%.2f, width=%.2f];\n' % (repr(d),repr(d),n,n)

        gr += "###\n"
        for s in sl:
            n,l = sl[s]
            for e in l:
                gr += ' "src.%s" -> "evt.%s";\n' % (repr(s),repr(e)) 
        for e in el:
            n,l = el[e]
            for d in l:
                gr += ' "evt.%s" -> "dst.%s";\n' % (repr(e),repr(d)) 
            
        gr += "}"
        return do_graph(gr, **kargs)
1059336
public static <T extends ImageBase<T>> void log(T input , T output ) {
		if( input instanceof ImageGray ) {
			if (GrayF32.class == input.getClass()) {
				PixelMath.log((GrayF32) input, (GrayF32) output);
			} else if (GrayF64.class == input.getClass()) {
				PixelMath.log((GrayF64) input, (GrayF64) output);
			} else {
				throw new IllegalArgumentException("Unknown image Type: " + input.getClass().getSimpleName());
			}
		} else if( input instanceof Planar ) {
			Planar in = (Planar)input;
			Planar out = (Planar)output;

			for (int i = 0; i < in.getNumBands(); i++) {
				log( in.getBand(i), out.getBand(i));
			}
		}
	}
461818
def BooleanTake(input_vertex: vertex_constructor_param_types, index: Collection[int], label: Optional[str]=None) -> Vertex:
    
    return Boolean(context.jvm_view().BooleanTakeVertex, label, cast_to_vertex(input_vertex), cast_to_long_array(index))
754747
def glog(x,l = 2):
    
    return np.log((x+np.sqrt(x**2+l**2))/2)/np.log(l)
211131
public float getBitangentY(int vertex) {
        if (!hasTangentsAndBitangents()) {
            throw new IllegalStateException("mesh has no bitangents");
        }
        
        checkVertexIndexBounds(vertex);
        
        return m_bitangents.getFloat((vertex * 3 + 1) * SIZEOF_FLOAT);
    }
497544
def CBO_Gamma(self, **kwargs):
        '''
        
        '''
        return (self.unstrained.CBO_Gamma(**kwargs) +
                self.CBO_strain_shift(**kwargs))
61006
def Power(base: vertex_constructor_param_types, exponent: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().PowerVertex, label, cast_to_double_vertex(base), cast_to_double_vertex(exponent))