Skip to content

Instantly share code, notes, and snippets.

import networkx as nx
def contract_edges(G,nodes, new_node, attr_dict=None, **attr):
'''Contracts the edges of the nodes in the set "nodes" '''
#Add the node with its attributes
G.add_node(new_node, attr_dict, **attr)
#Create the set of the edges that are to be contracted
cntr_edge_set = G.edges(nodes, data = True)
#Add edges from new_node to all target nodes in the set of edges that are to be contracted
#Possibly also checking that edge attributes are preserved and not overwritten,
// crash clang++ 3.3
template<char... elements>
class Chars
{
friend void f(Chars<elements>) {} // without friend does not crash
};
/*
% clang++ -v -std=c++0x -c crashclang.cc
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
# WorldChunkLoader
# Dynamically load and unload chunks on a 3D grid.
#
# Direct children should be scenes with Load As Placeholder checked.
# Direct children should be aligned on a grid.
# (To align in 3d scene editor: Transform -> Configure Snap -> Translate Snap.)
# Player should have a WorldChunkGPS component, which sends a signal to here.
#
# Algorithm: load current chunk and all neighbors around it; unload the rest.
extends Spatial
SINGULAR /
A Computer Algebra System for Polynomial Computations / version 4.2.0
0<
by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann \ Dec 2020
FB Mathematik der Universitaet, D-67653 Kaiserslautern \
/home/rburing/Documents/stdVerbose.S 1> option(teach);
/home/rburing/Documents/stdVerbose.S 2> option(redTail);
/home/rburing/Documents/stdVerbose.S 3> option(prot);
/home/rburing/Documents/stdVerbose.S 4> ring r=0, (y0,y1,y2,y3,y4,y5,y6,y7,y8,x0,x1,x2,x3,x4,x5,x6), dp;
/home/rburing/Documents/stdVerbose.S 5> ideal i = x1 + 7/5*x3 + 7/5*x5 - 4/125,