<commit_before>package triangulations;
import triangulations.Geom2;
@:forward
abstract Edges( Array<Edge> ) from Array<Edge> to Array<Edge> {
    
    inline public function new( v: Array<Edge> ) {
      this = v;
    }
    public inline static 
    function getEmpty(){
        return new Edges( new Array<Edge>() );
    }
    public /*inline*/ function set_fixedExternal( val: Bool ){
        for( e in this ) {
            e.fixed = val;
            e.external = val;
        }
        return val;
    }
    public var fixedExternal( never, set ):Bool;
    
    public inline
    function clone(): Edges {
        var e = getEmpty();
        var l = this.length;
        for( i in 0...l ){
            e[ i ].p = this[ i ].p;
            e[ i ].q = this[ i ].q;
        }
        return e;
    }
    
    public inline
    function getUnsure(): Array<Int> {
        var unsureEdges = new Array<Int>();
        var l = this.length;
        var lu = 0;
        for( j in 0...l ){
            if( !this[j].fixed ){
                unsureEdges[ lu ] = j;
                lu++;
            }
        }
        return unsureEdges;
    }
    
    public inline
    function add( e: Edges ){
        var l = this.length;
        var el = e.length;
        for( i in 0...el ) this[ l + i ] = e[ i ];
    }
    @:from
    static public function fromArrayArray( arr:Array<Array<Null<Int>>> ) {
        var edges: Edges = getEmpty();
        var l = arr.length;
        for( i in 0...l ) edges[ i ] = Edge.fromArray( arr[ i ] );
        return edges;
    }
}<commit_msg>moved flipEdge to Edges unsure, compiles.<commit_after>package triangulations;
import triangulations.Geom2;
@:forward
abstract Edges( Array<Edge> ) from Array<Edge> to Array<Edge> {
    
    inline public function new( v: Array<Edge> ) {
      this = v;
    }
    public inline static 
    function getEmpty(){
        return new Edges( new Array<Edge>() );
    }
    public /*inline*/ function set_fixedExternal( val: Bool ){
        for( e in this ) {
            e.fixed = val;
            e.external = val;
        }
        return val;
    }
    public var fixedExternal( never, set ):Bool;
    
    public inline
    function clone(): Edges {
        var e = getEmpty();
        var l = this.length;
        for( i in 0...l ){
            e[ i ].p = this[ i ].p;
            e[ i ].q = this[ i ].q;
        }
        return e;
    }
    
    public inline
    function getUnsure(): Array<Int> {
        var unsureEdges = new Array<Int>();
        var l = this.length;
        var lu = 0;
        for( j in 0...l ){
            if( !this[j].fixed ){
                unsureEdges[ lu ] = j;
                lu++;
            }
        }
        return unsureEdges;
    }
    
    public inline
    function add( e: Edges ){
        var l = this.length;
        var el = e.length;
        for( i in 0...el ) this[ l + i ] = e[ i ];
    }
    @:from
    static public function fromArrayArray( arr:Array<Array<Null<Int>>> ) {
        var edges: Edges = getEmpty();
        var l = arr.length;
        for( i in 0...l ) edges[ i ] = Edge.fromArray( arr[ i ] );
        return edges;
    }
    
    // "ok"
    // Given edges along with their quad-edge datastructure, flips the chosen edge
    // j, maintaining the quad-edge structure integrity.
    public inline
    function flipEdge( coEdges: Edges, sideEdges: Array<SideEdge>, j: Int ) {
      var edge = this[j];
      var coEdge = coEdges[j];
      var se = sideEdges[j];
      var j0 = se.a;
      var j1 = se.b;
      var j2 = se.c;
      var j3 = se.d;

      // Amend side edges 
      coEdges[j0].substitute( edge.p, coEdge.q);
      se = sideEdges[j0];
      se.substitute( j, j1 );
      se.substitute( j3, j );

      coEdges[j1].substitute( edge.p, coEdge.p);
      se = sideEdges[j1];
      se.substitute( j , j0);
      se.substitute( j2, j );

      coEdges[j2].substitute( edge.q, coEdge.p);
      se = sideEdges[j2];
      se.substitute( j , j3);
      se.substitute( j1, j );

      coEdges[j3].substitute( edge.q, coEdge.q);
      se = sideEdges[j3];
      se.substitute( j , j2);
      se.substitute( j0, j );

      // Flip
      this[j] = coEdges[j];
      coEdges[j] = edge.clone(); // in order to not effect the input

      // Amend primary edge
      var tmp = sideEdges[j].a;
      sideEdges[j].a = sideEdges[j].c;
      sideEdges[j].c = tmp;
    }
}
{'fraction_non_alphanumeric': 0.13189066059225513, 'fraction_numerical': 0.007289293849658315, 'mean_word_length': 1.6309167165967646, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3065756', 'n_tokens_mistral': 1496, 'n_tokens_neox': 1446, 'n_words': 429}