Transforms a graph self loop into an axis-aligned square.

@param  {object} n A graph node with a point (x, y) and a size.
@return {object}   A square: two points (x1, y1), (x2, y2) and height.
172037
function(n) {
      // Fitting to the curve is too costly, we compute a larger bounding box
      // using the control points:
      var cp = sigma.utils.getSelfLoopControlPoints(n.x, n.y, n.size);

      // Bounding box of the point and the two control points:
      var minX = Math.min(n.x, cp.x1, cp.x2),
          maxX = Math.max(n.x, cp.x1, cp.x2),
          minY = Math.min(n.y, cp.y1, cp.y2),
          maxY = Math.max(n.y, cp.y1, cp.y2);

      return {
        x1: minX - n.size,
        y1: minY - n.size,
        x2: maxX + n.size,
        y2: minY - n.size,
        height: maxY - minY + n.size * 2
      };
    }
962033
function(t, line$$1) {
                var R = t.determinant ? t.elements : matrix$2.Rotation(t, line$$1.direction).elements;
                var C = line$$1.pointClosestTo(this.anchor).elements;
                var A = this.anchor.elements, N = this.normal.elements;
                var C1 = C[0], C2 = C[1], C3 = C[2], A1 = A[0], A2 = A[1], A3 = A[2];
                var x = A1 - C1, y = A2 - C2, z = A3 - C3;
                return Plane$1.create([
                  C1 + R[0][0] * x + R[0][1] * y + R[0][2] * z,
                  C2 + R[1][0] * x + R[1][1] * y + R[1][2] * z,
                  C3 + R[2][0] * x + R[2][1] * y + R[2][2] * z
                ], [
                  R[0][0] * N[0] + R[0][1] * N[1] + R[0][2] * N[2],
                  R[1][0] * N[0] + R[1][1] * N[1] + R[1][2] * N[2],
                  R[2][0] * N[0] + R[2][1] * N[1] + R[2][2] * N[2]
                ]);
              }
685563
function Box( graph ) {
	var self = this;

	// INSTANCE ATTRIBUTES //

	this._parent = graph;
	this._root = undefined;
	this._children = {};
	this._config = {
		'type': 'box-and-whisker',
		'labels': [],
		'radius': 3,
		'width': 1
	};

	// DATA //

	this._data = graph._data;

	// ACCESSORS //

	this._accessors = {
		'median': function median( d ) {
			return [ [ d[1], d[1] ] ];
		},
		'quartiles': function quartiles( d ) {
			return [ d[2] ];
		},
		'centers': function centers( d ) {
			var _d = d[ 3 ],
				arr = [];
			for ( var i = 0; i < _d.length; i++ ) {
				arr.push( [ _d[i], d[1] ] );
			}
			return arr;
		},
		'whiskers': function whiskers( d ) {
			var arr = [];
			d = d[ 3 ];
			for ( var i = 0; i < d.length; i++ ) {
				arr.push( [ d[i], d[i] ] );
			}
			return arr;
		},
		'mOutliers': function outliers( d ) {
			if ( d.length > 4 && d[ 4 ].length ) {
				return d[4];
			}
			return [];
		},
		'eOutliers': function outliers( d ) {
			if ( d.length > 5 && d[ 5 ].length ) {
				return d[5];
			}
			return [];
		}
	};

	// TRANSFORMS //

	this._transforms = {
		'group': {
			'x': function X( d, w ) {
				return graph._xScale( d[ 0 ] ) - w;
			}
		},
		'line': {
			'y1': function Y1( d ) {
				return graph._yScale( d[ 0 ] );
			},
			'y2': function Y2( d ) {
				return graph._yScale( d[ 1 ] );
			}
		},
		'rect': {
			'y': function Y( d ) {
				return graph._yScale( d[ 1 ] );
			},
			'height': function Height( d ) {
				var height = graph._yScale( d[ 0 ] ) - graph._yScale( d[ 1 ] );
				return Math.abs( height );
			}
		},
		'circle': {
			'cy': function Y( d ) {
				return graph._yScale( d );
			},
			'r': function R( d ) {
				return self._config.radius;
			}
		}
	};

	// REGISTER //
	if ( graph._config.hasOwnProperty( 'marks' ) ) {
		graph._config.marks.push( this._config );
	} else {
		graph._config.marks = [ this._config ];
	}
	if ( graph._children.hasOwnProperty( 'marks' ) ) {
		graph._children.marks.push( this );
	} else {
		graph._children.marks = [ this ];
	}

	return this;
}
994365
function graph(g) {
    init(g);

    var xs = [upperLeft(g), upperRight(g), lowerRight(g), lowerLeft(g)];

    g.nodes().forEach(function(u) {
      var xArray = [];
      for (var i = 0; i < xs.length; ++i) {
        xArray.push(xs[i][u]);
      }
      xArray.sort();
      g.node(u).x = (xArray[1] + xArray[2]) / 2;
    });
  }
634751
function (x, y, rx, ry) {
    return new BVG('ellipse', x.constructor.name === 'Object' ? x : {
      x: x,
      y: y,
      rx: rx,
      ry: ry
    }, function (tag, data) {
      tag.setAttribute('cx', data.x);
      tag.setAttribute('cy', data.y);
      tag.setAttribute('rx', data.rx);
      tag.setAttribute('ry', data.ry);
    });
  }
1163175
function() {
            	if (!this.isSquare() || this.isSingular()) { return null; }
            	var n = this.elements.length, i = n, j;
            	var M = this.augment(Matrix$b.I(n)).toRightTriangular();
            	var np = M.elements[0].length, p, els, divisor;
            	var inverse_elements = [], new_element;
            	// Matrix is non-singular so there will be no zeros on the diagonal
            	// Cycle through rows from last to first
            	while (i--) {
            	    // First, normalise diagonal elements to 1
            	    els = [];
            	    inverse_elements[i] = [];
            	    divisor = M.elements[i][i];
            	    for (p = 0; p < np; p++) {
                    new_element = M.elements[i][p] / divisor;
            		els.push(new_element);
            		// Shuffle off the current row of the right hand side into the results
            		// array as it will not be modified by later runs through this loop
            		if (p >= n) { inverse_elements[i].push(new_element); }
            	    }
            	    M.elements[i] = els;
            	    // Then, subtract this row from those above it to
            	    // give the identity matrix on the left hand side
            	    j = i;
            	    while (j--) {
            		els = [];
            		for (p = 0; p < np; p++) {
            		    els.push(M.elements[j][p] - M.elements[i][p] * M.elements[j][i]);
            		}
            		M.elements[j] = els;
            	    }
            	}
            	return Matrix$b.create(inverse_elements);
                }
728034
function(array) {
				array = array || [];
				var i = 0;
				var l = this.vertices.length;
				for (var j=0;j<l;j++) {
					var v = this.vertices[j];
					array[i++] = v.x;
					array[i++] = v.y;
					array[i++] = v.z;
				}
				return array;
			}
909896
function(n) {
                    n = this._v(n, "n");

                    var toReturn = [];

                    for(var i=0; i<n; i++) {
                        toReturn[i] = this.rexp(1, this.prng())[0];
                    }

                    return toReturn
                }
1261632
function (x, y, r) {
		var attr = isObject(x) ?
			x :
			{
				x: x,
				y: y,
				r: r
			};

		return this.createElement('circle').attr(attr);
	}
1289777
function (x, y) {
                var matrix = selectedShape.node().getCTM(),
                    position = chart.svg.node().createSVGPoint();
                position.x = x || 0;
                position.y = y || 0;
                return position.matrixTransform(matrix);
            }
130778
function(x1, y1, x2, y2, width, height, centerX, centerY, padding) {
      var points = nodeShapes['square'].points;
      
      /*
      return renderer.boxIntersectPolygon(
        x1, y1, x2, y2,
        points, 
      */
    }
1187995
function Axes( graph ) {

	// INSTANCE ATTRIBUTES //

	this._parent = graph;
	this._root = undefined;
	this._children = {};
	this._config = [
		{
			"display": true,
			"scale": "x",
			"label": "x",
			"ticks": {
				"display": true,
				"num": 5,
				"format": null,
				"padding": 3,
				"innerSize": 6,
				"outerSize": 6,
				"rotation": 0,
				"direction": "out"
			},
			"orient": "bottom"
		},
		{
			"display": true,
			"scale": "y",
			"label": "y",
			"ticks": {
				"display": true,
				"num": 5,
				"format": null,
				"padding": 3,
				"innerSize": 6,
				"outerSize": 6,
				"rotation": 0,
				"direction": "out"
			},
			"orient": "left"
		}
	];

	// GENERATORS //

	this._xAxis = this.axis()
		.scale( graph._xScale )
		.orient( this._config[ 0 ].orient )
		.ticks( this._config[ 0 ].ticks.num )
		.innerTickSize( this._config[ 0 ].ticks.innerSize )
		.outerTickSize( this._config[ 0 ].ticks.outerSize )
		.tickPadding( this._config[ 0 ].ticks.padding )
		.tickFormat( this._config[ 0 ].ticks.format );

	this._yAxis = this.axis()
		.scale( graph._yScale )
		.orient( this._config[ 1 ].orient )
		.ticks( this._config[ 1 ].ticks.num )
		.innerTickSize( this._config[ 1 ].ticks.innerSize )
		.outerTickSize( this._config[ 1 ].ticks.outerSize )
		.tickPadding( this._config[ 1 ].ticks.padding )
		.tickFormat( this._config[ 1 ].ticks.format );

	// REGISTER //
	if ( graph._config.hasOwnProperty( 'axes' ) ) {
		graph._config.axes.push( this._config );
	} else {
		graph._config.axes = [ this._config ];
	}
	if ( graph._children.hasOwnProperty( 'axes' ) ) {
		graph._children.axes.push( this );
	} else {
		graph._children.axes = [ this ];
	}

	return this;

}
1060043
function(t, line) {
    var R = Matrix.Rotation(t, line.direction).elements;
    var C = line.pointClosestTo(this.anchor).elements;
    var A = this.anchor.elements, N = this.normal.elements;
    var C1 = C[0], C2 = C[1], C3 = C[2], A1 = A[0], A2 = A[1], A3 = A[2];
    var x = A1 - C1, y = A2 - C2, z = A3 - C3;
    return Plane.create([
      C1 + R[0][0] * x + R[0][1] * y + R[0][2] * z,
      C2 + R[1][0] * x + R[1][1] * y + R[1][2] * z,
      C3 + R[2][0] * x + R[2][1] * y + R[2][2] * z
    ], [
      R[0][0] * N[0] + R[0][1] * N[1] + R[0][2] * N[2],
      R[1][0] * N[0] + R[1][1] * N[1] + R[1][2] * N[2],
      R[2][0] * N[0] + R[2][1] * N[1] + R[2][2] * N[2]
    ]);
  }
370846
function(n, m, x){
  var matrix = [];
  for(var i = 0; i < n; i++) {
    matrix[i] = new Array(m);

    if(x != null){
      for(var j = 0; j < m; j++){
        matrix[i][j] = x;
      }
    }
  }

  return matrix;
}
948803
def grid_2d_8graph(self, m, n):
        """"""
        me = nx.Graph()
        node = me.node
        add_node = me.add_node
        add_edge = me.add_edge
        for i in range(m):
            for j in range(n):
                add_node((i, j))
                if i > 0:
                    add_edge((i, j), (i-1, j))
                    if j > 0:
                        add_edge((i, j), (i-1, j-1))
                if j > 0:
                    add_edge((i, j), (i, j-1))
                if (i - 1, j + 1) in node:
                    add_edge((i, j), (i-1, j+1))
        return self.copy_from(me)
930144
public static double Y(int n, double x) {
        double by, bym, byp, tox;

        if (n == 0) return Y0(x);
        if (n == 1) return Y(x);

        tox = 2.0 / x;
        by = Y(x);
        bym = Y0(x);
        for (int j = 1; j < n; j++) {
            byp = j * tox * by - bym;
            bym = by;
            by = byp;
        }
        return by;
    }
869861
public GeometryExpression<Geometry> geometryN(Integer n) {
        return GeometryExpressions.geometryOperation(SpatialOps.GEOMETRYN, mixin, ConstantImpl.create(n));
    }