hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
108
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
9689bf7cdb4a419310b90dbf8e3fabc7c0f0af22
68,541
cpp
C++
main_d2/gameseg.cpp
Kreeblah/ChocolateDescent
ce575a8193c4fa560731203d9aea66355c41cc0d
[ "MIT" ]
22
2019-08-19T21:09:29.000Z
2022-03-25T23:19:15.000Z
main_d2/gameseg.cpp
Kreeblah/ChocolateDescent
ce575a8193c4fa560731203d9aea66355c41cc0d
[ "MIT" ]
6
2019-11-08T22:17:03.000Z
2022-03-10T05:02:59.000Z
main_d2/gameseg.cpp
Kreeblah/ChocolateDescent
ce575a8193c4fa560731203d9aea66355c41cc0d
[ "MIT" ]
6
2019-08-24T08:03:14.000Z
2022-02-04T15:04:52.000Z
/* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ #include <stdlib.h> #include <stdio.h> #if defined(__linux__) || defined(_WIN32) || defined(_WIN64) #include <malloc.h> //for stackavail() #endif #include <string.h> // for memset() #include <algorithm> #include "misc/rand.h" #include "inferno.h" #include "game.h" #include "misc/error.h" #include "platform/mono.h" #include "vecmat/vecmat.h" #include "gameseg.h" #include "wall.h" #include "fuelcen.h" #include "bm.h" #include "fvi.h" #include "misc/byteswap.h" // How far a point can be from a plane, and still be "in" the plane #define PLANE_DIST_TOLERANCE 250 dl_index Dl_indices[MAX_DL_INDICES]; delta_light Delta_lights[MAX_DELTA_LIGHTS]; int Num_static_lights; // ------------------------------------------------------------------------------------------ // Compute the center point of a side of a segment. // The center point is defined to be the average of the 4 points defining the side. void compute_center_point_on_side(vms_vector *vp,segment *sp,int side) { int v; vm_vec_zero(vp); for (v=0; v<4; v++) vm_vec_add2(vp,&Vertices[sp->verts[Side_to_verts[side][v]]]); vm_vec_scale(vp,F1_0/4); } // ------------------------------------------------------------------------------------------ // Compute segment center. // The center point is defined to be the average of the 8 points defining the segment. void compute_segment_center(vms_vector *vp,segment *sp) { int v; vm_vec_zero(vp); for (v=0; v<8; v++) vm_vec_add2(vp,&Vertices[sp->verts[v]]); vm_vec_scale(vp,F1_0/8); } // ----------------------------------------------------------------------------- // Given two segments, return the side index in the connecting segment which connects to the base segment // Optimized by MK on 4/21/94 because it is a 2% load. int find_connect_side(segment *base_seg, segment *con_seg) { int s; short base_seg_num = base_seg - Segments; short *childs = con_seg->children; for (s=0; s<MAX_SIDES_PER_SEGMENT; s++) { if (*childs++ == base_seg_num) return s; } // legal to return -1, used in object_move_one(), mk, 06/08/94: Assert(0); // Illegal -- there is no connecting side between these two segments return -1; } // ----------------------------------------------------------------------------------- // Given a side, return the number of faces int get_num_faces(side *sidep) { switch (sidep->type) { case SIDE_IS_QUAD: return 1; break; case SIDE_IS_TRI_02: case SIDE_IS_TRI_13: return 2; break; default: Error("Illegal type = %i\n", sidep->type); break; } return 0; //shut up warning } // Fill in array with four absolute point numbers for a given side void get_side_verts(short *vertlist,int segnum,int sidenum) { int i; int8_t *sv = Side_to_verts[sidenum]; short *vp = Segments[segnum].verts; for (i=4; i--;) vertlist[i] = vp[sv[i]]; } #ifdef EDITOR // ----------------------------------------------------------------------------------- // Create all vertex lists (1 or 2) for faces on a side. // Sets: // num_faces number of lists // vertices vertices in all (1 or 2) faces // If there is one face, it has 4 vertices. // If there are two faces, they both have three vertices, so face #0 is stored in vertices 0,1,2, // face #1 is stored in vertices 3,4,5. // Note: these are not absolute vertex numbers, but are relative to the segment // Note: for triagulated sides, the middle vertex of each trianle is the one NOT // adjacent on the diagonal edge void create_all_vertex_lists(int *num_faces, int *vertices, int segnum, int sidenum) { side *sidep = &Segments[segnum].sides[sidenum]; int *sv = Side_to_verts_int[sidenum]; Assert((segnum <= Highest_segment_index) && (segnum >= 0)); Assert((sidenum >= 0) && (sidenum < 6)); switch (sidep->type) { case SIDE_IS_QUAD: vertices[0] = sv[0]; vertices[1] = sv[1]; vertices[2] = sv[2]; vertices[3] = sv[3]; *num_faces = 1; break; case SIDE_IS_TRI_02: *num_faces = 2; vertices[0] = sv[0]; vertices[1] = sv[1]; vertices[2] = sv[2]; vertices[3] = sv[2]; vertices[4] = sv[3]; vertices[5] = sv[0]; //IMPORTANT: DON'T CHANGE THIS CODE WITHOUT CHANGING GET_SEG_MASKS() //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() break; case SIDE_IS_TRI_13: *num_faces = 2; vertices[0] = sv[3]; vertices[1] = sv[0]; vertices[2] = sv[1]; vertices[3] = sv[1]; vertices[4] = sv[2]; vertices[5] = sv[3]; //IMPORTANT: DON'T CHANGE THIS CODE WITHOUT CHANGING GET_SEG_MASKS() //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() break; default: Error("Illegal side type (1), type = %i, segment # = %i, side # = %i\n", sidep->type, segnum, sidenum); break; } } #endif // ----------------------------------------------------------------------------------- // Like create all vertex lists, but returns the vertnums (relative to // the side) for each of the faces that make up the side. // If there is one face, it has 4 vertices. // If there are two faces, they both have three vertices, so face #0 is stored in vertices 0,1,2, // face #1 is stored in vertices 3,4,5. void create_all_vertnum_lists(int *num_faces, int *vertnums, int segnum, int sidenum) { side *sidep = &Segments[segnum].sides[sidenum]; Assert((segnum <= Highest_segment_index) && (segnum >= 0)); switch (sidep->type) { case SIDE_IS_QUAD: vertnums[0] = 0; vertnums[1] = 1; vertnums[2] = 2; vertnums[3] = 3; *num_faces = 1; break; case SIDE_IS_TRI_02: *num_faces = 2; vertnums[0] = 0; vertnums[1] = 1; vertnums[2] = 2; vertnums[3] = 2; vertnums[4] = 3; vertnums[5] = 0; //IMPORTANT: DON'T CHANGE THIS CODE WITHOUT CHANGING GET_SEG_MASKS() //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() break; case SIDE_IS_TRI_13: *num_faces = 2; vertnums[0] = 3; vertnums[1] = 0; vertnums[2] = 1; vertnums[3] = 1; vertnums[4] = 2; vertnums[5] = 3; //IMPORTANT: DON'T CHANGE THIS CODE WITHOUT CHANGING GET_SEG_MASKS() //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() break; default: Error("Illegal side type (2), type = %i, segment # = %i, side # = %i\n", sidep->type, segnum, sidenum); break; } } // ----- //like create_all_vertex_lists(), but generate absolute point numbers void create_abs_vertex_lists(int *num_faces, int *vertices, int segnum, int sidenum) { short *vp = Segments[segnum].verts; side *sidep = &Segments[segnum].sides[sidenum]; int *sv = Side_to_verts_int[sidenum]; Assert((segnum <= Highest_segment_index) && (segnum >= 0)); switch (sidep->type) { case SIDE_IS_QUAD: vertices[0] = vp[sv[0]]; vertices[1] = vp[sv[1]]; vertices[2] = vp[sv[2]]; vertices[3] = vp[sv[3]]; *num_faces = 1; break; case SIDE_IS_TRI_02: *num_faces = 2; vertices[0] = vp[sv[0]]; vertices[1] = vp[sv[1]]; vertices[2] = vp[sv[2]]; vertices[3] = vp[sv[2]]; vertices[4] = vp[sv[3]]; vertices[5] = vp[sv[0]]; //IMPORTANT: DON'T CHANGE THIS CODE WITHOUT CHANGING GET_SEG_MASKS(), //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() break; case SIDE_IS_TRI_13: *num_faces = 2; vertices[0] = vp[sv[3]]; vertices[1] = vp[sv[0]]; vertices[2] = vp[sv[1]]; vertices[3] = vp[sv[1]]; vertices[4] = vp[sv[2]]; vertices[5] = vp[sv[3]]; //IMPORTANT: DON'T CHANGE THIS CODE WITHOUT CHANGING GET_SEG_MASKS() //CREATE_ABS_VERTEX_LISTS(), CREATE_ALL_VERTEX_LISTS(), CREATE_ALL_VERTNUM_LISTS() break; default: Error("Illegal side type (3), type = %i, segment # = %i, side # = %i\n", sidep->type, segnum, sidenum); break; } } //returns 3 different bitmasks with info telling if this sphere is in //this segment. See segmasks structure for info on fields segmasks get_seg_masks(vms_vector *checkp,int segnum,fix rad) { int sn,facebit,sidebit; segmasks masks; int num_faces; int vertex_list[6]; segment *seg; if (segnum==-1) Error("segnum == -1 in get_seg_masks()"); Assert((segnum <= Highest_segment_index) && (segnum >= 0)); seg = &Segments[segnum]; //check point against each side of segment. return bitmask masks.sidemask = masks.facemask = masks.centermask = 0; for (sn=0,facebit=sidebit=1;sn<6;sn++,sidebit<<=1) { #ifndef COMPACT_SEGS side *s = &seg->sides[sn]; #endif int side_pokes_out; int vertnum,fn; // Get number of faces on this side, and at vertex_list, store vertices. // If one face, then vertex_list indicates a quadrilateral. // If two faces, then 0,1,2 define one triangle, 3,4,5 define the second. create_abs_vertex_lists( &num_faces, vertex_list, segnum, sn); //ok...this is important. If a side has 2 faces, we need to know if //those faces form a concave or convex side. If the side pokes out, //then a point is on the back of the side if it is behind BOTH faces, //but if the side pokes in, a point is on the back if behind EITHER face. if (num_faces==2) { fix dist; int side_count,center_count; #ifdef COMPACT_SEGS vms_vector normals[2]; #endif vertnum = std::min(vertex_list[0],vertex_list[2]); #ifdef COMPACT_SEGS get_side_normals(seg, sn, &normals[0], &normals[1] ); #endif if (vertex_list[4] < vertex_list[1]) #ifdef COMPACT_SEGS dist = vm_dist_to_plane(&Vertices[vertex_list[4]],&normals[0],&Vertices[vertnum]); #else dist = vm_dist_to_plane(&Vertices[vertex_list[4]],&s->normals[0],&Vertices[vertnum]); #endif else #ifdef COMPACT_SEGS dist = vm_dist_to_plane(&Vertices[vertex_list[1]],&normals[1],&Vertices[vertnum]); #else dist = vm_dist_to_plane(&Vertices[vertex_list[1]],&s->normals[1],&Vertices[vertnum]); #endif side_pokes_out = (dist > PLANE_DIST_TOLERANCE); side_count = center_count = 0; for (fn=0;fn<2;fn++,facebit<<=1) { #ifdef COMPACT_SEGS dist = vm_dist_to_plane(checkp, &normals[fn], &Vertices[vertnum]); #else dist = vm_dist_to_plane(checkp, &s->normals[fn], &Vertices[vertnum]); #endif if (dist < -PLANE_DIST_TOLERANCE) //in front of face center_count++; if (dist-rad < -PLANE_DIST_TOLERANCE) { masks.facemask |= facebit; side_count++; } } if (!side_pokes_out) { //must be behind both faces if (side_count==2) masks.sidemask |= sidebit; if (center_count==2) masks.centermask |= sidebit; } else { //must be behind at least one face if (side_count) masks.sidemask |= sidebit; if (center_count) masks.centermask |= sidebit; } } else { //only one face on this side fix dist; int i; #ifdef COMPACT_SEGS vms_vector normal; #endif //use lowest point number vertnum = vertex_list[0]; for (i=1;i<4;i++) if (vertex_list[i] < vertnum) vertnum = vertex_list[i]; #ifdef COMPACT_SEGS get_side_normal(seg, sn, 0, &normal ); dist = vm_dist_to_plane(checkp, &normal, &Vertices[vertnum]); #else dist = vm_dist_to_plane(checkp, &s->normals[0], &Vertices[vertnum]); #endif if (dist < -PLANE_DIST_TOLERANCE) masks.centermask |= sidebit; if (dist-rad < -PLANE_DIST_TOLERANCE) { masks.facemask |= facebit; masks.sidemask |= sidebit; } facebit <<= 2; } } return masks; } //this was converted from get_seg_masks()...it fills in an array of 6 //elements for the distace behind each side, or zero if not behind //only gets centermask, and assumes zero rad uint8_t get_side_dists(vms_vector *checkp,int segnum,fix *side_dists) { int sn,facebit,sidebit; uint8_t mask; int num_faces; int vertex_list[6]; segment *seg; Assert((segnum <= Highest_segment_index) && (segnum >= 0)); if (segnum==-1) Error("segnum == -1 in get_seg_dists()"); seg = &Segments[segnum]; //check point against each side of segment. return bitmask mask = 0; for (sn=0,facebit=sidebit=1;sn<6;sn++,sidebit<<=1) { #ifndef COMPACT_SEGS side *s = &seg->sides[sn]; #endif int side_pokes_out; int fn; side_dists[sn] = 0; // Get number of faces on this side, and at vertex_list, store vertices. // If one face, then vertex_list indicates a quadrilateral. // If two faces, then 0,1,2 define one triangle, 3,4,5 define the second. create_abs_vertex_lists( &num_faces, vertex_list, segnum, sn); //ok...this is important. If a side has 2 faces, we need to know if //those faces form a concave or convex side. If the side pokes out, //then a point is on the back of the side if it is behind BOTH faces, //but if the side pokes in, a point is on the back if behind EITHER face. if (num_faces==2) { fix dist; int center_count; int vertnum; #ifdef COMPACT_SEGS vms_vector normals[2]; #endif vertnum = std::min(vertex_list[0],vertex_list[2]); #ifdef COMPACT_SEGS get_side_normals(seg, sn, &normals[0], &normals[1] ); #endif if (vertex_list[4] < vertex_list[1]) #ifdef COMPACT_SEGS dist = vm_dist_to_plane(&Vertices[vertex_list[4]],&normals[0],&Vertices[vertnum]); #else dist = vm_dist_to_plane(&Vertices[vertex_list[4]],&s->normals[0],&Vertices[vertnum]); #endif else #ifdef COMPACT_SEGS dist = vm_dist_to_plane(&Vertices[vertex_list[1]],&normals[1],&Vertices[vertnum]); #else dist = vm_dist_to_plane(&Vertices[vertex_list[1]],&s->normals[1],&Vertices[vertnum]); #endif side_pokes_out = (dist > PLANE_DIST_TOLERANCE); center_count = 0; for (fn=0;fn<2;fn++,facebit<<=1) { #ifdef COMPACT_SEGS dist = vm_dist_to_plane(checkp, &normals[fn], &Vertices[vertnum]); #else dist = vm_dist_to_plane(checkp, &s->normals[fn], &Vertices[vertnum]); #endif if (dist < -PLANE_DIST_TOLERANCE) { //in front of face center_count++; side_dists[sn] += dist; } } if (!side_pokes_out) { //must be behind both faces if (center_count==2) { mask |= sidebit; side_dists[sn] /= 2; //get average } } else { //must be behind at least one face if (center_count) { mask |= sidebit; if (center_count==2) side_dists[sn] /= 2; //get average } } } else { //only one face on this side fix dist; int i,vertnum; #ifdef COMPACT_SEGS vms_vector normal; #endif //use lowest point number vertnum = vertex_list[0]; for (i=1;i<4;i++) if (vertex_list[i] < vertnum) vertnum = vertex_list[i]; #ifdef COMPACT_SEGS get_side_normal(seg, sn, 0, &normal ); dist = vm_dist_to_plane(checkp, &normal, &Vertices[vertnum]); #else dist = vm_dist_to_plane(checkp, &s->normals[0], &Vertices[vertnum]); #endif if (dist < -PLANE_DIST_TOLERANCE) { mask |= sidebit; side_dists[sn] = dist; } facebit <<= 2; } } return mask; } #ifndef NDEBUG #ifndef COMPACT_SEGS //returns true if errors detected int check_norms(int segnum,int sidenum,int facenum,int csegnum,int csidenum,int cfacenum) { vms_vector *n0,*n1; n0 = &Segments[segnum].sides[sidenum].normals[facenum]; n1 = &Segments[csegnum].sides[csidenum].normals[cfacenum]; if (n0->x != -n1->x || n0->y != -n1->y || n0->z != -n1->z) { mprintf((0,"Seg %x, side %d, norm %d doesn't match seg %x, side %d, norm %d:\n" " %8x %8x %8x\n" " %8x %8x %8x (negated)\n", segnum,sidenum,facenum,csegnum,csidenum,cfacenum, n0->x,n0->y,n0->z,-n1->x,-n1->y,-n1->z)); return 1; } else return 0; } //heavy-duty error checking int check_segment_connections(void) { int segnum,sidenum; int errors=0; for (segnum=0;segnum<=Highest_segment_index;segnum++) { segment *seg; seg = &Segments[segnum]; for (sidenum=0;sidenum<6;sidenum++) { side *s; segment *cseg; side *cs; int num_faces,csegnum,csidenum,con_num_faces; int vertex_list[6],con_vertex_list[6]; s = &seg->sides[sidenum]; create_abs_vertex_lists( &num_faces, vertex_list, segnum, sidenum); csegnum = seg->children[sidenum]; if (csegnum >= 0) { cseg = &Segments[csegnum]; csidenum = find_connect_side(seg,cseg); if (csidenum == -1) { mprintf((0,"Could not find connected side for seg %x back to seg %x, side %d\n",csegnum,segnum,sidenum)); errors = 1; continue; } cs = &cseg->sides[csidenum]; create_abs_vertex_lists( &con_num_faces, con_vertex_list, csegnum, csidenum); if (con_num_faces != num_faces) { mprintf((0,"Seg %x, side %d: num_faces (%d) mismatch with seg %x, side %d (%d)\n",segnum,sidenum,num_faces,csegnum,csidenum,con_num_faces)); errors = 1; } else if (num_faces == 1) { int t; for (t=0;t<4 && con_vertex_list[t]!=vertex_list[0];t++); if (t==4 || vertex_list[0] != con_vertex_list[t] || vertex_list[1] != con_vertex_list[(t+3)%4] || vertex_list[2] != con_vertex_list[(t+2)%4] || vertex_list[3] != con_vertex_list[(t+1)%4]) { mprintf((0,"Seg %x, side %d: vertex list mismatch with seg %x, side %d\n" " %x %x %x %x\n" " %x %x %x %x\n", segnum,sidenum,csegnum,csidenum, vertex_list[0],vertex_list[1],vertex_list[2],vertex_list[3], con_vertex_list[0],con_vertex_list[1],con_vertex_list[2],con_vertex_list[3])); errors = 1; } else errors |= check_norms(segnum,sidenum,0,csegnum,csidenum,0); } else { if (vertex_list[1] == con_vertex_list[1]) { if (vertex_list[4] != con_vertex_list[4] || vertex_list[0] != con_vertex_list[2] || vertex_list[2] != con_vertex_list[0] || vertex_list[3] != con_vertex_list[5] || vertex_list[5] != con_vertex_list[3]) { mprintf((0,"Seg %x, side %d: vertex list mismatch with seg %x, side %d\n" " %x %x %x %x %x %x\n" " %x %x %x %x %x %x\n", segnum,sidenum,csegnum,csidenum, vertex_list[0],vertex_list[1],vertex_list[2],vertex_list[3],vertex_list[4],vertex_list[5], con_vertex_list[0],con_vertex_list[1],con_vertex_list[2],con_vertex_list[3],con_vertex_list[4],con_vertex_list[5])); mprintf((0,"Changing seg:side %4i:%i from %i to %i\n", csegnum, csidenum, Segments[csegnum].sides[csidenum].type, 5-Segments[csegnum].sides[csidenum].type)); Segments[csegnum].sides[csidenum].type = 5-Segments[csegnum].sides[csidenum].type; } else { errors |= check_norms(segnum,sidenum,0,csegnum,csidenum,0); errors |= check_norms(segnum,sidenum,1,csegnum,csidenum,1); } } else { if (vertex_list[1] != con_vertex_list[4] || vertex_list[4] != con_vertex_list[1] || vertex_list[0] != con_vertex_list[5] || vertex_list[5] != con_vertex_list[0] || vertex_list[2] != con_vertex_list[3] || vertex_list[3] != con_vertex_list[2]) { mprintf((0,"Seg %x, side %d: vertex list mismatch with seg %x, side %d\n" " %x %x %x %x %x %x\n" " %x %x %x %x %x %x\n", segnum,sidenum,csegnum,csidenum, vertex_list[0],vertex_list[1],vertex_list[2],vertex_list[3],vertex_list[4],vertex_list[5], con_vertex_list[0],con_vertex_list[1],con_vertex_list[2],con_vertex_list[3],con_vertex_list[4],vertex_list[5])); mprintf((0,"Changing seg:side %4i:%i from %i to %i\n", csegnum, csidenum, Segments[csegnum].sides[csidenum].type, 5-Segments[csegnum].sides[csidenum].type)); Segments[csegnum].sides[csidenum].type = 5-Segments[csegnum].sides[csidenum].type; } else { errors |= check_norms(segnum,sidenum,0,csegnum,csidenum,1); errors |= check_norms(segnum,sidenum,1,csegnum,csidenum,0); } } } } } } // mprintf((0,"\n DONE \n")); return errors; } #endif #endif // Used to become a constant based on editor, but I wanted to be able to set // this for omega blob find_point_seg calls. Would be better to pass a paremeter // to the routine...--MK, 01/17/96 int Doing_lighting_hack_flag=0; //figure out what seg the given point is in, tracing through segments //returns segment number, or -1 if can't find segment int trace_segs(vms_vector *p0,int oldsegnum, int trace_segs_iterations) { int centermask; segment *seg; fix side_dists[6]; Assert((oldsegnum <= Highest_segment_index) && (oldsegnum >= 0)); /*if (stackavail() < 1024)*/ if (trace_segs_iterations > 1024) { //if no debugging, we'll get past assert #ifndef NDEBUG if (!Doing_lighting_hack_flag) Int3(); // Please get Matt, or if you cannot, then type // "?p0->xyz,segnum" at the DBG prompt, write down // the values (a 3-element vector and a segment number), // and make a copy of the mine you are playing. else #endif //[ISB] this function is really bad. really really bad. agonizingly bad. //This doesn't even begin to replicate it vanilla like, but I'd rather do this than rely on stupid shit //like stack availability. It would make more sense to do an exhaustive test if this fails but that's not what vanilla does. //or maybe they could have just used a saner search algorithm... fprintf(stderr, "trace_segs: iteration limit hit\n"); return oldsegnum; //just say we're in this segment and be done with it } centermask = get_side_dists(p0,oldsegnum,side_dists); //check old segment if (centermask == 0) //we're in the old segment return oldsegnum; //..say so //not in old seg. trace through to find seg else { int biggest_side; do { int sidenum,bit; fix biggest_val; seg = &Segments[oldsegnum]; biggest_side = -1; biggest_val = 0; for (sidenum=0,bit=1;sidenum<6;sidenum++,bit<<=1) if ((centermask&bit) && (seg->children[sidenum]>-1)) if (side_dists[sidenum] < biggest_val) { biggest_val = side_dists[sidenum]; biggest_side = sidenum; } if (biggest_side != -1) { int check; side_dists[biggest_side] = 0; check = trace_segs(p0,seg->children[biggest_side], trace_segs_iterations+1); //trace into adjacent segment if (check != -1) //we've found a segment return check; } } while (biggest_side!=-1); return -1; //we haven't found a segment } } int Exhaustive_count=0, Exhaustive_failed_count=0; //Tries to find a segment for a point, in the following way: // 1. Check the given segment // 2. Recursively trace through attached segments // 3. Check all the segmentns //Returns segnum if found, or -1 int find_point_seg(vms_vector *p,int segnum) { int newseg; //allow segnum==-1, meaning we have no idea what segment point is in Assert((segnum <= Highest_segment_index) && (segnum >= -1)); if (segnum != -1) { newseg = trace_segs(p,segnum, 0); if (newseg != -1) //we found a segment! return newseg; } //couldn't find via attached segs, so search all segs // MK: 10/15/94 // This Doing_lighting_hack_flag thing added by mk because the hundreds of scrolling messages were // slowing down lighting, and in about 98% of cases, it would just return -1 anyway. // Matt: This really should be fixed, though. We're probably screwing up our lighting in a few places. if (!Doing_lighting_hack_flag) { mprintf((1,"Warning: doing exhaustive search to find point segment (%i times)\n", ++Exhaustive_count)); for (newseg=0;newseg <= Highest_segment_index;newseg++) if (get_seg_masks(p,newseg,0).centermask == 0) return newseg; mprintf((1,"Warning: could not find point segment (%i times)\n", ++Exhaustive_failed_count)); return -1; //no segment found } else return -1; } //--repair-- // ------------------------------------------------------------------------------ //--repair-- void clsd_repair_center(int segnum) //--repair-- { //--repair-- int sidenum; //--repair-- //--repair-- // --- Set repair center bit for all repair center segments. //--repair-- if (Segments[segnum].special == SEGMENT_IS_REPAIRCEN) { //--repair-- Lsegments[segnum].special_type |= SS_REPAIR_CENTER; //--repair-- Lsegments[segnum].special_segment = segnum; //--repair-- } //--repair-- //--repair-- // --- Set repair center bit for all segments adjacent to a repair center. //--repair-- for (sidenum=0; sidenum < MAX_SIDES_PER_SEGMENT; sidenum++) { //--repair-- int s = Segments[segnum].children[sidenum]; //--repair-- //--repair-- if ( (s != -1) && (Segments[s].special==SEGMENT_IS_REPAIRCEN) ) { //--repair-- Lsegments[segnum].special_type |= SS_REPAIR_CENTER; //--repair-- Lsegments[segnum].special_segment = s; //--repair-- } //--repair-- } //--repair-- } //--repair-- // ------------------------------------------------------------------------------ //--repair-- // --- Set destination points for all Materialization centers. //--repair-- void clsd_materialization_center(int segnum) //--repair-- { //--repair-- if (Segments[segnum].special == SEGMENT_IS_ROBOTMAKER) { //--repair-- //--repair-- } //--repair-- } //--repair-- //--repair-- int Lsegment_highest_segment_index, Lsegment_highest_vertex_index; //--repair-- //--repair-- // ------------------------------------------------------------------------------ //--repair-- // Create data specific to mine which doesn't get written to disk. //--repair-- // Highest_segment_index and Highest_object_index must be valid. //--repair-- // 07/21: set repair center bit //--repair-- void create_local_segment_data(void) //--repair-- { //--repair-- int segnum; //--repair-- //--repair-- // --- Initialize all Lsegments. //--repair-- for (segnum=0; segnum <= Highest_segment_index; segnum++) { //--repair-- Lsegments[segnum].special_type = 0; //--repair-- Lsegments[segnum].special_segment = -1; //--repair-- } //--repair-- //--repair-- for (segnum=0; segnum <= Highest_segment_index; segnum++) { //--repair-- //--repair-- clsd_repair_center(segnum); //--repair-- clsd_materialization_center(segnum); //--repair-- //--repair-- } //--repair-- //--repair-- // Set check variables. //--repair-- // In main game loop, make sure these are valid, else Lsegments is not valid. //--repair-- Lsegment_highest_segment_index = Highest_segment_index; //--repair-- Lsegment_highest_vertex_index = Highest_vertex_index; //--repair-- } //--repair-- //--repair-- // ------------------------------------------------------------------------------------------ //--repair-- // Sort of makes sure create_local_segment_data has been called for the currently executing mine. //--repair-- // It is not failsafe, as you will see if you look at the code. //--repair-- // Returns 1 if Lsegments appears valid, 0 if not. //--repair-- int check_lsegments_validity(void) //--repair-- { //--repair-- return ((Lsegment_highest_segment_index == Highest_segment_index) && (Lsegment_highest_vertex_index == Highest_vertex_index)); //--repair-- } #define MAX_LOC_POINT_SEGS 64 int Connected_segment_distance; #define MIN_CACHE_FCD_DIST (F1_0*80) // Must be this far apart for cache lookup to succeed. Recognizes small changes in distance matter at small distances. #define MAX_FCD_CACHE 8 typedef struct { int seg0, seg1, csd; fix dist; } fcd_data; int Fcd_index = 0; fcd_data Fcd_cache[MAX_FCD_CACHE]; fix Last_fcd_flush_time; // ---------------------------------------------------------------------------------------------------------- void flush_fcd_cache(void) { int i; Fcd_index = 0; for (i=0; i<MAX_FCD_CACHE; i++) Fcd_cache[i].seg0 = -1; } // ---------------------------------------------------------------------------------------------------------- void add_to_fcd_cache(int seg0, int seg1, int depth, fix dist) { if (dist > MIN_CACHE_FCD_DIST) { Fcd_cache[Fcd_index].seg0 = seg0; Fcd_cache[Fcd_index].seg1 = seg1; Fcd_cache[Fcd_index].csd = depth; Fcd_cache[Fcd_index].dist = dist; Fcd_index++; if (Fcd_index >= MAX_FCD_CACHE) Fcd_index = 0; // -- mprintf((0, "Adding seg0=%i, seg1=%i to cache.\n", seg0, seg1)); } else { // If it's in the cache, remove it. int i; for (i=0; i<MAX_FCD_CACHE; i++) if (Fcd_cache[i].seg0 == seg0) if (Fcd_cache[i].seg1 == seg1) { Fcd_cache[Fcd_index].seg0 = -1; break; } } } // ---------------------------------------------------------------------------------------------------------- // Determine whether seg0 and seg1 are reachable in a way that allows sound to pass. // Search up to a maximum depth of max_depth. // Return the distance. fix find_connected_distance(vms_vector *p0, int seg0, vms_vector *p1, int seg1, int max_depth, int wid_flag) { int cur_seg; int sidenum; int qtail = 0, qhead = 0; int i; int8_t visited[MAX_SEGMENTS]; seg_seg seg_queue[MAX_SEGMENTS]; short depth[MAX_SEGMENTS]; int cur_depth; int num_points; point_seg point_segs[MAX_LOC_POINT_SEGS]; fix dist; // If > this, will overrun point_segs buffer #ifdef WINDOWS if (max_depth == -1) max_depth = 200; #endif if (max_depth > MAX_LOC_POINT_SEGS-2) { mprintf((1, "Warning: In find_connected_distance, max_depth = %i, limited to %i\n", max_depth, MAX_LOC_POINT_SEGS-2)); max_depth = MAX_LOC_POINT_SEGS-2; } if (seg0 == seg1) { Connected_segment_distance = 0; return vm_vec_dist_quick(p0, p1); } else { int conn_side; if ((conn_side = find_connect_side(&Segments[seg0], &Segments[seg1])) != -1) { if (WALL_IS_DOORWAY(&Segments[seg1], conn_side) & wid_flag) { Connected_segment_distance = 1; //mprintf((0, "\n")); return vm_vec_dist_quick(p0, p1); } } } // Periodically flush cache. if ((GameTime - Last_fcd_flush_time > F1_0*2) || (GameTime < Last_fcd_flush_time)) { flush_fcd_cache(); Last_fcd_flush_time = GameTime; } // Can't quickly get distance, so see if in Fcd_cache. for (i=0; i<MAX_FCD_CACHE; i++) if ((Fcd_cache[i].seg0 == seg0) && (Fcd_cache[i].seg1 == seg1)) { Connected_segment_distance = Fcd_cache[i].csd; // -- mprintf((0, "In cache, seg0=%i, seg1=%i. Returning.\n", seg0, seg1)); return Fcd_cache[i].dist; } num_points = 0; memset(visited, 0, Highest_segment_index+1); memset(depth, 0, sizeof(depth[0]) * (Highest_segment_index+1)); cur_seg = seg0; visited[cur_seg] = 1; cur_depth = 0; while (cur_seg != seg1) { segment *segp = &Segments[cur_seg]; for (sidenum = 0; sidenum < MAX_SIDES_PER_SEGMENT; sidenum++) { int snum = sidenum; if (WALL_IS_DOORWAY(segp, snum) & wid_flag) { int this_seg = segp->children[snum]; if (!visited[this_seg]) { seg_queue[qtail].start = cur_seg; seg_queue[qtail].end = this_seg; visited[this_seg] = 1; depth[qtail++] = cur_depth+1; if (max_depth != -1) { if (depth[qtail-1] == max_depth) { Connected_segment_distance = 1000; add_to_fcd_cache(seg0, seg1, Connected_segment_distance, F1_0*1000); return -1; } } else if (this_seg == seg1) { goto fcd_done1; } } } } // for (sidenum... if (qhead >= qtail) { Connected_segment_distance = 1000; add_to_fcd_cache(seg0, seg1, Connected_segment_distance, F1_0*1000); return -1; } cur_seg = seg_queue[qhead].end; cur_depth = depth[qhead]; qhead++; fcd_done1: ; } // while (cur_seg ... // Set qtail to the segment which ends at the goal. while (seg_queue[--qtail].end != seg1) if (qtail < 0) { Connected_segment_distance = 1000; add_to_fcd_cache(seg0, seg1, Connected_segment_distance, F1_0*1000); return -1; } while (qtail >= 0) { int parent_seg, this_seg; this_seg = seg_queue[qtail].end; parent_seg = seg_queue[qtail].start; point_segs[num_points].segnum = this_seg; compute_segment_center(&point_segs[num_points].point,&Segments[this_seg]); num_points++; if (parent_seg == seg0) break; while (seg_queue[--qtail].end != parent_seg) Assert(qtail >= 0); } point_segs[num_points].segnum = seg0; compute_segment_center(&point_segs[num_points].point,&Segments[seg0]); num_points++; if (num_points == 1) { Connected_segment_distance = num_points; return vm_vec_dist_quick(p0, p1); } else { dist = vm_vec_dist_quick(p1, &point_segs[1].point); dist += vm_vec_dist_quick(p0, &point_segs[num_points-2].point); for (i=1; i<num_points-2; i++) { fix ndist; ndist = vm_vec_dist_quick(&point_segs[i].point, &point_segs[i+1].point); dist += ndist; } } Connected_segment_distance = num_points; add_to_fcd_cache(seg0, seg1, num_points, dist); return dist; } int8_t convert_to_byte(fix f) { if (f >= 0x00010000) return MATRIX_MAX; else if (f <= -0x00010000) return -MATRIX_MAX; else return f >> MATRIX_PRECISION; } #define VEL_PRECISION 12 // Create a shortpos struct from an object. // Extract the matrix into int8_t values. // Create a position relative to vertex 0 with 1/256 normal "fix" precision. // Stuff segment in a short. void create_shortpos(shortpos *spp, object *objp, int swap_bytes) { // int segnum; int8_t *sp; sp = spp->bytemat; *sp++ = convert_to_byte(objp->orient.rvec.x); *sp++ = convert_to_byte(objp->orient.uvec.x); *sp++ = convert_to_byte(objp->orient.fvec.x); *sp++ = convert_to_byte(objp->orient.rvec.y); *sp++ = convert_to_byte(objp->orient.uvec.y); *sp++ = convert_to_byte(objp->orient.fvec.y); *sp++ = convert_to_byte(objp->orient.rvec.z); *sp++ = convert_to_byte(objp->orient.uvec.z); *sp++ = convert_to_byte(objp->orient.fvec.z); spp->xo = (objp->pos.x - Vertices[Segments[objp->segnum].verts[0]].x) >> RELPOS_PRECISION; spp->yo = (objp->pos.y - Vertices[Segments[objp->segnum].verts[0]].y) >> RELPOS_PRECISION; spp->zo = (objp->pos.z - Vertices[Segments[objp->segnum].verts[0]].z) >> RELPOS_PRECISION; spp->segment = objp->segnum; spp->velx = (objp->mtype.phys_info.velocity.x) >> VEL_PRECISION; spp->vely = (objp->mtype.phys_info.velocity.y) >> VEL_PRECISION; spp->velz = (objp->mtype.phys_info.velocity.z) >> VEL_PRECISION; // swap the short values for the big-endian machines. /*if (swap_bytes) { spp->xo = INTEL_SHORT(spp->xo); spp->yo = INTEL_SHORT(spp->yo); spp->zo = INTEL_SHORT(spp->zo); spp->segment = INTEL_SHORT(spp->segment); spp->velx = INTEL_SHORT(spp->velx); spp->vely = INTEL_SHORT(spp->vely); spp->velz = INTEL_SHORT(spp->velz); }*/ // mprintf((0, "Matrix: %08x %08x %08x %08x %08x %08x\n", objp->orient.m1,objp->orient.m2,objp->orient.m3, // spp->bytemat[0] << MATRIX_PRECISION,spp->bytemat[1] << MATRIX_PRECISION,spp->bytemat[2] << MATRIX_PRECISION)); // // mprintf((0, " %08x %08x %08x %08x %08x %08x\n", objp->orient.m4,objp->orient.m5,objp->orient.m6, // spp->bytemat[3] << MATRIX_PRECISION,spp->bytemat[4] << MATRIX_PRECISION,spp->bytemat[5] << MATRIX_PRECISION)); // // mprintf((0, " %08x %08x %08x %08x %08x %08x\n", objp->orient.m7,objp->orient.m8,objp->orient.m9, // spp->bytemat[6] << MATRIX_PRECISION,spp->bytemat[7] << MATRIX_PRECISION,spp->bytemat[8] << MATRIX_PRECISION)); // // mprintf((0, "Positn: %08x %08x %08x %08x %08x %08x\n", objp->pos.x, objp->pos.y, objp->pos.z, // (spp->xo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].x, // (spp->yo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].y, // (spp->zo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].z)); // mprintf((0, "Segment: %3i %3i\n", objp->segnum, spp->segment)); } void extract_shortpos(object *objp, shortpos *spp, int swap_bytes) { int segnum; int8_t *sp; sp = spp->bytemat; objp->orient.rvec.x = *sp++ << MATRIX_PRECISION; objp->orient.uvec.x = *sp++ << MATRIX_PRECISION; objp->orient.fvec.x = *sp++ << MATRIX_PRECISION; objp->orient.rvec.y = *sp++ << MATRIX_PRECISION; objp->orient.uvec.y = *sp++ << MATRIX_PRECISION; objp->orient.fvec.y = *sp++ << MATRIX_PRECISION; objp->orient.rvec.z = *sp++ << MATRIX_PRECISION; objp->orient.uvec.z = *sp++ << MATRIX_PRECISION; objp->orient.fvec.z = *sp++ << MATRIX_PRECISION; /*if (swap_bytes) { spp->xo = INTEL_SHORT(spp->xo); spp->yo = INTEL_SHORT(spp->yo); spp->zo = INTEL_SHORT(spp->zo); spp->segment = INTEL_SHORT(spp->segment); spp->velx = INTEL_SHORT(spp->velx); spp->vely = INTEL_SHORT(spp->vely); spp->velz = INTEL_SHORT(spp->velz); }*/ segnum = spp->segment; Assert((segnum >= 0) && (segnum <= Highest_segment_index)); objp->pos.x = (spp->xo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].x; objp->pos.y = (spp->yo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].y; objp->pos.z = (spp->zo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].z; objp->mtype.phys_info.velocity.x = (spp->velx << VEL_PRECISION); objp->mtype.phys_info.velocity.y = (spp->vely << VEL_PRECISION); objp->mtype.phys_info.velocity.z = (spp->velz << VEL_PRECISION); obj_relink(objp-Objects, segnum); // mprintf((0, "Matrix: %08x %08x %08x %08x %08x %08x\n", objp->orient.m1,objp->orient.m2,objp->orient.m3, // spp->bytemat[0],spp->bytemat[1],spp->bytemat[2])); // // mprintf((0, " %08x %08x %08x %08x %08x %08x\n", objp->orient.m4,objp->orient.m5,objp->orient.m6, // spp->bytemat[3],spp->bytemat[4],spp->bytemat[5])); // // mprintf((0, " %08x %08x %08x %08x %08x %08x\n", objp->orient.m7,objp->orient.m8,objp->orient.m9, // spp->bytemat[6],spp->bytemat[7],spp->bytemat[8])); // // mprintf((0, "Positn: %08x %08x %08x %08x %08x %08x\n", objp->pos.x, objp->pos.y, objp->pos.z, // (spp->xo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].x, (spp->yo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].y, (spp->zo << RELPOS_PRECISION) + Vertices[Segments[segnum].verts[0]].z)); // mprintf((0, "Segment: %3i %3i\n", objp->segnum, spp->segment)); } //--unused-- void test_shortpos(void) //--unused-- { //--unused-- shortpos spp; //--unused-- //--unused-- create_shortpos(&spp, &Objects[0]); //--unused-- extract_shortpos(&Objects[0], &spp); //--unused-- //--unused-- } // ----------------------------------------------------------------------------- // Segment validation functions. // Moved from editor to game so we can compute surface normals at load time. // ------------------------------------------------------------------------------- // ------------------------------------------------------------------------------------------ // Extract a vector from a segment. The vector goes from the start face to the end face. // The point on each face is the average of the four points forming the face. void extract_vector_from_segment(segment *sp, vms_vector *vp, int start, int end) { int i; vms_vector vs,ve; vm_vec_zero(&vs); vm_vec_zero(&ve); for (i=0; i<4; i++) { vm_vec_add2(&vs,&Vertices[sp->verts[Side_to_verts[start][i]]]); vm_vec_add2(&ve,&Vertices[sp->verts[Side_to_verts[end][i]]]); } vm_vec_sub(vp,&ve,&vs); vm_vec_scale(vp,F1_0/4); } //create a matrix that describes the orientation of the given segment void extract_orient_from_segment(vms_matrix *m,segment *seg) { vms_vector fvec,uvec; extract_vector_from_segment(seg,&fvec,WFRONT,WBACK); extract_vector_from_segment(seg,&uvec,WBOTTOM,WTOP); //vector to matrix does normalizations and orthogonalizations vm_vector_2_matrix(m,&fvec,&uvec,NULL); } #ifdef EDITOR // ------------------------------------------------------------------------------------------ // Extract the forward vector from segment *sp, return in *vp. // The forward vector is defined to be the vector from the the center of the front face of the segment // to the center of the back face of the segment. void extract_forward_vector_from_segment(segment *sp,vms_vector *vp) { extract_vector_from_segment(sp,vp,WFRONT,WBACK); } // ------------------------------------------------------------------------------------------ // Extract the right vector from segment *sp, return in *vp. // The forward vector is defined to be the vector from the the center of the left face of the segment // to the center of the right face of the segment. void extract_right_vector_from_segment(segment *sp,vms_vector *vp) { extract_vector_from_segment(sp,vp,WLEFT,WRIGHT); } // ------------------------------------------------------------------------------------------ // Extract the up vector from segment *sp, return in *vp. // The forward vector is defined to be the vector from the the center of the bottom face of the segment // to the center of the top face of the segment. void extract_up_vector_from_segment(segment *sp,vms_vector *vp) { extract_vector_from_segment(sp,vp,WBOTTOM,WTOP); } #endif void add_side_as_quad(segment *sp, int sidenum, vms_vector *normal) { side *sidep = &sp->sides[sidenum]; sidep->type = SIDE_IS_QUAD; #ifdef COMPACT_SEGS normal = normal; //avoid compiler warning #else sidep->normals[0] = *normal; sidep->normals[1] = *normal; #endif // If there is a connection here, we only formed the faces for the purpose of determining segment boundaries, // so don't generate polys, else they will get rendered. // if (sp->children[sidenum] != -1) // sidep->render_flag = 0; // else // sidep->render_flag = 1; } // ------------------------------------------------------------------------------- // Return v0, v1, v2 = 3 vertices with smallest numbers. If *negate_flag set, then negate normal after computation. // Note, you cannot just compute the normal by treating the points in the opposite direction as this introduces // small differences between normals which should merely be opposites of each other. void get_verts_for_normal(int va, int vb, int vc, int vd, int *v0, int *v1, int *v2, int *v3, int *negate_flag) { int i,j; int v[4],w[4]; // w is a list that shows how things got scrambled so we know if our normal is pointing backwards for (i=0; i<4; i++) w[i] = i; v[0] = va; v[1] = vb; v[2] = vc; v[3] = vd; for (i=1; i<4; i++) for (j=0; j<i; j++) if (v[j] > v[i]) { int t; t = v[j]; v[j] = v[i]; v[i] = t; t = w[j]; w[j] = w[i]; w[i] = t; } Assert((v[0] < v[1]) && (v[1] < v[2]) && (v[2] < v[3])); // Now, if for any w[i] & w[i+1]: w[i+1] = (w[i]+3)%4, then must swap *v0 = v[0]; *v1 = v[1]; *v2 = v[2]; *v3 = v[3]; if ( (((w[0]+3) % 4) == w[1]) || (((w[1]+3) % 4) == w[2])) *negate_flag = 1; else *negate_flag = 0; } // ------------------------------------------------------------------------------- void add_side_as_2_triangles(segment *sp, int sidenum) { vms_vector norm; int8_t *vs = Side_to_verts[sidenum]; fix dot; vms_vector vec_13; // vector from vertex 1 to vertex 3 side *sidep = &sp->sides[sidenum]; // Choose how to triangulate. // If a wall, then // Always triangulate so segment is convex. // Use Matt's formula: Na . AD > 0, where ABCD are vertices on side, a is face formed by A,B,C, Na is normal from face a. // If not a wall, then triangulate so whatever is on the other side is triangulated the same (ie, between the same absoluate vertices) if (!IS_CHILD(sp->children[sidenum])) { vm_vec_normal(&norm, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[2]]]); vm_vec_sub(&vec_13, &Vertices[sp->verts[vs[3]]], &Vertices[sp->verts[vs[1]]]); dot = vm_vec_dot(&norm, &vec_13); // Now, signifiy whether to triangulate from 0:2 or 1:3 if (dot >= 0) sidep->type = SIDE_IS_TRI_02; else sidep->type = SIDE_IS_TRI_13; #ifndef COMPACT_SEGS // Now, based on triangulation type, set the normals. if (sidep->type == SIDE_IS_TRI_02) { vm_vec_normal(&norm, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[2]]]); sidep->normals[0] = norm; vm_vec_normal(&norm, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[2]]], &Vertices[sp->verts[vs[3]]]); sidep->normals[1] = norm; } else { vm_vec_normal(&norm, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[3]]]); sidep->normals[0] = norm; vm_vec_normal(&norm, &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[2]]], &Vertices[sp->verts[vs[3]]]); sidep->normals[1] = norm; } #endif } else { int i,v[4], vsorted[4]; int negate_flag; for (i=0; i<4; i++) v[i] = sp->verts[vs[i]]; get_verts_for_normal(v[0], v[1], v[2], v[3], &vsorted[0], &vsorted[1], &vsorted[2], &vsorted[3], &negate_flag); if ((vsorted[0] == v[0]) || (vsorted[0] == v[2])) { sidep->type = SIDE_IS_TRI_02; #ifndef COMPACT_SEGS // Now, get vertices for normal for each triangle based on triangulation type. get_verts_for_normal(v[0], v[1], v[2], 32767, &vsorted[0], &vsorted[1], &vsorted[2], &vsorted[3], &negate_flag); vm_vec_normal(&norm, &Vertices[vsorted[0]], &Vertices[vsorted[1]], &Vertices[vsorted[2]]); if (negate_flag) vm_vec_negate(&norm); sidep->normals[0] = norm; get_verts_for_normal(v[0], v[2], v[3], 32767, &vsorted[0], &vsorted[1], &vsorted[2], &vsorted[3], &negate_flag); vm_vec_normal(&norm, &Vertices[vsorted[0]], &Vertices[vsorted[1]], &Vertices[vsorted[2]]); if (negate_flag) vm_vec_negate(&norm); sidep->normals[1] = norm; #endif } else { sidep->type = SIDE_IS_TRI_13; #ifndef COMPACT_SEGS // Now, get vertices for normal for each triangle based on triangulation type. get_verts_for_normal(v[0], v[1], v[3], 32767, &vsorted[0], &vsorted[1], &vsorted[2], &vsorted[3], &negate_flag); vm_vec_normal(&norm, &Vertices[vsorted[0]], &Vertices[vsorted[1]], &Vertices[vsorted[2]]); if (negate_flag) vm_vec_negate(&norm); sidep->normals[0] = norm; get_verts_for_normal(v[1], v[2], v[3], 32767, &vsorted[0], &vsorted[1], &vsorted[2], &vsorted[3], &negate_flag); vm_vec_normal(&norm, &Vertices[vsorted[0]], &Vertices[vsorted[1]], &Vertices[vsorted[2]]); if (negate_flag) vm_vec_negate(&norm); sidep->normals[1] = norm; #endif } } } int sign(fix v) { if (v > PLANE_DIST_TOLERANCE) return 1; else if (v < -(PLANE_DIST_TOLERANCE+1)) //neg & pos round differently return -1; else return 0; } // ------------------------------------------------------------------------------- void create_walls_on_side(segment *sp, int sidenum) { int vm0, vm1, vm2, vm3, negate_flag; int v0, v1, v2, v3; vms_vector vn; fix dist_to_plane; v0 = sp->verts[Side_to_verts[sidenum][0]]; v1 = sp->verts[Side_to_verts[sidenum][1]]; v2 = sp->verts[Side_to_verts[sidenum][2]]; v3 = sp->verts[Side_to_verts[sidenum][3]]; get_verts_for_normal(v0, v1, v2, v3, &vm0, &vm1, &vm2, &vm3, &negate_flag); vm_vec_normal(&vn, &Vertices[vm0], &Vertices[vm1], &Vertices[vm2]); dist_to_plane = abs(vm_dist_to_plane(&Vertices[vm3], &vn, &Vertices[vm0])); //if ((sp-Segments == 0x7b) && (sidenum == 3)) { // mprintf((0, "Verts = %3i %3i %3i %3i, negate flag = %3i, dist = %8x\n", vm0, vm1, vm2, vm3, negate_flag, dist_to_plane)); // mprintf((0, " Normal = %8x %8x %8x\n", vn.x, vn.y, vn.z)); // mprintf((0, " Vert %3i = [%8x %8x %8x]\n", vm0, Vertices[vm0].x, Vertices[vm0].y, Vertices[vm0].z)); // mprintf((0, " Vert %3i = [%8x %8x %8x]\n", vm1, Vertices[vm1].x, Vertices[vm1].y, Vertices[vm1].z)); // mprintf((0, " Vert %3i = [%8x %8x %8x]\n", vm2, Vertices[vm2].x, Vertices[vm2].y, Vertices[vm2].z)); // mprintf((0, " Vert %3i = [%8x %8x %8x]\n", vm3, Vertices[vm3].x, Vertices[vm3].y, Vertices[vm3].z)); //} //if ((sp-Segments == 0x86) && (sidenum == 5)) { // mprintf((0, "Verts = %3i %3i %3i %3i, negate flag = %3i, dist = %8x\n", vm0, vm1, vm2, vm3, negate_flag, dist_to_plane)); // mprintf((0, " Normal = %8x %8x %8x\n", vn.x, vn.y, vn.z)); // mprintf((0, " Vert %3i = [%8x %8x %8x]\n", vm0, Vertices[vm0].x, Vertices[vm0].y, Vertices[vm0].z)); // mprintf((0, " Vert %3i = [%8x %8x %8x]\n", vm1, Vertices[vm1].x, Vertices[vm1].y, Vertices[vm1].z)); // mprintf((0, " Vert %3i = [%8x %8x %8x]\n", vm2, Vertices[vm2].x, Vertices[vm2].y, Vertices[vm2].z)); // mprintf((0, " Vert %3i = [%8x %8x %8x]\n", vm3, Vertices[vm3].x, Vertices[vm3].y, Vertices[vm3].z)); //} if (negate_flag) vm_vec_negate(&vn); if (dist_to_plane <= PLANE_DIST_TOLERANCE) add_side_as_quad(sp, sidenum, &vn); else { add_side_as_2_triangles(sp, sidenum); //this code checks to see if we really should be triangulated, and //de-triangulates if we shouldn't be. { int num_faces; int vertex_list[6]; fix dist0,dist1; int s0,s1; int vertnum; side *s; create_abs_vertex_lists( &num_faces, vertex_list, sp-Segments, sidenum); Assert(num_faces == 2); s = &sp->sides[sidenum]; vertnum = std::min(vertex_list[0],vertex_list[2]); #ifdef COMPACT_SEGS { vms_vector normals[2]; get_side_normals(sp, sidenum, &normals[0], &normals[1] ); dist0 = vm_dist_to_plane(&Vertices[vertex_list[1]],&normals[1],&Vertices[vertnum]); dist1 = vm_dist_to_plane(&Vertices[vertex_list[4]],&normals[0],&Vertices[vertnum]); } #else dist0 = vm_dist_to_plane(&Vertices[vertex_list[1]],&s->normals[1],&Vertices[vertnum]); dist1 = vm_dist_to_plane(&Vertices[vertex_list[4]],&s->normals[0],&Vertices[vertnum]); #endif s0 = sign(dist0); s1 = sign(dist1); if (s0==0 || s1==0 || s0!=s1) { sp->sides[sidenum].type = SIDE_IS_QUAD; //detriangulate! #ifndef COMPACT_SEGS sp->sides[sidenum].normals[0] = vn; sp->sides[sidenum].normals[1] = vn; #endif } } } } #ifdef COMPACT_SEGS //#define CACHE_DEBUG 1 #define MAX_CACHE_NORMALS 128 #define CACHE_MASK 127 typedef struct ncache_element { short segnum; uint8_t sidenum; vms_vector normals[2]; } ncache_element; int ncache_initialized = 0; ncache_element ncache[MAX_CACHE_NORMALS]; #ifdef CACHE_DEBUG int ncache_counter = 0; int ncache_hits = 0; int ncache_misses = 0; #endif void ncache_init() { ncache_flush(); ncache_initialized = 1; } void ncache_flush() { int i; for (i=0; i<MAX_CACHE_NORMALS; i++ ) { ncache[i].segnum = -1; } } // ------------------------------------------------------------------------------- int find_ncache_element( int segnum, int sidenum, int face_flags ) { uint i; if (!ncache_initialized) ncache_init(); #ifdef CACHE_DEBUG if (((++ncache_counter % 5000)==1) && (ncache_hits+ncache_misses > 0)) mprintf(( 0, "NCACHE %d%% missed, H:%d, M:%d\n", (ncache_misses*100)/(ncache_hits+ncache_misses), ncache_hits, ncache_misses )); #endif i = ((segnum<<2) ^ sidenum) & CACHE_MASK; if ((ncache[i].segnum == segnum) && ((ncache[i].sidenum&0xf)==sidenum) ) { uint f1; #ifdef CACHE_DEBUG ncache_hits++; #endif f1 = ncache[i].sidenum>>4; if ( (f1&face_flags)==face_flags ) return i; if ( f1 & 1 ) uncached_get_side_normal( &Segments[segnum], sidenum, 1, &ncache[i].normals[1] ); else uncached_get_side_normal( &Segments[segnum], sidenum, 0, &ncache[i].normals[0] ); ncache[i].sidenum |= face_flags<<4; return i; } #ifdef CACHE_DEBUG ncache_misses++; #endif switch( face_flags ) { case 1: uncached_get_side_normal( &Segments[segnum], sidenum, 0, &ncache[i].normals[0] ); break; case 2: uncached_get_side_normal( &Segments[segnum], sidenum, 1, &ncache[i].normals[1] ); break; case 3: uncached_get_side_normals(&Segments[segnum], sidenum, &ncache[i].normals[0], &ncache[i].normals[1] ); break; } ncache[i].segnum = segnum; ncache[i].sidenum = sidenum | (face_flags<<4); return i; } void get_side_normal(segment *sp, int sidenum, int face_num, vms_vector * vm ) { int i; i = find_ncache_element( sp - Segments, sidenum, 1 << face_num ); *vm = ncache[i].normals[face_num]; if (0) { vms_vector tmp; uncached_get_side_normal(sp, sidenum, face_num, &tmp ); Assert( tmp.x == vm->x ); Assert( tmp.y == vm->y ); Assert( tmp.z == vm->z ); } } void get_side_normals(segment *sp, int sidenum, vms_vector * vm1, vms_vector * vm2 ) { int i; i = find_ncache_element( sp - Segments, sidenum, 3 ); *vm1 = ncache[i].normals[0]; *vm2 = ncache[i].normals[1]; if (0) { vms_vector tmp; uncached_get_side_normal(sp, sidenum, 0, &tmp ); Assert( tmp.x == vm1->x ); Assert( tmp.y == vm1->y ); Assert( tmp.z == vm1->z ); uncached_get_side_normal(sp, sidenum, 1, &tmp ); Assert( tmp.x == vm2->x ); Assert( tmp.y == vm2->y ); Assert( tmp.z == vm2->z ); } } void uncached_get_side_normal(segment *sp, int sidenum, int face_num, vms_vector * vm ) { int vm0, vm1, vm2, vm3, negate_flag; char *vs = Side_to_verts[sidenum]; switch( sp->sides[sidenum].type ) { case SIDE_IS_QUAD: get_verts_for_normal(sp->verts[vs[0]], sp->verts[vs[1]], sp->verts[vs[2]], sp->verts[vs[3]], &vm0, &vm1, &vm2, &vm3, &negate_flag); vm_vec_normal(vm, &Vertices[vm0], &Vertices[vm1], &Vertices[vm2]); if (negate_flag) vm_vec_negate(vm); break; case SIDE_IS_TRI_02: if ( face_num == 0 ) vm_vec_normal(vm, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[2]]]); else vm_vec_normal(vm, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[2]]], &Vertices[sp->verts[vs[3]]]); break; case SIDE_IS_TRI_13: if ( face_num == 0 ) vm_vec_normal(vm, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[3]]]); else vm_vec_normal(vm, &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[2]]], &Vertices[sp->verts[vs[3]]]); break; } } void uncached_get_side_normals(segment *sp, int sidenum, vms_vector * vm1, vms_vector * vm2 ) { int vvm0, vvm1, vvm2, vvm3, negate_flag; char *vs = Side_to_verts[sidenum]; switch( sp->sides[sidenum].type ) { case SIDE_IS_QUAD: get_verts_for_normal(sp->verts[vs[0]], sp->verts[vs[1]], sp->verts[vs[2]], sp->verts[vs[3]], &vvm0, &vvm1, &vvm2, &vvm3, &negate_flag); vm_vec_normal(vm1, &Vertices[vvm0], &Vertices[vvm1], &Vertices[vvm2]); if (negate_flag) vm_vec_negate(vm1); *vm2 = *vm1; break; case SIDE_IS_TRI_02: vm_vec_normal(vm1, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[2]]]); vm_vec_normal(vm2, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[2]]], &Vertices[sp->verts[vs[3]]]); break; case SIDE_IS_TRI_13: vm_vec_normal(vm1, &Vertices[sp->verts[vs[0]]], &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[3]]]); vm_vec_normal(vm2, &Vertices[sp->verts[vs[1]]], &Vertices[sp->verts[vs[2]]], &Vertices[sp->verts[vs[3]]]); break; } } #endif // ------------------------------------------------------------------------------- void validate_removable_wall(segment *sp, int sidenum, int tmap_num) { create_walls_on_side(sp, sidenum); sp->sides[sidenum].tmap_num = tmap_num; // assign_default_uvs_to_side(sp, sidenum); // assign_light_to_side(sp, sidenum); } // ------------------------------------------------------------------------------- // Make a just-modified segment side valid. void validate_segment_side(segment *sp, int sidenum) { if (sp->sides[sidenum].wall_num == -1) create_walls_on_side(sp, sidenum); else // create_removable_wall(sp, sidenum, sp->sides[sidenum].tmap_num); validate_removable_wall(sp, sidenum, sp->sides[sidenum].tmap_num); // Set render_flag. // If side doesn't have a child, then render wall. If it does have a child, but there is a temporary // wall there, then do render wall. // if (sp->children[sidenum] == -1) // sp->sides[sidenum].render_flag = 1; // else if (sp->sides[sidenum].wall_num != -1) // sp->sides[sidenum].render_flag = 1; // else // sp->sides[sidenum].render_flag = 0; } extern int check_for_degenerate_segment(segment *sp); // ------------------------------------------------------------------------------- // Make a just-modified segment valid. // check all sides to see how many faces they each should have (0,1,2) // create new vector normals void validate_segment(segment *sp) { int side; #ifdef EDITOR check_for_degenerate_segment(sp); #endif for (side = 0; side < MAX_SIDES_PER_SEGMENT; side++) validate_segment_side(sp, side); // assign_default_uvs_to_segment(sp); } // ------------------------------------------------------------------------------- // Validate all segments. // Highest_segment_index must be set. // For all used segments (number <= Highest_segment_index), segnum field must be != -1. void validate_segment_all(void) { int s; for (s=0; s<=Highest_segment_index; s++) #ifdef EDITOR if (Segments[s].segnum != -1) #endif validate_segment(&Segments[s]); #ifdef EDITOR { int said=0; for (s=Highest_segment_index+1; s<MAX_SEGMENTS; s++) if (Segments[s].segnum != -1) { if (!said) { mprintf((0, "Segment %i has invalid segnum. Bashing to -1. Silently bashing all others...", s)); } said++; Segments[s].segnum = -1; } if (said) mprintf((0, "%i fixed.\n", said)); } #endif #ifndef NDEBUG #ifndef COMPACT_SEGS if (check_segment_connections()) Int3(); //Get Matt, si vous plait. #endif #endif } // ------------------------------------------------------------------------------------------------------ // Picks a random point in a segment like so: // From center, go up to 50% of way towards any of the 8 vertices. void pick_random_point_in_seg(vms_vector *new_pos, int segnum) { int vnum; vms_vector vec2; compute_segment_center(new_pos, &Segments[segnum]); vnum = (P_Rand() * MAX_VERTICES_PER_SEGMENT) >> 15; vm_vec_sub(&vec2, &Vertices[Segments[segnum].verts[vnum]], new_pos); vm_vec_scale(&vec2, P_Rand()); // P_Rand() always in 0..1/2 vm_vec_add2(new_pos, &vec2); } // ---------------------------------------------------------------------------------------------------------- // Set the segment depth of all segments from start_seg in *segbuf. // Returns maximum depth value. int set_segment_depths(int start_seg, uint8_t *segbuf) { int i, curseg; uint8_t visited[MAX_SEGMENTS]; int queue[MAX_SEGMENTS]; int head, tail; int depth; int parent_depth; depth = 1; head = 0; tail = 0; for (i=0; i<=Highest_segment_index; i++) visited[i] = 0; if (segbuf[start_seg] == 0) return 1; queue[tail++] = start_seg; visited[start_seg] = 1; segbuf[start_seg] = depth++; if (depth == 0) depth = 255; while (head < tail) { curseg = queue[head++]; parent_depth = segbuf[curseg]; for (i=0; i<MAX_SIDES_PER_SEGMENT; i++) { int childnum; childnum = Segments[curseg].children[i]; if (childnum != -1) if (segbuf[childnum]) if (!visited[childnum]) { visited[childnum] = 1; segbuf[childnum] = parent_depth+1; queue[tail++] = childnum; } } } return parent_depth+1; } //these constants should match the ones in seguvs #define LIGHT_DISTANCE_THRESHOLD (F1_0*80) #define Magical_light_constant (F1_0*16) #define MAX_CHANGED_SEGS 30 short changed_segs[MAX_CHANGED_SEGS]; int n_changed_segs; // ------------------------------------------------------------------------------------------ //cast static light from a segment to nearby segments void apply_light_to_segment(segment *segp,vms_vector *segment_center, fix light_intensity,int recursion_depth) { vms_vector r_segment_center; fix dist_to_rseg; int i,segnum=segp-Segments,sidenum; for (i=0;i<n_changed_segs;i++) if (changed_segs[i] == segnum) break; if (i == n_changed_segs) { compute_segment_center(&r_segment_center, segp); dist_to_rseg = vm_vec_dist_quick(&r_segment_center, segment_center); if (dist_to_rseg <= LIGHT_DISTANCE_THRESHOLD) { fix light_at_point; if (dist_to_rseg > F1_0) light_at_point = fixdiv(Magical_light_constant, dist_to_rseg); else light_at_point = Magical_light_constant; if (light_at_point >= 0) { segment2 *seg2p = &Segment2s[segnum]; light_at_point = fixmul(light_at_point, light_intensity); if (light_at_point >= F1_0) light_at_point = F1_0-1; if (light_at_point <= -F1_0) light_at_point = -(F1_0-1); seg2p->static_light += light_at_point; if (seg2p->static_light < 0) // if it went negative, saturate seg2p->static_light = 0; } // end if (light_at_point... } // end if (dist_to_rseg... changed_segs[n_changed_segs++] = segnum; } if (recursion_depth < 2) for (sidenum=0; sidenum<6; sidenum++) { if (WALL_IS_DOORWAY(segp,sidenum) & WID_RENDPAST_FLAG) apply_light_to_segment(&Segments[segp->children[sidenum]],segment_center,light_intensity,recursion_depth+1); } } extern object *old_viewer; //update the static_light field in a segment, which is used for object lighting //this code is copied from the editor routine calim_process_all_lights() void change_segment_light(int segnum,int sidenum,int dir) { segment *segp = &Segments[segnum]; if (WALL_IS_DOORWAY(segp, sidenum) & WID_RENDER_FLAG) { side *sidep = &segp->sides[sidenum]; fix light_intensity; light_intensity = TmapInfo[sidep->tmap_num].lighting + TmapInfo[sidep->tmap_num2 & 0x3fff].lighting; light_intensity *= dir; n_changed_segs = 0; if (light_intensity) { vms_vector segment_center; compute_segment_center(&segment_center, segp); apply_light_to_segment(segp,&segment_center,light_intensity,0); } } //this is a horrible hack to get around the horrible hack used to //smooth lighting values when an object moves between segments old_viewer = NULL; } // ------------------------------------------------------------------------------------------ // dir = +1 -> add light // dir = -1 -> subtract light // dir = 17 -> add 17x light // dir = 0 -> you are dumb void change_light(int segnum, int sidenum, int dir) { int i, j, k; for (i=0; i<Num_static_lights; i++) { if ((Dl_indices[i].segnum == segnum) && (Dl_indices[i].sidenum == sidenum)) { delta_light *dlp; dlp = &Delta_lights[Dl_indices[i].index]; for (j=0; j<Dl_indices[i].count; j++) { for (k=0; k<4; k++) { fix dl,new_l; dl = dir * dlp->vert_light[k] * DL_SCALE; Assert((dlp->segnum >= 0) && (dlp->segnum <= Highest_segment_index)); Assert((dlp->sidenum >= 0) && (dlp->sidenum < MAX_SIDES_PER_SEGMENT)); new_l = (Segments[dlp->segnum].sides[dlp->sidenum].uvls[k].l += dl); if (new_l < 0) Segments[dlp->segnum].sides[dlp->sidenum].uvls[k].l = 0; } dlp++; } } } //recompute static light for segment change_segment_light(segnum,sidenum,dir); } // Subtract light cast by a light source from all surfaces to which it applies light. // This is precomputed data, stored at static light application time in the editor (the slow lighting function). // returns 1 if lights actually subtracted, else 0 int subtract_light(int segnum, int sidenum) { if (Light_subtracted[segnum] & (1 << sidenum)) { //mprintf((0, "Warning: Trying to subtract light from a source twice!\n")); return 0; } Light_subtracted[segnum] |= (1 << sidenum); change_light(segnum, sidenum, -1); return 1; } // Add light cast by a light source from all surfaces to which it applies light. // This is precomputed data, stored at static light application time in the editor (the slow lighting function). // You probably only want to call this after light has been subtracted. // returns 1 if lights actually added, else 0 int add_light(int segnum, int sidenum) { if (!(Light_subtracted[segnum] & (1 << sidenum))) { //mprintf((0, "Warning: Trying to add light which has never been subtracted!\n")); return 0; } Light_subtracted[segnum] &= ~(1 << sidenum); change_light(segnum, sidenum, 1); return 1; } // Light_subtracted[i] contains bit indicators for segment #i. // If bit n (1 << n) is set, then side #n in segment #i has had light subtracted from original (editor-computed) value. uint8_t Light_subtracted[MAX_SEGMENTS]; // Parse the Light_subtracted array, turning on or off all lights. void apply_all_changed_light(void) { int i,j; for (i=0; i<=Highest_segment_index; i++) { for (j=0; j<MAX_SIDES_PER_SEGMENT; j++) if (Light_subtracted[i] & (1 << j)) change_light(i, j, -1); } } //@@// Scans Light_subtracted bit array. //@@// For all light sources which have had their light subtracted, adds light back in. //@@void restore_all_lights_in_mine(void) //@@{ //@@ int i, j, k; //@@ //@@ for (i=0; i<Num_static_lights; i++) { //@@ int segnum, sidenum; //@@ delta_light *dlp; //@@ //@@ segnum = Dl_indices[i].segnum; //@@ sidenum = Dl_indices[i].sidenum; //@@ if (Light_subtracted[segnum] & (1 << sidenum)) { //@@ dlp = &Delta_lights[Dl_indices[i].index]; //@@ //@@ Light_subtracted[segnum] &= ~(1 << sidenum); //@@ for (j=0; j<Dl_indices[i].count; j++) { //@@ for (k=0; k<4; k++) { //@@ fix dl; //@@ dl = dlp->vert_light[k] * DL_SCALE; //@@ Assert((dlp->segnum >= 0) && (dlp->segnum <= Highest_segment_index)); //@@ Assert((dlp->sidenum >= 0) && (dlp->sidenum < MAX_SIDES_PER_SEGMENT)); //@@ Segments[dlp->segnum].sides[dlp->sidenum].uvls[k].l += dl; //@@ } //@@ dlp++; //@@ } //@@ } //@@ } //@@} // Should call this whenever a new mine gets loaded. // More specifically, should call this whenever something global happens // to change the status of static light in the mine. void clear_light_subtracted(void) { int i; for (i=0; i<=Highest_segment_index; i++) Light_subtracted[i] = 0; } // ----------------------------------------------------------------------------- fix find_connected_distance_segments( int seg0, int seg1, int depth, int wid_flag) { vms_vector p0, p1; compute_segment_center(&p0, &Segments[seg0]); compute_segment_center(&p1, &Segments[seg1]); return find_connected_distance(&p0, seg0, &p1, seg1, depth, wid_flag); } #define AMBIENT_SEGMENT_DEPTH 5 // ----------------------------------------------------------------------------- // Do a bfs from segnum, marking slots in marked_segs if the segment is reachable. void ambient_mark_bfs(int segnum, int8_t *marked_segs, int depth) { int i; if (depth < 0) return; marked_segs[segnum] = 1; for (i=0; i<MAX_SIDES_PER_SEGMENT; i++) { int child = Segments[segnum].children[i]; if (IS_CHILD(child) && (WALL_IS_DOORWAY(&Segments[segnum],i) & WID_RENDPAST_FLAG) && !marked_segs[child]) ambient_mark_bfs(child, marked_segs, depth-1); } } // ----------------------------------------------------------------------------- // Indicate all segments which are within audible range of falling water or lava, // and so should hear ambient gurgles. void set_ambient_sound_flags_common(int tmi_bit, int s2f_bit) { int i, j; int8_t marked_segs[MAX_SEGMENTS]; // Now, all segments containing ambient lava or water sound makers are flagged. // Additionally flag all segments which are within range of them. for (i=0; i<=Highest_segment_index; i++) { marked_segs[i] = 0; Segment2s[i].s2_flags &= ~s2f_bit; } // Mark all segments which are sources of the sound. for (i=0; i<=Highest_segment_index; i++) { segment *segp = &Segments[i]; segment2 *seg2p = &Segment2s[i]; for (j=0; j<MAX_SIDES_PER_SEGMENT; j++) { side *sidep = &segp->sides[j]; if ((TmapInfo[sidep->tmap_num].flags & tmi_bit) || (TmapInfo[sidep->tmap_num2 & 0x3fff].flags & tmi_bit)) { if (!IS_CHILD(segp->children[j]) || (sidep->wall_num != -1)) { seg2p->s2_flags |= s2f_bit; marked_segs[i] = 1; // Say it's itself that it is close enough to to hear something. } } } } // Next mark all segments within N segments of a source. for (i=0; i<=Highest_segment_index; i++) { segment2 *seg2p = &Segment2s[i]; if (seg2p->s2_flags & s2f_bit) ambient_mark_bfs(i, marked_segs, AMBIENT_SEGMENT_DEPTH); } // Now, flip bits in all segments which can hear the ambient sound. for (i=0; i<=Highest_segment_index; i++) if (marked_segs[i]) Segment2s[i].s2_flags |= s2f_bit; } // ----------------------------------------------------------------------------- // Indicate all segments which are within audible range of falling water or lava, // and so should hear ambient gurgles. // Bashes values in Segment2s array. void set_ambient_sound_flags(void) { set_ambient_sound_flags_common(TMI_VOLATILE, S2F_AMBIENT_LAVA); set_ambient_sound_flags_common(TMI_WATER, S2F_AMBIENT_WATER); }
30.694581
219
0.634525
Kreeblah
968c396fc3be636ce57ca53eae55cc1abc49e699
358
cpp
C++
6. Heaps/Function_operator.cpp
suraj0803/DSA
6ea21e452d7662e2351ee2a7b0415722e1bbf094
[ "MIT" ]
null
null
null
6. Heaps/Function_operator.cpp
suraj0803/DSA
6ea21e452d7662e2351ee2a7b0415722e1bbf094
[ "MIT" ]
null
null
null
6. Heaps/Function_operator.cpp
suraj0803/DSA
6ea21e452d7662e2351ee2a7b0415722e1bbf094
[ "MIT" ]
null
null
null
#include<iostream> using namespace std; class Func { public: void operator()(){ cout<<"Having Fun inside Operator() func."; } }; int main() { Func f;// Constructor f();// Overloaded() Operator = Function call f is an object. As it is a object but it is behaving like a functional call. return 0; }
16.272727
126
0.583799
suraj0803
968c4e4d936965d36e0e8e9fc2f6cf999205efaa
3,579
cpp
C++
src/reduced_alphabet_coder.cpp
metaVariable/ghostz
273cc1efe6278f8012fa9232d854e392b467477f
[ "BSD-2-Clause" ]
null
null
null
src/reduced_alphabet_coder.cpp
metaVariable/ghostz
273cc1efe6278f8012fa9232d854e392b467477f
[ "BSD-2-Clause" ]
null
null
null
src/reduced_alphabet_coder.cpp
metaVariable/ghostz
273cc1efe6278f8012fa9232d854e392b467477f
[ "BSD-2-Clause" ]
null
null
null
/* * reduced_alphabet_coder.cpp * * Created on: 2012/11/29 * Author: shu */ #include <iostream> #include <stdint.h> #include <vector> #include <string.h> #include <string> #include <algorithm> #include <limits.h> #include "alphabet_type.h" #include "alphabet_coder.h" #include "reduced_alphabet_coder.h" using namespace std; ReducedAlphabetCoder::ReducedAlphabetCoder() {} ReducedAlphabetCoder::ReducedAlphabetCoder(const AlphabetType &type) : AlphabetCoder(type) { } ReducedAlphabetCoder::ReducedAlphabetCoder(const AlphabetType &type, const std::vector<std::string> &alphabet_sets) { Set(type, alphabet_sets); } ReducedAlphabetCoder::~ReducedAlphabetCoder() {} bool ReducedAlphabetCoder::Set(const AlphabetType &type, const std::vector<std::string> &alphabet_sets) { vector<string> upper_alphabet_sets(alphabet_sets.size()); for (size_t i = 0; i < upper_alphabet_sets.size(); ++i) { upper_alphabet_sets[i].resize(alphabet_sets[i].size()); transform(alphabet_sets[i].begin(), alphabet_sets[i].end(), upper_alphabet_sets[i].begin(), ToUpper()); } min_regular_letter_code_ = 0; uint32_t number_codes = 0; string letters(""); letters += type.GetRegularLetters(); size_t ambiguous_letters_offset = letters.size(); letters += type.GetAmbiguousLetters(); size_t unkown_letter_offset = letters.size(); letters += type.GetUnknownLetter(); unknown_letter_ = toupper(type.GetUnknownLetter()); transform(letters.begin(), letters.end(), letters.begin(), ToUpper()); for (size_t i = 0; i < ambiguous_letters_offset; ++i) { char representative_alphabet = GetRepresentativeAlphabet(upper_alphabet_sets, letters[i]); if(representative_alphabet == letters[i]) { ++number_codes; } } max_regular_letter_code_ = number_codes - 1; for (size_t i = ambiguous_letters_offset; i < unkown_letter_offset; ++i) { char representative_alphabet = GetRepresentativeAlphabet(upper_alphabet_sets, letters[i]); if(representative_alphabet == letters[i]) { ++number_codes; } } char representative_alphabet = GetRepresentativeAlphabet(upper_alphabet_sets, letters[unkown_letter_offset]); unknown_code_ = representative_alphabet; if (representative_alphabet == letters[unkown_letter_offset]) { ++number_codes; } max_code_ = number_codes - 1; for (int i = 0; i < UCHAR_MAX; ++i) { code_map_[i] = unknown_code_; } Code code = 0; decode_map_.resize(max_code_ + 1,unknown_letter_); for (uint32_t i = 0; i < letters.length(); ++i) { representative_alphabet = GetRepresentativeAlphabet(upper_alphabet_sets, letters[i]); if (representative_alphabet == letters[i]) { code_map_[static_cast<int>(letters[i])] = code; code_map_[tolower(letters[i])] = code; decode_map_[code] = toupper(letters[i]); ++code; } } for (uint32_t i = 0; i < letters.length(); ++i) { representative_alphabet = GetRepresentativeAlphabet(upper_alphabet_sets, letters[i]); if (representative_alphabet != letters[i]) { code = code_map_[static_cast<int>(representative_alphabet)]; code_map_[static_cast<int>(letters[i])] = code; code_map_[tolower(letters[i])] = code; } } return true; } char ReducedAlphabetCoder::GetRepresentativeAlphabet(const std::vector<std::string> &alphabet_sets, const char c) { for (size_t i = 0; i < alphabet_sets.size(); ++i) { size_t count = 0; for (; count < alphabet_sets[i].size(); ++count) { if (alphabet_sets[i][count] == c) { return alphabet_sets[i][0]; } } } return c; }
31.955357
117
0.703828
metaVariable
96907c79e30112aaa62c8163758696a7b9830acd
1,806
cpp
C++
Sample/main.cpp
Skycoder42/QXmlCodeGen
e82366439fcb7e5fb3435b9a07961d4c4f07169c
[ "BSD-3-Clause" ]
1
2019-04-02T21:05:21.000Z
2019-04-02T21:05:21.000Z
Sample/main.cpp
Skycoder42/QXmlCodeGen
e82366439fcb7e5fb3435b9a07961d4c4f07169c
[ "BSD-3-Clause" ]
1
2019-02-17T09:20:59.000Z
2019-02-17T10:34:31.000Z
Sample/main.cpp
Skycoder42/QXmlCodeGen
e82366439fcb7e5fb3435b9a07961d4c4f07169c
[ "BSD-3-Clause" ]
null
null
null
#include <QCoreApplication> #include <QDebug> #include <QtTest> #include "testreader.h" class TestXmlCodeGen : public QObject { Q_OBJECT private Q_SLOTS: void testParser_data(); void testParser(); }; void TestXmlCodeGen::testParser_data() { QTest::addColumn<QString>("path"); QTest::addColumn<bool>("success"); QTest::addColumn<int>("resultIndex"); QTest::newRow("RootString.valid") << QStringLiteral(SRCDIR "/test1.xml") << true << 0; QTest::newRow("RootString.invalid.root") << QStringLiteral(SRCDIR "/test2.xml") << false << -1; QTest::newRow("RootString.invalid.content.data") << QStringLiteral(SRCDIR "/test3.xml") << false << -1; QTest::newRow("Root1.valid") << QStringLiteral(SRCDIR "/test4.xml") << true << 1; QTest::newRow("Root2.valid") << QStringLiteral(SRCDIR "/test5.xml") << true << 2; QTest::newRow("Root3.valid") << QStringLiteral(SRCDIR "/test6.xml") << true << 3; QTest::newRow("Root4.text") << QStringLiteral(SRCDIR "/test7.xml") << true << 4; QTest::newRow("Root4.content") << QStringLiteral(SRCDIR "/test8.xml") << true << 4; QTest::newRow("Root5") << QStringLiteral(SRCDIR "/test9.xml") << true << 5; } void TestXmlCodeGen::testParser() { QFETCH(QString, path); QFETCH(bool, success); QFETCH(int, resultIndex); try { TestReader reader; if(success) { auto res = reader.readDocument(path); QCOMPARE(res.index(), static_cast<size_t>(resultIndex)); } else QVERIFY_EXCEPTION_THROWN(reader.readDocument(path), TestNamespace::TestClass::Exception); } catch(std::exception &e) { if(success) QFAIL(e.what()); } } QTEST_MAIN(TestXmlCodeGen) #include "main.moc"
25.083333
92
0.621262
Skycoder42
96944eca5fdd3a75a08c5fe0b20976bf108c3e22
716
cpp
C++
Algorithm/algorithm-easy/List/5.cpp
TommyGong08/Leetcode
5359dfcb6b846e18e21efde07914027e958c0073
[ "MIT" ]
null
null
null
Algorithm/algorithm-easy/List/5.cpp
TommyGong08/Leetcode
5359dfcb6b846e18e21efde07914027e958c0073
[ "MIT" ]
null
null
null
Algorithm/algorithm-easy/List/5.cpp
TommyGong08/Leetcode
5359dfcb6b846e18e21efde07914027e958c0073
[ "MIT" ]
null
null
null
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: bool isPalindrome(ListNode* head) { //将每个值压入堆栈 vector<int> v; ListNode* p = head; while(p != NULL){ v.push_back(p->val); p = p->next; } int i=0; int flag = 1; while(i < v.size()){ if(v[i] == v.back()){ v.pop_back(); i++; } else{ flag = 0; break; } } if(flag == 0) return false; else return true; } };
21.058824
46
0.393855
TommyGong08
f7b93aaf28a8669274d072a0108f84f111f06677
4,046
hpp
C++
include/glimpse/renderbuffer.hpp
fabianishere/glimpse
12a16f4f254152a6ed8f64f143d058a269000aaf
[ "MIT" ]
null
null
null
include/glimpse/renderbuffer.hpp
fabianishere/glimpse
12a16f4f254152a6ed8f64f143d058a269000aaf
[ "MIT" ]
null
null
null
include/glimpse/renderbuffer.hpp
fabianishere/glimpse
12a16f4f254152a6ed8f64f143d058a269000aaf
[ "MIT" ]
null
null
null
#ifndef GLIMPSE_RENDERBUFFER_H #define GLIMPSE_RENDERBUFFER_H #include <glimpse/buffer.hpp> #include <glimpse/gl.hpp> #include <functional> namespace gl { /** * {@link Renderbuffer} objects are OpenGL objects that contain images. * * They are created and used specifically with {@link Framebuffer} objects. They * are optimized for use as render targets, while {@link Texture} objects may * not be, and are the logical choice when you do not need to sample from the * produced image. */ class Renderbuffer { public: /** * Construct a regular {@link Renderbuffer} instance. * * @param[in] width The width of the buffer. * @param[in] height The height of the buffer. * @param[in] components The number of components per pixel. * @param[in] dtype The data type of the render buffer. * @param[in] samples The number of samples. Value 0 * means no multisample format. */ Renderbuffer(int width, int height, int components, const gl::PixelType& dtype, int samples = 0) : Renderbuffer(width, height, components, false, dtype, samples) {} /** * Construct a depth {@link Renderbuffer} instance. * * @param[in] width The width of the buffer. * @param[in] height The height of the buffer. * @param[in] components The number of components per pixel. * @param[in] samples The number of samples. Value 0 means no multisample format. */ static Renderbuffer depth(int width, int height, int components, int samples = 0) { return Renderbuffer(width, height, components, true, gl::PixelType::f32, samples); } ~Renderbuffer() noexcept; // Disable copy constructors Renderbuffer(const Renderbuffer&) = delete; Renderbuffer& operator=(const Renderbuffer&) = delete; // Enable move constructors Renderbuffer(Renderbuffer&&) noexcept; Renderbuffer& operator=(Renderbuffer&&) noexcept; Renderbuffer& operator=(std::nullptr_t); /** * Determine whether the render buffer object is still valid. */ explicit operator bool() const noexcept; /** * The width of the render buffer. */ int width() const noexcept; /** * The height of the render buffer. */ int height() const noexcept; /** * The number of components per pixel. */ int components() const noexcept; /** * Determine whether this render buffer is a depth buffer. */ bool is_depth_buffer() const noexcept; /** * The samples of the render buffer. */ int samples() const noexcept; /** * The data type of the buffer. */ const gl::PixelType& dtype() const noexcept; /** * The handle to the native OpenGL object. */ gl::Handle native_handle() const noexcept; private: /** * Construct a {@link Renderbuffer} instance. * * @param[in] width The width of the buffer. * @param[in] height The height of the buffer. * @param[in] components The number of components per pixel. * @param[in] depth A flag to indicate that it should be a depth buffer. * @param[in] dtype The data type of the render buffer. * @param[in] samples The number of samples. Value 0 means no multisample * format. */ Renderbuffer(int width, int height, int components, bool depth, const gl::PixelType& dtype = gl::PixelType::f32, int samples = 0); /** * Reset the object state. */ void reset() noexcept; /** * Swap object state. */ void swap(Renderbuffer& other) noexcept; static constexpr gl::Handle INVALID = 0xFFFFFFFF; gl::Handle m_handle{INVALID}; int m_width; int m_height; int m_components; bool m_depth; std::reference_wrapper<const gl::PixelType> m_dtype{gl::PixelType::i8}; int m_samples; }; } // namespace gl #endif /* GLIMPSE_RENDERBUFFER_H */
28.097222
90
0.629016
fabianishere
f7b9a5ba0cc3bb12e0efd5f74638123a0b2f1f7b
551
cc
C++
src/gb/utils/log.cc
jonatan-ekstrom/FreshBoy
228302e720f4a8fe4bf5c911e86588e412c0ce0a
[ "MIT" ]
3
2021-11-30T20:37:33.000Z
2022-01-06T20:26:52.000Z
src/gb/utils/log.cc
jonatan-ekstrom/FreshBoy
228302e720f4a8fe4bf5c911e86588e412c0ce0a
[ "MIT" ]
null
null
null
src/gb/utils/log.cc
jonatan-ekstrom/FreshBoy
228302e720f4a8fe4bf5c911e86588e412c0ce0a
[ "MIT" ]
null
null
null
#include "log.h" #include <iostream> namespace { bool Enabled{false}; } namespace gb::log { void Enable() { Enabled = true; } std::string Hex(const u16 address) { constexpr char c[]{"0123456789ABCDEF"}; std::string res{"0x"}; res.push_back(c[(address >> 12) & 0x0F]); res.push_back(c[(address >> 8) & 0x0F]); res.push_back(c[(address >> 4) & 0x0F]); res.push_back(c[address & 0x0F]); return res; } void Warning(const std::string& txt) { if (!Enabled) return; std::cout << "WARN: " + txt << std::endl; } }
19.678571
45
0.598911
jonatan-ekstrom
f7bd6786d3a823303b0c3fbfe741d49f43adf94d
5,972
hpp
C++
include/svgpp/parser/external_function/parse_misc_impl.hpp
RichardCory/svgpp
801e0142c61c88cf2898da157fb96dc04af1b8b0
[ "BSL-1.0" ]
428
2015-01-05T17:13:54.000Z
2022-03-31T08:25:47.000Z
include/svgpp/parser/external_function/parse_misc_impl.hpp
andrew2015/svgpp
1d2f15ab5e1ae89e74604da08f65723f06c28b3b
[ "BSL-1.0" ]
61
2015-01-08T14:32:27.000Z
2021-12-06T16:55:11.000Z
include/svgpp/parser/external_function/parse_misc_impl.hpp
andrew2015/svgpp
1d2f15ab5e1ae89e74604da08f65723f06c28b3b
[ "BSL-1.0" ]
90
2015-05-19T04:56:46.000Z
2022-03-26T16:42:50.000Z
// Copyright Oleg Maximenko 2016. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://github.com/svgpp/svgpp for library home page. #pragma once #include <boost/spirit/include/qi.hpp> #include <svgpp/config.hpp> #include <svgpp/parser/detail/common.hpp> #include <svgpp/parser/external_function/parse_misc.hpp> #include <svgpp/parser/grammar/length.hpp> #define SVGPP_PARSE_MISC_IMPL(IteratorType, CoordinateType) \ template bool svgpp::detail::parse_viewBox<IteratorType, CoordinateType>( \ IteratorType &, IteratorType, CoordinateType &, CoordinateType &, CoordinateType &, CoordinateType &); \ template bool svgpp::detail::parse_bbox<IteratorType, CoordinateType>( \ IteratorType &, IteratorType, CoordinateType &, CoordinateType &, CoordinateType &, CoordinateType &); \ template bool svgpp::detail::parse_enable_background<IteratorType, svgpp::tag::source::attribute, CoordinateType>( \ IteratorType &, IteratorType, svgpp::tag::source::attribute, CoordinateType &, CoordinateType &, CoordinateType &, CoordinateType &); \ template bool svgpp::detail::parse_enable_background<IteratorType, svgpp::tag::source::css, CoordinateType>( \ IteratorType &, IteratorType, svgpp::tag::source::css, CoordinateType &, CoordinateType &, CoordinateType &, CoordinateType &); #define SVGPP_PARSE_CLIP_IMPL(IteratorType, LengthFactoryType) \ template bool svgpp::detail::parse_clip<LengthFactoryType, IteratorType, svgpp::tag::source::css>( \ LengthFactoryType const &, IteratorType &, IteratorType, svgpp::tag::source::css, \ LengthFactoryType::length_type *); \ template bool svgpp::detail::parse_clip<LengthFactoryType, IteratorType, svgpp::tag::source::attribute>( \ LengthFactoryType const &, IteratorType &, IteratorType, svgpp::tag::source::attribute, \ LengthFactoryType::length_type *); namespace svgpp { namespace detail { template<class Iterator, class Coordinate> bool parse_viewBox(Iterator & it, Iterator end, Coordinate & x, Coordinate & y, Coordinate & w, Coordinate & h) { namespace qi = boost::spirit::qi; namespace phx = boost::phoenix; using qi::_1; SVGPP_STATIC_IF_SAFE const qi::real_parser<Coordinate, detail::svg_real_policies<Coordinate> > number; SVGPP_STATIC_IF_SAFE const detail::comma_wsp_rule_no_skip<Iterator> comma_wsp; return qi::parse(it, end, number[phx::ref(x) = _1] >> comma_wsp >> number[phx::ref(y) = _1] >> comma_wsp >> number[phx::ref(w) = _1] >> comma_wsp >> number[phx::ref(h) = _1]); } template<class Iterator, class Coordinate> bool parse_bbox(Iterator & it, Iterator end, Coordinate & lo_x, Coordinate & lo_y, Coordinate & hi_x, Coordinate & hi_y) { namespace qi = boost::spirit::qi; namespace phx = boost::phoenix; using qi::_1; SVGPP_STATIC_IF_SAFE const qi::real_parser<Coordinate, detail::svg_real_policies<Coordinate> > number; return qi::parse(it, end, number[phx::ref(lo_x) = _1] >> qi::lit(',') >> number[phx::ref(lo_y) = _1] >> qi::lit(',') >> number[phx::ref(hi_x) = _1] >> qi::lit(',') >> number[phx::ref(hi_y) = _1]); } template<class Iterator, class PropertySource, class Coordinate> bool parse_enable_background(Iterator & it, Iterator end, PropertySource property_source, Coordinate & x, Coordinate & y, Coordinate & width, Coordinate & height) { namespace qi = boost::spirit::qi; namespace phx = boost::phoenix; using qi::_1; SVGPP_STATIC_IF_SAFE const qi::real_parser<Coordinate, detail::number_policies<Coordinate, PropertySource> > number; const qi::rule<Iterator> rule = detail::no_case_if_css(property_source)[qi::lit("new")] >> +detail::character_encoding_namespace::space >> number[phx::ref(x) = qi::_1] >> +detail::character_encoding_namespace::space >> number[phx::ref(y) = qi::_1] >> +detail::character_encoding_namespace::space >> number[phx::ref(width) = qi::_1] >> +detail::character_encoding_namespace::space >> number[phx::ref(height) = qi::_1]; // TODO: check for negative values return qi::parse(it, end, rule); } template<class LengthFactory, class Iterator, class PropertySource> bool parse_clip( LengthFactory const & length_factory, Iterator & it, Iterator end, PropertySource property_source, typename LengthFactory::length_type * out_rect) { // 'auto' and 'inherit' values must be checked outside namespace qi = boost::spirit::qi; namespace phx = boost::phoenix; using qi::_1; SVGPP_STATIC_IF_SAFE const length_grammar< PropertySource, Iterator, LengthFactory, tag::length_dimension::width > length_grammar_x; SVGPP_STATIC_IF_SAFE const length_grammar< PropertySource, Iterator, LengthFactory, tag::length_dimension::height > length_grammar_y; // Initializing with values for 'auto' for (int i = 0; i<4; ++i) out_rect[i] = length_factory.create_length(0, tag::length_units::none()); const qi::rule<Iterator> rule = detail::no_case_if_css(property_source) [ qi::lit("rect") >> *detail::character_encoding_namespace::space >> qi::lit('(') >> *detail::character_encoding_namespace::space >> (qi::lit("auto") | length_grammar_y(phx::cref(length_factory))[phx::ref(out_rect[0]) = qi::_1] ) >> +detail::character_encoding_namespace::space >> (qi::lit("auto") | length_grammar_x(phx::cref(length_factory))[phx::ref(out_rect[1]) = qi::_1] ) >> +detail::character_encoding_namespace::space >> (qi::lit("auto") | length_grammar_y(phx::cref(length_factory))[phx::ref(out_rect[2]) = qi::_1] ) >> +detail::character_encoding_namespace::space >> (qi::lit("auto") | length_grammar_x(phx::cref(length_factory))[phx::ref(out_rect[3]) = qi::_1] ) >> *detail::character_encoding_namespace::space >> qi::lit(')') ]; return qi::parse(it, end, rule); } }}
40.90411
139
0.708138
RichardCory
f7c0b4f3b57ecb89c975c1f0a90b0e89490bbaf1
3,477
cpp
C++
src/jaegertracing/thrift-gen/aggregation_validator_types.cpp
ankit-varma10/jaeger-client-cpp
855cddb1352347f8199be7e10c69fe970a020e22
[ "Apache-2.0" ]
null
null
null
src/jaegertracing/thrift-gen/aggregation_validator_types.cpp
ankit-varma10/jaeger-client-cpp
855cddb1352347f8199be7e10c69fe970a020e22
[ "Apache-2.0" ]
null
null
null
src/jaegertracing/thrift-gen/aggregation_validator_types.cpp
ankit-varma10/jaeger-client-cpp
855cddb1352347f8199be7e10c69fe970a020e22
[ "Apache-2.0" ]
1
2020-03-09T04:52:07.000Z
2020-03-09T04:52:07.000Z
/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ #include "aggregation_validator_types.h" #include <algorithm> #include <ostream> #include <thrift/TToString.h> namespace jaegertracing { namespace thrift { ValidateTraceResponse::~ValidateTraceResponse() throw() { } void ValidateTraceResponse::__set_ok(const bool val) { this->ok = val; } void ValidateTraceResponse::__set_traceCount(const int64_t val) { this->traceCount = val; } const char* ValidateTraceResponse::ascii_fingerprint = "92DB7C08FAF226B322B117D193F35B5F"; const uint8_t ValidateTraceResponse::binary_fingerprint[16] = {0x92,0xDB,0x7C,0x08,0xFA,0xF2,0x26,0xB3,0x22,0xB1,0x17,0xD1,0x93,0xF3,0x5B,0x5F}; uint32_t ValidateTraceResponse::read(::apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; ::apache::thrift::protocol::TType ftype; int16_t fid; xfer += iprot->readStructBegin(fname); using ::apache::thrift::protocol::TProtocolException; bool isset_ok = false; bool isset_traceCount = false; while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); if (ftype == ::apache::thrift::protocol::T_STOP) { break; } switch (fid) { case 1: if (ftype == ::apache::thrift::protocol::T_BOOL) { xfer += iprot->readBool(this->ok); isset_ok = true; } else { xfer += iprot->skip(ftype); } break; case 2: if (ftype == ::apache::thrift::protocol::T_I64) { xfer += iprot->readI64(this->traceCount); isset_traceCount = true; } else { xfer += iprot->skip(ftype); } break; default: xfer += iprot->skip(ftype); break; } xfer += iprot->readFieldEnd(); } xfer += iprot->readStructEnd(); if (!isset_ok) throw TProtocolException(TProtocolException::INVALID_DATA); if (!isset_traceCount) throw TProtocolException(TProtocolException::INVALID_DATA); return xfer; } uint32_t ValidateTraceResponse::write(::apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; oprot->incrementRecursionDepth(); xfer += oprot->writeStructBegin("ValidateTraceResponse"); xfer += oprot->writeFieldBegin("ok", ::apache::thrift::protocol::T_BOOL, 1); xfer += oprot->writeBool(this->ok); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldBegin("traceCount", ::apache::thrift::protocol::T_I64, 2); xfer += oprot->writeI64(this->traceCount); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); oprot->decrementRecursionDepth(); return xfer; } void swap(ValidateTraceResponse &a, ValidateTraceResponse &b) { using ::std::swap; swap(a.ok, b.ok); swap(a.traceCount, b.traceCount); } ValidateTraceResponse::ValidateTraceResponse(const ValidateTraceResponse& other0) { ok = other0.ok; traceCount = other0.traceCount; } ValidateTraceResponse& ValidateTraceResponse::operator=(const ValidateTraceResponse& other1) { ok = other1.ok; traceCount = other1.traceCount; return *this; } std::ostream& operator<<(std::ostream& out, const ValidateTraceResponse& obj) { using apache::thrift::to_string; out << "ValidateTraceResponse("; out << "ok=" << to_string(obj.ok); out << ", " << "traceCount=" << to_string(obj.traceCount); out << ")"; return out; } }} // namespace
26.746154
144
0.672131
ankit-varma10
f7c382e80177b562fce854ba29f2d1edafda717d
6,226
cc
C++
chrome/installer/setup/installer_state.cc
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/installer/setup/installer_state.cc
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/installer/setup/installer_state.cc
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
2
2021-01-05T23:43:46.000Z
2021-01-07T23:36:34.000Z
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/installer/setup/installer_state.h" #include <stddef.h> #include <string> #include "base/command_line.h" #include "base/files/file_util.h" #include "base/logging.h" #include "base/win/registry.h" #include "build/branding_buildflags.h" #include "chrome/install_static/install_util.h" #include "chrome/installer/setup/setup_util.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/helper.h" #include "chrome/installer/util/install_util.h" #include "chrome/installer/util/installation_state.h" #include "chrome/installer/util/master_preferences.h" #include "chrome/installer/util/master_preferences_constants.h" #include "chrome/installer/util/work_item.h" #include "chrome/installer/util/work_item_list.h" namespace installer { namespace { // Returns the boolean value of the distribution preference in |prefs| named // |pref_name|, or |default_value| if not set. bool GetMasterPreference(const MasterPreferences& prefs, const char* pref_name, bool default_value) { bool value; return prefs.GetBool(pref_name, &value) ? value : default_value; } } // namespace InstallerState::InstallerState() : operation_(UNINITIALIZED), level_(UNKNOWN_LEVEL), root_key_(nullptr), msi_(false), verbose_logging_(false) {} InstallerState::InstallerState(Level level) : operation_(UNINITIALIZED), level_(UNKNOWN_LEVEL), root_key_(nullptr), msi_(false), verbose_logging_(false) { // Use set_level() so that root_key_ is updated properly. set_level(level); } InstallerState::~InstallerState() {} void InstallerState::Initialize(const base::CommandLine& command_line, const MasterPreferences& prefs, const InstallationState& machine_state) { Clear(); set_level(GetMasterPreference(prefs, master_preferences::kSystemLevel, false) ? SYSTEM_LEVEL : USER_LEVEL); verbose_logging_ = GetMasterPreference(prefs, master_preferences::kVerboseLogging, false); msi_ = GetMasterPreference(prefs, master_preferences::kMsi, false); if (!msi_) { const ProductState* product_state = machine_state.GetProductState(system_install()); if (product_state != nullptr) msi_ = product_state->is_msi(); } const bool is_uninstall = command_line.HasSwitch(switches::kUninstall); target_path_ = GetChromeInstallPath(system_install()); state_key_ = install_static::GetClientStateKeyPath(); VLOG(1) << (is_uninstall ? "Uninstall Chrome" : "Install Chrome"); operation_ = is_uninstall ? UNINSTALL : SINGLE_INSTALL_OR_UPDATE; // Parse --critical-update-version=W.X.Y.Z std::string critical_version_value( command_line.GetSwitchValueASCII(switches::kCriticalUpdateVersion)); critical_update_version_ = base::Version(critical_version_value); } void InstallerState::set_level(Level level) { level_ = level; switch (level) { case UNKNOWN_LEVEL: root_key_ = nullptr; return; case USER_LEVEL: root_key_ = HKEY_CURRENT_USER; return; case SYSTEM_LEVEL: root_key_ = HKEY_LOCAL_MACHINE; return; } NOTREACHED() << level; } bool InstallerState::system_install() const { DCHECK(level_ == USER_LEVEL || level_ == SYSTEM_LEVEL); return level_ == SYSTEM_LEVEL; } base::Version InstallerState::GetCurrentVersion( const InstallationState& machine_state) const { base::Version current_version; const ProductState* product_state = machine_state.GetProductState(level_ == SYSTEM_LEVEL); if (product_state) { // Be aware that there might be a pending "new_chrome.exe" already in the // installation path. If so, we use old_version, which holds the version of // "chrome.exe" itself. if (base::PathExists(target_path().Append(kChromeNewExe)) && product_state->old_version()) { current_version = *(product_state->old_version()); } else { current_version = product_state->version(); } } return current_version; } base::Version InstallerState::DetermineCriticalVersion( const base::Version& current_version, const base::Version& new_version) const { DCHECK(new_version.IsValid()); if (critical_update_version_.IsValid() && (!current_version.IsValid() || (current_version.CompareTo(critical_update_version_) < 0)) && new_version.CompareTo(critical_update_version_) >= 0) { return critical_update_version_; } return base::Version(); } base::FilePath InstallerState::GetInstallerDirectory( const base::Version& version) const { return target_path().AppendASCII(version.GetString()).Append(kInstallerDir); } void InstallerState::Clear() { operation_ = UNINITIALIZED; target_path_.clear(); state_key_.clear(); critical_update_version_ = base::Version(); level_ = UNKNOWN_LEVEL; root_key_ = nullptr; msi_ = false; verbose_logging_ = false; } void InstallerState::SetStage(InstallerStage stage) const { GoogleUpdateSettings::SetProgress(system_install(), state_key_, progress_calculator_.Calculate(stage)); } void InstallerState::WriteInstallerResult( InstallStatus status, int string_resource_id, const base::string16* const launch_cmd) const { // Use a no-rollback list since this is a best-effort deal. std::unique_ptr<WorkItemList> install_list(WorkItem::CreateWorkItemList()); install_list->set_log_message("Write Installer Result"); install_list->set_best_effort(true); install_list->set_rollback_enabled(false); const bool system_install = this->system_install(); // Write the value for the product upon which we're operating. InstallUtil::AddInstallerResultItems( system_install, install_static::GetClientStateKeyPath(), status, string_resource_id, launch_cmd, install_list.get()); install_list->Do(); } bool InstallerState::RequiresActiveSetup() const { return system_install(); } } // namespace installer
32.092784
80
0.721169
mghgroup
f7c45f73c39c805ff526925261f3072636578c6e
1,447
cc
C++
components/ucloud_ai/src/model/aliyun-openapi/imagerecog/src/model/RecognizeImageColorRequest.cc
wstong999/AliOS-Things
6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9
[ "Apache-2.0" ]
4,538
2017-10-20T05:19:03.000Z
2022-03-30T02:29:30.000Z
components/ucloud_ai/src/model/aliyun-openapi/imagerecog/src/model/RecognizeImageColorRequest.cc
wstong999/AliOS-Things
6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9
[ "Apache-2.0" ]
1,088
2017-10-21T07:57:22.000Z
2022-03-31T08:15:49.000Z
components/ucloud_ai/src/model/aliyun-openapi/imagerecog/src/model/RecognizeImageColorRequest.cc
wstong999/AliOS-Things
6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9
[ "Apache-2.0" ]
1,860
2017-10-20T05:22:35.000Z
2022-03-27T10:54:14.000Z
/* * Copyright 2009-2017 Alibaba Cloud All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <alibabacloud/imagerecog/model/RecognizeImageColorRequest.h> using AlibabaCloud::Imagerecog::Model::RecognizeImageColorRequest; RecognizeImageColorRequest::RecognizeImageColorRequest() : RpcServiceRequest("imagerecog", "2019-09-30", "RecognizeImageColor") { setMethod(HttpRequest::Method::Post); } RecognizeImageColorRequest::~RecognizeImageColorRequest() {} std::string RecognizeImageColorRequest::getUrl()const { return url_; } void RecognizeImageColorRequest::setUrl(const std::string& url) { url_ = url; setBodyParameter("Url", url); } int RecognizeImageColorRequest::getColorCount()const { return colorCount_; } void RecognizeImageColorRequest::setColorCount(int colorCount) { colorCount_ = colorCount; setBodyParameter("ColorCount", std::to_string(colorCount)); }
27.826923
75
0.757429
wstong999
f7c4ab92496fa5c7064134eae25f005cc2e84a66
132
hpp
C++
InvalidCardException.hpp
FrankBotos/PokerHandStrength
bd11de0f90bbf517b3b4cd10d7d6c933478047a9
[ "MIT" ]
null
null
null
InvalidCardException.hpp
FrankBotos/PokerHandStrength
bd11de0f90bbf517b3b4cd10d7d6c933478047a9
[ "MIT" ]
null
null
null
InvalidCardException.hpp
FrankBotos/PokerHandStrength
bd11de0f90bbf517b3b4cd10d7d6c933478047a9
[ "MIT" ]
null
null
null
#pragma once #include <stdexcept> class InvalidCardException : public std::runtime_error { public: InvalidCardException(); };
13.2
54
0.75
FrankBotos
f7c4eba1bdad99a4c70e547792f470a7e111a6ae
9,101
cpp
C++
microcontroller/laserInterface.cpp
jrahlf/3D-Non-Contact-Laser-Profilometer
912eb8890442f897c951594c79a8a594096bc119
[ "MIT" ]
5
2016-02-06T14:57:35.000Z
2018-01-02T23:34:18.000Z
microcontroller/laserInterface.cpp
jrahlf/3D-Non-Contact-Laser-Profilometer
912eb8890442f897c951594c79a8a594096bc119
[ "MIT" ]
null
null
null
microcontroller/laserInterface.cpp
jrahlf/3D-Non-Contact-Laser-Profilometer
912eb8890442f897c951594c79a8a594096bc119
[ "MIT" ]
1
2020-04-19T13:16:31.000Z
2020-04-19T13:16:31.000Z
/* * laserInterface.cpp * * Created on: Dec 30, 2013 * Author: jonas * * UART DMA source: http://www.mikrocontroller.net/topic/243265 * UART interrupt source: http://eliaselectronics.com/stm32f4-usart-example-with-interrupt/ */ #pragma GCC push_options #pragma GCC optimize ("O0") #include <xpcc/architecture.hpp> #include <xpcc/workflow/timeout.hpp> #include "laserInterface.h" #include "state.h" #include "atof.h" #include "Trigger.h" #include "../ext/stm32f4xx_lib/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h" #include "../ext/stm32f4xx_lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h" #include "../ext/stm32f4xx_lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dma.h" #include "../ext/stm32f4xx_lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_usart.h" #include "../ext/stm32f4xx_lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h" #include "../ext/stm32f4xx_lib/STM32F4xx_StdPeriph_Driver/inc/misc.h" //source for dma: http://www.mikrocontroller.net/topic/251293 //================================== //=== Output ==== //================================== static unsigned char normalRequest[] = "M1,1\r";//{ 'M', '0', ',', '1', '\r'}; static const int normalRequestLength = 5; static const int normalRequestAnswerLength = 15; //TODO static unsigned char* bufferOut = normalRequest; static int expectedAnswerLength = normalRequestAnswerLength; static int requestLength = normalRequestLength; GPIO__INPUT(LASER_STATUS, E, 5); static int lastError = -1; //================================== //=== Input ==== //================================== //================================== //=== Double buffer ==== //================================== unsigned char Laser::DoubleBuffer::buf1[LASER_INPUT_BUFFER_SIZE+1]; unsigned char Laser::DoubleBuffer::buf2[LASER_INPUT_BUFFER_SIZE+1] = {'\0'}; unsigned char* Laser::DoubleBuffer::bufInPtr = Laser::DoubleBuffer::buf1; unsigned char* Laser::DoubleBuffer::bufOutPtr = Laser::DoubleBuffer::buf2; int Laser::DoubleBuffer::inSize = 0; int Laser::DoubleBuffer::outSize = 0; #if USE_LASER_DMA xpcc::stm32::Usart3 uart3(115200); xpcc::IODeviceWrapper<xpcc::stm32::Usart3> uartWrap3(uart3); #else xpcc::stm32::BufferedUsart3 uart3(115200, 4); xpcc::IODeviceWrapper<xpcc::stm32::BufferedUsart3> uartWrap3(uart3); #endif xpcc::IOStream laserOutStream(uartWrap3); using namespace xpcc::stm32; //================================== //=== Functions //================================== void USART3_Init(void); void DMAStream3_Channel4_Init(); void enable_USART3_Interrupts(); bool Laser::init(){ //uart2.configurePins(xpcc::stm32::USART3::Mapping::REMAP_PA2_PA3); LASER_STATUS::setInput(xpcc::stm32::PULLUP); #if USE_LASER_DMA enable_USART3_Interrupts(); USART3_Init(); DMAStream3_Channel4_Init(); USART_DMACmd(USART3, USART_DMAReq_Tx, ENABLE); #else uart3.configurePins(xpcc::stm32::BufferedUsart3::Mapping::REMAP_PC10_PC11); #endif return true; } int Laser::getLastError(){ return lastError; } void Laser::enableRequests(){ #if USE_LASER_DMA DMAStream3_Channel4_Init(); DMA_Cmd(DMA1_Stream3, ENABLE); #else sendMeasurementRequest(); #endif } void Laser::disableRequests(){ DMA_Cmd(DMA1_Stream3, DISABLE); } void Laser::sendString(const char* cmd){ laserOutStream << cmd << '\r'; } const char* Laser::exec(const char* cmd){ disableRequests(); USART_ITConfig(USART3, USART_IT_RXNE, DISABLE); xpcc::delay_ms(500); static char response[256]; char c = 0; //clear receive buffer for(int i = 0; i < 100; i++){ uart3.read((uint8_t&)c); } sendString(cmd); int i = 0; xpcc::Timeout<> timeout(1000); while(true){ if(uart3.read((uint8_t&)c)){ response[i] = c; i++; if(i > 254 || c == '\r'){ response[i-1] = '\0'; break; } } if(timeout.isExpired()){ break; } } xpcc::delay_ms(500); enableRequests(); enable_USART3_Interrupts(); if(c == '\r'){ return response; } if(i > 254){ return "Buffer overrun while executing laser command"; } if(timeout.isExpired()){ return "Timeout expired while executing laser command"; } cerr << " LaserInterface.cpp: " << __LINE__ << " : this point should not be reached" << endl; return ""; } int Laser::DoubleBuffer::asInt(){ return good() ? atoi2(Laser::DoubleBuffer::get()+3, 0) : 9000; } int Laser::DoubleBuffer::good(){ return lastError == -1 && outSize == expectedAnswerLength; } void USART3_Init(void){ GPIO_InitTypeDef GPIOC_10_11_InitStructure; USART_InitTypeDef USART3_InitStructure; //GPIO C 10/11 Init RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); GPIO_PinAFConfig(GPIOC, GPIO_PinSource10, GPIO_AF_USART3); GPIO_PinAFConfig(GPIOC, GPIO_PinSource11, GPIO_AF_USART3); GPIOC_10_11_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIOC_10_11_InitStructure.GPIO_OType = GPIO_OType_PP; GPIOC_10_11_InitStructure.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11; GPIOC_10_11_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIOC_10_11_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOC, &GPIOC_10_11_InitStructure); //USART 3 Init RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE); USART3_InitStructure.USART_BaudRate = 115200; USART3_InitStructure.USART_WordLength = USART_WordLength_8b; USART3_InitStructure.USART_StopBits = USART_StopBits_1; USART3_InitStructure.USART_Parity = USART_Parity_No; USART3_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART3_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; USART_Init(USART3, &USART3_InitStructure); USART_Cmd(USART3, ENABLE); } void DMAStream3_Channel4_Init(void){ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA1, ENABLE); DMA_InitTypeDef DMA_InitStruct; DMA_StructInit(&DMA_InitStruct); DMA_InitStruct.DMA_Channel = DMA_Channel_4; DMA_InitStruct.DMA_PeripheralBaseAddr = (uint32_t)&(USART3->DR); DMA_InitStruct.DMA_Memory0BaseAddr = (uint32_t)bufferOut; DMA_InitStruct.DMA_DIR = DMA_DIR_MemoryToPeripheral; DMA_InitStruct.DMA_BufferSize = requestLength; DMA_InitStruct.DMA_PeripheralInc = DMA_PeripheralInc_Disable; DMA_InitStruct.DMA_MemoryInc = DMA_MemoryInc_Enable; DMA_InitStruct.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte; DMA_InitStruct.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte; DMA_InitStruct.DMA_Mode = DMA_Mode_Circular; DMA_InitStruct.DMA_Priority = DMA_Priority_Medium; DMA_InitStruct.DMA_FIFOMode = DMA_FIFOMode_Disable; DMA_InitStruct.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull; DMA_InitStruct.DMA_MemoryBurst = DMA_MemoryBurst_Single; DMA_InitStruct.DMA_PeripheralBurst = DMA_PeripheralBurst_Single; DMA_Init(DMA1_Stream3, &DMA_InitStruct); } void enable_USART3_Interrupts(){ /* Here the USART3 receive interrupt is enabled * and the interrupt controller is configured * to jump to the USART3_IRQHandler() function * if the USART3 receive interrupt occurs */ USART_ITConfig(USART3, USART_IT_RXNE, ENABLE); // enable the USART3 receive interrupt NVIC_InitTypeDef NVIC_InitStructure; // this is used to configure the NVIC (nested vector interrupt controller) NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn; // we want to configure the USART3 interrupts NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;// this sets the priority group of the USART3 interrupts NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; // this sets the subpriority inside the group NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; // the USART3 interrupts are globally enabled NVIC_Init(&NVIC_InitStructure); // the properties are passed to the NVIC_Init function which takes care of the low level stuff // finally this enables the complete USART3 peripheral USART_Cmd(USART3, ENABLE); } #pragma GCC pop_options #if USE_LASER_DMA // this is the interrupt request handler (IRQ) for ALL USART3 interrupts extern "C" void USART3_IRQHandler(void){ // check if the USART3 receive interrupt flag was set if( USART_GetITStatus(USART3, USART_IT_RXNE) ){ char c = USART3->DR; Laser::handleChar(c); //USART_ClearITPendingBit(USART3, USART_IT_RXNE); not needed } } #endif void Laser::handleChar(char c){ Laser::DoubleBuffer::addChar(c); if(c == '\r'){ #if !USE_LASER_DMA Laser::sendMeasurementRequest(); #endif //do some sanity checks //active low -> high means invalid measurement bool nok = LASER_STATUS::read(); State::setOrange(nok); if(nok){ Laser::DoubleBuffer::reset(); lastError = 3000; return; } if(Laser::DoubleBuffer::get()[0] == 'E' && Laser::DoubleBuffer::get()[1] == 'R'){ lastError = atoi2(Laser::DoubleBuffer::get()+6, 2, -1); Laser::DoubleBuffer::reset(); }else{ lastError = -1; //no error if(Laser::DoubleBuffer::getInSize() == normalRequestAnswerLength){ Laser::DoubleBuffer::swap(); //Trigger::forceTrigger(); }else{ Laser::DoubleBuffer::reset(); lastError = 2000+Laser::DoubleBuffer::getInSize(); } } } if(Laser::DoubleBuffer::getInSize() >= LASER_INPUT_BUFFER_SIZE){ Laser::DoubleBuffer::reset(); //reset everything } } void Laser::sendMeasurementRequest(){ uart3.write(bufferOut, requestLength); }
29.644951
134
0.729261
jrahlf
f7c4ed699c8b50d7aa69b2a6e9cdc331830bdc6e
744
hpp
C++
cpp/include/example/AsioTcpClient.hpp
skydiveuas/skylync
73db7fe4593e262a1fc1a7b61c18190275abe723
[ "MIT" ]
1
2018-06-06T20:33:28.000Z
2018-06-06T20:33:28.000Z
cpp/include/example/AsioTcpClient.hpp
skydiveuas/skylync
73db7fe4593e262a1fc1a7b61c18190275abe723
[ "MIT" ]
null
null
null
cpp/include/example/AsioTcpClient.hpp
skydiveuas/skylync
73db7fe4593e262a1fc1a7b61c18190275abe723
[ "MIT" ]
1
2020-07-31T03:39:15.000Z
2020-07-31T03:39:15.000Z
#ifndef EXAMPLE_ASIOTCPCLIENT_HPP #define EXAMPLE_ASIOTCPCLIENT_HPP #include "ICommInterface.hpp" #include "asio.hpp" #include <array> namespace sl { namespace example { class AsioTcpClient : public sl::ICommInterface { public: AsioTcpClient(ICommInterface::Listener* _listener, asio::io_context& _ioContext); void connect(const std::string& host, const int port) override; void disconnect() override; void send(const DataPacket dataPacket) override; private: static constexpr size_t READ_BUFFER_SIZE = 1024; std::array<uint8_t, READ_BUFFER_SIZE> readBuffer; asio::io_context& ioContext; asio::ip::tcp::socket socket; void doRead(); }; } // example } // sl #endif // EXAMPLE_ASIOTCPCLIENT_HPP
17.714286
85
0.735215
skydiveuas
f7cf9513215406093d090b3305e6927d77e21171
1,007
hpp
C++
doc/quickbook/oglplus/quickref/enums/ext/debug_output_source.hpp
matus-chochlik/oglplus
76dd964e590967ff13ddff8945e9dcf355e0c952
[ "BSL-1.0" ]
364
2015-01-01T09:38:23.000Z
2022-03-22T05:32:00.000Z
doc/quickbook/oglplus/quickref/enums/ext/debug_output_source.hpp
matus-chochlik/oglplus
76dd964e590967ff13ddff8945e9dcf355e0c952
[ "BSL-1.0" ]
55
2015-01-06T16:42:55.000Z
2020-07-09T04:21:41.000Z
doc/quickbook/oglplus/quickref/enums/ext/debug_output_source.hpp
matus-chochlik/oglplus
76dd964e590967ff13ddff8945e9dcf355e0c952
[ "BSL-1.0" ]
57
2015-01-07T18:35:49.000Z
2022-03-22T05:32:04.000Z
// File doc/quickbook/oglplus/quickref/enums/ext/debug_output_source.hpp // // Automatically generated file, DO NOT modify manually. // Edit the source 'source/enums/oglplus/ext/debug_output_source.txt' // or the 'source/enums/make_enum.py' script instead. // // Copyright 2010-2019 Matus Chochlik. // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // //[oglplus_enums_ext_debug_output_source enum class DebugOutputARBSource : GLenum { API = GL_DEBUG_SOURCE_API_ARB, WindowSystem = GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB, ShaderCompiler = GL_DEBUG_SOURCE_SHADER_COMPILER_ARB, ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY_ARB, Application = GL_DEBUG_SOURCE_APPLICATION_ARB, Other = GL_DEBUG_SOURCE_OTHER_ARB, DontCare = GL_DONT_CARE }; template <> __Range<DebugOutputARBSource> __EnumValueRange<DebugOutputARBSource>(); __StrCRef __EnumValueName(DebugOutputARBSource); //]
33.566667
73
0.784508
matus-chochlik
f7cfff6dd03f729f81f5df153e563d7bb50caacf
648
cpp
C++
MPAGS-CIPHER/writeOutput.cpp
MPAGS-CPP-2019/mpags-day-2-JamesDownsLab
9039e31b21c46008b4759e06a9e2cadff1b05014
[ "MIT" ]
null
null
null
MPAGS-CIPHER/writeOutput.cpp
MPAGS-CPP-2019/mpags-day-2-JamesDownsLab
9039e31b21c46008b4759e06a9e2cadff1b05014
[ "MIT" ]
1
2019-10-31T18:00:48.000Z
2019-10-31T18:00:48.000Z
MPAGS-CIPHER/writeOutput.cpp
MPAGS-CPP-2019/mpags-day-2-JamesDownsLab
9039e31b21c46008b4759e06a9e2cadff1b05014
[ "MIT" ]
1
2019-10-31T09:23:24.000Z
2019-10-31T09:23:24.000Z
#include "writeOutput.hpp" #include <string> #include <fstream> #include <iostream> void write_output( const std::string &outputFile, const std::string &outputText) { /* * Writes outputText to outputFile. If outputFile is an empty string * write the output to the console. */ if (!outputFile.empty()) { std::ofstream out_file{outputFile}; bool ok_to_write{out_file.good()}; if (ok_to_write) { out_file << outputText; } else { std::cerr << "Error writing file" << std::endl; } } else { std::cout << outputText << std::endl; } }
24.923077
72
0.57716
MPAGS-CPP-2019
f7d09690c76197e30d4bb019fdd51dfe7b72b611
2,039
cpp
C++
samples/snippets/cpp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteEndElement Example/CPP/source.cpp
hamarb123/dotnet-api-docs
6aeb55784944a2f1f5e773b657791cbd73a92dd4
[ "CC-BY-4.0", "MIT" ]
421
2018-04-01T01:57:50.000Z
2022-03-28T15:24:42.000Z
samples/snippets/cpp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteEndElement Example/CPP/source.cpp
hamarb123/dotnet-api-docs
6aeb55784944a2f1f5e773b657791cbd73a92dd4
[ "CC-BY-4.0", "MIT" ]
5,797
2018-04-02T21:12:23.000Z
2022-03-31T23:54:38.000Z
samples/snippets/cpp/VS_Snippets_Data/Classic WebData XmlTextWriter.WriteEndElement Example/CPP/source.cpp
hamarb123/dotnet-api-docs
6aeb55784944a2f1f5e773b657791cbd73a92dd4
[ "CC-BY-4.0", "MIT" ]
1,482
2018-03-31T11:26:20.000Z
2022-03-30T22:36:45.000Z
// <Snippet1> #using <System.Xml.dll> using namespace System; using namespace System::IO; using namespace System::Xml; int main() { XmlTextWriter^ writer = nullptr; String^ filename = "sampledata.xml"; writer = gcnew XmlTextWriter( filename, nullptr ); //Use indenting for readability. writer->Formatting = Formatting::Indented; //Write the XML delcaration writer->WriteStartDocument(); //Write the ProcessingInstruction node. String^ PItext = "type=\"text/xsl\" href=\"book.xsl\""; writer->WriteProcessingInstruction( "xml-stylesheet", PItext ); //Write the DocumentType node. writer->WriteDocType( "book", nullptr, nullptr, "<!ENTITY h \"hardcover\">" ); //Write a Comment node. writer->WriteComment( "sample XML" ); //Write the root element. writer->WriteStartElement( "book" ); //Write the genre attribute. writer->WriteAttributeString( "genre", "novel" ); //Write the ISBN attribute. writer->WriteAttributeString( "ISBN", "1-8630-014" ); //Write the title. writer->WriteElementString( "title", "The Handmaid's Tale" ); //Write the style element. writer->WriteStartElement( "style" ); writer->WriteEntityRef( "h" ); writer->WriteEndElement(); //Write the price. writer->WriteElementString( "price", "19.95" ); //Write CDATA. writer->WriteCData( "Prices 15% off!!" ); //Write the close tag for the root element. writer->WriteEndElement(); writer->WriteEndDocument(); //Write the XML to file and close the writer. writer->Flush(); writer->Close(); //Load the file into an XmlDocument to ensure well formed XML. XmlDocument^ doc = gcnew XmlDocument; //Preserve white space for readability. doc->PreserveWhitespace = true; //Load the file. doc->Load( filename ); //Display the XML content to the console. Console::Write( doc->InnerXml ); } // </Snippet1>
26.828947
82
0.62972
hamarb123
f7d0a156d1a840df1a733e12ecaeb962021e42c7
1,522
cpp
C++
shared/vkRenderers/VulkanClear.cpp
adoug/3D-Graphics-Rendering-Cookbook
dabffed670b8be5a619f0f62b10e0cc8ccdd5a36
[ "MIT" ]
399
2021-06-03T02:42:20.000Z
2022-03-27T23:23:15.000Z
shared/vkRenderers/VulkanClear.cpp
adoug/3D-Graphics-Rendering-Cookbook
dabffed670b8be5a619f0f62b10e0cc8ccdd5a36
[ "MIT" ]
7
2021-07-13T02:36:01.000Z
2022-03-26T03:46:37.000Z
shared/vkRenderers/VulkanClear.cpp
adoug/3D-Graphics-Rendering-Cookbook
dabffed670b8be5a619f0f62b10e0cc8ccdd5a36
[ "MIT" ]
53
2021-06-02T20:02:24.000Z
2022-03-29T15:36:30.000Z
#include "shared/Utils.h" #include "shared/UtilsMath.h" #include "shared/vkRenderers/VulkanClear.h" #include "shared/EasyProfilerWrapper.h" VulkanClear::VulkanClear(VulkanRenderDevice& vkDev, VulkanImage depthTexture) : RendererBase(vkDev, depthTexture) , shouldClearDepth(depthTexture.image != VK_NULL_HANDLE) { if (!createColorAndDepthRenderPass( vkDev, shouldClearDepth, &renderPass_, RenderPassCreateInfo{ .clearColor_ = true, .clearDepth_ = true, .flags_ = eRenderPassBit_First })) { printf("VulkanClear: failed to create render pass\n"); exit(EXIT_FAILURE); } createColorAndDepthFramebuffers(vkDev, renderPass_, depthTexture.imageView, swapchainFramebuffers_); } void VulkanClear::fillCommandBuffer(VkCommandBuffer commandBuffer, size_t swapFramebuffer) { EASY_FUNCTION(); const VkClearValue clearValues[2] = { VkClearValue { .color = { 1.0f, 1.0f, 1.0f, 1.0f } }, VkClearValue { .depthStencil = { 1.0f, 0 } } }; const VkRect2D screenRect = { .offset = { 0, 0 }, .extent = {.width = framebufferWidth_, .height = framebufferHeight_ } }; const VkRenderPassBeginInfo renderPassInfo = { .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, .renderPass = renderPass_, .framebuffer = swapchainFramebuffers_[swapFramebuffer], .renderArea = screenRect, .clearValueCount = static_cast<uint32_t>(shouldClearDepth ? 2 : 1), .pClearValues = &clearValues[0] }; vkCmdBeginRenderPass( commandBuffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE ); vkCmdEndRenderPass( commandBuffer ); }
32.382979
139
0.761498
adoug
f7d69ac314df9f0d7e36c1472107ed435f235080
1,384
cc
C++
tests/elle/Printable.cc
infinitio/elle
d9bec976a1217137436db53db39cda99e7024ce4
[ "Apache-2.0" ]
521
2016-02-14T00:39:01.000Z
2022-03-01T22:39:25.000Z
tests/elle/Printable.cc
infinitio/elle
d9bec976a1217137436db53db39cda99e7024ce4
[ "Apache-2.0" ]
8
2017-02-21T11:47:33.000Z
2018-11-01T09:37:14.000Z
tests/elle/Printable.cc
infinitio/elle
d9bec976a1217137436db53db39cda99e7024ce4
[ "Apache-2.0" ]
48
2017-02-21T10:18:13.000Z
2022-03-25T02:35:20.000Z
#include <elle/test.hh> #include <elle/Printable.hh> #include <iostream> #include <sstream> namespace elle { class ComplexNumber : public Printable { public: ComplexNumber(int real, int imag); ~ComplexNumber(); void set(int real, int imag); void print(std::ostream& stream) const; private: int _real, _imag; }; ComplexNumber::ComplexNumber(int real, int imag) { _real = real; _imag = imag; } ComplexNumber::~ComplexNumber() { } void ComplexNumber::set(int real, int imag) { _real = real; _imag = imag; } void ComplexNumber::print(std::ostream& stream) const { if (_imag >= 0) stream << _real << " + " << _imag << "j"; if (_imag < 0) stream << _real << " - " << abs(_imag) << "j"; } } static void test_generic(int x, int y) { elle::ComplexNumber testPositive(x, y); std::stringstream output, expected; if (y >= 0) expected << x << " + " << y << "j"; if (y < 0) expected << x << " - " << abs(y) << "j"; testPositive.print(output); BOOST_CHECK_EQUAL(output.str(), expected.str()); } ELLE_TEST_SUITE() { boost::unit_test::test_suite* basics = BOOST_TEST_SUITE("Basics"); boost::unit_test::framework::master_test_suite().add(basics); basics->add(BOOST_TEST_CASE(std::bind(test_generic, 1, 2))); basics->add(BOOST_TEST_CASE(std::bind(test_generic, 3, -5))); }
17.74359
67
0.615607
infinitio
f7d7561837a92999a315ff140df0d9893a61cd26
1,109
cpp
C++
Engine/Source/Rendering/VertexArray.cpp
wdrDarx/DEngine3
27e2de3b56b6d4c8705e8a0e36f5911d8651caa2
[ "MIT" ]
2
2022-01-11T21:15:31.000Z
2022-02-22T21:14:33.000Z
Engine/Source/Rendering/VertexArray.cpp
wdrDarx/DEngine3
27e2de3b56b6d4c8705e8a0e36f5911d8651caa2
[ "MIT" ]
null
null
null
Engine/Source/Rendering/VertexArray.cpp
wdrDarx/DEngine3
27e2de3b56b6d4c8705e8a0e36f5911d8651caa2
[ "MIT" ]
null
null
null
#pragma once #include "VertexArray.h" #include "VertexBufferLayout.h" #include "Vertexbuffer.h" VertexArray::VertexArray() { glGenVertexArrays(1, &m_RendererID); } VertexArray::~VertexArray() { glDeleteVertexArrays(1, &m_RendererID); } void VertexArray::Addbuffer(const VertexBuffer& vb, const VertexBufferLayout& layout) { Bind(); vb.Bind(); const auto& elements = layout.GetElements(); uptr offset = 0; for (uint i = 0; i < elements.size(); i++) { const auto& element = elements[i]; uint AttribLayoutIndex = i + layout.m_InitialLayoutOffset; glEnableVertexAttribArray(AttribLayoutIndex); glVertexAttribPointer(AttribLayoutIndex, element.count, element.type, element.normalized, layout.GetStride(), (const void*)offset); glVertexAttribDivisor(AttribLayoutIndex, element.instanceCounter); //0 = per vertex, 1 = per instance, 2 = per 2 instances etc offset += element.count * VertexBufferElement::GetSizeOfType(element.type); } m_VertexBuffer = &vb; } void VertexArray::Bind() const { glBindVertexArray(m_RendererID); } void VertexArray::Unbind() const { glBindVertexArray(0); }
24.644444
133
0.74752
wdrDarx
f7d813c47898857d7f483f3d86bcdc4f637aac01
1,447
cpp
C++
exercises/C01-Beginner_Exercises/S06-fwcTools2/Solutions/160_ChangeTextSOLN.cpp
rdholder/FeetWetCoding
c0106009eae0ff0fadd7e96b8adfe3a815d5dcfb
[ "BSD-2-Clause-FreeBSD" ]
2
2016-04-28T19:31:51.000Z
2016-05-22T06:57:47.000Z
exercises/C01-Beginner_Exercises/S06-fwcTools2/Solutions/160_ChangeTextSOLN.cpp
rdholder/FeetWetCoding
c0106009eae0ff0fadd7e96b8adfe3a815d5dcfb
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
exercises/C01-Beginner_Exercises/S06-fwcTools2/Solutions/160_ChangeTextSOLN.cpp
rdholder/FeetWetCoding
c0106009eae0ff0fadd7e96b8adfe3a815d5dcfb
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
// copyright (c) 2011 Robert Holder, Janice Dugger. // See HELP.html included in this distribution. #include <exercises/C01_S06.h> // ========================================== // = THIS IS THE SOLUTION CODE = // = THIS IS *NOT* THE EXERCISE CODE = // = (If you meant to look at the exercise = // = it's in the directory above this one.) = // ========================================== void ChangeTextSoln::runExercise() { std::string key; seeout << "Press keys R, G or B to change circle color and text color description, or q to quit.\n"; int circle = fwcCircle(200,200,75,BLUE,1,true); fwcText("Circle color is:", 100, 300, BLUE, 24); int circle_color_text = fwcText("BLUE",180,350,BLUE,20); while ( key != "q" && key != "Q" ) { key = waitForKeyPress(); // = is pronounced "GETS" if ( key == "r" || key == "R" ) // == is pronounced "EQUALS" :-) { fwcChangeColor(circle,RED,true); fwcChangeText(circle_color_text,"RED"); } if ( key == "g" || key == "G" ) { fwcChangeColor(circle,GREEN,true); fwcChangeText(circle_color_text,"GREEN"); } if ( key == "b" || key == "B" ) { fwcChangeColor(circle,BLUE,true); fwcChangeText(circle_color_text,"BLUE"); } } fwcClearItems(); fwcText("DONE!", 60, 150, DARKBLUE, 60); }
30.787234
104
0.514858
rdholder
f7e15c976119ea8f370ce1e1037c6aeb883717a6
4,000
cpp
C++
server/Server/Packets/CGUnEquipHandler.cpp
viticm/web-pap
7c9b1f49d9ba8d8e40f8fddae829c2e414ccfeca
[ "BSD-3-Clause" ]
3
2018-06-19T21:37:38.000Z
2021-07-31T21:51:40.000Z
server/Server/Packets/CGUnEquipHandler.cpp
viticm/web-pap
7c9b1f49d9ba8d8e40f8fddae829c2e414ccfeca
[ "BSD-3-Clause" ]
null
null
null
server/Server/Packets/CGUnEquipHandler.cpp
viticm/web-pap
7c9b1f49d9ba8d8e40f8fddae829c2e414ccfeca
[ "BSD-3-Clause" ]
13
2015-01-30T17:45:06.000Z
2022-01-06T02:29:34.000Z
#include "stdafx.h" #include "CGUnEquip.h" #include "Type.h" #include "Log.h" #include "GamePlayer.h" #include "Scene.h" #include "Obj_Human.h" #include "GCUnEquipResult.h" #include "GCCharEquipment.h" #include "HumanItemLogic.h" #include "ItemOperator.h" extern UINT GetEquipmentMaxLevelGemID(Item *pEquipment); UINT CGUnEquipHandler::Execute( CGUnEquip* pPacket, Player* pPlayer ) { __ENTER_FUNCTION GamePlayer* pGamePlayer = (GamePlayer*)pPlayer ; Assert( pGamePlayer ) ; Obj_Human* pHuman = pGamePlayer->GetHuman() ; Assert( pHuman ) ; Scene* pScene = pHuman->getScene() ; if( pScene==NULL ) { Assert(FALSE) ; return PACKET_EXE_ERROR ; } //检查线程执行资源是否正确 Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ; HUMAN_EQUIP EquipPoint = (HUMAN_EQUIP)pPacket->getEquipPoint(); //Assert( pHuman->GetDB()->GetEquipDB()->IsSet(EquipPoint) ) ; Item* pEquipItem = HumanItemLogic::GetEquip(pHuman,EquipPoint); if(!pEquipItem) { Assert(pEquipItem); return PACKET_EXE_CONTINUE; } if(pEquipItem->IsEmpty()) { return PACKET_EXE_CONTINUE; } UCHAR itemClass = pEquipItem->GetItemClass(); if(itemClass == ICLASS_EQUIP) { INT BagIndex;// = pHuman->GetFirstEmptyBagIndex(); ItemContainer* pEquipContainer = pHuman->GetEquipContain(); ItemContainer* pBaseContainer = pHuman->GetBaseContain(); if(!pEquipContainer) { Assert(pEquipItem); return PACKET_EXE_CONTINUE; } BYTE DeliverBagIndex = pPacket->getBagIndex(); if(DeliverBagIndex<pBaseContainer->GetContainerSize()) { BagIndex = g_ItemOperator.MoveItem(pEquipContainer, EquipPoint, pBaseContainer,DeliverBagIndex); } else { BagIndex = g_ItemOperator.MoveItem(pEquipContainer, EquipPoint, pBaseContainer); } GCUnEquipResult Msg; if(BagIndex>=0 && BagIndex<pBaseContainer->GetContainerSize()) { Msg.setEquipPoint(EquipPoint); Msg.setBagIndex(BagIndex); Msg.setItemID(pEquipItem->GetGUID()); Msg.setItemTableIndex(pEquipItem->GetItemTableIndex()); Msg.setResult(UNEQUIP_SUCCESS); pHuman->SetEquipVer(pHuman->GetEquipVer()+1); pHuman->ItemEffectFlush(); pGamePlayer->SendPacket( &Msg ) ; //如果可见 if(pHuman->IsVisualPart(EquipPoint)) { GCCharEquipment OtherMsg; OtherMsg.setObjID(pHuman->GetID()); //if(EquipPoint == HEQUIP_WEAPON) //{ // UINT uGemID = GetEquipmentMaxLevelGemID(pEquipItem); // OtherMsg.setID(EquipPoint,pEquipItem->GetItemTableIndex(), uGemID); //} //else //{ OtherMsg.setID(EquipPoint,pEquipItem->GetItemTableIndex(), -1); //} pScene->BroadCast(&OtherMsg,pHuman,TRUE); } } else { if(ITEMOE_DESTOPERATOR_HASITEM == BagIndex) { Msg.setResult(UNEQUIP_HAS_ITEM); pGamePlayer->SendPacket( &Msg ); } else if(ITEMOE_DESTOPERATOR_FULL == BagIndex) { Msg.setResult(UNEQUIP_BAG_FULL); pGamePlayer->SendPacket( &Msg ); } } } else { Assert(FALSE); //装备为什么不是 ICLASS_EQUIP } g_pLog->FastSaveLog( LOG_FILE_1, "CGUnEquipHandler EquipPoint=%d itemClass=%d", EquipPoint, itemClass ) ; return PACKET_EXE_CONTINUE ; __LEAVE_FUNCTION return PACKET_EXE_ERROR ; }
27.39726
89
0.5575
viticm
f7e9214f5404730203b8a466a580e6b2cfa105fa
2,075
cpp
C++
qt/code/QEditVector.cpp
nvxden/cpp-lib
472303879a7831f8e4144e882423f0be0e6b5f91
[ "MIT" ]
null
null
null
qt/code/QEditVector.cpp
nvxden/cpp-lib
472303879a7831f8e4144e882423f0be0e6b5f91
[ "MIT" ]
null
null
null
qt/code/QEditVector.cpp
nvxden/cpp-lib
472303879a7831f8e4144e882423f0be0e6b5f91
[ "MIT" ]
null
null
null
#include <nvx/qt/QEditVector.hpp> using namespace nvx; QEditVector::QEditVector(Type type, QWidget *parent) : QWidget(parent) { // layout->addLayout(sizelay); // layout->setMargin(0); // sizelay->setMargin(0); // sizelay->addWidget(sizelabel); // sizelay->addWidget(sizeedit); // sizeedit->setFixedWidth(60); // connect( // sizeedit, (void (QSpinBox::*)(int))&QSpinBox::valueChanged, // [&](int i) { resize(i); } // ); // layout->addLayout(elemlay); // elemlay->setMargin(0); // elemlay->setHorizontalSpacing(20); // resize(3); // layout->addStretch(1); // setLayout(layout); setLayout(elemlay); elemlay->addRow(sizelabel, sizeedit); sizeedit->setFixedWidth(60); connect( sizeedit, (void (QSpinBox::*)(int))&QSpinBox::valueChanged, [&](int i) { resize(i); } ); elemlay->setMargin(0); elemlay->setHorizontalSpacing(20); setLayout(elemlay); switch(type) { case int_type: createNewWidget = [](int)->QSpinBox * { auto *box = new QSpinBox; box->setMinimum(int_min); box->setMaximum(int_max); box->setFixedWidth(60); return box; }; break; case double_type: createNewWidget = [](int)->QDoubleSpinBox * { auto *box = new QDoubleSpinBox; box->setMinimum(-double_inf); box->setMaximum(double_inf); box->setSingleStep(0.1); box->setFixedWidth(60); return box; }; break; case string_type: createNewWidget = [](int)->QLineEdit * { auto *line = new QLineEdit; return line; }; break; } resize(3); return; } void QEditVector::resize(int newsize) { if(sizeedit->value() != newsize) { sizeedit->setValue(newsize); return; } if(newsize == (int)widgets.size()) return; if(newsize < (int)widgets.size()) { while((int)widgets.size() != newsize) { elemlay->removeRow((int)widgets.size()); widgets.pop_back(); } return; } QWidget *widget; while((int)widgets.size() != newsize) { widget = createNewWidget(widgets.size()); elemlay->addRow( elemlabelgen(widgets.size()).c_str(), widget ); widgets.push_back(widget); } return; } // end
17.584746
70
0.646265
nvxden
f7e9ec9db344b25b9553fee2fdad35f3de141b20
464
hpp
C++
renderboi/toolbox/mesh_generators/mesh_type.hpp
deqyra/GLSandbox
40d641ebbf6af694e8640a584d283876d128748c
[ "MIT" ]
null
null
null
renderboi/toolbox/mesh_generators/mesh_type.hpp
deqyra/GLSandbox
40d641ebbf6af694e8640a584d283876d128748c
[ "MIT" ]
null
null
null
renderboi/toolbox/mesh_generators/mesh_type.hpp
deqyra/GLSandbox
40d641ebbf6af694e8640a584d283876d128748c
[ "MIT" ]
null
null
null
#ifndef RENDERBOI__TOOLBOX__MESH_GENERATORS__MESH_TYPE_HPP #define RENDERBOI__TOOLBOX__MESH_GENERATORS__MESH_TYPE_HPP namespace Renderboi { /// @brief Collection of literals describing the different shapes a mesh can // come in. Each of these can be mapped to a concrete MeshGenerator subclass. enum class MeshType { Axes, Cube, Plane, Tetrahedron, Torus }; }//namespace Renderboi #endif//RENDERBOI__TOOLBOX__MESH_GENERATORS__MESH_TYPE_HPP
23.2
77
0.797414
deqyra
f7ed264042caccf0b2df1c7d7acfbb8d9262ae47
918
cpp
C++
C_CPP/final/tree.cpp
dengchongsen/study_codes
29d74c05d340117f76aafcc320766248a0f8386b
[ "MulanPSL-1.0" ]
null
null
null
C_CPP/final/tree.cpp
dengchongsen/study_codes
29d74c05d340117f76aafcc320766248a0f8386b
[ "MulanPSL-1.0" ]
null
null
null
C_CPP/final/tree.cpp
dengchongsen/study_codes
29d74c05d340117f76aafcc320766248a0f8386b
[ "MulanPSL-1.0" ]
null
null
null
#include<iostream> #include<cstring> #include<queue> using namespace std; char ans[99]; int lans = 0; char ca[99]; char cb[99]; int la, lb; void dfs(int index){ if( ca[index] == '\0' || ca[index] == '#') { ans[lans++] = '#'; return ; } ans[lans++] = ca[index]; dfs( 2*index+1 ); dfs( 2*index+2); } int main(){ int n; cin >> n; while(n--){ memset(ca,'\0',sizeof(ca)); memset(cb, '\0', sizeof(cb)); memset(ans, '\0', sizeof(ans)); lans = 0; cin >> ca >> cb; la = strlen(ca); lb = strlen(cb); dfs(0); // for(int i=0; i<lans; i++){ // cout<<ans[i]; // } // cout<<endl; int flag = 0; for( int i=0; i<lb; i++){ // cout<<ans[i]<<" "<<cb[i]<<endl; if( ans[i] != cb[i] ){ flag = 1; break; }; } if(flag==0){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } return 0; }
16.105263
46
0.446623
dengchongsen
f7ed53fd00e37b1c22771b8f2b0161564afed229
1,002
cpp
C++
Basic/Calculate Nth Fibonacci Number/SolutionByPiyush.cpp
rajethanm4/Programmers-Community
d16083eb0e84403159d999d4d1a8bbf652ca51f6
[ "MIT" ]
8
2020-11-07T10:29:21.000Z
2020-12-26T16:54:13.000Z
Basic/Calculate Nth Fibonacci Number/SolutionByPiyush.cpp
rajethanm4/Programmers-Community
d16083eb0e84403159d999d4d1a8bbf652ca51f6
[ "MIT" ]
null
null
null
Basic/Calculate Nth Fibonacci Number/SolutionByPiyush.cpp
rajethanm4/Programmers-Community
d16083eb0e84403159d999d4d1a8bbf652ca51f6
[ "MIT" ]
2
2019-12-18T13:06:19.000Z
2021-01-05T18:47:18.000Z
#include<iostream> using namespace std; /* Program Description: A positive number N is given to you and You need to calculate Nth Number in Fibonacci Series. Input: Positive Number Return: Nth number of the fibonacci series where N represents the given "Positive Number". Solution Description: I will follow a recursive approach to find the Nth number of the fibonacci series. */ int Nth_of_Fibonacci(int Number) { if(Number <= 2) return Number-1; else return Nth_of_Fibonacci(Number - 1) + Nth_of_Fibonacci(Number - 2); } int main() { int Number = 0; cout<<"\Enter the number representing the Nth position of the fbonacci series:"; cin>>Number; if(Nth_of_Fibonacci(Number) == -1) // the value returned by the function can be -1 as for 0,1,2 the function is returning (Number-1) so for input '0' the function will return '-1'. cout<<"\nFibonacci series at 0th element doesn't exist."; else cout<<Nth_of_Fibonacci(Number); return 0; }
33.4
184
0.706587
rajethanm4
f7edf7b2b27d08a886d369f0bf63b52a5fe87b87
5,030
cpp
C++
PrinterContextNativeRuntimeComponent/PrinterProperty.cpp
Ganeshcoep/print-oem-samples
0508c31e2881ee0d4379cd7ff830e0062e818a6c
[ "MIT" ]
4
2020-03-25T20:39:20.000Z
2021-04-20T16:11:17.000Z
PrinterContextNativeRuntimeComponent/PrinterProperty.cpp
Ganeshcoep/print-oem-samples
0508c31e2881ee0d4379cd7ff830e0062e818a6c
[ "MIT" ]
2
2017-12-13T16:44:29.000Z
2018-11-14T16:01:37.000Z
PrinterContextNativeRuntimeComponent/PrinterProperty.cpp
Ganeshcoep/print-oem-samples
0508c31e2881ee0d4379cd7ff830e0062e818a6c
[ "MIT" ]
7
2019-06-13T23:15:42.000Z
2020-08-05T14:57:37.000Z
/* * Copyright (c) Microsoft Corporation. All rights reserved. * * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF * ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A * PARTICULAR PURPOSE. * * This class represents a specific printer property * as described in https://msdn.microsoft.com/library/windows/hardware/hh439547 */ #include "pch.h" #include "PrinterProperty.h" // Namespaces using namespace Windows::Foundation; namespace PrinterContextNativeRuntimeComponent { namespace Printing { namespace PrinterExtension { PrinterProperty::PrinterProperty(IPrinterPropertyBag* bag, Platform::String^ printerName) { m_printerPropertyBag = bag; m_printerName = AutoBSTR(printerName); } bool PrinterProperty::GetBool(IPrinterPropertyBag* bag, BSTR name) { BOOL b; ThrowIf(bag->GetBool(name, &b)); return b ? true : false; } void PrinterProperty::SetBool(IPrinterPropertyBag* bag, BSTR name, bool value) { ThrowIf(bag->SetBool(name, value)); } int PrinterProperty::GetInt(IPrinterPropertyBag* bag, BSTR name) { LONG u; ThrowIf(bag->GetInt32(name, &u)); return u; } void PrinterProperty::SetInt(IPrinterPropertyBag* bag, BSTR name, int value) { LONG u = value; ThrowIf(bag->SetInt32(name, u)); } String^ PrinterProperty::GetString(IPrinterPropertyBag* bag, BSTR name) { BSTR u = NULL; StringNonZeroCheck(bag->GetString(name, &u)); Platform::String^ s = ref new Platform::String(u); return s; } void PrinterProperty::SetString(IPrinterPropertyBag* bag, BSTR name, Platform::String^ value) { AutoBSTR b(value); ThrowIf(bag->SetString(name, b)); } Array<byte>^ PrinterProperty::GetBytes(IPrinterPropertyBag* bag, BSTR name) { DWORD count; BYTE* val = NULL; StringNonZeroCheck(bag->GetBytes(name, &count, &val)); return ref new Array<byte, 1>(val, count); //TODO:Test that this is OK } void PrinterProperty::SetBytes(IPrinterPropertyBag* bag, BSTR name, const Array<byte>^ value) { ThrowIf(bag->SetBytes(name, value->Length, value->Data)); } IStream* PrinterProperty::GetReadStream(IPrinterPropertyBag* bag, BSTR name) { IStream* s = NULL; ThrowIf(bag->GetReadStream(name, &s)); return s; } IStream* PrinterProperty::GetWriteStream(IPrinterPropertyBag* bag, BSTR name) { IStream* s = NULL; ThrowIf(bag->GetWriteStream(name, &s)); return s; } // Properties bool PrinterProperty::Bool::get() { return GetBool(m_printerPropertyBag.Get(), m_printerName); } void PrinterProperty::Bool::set(bool value) { SetBool(m_printerPropertyBag.Get(), m_printerName, value); } int PrinterProperty::Int::get() { return GetInt(m_printerPropertyBag.Get(), m_printerName); } void PrinterProperty::Int::set(int value) { SetInt(m_printerPropertyBag.Get(), m_printerName, value); } Platform::String^ PrinterProperty::String::get() { return GetString(m_printerPropertyBag.Get(), m_printerName); } void PrinterProperty::String::set(Platform::String^ value) { SetString(m_printerPropertyBag.Get(), m_printerName, value); } Array<byte>^ PrinterProperty::Bytes::get() { return GetBytes(m_printerPropertyBag.Get(), m_printerName); } void PrinterProperty::Bytes::set(const Array<byte>^ value) { SetBytes(m_printerPropertyBag.Get(), m_printerName, value); } //Actually an IStream* return value ULONGLONG PrinterProperty::ReadStream2::get() { return (ULONGLONG)GetReadStream(m_printerPropertyBag.Get(), m_printerName); } //Actually an IStream* return value ULONGLONG PrinterProperty::WriteStream2::get() { return (ULONGLONG)GetWriteStream(m_printerPropertyBag.Get(), m_printerName); } } } }
33.986486
105
0.541948
Ganeshcoep
f7ee4202ddab6e84df18e5c6803e277c8f5e1019
4,734
hpp
C++
include/helper/pose_helper.hpp
Tobi2001/asr_direct_search_manager
d24847477a37e29a1224f7261a27f91d2a2faebf
[ "BSD-3-Clause" ]
null
null
null
include/helper/pose_helper.hpp
Tobi2001/asr_direct_search_manager
d24847477a37e29a1224f7261a27f91d2a2faebf
[ "BSD-3-Clause" ]
null
null
null
include/helper/pose_helper.hpp
Tobi2001/asr_direct_search_manager
d24847477a37e29a1224f7261a27f91d2a2faebf
[ "BSD-3-Clause" ]
2
2017-04-06T13:36:46.000Z
2019-12-19T18:54:01.000Z
/** Copyright (c) 2016, Borella Jocelyn, Karrenbauer Oliver, Meißner Pascal All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include <ros/ros.h> #include <math.h> #include <boost/shared_ptr.hpp> #include <eigen3/Eigen/Geometry> #include "asr_robot_model_services/GetDistance.h" #include "asr_robot_model_services/GetPose.h" #include "asr_robot_model_services/RobotStateMessage.h" #define RAD_TO_DEG 180.0 / M_PI #define DEG_TO_RAD M_PI / 180.0 namespace directSearchWS { class PoseHelper { private: static boost::shared_ptr<PoseHelper> instancePtr; static double viewPointDistance; static int distanceFuncParam; static double viewCenterPositionDistanceThreshold; static double viewCenterOrientationRadDistanceThreshold; ros::ServiceClient getDistanceServiceClient; ros::ServiceClient getRobotPoseServiceClient; ros::ServiceClient getCameraPoseServiceClient; template <typename T> static T waitForParam(ros::NodeHandle n, std::string param); //calc distance functions double calcDistPositionWithNBV(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2); double calcDistPositionEucl(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2); Eigen::Vector3d calculateViewCenterPoint(const geometry_msgs::Pose &pose); Eigen::Vector3d convertPositionToVec(const geometry_msgs::Pose &pose) { return Eigen::Vector3d(pose.position.x, pose.position.y, pose.position.z); } geometry_msgs::Pose convertVecToPosition(const Eigen::Vector3d &vec) { geometry_msgs::Pose pose; pose.position.x = vec[0]; pose.position.y = vec[1]; pose.position.z = vec[2]; return pose; } Eigen::Quaterniond convertPoseQuatToQuat(const geometry_msgs::Pose &pose) { return Eigen::Quaterniond(pose.orientation.w, pose.orientation.x, pose.orientation.y, pose.orientation.z); } geometry_msgs::Pose getOriginPose() { geometry_msgs::Pose origin; origin.position.x = 0; origin.position.y = 0; origin.position.z = 0; origin.orientation.x = 0; origin.orientation.y = 0; origin.orientation.z = 0; origin.orientation.w = 1; return origin; } PoseHelper(); public: static boost::shared_ptr<PoseHelper> getInstance(); static void resetInstance(); geometry_msgs::Pose getCurrentRobotPose(); geometry_msgs::Pose getCurrentCameraPose(); double calculateDistance(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2); double calcAngularDistanceInRad(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2); bool checkViewCenterPointsAreApproxEquale(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2); bool checkPosesAreApproxEquale(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2, const double positionThreshold, const double orientationRadThreshold); bool checkPositionsAreApproxEquale(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2, const double positionThreshold); bool checkOrientationsAreApproxEquale(const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2, const double orientationRadThreshold); }; typedef boost::shared_ptr<PoseHelper> PoseHelperPtr; }
42.267857
755
0.764681
Tobi2001
f7ef46b21439489c8caa208e04fb2175b74b4130
11,891
cpp
C++
MQUVCopyByVCol.cpp
devil-tamachan/MQUVCopyByVCol
d1a2d16df137a7759b7b13d2dcd2573c2ddf47d7
[ "BSD-3-Clause" ]
null
null
null
MQUVCopyByVCol.cpp
devil-tamachan/MQUVCopyByVCol
d1a2d16df137a7759b7b13d2dcd2573c2ddf47d7
[ "BSD-3-Clause" ]
null
null
null
MQUVCopyByVCol.cpp
devil-tamachan/MQUVCopyByVCol
d1a2d16df137a7759b7b13d2dcd2573c2ddf47d7
[ "BSD-3-Clause" ]
null
null
null
//--------------------------------------------------------------------------- // // MQUVCopyByVCol // // Copyright(C) 1999-2013, tetraface Inc. // // Sample for Object plug-in for deleting faces with reserving lines // in the faces. // Created DLL must be installed in "Plugins\Object" directory. // //  オブジェクト中の辺のみを残して面を削除するオブジェクトプラグイン // のサンプル。 //  作成したDLLは"Plugins\Object"フォルダに入れる必要がある。 // // //--------------------------------------------------------------------------- #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <vector> #include <atlbase.h> #include <atlstr.h> #include <atlcoll.h> #include "MQPlugin.h" #include "MQBasePlugin.h" #include "MQWidget.h" HINSTANCE hInstance; //--------------------------------------------------------------------------- // DllMain //--------------------------------------------------------------------------- BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { // リソース表示に必要なので、インスタンスを保存しておく // Store the instance because it is necessary for displaying resources. hInstance = (HINSTANCE)hModule; // プラグインとしては特に必要な処理はないので、何もせずにTRUEを返す // There is nothing to do for a plugin. So just return TRUE. return TRUE; } //--------------------------------------------------------------------------- // class MQUVCopyByVColPlugin //--------------------------------------------------------------------------- class MQUVCopyByVColPlugin : public MQObjectPlugin { public: MQUVCopyByVColPlugin(); ~MQUVCopyByVColPlugin(); void GetPlugInID(DWORD *Product, DWORD *ID) override; const char *GetPlugInName(void) override; const char *EnumString(int index) override; BOOL Execute(int index, MQDocument doc) override; private: BOOL MQUVCopyByVCol(MQDocument doc); BOOL DeleteLines(MQDocument doc); }; MQBasePlugin *GetPluginClass() { static MQUVCopyByVColPlugin plugin; return &plugin; } MQUVCopyByVColPlugin::MQUVCopyByVColPlugin() { } MQUVCopyByVColPlugin::~MQUVCopyByVColPlugin() { } //--------------------------------------------------------------------------- // MQGetPlugInID // プラグインIDを返す。 // この関数は起動時に呼び出される。 //--------------------------------------------------------------------------- void MQUVCopyByVColPlugin::GetPlugInID(DWORD *Product, DWORD *ID) { // プロダクト名(制作者名)とIDを、全部で64bitの値として返す // 値は他と重複しないようなランダムなもので良い *Product = 0x8AFEA457; *ID = 0x9F57C622; } //--------------------------------------------------------------------------- // MQGetPlugInName // プラグイン名を返す。 // この関数は[プラグインについて]表示時に呼び出される。 //--------------------------------------------------------------------------- const char *MQUVCopyByVColPlugin::GetPlugInName(void) { // プラグイン名 return "MQUVCopyByVCol Copyright(C) 2016, tamachan"; } //--------------------------------------------------------------------------- // MQEnumString // ポップアップメニューに表示される文字列を返す。 // この関数は起動時に呼び出される。 //--------------------------------------------------------------------------- const char *MQUVCopyByVColPlugin::EnumString(int index) { static char buffer[256]; switch(index){ case 0: // Note: following $res$ means the string uses system resource string. return "頂点色が同じUVをコピー"; } return NULL; } //--------------------------------------------------------------------------- // MQModifyObject // メニューから選択されたときに呼び出される。 //--------------------------------------------------------------------------- BOOL MQUVCopyByVColPlugin::Execute(int index, MQDocument doc) { switch(index){ case 0: return MQUVCopyByVCol(doc); } return FALSE; } int compare_VCols(const void *a, const void *b) { return memcmp(a, b, 13/*rgb*4+fTri*/); } int compare_VCol1(const void *a, const void *b) { return memcmp(a, b, 3/*rgb*/); } static const DWORD g_VColUVs_OneSetSize = 3/*RGB*/*4/*角形*/+1/*fTri*/ + sizeof(MQCoordinate)*4/*角形*/; int SearchVCols(BYTE *pVColUVs, DWORD numSet, BYTE *vcols) { int mid; int left = 0; int right = numSet-1; while (left < right) { mid = (left + right) / 2; if (compare_VCols((const void*)(pVColUVs + g_VColUVs_OneSetSize * mid), vcols) < 0) left = mid + 1; else right = mid; } if (compare_VCols((const void*)(pVColUVs + g_VColUVs_OneSetSize * left), vcols) == 0) return left; return -1; } void rotateL(BYTE *arr, int unitSize, int numUnit, int shift) { if(shift>=numUnit)shift%=numUnit; if(shift==0)return; BYTE *t = NULL; if(numUnit/2 < shift) {//right rotate shift = numUnit - shift; int tSize = shift*unitSize; BYTE *t = (BYTE *)malloc(tSize); memcpy(t, arr+(numUnit-shift)*unitSize, tSize); memmove(arr+shift*unitSize, arr, (numUnit-shift)*unitSize); memcpy(arr, t, tSize); } else {//left rotate int tSize = shift*unitSize; BYTE *t = (BYTE *)malloc(tSize); memcpy(t, arr, tSize); memmove(arr, arr+shift*unitSize, (numUnit-shift)*unitSize); memcpy(arr+(numUnit-shift)*unitSize, t, tSize); } free(t); } void rotateR(BYTE *arr, int unitSize, int numUnit, int shift) { if(shift>=numUnit)shift%=numUnit; if(shift==0)return; int lshift = numUnit-shift; rotateL(arr, unitSize, numUnit, lshift); } int SearchMinVColIdx(BYTE *vcols, int numV) { int minIdx=0; int minCnt=0; for(int i=1;i<numV;i++) { int result = compare_VCol1(vcols+i*3, vcols+minIdx*3); if(result<0) { minIdx=i; minCnt=1; } else if(result==0) { minCnt++; } } if(minCnt>1) { int unitSize = 3*numV; BYTE *vcolsArr = (BYTE*)malloc(unitSize*numV); memcpy(vcolsArr, vcols, unitSize); for(int i=1;i<numV;i++) { BYTE *dst = vcolsArr+unitSize*i; memcpy(dst, vcols, unitSize); rotateL(dst, 3, numV, i+1); } minIdx=0; for(int i=1;i<numV;i++) { int result = memcmp(vcols+i*unitSize, vcols+minIdx*unitSize, unitSize); if(result<0)minIdx=i; } free(vcolsArr); } return minIdx; } int SortVCols(BYTE *vcols, int numV) { int minIdx = SearchMinVColIdx(vcols, numV); if(minIdx==0)return minIdx; rotateL(vcols, 3, numV, minIdx); return minIdx; } void SortUVs(BYTE *pVColUVs, int numV, int minIdx) { rotateL(pVColUVs + 13, sizeof(MQCoordinate), numV, minIdx); } int SortVColUV(BYTE *pVColUVs) { int numV = pVColUVs[12]==1?3:4; int minIdx = SortVCols(pVColUVs, numV); if(minIdx>0)SortUVs(pVColUVs, numV, minIdx); return minIdx; } void DbgVColUVs(BYTE *p) { CString s; s.Format("%02X%02X%02X %02X%02X%02X %02X%02X%02X %02X%02X%02X %02X %f,%f %f,%f %f,%f %f,%f", p[0],p[1],p[2], p[3],p[4],p[5], p[6],p[7],p[8], p[9],p[10],p[11], p[12], *(float*)(p+13),*(float*)(p+17), *(float*)(p+21),*(float*)(p+25), *(float*)(p+29),*(float*)(p+33), *(float*)(p+37),*(float*)(p+41)); OutputDebugString(s); } void DbgVCols(BYTE *p) { CString s; s.Format("%02X%02X%02X %02X%02X%02X %02X%02X%02X %02X%02X%02X %02X", p[0],p[1],p[2], p[3],p[4],p[5], p[6],p[7],p[8], p[9],p[10],p[11], p[12]); OutputDebugString(s); } DWORD ReadVColUVs(MQObject oBrush, BYTE *pVColUVs) { DWORD numSet = 0; BYTE *pCur = pVColUVs; for(int fi=0;fi<oBrush->GetFaceCount();fi++) { int numV = oBrush->GetFacePointCount(fi); if(numV>=5) { MessageBox(NULL, "brushオブジェクトに5角以上のポリゴンが含まれています", "エラー", MB_ICONSTOP); return 0; } if(numV<=2)continue; for(int j=0;j<numV;j++) { DWORD c = oBrush->GetFaceVertexColor(fi, j); memcpy(pCur, &c, 3); pCur+=3; } if(numV==3) { memset(pCur, 0, 3); pCur+=3; *pCur=1; } else *pCur=0; pCur++; oBrush->GetFaceCoordinateArray(fi, (MQCoordinate*)pCur); pCur+=sizeof(MQCoordinate)*4; numSet++; } pCur = pVColUVs; for(int i=0;i<numSet;i++) { //OutputDebugString(pCur[12]?"3":"4"); //DbgVColUVs(pCur); SortVColUV(pCur); //DbgVColUVs(pCur); pCur+=g_VColUVs_OneSetSize; } //OutputDebugString("++++++++++++++++++++++Sorted src"); /*pCur = pVColUVs; for(int i=0;i<numSet;i++) { DbgVColUVs(pCur); pCur+=g_VColUVs_OneSetSize; }*/ //OutputDebugString("----------------------Sorted src"); /*FILE *fp = fopen("C:\\tmp\\dbg2.bin", "wb"); if(fp!=NULL) { fwrite(pVColUVs, g_VColUVs_OneSetSize, numSet, fp); fclose(fp); }*/ qsort(pVColUVs, numSet, g_VColUVs_OneSetSize, compare_VCols); OutputDebugString("++++++++++++++++++++++Sorted src2"); pCur = pVColUVs; for(int i=0;i<numSet;i++) { DbgVColUVs(pCur); pCur+=g_VColUVs_OneSetSize; } OutputDebugString("----------------------Sorted src2"); return numSet; } void SetUVs(MQObject o, int fi, BYTE *pVColUVs, int idx, int rshift) { MQCoordinate uvs[4]; /*{ CString s; s.Format("idx==%d\n", idx); OutputDebugString(s); }*/ int numV = pVColUVs[12]==1 ? 3:4; if(numV!=o->GetFacePointCount(fi))return; void *pStart = (pVColUVs + idx*g_VColUVs_OneSetSize + 13); memcpy(uvs, pStart, sizeof(MQCoordinate)*numV); /*for(int i=0;i<numV;i++) { CString s; s.Format("%f,%f\n", uvs[i].u, uvs[i].v); OutputDebugString(s); }*/ //OutputDebugString("------------------"); rotateR((BYTE*)uvs, sizeof(MQCoordinate), numV, rshift); /*for(int i=0;i<numV;i++) { CString s; s.Format("%f,%f\n", uvs[i].u, uvs[i].v); OutputDebugString(s); }*/ //OutputDebugString("------------------"); o->SetFaceCoordinateArray(fi, uvs); } BOOL MQUVCopyByVColPlugin::MQUVCopyByVCol(MQDocument doc) { BYTE *pVColUVs = NULL; CAtlArray<MQObject> targetObjArr; MQObject oBrush = NULL; int numObj = doc->GetObjectCount(); for(int i=0;i<numObj;i++) { MQObject o = doc->GetObject(i); if(o!=NULL) { CString objName; o->GetName(objName.GetBufferSetLength(151), 150); objName.ReleaseBuffer(); if(objName==_T("brush"))oBrush = o; else { targetObjArr.Add(o); } } } if(oBrush == NULL || oBrush->GetFaceCount()==0 ||targetObjArr.GetCount()==0)return FALSE; pVColUVs = (BYTE*)calloc(oBrush->GetFaceCount(), g_VColUVs_OneSetSize); if(pVColUVs==NULL)goto failed_MQUVCopyByVCol; DWORD numSetSrc = ReadVColUVs(oBrush, pVColUVs); if(numSetSrc==0)goto failed_MQUVCopyByVCol; //OutputDebugString("src readed-----------------\n"); /*FILE *fp = fopen("C:\\tmp\\dbg.bin", "wb"); if(fp!=NULL) { fwrite(pVColUVs, g_VColUVs_OneSetSize, numSetSrc, fp); fclose(fp); }*/ BYTE vcols[13] = {0}; for(int oi=0;oi<targetObjArr.GetCount();oi++) { MQObject o = targetObjArr[oi]; int numFace = o->GetFaceCount(); //CString s; //s.Format("g_VColUVs_OneSetSize==%d\n", g_VColUVs_OneSetSize); //OutputDebugString(s); //s.Format("sizeof(MQCoordinate)==%d\n", sizeof(MQCoordinate)); //OutputDebugString(s); //o->GetName(s.GetBufferSetLength(255), 255); //OutputDebugString(s); //s.Format("numFace == %d\n", numFace); //OutputDebugString(s); for(int fi=0;fi<numFace;fi++) { int numV = o->GetFacePointCount(fi); //s.Format("numV == %d\n", numV); //OutputDebugString(s); if(numV!=3 && numV!=4)continue; memset(vcols, 0, sizeof(vcols)); for(int j=0;j<numV;j++) { *((DWORD*)(vcols+3*j)) = o->GetFaceVertexColor(fi, j); } if(numV==3)vcols[9]=0; vcols[12] = numV==3?1:0; OutputDebugString("-------------\n"); DbgVCols(vcols); int minIdx = SortVCols(vcols, numV); DbgVCols(vcols); int idx = SearchVCols(pVColUVs, numSetSrc, vcols); if(idx>=0) { DbgVColUVs(pVColUVs+idx*g_VColUVs_OneSetSize); SetUVs(o, fi, pVColUVs, idx, minIdx); } else OutputDebugString("ERR: vcol not found\n"); } } if(pVColUVs!=NULL)free(pVColUVs); return TRUE; failed_MQUVCopyByVCol: if(pVColUVs!=NULL)free(pVColUVs); return FALSE; }
26.307522
305
0.570516
devil-tamachan
f7f14c072123066b3863735cf881deb6aecd6db0
1,411
cpp
C++
lib/mayaUsd/undo/UsdUndoManager.cpp
smithw-adsk/maya-usd
3a2278111e631423ffa9bae28158a6d2299a200e
[ "Apache-2.0" ]
null
null
null
lib/mayaUsd/undo/UsdUndoManager.cpp
smithw-adsk/maya-usd
3a2278111e631423ffa9bae28158a6d2299a200e
[ "Apache-2.0" ]
4
2020-05-04T19:21:26.000Z
2020-05-08T15:30:38.000Z
lib/mayaUsd/undo/UsdUndoManager.cpp
smithw-adsk/maya-usd
3a2278111e631423ffa9bae28158a6d2299a200e
[ "Apache-2.0" ]
1
2020-05-04T22:14:09.000Z
2020-05-04T22:14:09.000Z
// // Copyright 2020 Autodesk // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #include "UsdUndoManager.h" #include "UsdUndoBlock.h" #include "UsdUndoStateDelegate.h" PXR_NAMESPACE_USING_DIRECTIVE namespace MAYAUSD_NS_DEF { UsdUndoManager& UsdUndoManager::instance() { static UsdUndoManager undoManager; return undoManager; } void UsdUndoManager::trackLayerStates(const SdfLayerHandle& layer) { layer->SetStateDelegate(UsdUndoStateDelegate::New()); } void UsdUndoManager::addInverse(InvertFunc func) { if (UsdUndoBlock::depth() == 0) { TF_CODING_ERROR("Collecting invert functions outside of undoblock is not allowed!"); return; } _invertFuncs.emplace_back(func); } void UsdUndoManager::transferEdits(UsdUndoableItem& undoableItem) { // transfer the edits undoableItem._invertFuncs = std::move(_invertFuncs); } } // namespace MAYAUSD_NS_DEF
26.12963
92
0.744862
smithw-adsk
f7f4961c679525497c2980665598f0c615d4197d
5,802
inl
C++
Core/DianYing/Include/Dy/Management/Inline/MWindowImpl.inl
liliilli/DianYing
6e19f67e5d932e346a0ce63a648bed1a04ef618e
[ "MIT" ]
4
2019-03-17T19:46:54.000Z
2019-12-09T20:11:01.000Z
Core/DianYing/Include/Dy/Management/Inline/MWindowImpl.inl
liliilli/DianYing
6e19f67e5d932e346a0ce63a648bed1a04ef618e
[ "MIT" ]
null
null
null
Core/DianYing/Include/Dy/Management/Inline/MWindowImpl.inl
liliilli/DianYing
6e19f67e5d932e346a0ce63a648bed1a04ef618e
[ "MIT" ]
null
null
null
#ifndef GUARD_DY_MANAGEMENT_WINDOWMANAGER_IMPL_INL #define GUARD_DY_MANAGEMENT_WINDOWMANAGER_IMPL_INL /// /// MIT License /// Copyright (c) 2018-2019 Jongmin Yun /// /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE /// SOFTWARE. /// namespace dy { inline MWindow::Impl::Impl(MWindow& parent) : mImplParent{parent} { /// @brief Initialize OpenGL Context. /// This function must be returned `EDySuccess::DY_SUCCESS`. static auto InitializeOpenGL = [this]() { glfwInit(); // Create descriptor. PDyGLWindowContextDescriptor descriptor{}; descriptor.mWindowName = "DianYing"; descriptor.mIsWindowResizable = false; descriptor.mIsWindowVisible = true; descriptor.mIsWindowShouldFocus = true; descriptor.mIsUsingDefaultDoubleBuffer = true; const auto& settingManager = MSetting::GetInstance(); descriptor.mWindowSize = DIVec2{ settingManager.GetWindowSizeWidth(), settingManager.GetWindowSizeHeight() }; this->mGlfwWindow = XGLWrapper::CreateGLWindow(descriptor); // Create window instance for giving context to I/O worker thread. descriptor.mIsWindowShouldFocus = false; descriptor.mIsWindowVisible = false; descriptor.mSharingContext = this->mGlfwWindow; for (auto& ptrWindow : this->mGlfwWorkerWnds) { ptrWindow = XGLWrapper::CreateGLWindow(descriptor); } // Check validity if (this->mGlfwWindow == nullptr) { glfwTerminate(); return EDySuccess::DY_FAILURE; } XGLWrapper::CreateGLContext(this->mGlfwWindow); gladLoadGLLoader(reinterpret_cast<GLADloadproc>(glfwGetProcAddress)); glfwSetInputMode(this->mGlfwWindow, GLFW_STICKY_KEYS, GL_FALSE); glfwSetFramebufferSizeCallback(this->mGlfwWindow, &DyGlCallbackFrameBufferSize); glfwSetWindowCloseCallback(this->mGlfwWindow, &DyGlCallbackWindowClose); // If in debug build environment, enable debug output logging. #if defined(_DEBUG) || !defined(_NDEBUG) glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); glDebugMessageCallback(DyGlMessageCallback, nullptr); GLuint unusedIds = 0; glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, &unusedIds, GL_TRUE); glfwSetErrorCallback(&DyGLFWErrorFunction); #endif // Setting rendering. glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); { // Make initialized screen to black for giving liability to users XD glClear(GL_COLOR_BUFFER_BIT); glClearColor(0.f, 0.f, 0.f, 1.0f); glfwSwapBuffers(this->mGlfwWindow); glfwPollEvents(); } return EDySuccess::DY_SUCCESS; }; //! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //! FUNCTIONBODY ∨ //! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DyPushLogDebugInfo("{} | MWindow::Impl::pfInitialize().", "FunctionCall"); // If we should create console window... if (MSetting::GetInstance().IsEnabledSubFeatureLoggingToConsole() == true) { const auto flag = gEngine->GetPlatformInfo().CreateConsoleWindow(); MDY_ASSERT(flag == true); } // @TODO TEMP switch (MSetting::GetInstance().GetRenderingType()) { default: MDY_UNEXPECTED_BRANCH(); break; case EDyRenderingApi::DirectX12: MDY_NOT_IMPLEMENTED_ASSERT(); break; case EDyRenderingApi::Vulkan: MDY_NOT_IMPLEMENTED_ASSERT(); break; case EDyRenderingApi::DirectX11: MDY_NOT_IMPLEMENTED_ASSERT(); break; case EDyRenderingApi::OpenGL: DyPushLogDebugInfo("Initialize OpenGL Context."); MDY_CALL_ASSERT_SUCCESS(InitializeOpenGL()); break; } } inline MWindow::Impl::~Impl() { DyPushLogDebugInfo("{} | MWindow::Impl::pfRelease().", "FunctionCall"); switch (MSetting::GetInstance().GetRenderingType()) { default: MDY_UNEXPECTED_BRANCH(); case EDyRenderingApi::DirectX11: DyPushLogDebugInfo("Release DirectX11 Context."); MDY_NOT_IMPLEMENTED_ASSERT(); break; case EDyRenderingApi::DirectX12: DyPushLogDebugInfo("Release DirectX12 Context."); MDY_NOT_IMPLEMENTED_ASSERT(); break; case EDyRenderingApi::Vulkan: DyPushLogDebugInfo("Release Vulkan Context."); MDY_NOT_IMPLEMENTED_ASSERT(); break; case EDyRenderingApi::OpenGL: glfwTerminate(); break; } if (gEngine->GetPlatformInfo().IsConsoleWindowCreated() == true) { const auto flag = gEngine->GetPlatformInfo().RemoveConsoleWindow(); MDY_ASSERT(flag == true); } } inline bool MWindow::Impl::IsWindowShouldClose() const noexcept { return glfwWindowShouldClose(this->mGlfwWindow); } inline EDySuccess MWindow::Impl::MDY_PRIVATE(TerminateWindow)() noexcept { glfwSetWindowShouldClose(this->GetGLMainWindow(), GLFW_TRUE); return EDySuccess::DY_SUCCESS; } inline GLFWwindow* MWindow::Impl::GetGLMainWindow() const noexcept { MDY_ASSERT_MSG(MDY_CHECK_ISNOTNULL(this->mGlfwWindow), "GlfwWindow is not initiailized."); return this->mGlfwWindow; } inline const std::array<GLFWwindow*, 2>& MWindow::Impl::GetGLWorkerWindowList() const noexcept { #if defined (NDEBUG) == false for (const auto& ptrWindow : this->mGlfwWorkerWnds) { // Validation check. MaybeNotUsed(ptrWindow); MDY_ASSERT_MSG(MDY_CHECK_ISNOTNULL(ptrWindow), "GLFWwindow must be valid."); } #endif return this->mGlfwWorkerWnds; } } /// ::dy namespace #endif /// GUARD_DY_MANAGEMENT_WINDOWMANAGER_IMPL_INL
35.814815
121
0.715615
liliilli
f7f58db89fe142ca9d96f959f2d7e378874a53fc
7,046
cpp
C++
emulator/src/devices/machine/vt82c496.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
1
2022-01-15T21:38:38.000Z
2022-01-15T21:38:38.000Z
emulator/src/devices/machine/vt82c496.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
null
null
null
emulator/src/devices/machine/vt82c496.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
null
null
null
// license:BSD-3-Clause // copyright-holders:Barry Rodewald /* VIA VT82C496G "Green PC" system chipset */ #include "emu.h" #include "vt82c496.h" /*************************************************************************** IMPLEMENTATION ***************************************************************************/ DEFINE_DEVICE_TYPE(VT82C496, vt82c496_device, "vt82c496", "VIA VT82C496 system chipset") vt82c496_device::vt82c496_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, VT82C496, tag, owner, clock), m_cpu_tag(nullptr), m_region_tag(nullptr), m_space(nullptr), m_ram(nullptr), m_rom(nullptr), m_reg_select(0) { } void vt82c496_device::device_start() { /* get address space we are working on */ device_t *cpu = machine().device(m_cpu_tag); assert(cpu != nullptr); m_space = &cpu->memory().space(AS_PROGRAM); /* get rom region */ m_rom = machine().root_device().memregion(m_region_tag)->base(); save_pointer(m_reg,"Registers",0x100); m_ram = machine().device<ram_device>(RAM_TAG); } void vt82c496_device::device_reset() { memset(m_reg,0,0x100); // set up default ROM banking m_space->install_read_bank(0xc0000,0xc3fff,0,"bios_c0_r"); m_space->install_read_bank(0xc4000,0xc7fff,0,"bios_c4_r"); m_space->install_read_bank(0xc8000,0xcbfff,0,"bios_c8_r"); m_space->install_read_bank(0xcc000,0xcffff,0,"bios_cc_r"); m_space->install_read_bank(0xd0000,0xd3fff,0,"bios_d0_r"); m_space->install_read_bank(0xd4000,0xd7fff,0,"bios_d4_r"); m_space->install_read_bank(0xd8000,0xdbfff,0,"bios_d8_r"); m_space->install_read_bank(0xdc000,0xdffff,0,"bios_dc_r"); m_space->install_read_bank(0xe0000,0xeffff,0,"bios_e0_r"); m_space->install_read_bank(0xf0000,0xfffff,0,"bios_f0_r"); m_space->nop_write(0xc0000,0xfffff); machine().root_device().membank("bios_c0_r")->set_base(m_rom); machine().root_device().membank("bios_c4_r")->set_base(m_rom+0x4000); machine().root_device().membank("bios_c8_r")->set_base(m_rom+0x8000); machine().root_device().membank("bios_cc_r")->set_base(m_rom+0xc000); machine().root_device().membank("bios_d0_r")->set_base(m_rom+0x10000); machine().root_device().membank("bios_d4_r")->set_base(m_rom+0x14000); machine().root_device().membank("bios_d8_r")->set_base(m_rom+0x18000); machine().root_device().membank("bios_dc_r")->set_base(m_rom+0x1c000); machine().root_device().membank("bios_e0_r")->set_base(m_rom+0x20000); machine().root_device().membank("bios_f0_r")->set_base(m_rom+0x30000); } READ8_MEMBER(vt82c496_device::read) { if(offset == 1) return m_reg[m_reg_select]; return 0x00; } WRITE8_MEMBER(vt82c496_device::write) { if(offset == 0) m_reg_select = data; if(offset == 1) { m_reg[m_reg_select] = data; switch(m_reg_select) { case 0x30: update_mem_c0(data); break; case 0x31: update_mem_d0(data); break; case 0x32: update_mem_e0(data); break; } } } void vt82c496_device::update_mem_c0(uint8_t data) { if(data & 0x80) machine().root_device().membank("bios_cc_r")->set_base(m_ram->pointer()+0xcc000); else machine().root_device().membank("bios_cc_r")->set_base(m_rom+0xc000); if(data & 0x40) { m_space->install_write_bank(0xcc000,0xcffff,0,"bios_cc_w"); machine().root_device().membank("bios_cc_w")->set_base(m_ram->pointer()+0xcc000); } else m_space->nop_write(0xcc000,0xcffff); if(data & 0x20) machine().root_device().membank("bios_c8_r")->set_base(m_ram->pointer()+0xc8000); else machine().root_device().membank("bios_c8_r")->set_base(m_rom+0x8000); if(data & 0x10) { m_space->install_write_bank(0xc8000,0xcbfff,0,"bios_c8_w"); machine().root_device().membank("bios_c8_w")->set_base(m_ram->pointer()+0xc8000); } else m_space->nop_write(0xc8000,0xcbfff); if(data & 0x08) machine().root_device().membank("bios_c4_r")->set_base(m_ram->pointer()+0xc4000); else machine().root_device().membank("bios_c4_r")->set_base(m_rom+0x4000); if(data & 0x04) { m_space->install_write_bank(0xc4000,0xc7fff,0,"bios_c4_w"); machine().root_device().membank("bios_c4_w")->set_base(m_ram->pointer()+0xc4000); } else m_space->nop_write(0xc4000,0xc7fff); if(data & 0x02) machine().root_device().membank("bios_c0_r")->set_base(m_ram->pointer()+0xc0000); else machine().root_device().membank("bios_c0_r")->set_base(m_rom+0); if(data & 0x01) { m_space->install_write_bank(0xc0000,0xc3fff,0,"bios_c0_w"); machine().root_device().membank("bios_c0_w")->set_base(m_ram->pointer()+0xc0000); } else m_space->nop_write(0xc0000,0xc3fff); } void vt82c496_device::update_mem_d0(uint8_t data) { if(data & 0x80) machine().root_device().membank("bios_dc_r")->set_base(m_ram->pointer()+0xdc000); else machine().root_device().membank("bios_dc_r")->set_base(m_rom+0x1c000); if(data & 0x40) { m_space->install_write_bank(0xdc000,0xdffff,0,"bios_dc_w"); machine().root_device().membank("bios_dc_w")->set_base(m_ram->pointer()+0xdc000); } else m_space->nop_write(0xdc000,0xdffff); if(data & 0x20) machine().root_device().membank("bios_d8_r")->set_base(m_ram->pointer()+0xd8000); else machine().root_device().membank("bios_d8_r")->set_base(m_rom+0x18000); if(data & 0x10) { m_space->install_write_bank(0xd8000,0xdbfff,0,"bios_d8_w"); machine().root_device().membank("bios_d8_w")->set_base(m_ram->pointer()+0xd8000); } else m_space->nop_write(0xd8000,0xdbfff); if(data & 0x08) machine().root_device().membank("bios_d4_r")->set_base(m_ram->pointer()+0xd4000); else machine().root_device().membank("bios_d4_r")->set_base(m_rom+0x14000); if(data & 0x04) { m_space->install_write_bank(0xd4000,0xd7fff,0,"bios_d4_w"); machine().root_device().membank("bios_d4_w")->set_base(m_ram->pointer()+0xd4000); } else m_space->nop_write(0xd4000,0xd7fff); if(data & 0x02) machine().root_device().membank("bios_d0_r")->set_base(m_ram->pointer()+0xd0000); else machine().root_device().membank("bios_d0_r")->set_base(m_rom+0x10000); if(data & 0x01) { m_space->install_write_bank(0xd0000,0xd3fff,0,"bios_d0_w"); machine().root_device().membank("bios_d0_w")->set_base(m_ram->pointer()+0xd0000); } else m_space->nop_write(0xd0000,0xd3fff); } void vt82c496_device::update_mem_e0(uint8_t data) { if(data & 0x80) machine().root_device().membank("bios_e0_r")->set_base(m_ram->pointer()+0xe0000); else machine().root_device().membank("bios_e0_r")->set_base(m_rom+0x20000); if(data & 0x40) { m_space->install_write_bank(0xe0000,0xeffff,0,"bios_e0_w"); machine().root_device().membank("bios_e0_w")->set_base(m_ram->pointer()+0xe0000); } else m_space->nop_write(0xe0000,0xeffff); if(data & 0x20) machine().root_device().membank("bios_f0_r")->set_base(m_ram->pointer()+0xf0000); else machine().root_device().membank("bios_f0_r")->set_base(m_rom+0x30000); if(data & 0x10) { m_space->install_write_bank(0xf0000,0xfffff,0,"bios_f0_w"); machine().root_device().membank("bios_f0_w")->set_base(m_ram->pointer()+0xf0000); } else m_space->nop_write(0xf0000,0xfffff); }
31.039648
159
0.710048
rjw57
f7f5e739d6d881d28940dd7fe11e1b1508d19b4a
749
cpp
C++
Sources/LibRT/source/RTBufferDescriptor.cpp
Rominitch/MouCaLab
d8c24de479b1bc11509df8456e0071d394fbeab9
[ "Unlicense" ]
null
null
null
Sources/LibRT/source/RTBufferDescriptor.cpp
Rominitch/MouCaLab
d8c24de479b1bc11509df8456e0071d394fbeab9
[ "Unlicense" ]
null
null
null
Sources/LibRT/source/RTBufferDescriptor.cpp
Rominitch/MouCaLab
d8c24de479b1bc11509df8456e0071d394fbeab9
[ "Unlicense" ]
null
null
null
/// https://github.com/Rominitch/MouCaLab /// \author Rominitch /// \license No license #include "Dependencies.h" #include <LibRT/include/RTBufferDescriptor.h> namespace RT { ComponentDescriptor::ComponentDescriptor(const uint64_t nbComponents, const Type formatType, const ComponentUsage componentUsage, const bool bNormalized) : _formatType(formatType), _nbComponents(nbComponents), _sizeInByte(0), _componentUsage(componentUsage), _isNormalized(bNormalized) { //Check error MOUCA_PRE_CONDITION(nbComponents > 0); MOUCA_PRE_CONDITION(formatType < Type::NbTypes); MOUCA_PRE_CONDITION(componentUsage < ComponentUsage::NbUsages); //Compute Size of descriptor _sizeInByte = computeSizeOf(_formatType) * _nbComponents; } }
32.565217
155
0.781041
Rominitch
f7f811321f9e8fc5459641b58262b596b9d77852
2,524
cpp
C++
application/game.cpp
YoeyT/IPASS-SSD1351-Tron
9f01b8ac84fe3304bcc711dd43e3211b178bb9c0
[ "BSL-1.0" ]
null
null
null
application/game.cpp
YoeyT/IPASS-SSD1351-Tron
9f01b8ac84fe3304bcc711dd43e3211b178bb9c0
[ "BSL-1.0" ]
null
null
null
application/game.cpp
YoeyT/IPASS-SSD1351-Tron
9f01b8ac84fe3304bcc711dd43e3211b178bb9c0
[ "BSL-1.0" ]
null
null
null
#include "game.hpp" void StartGame(SSD1351& screen, hwlib::pin_in& upKey, hwlib::pin_in& downKey, hwlib::pin_in& leftKey, hwlib::pin_in& rightKey) { //setup screen.Init(); screen.FillScreen(0); //player bike player(12, 12, color(0, 0xFF, 0xFF)); player.Draw(screen); //AI AIBike AI(111, 111, color(0xF8, 0x00, 0x00)); AI.Draw(screen); //Borders wall borderLeft(0, 0, 2, 127, 0x001F); wall borderDown(0, 125, 127, 127, 0x001F); wall borderUp(0, 0, 127, 2, 0x001F); wall borderRight(125, 0, 127, 127, 0x001F); borderLeft.Draw(screen); borderDown.Draw(screen); borderUp.Draw(screen); borderRight.Draw(screen); const std::array<wall , 4> borderWalls = {borderLeft, borderDown, borderUp, borderRight}; bool gameQuit = false; uint16_t colorWon; //gameloop, this runs every "frame" while(!gameQuit) { //read player inputs and move accordingly player.ReadAndMove(!upKey.read(), !downKey.read(), !leftKey.read(), !rightKey.read()); player.Draw(screen); //Make a decision and move accordingly AI.MakeDecision(player, borderWalls); AI.Draw(screen); //check for collisions if(CheckCollisions(AI, player, borderWalls)) { gameQuit = true; colorWon = 0x07FF; } else if(CheckCollisions(player, AI, borderWalls)) { gameQuit = true; colorWon = 0xF800; } //limit frames per second, otherwise the game is too fast hwlib::wait_ms(50); } screen.FillScreen(colorWon); } bool CheckCollisions(const bike& player, const bike& otherPlayer, const std::array<wall, 4>& borderWalls) { //check for wall collision for(wall wallObject : borderWalls) { if(Collision(player, wallObject)) { return true; } } //check bike trail collisions for(uint8_t trail = 0; trail < (player.GetBikeTrailIterator() - 1); trail++) { if(Collision(player, player.GetBikeTrail()[trail])) { return true; } } //check other player bike trail collisions for(uint8_t trail = 0; trail < (otherPlayer.GetBikeTrailIterator() - 1); trail++) { if(Collision(player, otherPlayer.GetBikeTrail()[trail])) { return true; } } //check bike to bike collision if(Collision(player, otherPlayer)) { return true; } return false; }
26.020619
126
0.596276
YoeyT
f7f9223443bfb7b281cba54c2b4da1ac000e67dd
267
cpp
C++
cppabi/src/adapterold.cpp
ivanmurashko/articles
522db3ad21e96084490acd39a146a335763e5beb
[ "MIT" ]
1
2019-09-27T08:59:55.000Z
2019-09-27T08:59:55.000Z
cppabi/src/adapterold.cpp
ivanmurashko/articles
522db3ad21e96084490acd39a146a335763e5beb
[ "MIT" ]
null
null
null
cppabi/src/adapterold.cpp
ivanmurashko/articles
522db3ad21e96084490acd39a146a335763e5beb
[ "MIT" ]
null
null
null
#define _GLIBCXX_USE_CXX11_ABI 0 #include "adapter.h" #include "old.h" namespace testadapter { std::vector<char> func(std::vector<char> input){ auto res = test::func(std::string(input.data(), input.size())); return std::vector<char>(res.begin(), res.end()); } }
24.272727
65
0.692884
ivanmurashko
f7fab0ab8126e6982361b4bbd2a0ea4f501bb302
5,085
cpp
C++
tests/lexy/dsl/capture.cpp
netcan/lexy
775e3d6bf1169ce13b08598d774e707c253f0792
[ "BSL-1.0" ]
null
null
null
tests/lexy/dsl/capture.cpp
netcan/lexy
775e3d6bf1169ce13b08598d774e707c253f0792
[ "BSL-1.0" ]
null
null
null
tests/lexy/dsl/capture.cpp
netcan/lexy
775e3d6bf1169ce13b08598d774e707c253f0792
[ "BSL-1.0" ]
null
null
null
// Copyright (C) 2020 Jonathan Müller <jonathanmueller.dev@gmail.com> // This file is subject to the license terms in the LICENSE file // found in the top-level directory of this distribution. #include <lexy/dsl/capture.hpp> #include "verify.hpp" #include <lexy/callback.hpp> #include <lexy/dsl/label.hpp> #include <lexy/dsl/sequence.hpp> TEST_CASE("dsl::capture()") { SUBCASE("basic") { constexpr auto rule = capture(LEXY_LIT("abc")); CHECK(lexy::is_rule<decltype(rule)>); CHECK(!lexy::is_pattern<decltype(rule)>); struct callback { const char* str; constexpr int success(const char* cur, lexy::lexeme_for<test_input> lex) { CONSTEXPR_CHECK(lex.begin() == str); CONSTEXPR_CHECK(lex.end() == cur); return 0; } constexpr int error(test_error<lexy::expected_literal> e) { CONSTEXPR_CHECK(e.string() == "abc"); return -1; } }; constexpr auto empty = rule_matches<callback>(rule, ""); CHECK(empty == -1); constexpr auto success = rule_matches<callback>(rule, "abc"); CHECK(success == 0); } SUBCASE("capture label") { constexpr auto rule = capture(lexy::dsl::label<struct lab>); CHECK(lexy::is_rule<decltype(rule)>); CHECK(!lexy::is_pattern<decltype(rule)>); struct callback { const char* str; constexpr int success(const char* cur, lexy::lexeme_for<test_input> lex, lexy::label<lab>) { CONSTEXPR_CHECK(str == cur); CONSTEXPR_CHECK(lex.empty()); return 0; } }; constexpr auto empty = rule_matches<callback>(rule, ""); CHECK(empty == 0); constexpr auto string = rule_matches<callback>(rule, "abc"); CHECK(string == 0); } SUBCASE("directly nested") { constexpr auto rule = capture(capture(LEXY_LIT("abc"))); CHECK(lexy::is_rule<decltype(rule)>); CHECK(!lexy::is_pattern<decltype(rule)>); struct callback { const char* str; constexpr int success(const char*, lexy::lexeme_for<test_input> outer, lexy::lexeme_for<test_input> inner) { CONSTEXPR_CHECK(lexy::as_string<lexy::_detail::string_view>(outer) == "abc"); CONSTEXPR_CHECK(lexy::as_string<lexy::_detail::string_view>(inner) == "abc"); return 0; } constexpr int error(test_error<lexy::expected_literal> e) { CONSTEXPR_CHECK(e.string() == "abc"); return -1; } }; constexpr auto empty = rule_matches<callback>(rule, ""); CHECK(empty == -1); constexpr auto success = rule_matches<callback>(rule, "abc"); CHECK(success == 0); } SUBCASE("indirectly nested") { constexpr auto rule = capture(LEXY_LIT("(") + capture(LEXY_LIT("abc")) + LEXY_LIT(")")); CHECK(lexy::is_rule<decltype(rule)>); struct callback { const char* str; constexpr int success(const char*, lexy::lexeme_for<test_input> outer, lexy::lexeme_for<test_input> inner) { CONSTEXPR_CHECK(lexy::as_string<lexy::_detail::string_view>(outer) == "(abc)"); CONSTEXPR_CHECK(lexy::as_string<lexy::_detail::string_view>(inner) == "abc"); return 0; } constexpr int error(test_error<lexy::expected_literal>) { return -1; } }; constexpr auto empty = rule_matches<callback>(rule, ""); CHECK(empty == -1); constexpr auto success = rule_matches<callback>(rule, "(abc)"); CHECK(success == 0); } SUBCASE("whitespace") { constexpr auto rule = capture(LEXY_LIT("abc"))[LEXY_LIT(" ")]; CHECK(lexy::is_rule<decltype(rule)>); CHECK(!lexy::is_pattern<decltype(rule)>); struct callback { const char* str; constexpr int success(const char* cur, lexy::lexeme_for<test_input> lex) { CONSTEXPR_CHECK(lex.end() == cur); CONSTEXPR_CHECK(lexy::_detail::string_view(lex.data(), lex.size()) == "abc"); return 0; } constexpr int error(test_error<lexy::expected_literal> e) { CONSTEXPR_CHECK(e.string() == "abc"); return -1; } }; constexpr auto empty = rule_matches<callback>(rule, ""); CHECK(empty == -1); constexpr auto success = rule_matches<callback>(rule, "abc"); CHECK(success == 0); constexpr auto with_space = rule_matches<callback>(rule, " abc"); CHECK(with_space == 0); } }
31.006098
96
0.532153
netcan
790079afd1a1eaf04f5a1d286c1994e5d4839518
94
hpp
C++
include/Towers/Towers.hpp
sarahkittyy/BloonsTDS
07a00f01db49077f0a3c555fc629de4775f11124
[ "MIT" ]
null
null
null
include/Towers/Towers.hpp
sarahkittyy/BloonsTDS
07a00f01db49077f0a3c555fc629de4775f11124
[ "MIT" ]
null
null
null
include/Towers/Towers.hpp
sarahkittyy/BloonsTDS
07a00f01db49077f0a3c555fc629de4775f11124
[ "MIT" ]
null
null
null
#pragma once #include "Towers/Manager.hpp" #include "Towers/Tower.hpp" namespace Towers { }
10.444444
29
0.734043
sarahkittyy
7901240c1580bfaa28c775b4e754cdbd074a422a
270
cpp
C++
frontend/typing/types/meta.cpp
NicolaiLS/becarre
cf23e80041f856f50b9f96c087819780dfe1792c
[ "MIT" ]
null
null
null
frontend/typing/types/meta.cpp
NicolaiLS/becarre
cf23e80041f856f50b9f96c087819780dfe1792c
[ "MIT" ]
null
null
null
frontend/typing/types/meta.cpp
NicolaiLS/becarre
cf23e80041f856f50b9f96c087819780dfe1792c
[ "MIT" ]
null
null
null
#include <becarre/frontend/typing/types/meta.hpp> #include <becarre/frontend/typing/types.hpp> namespace becarre::frontend::typing::types { Type meta(Type const & value) noexcept { return Type(types::Meta{value}); } } // namespace becarre::frontend::typing::types
19.285714
49
0.740741
NicolaiLS
7903fcb0a505e1afe2adbec3030a92f354b3c8dd
36,384
cpp
C++
plugins/Rembed/Rembed.cpp
oxhead/HPCC-Platform
62e092695542a9bbea1bb3672f0d1ff572666cfc
[ "Apache-2.0" ]
null
null
null
plugins/Rembed/Rembed.cpp
oxhead/HPCC-Platform
62e092695542a9bbea1bb3672f0d1ff572666cfc
[ "Apache-2.0" ]
null
null
null
plugins/Rembed/Rembed.cpp
oxhead/HPCC-Platform
62e092695542a9bbea1bb3672f0d1ff572666cfc
[ "Apache-2.0" ]
null
null
null
/*############################################################################## HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems®. Licensed under the GPL, Version 2.0 or later you may not use this file except in compliance with the License. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ############################################################################## */ #include "platform.h" #ifdef RCPP_HEADER_ONLY // NOTE - these symbols need to be hidden from being exported from the Rembed .so file as RInside tries to dynamically // load them from Rcpp.so // If future versions of Rcpp add any (in Rcpp/routines.h) they may need to be added here too. #define type2name HIDE_RCPP_type2name #define enterRNGScope HIDE_RCPP_enterRNGScope #define exitRNGScope HIDE_RCPP_exitRNGScope #define get_string_buffer HIDE_RCPP_get_string_buffer #define get_Rcpp_namespace HIDE_RCPP_get_Rcpp_namespace #define mktime00 HIDE_RCPP_mktime00_ #define gmtime_ HIDE_RCPP_gmtime_ #define rcpp_get_stack_trace HIDE_RCPP_rcpp_get_stack_trace #define rcpp_set_stack_trace HIDE_RCPP_rcpp_set_stack_trace #define demangle HIDE_RCPP_demangle #define short_file_name HIDE_RCPP_short_file_name #define stack_trace HIDE_RCPP_stack_trace #define get_string_elt HIDE_RCPP_get_string_elt #define char_get_string_elt HIDE_RCPP_char_get_string_elt #define set_string_elt HIDE_RCPP_set_string_elt #define char_set_string_elt HIDE_RCPP_char_set_string_elt #define get_string_ptr HIDE_RCPP_get_string_ptr #define get_vector_elt HIDE_RCPP_get_vector_elt #define set_vector_elt HIDE_RCPP_set_vector_elt #define get_vector_ptr HIDE_RCPP_get_vector_ptr #define char_nocheck HIDE_RCPP_char_nocheck #define dataptr HIDE_RCPP_dataptr #define getCurrentScope HIDE_RCPP_getCurrentScope #define setCurrentScope HIDE_RCPP_setCurrentScope #define get_cache HIDE_RCPP_get_cache #define reset_current_error HIDE_RCPP_reset_current_error #define error_occured HIDE_RCPP_error_occured #define rcpp_get_current_error HIDE_RCPP_rcpp_get_current_error #endif #include "RInside.h" #include "Rinterface.h" #include "jexcept.hpp" #include "jthread.hpp" #include "hqlplugins.hpp" #include "deftype.hpp" #include "eclrtl.hpp" #include "eclrtl_imp.hpp" #include "rtlds_imp.hpp" #include "rtlfield_imp.hpp" #include "nbcd.hpp" #ifdef _WIN32 #define EXPORT __declspec(dllexport) #else #define EXPORT #endif static const char * compatibleVersions[] = { "R Embed Helper 1.0.0", NULL }; static const char *version = "R Embed Helper 1.0.0"; extern "C" EXPORT bool getECLPluginDefinition(ECLPluginDefinitionBlock *pb) { if (pb->size == sizeof(ECLPluginDefinitionBlockEx)) { ECLPluginDefinitionBlockEx * pbx = (ECLPluginDefinitionBlockEx *) pb; pbx->compatibleVersions = compatibleVersions; } else if (pb->size != sizeof(ECLPluginDefinitionBlock)) return false; pb->magicVersion = PLUGIN_VERSION; pb->version = version; pb->moduleName = "+R+"; // Hack - we don't want to export any ECL, but if we don't export something, pb->ECL = ""; // Hack - the dll is unloaded at startup when compiling, and the R runtime closes stdin when unloaded pb->flags = PLUGIN_MULTIPLE_VERSIONS; pb->description = "R Embed Helper"; return true; } #ifdef _WIN32 EXTERN_C IMAGE_DOS_HEADER __ImageBase; #endif #define UNSUPPORTED(feature) throw MakeStringException(MSGAUD_user, 0, "Rembed: UNSUPPORTED feature: %s", feature) #define FAIL(msg) throw MakeStringException(MSGAUD_user, 0, "Rembed: Rcpp error: %s", msg) namespace Rembed { class OwnedRoxieRowSet : public ConstPointerArray { public: ~OwnedRoxieRowSet() { ForEachItemIn(idx, *this) rtlReleaseRow(item(idx)); } }; // Use a global object to ensure that the R instance is initialized only once // Because of R's dodgy stack checks, we also have to do so on main thread static class RGlobalState { public: RGlobalState() { const char *args[] = {"R", "--slave" }; R = new RInside(2, args, true, false, true); // Setting interactive mode=true prevents R syntax errors from terminating the process // The R code for checking stack limits assumes that all calls are on the same thread // as the original context was created on - this will not always be true in ECL (and hardly // ever true in Roxie // Setting the stack limit to -1 disables this check R_CStackLimit = -1; // Make sure we are never unloaded (as R does not support it) // we do this by doing a dynamic load of the Rembed library #ifdef _WIN32 char path[_MAX_PATH]; ::GetModuleFileName((HINSTANCE)&__ImageBase, path, _MAX_PATH); if (strstr(path, "Rembed")) { HINSTANCE h = LoadSharedObject(path, false, false); DBGLOG("LoadSharedObject returned %p", h); } #else FILE *diskfp = fopen("/proc/self/maps", "r"); if (diskfp) { char ln[_MAX_PATH]; while (fgets(ln, sizeof(ln), diskfp)) { if (strstr(ln, "libRembed")) { const char *fullName = strchr(ln, '/'); if (fullName) { char *tail = (char *) strstr(fullName, SharedObjectExtension); if (tail) { tail[strlen(SharedObjectExtension)] = 0; HINSTANCE h = LoadSharedObject(fullName, false, false); break; } } } } fclose(diskfp); } #endif } ~RGlobalState() { delete R; } RInside *R; }* globalState = NULL; static CriticalSection RCrit; // R is single threaded - need to own this before making any call to R static RGlobalState *queryGlobalState() { CriticalBlock b(RCrit); if (!globalState) globalState = new RGlobalState; return globalState; } extern void unload() { CriticalBlock b(RCrit); if (globalState) delete globalState; globalState = NULL; } MODULE_INIT(INIT_PRIORITY_STANDARD) { queryGlobalState(); // make sure gets loaded by main thread return true; } MODULE_EXIT() { // Don't unload, because R seems to have problems with being reloaded, i.e. crashes on next use // unload(); } // A RDataFrameHeaderBuilder object is used to construct the header for an R dataFrame from an ECL row class RDataFrameHeaderBuilder : public CInterfaceOf<IFieldProcessor> { public: RDataFrameHeaderBuilder() { } virtual void processString(unsigned len, const char *value, const RtlFieldInfo * field) { addField(field); } virtual void processBool(bool value, const RtlFieldInfo * field) { addField(field); } virtual void processData(unsigned len, const void *value, const RtlFieldInfo * field) { addField(field); } virtual void processInt(__int64 value, const RtlFieldInfo * field) { addField(field); } virtual void processUInt(unsigned __int64 value, const RtlFieldInfo * field) { addField(field); } virtual void processReal(double value, const RtlFieldInfo * field) { addField(field); } virtual void processDecimal(const void *value, unsigned digits, unsigned precision, const RtlFieldInfo * field) { addField(field); } virtual void processUDecimal(const void *value, unsigned digits, unsigned precision, const RtlFieldInfo * field) { addField(field); } virtual void processUnicode(unsigned len, const UChar *value, const RtlFieldInfo * field) { UNSUPPORTED("Unicode/UTF8 fields"); } virtual void processQString(unsigned len, const char *value, const RtlFieldInfo * field) { addField(field); } virtual void processSetAll(const RtlFieldInfo * field) { UNSUPPORTED("SET fields"); } virtual void processUtf8(unsigned len, const char *value, const RtlFieldInfo * field) { UNSUPPORTED("Unicode/UTF8 fields"); } virtual bool processBeginSet(const RtlFieldInfo * field, unsigned elements, bool isAll, const byte *data) { UNSUPPORTED("SET fields"); } virtual bool processBeginDataset(const RtlFieldInfo * field, unsigned rows) { UNSUPPORTED("Nested datasets"); } virtual bool processBeginRow(const RtlFieldInfo * field) { return true; } virtual void processEndSet(const RtlFieldInfo * field) { UNSUPPORTED("SET fields"); } virtual void processEndDataset(const RtlFieldInfo * field) { UNSUPPORTED("Nested datasets"); } virtual void processEndRow(const RtlFieldInfo * field) { } Rcpp::CharacterVector namevec; protected: void addField(const RtlFieldInfo * field) { namevec.push_back(field->name->queryStr()); } }; // A RDataFrameHeaderBuilder object is used to construct the header for an R dataFrame from an ECL row class RDataFrameAppender : public CInterfaceOf<IFieldProcessor> { public: RDataFrameAppender(Rcpp::List &_list) : list(_list) { colIdx = 0; rowIdx = 0; } inline void setRowIdx(unsigned _idx) { colIdx = 0; rowIdx = _idx; } virtual void processString(unsigned len, const char *value, const RtlFieldInfo * field) { std::string s(value, len); Rcpp::List column = list[colIdx]; column[rowIdx] = s; colIdx++; } virtual void processBool(bool value, const RtlFieldInfo * field) { Rcpp::List column = list[colIdx]; column[rowIdx] = value; colIdx++; } virtual void processData(unsigned len, const void *value, const RtlFieldInfo * field) { std::vector<byte> vval; const byte *cval = (const byte *) value; vval.assign(cval, cval+len); Rcpp::List column = list[colIdx]; column[rowIdx] = vval; colIdx++; } virtual void processInt(__int64 value, const RtlFieldInfo * field) { Rcpp::List column = list[colIdx]; column[rowIdx] = (long int) value; // Rcpp does not support int64 colIdx++; } virtual void processUInt(unsigned __int64 value, const RtlFieldInfo * field) { Rcpp::List column = list[colIdx]; column[rowIdx] = (unsigned long int) value; // Rcpp does not support int64 colIdx++; } virtual void processReal(double value, const RtlFieldInfo * field) { Rcpp::List column = list[colIdx]; column[rowIdx] = value; colIdx++; } virtual void processDecimal(const void *value, unsigned digits, unsigned precision, const RtlFieldInfo * field) { Decimal val; val.setDecimal(digits, precision, value); Rcpp::List column = list[colIdx]; column[rowIdx] = val.getReal(); colIdx++; } virtual void processUDecimal(const void *value, unsigned digits, unsigned precision, const RtlFieldInfo * field) { Decimal val; val.setUDecimal(digits, precision, value); Rcpp::List column = list[colIdx]; column[rowIdx] = val.getReal(); colIdx++; } virtual void processUnicode(unsigned len, const UChar *value, const RtlFieldInfo * field) { UNSUPPORTED("Unicode/UTF8 fields"); } virtual void processQString(unsigned len, const char *value, const RtlFieldInfo * field) { size32_t charCount; rtlDataAttr text; rtlQStrToStrX(charCount, text.refstr(), len, value); processString(charCount, text.getstr(), field); } virtual void processSetAll(const RtlFieldInfo * field) { UNSUPPORTED("SET fields"); } virtual void processUtf8(unsigned len, const char *value, const RtlFieldInfo * field) { UNSUPPORTED("Unicode/UTF8 fields"); } virtual bool processBeginSet(const RtlFieldInfo * field, unsigned elements, bool isAll, const byte *data) { UNSUPPORTED("SET fields"); } virtual bool processBeginDataset(const RtlFieldInfo * field, unsigned rows) { UNSUPPORTED("Nested datasets"); } virtual bool processBeginRow(const RtlFieldInfo * field) { return true; } virtual void processEndSet(const RtlFieldInfo * field) { UNSUPPORTED("SET fields"); } virtual void processEndDataset(const RtlFieldInfo * field) { UNSUPPORTED("Nested datasets"); } virtual void processEndRow(const RtlFieldInfo * field) { } protected: unsigned rowIdx; unsigned colIdx; Rcpp::List &list; }; // A RRowBuilder object is used to construct an ECL row from a R dataframe and row index class RRowBuilder : public CInterfaceOf<IFieldSource> { public: RRowBuilder(Rcpp::DataFrame &_frame) : frame(_frame) { rowIdx = 0; colIdx = 0; } inline void setRowIdx(unsigned _rowIdx) { rowIdx = _rowIdx; colIdx = 0; } virtual bool getBooleanResult(const RtlFieldInfo *field) { nextField(field); return ::Rcpp::as<bool>(elem); } virtual void getDataResult(const RtlFieldInfo *field, size32_t &__len, void * &__result) { nextField(field); std::vector<byte> vval = ::Rcpp::as<std::vector<byte> >(elem); rtlStrToDataX(__len, __result, vval.size(), vval.data()); } virtual double getRealResult(const RtlFieldInfo *field) { nextField(field); return ::Rcpp::as<double>(elem); } virtual __int64 getSignedResult(const RtlFieldInfo *field) { nextField(field); return ::Rcpp::as<long int>(elem); // Should really be long long, but RInside does not support that } virtual unsigned __int64 getUnsignedResult(const RtlFieldInfo *field) { nextField(field); return ::Rcpp::as<unsigned long int>(elem); // Should really be long long, but RInside does not support that } virtual void getStringResult(const RtlFieldInfo *field, size32_t &__len, char * &__result) { nextField(field); std::string str = ::Rcpp::as<std::string>(elem); rtlStrToStrX(__len, __result, str.length(), str.data()); } virtual void getUTF8Result(const RtlFieldInfo *field, size32_t &chars, char * &result) { UNSUPPORTED("Unicode/UTF8 fields"); } virtual void getUnicodeResult(const RtlFieldInfo *field, size32_t &chars, UChar * &result) { UNSUPPORTED("Unicode/UTF8 fields"); } virtual void getDecimalResult(const RtlFieldInfo *field, Decimal &value) { nextField(field); double ret = ::Rcpp::as<double>(elem); value.setReal(ret); } virtual void processBeginSet(const RtlFieldInfo * field, bool &isAll) { UNSUPPORTED("SET fields"); } virtual bool processNextSet(const RtlFieldInfo * field) { UNSUPPORTED("SET fields"); } virtual void processBeginDataset(const RtlFieldInfo * field) { UNSUPPORTED("Nested datasets"); } virtual void processBeginRow(const RtlFieldInfo * field) { } virtual bool processNextRow(const RtlFieldInfo * field) { UNSUPPORTED("Nested datasets"); } virtual void processEndSet(const RtlFieldInfo * field) { UNSUPPORTED("SET fields"); } virtual void processEndDataset(const RtlFieldInfo * field) { UNSUPPORTED("Nested datasets"); } virtual void processEndRow(const RtlFieldInfo * field) { } protected: void nextField(const RtlFieldInfo * field) { // NOTE - we could put support for looking up columns by name here, but for efficiency reasons we only support matching by position Rcpp::RObject colObject = frame[colIdx]; Rcpp::List column = ::Rcpp::as<Rcpp::List>(colObject); // MORE - this can crash if wrong type came from R. But I can't work out how to test that Rcpp::RObject t = column[rowIdx]; elem = t; colIdx++; } Rcpp::DataFrame frame; unsigned rowIdx; unsigned colIdx; Rcpp::RObject elem; }; static size32_t getRowResult(RInside::Proxy &result, ARowBuilder &builder) { // To return a single row, we expect a dataframe (with 1 row)... Rcpp::DataFrame dFrame = ::Rcpp::as<Rcpp::DataFrame>(result); // Note that this will also accept (and convert) a list RRowBuilder myRRowBuilder(dFrame); const RtlTypeInfo *typeInfo = builder.queryAllocator()->queryOutputMeta()->queryTypeInfo(); assertex(typeInfo); RtlFieldStrInfo dummyField("<row>", NULL, typeInfo); return typeInfo->build(builder, 0, &dummyField, myRRowBuilder); } // A R function that returns a dataset will return a RRowStream object that can be // interrogated to return each row of the result in turn class RRowStream : public CInterfaceOf<IRowStream> { public: RRowStream(RInside::Proxy &_result, IEngineRowAllocator *_resultAllocator) : dFrame(::Rcpp::as<Rcpp::DataFrame>(_result)), myRRowBuilder(dFrame) { resultAllocator.set(_resultAllocator); // A DataFrame is a list of columns // Each column is a vector (and all columns should be the same length) unsigned numColumns = dFrame.length(); assertex(numColumns > 0); Rcpp::List col1 = dFrame[0]; numRows = col1.length(); idx = 0; } virtual const void *nextRow() { CriticalBlock b(RCrit); if (!resultAllocator) return NULL; if (idx >= numRows) { stop(); return NULL; } RtlDynamicRowBuilder builder(resultAllocator); const RtlTypeInfo *typeInfo = builder.queryAllocator()->queryOutputMeta()->queryTypeInfo(); assertex(typeInfo); RtlFieldStrInfo dummyField("<row>", NULL, typeInfo); myRRowBuilder.setRowIdx(idx); try { size32_t len = typeInfo->build(builder, 0, &dummyField, myRRowBuilder); idx++; return builder.finalizeRowClear(len); } catch (std::exception &E) { FAIL(E.what()); } } virtual void stop() { resultAllocator.clear(); } protected: Rcpp::DataFrame dFrame; Linked<IEngineRowAllocator> resultAllocator; RRowBuilder myRRowBuilder; unsigned numRows; unsigned idx; }; // Each call to a R function will use a new REmbedFunctionContext object // This takes care of ensuring that the critsec is locked while we are executing R code, // and released when we are not class REmbedFunctionContext: public CInterfaceOf<IEmbedFunctionContext> { public: REmbedFunctionContext(RInside &_R, const char *options) : R(_R), block(RCrit), result(R_NilValue) { } ~REmbedFunctionContext() { } virtual IInterface *bindParamWriter(IInterface *esdl, const char *esdlservice, const char *esdltype, const char *name) { return NULL; } virtual void paramWriterCommit(IInterface *writer) { } virtual void writeResult(IInterface *esdl, const char *esdlservice, const char *esdltype, IInterface *writer) { } virtual bool getBooleanResult() { try { return ::Rcpp::as<bool>(result); } catch (std::exception &E) { FAIL(E.what()); } } virtual void getDataResult(size32_t &__len, void * &__result) { try { std::vector<byte> vval = ::Rcpp::as<std::vector<byte> >(result); rtlStrToDataX(__len, __result, vval.size(), vval.data()); } catch (std::exception &E) { FAIL(E.what()); } } virtual double getRealResult() { try { return ::Rcpp::as<double>(result); } catch (std::exception &E) { FAIL(E.what()); } } virtual __int64 getSignedResult() { try { return ::Rcpp::as<long int>(result); // Should really be long long, but RInside does not support that } catch (std::exception &E) { FAIL(E.what()); } } virtual unsigned __int64 getUnsignedResult() { try { return ::Rcpp::as<unsigned long int>(result); // Should really be long long, but RInside does not support that } catch (std::exception &E) { FAIL(E.what()); } } virtual void getStringResult(size32_t &__len, char * &__result) { try { std::string str = ::Rcpp::as<std::string>(result); rtlStrToStrX(__len, __result, str.length(), str.data()); } catch (std::exception &E) { FAIL(E.what()); } } virtual void getUTF8Result(size32_t &chars, char * &result) { UNSUPPORTED("Unicode/UTF8 results"); } virtual void getUnicodeResult(size32_t &chars, UChar * &result) { UNSUPPORTED("Unicode/UTF8 results"); } virtual void getSetResult(bool & __isAllResult, size32_t & __resultBytes, void * & __result, int _elemType, size32_t elemSize) { try { type_t elemType = (type_t) _elemType; __isAllResult = false; switch(elemType) { #define FETCH_ARRAY(type) \ { \ std::vector<type> vval = ::Rcpp::as< std::vector<type> >(result); \ rtlStrToDataX(__resultBytes, __result, vval.size()*elemSize, (const void *) vval.data()); \ } case type_boolean: { std::vector<bool> vval = ::Rcpp::as< std::vector<bool> >(result); size32_t size = vval.size(); // Vector of bool is odd, and can't be retrieved via data() // Instead we need to iterate, I guess rtlDataAttr out(size); bool *outData = (bool *) out.getdata(); for (std::vector<bool>::iterator iter = vval.begin(); iter < vval.end(); iter++) { *outData++ = *iter; } __resultBytes = size; __result = out.detachdata(); break; } case type_int: /* if (elemSize == sizeof(signed char)) // rcpp does not seem to support... FETCH_ARRAY(signed char) else */ if (elemSize == sizeof(short)) FETCH_ARRAY(short) else if (elemSize == sizeof(int)) FETCH_ARRAY(int) else if (elemSize == sizeof(long)) // __int64 / long long does not work... FETCH_ARRAY(long) else rtlFail(0, "Rembed: Unsupported result type"); break; case type_unsigned: if (elemSize == sizeof(byte)) FETCH_ARRAY(byte) else if (elemSize == sizeof(unsigned short)) FETCH_ARRAY(unsigned short) else if (elemSize == sizeof(unsigned int)) FETCH_ARRAY(unsigned int) else if (elemSize == sizeof(unsigned long)) // __int64 / long long does not work... FETCH_ARRAY(unsigned long) else rtlFail(0, "Rembed: Unsupported result type"); break; case type_real: if (elemSize == sizeof(float)) FETCH_ARRAY(float) else if (elemSize == sizeof(double)) FETCH_ARRAY(double) else rtlFail(0, "Rembed: Unsupported result type"); break; case type_string: case type_varstring: { std::vector<std::string> vval = ::Rcpp::as< std::vector<std::string> >(result); size32_t numResults = vval.size(); rtlRowBuilder out; byte *outData = NULL; size32_t outBytes = 0; if (elemSize != UNKNOWN_LENGTH) { outBytes = numResults * elemSize; // MORE - check for overflow? out.ensureAvailable(outBytes); outData = out.getbytes(); } for (std::vector<std::string>::iterator iter = vval.begin(); iter < vval.end(); iter++) { size32_t lenBytes = (*iter).size(); const char *text = (*iter).data(); if (elemType == type_string) { if (elemSize == UNKNOWN_LENGTH) { out.ensureAvailable(outBytes + lenBytes + sizeof(size32_t)); outData = out.getbytes() + outBytes; * (size32_t *) outData = lenBytes; rtlStrToStr(lenBytes, outData+sizeof(size32_t), lenBytes, text); outBytes += lenBytes + sizeof(size32_t); } else { rtlStrToStr(elemSize, outData, lenBytes, text); outData += elemSize; } } else { if (elemSize == UNKNOWN_LENGTH) { out.ensureAvailable(outBytes + lenBytes + 1); outData = out.getbytes() + outBytes; rtlStrToVStr(0, outData, lenBytes, text); outBytes += lenBytes + 1; } else { rtlStrToVStr(elemSize, outData, lenBytes, text); // Fixed size null terminated strings... weird. outData += elemSize; } } } __resultBytes = outBytes; __result = out.detachdata(); break; } default: rtlFail(0, "REmbed: Unsupported result type"); break; } } catch (std::exception &E) { FAIL(E.what()); } } virtual IRowStream *getDatasetResult(IEngineRowAllocator * _resultAllocator) { try { return new RRowStream(result, _resultAllocator); } catch (std::exception &E) { FAIL(E.what()); } } virtual byte * getRowResult(IEngineRowAllocator * _resultAllocator) { try { RtlDynamicRowBuilder rowBuilder(_resultAllocator); size32_t len = Rembed::getRowResult(result, rowBuilder); return (byte *) rowBuilder.finalizeRowClear(len); } catch (std::exception &E) { FAIL(E.what()); } } virtual size32_t getTransformResult(ARowBuilder & builder) { try { return Rembed::getRowResult(result, builder); } catch (std::exception &E) { FAIL(E.what()); } } virtual void bindBooleanParam(const char *name, bool val) { R[name] = val; } virtual void bindDataParam(const char *name, size32_t len, const void *val) { std::vector<byte> vval; const byte *cval = (const byte *) val; vval.assign(cval, cval+len); R[name] = vval; } virtual void bindFloatParam(const char *name, float val) { R[name] = val; } virtual void bindRealParam(const char *name, double val) { R[name] = val; } virtual void bindSignedSizeParam(const char *name, int size, __int64 val) { R[name] = (long int) val; } virtual void bindSignedParam(const char *name, __int64 val) { R[name] = (long int) val; } virtual void bindUnsignedSizeParam(const char *name, int size, unsigned __int64 val) { R[name] = (long int) val; } virtual void bindUnsignedParam(const char *name, unsigned __int64 val) { R[name] = (unsigned long int) val; } virtual void bindStringParam(const char *name, size32_t len, const char *val) { std::string s(val, len); R[name] = s; } virtual void bindVStringParam(const char *name, const char *val) { R[name] = val; } virtual void bindUTF8Param(const char *name, size32_t chars, const char *val) { rtlFail(0, "Rembed: Unsupported parameter type UTF8"); } virtual void bindUnicodeParam(const char *name, size32_t chars, const UChar *val) { rtlFail(0, "Rembed: Unsupported parameter type UNICODE"); } virtual void bindSetParam(const char *name, int _elemType, size32_t elemSize, bool isAll, size32_t totalBytes, void *setData) { if (isAll) rtlFail(0, "Rembed: Unsupported parameter type ALL"); type_t elemType = (type_t) _elemType; int numElems = totalBytes / elemSize; switch(elemType) { #define BIND_ARRAY(type) \ { \ std::vector<type> vval; \ const type *start = (const type *) setData; \ vval.assign(start, start+numElems); \ R[name] = vval; \ } case type_boolean: BIND_ARRAY(bool) break; case type_int: /* if (elemSize == sizeof(signed char)) // No binding exists in rcpp BIND_ARRAY(signed char) else */ if (elemSize == sizeof(short)) BIND_ARRAY(short) else if (elemSize == sizeof(int)) BIND_ARRAY(int) else if (elemSize == sizeof(long)) // __int64 / long long does not work... BIND_ARRAY(long) else rtlFail(0, "Rembed: Unsupported parameter type"); break; case type_unsigned: if (elemSize == sizeof(unsigned char)) BIND_ARRAY(unsigned char) else if (elemSize == sizeof(unsigned short)) BIND_ARRAY(unsigned short) else if (elemSize == sizeof(unsigned int)) BIND_ARRAY(unsigned int) else if (elemSize == sizeof(unsigned long)) // __int64 / long long does not work... BIND_ARRAY(unsigned long) else rtlFail(0, "Rembed: Unsupported parameter type"); break; case type_real: if (elemSize == sizeof(float)) BIND_ARRAY(float) else if (elemSize == sizeof(double)) BIND_ARRAY(double) else rtlFail(0, "Rembed: Unsupported parameter type"); break; case type_string: case type_varstring: { std::vector<std::string> vval; const byte *inData = (const byte *) setData; const byte *endData = inData + totalBytes; while (inData < endData) { int thisSize; if (elemSize == UNKNOWN_LENGTH) { if (elemType==type_varstring) thisSize = strlen((const char *) inData) + 1; else { thisSize = * (size32_t *) inData; inData += sizeof(size32_t); } } else thisSize = elemSize; std::string s((const char *) inData, thisSize); vval.push_back(s); inData += thisSize; numElems++; } R[name] = vval; break; } default: rtlFail(0, "REmbed: Unsupported parameter type"); break; } } virtual void bindRowParam(const char *name, IOutputMetaData & metaVal, byte *row) { // We create a single-row dataframe const RtlTypeInfo *typeInfo = metaVal.queryTypeInfo(); assertex(typeInfo); RtlFieldStrInfo dummyField("<row>", NULL, typeInfo); RDataFrameHeaderBuilder headerBuilder; typeInfo->process(row, row, &dummyField, headerBuilder); // Sets up the R dataframe from the first ECL row Rcpp::List myList(headerBuilder.namevec.length()); myList.attr("names") = headerBuilder.namevec; for (int i=0; i<myList.length(); i++) { Rcpp::List column(1); myList[i] = column; } RDataFrameAppender frameBuilder(myList); Rcpp::StringVector row_names(1); frameBuilder.setRowIdx(0); typeInfo->process(row, row, &dummyField, frameBuilder); row_names(0) = "1"; myList.attr("class") = "data.frame"; myList.attr("row.names") = row_names; R[name] = myList; } virtual void bindDatasetParam(const char *name, IOutputMetaData & metaVal, IRowStream * val) { const RtlTypeInfo *typeInfo = metaVal.queryTypeInfo(); assertex(typeInfo); RtlFieldStrInfo dummyField("<row>", NULL, typeInfo); OwnedRoxieRowSet rows; loop { const byte *row = (const byte *) val->ungroupedNextRow(); if (!row) break; rows.append(row); } const byte *firstrow = (const byte *) rows.item(0); RDataFrameHeaderBuilder headerBuilder; typeInfo->process(firstrow, firstrow, &dummyField, headerBuilder); // Sets up the R dataframe from the first ECL row Rcpp::List myList(headerBuilder.namevec.length()); myList.attr("names") = headerBuilder.namevec; for (int i=0; i<myList.length(); i++) { Rcpp::List column(rows.length()); myList[i] = column; } RDataFrameAppender frameBuilder(myList); Rcpp::StringVector row_names(rows.length()); ForEachItemIn(idx, rows) { const byte * row = (const byte *) rows.item(idx); frameBuilder.setRowIdx(idx); typeInfo->process(row, row, &dummyField, frameBuilder); StringBuffer rowname; rowname.append(idx+1); row_names(idx) = rowname.str(); } myList.attr("class") = "data.frame"; myList.attr("row.names") = row_names; R[name] = myList; } virtual void importFunction(size32_t lenChars, const char *utf) { throwUnexpected(); } virtual void compileEmbeddedScript(size32_t lenChars, const char *utf) { StringBuffer text(rtlUtf8Size(lenChars, utf), utf); text.stripChar('\r'); func.assign(text.str()); } virtual void callFunction() { try { result = R.parseEval(func); } catch (std::exception &E) { FAIL(E.what()); } } private: RInside &R; RInside::Proxy result; std::string func; CriticalBlock block; }; class REmbedContext: public CInterfaceOf<IEmbedContext> { public: virtual IEmbedFunctionContext *createFunctionContext(unsigned flags, const char *options) { return createFunctionContextEx(NULL, flags, options); } virtual IEmbedFunctionContext *createFunctionContextEx(ICodeContext * ctx, unsigned flags, const char *options) { return new REmbedFunctionContext(*queryGlobalState()->R, options); } virtual IEmbedServiceContext *createServiceContext(const char *service, unsigned flags, const char *options) { throwUnexpected(); } }; extern IEmbedContext* getEmbedContext() { return new REmbedContext; } extern bool syntaxCheck(const char *script) { return true; // MORE } } // namespace
32.572963
152
0.587456
oxhead
790447cc78fa125da041f588d6d0229913035315
1,628
cpp
C++
leetcode.com/0710 Random Pick with Blacklist/main.cpp
sky-bro/AC
29bfa3f13994612887e18065fa6e854b9a29633d
[ "MIT" ]
1
2020-08-20T11:02:49.000Z
2020-08-20T11:02:49.000Z
leetcode.com/0710 Random Pick with Blacklist/main.cpp
sky-bro/AC
29bfa3f13994612887e18065fa6e854b9a29633d
[ "MIT" ]
null
null
null
leetcode.com/0710 Random Pick with Blacklist/main.cpp
sky-bro/AC
29bfa3f13994612887e18065fa6e854b9a29633d
[ "MIT" ]
1
2022-01-01T23:23:13.000Z
2022-01-01T23:23:13.000Z
#include <iostream> #include <vector> #include <random> #include <unordered_map> using namespace std; // ref: Java O(B) / O(1), HashMap // https://leetcode.com/problems/random-pick-with-blacklist/discuss/144624/Java-O(B)-O(1)-HashMap // this should be the right way to approch this problem // I don't think other binary search solution is right... class Solution { private: mt19937 prng; uniform_int_distribution<> dis; unordered_map<int, int> mp; public: Solution(int N, vector<int>& blacklist) { // for seed (this is a rng: random number generator) random_device rd; // prng: pseudo random number generator // prng will be more efficent than randome_device prng = mt19937(rd()); int n = N - blacklist.size(); dis = uniform_int_distribution<>(0, n-1); for (int b: blacklist) { // these don't need remap // but take the place: prevent others remap here if (b >= n) mp.emplace(b, -1); } --N; // number picked in [0, N) for (int b: blacklist) { if (b < n) { // remap these // place taken by some number in bloacklist while (mp.count(N)) --N; // place available mp.emplace(b, N--); } } } int pick() { int k = dis(prng); auto it = mp.find(k); return it == mp.end() ? k : it->second; } }; /** * Your Solution object will be instantiated and called as such: * Solution* obj = new Solution(N, blacklist); * int param_1 = obj->pick(); */
27.59322
97
0.562039
sky-bro
79071baa18a4f9615d7747c08a4ed592dbb72c5f
132
cpp
C++
Modules/Nulstar/NulstarMain/NPluginManger.cpp
Berzeck/Nulstar
d3a7f59ee617e045966071d19c39d1ab63b23114
[ "MIT" ]
17
2018-08-13T23:37:31.000Z
2019-04-25T18:31:22.000Z
Modules/Nulstar/NulstarMain/NPluginManger.cpp
Berzeck/Nulstar-v0
d3a7f59ee617e045966071d19c39d1ab63b23114
[ "MIT" ]
7
2018-09-03T22:43:15.000Z
2019-07-14T06:57:16.000Z
Modules/Nulstar/NulstarMain/NPluginManger.cpp
CCC-NULS/Nulstar
f48d869254f4adb60e7c95f0e313bfb44ab8dc84
[ "MIT" ]
7
2018-09-07T10:05:08.000Z
2020-02-03T12:18:49.000Z
#include "NPluginManger.h" NPluginManger::NPluginManger(QObject* parent) : QObject(parent) { } void NPluginManger::scan() { }
12
45
0.712121
Berzeck
790e3b95739046c5c4aa15e12e5f987bc2b75c5f
1,501
cpp
C++
examples/NUCLEO-G070RB/ADC/Main.cpp
marangisto/HAL
fa56b539f64b277fa122a010e4ee643463f58498
[ "MIT" ]
2
2019-09-12T04:12:16.000Z
2020-09-23T19:13:06.000Z
examples/NUCLEO-G070RB/ADC/Main.cpp
marangisto/HAL
fa56b539f64b277fa122a010e4ee643463f58498
[ "MIT" ]
2
2019-09-10T13:47:50.000Z
2020-02-24T03:27:47.000Z
examples/NUCLEO-G070RB/ADC/Main.cpp
marangisto/HAL
fa56b539f64b277fa122a010e4ee643463f58498
[ "MIT" ]
3
2019-08-31T12:58:28.000Z
2020-03-26T22:56:34.000Z
#include <timer.h> #include <dac.h> #include <adc.h> #include <dma.h> using hal::sys_tick; using hal::sys_clock; using namespace hal::gpio; using namespace hal::timer; using namespace hal::adc; using namespace hal::dma; typedef hal::timer::timer_t<3> trig; typedef hal::dac::dac_t<1> dac; typedef hal::dma::dma_t<1> dma; typedef hal::adc::adc_t<1> adc; typedef analog_t<PA0> ain0; typedef analog_t<PA1> ain1; typedef output_t<PA10> probe; static const uint8_t adc_dma_ch = 2; static const uint16_t half_buffer_size = 32; static const uint16_t buffer_size = half_buffer_size * 2; static uint16_t adc_buf[buffer_size]; template<> void handler<interrupt::DMA_CHANNEL2_3>() { uint32_t sts = dma::interrupt_status<adc_dma_ch>(); dma::clear_interrupt_flags<adc_dma_ch>(); if (sts & (dma_half_transfer | dma_transfer_complete)) probe::write(sts & dma_transfer_complete); } int main() { ain0::setup(); ain1::setup(); probe::setup(); dac::setup(); dac::enable<1>(); dac::enable<2>(); interrupt::enable(); dma::setup(); hal::nvic<interrupt::DMA_CHANNEL2_3>::enable(); trig::setup(0, 64); trig::master_mode<trig::mm_update>(); adc::setup(); adc::sequence<1, 0>(); adc::dma<dma, adc_dma_ch, uint16_t>(adc_buf, buffer_size); adc::trigger<0x3>(); adc::enable(); adc::start_conversion(); for (;;) { dac::write<1>(adc_buf[0]); dac::write<2>(adc_buf[1]); sys_tick::delay_ms(1); } }
22.402985
62
0.655563
marangisto
7912e35c058c92610901e5d8cbd7a53cc35be4be
1,965
cpp
C++
engine/source/Actions/ActionParallel.cpp
MaxSigma/SGEngine
68a01012911b8d91c9ff6d960a0f7d1163940e09
[ "MIT" ]
11
2020-10-21T15:03:41.000Z
2020-11-03T09:15:28.000Z
engine/source/Actions/ActionParallel.cpp
MaxSigma/SGEngine
68a01012911b8d91c9ff6d960a0f7d1163940e09
[ "MIT" ]
null
null
null
engine/source/Actions/ActionParallel.cpp
MaxSigma/SGEngine
68a01012911b8d91c9ff6d960a0f7d1163940e09
[ "MIT" ]
1
2020-10-27T00:13:41.000Z
2020-10-27T00:13:41.000Z
///////////////////////////////////////////////////// // 2016 © Max Gittel // ///////////////////////////////////////////////////// // SGEngine #include "ActionParallel.h" namespace sge { ActionParallel::ActionParallel(){ _time=0; } ActionParallel::~ActionParallel(){} void ActionParallel::updateEntity(Entity* entity){ for (int i=0; i<_actions.size(); i++) { if(_time>_actions[i]->_endTime){ if( _actions[i]->_isRunning==true){ _actions[i]->_time=_actions[i]->_endTime; _actions[i]->end(entity); _actions[i]->_isRunning=false; } }else{ _actions[i]->_time= _time; _actions[i]->updateEntity(entity); } } } void ActionParallel::start(Entity* entity){ for (int i=0; i<_actions.size(); i++) { _actions[i]->_isRunning=true; _actions[i]->_time= 0; _actions[i]->start(entity); } } void ActionParallel::end(Entity* entity){ } ActionParallel* ActionParallel::create(std::vector<Action*> actions){ ActionParallel* actionParallel= new ActionParallel(); actionParallel->_actions=actions; for (int i=0; i<actions.size(); i++) { actions[i]->_startTime= 0; actions[i]->_endTime= actions[i]->_duration; if(actionParallel->_duration<actions[i]->_duration){ actionParallel->_duration= actions[i]->_duration; } } return actionParallel; } }
23.674699
73
0.410178
MaxSigma
79152e544084796175ebb9289bda22bdfce58aae
1,733
hpp
C++
cxx/graphidx/bits/weights.hpp
EQt/graphidx
9716488cf29f6235072fc920fa1a473bf88e954f
[ "MIT" ]
4
2020-04-03T15:18:30.000Z
2022-01-06T15:22:48.000Z
cxx/graphidx/bits/weights.hpp
EQt/graphidx
9716488cf29f6235072fc920fa1a473bf88e954f
[ "MIT" ]
null
null
null
cxx/graphidx/bits/weights.hpp
EQt/graphidx
9716488cf29f6235072fc920fa1a473bf88e954f
[ "MIT" ]
null
null
null
#pragma once #include <cstddef> // for size_t /** A value that cannot be assigned a new value */ template <typename T = double> struct Ignore { const T val; const T operator=(const T) const { return val; } bool operator==(const T other) const { return other == val; } explicit operator T() const { return val; } }; template <typename T = double> bool operator==(const T b, const Ignore<T> a) { return a.val == b; } template <typename T = double> struct Weights { }; /** Provide a uniform weighting of one */ template <typename T = double> struct Ones : public Weights<T> { constexpr T operator[](size_t) const { return T(1); } constexpr Ignore<T> operator[](size_t) { return Ignore<T>{T(1)}; } static constexpr bool is_const() { return true; } }; template <typename T = double> struct Const : public Weights<T> { const T c; Const(const T &c) : c(c) { } const T operator[](size_t) const { return c; } const Ignore<T> operator[](size_t) { return Ignore<T>{c}; } static constexpr bool is_const() { return true; } }; template <typename T = double> struct Array : public Weights<T> { T *a; Array(T *a) : a(a) { } const T operator[](size_t i) const { return a[i]; } T& operator[](size_t i) { return a[i]; } static constexpr bool is_const() { return false; } }; template <typename T, typename S> T create_weight(S); template <typename T> Ones<T> create_weight() { return Ones<T>(); } template <typename T> Const<T> create_weight(T c) { return Const<T>(c); } template <typename T> Array<T> create_weight(T *a) { return Array<T>(a); } template <typename T> inline constexpr bool is_const(const T&) { return T::is_const(); }
17.505051
70
0.636469
EQt
79197bd50f1a481121720400a0547845e64b525d
233
cpp
C++
atcoder/92B.cpp
freedomDR/coding
310a68077de93ef445ccd2929e90ba9c22a9b8eb
[ "MIT" ]
null
null
null
atcoder/92B.cpp
freedomDR/coding
310a68077de93ef445ccd2929e90ba9c22a9b8eb
[ "MIT" ]
null
null
null
atcoder/92B.cpp
freedomDR/coding
310a68077de93ef445ccd2929e90ba9c22a9b8eb
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; int main() { int n,d,x,ans; cin>>n>>d>>x; ans = 0; while(n--){ int a; cin>>a; ans += ((d-1)/a + 1); } cout<<ans+x<<endl; return 0; }
12.944444
29
0.424893
freedomDR
791a8064653daf73b14ccdc4aa8ddcac77f432c1
159,543
cpp
C++
cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_UNIFIED_FIREWALL_MIB.cpp
CiscoDevNet/ydk-cpp
ef7d75970f2ef1154100e0f7b0a2ee823609b481
[ "ECL-2.0", "Apache-2.0" ]
17
2016-12-02T05:45:49.000Z
2022-02-10T19:32:54.000Z
cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_UNIFIED_FIREWALL_MIB.cpp
CiscoDevNet/ydk-cpp
ef7d75970f2ef1154100e0f7b0a2ee823609b481
[ "ECL-2.0", "Apache-2.0" ]
2
2017-03-27T15:22:38.000Z
2019-11-05T08:30:16.000Z
cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_UNIFIED_FIREWALL_MIB.cpp
CiscoDevNet/ydk-cpp
ef7d75970f2ef1154100e0f7b0a2ee823609b481
[ "ECL-2.0", "Apache-2.0" ]
11
2016-12-02T05:45:52.000Z
2019-11-07T08:28:17.000Z
#include <sstream> #include <iostream> #include <ydk/entity_util.hpp> #include "bundle_info.hpp" #include "generated_entity_lookup.hpp" #include "CISCO_UNIFIED_FIREWALL_MIB.hpp" using namespace ydk; namespace cisco_ios_xe { namespace CISCO_UNIFIED_FIREWALL_MIB { CISCOUNIFIEDFIREWALLMIB::CISCOUNIFIEDFIREWALLMIB() : cufwconnectionglobals(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals>()) , cufwconnectionresources(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources>()) , cufwconnectionreportsettings(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings>()) , cufwapplinspectiongrp(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp>()) , cufwurlfilterglobals(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals>()) , cufwurlfilterresourceusage(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage>()) , cufwaaicglobals(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals>()) , cufwaaichttpprotocolstats(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats>()) , cufwl2fwglobals(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals>()) , cufwnotifcntlgrp(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp>()) , cufwconnsummarytable(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable>()) , cufwappconnsummarytable(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable>()) , cufwpolicyconnsummarytable(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable>()) , cufwpolicyappconnsummarytable(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable>()) , cufwinspectiontable(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable>()) , cufwurlfservertable(std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable>()) { cufwconnectionglobals->parent = this; cufwconnectionresources->parent = this; cufwconnectionreportsettings->parent = this; cufwapplinspectiongrp->parent = this; cufwurlfilterglobals->parent = this; cufwurlfilterresourceusage->parent = this; cufwaaicglobals->parent = this; cufwaaichttpprotocolstats->parent = this; cufwl2fwglobals->parent = this; cufwnotifcntlgrp->parent = this; cufwconnsummarytable->parent = this; cufwappconnsummarytable->parent = this; cufwpolicyconnsummarytable->parent = this; cufwpolicyappconnsummarytable->parent = this; cufwinspectiontable->parent = this; cufwurlfservertable->parent = this; yang_name = "CISCO-UNIFIED-FIREWALL-MIB"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = true; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::~CISCOUNIFIEDFIREWALLMIB() { } bool CISCOUNIFIEDFIREWALLMIB::has_data() const { if (is_presence_container) return true; return (cufwconnectionglobals != nullptr && cufwconnectionglobals->has_data()) || (cufwconnectionresources != nullptr && cufwconnectionresources->has_data()) || (cufwconnectionreportsettings != nullptr && cufwconnectionreportsettings->has_data()) || (cufwapplinspectiongrp != nullptr && cufwapplinspectiongrp->has_data()) || (cufwurlfilterglobals != nullptr && cufwurlfilterglobals->has_data()) || (cufwurlfilterresourceusage != nullptr && cufwurlfilterresourceusage->has_data()) || (cufwaaicglobals != nullptr && cufwaaicglobals->has_data()) || (cufwaaichttpprotocolstats != nullptr && cufwaaichttpprotocolstats->has_data()) || (cufwl2fwglobals != nullptr && cufwl2fwglobals->has_data()) || (cufwnotifcntlgrp != nullptr && cufwnotifcntlgrp->has_data()) || (cufwconnsummarytable != nullptr && cufwconnsummarytable->has_data()) || (cufwappconnsummarytable != nullptr && cufwappconnsummarytable->has_data()) || (cufwpolicyconnsummarytable != nullptr && cufwpolicyconnsummarytable->has_data()) || (cufwpolicyappconnsummarytable != nullptr && cufwpolicyappconnsummarytable->has_data()) || (cufwinspectiontable != nullptr && cufwinspectiontable->has_data()) || (cufwurlfservertable != nullptr && cufwurlfservertable->has_data()); } bool CISCOUNIFIEDFIREWALLMIB::has_operation() const { return is_set(yfilter) || (cufwconnectionglobals != nullptr && cufwconnectionglobals->has_operation()) || (cufwconnectionresources != nullptr && cufwconnectionresources->has_operation()) || (cufwconnectionreportsettings != nullptr && cufwconnectionreportsettings->has_operation()) || (cufwapplinspectiongrp != nullptr && cufwapplinspectiongrp->has_operation()) || (cufwurlfilterglobals != nullptr && cufwurlfilterglobals->has_operation()) || (cufwurlfilterresourceusage != nullptr && cufwurlfilterresourceusage->has_operation()) || (cufwaaicglobals != nullptr && cufwaaicglobals->has_operation()) || (cufwaaichttpprotocolstats != nullptr && cufwaaichttpprotocolstats->has_operation()) || (cufwl2fwglobals != nullptr && cufwl2fwglobals->has_operation()) || (cufwnotifcntlgrp != nullptr && cufwnotifcntlgrp->has_operation()) || (cufwconnsummarytable != nullptr && cufwconnsummarytable->has_operation()) || (cufwappconnsummarytable != nullptr && cufwappconnsummarytable->has_operation()) || (cufwpolicyconnsummarytable != nullptr && cufwpolicyconnsummarytable->has_operation()) || (cufwpolicyappconnsummarytable != nullptr && cufwpolicyappconnsummarytable->has_operation()) || (cufwinspectiontable != nullptr && cufwinspectiontable->has_operation()) || (cufwurlfservertable != nullptr && cufwurlfservertable->has_operation()); } std::string CISCOUNIFIEDFIREWALLMIB::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "cuFwConnectionGlobals") { if(cufwconnectionglobals == nullptr) { cufwconnectionglobals = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals>(); } return cufwconnectionglobals; } if(child_yang_name == "cuFwConnectionResources") { if(cufwconnectionresources == nullptr) { cufwconnectionresources = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources>(); } return cufwconnectionresources; } if(child_yang_name == "cuFwConnectionReportSettings") { if(cufwconnectionreportsettings == nullptr) { cufwconnectionreportsettings = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings>(); } return cufwconnectionreportsettings; } if(child_yang_name == "cuFwApplInspectionGrp") { if(cufwapplinspectiongrp == nullptr) { cufwapplinspectiongrp = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp>(); } return cufwapplinspectiongrp; } if(child_yang_name == "cufwUrlFilterGlobals") { if(cufwurlfilterglobals == nullptr) { cufwurlfilterglobals = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals>(); } return cufwurlfilterglobals; } if(child_yang_name == "cufwUrlFilterResourceUsage") { if(cufwurlfilterresourceusage == nullptr) { cufwurlfilterresourceusage = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage>(); } return cufwurlfilterresourceusage; } if(child_yang_name == "cufwAaicGlobals") { if(cufwaaicglobals == nullptr) { cufwaaicglobals = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals>(); } return cufwaaicglobals; } if(child_yang_name == "cufwAaicHttpProtocolStats") { if(cufwaaichttpprotocolstats == nullptr) { cufwaaichttpprotocolstats = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats>(); } return cufwaaichttpprotocolstats; } if(child_yang_name == "cufwL2FwGlobals") { if(cufwl2fwglobals == nullptr) { cufwl2fwglobals = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals>(); } return cufwl2fwglobals; } if(child_yang_name == "cuFwNotifCntlGrp") { if(cufwnotifcntlgrp == nullptr) { cufwnotifcntlgrp = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp>(); } return cufwnotifcntlgrp; } if(child_yang_name == "cufwConnSummaryTable") { if(cufwconnsummarytable == nullptr) { cufwconnsummarytable = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable>(); } return cufwconnsummarytable; } if(child_yang_name == "cufwAppConnSummaryTable") { if(cufwappconnsummarytable == nullptr) { cufwappconnsummarytable = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable>(); } return cufwappconnsummarytable; } if(child_yang_name == "cufwPolicyConnSummaryTable") { if(cufwpolicyconnsummarytable == nullptr) { cufwpolicyconnsummarytable = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable>(); } return cufwpolicyconnsummarytable; } if(child_yang_name == "cufwPolicyAppConnSummaryTable") { if(cufwpolicyappconnsummarytable == nullptr) { cufwpolicyappconnsummarytable = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable>(); } return cufwpolicyappconnsummarytable; } if(child_yang_name == "cufwInspectionTable") { if(cufwinspectiontable == nullptr) { cufwinspectiontable = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable>(); } return cufwinspectiontable; } if(child_yang_name == "cufwUrlfServerTable") { if(cufwurlfservertable == nullptr) { cufwurlfservertable = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable>(); } return cufwurlfservertable; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; if(cufwconnectionglobals != nullptr) { _children["cuFwConnectionGlobals"] = cufwconnectionglobals; } if(cufwconnectionresources != nullptr) { _children["cuFwConnectionResources"] = cufwconnectionresources; } if(cufwconnectionreportsettings != nullptr) { _children["cuFwConnectionReportSettings"] = cufwconnectionreportsettings; } if(cufwapplinspectiongrp != nullptr) { _children["cuFwApplInspectionGrp"] = cufwapplinspectiongrp; } if(cufwurlfilterglobals != nullptr) { _children["cufwUrlFilterGlobals"] = cufwurlfilterglobals; } if(cufwurlfilterresourceusage != nullptr) { _children["cufwUrlFilterResourceUsage"] = cufwurlfilterresourceusage; } if(cufwaaicglobals != nullptr) { _children["cufwAaicGlobals"] = cufwaaicglobals; } if(cufwaaichttpprotocolstats != nullptr) { _children["cufwAaicHttpProtocolStats"] = cufwaaichttpprotocolstats; } if(cufwl2fwglobals != nullptr) { _children["cufwL2FwGlobals"] = cufwl2fwglobals; } if(cufwnotifcntlgrp != nullptr) { _children["cuFwNotifCntlGrp"] = cufwnotifcntlgrp; } if(cufwconnsummarytable != nullptr) { _children["cufwConnSummaryTable"] = cufwconnsummarytable; } if(cufwappconnsummarytable != nullptr) { _children["cufwAppConnSummaryTable"] = cufwappconnsummarytable; } if(cufwpolicyconnsummarytable != nullptr) { _children["cufwPolicyConnSummaryTable"] = cufwpolicyconnsummarytable; } if(cufwpolicyappconnsummarytable != nullptr) { _children["cufwPolicyAppConnSummaryTable"] = cufwpolicyappconnsummarytable; } if(cufwinspectiontable != nullptr) { _children["cufwInspectionTable"] = cufwinspectiontable; } if(cufwurlfservertable != nullptr) { _children["cufwUrlfServerTable"] = cufwurlfservertable; } return _children; } void CISCOUNIFIEDFIREWALLMIB::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void CISCOUNIFIEDFIREWALLMIB::set_filter(const std::string & value_path, YFilter yfilter) { } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::clone_ptr() const { return std::make_shared<CISCOUNIFIEDFIREWALLMIB>(); } std::string CISCOUNIFIEDFIREWALLMIB::get_bundle_yang_models_location() const { return ydk_cisco_ios_xe_models_path; } std::string CISCOUNIFIEDFIREWALLMIB::get_bundle_name() const { return "cisco_ios_xe"; } augment_capabilities_function CISCOUNIFIEDFIREWALLMIB::get_augment_capabilities_function() const { return cisco_ios_xe_augment_lookup_tables; } std::map<std::pair<std::string, std::string>, std::string> CISCOUNIFIEDFIREWALLMIB::get_namespace_identity_lookup() const { return cisco_ios_xe_namespace_identity_lookup; } bool CISCOUNIFIEDFIREWALLMIB::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cuFwConnectionGlobals" || name == "cuFwConnectionResources" || name == "cuFwConnectionReportSettings" || name == "cuFwApplInspectionGrp" || name == "cufwUrlFilterGlobals" || name == "cufwUrlFilterResourceUsage" || name == "cufwAaicGlobals" || name == "cufwAaicHttpProtocolStats" || name == "cufwL2FwGlobals" || name == "cuFwNotifCntlGrp" || name == "cufwConnSummaryTable" || name == "cufwAppConnSummaryTable" || name == "cufwPolicyConnSummaryTable" || name == "cufwPolicyAppConnSummaryTable" || name == "cufwInspectionTable" || name == "cufwUrlfServerTable") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::CuFwConnectionGlobals() : cufwconnglobalnumattempted{YType::uint64, "cufwConnGlobalNumAttempted"}, cufwconnglobalnumsetupsaborted{YType::uint64, "cufwConnGlobalNumSetupsAborted"}, cufwconnglobalnumpolicydeclined{YType::uint64, "cufwConnGlobalNumPolicyDeclined"}, cufwconnglobalnumresdeclined{YType::uint64, "cufwConnGlobalNumResDeclined"}, cufwconnglobalnumhalfopen{YType::uint32, "cufwConnGlobalNumHalfOpen"}, cufwconnglobalnumactive{YType::uint32, "cufwConnGlobalNumActive"}, cufwconnglobalnumexpired{YType::uint64, "cufwConnGlobalNumExpired"}, cufwconnglobalnumaborted{YType::uint64, "cufwConnGlobalNumAborted"}, cufwconnglobalnumembryonic{YType::uint32, "cufwConnGlobalNumEmbryonic"}, cufwconnglobalconnsetuprate1{YType::uint32, "cufwConnGlobalConnSetupRate1"}, cufwconnglobalconnsetuprate5{YType::uint32, "cufwConnGlobalConnSetupRate5"}, cufwconnglobalnumremoteaccess{YType::uint32, "cufwConnGlobalNumRemoteAccess"} { yang_name = "cuFwConnectionGlobals"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::~CuFwConnectionGlobals() { } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::has_data() const { if (is_presence_container) return true; return cufwconnglobalnumattempted.is_set || cufwconnglobalnumsetupsaborted.is_set || cufwconnglobalnumpolicydeclined.is_set || cufwconnglobalnumresdeclined.is_set || cufwconnglobalnumhalfopen.is_set || cufwconnglobalnumactive.is_set || cufwconnglobalnumexpired.is_set || cufwconnglobalnumaborted.is_set || cufwconnglobalnumembryonic.is_set || cufwconnglobalconnsetuprate1.is_set || cufwconnglobalconnsetuprate5.is_set || cufwconnglobalnumremoteaccess.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwconnglobalnumattempted.yfilter) || ydk::is_set(cufwconnglobalnumsetupsaborted.yfilter) || ydk::is_set(cufwconnglobalnumpolicydeclined.yfilter) || ydk::is_set(cufwconnglobalnumresdeclined.yfilter) || ydk::is_set(cufwconnglobalnumhalfopen.yfilter) || ydk::is_set(cufwconnglobalnumactive.yfilter) || ydk::is_set(cufwconnglobalnumexpired.yfilter) || ydk::is_set(cufwconnglobalnumaborted.yfilter) || ydk::is_set(cufwconnglobalnumembryonic.yfilter) || ydk::is_set(cufwconnglobalconnsetuprate1.yfilter) || ydk::is_set(cufwconnglobalconnsetuprate5.yfilter) || ydk::is_set(cufwconnglobalnumremoteaccess.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cuFwConnectionGlobals"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwconnglobalnumattempted.is_set || is_set(cufwconnglobalnumattempted.yfilter)) leaf_name_data.push_back(cufwconnglobalnumattempted.get_name_leafdata()); if (cufwconnglobalnumsetupsaborted.is_set || is_set(cufwconnglobalnumsetupsaborted.yfilter)) leaf_name_data.push_back(cufwconnglobalnumsetupsaborted.get_name_leafdata()); if (cufwconnglobalnumpolicydeclined.is_set || is_set(cufwconnglobalnumpolicydeclined.yfilter)) leaf_name_data.push_back(cufwconnglobalnumpolicydeclined.get_name_leafdata()); if (cufwconnglobalnumresdeclined.is_set || is_set(cufwconnglobalnumresdeclined.yfilter)) leaf_name_data.push_back(cufwconnglobalnumresdeclined.get_name_leafdata()); if (cufwconnglobalnumhalfopen.is_set || is_set(cufwconnglobalnumhalfopen.yfilter)) leaf_name_data.push_back(cufwconnglobalnumhalfopen.get_name_leafdata()); if (cufwconnglobalnumactive.is_set || is_set(cufwconnglobalnumactive.yfilter)) leaf_name_data.push_back(cufwconnglobalnumactive.get_name_leafdata()); if (cufwconnglobalnumexpired.is_set || is_set(cufwconnglobalnumexpired.yfilter)) leaf_name_data.push_back(cufwconnglobalnumexpired.get_name_leafdata()); if (cufwconnglobalnumaborted.is_set || is_set(cufwconnglobalnumaborted.yfilter)) leaf_name_data.push_back(cufwconnglobalnumaborted.get_name_leafdata()); if (cufwconnglobalnumembryonic.is_set || is_set(cufwconnglobalnumembryonic.yfilter)) leaf_name_data.push_back(cufwconnglobalnumembryonic.get_name_leafdata()); if (cufwconnglobalconnsetuprate1.is_set || is_set(cufwconnglobalconnsetuprate1.yfilter)) leaf_name_data.push_back(cufwconnglobalconnsetuprate1.get_name_leafdata()); if (cufwconnglobalconnsetuprate5.is_set || is_set(cufwconnglobalconnsetuprate5.yfilter)) leaf_name_data.push_back(cufwconnglobalconnsetuprate5.get_name_leafdata()); if (cufwconnglobalnumremoteaccess.is_set || is_set(cufwconnglobalnumremoteaccess.yfilter)) leaf_name_data.push_back(cufwconnglobalnumremoteaccess.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwConnGlobalNumAttempted") { cufwconnglobalnumattempted = value; cufwconnglobalnumattempted.value_namespace = name_space; cufwconnglobalnumattempted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumSetupsAborted") { cufwconnglobalnumsetupsaborted = value; cufwconnglobalnumsetupsaborted.value_namespace = name_space; cufwconnglobalnumsetupsaborted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumPolicyDeclined") { cufwconnglobalnumpolicydeclined = value; cufwconnglobalnumpolicydeclined.value_namespace = name_space; cufwconnglobalnumpolicydeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumResDeclined") { cufwconnglobalnumresdeclined = value; cufwconnglobalnumresdeclined.value_namespace = name_space; cufwconnglobalnumresdeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumHalfOpen") { cufwconnglobalnumhalfopen = value; cufwconnglobalnumhalfopen.value_namespace = name_space; cufwconnglobalnumhalfopen.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumActive") { cufwconnglobalnumactive = value; cufwconnglobalnumactive.value_namespace = name_space; cufwconnglobalnumactive.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumExpired") { cufwconnglobalnumexpired = value; cufwconnglobalnumexpired.value_namespace = name_space; cufwconnglobalnumexpired.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumAborted") { cufwconnglobalnumaborted = value; cufwconnglobalnumaborted.value_namespace = name_space; cufwconnglobalnumaborted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumEmbryonic") { cufwconnglobalnumembryonic = value; cufwconnglobalnumembryonic.value_namespace = name_space; cufwconnglobalnumembryonic.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalConnSetupRate1") { cufwconnglobalconnsetuprate1 = value; cufwconnglobalconnsetuprate1.value_namespace = name_space; cufwconnglobalconnsetuprate1.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalConnSetupRate5") { cufwconnglobalconnsetuprate5 = value; cufwconnglobalconnsetuprate5.value_namespace = name_space; cufwconnglobalconnsetuprate5.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnGlobalNumRemoteAccess") { cufwconnglobalnumremoteaccess = value; cufwconnglobalnumremoteaccess.value_namespace = name_space; cufwconnglobalnumremoteaccess.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwConnGlobalNumAttempted") { cufwconnglobalnumattempted.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumSetupsAborted") { cufwconnglobalnumsetupsaborted.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumPolicyDeclined") { cufwconnglobalnumpolicydeclined.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumResDeclined") { cufwconnglobalnumresdeclined.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumHalfOpen") { cufwconnglobalnumhalfopen.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumActive") { cufwconnglobalnumactive.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumExpired") { cufwconnglobalnumexpired.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumAborted") { cufwconnglobalnumaborted.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumEmbryonic") { cufwconnglobalnumembryonic.yfilter = yfilter; } if(value_path == "cufwConnGlobalConnSetupRate1") { cufwconnglobalconnsetuprate1.yfilter = yfilter; } if(value_path == "cufwConnGlobalConnSetupRate5") { cufwconnglobalconnsetuprate5.yfilter = yfilter; } if(value_path == "cufwConnGlobalNumRemoteAccess") { cufwconnglobalnumremoteaccess.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionGlobals::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwConnGlobalNumAttempted" || name == "cufwConnGlobalNumSetupsAborted" || name == "cufwConnGlobalNumPolicyDeclined" || name == "cufwConnGlobalNumResDeclined" || name == "cufwConnGlobalNumHalfOpen" || name == "cufwConnGlobalNumActive" || name == "cufwConnGlobalNumExpired" || name == "cufwConnGlobalNumAborted" || name == "cufwConnGlobalNumEmbryonic" || name == "cufwConnGlobalConnSetupRate1" || name == "cufwConnGlobalConnSetupRate5" || name == "cufwConnGlobalNumRemoteAccess") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::CuFwConnectionResources() : cufwconnresmemoryusage{YType::uint32, "cufwConnResMemoryUsage"}, cufwconnresactiveconnmemoryusage{YType::uint32, "cufwConnResActiveConnMemoryUsage"}, cufwconnreshoconnmemoryusage{YType::uint32, "cufwConnResHOConnMemoryUsage"}, cufwconnresembrconnmemoryusage{YType::uint32, "cufwConnResEmbrConnMemoryUsage"} { yang_name = "cuFwConnectionResources"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::~CuFwConnectionResources() { } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::has_data() const { if (is_presence_container) return true; return cufwconnresmemoryusage.is_set || cufwconnresactiveconnmemoryusage.is_set || cufwconnreshoconnmemoryusage.is_set || cufwconnresembrconnmemoryusage.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwconnresmemoryusage.yfilter) || ydk::is_set(cufwconnresactiveconnmemoryusage.yfilter) || ydk::is_set(cufwconnreshoconnmemoryusage.yfilter) || ydk::is_set(cufwconnresembrconnmemoryusage.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cuFwConnectionResources"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwconnresmemoryusage.is_set || is_set(cufwconnresmemoryusage.yfilter)) leaf_name_data.push_back(cufwconnresmemoryusage.get_name_leafdata()); if (cufwconnresactiveconnmemoryusage.is_set || is_set(cufwconnresactiveconnmemoryusage.yfilter)) leaf_name_data.push_back(cufwconnresactiveconnmemoryusage.get_name_leafdata()); if (cufwconnreshoconnmemoryusage.is_set || is_set(cufwconnreshoconnmemoryusage.yfilter)) leaf_name_data.push_back(cufwconnreshoconnmemoryusage.get_name_leafdata()); if (cufwconnresembrconnmemoryusage.is_set || is_set(cufwconnresembrconnmemoryusage.yfilter)) leaf_name_data.push_back(cufwconnresembrconnmemoryusage.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwConnResMemoryUsage") { cufwconnresmemoryusage = value; cufwconnresmemoryusage.value_namespace = name_space; cufwconnresmemoryusage.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnResActiveConnMemoryUsage") { cufwconnresactiveconnmemoryusage = value; cufwconnresactiveconnmemoryusage.value_namespace = name_space; cufwconnresactiveconnmemoryusage.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnResHOConnMemoryUsage") { cufwconnreshoconnmemoryusage = value; cufwconnreshoconnmemoryusage.value_namespace = name_space; cufwconnreshoconnmemoryusage.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnResEmbrConnMemoryUsage") { cufwconnresembrconnmemoryusage = value; cufwconnresembrconnmemoryusage.value_namespace = name_space; cufwconnresembrconnmemoryusage.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwConnResMemoryUsage") { cufwconnresmemoryusage.yfilter = yfilter; } if(value_path == "cufwConnResActiveConnMemoryUsage") { cufwconnresactiveconnmemoryusage.yfilter = yfilter; } if(value_path == "cufwConnResHOConnMemoryUsage") { cufwconnreshoconnmemoryusage.yfilter = yfilter; } if(value_path == "cufwConnResEmbrConnMemoryUsage") { cufwconnresembrconnmemoryusage.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionResources::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwConnResMemoryUsage" || name == "cufwConnResActiveConnMemoryUsage" || name == "cufwConnResHOConnMemoryUsage" || name == "cufwConnResEmbrConnMemoryUsage") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::CuFwConnectionReportSettings() : cufwconnreptappstats{YType::boolean, "cufwConnReptAppStats"}, cufwconnreptappstatslastchanged{YType::uint32, "cufwConnReptAppStatsLastChanged"} { yang_name = "cuFwConnectionReportSettings"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::~CuFwConnectionReportSettings() { } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::has_data() const { if (is_presence_container) return true; return cufwconnreptappstats.is_set || cufwconnreptappstatslastchanged.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwconnreptappstats.yfilter) || ydk::is_set(cufwconnreptappstatslastchanged.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cuFwConnectionReportSettings"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwconnreptappstats.is_set || is_set(cufwconnreptappstats.yfilter)) leaf_name_data.push_back(cufwconnreptappstats.get_name_leafdata()); if (cufwconnreptappstatslastchanged.is_set || is_set(cufwconnreptappstatslastchanged.yfilter)) leaf_name_data.push_back(cufwconnreptappstatslastchanged.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwConnReptAppStats") { cufwconnreptappstats = value; cufwconnreptappstats.value_namespace = name_space; cufwconnreptappstats.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnReptAppStatsLastChanged") { cufwconnreptappstatslastchanged = value; cufwconnreptappstatslastchanged.value_namespace = name_space; cufwconnreptappstatslastchanged.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwConnReptAppStats") { cufwconnreptappstats.yfilter = yfilter; } if(value_path == "cufwConnReptAppStatsLastChanged") { cufwconnreptappstatslastchanged.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CuFwConnectionReportSettings::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwConnReptAppStats" || name == "cufwConnReptAppStatsLastChanged") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::CuFwApplInspectionGrp() : cufwaiaudittrailenabled{YType::boolean, "cufwAIAuditTrailEnabled"}, cufwaialertenabled{YType::boolean, "cufwAIAlertEnabled"} { yang_name = "cuFwApplInspectionGrp"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::~CuFwApplInspectionGrp() { } bool CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::has_data() const { if (is_presence_container) return true; return cufwaiaudittrailenabled.is_set || cufwaialertenabled.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwaiaudittrailenabled.yfilter) || ydk::is_set(cufwaialertenabled.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cuFwApplInspectionGrp"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwaiaudittrailenabled.is_set || is_set(cufwaiaudittrailenabled.yfilter)) leaf_name_data.push_back(cufwaiaudittrailenabled.get_name_leafdata()); if (cufwaialertenabled.is_set || is_set(cufwaialertenabled.yfilter)) leaf_name_data.push_back(cufwaialertenabled.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwAIAuditTrailEnabled") { cufwaiaudittrailenabled = value; cufwaiaudittrailenabled.value_namespace = name_space; cufwaiaudittrailenabled.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAIAlertEnabled") { cufwaialertenabled = value; cufwaialertenabled.value_namespace = name_space; cufwaialertenabled.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwAIAuditTrailEnabled") { cufwaiaudittrailenabled.yfilter = yfilter; } if(value_path == "cufwAIAlertEnabled") { cufwaialertenabled.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CuFwApplInspectionGrp::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwAIAuditTrailEnabled" || name == "cufwAIAlertEnabled") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::CufwUrlFilterGlobals() : cufwurlffunctionenabled{YType::uint32, "cufwUrlfFunctionEnabled"}, cufwurlfrequestsnumprocessed{YType::uint64, "cufwUrlfRequestsNumProcessed"}, cufwurlfrequestsprocrate1{YType::uint32, "cufwUrlfRequestsProcRate1"}, cufwurlfrequestsprocrate5{YType::uint32, "cufwUrlfRequestsProcRate5"}, cufwurlfrequestsnumallowed{YType::uint64, "cufwUrlfRequestsNumAllowed"}, cufwurlfrequestsnumdenied{YType::uint64, "cufwUrlfRequestsNumDenied"}, cufwurlfrequestsdeniedrate1{YType::uint32, "cufwUrlfRequestsDeniedRate1"}, cufwurlfrequestsdeniedrate5{YType::uint32, "cufwUrlfRequestsDeniedRate5"}, cufwurlfrequestsnumcacheallowed{YType::uint64, "cufwUrlfRequestsNumCacheAllowed"}, cufwurlfrequestsnumcachedenied{YType::uint64, "cufwUrlfRequestsNumCacheDenied"}, cufwurlfallowmodereqnumallowed{YType::uint64, "cufwUrlfAllowModeReqNumAllowed"}, cufwurlfallowmodereqnumdenied{YType::uint64, "cufwUrlfAllowModeReqNumDenied"}, cufwurlfrequestsnumresdropped{YType::uint64, "cufwUrlfRequestsNumResDropped"}, cufwurlfrequestsresdroprate1{YType::uint32, "cufwUrlfRequestsResDropRate1"}, cufwurlfrequestsresdroprate5{YType::uint32, "cufwUrlfRequestsResDropRate5"}, cufwurlfnumservertimeouts{YType::uint64, "cufwUrlfNumServerTimeouts"}, cufwurlfnumserverretries{YType::uint64, "cufwUrlfNumServerRetries"}, cufwurlfresponsesnumlate{YType::uint64, "cufwUrlfResponsesNumLate"}, cufwurlfurlaccrespsnumresdropped{YType::uint64, "cufwUrlfUrlAccRespsNumResDropped"} { yang_name = "cufwUrlFilterGlobals"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::~CufwUrlFilterGlobals() { } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::has_data() const { if (is_presence_container) return true; return cufwurlffunctionenabled.is_set || cufwurlfrequestsnumprocessed.is_set || cufwurlfrequestsprocrate1.is_set || cufwurlfrequestsprocrate5.is_set || cufwurlfrequestsnumallowed.is_set || cufwurlfrequestsnumdenied.is_set || cufwurlfrequestsdeniedrate1.is_set || cufwurlfrequestsdeniedrate5.is_set || cufwurlfrequestsnumcacheallowed.is_set || cufwurlfrequestsnumcachedenied.is_set || cufwurlfallowmodereqnumallowed.is_set || cufwurlfallowmodereqnumdenied.is_set || cufwurlfrequestsnumresdropped.is_set || cufwurlfrequestsresdroprate1.is_set || cufwurlfrequestsresdroprate5.is_set || cufwurlfnumservertimeouts.is_set || cufwurlfnumserverretries.is_set || cufwurlfresponsesnumlate.is_set || cufwurlfurlaccrespsnumresdropped.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwurlffunctionenabled.yfilter) || ydk::is_set(cufwurlfrequestsnumprocessed.yfilter) || ydk::is_set(cufwurlfrequestsprocrate1.yfilter) || ydk::is_set(cufwurlfrequestsprocrate5.yfilter) || ydk::is_set(cufwurlfrequestsnumallowed.yfilter) || ydk::is_set(cufwurlfrequestsnumdenied.yfilter) || ydk::is_set(cufwurlfrequestsdeniedrate1.yfilter) || ydk::is_set(cufwurlfrequestsdeniedrate5.yfilter) || ydk::is_set(cufwurlfrequestsnumcacheallowed.yfilter) || ydk::is_set(cufwurlfrequestsnumcachedenied.yfilter) || ydk::is_set(cufwurlfallowmodereqnumallowed.yfilter) || ydk::is_set(cufwurlfallowmodereqnumdenied.yfilter) || ydk::is_set(cufwurlfrequestsnumresdropped.yfilter) || ydk::is_set(cufwurlfrequestsresdroprate1.yfilter) || ydk::is_set(cufwurlfrequestsresdroprate5.yfilter) || ydk::is_set(cufwurlfnumservertimeouts.yfilter) || ydk::is_set(cufwurlfnumserverretries.yfilter) || ydk::is_set(cufwurlfresponsesnumlate.yfilter) || ydk::is_set(cufwurlfurlaccrespsnumresdropped.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwUrlFilterGlobals"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwurlffunctionenabled.is_set || is_set(cufwurlffunctionenabled.yfilter)) leaf_name_data.push_back(cufwurlffunctionenabled.get_name_leafdata()); if (cufwurlfrequestsnumprocessed.is_set || is_set(cufwurlfrequestsnumprocessed.yfilter)) leaf_name_data.push_back(cufwurlfrequestsnumprocessed.get_name_leafdata()); if (cufwurlfrequestsprocrate1.is_set || is_set(cufwurlfrequestsprocrate1.yfilter)) leaf_name_data.push_back(cufwurlfrequestsprocrate1.get_name_leafdata()); if (cufwurlfrequestsprocrate5.is_set || is_set(cufwurlfrequestsprocrate5.yfilter)) leaf_name_data.push_back(cufwurlfrequestsprocrate5.get_name_leafdata()); if (cufwurlfrequestsnumallowed.is_set || is_set(cufwurlfrequestsnumallowed.yfilter)) leaf_name_data.push_back(cufwurlfrequestsnumallowed.get_name_leafdata()); if (cufwurlfrequestsnumdenied.is_set || is_set(cufwurlfrequestsnumdenied.yfilter)) leaf_name_data.push_back(cufwurlfrequestsnumdenied.get_name_leafdata()); if (cufwurlfrequestsdeniedrate1.is_set || is_set(cufwurlfrequestsdeniedrate1.yfilter)) leaf_name_data.push_back(cufwurlfrequestsdeniedrate1.get_name_leafdata()); if (cufwurlfrequestsdeniedrate5.is_set || is_set(cufwurlfrequestsdeniedrate5.yfilter)) leaf_name_data.push_back(cufwurlfrequestsdeniedrate5.get_name_leafdata()); if (cufwurlfrequestsnumcacheallowed.is_set || is_set(cufwurlfrequestsnumcacheallowed.yfilter)) leaf_name_data.push_back(cufwurlfrequestsnumcacheallowed.get_name_leafdata()); if (cufwurlfrequestsnumcachedenied.is_set || is_set(cufwurlfrequestsnumcachedenied.yfilter)) leaf_name_data.push_back(cufwurlfrequestsnumcachedenied.get_name_leafdata()); if (cufwurlfallowmodereqnumallowed.is_set || is_set(cufwurlfallowmodereqnumallowed.yfilter)) leaf_name_data.push_back(cufwurlfallowmodereqnumallowed.get_name_leafdata()); if (cufwurlfallowmodereqnumdenied.is_set || is_set(cufwurlfallowmodereqnumdenied.yfilter)) leaf_name_data.push_back(cufwurlfallowmodereqnumdenied.get_name_leafdata()); if (cufwurlfrequestsnumresdropped.is_set || is_set(cufwurlfrequestsnumresdropped.yfilter)) leaf_name_data.push_back(cufwurlfrequestsnumresdropped.get_name_leafdata()); if (cufwurlfrequestsresdroprate1.is_set || is_set(cufwurlfrequestsresdroprate1.yfilter)) leaf_name_data.push_back(cufwurlfrequestsresdroprate1.get_name_leafdata()); if (cufwurlfrequestsresdroprate5.is_set || is_set(cufwurlfrequestsresdroprate5.yfilter)) leaf_name_data.push_back(cufwurlfrequestsresdroprate5.get_name_leafdata()); if (cufwurlfnumservertimeouts.is_set || is_set(cufwurlfnumservertimeouts.yfilter)) leaf_name_data.push_back(cufwurlfnumservertimeouts.get_name_leafdata()); if (cufwurlfnumserverretries.is_set || is_set(cufwurlfnumserverretries.yfilter)) leaf_name_data.push_back(cufwurlfnumserverretries.get_name_leafdata()); if (cufwurlfresponsesnumlate.is_set || is_set(cufwurlfresponsesnumlate.yfilter)) leaf_name_data.push_back(cufwurlfresponsesnumlate.get_name_leafdata()); if (cufwurlfurlaccrespsnumresdropped.is_set || is_set(cufwurlfurlaccrespsnumresdropped.yfilter)) leaf_name_data.push_back(cufwurlfurlaccrespsnumresdropped.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwUrlfFunctionEnabled") { cufwurlffunctionenabled = value; cufwurlffunctionenabled.value_namespace = name_space; cufwurlffunctionenabled.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsNumProcessed") { cufwurlfrequestsnumprocessed = value; cufwurlfrequestsnumprocessed.value_namespace = name_space; cufwurlfrequestsnumprocessed.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsProcRate1") { cufwurlfrequestsprocrate1 = value; cufwurlfrequestsprocrate1.value_namespace = name_space; cufwurlfrequestsprocrate1.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsProcRate5") { cufwurlfrequestsprocrate5 = value; cufwurlfrequestsprocrate5.value_namespace = name_space; cufwurlfrequestsprocrate5.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsNumAllowed") { cufwurlfrequestsnumallowed = value; cufwurlfrequestsnumallowed.value_namespace = name_space; cufwurlfrequestsnumallowed.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsNumDenied") { cufwurlfrequestsnumdenied = value; cufwurlfrequestsnumdenied.value_namespace = name_space; cufwurlfrequestsnumdenied.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsDeniedRate1") { cufwurlfrequestsdeniedrate1 = value; cufwurlfrequestsdeniedrate1.value_namespace = name_space; cufwurlfrequestsdeniedrate1.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsDeniedRate5") { cufwurlfrequestsdeniedrate5 = value; cufwurlfrequestsdeniedrate5.value_namespace = name_space; cufwurlfrequestsdeniedrate5.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsNumCacheAllowed") { cufwurlfrequestsnumcacheallowed = value; cufwurlfrequestsnumcacheallowed.value_namespace = name_space; cufwurlfrequestsnumcacheallowed.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsNumCacheDenied") { cufwurlfrequestsnumcachedenied = value; cufwurlfrequestsnumcachedenied.value_namespace = name_space; cufwurlfrequestsnumcachedenied.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfAllowModeReqNumAllowed") { cufwurlfallowmodereqnumallowed = value; cufwurlfallowmodereqnumallowed.value_namespace = name_space; cufwurlfallowmodereqnumallowed.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfAllowModeReqNumDenied") { cufwurlfallowmodereqnumdenied = value; cufwurlfallowmodereqnumdenied.value_namespace = name_space; cufwurlfallowmodereqnumdenied.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsNumResDropped") { cufwurlfrequestsnumresdropped = value; cufwurlfrequestsnumresdropped.value_namespace = name_space; cufwurlfrequestsnumresdropped.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsResDropRate1") { cufwurlfrequestsresdroprate1 = value; cufwurlfrequestsresdroprate1.value_namespace = name_space; cufwurlfrequestsresdroprate1.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfRequestsResDropRate5") { cufwurlfrequestsresdroprate5 = value; cufwurlfrequestsresdroprate5.value_namespace = name_space; cufwurlfrequestsresdroprate5.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfNumServerTimeouts") { cufwurlfnumservertimeouts = value; cufwurlfnumservertimeouts.value_namespace = name_space; cufwurlfnumservertimeouts.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfNumServerRetries") { cufwurlfnumserverretries = value; cufwurlfnumserverretries.value_namespace = name_space; cufwurlfnumserverretries.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfResponsesNumLate") { cufwurlfresponsesnumlate = value; cufwurlfresponsesnumlate.value_namespace = name_space; cufwurlfresponsesnumlate.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfUrlAccRespsNumResDropped") { cufwurlfurlaccrespsnumresdropped = value; cufwurlfurlaccrespsnumresdropped.value_namespace = name_space; cufwurlfurlaccrespsnumresdropped.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwUrlfFunctionEnabled") { cufwurlffunctionenabled.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsNumProcessed") { cufwurlfrequestsnumprocessed.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsProcRate1") { cufwurlfrequestsprocrate1.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsProcRate5") { cufwurlfrequestsprocrate5.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsNumAllowed") { cufwurlfrequestsnumallowed.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsNumDenied") { cufwurlfrequestsnumdenied.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsDeniedRate1") { cufwurlfrequestsdeniedrate1.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsDeniedRate5") { cufwurlfrequestsdeniedrate5.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsNumCacheAllowed") { cufwurlfrequestsnumcacheallowed.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsNumCacheDenied") { cufwurlfrequestsnumcachedenied.yfilter = yfilter; } if(value_path == "cufwUrlfAllowModeReqNumAllowed") { cufwurlfallowmodereqnumallowed.yfilter = yfilter; } if(value_path == "cufwUrlfAllowModeReqNumDenied") { cufwurlfallowmodereqnumdenied.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsNumResDropped") { cufwurlfrequestsnumresdropped.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsResDropRate1") { cufwurlfrequestsresdroprate1.yfilter = yfilter; } if(value_path == "cufwUrlfRequestsResDropRate5") { cufwurlfrequestsresdroprate5.yfilter = yfilter; } if(value_path == "cufwUrlfNumServerTimeouts") { cufwurlfnumservertimeouts.yfilter = yfilter; } if(value_path == "cufwUrlfNumServerRetries") { cufwurlfnumserverretries.yfilter = yfilter; } if(value_path == "cufwUrlfResponsesNumLate") { cufwurlfresponsesnumlate.yfilter = yfilter; } if(value_path == "cufwUrlfUrlAccRespsNumResDropped") { cufwurlfurlaccrespsnumresdropped.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterGlobals::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwUrlfFunctionEnabled" || name == "cufwUrlfRequestsNumProcessed" || name == "cufwUrlfRequestsProcRate1" || name == "cufwUrlfRequestsProcRate5" || name == "cufwUrlfRequestsNumAllowed" || name == "cufwUrlfRequestsNumDenied" || name == "cufwUrlfRequestsDeniedRate1" || name == "cufwUrlfRequestsDeniedRate5" || name == "cufwUrlfRequestsNumCacheAllowed" || name == "cufwUrlfRequestsNumCacheDenied" || name == "cufwUrlfAllowModeReqNumAllowed" || name == "cufwUrlfAllowModeReqNumDenied" || name == "cufwUrlfRequestsNumResDropped" || name == "cufwUrlfRequestsResDropRate1" || name == "cufwUrlfRequestsResDropRate5" || name == "cufwUrlfNumServerTimeouts" || name == "cufwUrlfNumServerRetries" || name == "cufwUrlfResponsesNumLate" || name == "cufwUrlfUrlAccRespsNumResDropped") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::CufwUrlFilterResourceUsage() : cufwurlfrestotalrequestcachesize{YType::uint32, "cufwUrlfResTotalRequestCacheSize"}, cufwurlfrestotalrespcachesize{YType::uint32, "cufwUrlfResTotalRespCacheSize"} { yang_name = "cufwUrlFilterResourceUsage"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::~CufwUrlFilterResourceUsage() { } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::has_data() const { if (is_presence_container) return true; return cufwurlfrestotalrequestcachesize.is_set || cufwurlfrestotalrespcachesize.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwurlfrestotalrequestcachesize.yfilter) || ydk::is_set(cufwurlfrestotalrespcachesize.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwUrlFilterResourceUsage"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwurlfrestotalrequestcachesize.is_set || is_set(cufwurlfrestotalrequestcachesize.yfilter)) leaf_name_data.push_back(cufwurlfrestotalrequestcachesize.get_name_leafdata()); if (cufwurlfrestotalrespcachesize.is_set || is_set(cufwurlfrestotalrespcachesize.yfilter)) leaf_name_data.push_back(cufwurlfrestotalrespcachesize.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwUrlfResTotalRequestCacheSize") { cufwurlfrestotalrequestcachesize = value; cufwurlfrestotalrequestcachesize.value_namespace = name_space; cufwurlfrestotalrequestcachesize.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfResTotalRespCacheSize") { cufwurlfrestotalrespcachesize = value; cufwurlfrestotalrespcachesize.value_namespace = name_space; cufwurlfrestotalrespcachesize.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwUrlfResTotalRequestCacheSize") { cufwurlfrestotalrequestcachesize.yfilter = yfilter; } if(value_path == "cufwUrlfResTotalRespCacheSize") { cufwurlfrestotalrespcachesize.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlFilterResourceUsage::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwUrlfResTotalRequestCacheSize" || name == "cufwUrlfResTotalRespCacheSize") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::CufwAaicGlobals() : cufwaaicglobalnumbadprotocolops{YType::uint64, "cufwAaicGlobalNumBadProtocolOps"}, cufwaaicglobalnumbadpdusize{YType::uint64, "cufwAaicGlobalNumBadPDUSize"}, cufwaaicglobalnumbadportrange{YType::uint64, "cufwAaicGlobalNumBadPortRange"} { yang_name = "cufwAaicGlobals"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::~CufwAaicGlobals() { } bool CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::has_data() const { if (is_presence_container) return true; return cufwaaicglobalnumbadprotocolops.is_set || cufwaaicglobalnumbadpdusize.is_set || cufwaaicglobalnumbadportrange.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwaaicglobalnumbadprotocolops.yfilter) || ydk::is_set(cufwaaicglobalnumbadpdusize.yfilter) || ydk::is_set(cufwaaicglobalnumbadportrange.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwAaicGlobals"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwaaicglobalnumbadprotocolops.is_set || is_set(cufwaaicglobalnumbadprotocolops.yfilter)) leaf_name_data.push_back(cufwaaicglobalnumbadprotocolops.get_name_leafdata()); if (cufwaaicglobalnumbadpdusize.is_set || is_set(cufwaaicglobalnumbadpdusize.yfilter)) leaf_name_data.push_back(cufwaaicglobalnumbadpdusize.get_name_leafdata()); if (cufwaaicglobalnumbadportrange.is_set || is_set(cufwaaicglobalnumbadportrange.yfilter)) leaf_name_data.push_back(cufwaaicglobalnumbadportrange.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwAaicGlobalNumBadProtocolOps") { cufwaaicglobalnumbadprotocolops = value; cufwaaicglobalnumbadprotocolops.value_namespace = name_space; cufwaaicglobalnumbadprotocolops.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAaicGlobalNumBadPDUSize") { cufwaaicglobalnumbadpdusize = value; cufwaaicglobalnumbadpdusize.value_namespace = name_space; cufwaaicglobalnumbadpdusize.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAaicGlobalNumBadPortRange") { cufwaaicglobalnumbadportrange = value; cufwaaicglobalnumbadportrange.value_namespace = name_space; cufwaaicglobalnumbadportrange.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwAaicGlobalNumBadProtocolOps") { cufwaaicglobalnumbadprotocolops.yfilter = yfilter; } if(value_path == "cufwAaicGlobalNumBadPDUSize") { cufwaaicglobalnumbadpdusize.yfilter = yfilter; } if(value_path == "cufwAaicGlobalNumBadPortRange") { cufwaaicglobalnumbadportrange.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwAaicGlobals::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwAaicGlobalNumBadProtocolOps" || name == "cufwAaicGlobalNumBadPDUSize" || name == "cufwAaicGlobalNumBadPortRange") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::CufwAaicHttpProtocolStats() : cufwaaichttpnumbadprotocolops{YType::uint64, "cufwAaicHttpNumBadProtocolOps"}, cufwaaichttpnumbadpdusize{YType::uint64, "cufwAaicHttpNumBadPDUSize"}, cufwaaichttpnumtunneledconns{YType::uint64, "cufwAaicHttpNumTunneledConns"}, cufwaaichttpnumlargeuris{YType::uint64, "cufwAaicHttpNumLargeURIs"}, cufwaaichttpnumbadcontent{YType::uint64, "cufwAaicHttpNumBadContent"}, cufwaaichttpnummismatchcontent{YType::uint64, "cufwAaicHttpNumMismatchContent"}, cufwaaichttpnumdoubleencodedpkts{YType::uint64, "cufwAaicHttpNumDoubleEncodedPkts"} { yang_name = "cufwAaicHttpProtocolStats"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::~CufwAaicHttpProtocolStats() { } bool CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::has_data() const { if (is_presence_container) return true; return cufwaaichttpnumbadprotocolops.is_set || cufwaaichttpnumbadpdusize.is_set || cufwaaichttpnumtunneledconns.is_set || cufwaaichttpnumlargeuris.is_set || cufwaaichttpnumbadcontent.is_set || cufwaaichttpnummismatchcontent.is_set || cufwaaichttpnumdoubleencodedpkts.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwaaichttpnumbadprotocolops.yfilter) || ydk::is_set(cufwaaichttpnumbadpdusize.yfilter) || ydk::is_set(cufwaaichttpnumtunneledconns.yfilter) || ydk::is_set(cufwaaichttpnumlargeuris.yfilter) || ydk::is_set(cufwaaichttpnumbadcontent.yfilter) || ydk::is_set(cufwaaichttpnummismatchcontent.yfilter) || ydk::is_set(cufwaaichttpnumdoubleencodedpkts.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwAaicHttpProtocolStats"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwaaichttpnumbadprotocolops.is_set || is_set(cufwaaichttpnumbadprotocolops.yfilter)) leaf_name_data.push_back(cufwaaichttpnumbadprotocolops.get_name_leafdata()); if (cufwaaichttpnumbadpdusize.is_set || is_set(cufwaaichttpnumbadpdusize.yfilter)) leaf_name_data.push_back(cufwaaichttpnumbadpdusize.get_name_leafdata()); if (cufwaaichttpnumtunneledconns.is_set || is_set(cufwaaichttpnumtunneledconns.yfilter)) leaf_name_data.push_back(cufwaaichttpnumtunneledconns.get_name_leafdata()); if (cufwaaichttpnumlargeuris.is_set || is_set(cufwaaichttpnumlargeuris.yfilter)) leaf_name_data.push_back(cufwaaichttpnumlargeuris.get_name_leafdata()); if (cufwaaichttpnumbadcontent.is_set || is_set(cufwaaichttpnumbadcontent.yfilter)) leaf_name_data.push_back(cufwaaichttpnumbadcontent.get_name_leafdata()); if (cufwaaichttpnummismatchcontent.is_set || is_set(cufwaaichttpnummismatchcontent.yfilter)) leaf_name_data.push_back(cufwaaichttpnummismatchcontent.get_name_leafdata()); if (cufwaaichttpnumdoubleencodedpkts.is_set || is_set(cufwaaichttpnumdoubleencodedpkts.yfilter)) leaf_name_data.push_back(cufwaaichttpnumdoubleencodedpkts.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwAaicHttpNumBadProtocolOps") { cufwaaichttpnumbadprotocolops = value; cufwaaichttpnumbadprotocolops.value_namespace = name_space; cufwaaichttpnumbadprotocolops.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAaicHttpNumBadPDUSize") { cufwaaichttpnumbadpdusize = value; cufwaaichttpnumbadpdusize.value_namespace = name_space; cufwaaichttpnumbadpdusize.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAaicHttpNumTunneledConns") { cufwaaichttpnumtunneledconns = value; cufwaaichttpnumtunneledconns.value_namespace = name_space; cufwaaichttpnumtunneledconns.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAaicHttpNumLargeURIs") { cufwaaichttpnumlargeuris = value; cufwaaichttpnumlargeuris.value_namespace = name_space; cufwaaichttpnumlargeuris.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAaicHttpNumBadContent") { cufwaaichttpnumbadcontent = value; cufwaaichttpnumbadcontent.value_namespace = name_space; cufwaaichttpnumbadcontent.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAaicHttpNumMismatchContent") { cufwaaichttpnummismatchcontent = value; cufwaaichttpnummismatchcontent.value_namespace = name_space; cufwaaichttpnummismatchcontent.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAaicHttpNumDoubleEncodedPkts") { cufwaaichttpnumdoubleencodedpkts = value; cufwaaichttpnumdoubleencodedpkts.value_namespace = name_space; cufwaaichttpnumdoubleencodedpkts.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwAaicHttpNumBadProtocolOps") { cufwaaichttpnumbadprotocolops.yfilter = yfilter; } if(value_path == "cufwAaicHttpNumBadPDUSize") { cufwaaichttpnumbadpdusize.yfilter = yfilter; } if(value_path == "cufwAaicHttpNumTunneledConns") { cufwaaichttpnumtunneledconns.yfilter = yfilter; } if(value_path == "cufwAaicHttpNumLargeURIs") { cufwaaichttpnumlargeuris.yfilter = yfilter; } if(value_path == "cufwAaicHttpNumBadContent") { cufwaaichttpnumbadcontent.yfilter = yfilter; } if(value_path == "cufwAaicHttpNumMismatchContent") { cufwaaichttpnummismatchcontent.yfilter = yfilter; } if(value_path == "cufwAaicHttpNumDoubleEncodedPkts") { cufwaaichttpnumdoubleencodedpkts.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwAaicHttpProtocolStats::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwAaicHttpNumBadProtocolOps" || name == "cufwAaicHttpNumBadPDUSize" || name == "cufwAaicHttpNumTunneledConns" || name == "cufwAaicHttpNumLargeURIs" || name == "cufwAaicHttpNumBadContent" || name == "cufwAaicHttpNumMismatchContent" || name == "cufwAaicHttpNumDoubleEncodedPkts") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::CufwL2FwGlobals() : cufwl2globalenablestealthmode{YType::boolean, "cufwL2GlobalEnableStealthMode"}, cufwl2globalarpcachesize{YType::int32, "cufwL2GlobalArpCacheSize"}, cufwl2globalenablearpinspection{YType::boolean, "cufwL2GlobalEnableArpInspection"}, cufwl2globalnumarprequests{YType::uint64, "cufwL2GlobalNumArpRequests"}, cufwl2globalnumicmprequests{YType::uint64, "cufwL2GlobalNumIcmpRequests"}, cufwl2globalnumfloods{YType::uint64, "cufwL2GlobalNumFloods"}, cufwl2globalnumdrops{YType::uint64, "cufwL2GlobalNumDrops"}, cufwl2globalarpoverflowrate5{YType::uint32, "cufwL2GlobalArpOverflowRate5"}, cufwl2globalnumbadarpresponses{YType::uint64, "cufwL2GlobalNumBadArpResponses"}, cufwl2globalnumspoofedarpresps{YType::uint64, "cufwL2GlobalNumSpoofedArpResps"} { yang_name = "cufwL2FwGlobals"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::~CufwL2FwGlobals() { } bool CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::has_data() const { if (is_presence_container) return true; return cufwl2globalenablestealthmode.is_set || cufwl2globalarpcachesize.is_set || cufwl2globalenablearpinspection.is_set || cufwl2globalnumarprequests.is_set || cufwl2globalnumicmprequests.is_set || cufwl2globalnumfloods.is_set || cufwl2globalnumdrops.is_set || cufwl2globalarpoverflowrate5.is_set || cufwl2globalnumbadarpresponses.is_set || cufwl2globalnumspoofedarpresps.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwl2globalenablestealthmode.yfilter) || ydk::is_set(cufwl2globalarpcachesize.yfilter) || ydk::is_set(cufwl2globalenablearpinspection.yfilter) || ydk::is_set(cufwl2globalnumarprequests.yfilter) || ydk::is_set(cufwl2globalnumicmprequests.yfilter) || ydk::is_set(cufwl2globalnumfloods.yfilter) || ydk::is_set(cufwl2globalnumdrops.yfilter) || ydk::is_set(cufwl2globalarpoverflowrate5.yfilter) || ydk::is_set(cufwl2globalnumbadarpresponses.yfilter) || ydk::is_set(cufwl2globalnumspoofedarpresps.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwL2FwGlobals"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwl2globalenablestealthmode.is_set || is_set(cufwl2globalenablestealthmode.yfilter)) leaf_name_data.push_back(cufwl2globalenablestealthmode.get_name_leafdata()); if (cufwl2globalarpcachesize.is_set || is_set(cufwl2globalarpcachesize.yfilter)) leaf_name_data.push_back(cufwl2globalarpcachesize.get_name_leafdata()); if (cufwl2globalenablearpinspection.is_set || is_set(cufwl2globalenablearpinspection.yfilter)) leaf_name_data.push_back(cufwl2globalenablearpinspection.get_name_leafdata()); if (cufwl2globalnumarprequests.is_set || is_set(cufwl2globalnumarprequests.yfilter)) leaf_name_data.push_back(cufwl2globalnumarprequests.get_name_leafdata()); if (cufwl2globalnumicmprequests.is_set || is_set(cufwl2globalnumicmprequests.yfilter)) leaf_name_data.push_back(cufwl2globalnumicmprequests.get_name_leafdata()); if (cufwl2globalnumfloods.is_set || is_set(cufwl2globalnumfloods.yfilter)) leaf_name_data.push_back(cufwl2globalnumfloods.get_name_leafdata()); if (cufwl2globalnumdrops.is_set || is_set(cufwl2globalnumdrops.yfilter)) leaf_name_data.push_back(cufwl2globalnumdrops.get_name_leafdata()); if (cufwl2globalarpoverflowrate5.is_set || is_set(cufwl2globalarpoverflowrate5.yfilter)) leaf_name_data.push_back(cufwl2globalarpoverflowrate5.get_name_leafdata()); if (cufwl2globalnumbadarpresponses.is_set || is_set(cufwl2globalnumbadarpresponses.yfilter)) leaf_name_data.push_back(cufwl2globalnumbadarpresponses.get_name_leafdata()); if (cufwl2globalnumspoofedarpresps.is_set || is_set(cufwl2globalnumspoofedarpresps.yfilter)) leaf_name_data.push_back(cufwl2globalnumspoofedarpresps.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwL2GlobalEnableStealthMode") { cufwl2globalenablestealthmode = value; cufwl2globalenablestealthmode.value_namespace = name_space; cufwl2globalenablestealthmode.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalArpCacheSize") { cufwl2globalarpcachesize = value; cufwl2globalarpcachesize.value_namespace = name_space; cufwl2globalarpcachesize.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalEnableArpInspection") { cufwl2globalenablearpinspection = value; cufwl2globalenablearpinspection.value_namespace = name_space; cufwl2globalenablearpinspection.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalNumArpRequests") { cufwl2globalnumarprequests = value; cufwl2globalnumarprequests.value_namespace = name_space; cufwl2globalnumarprequests.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalNumIcmpRequests") { cufwl2globalnumicmprequests = value; cufwl2globalnumicmprequests.value_namespace = name_space; cufwl2globalnumicmprequests.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalNumFloods") { cufwl2globalnumfloods = value; cufwl2globalnumfloods.value_namespace = name_space; cufwl2globalnumfloods.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalNumDrops") { cufwl2globalnumdrops = value; cufwl2globalnumdrops.value_namespace = name_space; cufwl2globalnumdrops.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalArpOverflowRate5") { cufwl2globalarpoverflowrate5 = value; cufwl2globalarpoverflowrate5.value_namespace = name_space; cufwl2globalarpoverflowrate5.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalNumBadArpResponses") { cufwl2globalnumbadarpresponses = value; cufwl2globalnumbadarpresponses.value_namespace = name_space; cufwl2globalnumbadarpresponses.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwL2GlobalNumSpoofedArpResps") { cufwl2globalnumspoofedarpresps = value; cufwl2globalnumspoofedarpresps.value_namespace = name_space; cufwl2globalnumspoofedarpresps.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwL2GlobalEnableStealthMode") { cufwl2globalenablestealthmode.yfilter = yfilter; } if(value_path == "cufwL2GlobalArpCacheSize") { cufwl2globalarpcachesize.yfilter = yfilter; } if(value_path == "cufwL2GlobalEnableArpInspection") { cufwl2globalenablearpinspection.yfilter = yfilter; } if(value_path == "cufwL2GlobalNumArpRequests") { cufwl2globalnumarprequests.yfilter = yfilter; } if(value_path == "cufwL2GlobalNumIcmpRequests") { cufwl2globalnumicmprequests.yfilter = yfilter; } if(value_path == "cufwL2GlobalNumFloods") { cufwl2globalnumfloods.yfilter = yfilter; } if(value_path == "cufwL2GlobalNumDrops") { cufwl2globalnumdrops.yfilter = yfilter; } if(value_path == "cufwL2GlobalArpOverflowRate5") { cufwl2globalarpoverflowrate5.yfilter = yfilter; } if(value_path == "cufwL2GlobalNumBadArpResponses") { cufwl2globalnumbadarpresponses.yfilter = yfilter; } if(value_path == "cufwL2GlobalNumSpoofedArpResps") { cufwl2globalnumspoofedarpresps.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwL2FwGlobals::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwL2GlobalEnableStealthMode" || name == "cufwL2GlobalArpCacheSize" || name == "cufwL2GlobalEnableArpInspection" || name == "cufwL2GlobalNumArpRequests" || name == "cufwL2GlobalNumIcmpRequests" || name == "cufwL2GlobalNumFloods" || name == "cufwL2GlobalNumDrops" || name == "cufwL2GlobalArpOverflowRate5" || name == "cufwL2GlobalNumBadArpResponses" || name == "cufwL2GlobalNumSpoofedArpResps") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::CuFwNotifCntlGrp() : cufwcntlurlfserverstatuschange{YType::boolean, "cufwCntlUrlfServerStatusChange"}, cufwcntll2staticmacaddressmoved{YType::boolean, "cufwCntlL2StaticMacAddressMoved"} { yang_name = "cuFwNotifCntlGrp"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::~CuFwNotifCntlGrp() { } bool CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::has_data() const { if (is_presence_container) return true; return cufwcntlurlfserverstatuschange.is_set || cufwcntll2staticmacaddressmoved.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwcntlurlfserverstatuschange.yfilter) || ydk::is_set(cufwcntll2staticmacaddressmoved.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cuFwNotifCntlGrp"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwcntlurlfserverstatuschange.is_set || is_set(cufwcntlurlfserverstatuschange.yfilter)) leaf_name_data.push_back(cufwcntlurlfserverstatuschange.get_name_leafdata()); if (cufwcntll2staticmacaddressmoved.is_set || is_set(cufwcntll2staticmacaddressmoved.yfilter)) leaf_name_data.push_back(cufwcntll2staticmacaddressmoved.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwCntlUrlfServerStatusChange") { cufwcntlurlfserverstatuschange = value; cufwcntlurlfserverstatuschange.value_namespace = name_space; cufwcntlurlfserverstatuschange.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwCntlL2StaticMacAddressMoved") { cufwcntll2staticmacaddressmoved = value; cufwcntll2staticmacaddressmoved.value_namespace = name_space; cufwcntll2staticmacaddressmoved.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwCntlUrlfServerStatusChange") { cufwcntlurlfserverstatuschange.yfilter = yfilter; } if(value_path == "cufwCntlL2StaticMacAddressMoved") { cufwcntll2staticmacaddressmoved.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CuFwNotifCntlGrp::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwCntlUrlfServerStatusChange" || name == "cufwCntlL2StaticMacAddressMoved") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryTable() : cufwconnsummaryentry(this, {"cufwconnprotocol"}) { yang_name = "cufwConnSummaryTable"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::~CufwConnSummaryTable() { } bool CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<cufwconnsummaryentry.len(); index++) { if(cufwconnsummaryentry[index]->has_data()) return true; } return false; } bool CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::has_operation() const { for (std::size_t index=0; index<cufwconnsummaryentry.len(); index++) { if(cufwconnsummaryentry[index]->has_operation()) return true; } return is_set(yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwConnSummaryTable"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "cufwConnSummaryEntry") { auto ent_ = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry>(); ent_->parent = this; cufwconnsummaryentry.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : cufwconnsummaryentry.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::set_filter(const std::string & value_path, YFilter yfilter) { } bool CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwConnSummaryEntry") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::CufwConnSummaryEntry() : cufwconnprotocol{YType::enumeration, "cufwConnProtocol"}, cufwconnnumattempted{YType::uint64, "cufwConnNumAttempted"}, cufwconnnumsetupsaborted{YType::uint64, "cufwConnNumSetupsAborted"}, cufwconnnumpolicydeclined{YType::uint64, "cufwConnNumPolicyDeclined"}, cufwconnnumresdeclined{YType::uint64, "cufwConnNumResDeclined"}, cufwconnnumhalfopen{YType::uint32, "cufwConnNumHalfOpen"}, cufwconnnumactive{YType::uint32, "cufwConnNumActive"}, cufwconnnumaborted{YType::uint64, "cufwConnNumAborted"}, cufwconnsetuprate1{YType::uint32, "cufwConnSetupRate1"}, cufwconnsetuprate5{YType::uint32, "cufwConnSetupRate5"} { yang_name = "cufwConnSummaryEntry"; yang_parent_name = "cufwConnSummaryTable"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::~CufwConnSummaryEntry() { } bool CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::has_data() const { if (is_presence_container) return true; return cufwconnprotocol.is_set || cufwconnnumattempted.is_set || cufwconnnumsetupsaborted.is_set || cufwconnnumpolicydeclined.is_set || cufwconnnumresdeclined.is_set || cufwconnnumhalfopen.is_set || cufwconnnumactive.is_set || cufwconnnumaborted.is_set || cufwconnsetuprate1.is_set || cufwconnsetuprate5.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwconnprotocol.yfilter) || ydk::is_set(cufwconnnumattempted.yfilter) || ydk::is_set(cufwconnnumsetupsaborted.yfilter) || ydk::is_set(cufwconnnumpolicydeclined.yfilter) || ydk::is_set(cufwconnnumresdeclined.yfilter) || ydk::is_set(cufwconnnumhalfopen.yfilter) || ydk::is_set(cufwconnnumactive.yfilter) || ydk::is_set(cufwconnnumaborted.yfilter) || ydk::is_set(cufwconnsetuprate1.yfilter) || ydk::is_set(cufwconnsetuprate5.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/cufwConnSummaryTable/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwConnSummaryEntry"; ADD_KEY_TOKEN(cufwconnprotocol, "cufwConnProtocol"); return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwconnprotocol.is_set || is_set(cufwconnprotocol.yfilter)) leaf_name_data.push_back(cufwconnprotocol.get_name_leafdata()); if (cufwconnnumattempted.is_set || is_set(cufwconnnumattempted.yfilter)) leaf_name_data.push_back(cufwconnnumattempted.get_name_leafdata()); if (cufwconnnumsetupsaborted.is_set || is_set(cufwconnnumsetupsaborted.yfilter)) leaf_name_data.push_back(cufwconnnumsetupsaborted.get_name_leafdata()); if (cufwconnnumpolicydeclined.is_set || is_set(cufwconnnumpolicydeclined.yfilter)) leaf_name_data.push_back(cufwconnnumpolicydeclined.get_name_leafdata()); if (cufwconnnumresdeclined.is_set || is_set(cufwconnnumresdeclined.yfilter)) leaf_name_data.push_back(cufwconnnumresdeclined.get_name_leafdata()); if (cufwconnnumhalfopen.is_set || is_set(cufwconnnumhalfopen.yfilter)) leaf_name_data.push_back(cufwconnnumhalfopen.get_name_leafdata()); if (cufwconnnumactive.is_set || is_set(cufwconnnumactive.yfilter)) leaf_name_data.push_back(cufwconnnumactive.get_name_leafdata()); if (cufwconnnumaborted.is_set || is_set(cufwconnnumaborted.yfilter)) leaf_name_data.push_back(cufwconnnumaborted.get_name_leafdata()); if (cufwconnsetuprate1.is_set || is_set(cufwconnsetuprate1.yfilter)) leaf_name_data.push_back(cufwconnsetuprate1.get_name_leafdata()); if (cufwconnsetuprate5.is_set || is_set(cufwconnsetuprate5.yfilter)) leaf_name_data.push_back(cufwconnsetuprate5.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwConnProtocol") { cufwconnprotocol = value; cufwconnprotocol.value_namespace = name_space; cufwconnprotocol.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnNumAttempted") { cufwconnnumattempted = value; cufwconnnumattempted.value_namespace = name_space; cufwconnnumattempted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnNumSetupsAborted") { cufwconnnumsetupsaborted = value; cufwconnnumsetupsaborted.value_namespace = name_space; cufwconnnumsetupsaborted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnNumPolicyDeclined") { cufwconnnumpolicydeclined = value; cufwconnnumpolicydeclined.value_namespace = name_space; cufwconnnumpolicydeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnNumResDeclined") { cufwconnnumresdeclined = value; cufwconnnumresdeclined.value_namespace = name_space; cufwconnnumresdeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnNumHalfOpen") { cufwconnnumhalfopen = value; cufwconnnumhalfopen.value_namespace = name_space; cufwconnnumhalfopen.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnNumActive") { cufwconnnumactive = value; cufwconnnumactive.value_namespace = name_space; cufwconnnumactive.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnNumAborted") { cufwconnnumaborted = value; cufwconnnumaborted.value_namespace = name_space; cufwconnnumaborted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnSetupRate1") { cufwconnsetuprate1 = value; cufwconnsetuprate1.value_namespace = name_space; cufwconnsetuprate1.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwConnSetupRate5") { cufwconnsetuprate5 = value; cufwconnsetuprate5.value_namespace = name_space; cufwconnsetuprate5.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwConnProtocol") { cufwconnprotocol.yfilter = yfilter; } if(value_path == "cufwConnNumAttempted") { cufwconnnumattempted.yfilter = yfilter; } if(value_path == "cufwConnNumSetupsAborted") { cufwconnnumsetupsaborted.yfilter = yfilter; } if(value_path == "cufwConnNumPolicyDeclined") { cufwconnnumpolicydeclined.yfilter = yfilter; } if(value_path == "cufwConnNumResDeclined") { cufwconnnumresdeclined.yfilter = yfilter; } if(value_path == "cufwConnNumHalfOpen") { cufwconnnumhalfopen.yfilter = yfilter; } if(value_path == "cufwConnNumActive") { cufwconnnumactive.yfilter = yfilter; } if(value_path == "cufwConnNumAborted") { cufwconnnumaborted.yfilter = yfilter; } if(value_path == "cufwConnSetupRate1") { cufwconnsetuprate1.yfilter = yfilter; } if(value_path == "cufwConnSetupRate5") { cufwconnsetuprate5.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwConnSummaryTable::CufwConnSummaryEntry::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwConnProtocol" || name == "cufwConnNumAttempted" || name == "cufwConnNumSetupsAborted" || name == "cufwConnNumPolicyDeclined" || name == "cufwConnNumResDeclined" || name == "cufwConnNumHalfOpen" || name == "cufwConnNumActive" || name == "cufwConnNumAborted" || name == "cufwConnSetupRate1" || name == "cufwConnSetupRate5") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryTable() : cufwappconnsummaryentry(this, {"cufwappconnprotocol"}) { yang_name = "cufwAppConnSummaryTable"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::~CufwAppConnSummaryTable() { } bool CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<cufwappconnsummaryentry.len(); index++) { if(cufwappconnsummaryentry[index]->has_data()) return true; } return false; } bool CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::has_operation() const { for (std::size_t index=0; index<cufwappconnsummaryentry.len(); index++) { if(cufwappconnsummaryentry[index]->has_operation()) return true; } return is_set(yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwAppConnSummaryTable"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "cufwAppConnSummaryEntry") { auto ent_ = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry>(); ent_->parent = this; cufwappconnsummaryentry.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : cufwappconnsummaryentry.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::set_filter(const std::string & value_path, YFilter yfilter) { } bool CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwAppConnSummaryEntry") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::CufwAppConnSummaryEntry() : cufwappconnprotocol{YType::enumeration, "cufwAppConnProtocol"}, cufwappconnnumattempted{YType::uint64, "cufwAppConnNumAttempted"}, cufwappconnnumsetupsaborted{YType::uint64, "cufwAppConnNumSetupsAborted"}, cufwappconnnumpolicydeclined{YType::uint64, "cufwAppConnNumPolicyDeclined"}, cufwappconnnumresdeclined{YType::uint64, "cufwAppConnNumResDeclined"}, cufwappconnnumhalfopen{YType::uint32, "cufwAppConnNumHalfOpen"}, cufwappconnnumactive{YType::uint32, "cufwAppConnNumActive"}, cufwappconnnumaborted{YType::uint64, "cufwAppConnNumAborted"}, cufwappconnsetuprate1{YType::uint32, "cufwAppConnSetupRate1"}, cufwappconnsetuprate5{YType::uint32, "cufwAppConnSetupRate5"} { yang_name = "cufwAppConnSummaryEntry"; yang_parent_name = "cufwAppConnSummaryTable"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::~CufwAppConnSummaryEntry() { } bool CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::has_data() const { if (is_presence_container) return true; return cufwappconnprotocol.is_set || cufwappconnnumattempted.is_set || cufwappconnnumsetupsaborted.is_set || cufwappconnnumpolicydeclined.is_set || cufwappconnnumresdeclined.is_set || cufwappconnnumhalfopen.is_set || cufwappconnnumactive.is_set || cufwappconnnumaborted.is_set || cufwappconnsetuprate1.is_set || cufwappconnsetuprate5.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwappconnprotocol.yfilter) || ydk::is_set(cufwappconnnumattempted.yfilter) || ydk::is_set(cufwappconnnumsetupsaborted.yfilter) || ydk::is_set(cufwappconnnumpolicydeclined.yfilter) || ydk::is_set(cufwappconnnumresdeclined.yfilter) || ydk::is_set(cufwappconnnumhalfopen.yfilter) || ydk::is_set(cufwappconnnumactive.yfilter) || ydk::is_set(cufwappconnnumaborted.yfilter) || ydk::is_set(cufwappconnsetuprate1.yfilter) || ydk::is_set(cufwappconnsetuprate5.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/cufwAppConnSummaryTable/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwAppConnSummaryEntry"; ADD_KEY_TOKEN(cufwappconnprotocol, "cufwAppConnProtocol"); return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwappconnprotocol.is_set || is_set(cufwappconnprotocol.yfilter)) leaf_name_data.push_back(cufwappconnprotocol.get_name_leafdata()); if (cufwappconnnumattempted.is_set || is_set(cufwappconnnumattempted.yfilter)) leaf_name_data.push_back(cufwappconnnumattempted.get_name_leafdata()); if (cufwappconnnumsetupsaborted.is_set || is_set(cufwappconnnumsetupsaborted.yfilter)) leaf_name_data.push_back(cufwappconnnumsetupsaborted.get_name_leafdata()); if (cufwappconnnumpolicydeclined.is_set || is_set(cufwappconnnumpolicydeclined.yfilter)) leaf_name_data.push_back(cufwappconnnumpolicydeclined.get_name_leafdata()); if (cufwappconnnumresdeclined.is_set || is_set(cufwappconnnumresdeclined.yfilter)) leaf_name_data.push_back(cufwappconnnumresdeclined.get_name_leafdata()); if (cufwappconnnumhalfopen.is_set || is_set(cufwappconnnumhalfopen.yfilter)) leaf_name_data.push_back(cufwappconnnumhalfopen.get_name_leafdata()); if (cufwappconnnumactive.is_set || is_set(cufwappconnnumactive.yfilter)) leaf_name_data.push_back(cufwappconnnumactive.get_name_leafdata()); if (cufwappconnnumaborted.is_set || is_set(cufwappconnnumaborted.yfilter)) leaf_name_data.push_back(cufwappconnnumaborted.get_name_leafdata()); if (cufwappconnsetuprate1.is_set || is_set(cufwappconnsetuprate1.yfilter)) leaf_name_data.push_back(cufwappconnsetuprate1.get_name_leafdata()); if (cufwappconnsetuprate5.is_set || is_set(cufwappconnsetuprate5.yfilter)) leaf_name_data.push_back(cufwappconnsetuprate5.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwAppConnProtocol") { cufwappconnprotocol = value; cufwappconnprotocol.value_namespace = name_space; cufwappconnprotocol.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnNumAttempted") { cufwappconnnumattempted = value; cufwappconnnumattempted.value_namespace = name_space; cufwappconnnumattempted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnNumSetupsAborted") { cufwappconnnumsetupsaborted = value; cufwappconnnumsetupsaborted.value_namespace = name_space; cufwappconnnumsetupsaborted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnNumPolicyDeclined") { cufwappconnnumpolicydeclined = value; cufwappconnnumpolicydeclined.value_namespace = name_space; cufwappconnnumpolicydeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnNumResDeclined") { cufwappconnnumresdeclined = value; cufwappconnnumresdeclined.value_namespace = name_space; cufwappconnnumresdeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnNumHalfOpen") { cufwappconnnumhalfopen = value; cufwappconnnumhalfopen.value_namespace = name_space; cufwappconnnumhalfopen.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnNumActive") { cufwappconnnumactive = value; cufwappconnnumactive.value_namespace = name_space; cufwappconnnumactive.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnNumAborted") { cufwappconnnumaborted = value; cufwappconnnumaborted.value_namespace = name_space; cufwappconnnumaborted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnSetupRate1") { cufwappconnsetuprate1 = value; cufwappconnsetuprate1.value_namespace = name_space; cufwappconnsetuprate1.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwAppConnSetupRate5") { cufwappconnsetuprate5 = value; cufwappconnsetuprate5.value_namespace = name_space; cufwappconnsetuprate5.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwAppConnProtocol") { cufwappconnprotocol.yfilter = yfilter; } if(value_path == "cufwAppConnNumAttempted") { cufwappconnnumattempted.yfilter = yfilter; } if(value_path == "cufwAppConnNumSetupsAborted") { cufwappconnnumsetupsaborted.yfilter = yfilter; } if(value_path == "cufwAppConnNumPolicyDeclined") { cufwappconnnumpolicydeclined.yfilter = yfilter; } if(value_path == "cufwAppConnNumResDeclined") { cufwappconnnumresdeclined.yfilter = yfilter; } if(value_path == "cufwAppConnNumHalfOpen") { cufwappconnnumhalfopen.yfilter = yfilter; } if(value_path == "cufwAppConnNumActive") { cufwappconnnumactive.yfilter = yfilter; } if(value_path == "cufwAppConnNumAborted") { cufwappconnnumaborted.yfilter = yfilter; } if(value_path == "cufwAppConnSetupRate1") { cufwappconnsetuprate1.yfilter = yfilter; } if(value_path == "cufwAppConnSetupRate5") { cufwappconnsetuprate5.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwAppConnSummaryTable::CufwAppConnSummaryEntry::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwAppConnProtocol" || name == "cufwAppConnNumAttempted" || name == "cufwAppConnNumSetupsAborted" || name == "cufwAppConnNumPolicyDeclined" || name == "cufwAppConnNumResDeclined" || name == "cufwAppConnNumHalfOpen" || name == "cufwAppConnNumActive" || name == "cufwAppConnNumAborted" || name == "cufwAppConnSetupRate1" || name == "cufwAppConnSetupRate5") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryTable() : cufwpolicyconnsummaryentry(this, {"cufwpolconnpolicy", "cufwpolconnpolicytargettype", "cufwpolconnpolicytarget", "cufwpolconnprotocol"}) { yang_name = "cufwPolicyConnSummaryTable"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::~CufwPolicyConnSummaryTable() { } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<cufwpolicyconnsummaryentry.len(); index++) { if(cufwpolicyconnsummaryentry[index]->has_data()) return true; } return false; } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::has_operation() const { for (std::size_t index=0; index<cufwpolicyconnsummaryentry.len(); index++) { if(cufwpolicyconnsummaryentry[index]->has_operation()) return true; } return is_set(yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwPolicyConnSummaryTable"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "cufwPolicyConnSummaryEntry") { auto ent_ = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry>(); ent_->parent = this; cufwpolicyconnsummaryentry.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : cufwpolicyconnsummaryentry.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::set_filter(const std::string & value_path, YFilter yfilter) { } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwPolicyConnSummaryEntry") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::CufwPolicyConnSummaryEntry() : cufwpolconnpolicy{YType::str, "cufwPolConnPolicy"}, cufwpolconnpolicytargettype{YType::enumeration, "cufwPolConnPolicyTargetType"}, cufwpolconnpolicytarget{YType::str, "cufwPolConnPolicyTarget"}, cufwpolconnprotocol{YType::enumeration, "cufwPolConnProtocol"}, cufwpolconnnumattempted{YType::uint64, "cufwPolConnNumAttempted"}, cufwpolconnnumsetupsaborted{YType::uint64, "cufwPolConnNumSetupsAborted"}, cufwpolconnnumpolicydeclined{YType::uint64, "cufwPolConnNumPolicyDeclined"}, cufwpolconnnumresdeclined{YType::uint64, "cufwPolConnNumResDeclined"}, cufwpolconnnumhalfopen{YType::uint32, "cufwPolConnNumHalfOpen"}, cufwpolconnnumactive{YType::uint32, "cufwPolConnNumActive"}, cufwpolconnnumaborted{YType::uint64, "cufwPolConnNumAborted"} { yang_name = "cufwPolicyConnSummaryEntry"; yang_parent_name = "cufwPolicyConnSummaryTable"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::~CufwPolicyConnSummaryEntry() { } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::has_data() const { if (is_presence_container) return true; return cufwpolconnpolicy.is_set || cufwpolconnpolicytargettype.is_set || cufwpolconnpolicytarget.is_set || cufwpolconnprotocol.is_set || cufwpolconnnumattempted.is_set || cufwpolconnnumsetupsaborted.is_set || cufwpolconnnumpolicydeclined.is_set || cufwpolconnnumresdeclined.is_set || cufwpolconnnumhalfopen.is_set || cufwpolconnnumactive.is_set || cufwpolconnnumaborted.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwpolconnpolicy.yfilter) || ydk::is_set(cufwpolconnpolicytargettype.yfilter) || ydk::is_set(cufwpolconnpolicytarget.yfilter) || ydk::is_set(cufwpolconnprotocol.yfilter) || ydk::is_set(cufwpolconnnumattempted.yfilter) || ydk::is_set(cufwpolconnnumsetupsaborted.yfilter) || ydk::is_set(cufwpolconnnumpolicydeclined.yfilter) || ydk::is_set(cufwpolconnnumresdeclined.yfilter) || ydk::is_set(cufwpolconnnumhalfopen.yfilter) || ydk::is_set(cufwpolconnnumactive.yfilter) || ydk::is_set(cufwpolconnnumaborted.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/cufwPolicyConnSummaryTable/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwPolicyConnSummaryEntry"; ADD_KEY_TOKEN(cufwpolconnpolicy, "cufwPolConnPolicy"); ADD_KEY_TOKEN(cufwpolconnpolicytargettype, "cufwPolConnPolicyTargetType"); ADD_KEY_TOKEN(cufwpolconnpolicytarget, "cufwPolConnPolicyTarget"); ADD_KEY_TOKEN(cufwpolconnprotocol, "cufwPolConnProtocol"); return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwpolconnpolicy.is_set || is_set(cufwpolconnpolicy.yfilter)) leaf_name_data.push_back(cufwpolconnpolicy.get_name_leafdata()); if (cufwpolconnpolicytargettype.is_set || is_set(cufwpolconnpolicytargettype.yfilter)) leaf_name_data.push_back(cufwpolconnpolicytargettype.get_name_leafdata()); if (cufwpolconnpolicytarget.is_set || is_set(cufwpolconnpolicytarget.yfilter)) leaf_name_data.push_back(cufwpolconnpolicytarget.get_name_leafdata()); if (cufwpolconnprotocol.is_set || is_set(cufwpolconnprotocol.yfilter)) leaf_name_data.push_back(cufwpolconnprotocol.get_name_leafdata()); if (cufwpolconnnumattempted.is_set || is_set(cufwpolconnnumattempted.yfilter)) leaf_name_data.push_back(cufwpolconnnumattempted.get_name_leafdata()); if (cufwpolconnnumsetupsaborted.is_set || is_set(cufwpolconnnumsetupsaborted.yfilter)) leaf_name_data.push_back(cufwpolconnnumsetupsaborted.get_name_leafdata()); if (cufwpolconnnumpolicydeclined.is_set || is_set(cufwpolconnnumpolicydeclined.yfilter)) leaf_name_data.push_back(cufwpolconnnumpolicydeclined.get_name_leafdata()); if (cufwpolconnnumresdeclined.is_set || is_set(cufwpolconnnumresdeclined.yfilter)) leaf_name_data.push_back(cufwpolconnnumresdeclined.get_name_leafdata()); if (cufwpolconnnumhalfopen.is_set || is_set(cufwpolconnnumhalfopen.yfilter)) leaf_name_data.push_back(cufwpolconnnumhalfopen.get_name_leafdata()); if (cufwpolconnnumactive.is_set || is_set(cufwpolconnnumactive.yfilter)) leaf_name_data.push_back(cufwpolconnnumactive.get_name_leafdata()); if (cufwpolconnnumaborted.is_set || is_set(cufwpolconnnumaborted.yfilter)) leaf_name_data.push_back(cufwpolconnnumaborted.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwPolConnPolicy") { cufwpolconnpolicy = value; cufwpolconnpolicy.value_namespace = name_space; cufwpolconnpolicy.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnPolicyTargetType") { cufwpolconnpolicytargettype = value; cufwpolconnpolicytargettype.value_namespace = name_space; cufwpolconnpolicytargettype.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnPolicyTarget") { cufwpolconnpolicytarget = value; cufwpolconnpolicytarget.value_namespace = name_space; cufwpolconnpolicytarget.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnProtocol") { cufwpolconnprotocol = value; cufwpolconnprotocol.value_namespace = name_space; cufwpolconnprotocol.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnNumAttempted") { cufwpolconnnumattempted = value; cufwpolconnnumattempted.value_namespace = name_space; cufwpolconnnumattempted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnNumSetupsAborted") { cufwpolconnnumsetupsaborted = value; cufwpolconnnumsetupsaborted.value_namespace = name_space; cufwpolconnnumsetupsaborted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnNumPolicyDeclined") { cufwpolconnnumpolicydeclined = value; cufwpolconnnumpolicydeclined.value_namespace = name_space; cufwpolconnnumpolicydeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnNumResDeclined") { cufwpolconnnumresdeclined = value; cufwpolconnnumresdeclined.value_namespace = name_space; cufwpolconnnumresdeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnNumHalfOpen") { cufwpolconnnumhalfopen = value; cufwpolconnnumhalfopen.value_namespace = name_space; cufwpolconnnumhalfopen.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnNumActive") { cufwpolconnnumactive = value; cufwpolconnnumactive.value_namespace = name_space; cufwpolconnnumactive.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolConnNumAborted") { cufwpolconnnumaborted = value; cufwpolconnnumaborted.value_namespace = name_space; cufwpolconnnumaborted.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwPolConnPolicy") { cufwpolconnpolicy.yfilter = yfilter; } if(value_path == "cufwPolConnPolicyTargetType") { cufwpolconnpolicytargettype.yfilter = yfilter; } if(value_path == "cufwPolConnPolicyTarget") { cufwpolconnpolicytarget.yfilter = yfilter; } if(value_path == "cufwPolConnProtocol") { cufwpolconnprotocol.yfilter = yfilter; } if(value_path == "cufwPolConnNumAttempted") { cufwpolconnnumattempted.yfilter = yfilter; } if(value_path == "cufwPolConnNumSetupsAborted") { cufwpolconnnumsetupsaborted.yfilter = yfilter; } if(value_path == "cufwPolConnNumPolicyDeclined") { cufwpolconnnumpolicydeclined.yfilter = yfilter; } if(value_path == "cufwPolConnNumResDeclined") { cufwpolconnnumresdeclined.yfilter = yfilter; } if(value_path == "cufwPolConnNumHalfOpen") { cufwpolconnnumhalfopen.yfilter = yfilter; } if(value_path == "cufwPolConnNumActive") { cufwpolconnnumactive.yfilter = yfilter; } if(value_path == "cufwPolConnNumAborted") { cufwpolconnnumaborted.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyConnSummaryTable::CufwPolicyConnSummaryEntry::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwPolConnPolicy" || name == "cufwPolConnPolicyTargetType" || name == "cufwPolConnPolicyTarget" || name == "cufwPolConnProtocol" || name == "cufwPolConnNumAttempted" || name == "cufwPolConnNumSetupsAborted" || name == "cufwPolConnNumPolicyDeclined" || name == "cufwPolConnNumResDeclined" || name == "cufwPolConnNumHalfOpen" || name == "cufwPolConnNumActive" || name == "cufwPolConnNumAborted") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryTable() : cufwpolicyappconnsummaryentry(this, {"cufwpolappconnpolicy", "cufwpolappconnpolicytargettype", "cufwpolappconnpolicytarget", "cufwpolappconnprotocol"}) { yang_name = "cufwPolicyAppConnSummaryTable"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::~CufwPolicyAppConnSummaryTable() { } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<cufwpolicyappconnsummaryentry.len(); index++) { if(cufwpolicyappconnsummaryentry[index]->has_data()) return true; } return false; } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::has_operation() const { for (std::size_t index=0; index<cufwpolicyappconnsummaryentry.len(); index++) { if(cufwpolicyappconnsummaryentry[index]->has_operation()) return true; } return is_set(yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwPolicyAppConnSummaryTable"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "cufwPolicyAppConnSummaryEntry") { auto ent_ = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry>(); ent_->parent = this; cufwpolicyappconnsummaryentry.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : cufwpolicyappconnsummaryentry.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::set_filter(const std::string & value_path, YFilter yfilter) { } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwPolicyAppConnSummaryEntry") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::CufwPolicyAppConnSummaryEntry() : cufwpolappconnpolicy{YType::str, "cufwPolAppConnPolicy"}, cufwpolappconnpolicytargettype{YType::enumeration, "cufwPolAppConnPolicyTargetType"}, cufwpolappconnpolicytarget{YType::str, "cufwPolAppConnPolicyTarget"}, cufwpolappconnprotocol{YType::enumeration, "cufwPolAppConnProtocol"}, cufwpolappconnnumattempted{YType::uint64, "cufwPolAppConnNumAttempted"}, cufwpolappconnnumsetupsaborted{YType::uint64, "cufwPolAppConnNumSetupsAborted"}, cufwpolappconnnumpolicydeclined{YType::uint64, "cufwPolAppConnNumPolicyDeclined"}, cufwpolappconnnumresdeclined{YType::uint64, "cufwPolAppConnNumResDeclined"}, cufwpolappconnnumhalfopen{YType::uint32, "cufwPolAppConnNumHalfOpen"}, cufwpolappconnnumactive{YType::uint32, "cufwPolAppConnNumActive"}, cufwpolappconnnumaborted{YType::uint64, "cufwPolAppConnNumAborted"} { yang_name = "cufwPolicyAppConnSummaryEntry"; yang_parent_name = "cufwPolicyAppConnSummaryTable"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::~CufwPolicyAppConnSummaryEntry() { } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::has_data() const { if (is_presence_container) return true; return cufwpolappconnpolicy.is_set || cufwpolappconnpolicytargettype.is_set || cufwpolappconnpolicytarget.is_set || cufwpolappconnprotocol.is_set || cufwpolappconnnumattempted.is_set || cufwpolappconnnumsetupsaborted.is_set || cufwpolappconnnumpolicydeclined.is_set || cufwpolappconnnumresdeclined.is_set || cufwpolappconnnumhalfopen.is_set || cufwpolappconnnumactive.is_set || cufwpolappconnnumaborted.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwpolappconnpolicy.yfilter) || ydk::is_set(cufwpolappconnpolicytargettype.yfilter) || ydk::is_set(cufwpolappconnpolicytarget.yfilter) || ydk::is_set(cufwpolappconnprotocol.yfilter) || ydk::is_set(cufwpolappconnnumattempted.yfilter) || ydk::is_set(cufwpolappconnnumsetupsaborted.yfilter) || ydk::is_set(cufwpolappconnnumpolicydeclined.yfilter) || ydk::is_set(cufwpolappconnnumresdeclined.yfilter) || ydk::is_set(cufwpolappconnnumhalfopen.yfilter) || ydk::is_set(cufwpolappconnnumactive.yfilter) || ydk::is_set(cufwpolappconnnumaborted.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/cufwPolicyAppConnSummaryTable/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwPolicyAppConnSummaryEntry"; ADD_KEY_TOKEN(cufwpolappconnpolicy, "cufwPolAppConnPolicy"); ADD_KEY_TOKEN(cufwpolappconnpolicytargettype, "cufwPolAppConnPolicyTargetType"); ADD_KEY_TOKEN(cufwpolappconnpolicytarget, "cufwPolAppConnPolicyTarget"); ADD_KEY_TOKEN(cufwpolappconnprotocol, "cufwPolAppConnProtocol"); return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwpolappconnpolicy.is_set || is_set(cufwpolappconnpolicy.yfilter)) leaf_name_data.push_back(cufwpolappconnpolicy.get_name_leafdata()); if (cufwpolappconnpolicytargettype.is_set || is_set(cufwpolappconnpolicytargettype.yfilter)) leaf_name_data.push_back(cufwpolappconnpolicytargettype.get_name_leafdata()); if (cufwpolappconnpolicytarget.is_set || is_set(cufwpolappconnpolicytarget.yfilter)) leaf_name_data.push_back(cufwpolappconnpolicytarget.get_name_leafdata()); if (cufwpolappconnprotocol.is_set || is_set(cufwpolappconnprotocol.yfilter)) leaf_name_data.push_back(cufwpolappconnprotocol.get_name_leafdata()); if (cufwpolappconnnumattempted.is_set || is_set(cufwpolappconnnumattempted.yfilter)) leaf_name_data.push_back(cufwpolappconnnumattempted.get_name_leafdata()); if (cufwpolappconnnumsetupsaborted.is_set || is_set(cufwpolappconnnumsetupsaborted.yfilter)) leaf_name_data.push_back(cufwpolappconnnumsetupsaborted.get_name_leafdata()); if (cufwpolappconnnumpolicydeclined.is_set || is_set(cufwpolappconnnumpolicydeclined.yfilter)) leaf_name_data.push_back(cufwpolappconnnumpolicydeclined.get_name_leafdata()); if (cufwpolappconnnumresdeclined.is_set || is_set(cufwpolappconnnumresdeclined.yfilter)) leaf_name_data.push_back(cufwpolappconnnumresdeclined.get_name_leafdata()); if (cufwpolappconnnumhalfopen.is_set || is_set(cufwpolappconnnumhalfopen.yfilter)) leaf_name_data.push_back(cufwpolappconnnumhalfopen.get_name_leafdata()); if (cufwpolappconnnumactive.is_set || is_set(cufwpolappconnnumactive.yfilter)) leaf_name_data.push_back(cufwpolappconnnumactive.get_name_leafdata()); if (cufwpolappconnnumaborted.is_set || is_set(cufwpolappconnnumaborted.yfilter)) leaf_name_data.push_back(cufwpolappconnnumaborted.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwPolAppConnPolicy") { cufwpolappconnpolicy = value; cufwpolappconnpolicy.value_namespace = name_space; cufwpolappconnpolicy.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnPolicyTargetType") { cufwpolappconnpolicytargettype = value; cufwpolappconnpolicytargettype.value_namespace = name_space; cufwpolappconnpolicytargettype.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnPolicyTarget") { cufwpolappconnpolicytarget = value; cufwpolappconnpolicytarget.value_namespace = name_space; cufwpolappconnpolicytarget.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnProtocol") { cufwpolappconnprotocol = value; cufwpolappconnprotocol.value_namespace = name_space; cufwpolappconnprotocol.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnNumAttempted") { cufwpolappconnnumattempted = value; cufwpolappconnnumattempted.value_namespace = name_space; cufwpolappconnnumattempted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnNumSetupsAborted") { cufwpolappconnnumsetupsaborted = value; cufwpolappconnnumsetupsaborted.value_namespace = name_space; cufwpolappconnnumsetupsaborted.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnNumPolicyDeclined") { cufwpolappconnnumpolicydeclined = value; cufwpolappconnnumpolicydeclined.value_namespace = name_space; cufwpolappconnnumpolicydeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnNumResDeclined") { cufwpolappconnnumresdeclined = value; cufwpolappconnnumresdeclined.value_namespace = name_space; cufwpolappconnnumresdeclined.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnNumHalfOpen") { cufwpolappconnnumhalfopen = value; cufwpolappconnnumhalfopen.value_namespace = name_space; cufwpolappconnnumhalfopen.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnNumActive") { cufwpolappconnnumactive = value; cufwpolappconnnumactive.value_namespace = name_space; cufwpolappconnnumactive.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwPolAppConnNumAborted") { cufwpolappconnnumaborted = value; cufwpolappconnnumaborted.value_namespace = name_space; cufwpolappconnnumaborted.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwPolAppConnPolicy") { cufwpolappconnpolicy.yfilter = yfilter; } if(value_path == "cufwPolAppConnPolicyTargetType") { cufwpolappconnpolicytargettype.yfilter = yfilter; } if(value_path == "cufwPolAppConnPolicyTarget") { cufwpolappconnpolicytarget.yfilter = yfilter; } if(value_path == "cufwPolAppConnProtocol") { cufwpolappconnprotocol.yfilter = yfilter; } if(value_path == "cufwPolAppConnNumAttempted") { cufwpolappconnnumattempted.yfilter = yfilter; } if(value_path == "cufwPolAppConnNumSetupsAborted") { cufwpolappconnnumsetupsaborted.yfilter = yfilter; } if(value_path == "cufwPolAppConnNumPolicyDeclined") { cufwpolappconnnumpolicydeclined.yfilter = yfilter; } if(value_path == "cufwPolAppConnNumResDeclined") { cufwpolappconnnumresdeclined.yfilter = yfilter; } if(value_path == "cufwPolAppConnNumHalfOpen") { cufwpolappconnnumhalfopen.yfilter = yfilter; } if(value_path == "cufwPolAppConnNumActive") { cufwpolappconnnumactive.yfilter = yfilter; } if(value_path == "cufwPolAppConnNumAborted") { cufwpolappconnnumaborted.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwPolicyAppConnSummaryTable::CufwPolicyAppConnSummaryEntry::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwPolAppConnPolicy" || name == "cufwPolAppConnPolicyTargetType" || name == "cufwPolAppConnPolicyTarget" || name == "cufwPolAppConnProtocol" || name == "cufwPolAppConnNumAttempted" || name == "cufwPolAppConnNumSetupsAborted" || name == "cufwPolAppConnNumPolicyDeclined" || name == "cufwPolAppConnNumResDeclined" || name == "cufwPolAppConnNumHalfOpen" || name == "cufwPolAppConnNumActive" || name == "cufwPolAppConnNumAborted") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionTable() : cufwinspectionentry(this, {"cufwinspectionpolicyname", "cufwinspectionprotocol"}) { yang_name = "cufwInspectionTable"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::~CufwInspectionTable() { } bool CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<cufwinspectionentry.len(); index++) { if(cufwinspectionentry[index]->has_data()) return true; } return false; } bool CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::has_operation() const { for (std::size_t index=0; index<cufwinspectionentry.len(); index++) { if(cufwinspectionentry[index]->has_operation()) return true; } return is_set(yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwInspectionTable"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "cufwInspectionEntry") { auto ent_ = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry>(); ent_->parent = this; cufwinspectionentry.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : cufwinspectionentry.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::set_filter(const std::string & value_path, YFilter yfilter) { } bool CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwInspectionEntry") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::CufwInspectionEntry() : cufwinspectionpolicyname{YType::str, "cufwInspectionPolicyName"}, cufwinspectionprotocol{YType::enumeration, "cufwInspectionProtocol"}, cufwinspectionstatus{YType::boolean, "cufwInspectionStatus"} { yang_name = "cufwInspectionEntry"; yang_parent_name = "cufwInspectionTable"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::~CufwInspectionEntry() { } bool CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::has_data() const { if (is_presence_container) return true; return cufwinspectionpolicyname.is_set || cufwinspectionprotocol.is_set || cufwinspectionstatus.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwinspectionpolicyname.yfilter) || ydk::is_set(cufwinspectionprotocol.yfilter) || ydk::is_set(cufwinspectionstatus.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/cufwInspectionTable/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwInspectionEntry"; ADD_KEY_TOKEN(cufwinspectionpolicyname, "cufwInspectionPolicyName"); ADD_KEY_TOKEN(cufwinspectionprotocol, "cufwInspectionProtocol"); return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwinspectionpolicyname.is_set || is_set(cufwinspectionpolicyname.yfilter)) leaf_name_data.push_back(cufwinspectionpolicyname.get_name_leafdata()); if (cufwinspectionprotocol.is_set || is_set(cufwinspectionprotocol.yfilter)) leaf_name_data.push_back(cufwinspectionprotocol.get_name_leafdata()); if (cufwinspectionstatus.is_set || is_set(cufwinspectionstatus.yfilter)) leaf_name_data.push_back(cufwinspectionstatus.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwInspectionPolicyName") { cufwinspectionpolicyname = value; cufwinspectionpolicyname.value_namespace = name_space; cufwinspectionpolicyname.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwInspectionProtocol") { cufwinspectionprotocol = value; cufwinspectionprotocol.value_namespace = name_space; cufwinspectionprotocol.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwInspectionStatus") { cufwinspectionstatus = value; cufwinspectionstatus.value_namespace = name_space; cufwinspectionstatus.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwInspectionPolicyName") { cufwinspectionpolicyname.yfilter = yfilter; } if(value_path == "cufwInspectionProtocol") { cufwinspectionprotocol.yfilter = yfilter; } if(value_path == "cufwInspectionStatus") { cufwinspectionstatus.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwInspectionTable::CufwInspectionEntry::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwInspectionPolicyName" || name == "cufwInspectionProtocol" || name == "cufwInspectionStatus") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerTable() : cufwurlfserverentry(this, {"cufwurlfserveraddrtype", "cufwurlfserveraddress", "cufwurlfserverport"}) { yang_name = "cufwUrlfServerTable"; yang_parent_name = "CISCO-UNIFIED-FIREWALL-MIB"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::~CufwUrlfServerTable() { } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::has_data() const { if (is_presence_container) return true; for (std::size_t index=0; index<cufwurlfserverentry.len(); index++) { if(cufwurlfserverentry[index]->has_data()) return true; } return false; } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::has_operation() const { for (std::size_t index=0; index<cufwurlfserverentry.len(); index++) { if(cufwurlfserverentry[index]->has_operation()) return true; } return is_set(yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwUrlfServerTable"; return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { if(child_yang_name == "cufwUrlfServerEntry") { auto ent_ = std::make_shared<CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry>(); ent_->parent = this; cufwurlfserverentry.append(ent_); return ent_; } return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; count_ = 0; for (auto ent_ : cufwurlfserverentry.entities()) { if(_children.find(ent_->get_segment_path()) == _children.end()) _children[ent_->get_segment_path()] = ent_; else _children[ent_->get_segment_path()+count_++] = ent_; } return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { } void CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::set_filter(const std::string & value_path, YFilter yfilter) { } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwUrlfServerEntry") return true; return false; } CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::CufwUrlfServerEntry() : cufwurlfserveraddrtype{YType::enumeration, "cufwUrlfServerAddrType"}, cufwurlfserveraddress{YType::str, "cufwUrlfServerAddress"}, cufwurlfserverport{YType::uint16, "cufwUrlfServerPort"}, cufwurlfservervendor{YType::enumeration, "cufwUrlfServerVendor"}, cufwurlfserverstatus{YType::enumeration, "cufwUrlfServerStatus"}, cufwurlfserverreqsnumprocessed{YType::uint64, "cufwUrlfServerReqsNumProcessed"}, cufwurlfserverreqsnumallowed{YType::uint64, "cufwUrlfServerReqsNumAllowed"}, cufwurlfserverreqsnumdenied{YType::uint64, "cufwUrlfServerReqsNumDenied"}, cufwurlfservernumtimeouts{YType::uint64, "cufwUrlfServerNumTimeouts"}, cufwurlfservernumretries{YType::uint64, "cufwUrlfServerNumRetries"}, cufwurlfserverrespsnumreceived{YType::uint64, "cufwUrlfServerRespsNumReceived"}, cufwurlfserverrespsnumlate{YType::uint64, "cufwUrlfServerRespsNumLate"}, cufwurlfserveravgresptime1{YType::uint32, "cufwUrlfServerAvgRespTime1"}, cufwurlfserveravgresptime5{YType::uint32, "cufwUrlfServerAvgRespTime5"} { yang_name = "cufwUrlfServerEntry"; yang_parent_name = "cufwUrlfServerTable"; is_top_level_class = false; has_list_ancestor = false; } CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::~CufwUrlfServerEntry() { } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::has_data() const { if (is_presence_container) return true; return cufwurlfserveraddrtype.is_set || cufwurlfserveraddress.is_set || cufwurlfserverport.is_set || cufwurlfservervendor.is_set || cufwurlfserverstatus.is_set || cufwurlfserverreqsnumprocessed.is_set || cufwurlfserverreqsnumallowed.is_set || cufwurlfserverreqsnumdenied.is_set || cufwurlfservernumtimeouts.is_set || cufwurlfservernumretries.is_set || cufwurlfserverrespsnumreceived.is_set || cufwurlfserverrespsnumlate.is_set || cufwurlfserveravgresptime1.is_set || cufwurlfserveravgresptime5.is_set; } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::has_operation() const { return is_set(yfilter) || ydk::is_set(cufwurlfserveraddrtype.yfilter) || ydk::is_set(cufwurlfserveraddress.yfilter) || ydk::is_set(cufwurlfserverport.yfilter) || ydk::is_set(cufwurlfservervendor.yfilter) || ydk::is_set(cufwurlfserverstatus.yfilter) || ydk::is_set(cufwurlfserverreqsnumprocessed.yfilter) || ydk::is_set(cufwurlfserverreqsnumallowed.yfilter) || ydk::is_set(cufwurlfserverreqsnumdenied.yfilter) || ydk::is_set(cufwurlfservernumtimeouts.yfilter) || ydk::is_set(cufwurlfservernumretries.yfilter) || ydk::is_set(cufwurlfserverrespsnumreceived.yfilter) || ydk::is_set(cufwurlfserverrespsnumlate.yfilter) || ydk::is_set(cufwurlfserveravgresptime1.yfilter) || ydk::is_set(cufwurlfserveravgresptime5.yfilter); } std::string CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::get_absolute_path() const { std::ostringstream path_buffer; path_buffer << "CISCO-UNIFIED-FIREWALL-MIB:CISCO-UNIFIED-FIREWALL-MIB/cufwUrlfServerTable/" << get_segment_path(); return path_buffer.str(); } std::string CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::get_segment_path() const { std::ostringstream path_buffer; path_buffer << "cufwUrlfServerEntry"; ADD_KEY_TOKEN(cufwurlfserveraddrtype, "cufwUrlfServerAddrType"); ADD_KEY_TOKEN(cufwurlfserveraddress, "cufwUrlfServerAddress"); ADD_KEY_TOKEN(cufwurlfserverport, "cufwUrlfServerPort"); return path_buffer.str(); } std::vector<std::pair<std::string, LeafData> > CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::get_name_leaf_data() const { std::vector<std::pair<std::string, LeafData> > leaf_name_data {}; if (cufwurlfserveraddrtype.is_set || is_set(cufwurlfserveraddrtype.yfilter)) leaf_name_data.push_back(cufwurlfserveraddrtype.get_name_leafdata()); if (cufwurlfserveraddress.is_set || is_set(cufwurlfserveraddress.yfilter)) leaf_name_data.push_back(cufwurlfserveraddress.get_name_leafdata()); if (cufwurlfserverport.is_set || is_set(cufwurlfserverport.yfilter)) leaf_name_data.push_back(cufwurlfserverport.get_name_leafdata()); if (cufwurlfservervendor.is_set || is_set(cufwurlfservervendor.yfilter)) leaf_name_data.push_back(cufwurlfservervendor.get_name_leafdata()); if (cufwurlfserverstatus.is_set || is_set(cufwurlfserverstatus.yfilter)) leaf_name_data.push_back(cufwurlfserverstatus.get_name_leafdata()); if (cufwurlfserverreqsnumprocessed.is_set || is_set(cufwurlfserverreqsnumprocessed.yfilter)) leaf_name_data.push_back(cufwurlfserverreqsnumprocessed.get_name_leafdata()); if (cufwurlfserverreqsnumallowed.is_set || is_set(cufwurlfserverreqsnumallowed.yfilter)) leaf_name_data.push_back(cufwurlfserverreqsnumallowed.get_name_leafdata()); if (cufwurlfserverreqsnumdenied.is_set || is_set(cufwurlfserverreqsnumdenied.yfilter)) leaf_name_data.push_back(cufwurlfserverreqsnumdenied.get_name_leafdata()); if (cufwurlfservernumtimeouts.is_set || is_set(cufwurlfservernumtimeouts.yfilter)) leaf_name_data.push_back(cufwurlfservernumtimeouts.get_name_leafdata()); if (cufwurlfservernumretries.is_set || is_set(cufwurlfservernumretries.yfilter)) leaf_name_data.push_back(cufwurlfservernumretries.get_name_leafdata()); if (cufwurlfserverrespsnumreceived.is_set || is_set(cufwurlfserverrespsnumreceived.yfilter)) leaf_name_data.push_back(cufwurlfserverrespsnumreceived.get_name_leafdata()); if (cufwurlfserverrespsnumlate.is_set || is_set(cufwurlfserverrespsnumlate.yfilter)) leaf_name_data.push_back(cufwurlfserverrespsnumlate.get_name_leafdata()); if (cufwurlfserveravgresptime1.is_set || is_set(cufwurlfserveravgresptime1.yfilter)) leaf_name_data.push_back(cufwurlfserveravgresptime1.get_name_leafdata()); if (cufwurlfserveravgresptime5.is_set || is_set(cufwurlfserveravgresptime5.yfilter)) leaf_name_data.push_back(cufwurlfserveravgresptime5.get_name_leafdata()); return leaf_name_data; } std::shared_ptr<ydk::Entity> CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::get_child_by_name(const std::string & child_yang_name, const std::string & segment_path) { return nullptr; } std::map<std::string, std::shared_ptr<ydk::Entity>> CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::get_children() const { std::map<std::string, std::shared_ptr<ydk::Entity>> _children{}; char count_=0; return _children; } void CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::set_value(const std::string & value_path, const std::string & value, const std::string & name_space, const std::string & name_space_prefix) { if(value_path == "cufwUrlfServerAddrType") { cufwurlfserveraddrtype = value; cufwurlfserveraddrtype.value_namespace = name_space; cufwurlfserveraddrtype.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerAddress") { cufwurlfserveraddress = value; cufwurlfserveraddress.value_namespace = name_space; cufwurlfserveraddress.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerPort") { cufwurlfserverport = value; cufwurlfserverport.value_namespace = name_space; cufwurlfserverport.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerVendor") { cufwurlfservervendor = value; cufwurlfservervendor.value_namespace = name_space; cufwurlfservervendor.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerStatus") { cufwurlfserverstatus = value; cufwurlfserverstatus.value_namespace = name_space; cufwurlfserverstatus.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerReqsNumProcessed") { cufwurlfserverreqsnumprocessed = value; cufwurlfserverreqsnumprocessed.value_namespace = name_space; cufwurlfserverreqsnumprocessed.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerReqsNumAllowed") { cufwurlfserverreqsnumallowed = value; cufwurlfserverreqsnumallowed.value_namespace = name_space; cufwurlfserverreqsnumallowed.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerReqsNumDenied") { cufwurlfserverreqsnumdenied = value; cufwurlfserverreqsnumdenied.value_namespace = name_space; cufwurlfserverreqsnumdenied.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerNumTimeouts") { cufwurlfservernumtimeouts = value; cufwurlfservernumtimeouts.value_namespace = name_space; cufwurlfservernumtimeouts.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerNumRetries") { cufwurlfservernumretries = value; cufwurlfservernumretries.value_namespace = name_space; cufwurlfservernumretries.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerRespsNumReceived") { cufwurlfserverrespsnumreceived = value; cufwurlfserverrespsnumreceived.value_namespace = name_space; cufwurlfserverrespsnumreceived.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerRespsNumLate") { cufwurlfserverrespsnumlate = value; cufwurlfserverrespsnumlate.value_namespace = name_space; cufwurlfserverrespsnumlate.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerAvgRespTime1") { cufwurlfserveravgresptime1 = value; cufwurlfserveravgresptime1.value_namespace = name_space; cufwurlfserveravgresptime1.value_namespace_prefix = name_space_prefix; } if(value_path == "cufwUrlfServerAvgRespTime5") { cufwurlfserveravgresptime5 = value; cufwurlfserveravgresptime5.value_namespace = name_space; cufwurlfserveravgresptime5.value_namespace_prefix = name_space_prefix; } } void CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::set_filter(const std::string & value_path, YFilter yfilter) { if(value_path == "cufwUrlfServerAddrType") { cufwurlfserveraddrtype.yfilter = yfilter; } if(value_path == "cufwUrlfServerAddress") { cufwurlfserveraddress.yfilter = yfilter; } if(value_path == "cufwUrlfServerPort") { cufwurlfserverport.yfilter = yfilter; } if(value_path == "cufwUrlfServerVendor") { cufwurlfservervendor.yfilter = yfilter; } if(value_path == "cufwUrlfServerStatus") { cufwurlfserverstatus.yfilter = yfilter; } if(value_path == "cufwUrlfServerReqsNumProcessed") { cufwurlfserverreqsnumprocessed.yfilter = yfilter; } if(value_path == "cufwUrlfServerReqsNumAllowed") { cufwurlfserverreqsnumallowed.yfilter = yfilter; } if(value_path == "cufwUrlfServerReqsNumDenied") { cufwurlfserverreqsnumdenied.yfilter = yfilter; } if(value_path == "cufwUrlfServerNumTimeouts") { cufwurlfservernumtimeouts.yfilter = yfilter; } if(value_path == "cufwUrlfServerNumRetries") { cufwurlfservernumretries.yfilter = yfilter; } if(value_path == "cufwUrlfServerRespsNumReceived") { cufwurlfserverrespsnumreceived.yfilter = yfilter; } if(value_path == "cufwUrlfServerRespsNumLate") { cufwurlfserverrespsnumlate.yfilter = yfilter; } if(value_path == "cufwUrlfServerAvgRespTime1") { cufwurlfserveravgresptime1.yfilter = yfilter; } if(value_path == "cufwUrlfServerAvgRespTime5") { cufwurlfserveravgresptime5.yfilter = yfilter; } } bool CISCOUNIFIEDFIREWALLMIB::CufwUrlfServerTable::CufwUrlfServerEntry::has_leaf_or_child_of_name(const std::string & name) const { if(name == "cufwUrlfServerAddrType" || name == "cufwUrlfServerAddress" || name == "cufwUrlfServerPort" || name == "cufwUrlfServerVendor" || name == "cufwUrlfServerStatus" || name == "cufwUrlfServerReqsNumProcessed" || name == "cufwUrlfServerReqsNumAllowed" || name == "cufwUrlfServerReqsNumDenied" || name == "cufwUrlfServerNumTimeouts" || name == "cufwUrlfServerNumRetries" || name == "cufwUrlfServerRespsNumReceived" || name == "cufwUrlfServerRespsNumLate" || name == "cufwUrlfServerAvgRespTime1" || name == "cufwUrlfServerAvgRespTime5") return true; return false; } } }
41.396731
786
0.761224
CiscoDevNet
791a8085867aca9e5606d061a6769ac8bb911637
2,066
cpp
C++
Tropelet.cpp
mls-m5/NoMaintenance
c54c702b658c6a3abe36ff2d175b5c923d4ca55f
[ "Apache-2.0" ]
null
null
null
Tropelet.cpp
mls-m5/NoMaintenance
c54c702b658c6a3abe36ff2d175b5c923d4ca55f
[ "Apache-2.0" ]
null
null
null
Tropelet.cpp
mls-m5/NoMaintenance
c54c702b658c6a3abe36ff2d175b5c923d4ca55f
[ "Apache-2.0" ]
null
null
null
/* * Tropelet.cpp * * Created on: 6 feb 2013 * Author: mattias */ #include "Tropelet.h" #include "Screen.h" struct Position{ double X, Y; }; Tropelet::Tropelet() { // TODO Auto-generated constructor stub } Tropelet::~Tropelet() { // TODO Auto-generated destructor stub } void Tropelet::Fire(double X, double Y, double XAim, double YAim, int Turn, bool isFire){ if (!isFire) { return;;} if (MyPlayer->getItem(1) < 20 || MyPlayer->getItem(2) < 220) { return;;} MyPlayer->setItem (1, 0); MyPlayer->CalcItem(2, -250); long i; Position Speed; Position Pos; long HitPlayer; Speed.X = XAim / 10 * Turn; Speed.Y = YAim / 10; Pos.X = X + XAim / 3 * Turn; Pos.Y = Y + YAim / 3; for(i = 0; i <= 30; ++i){ Pos.X = Pos.X + Speed.X; Pos.Y = Pos.Y + Speed.Y; HitPlayer = FrmScreen.isPlayer((Pos.X), (Pos.Y)); if (FrmScreen.GetMap((Pos.X), (Pos.Y)) || HitPlayer) { break;} FrmScreen.MakeSmoke(Pos.X, Pos.Y, 0, -3, 1); } PlaySound(dsFire4); if (i == 31) { return;;} Pos.X = Pos.X - Speed.X; Pos.Y = Pos.Y - Speed.Y; if (HitPlayer) { MakeWarp (HitPlayer - 1); FrmScreen.HitPlayer(HitPlayer- 1, 20); }else{ FrmScreen.DrawCircleToMap((Pos.X), (Pos.Y), 30, mAir); } } void Tropelet::MakeWarp(long Player){ long i; long X; long Y; long MapX; long MapY; auto PlayerToWarp = frmScreen.getPlayer(Player); MapX = frmScreen.GetMapWidth(); MapY = frmScreen.GetMapHeight(); FrmScreen.MakeSmoke(PlayerToWarp->XPos, PlayerToWarp->YPos, -3, 0, 1); FrmScreen.MakeSmoke(PlayerToWarp->XPos, PlayerToWarp->YPos, 3, 0, 1); for(i = 0; i <= 1000; ++i){ X = (MapX - 20) * Rnd() + 10; Y = (MapY - 20) * Rnd() + 10; if (FrmScreen.GetMap(X, Y) == mAir) { break;} } PlayerToWarp->XPos = X; PlayerToWarp->YPos = Y; FrmScreen.MakeSmoke(PlayerToWarp->XPos, PlayerToWarp->YPos, -3, 0, 1); FrmScreen.MakeSmoke(PlayerToWarp->XPos, PlayerToWarp->YPos, 3, 0, 1); }
29.098592
89
0.580348
mls-m5
791d3950b76d2178ea875ff6285ee47bc895dd2c
3,959
cpp
C++
source/net/tcp/sockettcpserver.cpp
lwIoT/lwIoT
07d2a3ba962aef508911e453268427b006c57701
[ "Apache-2.0" ]
1
2019-07-05T21:39:23.000Z
2019-07-05T21:39:23.000Z
source/net/tcp/sockettcpserver.cpp
lwIoT/lwiot-core
07d2a3ba962aef508911e453268427b006c57701
[ "Apache-2.0" ]
null
null
null
source/net/tcp/sockettcpserver.cpp
lwIoT/lwiot-core
07d2a3ba962aef508911e453268427b006c57701
[ "Apache-2.0" ]
null
null
null
/* * TCP server wrapper * * @author Michel Megens * @email dev@bietje.net */ #include <stdlib.h> #include <stdio.h> #include <lwiot.h> #include <lwiot/types.h> #include <lwiot/log.h> #include <lwiot/error.h> #include <lwiot/stl/string.h> #include <lwiot/stream.h> #include <lwiot/network/ipaddress.h> #include <lwiot/network/sockettcpclient.h> #include <lwiot/network/sockettcpserver.h> #if !defined(HAVE_LWIP) && !defined(WIN32) #include <sys/ioctl.h> #include <sys/socket.h> #include <unistd.h> #endif extern "C" { #include "lwiot/network/dns.h" } namespace lwiot { SocketTcpServer::SocketTcpServer() : TcpServer() { this->_socket = server_socket_create(SOCKET_STREAM, false); } SocketTcpServer::SocketTcpServer(BindAddress addr, uint16_t port) : TcpServer(IPAddress::fromBindAddress(addr), port) { this->_socket = server_socket_create(SOCKET_STREAM, this->_bind_addr.isIPv6()); } SocketTcpServer::SocketTcpServer(SocketTcpServer &&other) noexcept : TcpServer(other._bind_addr, other._bind_port), _socket(other._socket) { other._socket = nullptr; } SocketTcpServer::SocketTcpServer(const lwiot::IPAddress &addr, uint16_t port) : TcpServer(addr, port) { this->_socket = server_socket_create(SOCKET_STREAM, this->_bind_addr.isIPv6()); } SocketTcpServer::~SocketTcpServer() { if(this->_socket != nullptr) this->close(); } SocketTcpServer& SocketTcpServer::operator=(lwiot::SocketTcpServer &&other) noexcept { this->_bind_addr = other._bind_addr; this->_bind_port = other._bind_port; this->_socket = other._socket; other._socket = nullptr; return *this; } SocketTcpServer& SocketTcpServer::operator=(const lwiot::SocketTcpServer &server) { if(server._socket == this->_socket) return *this; this->close(); this->bind(); return *this; } void SocketTcpServer::connect() { if(this->_socket) this->close(); this->_socket = server_socket_create(SOCKET_STREAM, this->address().isIPv6()); } bool SocketTcpServer::operator==(const lwiot::SocketTcpServer &other) { return this->_socket == other._socket; } bool SocketTcpServer::operator!=(const lwiot::SocketTcpServer &other) { return this->_socket != other._socket; } void SocketTcpServer::close() { if(this->_socket == nullptr) return; socket_close(this->_socket); this->_socket = nullptr; } /*bool SocketTcpServer::bind(const lwiot::IPAddress &addr, uint16_t port) { this->_bind_port = port; this->_bind_addr = addr; if(this->_socket == nullptr) this->connect(); return this->bind(); }*/ void SocketTcpServer::setTimeout(time_t seconds) { socket_set_timeout(this->_socket, seconds); } bool SocketTcpServer::bind(BindAddress addr, uint16_t port) { return this->bind(IPAddress::fromBindAddress(addr), port); } bool SocketTcpServer::bind(const lwiot::IPAddress &addr, uint16_t port) { TcpServer::bind(addr, port); if(this->_socket == nullptr) this->connect(); return this->bind(); } bool SocketTcpServer::bind() const { bool rv; remote_addr_t remote; if(this->_socket == nullptr) { print_dbg("Invalid socket descriptor, unable to bind!\n"); return false; } this->_bind_addr.toRemoteAddress(remote); rv = server_socket_bind_to(this->_socket, &remote, this->_bind_port); if(!rv) { print_dbg("Unable to bind TCP server socket!\n"); return false; } rv = server_socket_listen(this->_socket); if(!rv) { print_dbg("Unable to accept client sockets!\n"); return false; } print_dbg("Server binded!\n"); return true; } UniquePointer<TcpClient> SocketTcpServer::accept() { auto socket = server_socket_accept(this->_socket); auto client = new SocketTcpClient(socket); UniquePointer<TcpClient> wrapped(client); return wrapped; } }
22.241573
119
0.675423
lwIoT
791f9f712e7bfca11b7601af6cfffbcd9ae19c64
3,784
hpp
C++
include/navigation.hpp
maarufvazifdar/shamazon_robot
ffdbacf649dcac604e5366e9ac8ae3b519b9599d
[ "BSD-3-Clause" ]
null
null
null
include/navigation.hpp
maarufvazifdar/shamazon_robot
ffdbacf649dcac604e5366e9ac8ae3b519b9599d
[ "BSD-3-Clause" ]
1
2021-12-13T21:15:09.000Z
2021-12-13T21:15:09.000Z
include/navigation.hpp
maarufvazifdar/shamazon_robot
ffdbacf649dcac604e5366e9ac8ae3b519b9599d
[ "BSD-3-Clause" ]
8
2021-11-28T00:00:03.000Z
2021-12-13T18:59:55.000Z
/** * BSD-3 Clause * * Copyright (c) 2021 Maaruf Vazifdar, Maitreya Kulkarni, Pratik Bhujnbal * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * @file navigation.hpp * @author Maaruf Vazifdar * @author Maitreya Kulkarni * @author Pratik Bhujnbal * @brief Class to hold robot's navigation related attributes and members. * @version 1.0 * @date 11/26/2021 * @copyright Copyright (c) 2021 * */ #include<ros/ros.h> #include<nav_msgs/Odometry.h> #include<move_base_msgs/MoveBaseAction.h> #include<actionlib/client/simple_action_client.h> #include <tf/tf.h> #include <vector> #include "nav_msgs/OccupancyGrid.h" #pragma once /** * @brief Class to hold robot's navigation related attributes and members. */ class Navigation { public: // ros::init(argc, argv,"shamazon_robot"); ros::NodeHandle nh; std::vector<double> pickup_goal = { 3.4, 3.4, -2 }; std::vector<std::vector<double>> delivery_goal = { { 7.5, 0, 1.57 }, { 7.5, 0, 1.57 } }; /** * @brief Constrctor of Class Navigation to initialize attributes. */ Navigation() { _goal_status = true; current_position_x; current_position_y; ros::Subscriber sub = nh.subscribe < nav_msgs::OccupancyGrid > ("/multimap_server/maps/level_2/localization/map", 1, &Navigation::mapCallback, this); } /** * @brief Destructor of class Navigation. */ ~Navigation() { } /** * @brief Callback for current robot's pose. * @param const nav_msgs::Odometry::ConstPtr &msg - Robot odometry data. * @return void */ void PoseCallback(const nav_msgs::Odometry::ConstPtr &msg); /** * @brief Send desired goal to move_base action server. * @param const nav_msgs::Odometry::ConstPtr &msg. * @return void */ void sendGoalsToActionServer(float goal_x, float goal_y, float goal_theta); /** * @brief Command package feed conveyor to drop package on the robot. * @param void * @return true - package feed conveyor status. */ bool activateConveyor(); /** * @brief Command robot's conveyor to drop package on the delivery location. * @param void * @return true - robot's conveyor status. */ bool activateRobotConveyor(); /** * @brief Update global map in the map server. * @param none. * @return void */ void mapCallback(nav_msgs::OccupancyGrid msg); void updateGlobalMap(); private: /** * Class local variables. */ bool _goal_status; double current_position_x; double current_position_y; double current_quat[3]; typedef actionlib::SimpleActionClient <move_base_msgs::MoveBaseAction> _move_base_client; move_base_msgs::MoveBaseGoal _goal; nav_msgs::Odometry _robot_pose; nav_msgs::OccupancyGrid map; };
29.795276
80
0.701903
maarufvazifdar
7920a3179398f183c0a1fd5e77ff82528aa06912
2,355
cpp
C++
PhysicsSandbox/SandboxGeometry/Shapes2d/SatShape2d.cpp
jodavis42/PhysicsSandbox
3119caaa77721041440cdc1b3cf96d4bd9e2d98b
[ "MIT" ]
1
2022-03-26T21:08:19.000Z
2022-03-26T21:08:19.000Z
PhysicsSandbox/SandboxGeometry/Shapes2d/SatShape2d.cpp
jodavis42/PhysicsSandbox
3119caaa77721041440cdc1b3cf96d4bd9e2d98b
[ "MIT" ]
null
null
null
PhysicsSandbox/SandboxGeometry/Shapes2d/SatShape2d.cpp
jodavis42/PhysicsSandbox
3119caaa77721041440cdc1b3cf96d4bd9e2d98b
[ "MIT" ]
null
null
null
#include "Precompiled.hpp" #include "SatShape2d.hpp" #include "SandboxGeometry/Shapes2d/Line2d.hpp" namespace SandboxGeometry { //-------------------------------------------------------------------SatShape2d size_t SatShape2d::PointCount() const { return mPoints.Size(); } size_t SatShape2d::EdgeCount() const { return PointCount(); } size_t SatShape2d::FaceCount() const { return EdgeCount(); } Vector2 SatShape2d::GetPoint(size_t index) const { return mPoints[index]; } Line2d SatShape2d::GetEdge(size_t index) const { size_t index0 = index; size_t index1 = (index + 1) % PointCount(); Line2d result; result.mPoints[0] = GetPoint(index0); result.mPoints[1] = GetPoint(index1); return result; } Vector2 SatShape2d::GetNormal(size_t index) const { Line2d line = GetEdge(index); Vector2 edge = line.mPoints[1] - line.mPoints[0]; Vector2 normal = Vector2(edge.y, -edge.x); return Math::Normalized(normal); } SatShape2d::Face SatShape2d::GetFace(size_t index) const { Line2d edge = GetEdge(index); Face result; result.mPoints[0] = edge.mPoints[0]; result.mPoints[1] = edge.mPoints[1]; result.mEdge = result.mPoints[1] - result.mPoints[0]; result.mNormal = Math::Normalized(Vector2(result.mEdge.y, -result.mEdge.x)); return result; } Vector2 SatShape2d::Search(const Vector2& direction) const { float maxDistance = -Math::PositiveMax(); size_t maxIndex = 0; for(size_t i = 0; i < PointCount(); ++i) { Vector2 point = GetPoint(i); float distance = Math::Dot(direction, point); if(distance > maxDistance) { maxDistance = distance; maxIndex = i; } } return GetPoint(maxIndex); } void BuildObbSatShape2d(const Vector2& obbCenter, const Matrix2& obbRotation, const Vector2& obbHalfExtents, SatShape2d& shape) { shape.mPoints.Resize(4); shape.mPoints[0] = obbCenter + obbRotation.GetBasis(0) * obbHalfExtents[0] + obbRotation.GetBasis(1) * obbHalfExtents[1]; shape.mPoints[1] = obbCenter - obbRotation.GetBasis(0) * obbHalfExtents[0] + obbRotation.GetBasis(1) * obbHalfExtents[1]; shape.mPoints[2] = obbCenter - obbRotation.GetBasis(0) * obbHalfExtents[0] - obbRotation.GetBasis(1) * obbHalfExtents[1]; shape.mPoints[3] = obbCenter + obbRotation.GetBasis(0) * obbHalfExtents[0] - obbRotation.GetBasis(1) * obbHalfExtents[1]; } }//namespace SandboxGeometry
27.068966
127
0.693418
jodavis42
792286095a28e6b42b9bd4b8b9efe1c808a9d413
6,038
cpp
C++
LibXDK/src/_BaseXValue.cpp
sim9108/SDKS
2823124fa0a22f8a77d131e7a2fb7f4aba59129c
[ "MIT" ]
2
2015-03-23T01:08:49.000Z
2015-03-23T02:28:17.000Z
LibXDK/src/_BaseXValue.cpp
sim9108/SDKS
2823124fa0a22f8a77d131e7a2fb7f4aba59129c
[ "MIT" ]
null
null
null
LibXDK/src/_BaseXValue.cpp
sim9108/SDKS
2823124fa0a22f8a77d131e7a2fb7f4aba59129c
[ "MIT" ]
null
null
null
#include <LibXtra/_BaseXValue.h> _BaseXValue::_BaseXValue(_MOAFactory* mobj, const char* title) :refcnt_(1), moa_obj_{ mobj }, utils_{ moa_obj_ }, xtra_name_{ title } { this->moa_obj_->AddRef(); ++DllgXtraInterfaceCount; } _BaseXValue::~_BaseXValue(void) { this->moa_obj_->Release(); --DllgXtraInterfaceCount; } HRESULT __stdcall _BaseXValue::QueryInterface(ConstPMoaInterfaceID pInterfaceID, PPMoaVoid ppv) { if (*pInterfaceID == IID_IMoaMmXValue){ this->AddRef(); *ppv = (IMoaMmXValue*)this; return S_OK; } if(*pInterfaceID==IID_IMoaUnknown){ this->AddRef(); *ppv =(IMoaUnknown*)this; return S_OK; } return E_NOINTERFACE; } MoaUlong __stdcall _BaseXValue::AddRef() { return InterlockedIncrement(&this->refcnt_); } MoaUlong __stdcall _BaseXValue::Release() { MoaUlong result; result = InterlockedDecrement(&this->refcnt_); if (!result) delete this; return result; } HRESULT __stdcall _BaseXValue::SetData(PMoaVoid pDataum){ return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::GetPropCount(MoaLong* pCount){ *pCount = 0; return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::GetPropDescriptionByIndex(MoaLong index, PMoaMmValueDescription pDescription){ return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::GetCount(MoaMmSymbol propName, MoaLong* pCount){ *pCount = 0; return kMoaMmErr_PropertyNotFound; } ///!!!! HRESULT __stdcall _BaseXValue::GetProp(ConstPMoaMmValue selfRef, MoaMmSymbol propName, MoaLong indexCount, ConstPMoaMmValue pIndexValues, PMoaMmValue pResult){ return kMoaMmErr_PropertyNotFound; } HRESULT __stdcall _BaseXValue::SetProp(MoaMmSymbol propName, MoaLong indexCount, ConstPMoaMmValue pIndexValues, ConstPMoaMmValue pNewValue){ return kMoaMmErr_PropertyNotFound; } ////!!!!!! //!!!! important !!! HRESULT __stdcall _BaseXValue::AccessPropRef(ConstPMoaMmValue selfRef, MoaMmSymbol propName, MoaLong indexCount, ConstPMoaMmValue pIndexValues, PMoaMmValue pResult){ return this->GetProp(selfRef, propName, indexCount, pIndexValues, pResult); } HRESULT __stdcall _BaseXValue::GetContents(ConstPMoaMmValue selfRef, PMoaMmValue pResult){ return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::SetContents(PMoaMmValue pNewValue){ return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::SetContentsBefore(PMoaMmValue pNewValue){ return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::SetContentsAfter(PMoaMmValue pNewValue){ return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::Ilk(PMoaMmValue pArgument, PMoaMmValue pResult){ return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::StringRep(PMoaMmValue pStringVal){ std::stringstream ss; ss << "<Xtra child \"" << xtra_name_ <<"\" 0x"<<std::hex<<(void*) this << ">"; this->utils_.write_string(ss, *pStringVal); return kMoaErr_NoErr; } HRESULT __stdcall _BaseXValue::SymbolRep(PMoaMmSymbol pSymbol){ *pSymbol = this->utils_.make_symbol(xtra_name_); return kMoaErr_NoErr; } HRESULT __stdcall _BaseXValue::IntegerRep(PMoaLong pIntVal){ *pIntVal = 0; return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::StreamOut(PIMoaStream2 pStream){ return kMoaMmErr_AccessNotSupported; } HRESULT __stdcall _BaseXValue::StreamIn(PIMoaStream2 pStream){ return kMoaMmErr_AccessNotSupported; } //ImageCrop ImageCrop::ImageCrop(ImageLock& org_image, RECT& roi_rect, RECT& intersect_rect) :org_image_{ org_image }, roi_rect_( roi_rect ), intersect_rect_(intersect_rect) { width_ = roi_rect_.right - roi_rect_.left + 1; height_ = roi_rect_.bottom - roi_rect_.top + 1; } const RECT& ImageCrop::intersect_rect() const{ return this->intersect_rect_; } MoaLong ImageCrop::width() const{ return this->width_; } MoaLong ImageCrop::height() const{ return this->height_; } // ImageLock ImageLock::ImageLock(_BaseXValue& mobj, MoaMmValue& mv) :mobj_(mobj), ready_{false} { auto mtype = mobj.utils_.is_type(mv); if (kMoaMmValueType_Other != mtype) return; ready_ = true; this->mv_ = mv; this->raw_update_info(); this->mobj_.utils_.LockPixels(&this->mv_, (PMoaVoid*)&this->data_); } ImageLock::ImageLock(_BaseXValue& mobj, MoaMmCallInfo& callPtr, int idx) :mobj_(mobj), ready_{ false } { auto mtype = mobj.utils_.is_type(callPtr, idx); if (kMoaMmValueType_Other != mtype) return; ready_ = true; this->mv_ = this->mobj_.utils_.get_index(callPtr, idx); this->raw_update_info(); this->mobj_.utils_.LockPixels(&this->mv_, (PMoaVoid*)&this->data_); } void ImageLock::raw_update_info(){ MoaMmImageInfo info; mobj_.utils_.GetImageInfo(&this->mv_, &info); this->width_ = info.iWidth; this->height_ = info.iHeight; this->image_row_bytes_ = info.iRowBytes; this->pitch_bytes_ = info.iRowBytes; this->pixel_bytes_ = info.iTotalDepth / 8; this->alpha_pixel_bytes_ = info.iAlphaDepth / 8; } ImageCrop ImageLock::get_crop(RECT& rect){ RECT full_rect = { 0, 0, this->width() - 1, this->height() - 1 }; RECT intersect_rect; ::IntersectRect(&intersect_rect, &full_rect, &rect); intersect_rect.left -= rect.left; intersect_rect.right -= rect.left; intersect_rect.top -= rect.top; intersect_rect.bottom -= rect.top; return ImageCrop(*this, rect, intersect_rect); } ImageLock::operator ImageCrop(){ RECT full_rect = { 0, 0, this->width() - 1, this->height() - 1 }; return this->get_crop(full_rect); } ImageLock::~ImageLock(){ this->reset(); } void ImageLock::reset(){ if (!ready_) return; this->mobj_.utils_.UnlockPixels(&this->mv_); ready_ = false; this->data_ = nullptr; width_ = height_ = image_row_bytes_ = pitch_bytes_ = pixel_bytes_ = alpha_pixel_bytes_ = 0; } BYTE* ImageLock::data() const{ return this->data_; } MoaLong ImageLock::width() const{ return this->width_; } MoaLong ImageLock::height() const { return this->height_; } MoaLong ImageLock::total_depth() const{ return this->pixel_bytes_; } MoaLong ImageLock::row_bytes() const{ return this->image_row_bytes_; }
22.784906
147
0.753395
sim9108
79237159bf0cf8b68cf304d0e5157ebb636176e3
5,753
cpp
C++
android/android_9/frameworks/native/opengl/libs/EGL/FileBlobCache.cpp
yakuizhao/intel-vaapi-driver
b2bb0383352694941826543a171b557efac2219b
[ "MIT" ]
null
null
null
android/android_9/frameworks/native/opengl/libs/EGL/FileBlobCache.cpp
yakuizhao/intel-vaapi-driver
b2bb0383352694941826543a171b557efac2219b
[ "MIT" ]
null
null
null
android/android_9/frameworks/native/opengl/libs/EGL/FileBlobCache.cpp
yakuizhao/intel-vaapi-driver
b2bb0383352694941826543a171b557efac2219b
[ "MIT" ]
null
null
null
/* ** Copyright 2017, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** ** http://www.apache.org/licenses/LICENSE-2.0 ** ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License. */ #include "FileBlobCache.h" #include <errno.h> #include <inttypes.h> #include <log/log.h> #include <sys/mman.h> #include <sys/stat.h> // Cache file header static const char* cacheFileMagic = "EGL$"; static const size_t cacheFileHeaderSize = 8; namespace android { static uint32_t crc32c(const uint8_t* buf, size_t len) { const uint32_t polyBits = 0x82F63B78; uint32_t r = 0; for (size_t i = 0; i < len; i++) { r ^= buf[i]; for (int j = 0; j < 8; j++) { if (r & 1) { r = (r >> 1) ^ polyBits; } else { r >>= 1; } } } return r; } FileBlobCache::FileBlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize, const std::string& filename) : BlobCache(maxKeySize, maxValueSize, maxTotalSize) , mFilename(filename) { if (mFilename.length() > 0) { size_t headerSize = cacheFileHeaderSize; int fd = open(mFilename.c_str(), O_RDONLY, 0); if (fd == -1) { if (errno != ENOENT) { ALOGE("error opening cache file %s: %s (%d)", mFilename.c_str(), strerror(errno), errno); } return; } struct stat statBuf; if (fstat(fd, &statBuf) == -1) { ALOGE("error stat'ing cache file: %s (%d)", strerror(errno), errno); close(fd); return; } // Sanity check the size before trying to mmap it. size_t fileSize = statBuf.st_size; if (fileSize > mMaxTotalSize * 2) { ALOGE("cache file is too large: %#" PRIx64, static_cast<off64_t>(statBuf.st_size)); close(fd); return; } uint8_t* buf = reinterpret_cast<uint8_t*>(mmap(NULL, fileSize, PROT_READ, MAP_PRIVATE, fd, 0)); if (buf == MAP_FAILED) { ALOGE("error mmaping cache file: %s (%d)", strerror(errno), errno); close(fd); return; } // Check the file magic and CRC size_t cacheSize = fileSize - headerSize; if (memcmp(buf, cacheFileMagic, 4) != 0) { ALOGE("cache file has bad mojo"); close(fd); return; } uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4); if (crc32c(buf + headerSize, cacheSize) != *crc) { ALOGE("cache file failed CRC check"); close(fd); return; } int err = unflatten(buf + headerSize, cacheSize); if (err < 0) { ALOGE("error reading cache contents: %s (%d)", strerror(-err), -err); munmap(buf, fileSize); close(fd); return; } munmap(buf, fileSize); close(fd); } } void FileBlobCache::writeToFile() { if (mFilename.length() > 0) { size_t cacheSize = getFlattenedSize(); size_t headerSize = cacheFileHeaderSize; const char* fname = mFilename.c_str(); // Try to create the file with no permissions so we can write it // without anyone trying to read it. int fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0); if (fd == -1) { if (errno == EEXIST) { // The file exists, delete it and try again. if (unlink(fname) == -1) { // No point in retrying if the unlink failed. ALOGE("error unlinking cache file %s: %s (%d)", fname, strerror(errno), errno); return; } // Retry now that we've unlinked the file. fd = open(fname, O_CREAT | O_EXCL | O_RDWR, 0); } if (fd == -1) { ALOGE("error creating cache file %s: %s (%d)", fname, strerror(errno), errno); return; } } size_t fileSize = headerSize + cacheSize; uint8_t* buf = new uint8_t [fileSize]; if (!buf) { ALOGE("error allocating buffer for cache contents: %s (%d)", strerror(errno), errno); close(fd); unlink(fname); return; } int err = flatten(buf + headerSize, cacheSize); if (err < 0) { ALOGE("error writing cache contents: %s (%d)", strerror(-err), -err); delete [] buf; close(fd); unlink(fname); return; } // Write the file magic and CRC memcpy(buf, cacheFileMagic, 4); uint32_t* crc = reinterpret_cast<uint32_t*>(buf + 4); *crc = crc32c(buf + headerSize, cacheSize); if (write(fd, buf, fileSize) == -1) { ALOGE("error writing cache file: %s (%d)", strerror(errno), errno); delete [] buf; close(fd); unlink(fname); return; } delete [] buf; fchmod(fd, S_IRUSR); close(fd); } } }
30.764706
89
0.51434
yakuizhao
7924f71f624649dd618883c3138e8cfb96b4f59d
6,030
cpp
C++
lib/Analysis/Memory/BitMemoryTrait.cpp
yukatan1701/tsar
a6f95cdaeb117ccd5fcb775b471b1aa17c45f4e8
[ "Apache-2.0" ]
14
2019-11-04T15:03:40.000Z
2021-09-07T17:29:40.000Z
lib/Analysis/Memory/BitMemoryTrait.cpp
yukatan1701/tsar
a6f95cdaeb117ccd5fcb775b471b1aa17c45f4e8
[ "Apache-2.0" ]
11
2019-11-29T21:18:12.000Z
2021-12-22T21:36:40.000Z
lib/Analysis/Memory/BitMemoryTrait.cpp
yukatan1701/tsar
a6f95cdaeb117ccd5fcb775b471b1aa17c45f4e8
[ "Apache-2.0" ]
17
2019-10-15T13:56:35.000Z
2021-10-20T17:21:14.000Z
//=== BitMemoryTrait.cpp Bitwise Representation of Memory Traits *- C++ -*===// // // Traits Static Analyzer (SAPFOR) // // Copyright 2018 DVM System Group // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //===----------------------------------------------------------------------===// // // This file implements bitwise representation of memory traits. // //===----------------------------------------------------------------------===// #include "BitMemoryTrait.h" using namespace tsar; BitMemoryTrait::BitMemoryTrait(const MemoryDescriptor &Dptr) : mId(NoAccess) { if (Dptr.is<trait::AddressAccess>()) mId &= AddressAccess; if (Dptr.is<trait::HeaderAccess>()) mId &= HeaderAccess; if (Dptr.is<trait::NoPromotedScalar>()) mId &= NoPromotedScalar; if (Dptr.is<trait::ExplicitAccess>()) mId &= ExplicitAccess; if (Dptr.is<trait::Redundant>()) mId &= Redundant; if (Dptr.is<trait::NoRedundant>()) mId &= NoRedundant; if (Dptr.is<trait::DirectAccess>()) mId &= DirectAccess; if (Dptr.is<trait::IndirectAccess>()) mId &= IndirectAccess; if (Dptr.is<trait::Lock>()) mId &= Lock; if (Dptr.is<trait::NoAccess>()) return; if (Dptr.is<trait::Flow>() || Dptr.is<trait::Anti>() || Dptr.is<trait::Output>()) { mId &= Dependency; } else if (Dptr.is<trait::Reduction>()) { mId &= Reduction; } else if (Dptr.is<trait::Induction>()) { mId &= Induction; } else if (Dptr.is<trait::Readonly>()) { mId &= Readonly; } else { auto SharedFlag = Dptr.is<trait::Shared>() ? SharedJoin : ~NoAccess; auto SharedTrait = Dptr.is<trait::Shared>() ? Shared : Dependency; if (Dptr.is<trait::Private>()) { mId &= Private | SharedFlag; } else { if (Dptr.is<trait::FirstPrivate>()) mId &= FirstPrivate | SharedFlag; if (Dptr.is<trait::LastPrivate>()) mId &= LastPrivate | SharedFlag; else if (Dptr.is<trait::SecondToLastPrivate>()) mId &= SecondToLastPrivate | SharedFlag; else if (Dptr.is<trait::DynamicPrivate>()) mId &= DynamicPrivate | SharedFlag; else if (!Dptr.is<trait::FirstPrivate>()) { mId &= SharedTrait; } } } } MemoryDescriptor BitMemoryTrait::toDescriptor(unsigned TraitNumber, MemoryStatistic &Stat) const { MemoryDescriptor Dptr; if (!(get() & ~AddressAccess)) { Dptr.set<trait::AddressAccess>(); Stat.get<trait::AddressAccess>() += TraitNumber; } if (!(get() & ~HeaderAccess)) { Dptr.set<trait::HeaderAccess>(); Stat.get<trait::HeaderAccess>() += TraitNumber; } if (!(get() & ~Lock)) { Dptr.set<trait::Lock>(); Stat.get<trait::Lock>() += TraitNumber; } if (!(get() & ~NoPromotedScalar)) { Dptr.set<trait::NoPromotedScalar>(); Stat.get<trait::NoPromotedScalar>() += TraitNumber; } if (!(get() & ~ExplicitAccess)) { Dptr.set<trait::ExplicitAccess>(); Stat.get<trait::ExplicitAccess>() += TraitNumber; } if (!(get() & ~Redundant)) { Dptr.set<trait::Redundant>(); Stat.get<trait::Redundant>() += TraitNumber; } if (!(get() & ~NoRedundant)) { Dptr.set<trait::NoRedundant>(); Stat.get<trait::NoRedundant>() += TraitNumber; } if (!(get() & ~DirectAccess)) { Dptr.set<trait::DirectAccess>(); Stat.get<trait::DirectAccess>() += TraitNumber; } if (!(get() & ~IndirectAccess)) { Dptr.set<trait::IndirectAccess>(); Stat.get<trait::IndirectAccess>() += TraitNumber; } switch (dropUnitFlag(get())) { case Readonly: Dptr.set<trait::Readonly>(); Stat.get<trait::Readonly>() += TraitNumber; return Dptr; case NoAccess: Dptr.set<trait::NoAccess>(); return Dptr; case Shared: Dptr.set<trait::Shared>(); Stat.get<trait::Shared>() += TraitNumber; return Dptr; } if (hasSharedJoin(get())) { Dptr.set<trait::Shared>(); Stat.get<trait::Shared>() += TraitNumber; } switch (dropUnitFlag(dropSharedFlag(get()))) { default: llvm_unreachable("Unknown type of memory location dependency!"); break; case Private: Dptr.set<trait::Private>(); Stat.get<trait::Private>() += TraitNumber; break; case FirstPrivate: Dptr.set<trait::FirstPrivate>(); Stat.get<trait::FirstPrivate>() += TraitNumber; break; case FirstPrivate & LastPrivate: Dptr.set<trait::FirstPrivate>(); Stat.get<trait::FirstPrivate>() += TraitNumber; case LastPrivate: Dptr.set<trait::LastPrivate>(); Stat.get<trait::LastPrivate>() += TraitNumber; break; case FirstPrivate & SecondToLastPrivate: Dptr.set<trait::FirstPrivate>(); Stat.get<trait::FirstPrivate>() += TraitNumber; case SecondToLastPrivate: Dptr.set<trait::SecondToLastPrivate>(); Stat.get<trait::SecondToLastPrivate>() +=TraitNumber; break; case FirstPrivate & DynamicPrivate: Dptr.set<trait::FirstPrivate>(); Stat.get<trait::FirstPrivate>() += TraitNumber; case DynamicPrivate: Dptr.set<trait::DynamicPrivate>(); Stat.get<trait::DynamicPrivate>() += TraitNumber; break; case Dependency: Dptr.set<trait::Flow, trait::Anti, trait::Output>(); Stat.get<trait::Flow>() += TraitNumber; Stat.get<trait::Anti>() += TraitNumber; Stat.get<trait::Output>() += TraitNumber; return Dptr; case Reduction: Dptr.set<trait::Reduction>(); Stat.get<trait::Reduction>() += TraitNumber; return Dptr; case Induction: Dptr.set<trait::Induction>(); Stat.get<trait::Induction>() += TraitNumber; return Dptr; } return Dptr; }
32.95082
80
0.626368
yukatan1701
7929cea169311bc2fde7346938709643748fc68e
2,782
hpp
C++
hotspot/src/share/vm/utilities/ticks.inline.hpp
dbac/jdk8
abfce42ff6d4b8b77d622157519ecd211ba0aa8f
[ "MIT" ]
1
2020-12-26T04:52:15.000Z
2020-12-26T04:52:15.000Z
hotspot/src/share/vm/utilities/ticks.inline.hpp
dbac/jdk8
abfce42ff6d4b8b77d622157519ecd211ba0aa8f
[ "MIT" ]
1
2020-12-26T04:57:19.000Z
2020-12-26T04:57:19.000Z
hotspot/src/share/vm/utilities/ticks.inline.hpp
dbac/jdk8
abfce42ff6d4b8b77d622157519ecd211ba0aa8f
[ "MIT" ]
1
2021-12-06T01:13:18.000Z
2021-12-06T01:13:18.000Z
/* * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ #ifndef SHARE_VM_UTILITIES_TICKS_INLINE_HPP #define SHARE_VM_UTILITIES_TICKS_INLINE_HPP #include "utilities/ticks.hpp" inline Tickspan operator+(Tickspan lhs, const Tickspan& rhs) { lhs += rhs; return lhs; } inline bool operator==(const Tickspan& lhs, const Tickspan& rhs) { return lhs.value() == rhs.value(); } inline bool operator!=(const Tickspan& lhs, const Tickspan& rhs) { return !operator==(lhs,rhs); } inline bool operator<(const Tickspan& lhs, const Tickspan& rhs) { return lhs.value() < rhs.value(); } inline bool operator>(const Tickspan& lhs, const Tickspan& rhs) { return operator<(rhs,lhs); } inline bool operator<=(const Tickspan& lhs, const Tickspan& rhs) { return !operator>(lhs,rhs); } inline bool operator>=(const Tickspan& lhs, const Tickspan& rhs) { return !operator<(lhs,rhs); } inline Ticks operator+(Ticks lhs, const Tickspan& span) { lhs += span; return lhs; } inline Ticks operator-(Ticks lhs, const Tickspan& span) { lhs -= span; return lhs; } inline Tickspan operator-(const Ticks& end, const Ticks& start) { return Tickspan(end, start); } inline bool operator==(const Ticks& lhs, const Ticks& rhs) { return lhs.value() == rhs.value(); } inline bool operator!=(const Ticks& lhs, const Ticks& rhs) { return !operator==(lhs,rhs); } inline bool operator<(const Ticks& lhs, const Ticks& rhs) { return lhs.value() < rhs.value(); } inline bool operator>(const Ticks& lhs, const Ticks& rhs) { return operator<(rhs,lhs); } inline bool operator<=(const Ticks& lhs, const Ticks& rhs) { return !operator>(lhs,rhs); } inline bool operator>=(const Ticks& lhs, const Ticks& rhs) { return !operator<(lhs,rhs); } #endif // SHARE_VM_UTILITIES_TICKS_INLINE_HPP
28.387755
76
0.719267
dbac
7929fcdd5ac7f3a03fa9080aae7dc118b8fd1d84
183
cpp
C++
src/model/Eph.cpp
guilherme-araujo/gsop-dist
15da82ffa8add74cc61b95d3544ec3aaa0e71a32
[ "MIT" ]
null
null
null
src/model/Eph.cpp
guilherme-araujo/gsop-dist
15da82ffa8add74cc61b95d3544ec3aaa0e71a32
[ "MIT" ]
null
null
null
src/model/Eph.cpp
guilherme-araujo/gsop-dist
15da82ffa8add74cc61b95d3544ec3aaa0e71a32
[ "MIT" ]
null
null
null
#include "Eph.h" Eph::Eph(double b){ this->bonus = b; this->time = 0; this->type = 'A'; } Eph::Eph(double b, char t){ this->bonus = b; this->time = 0; this->type = t; }
13.071429
27
0.535519
guilherme-araujo
792b8821b0ac064577728047657f8979b7885d7b
885
cpp
C++
CONTESTS/HACKER RANK/Multiply.cpp
priojeetpriyom/competitive-programming
0024328972d4e14c04c0fd5d6dd3cdf131d84f9d
[ "MIT" ]
1
2021-11-22T02:26:43.000Z
2021-11-22T02:26:43.000Z
CONTESTS/HACKER RANK/Multiply.cpp
priojeetpriyom/competitive-programming
0024328972d4e14c04c0fd5d6dd3cdf131d84f9d
[ "MIT" ]
null
null
null
CONTESTS/HACKER RANK/Multiply.cpp
priojeetpriyom/competitive-programming
0024328972d4e14c04c0fd5d6dd3cdf131d84f9d
[ "MIT" ]
null
null
null
#include <iostream> #include <cstdio> #include <string.h> #include <math.h> #include <algorithm> #include <stack> #include <queue> #include <climits> #define INT_MAX; using namespace std; int main() { int n; int q,x; while (scanf("%d %d",&n,&q)==2) { while(q--) { long long sum=0; scanf("%d",&x); int temp=n; for(int i=1;i<x;i++) n+=temp; int root= sqrt(n)+1; //printf("n %d x %d\n",n,x); for(int i=1;i<root;i++) { if(n%i==0) { sum+=i; temp=n/i; if(i!=temp) sum+=temp; // if(sum>1000000007) // sum=sum%1000000007; } } printf("%lld\n",sum%1000000007); } } return 0; }
18.829787
45
0.39322
priojeetpriyom
792b9d0a3a28be8eaf1d3b49354f7a1da7d2f58f
19,951
cxx
C++
src/external/marray/test/indexed_dpd_varray.cxx
xrq-phys/tblis
fc9be95ddb7906853c85931b5029b3011fe60587
[ "BSD-3-Clause" ]
null
null
null
src/external/marray/test/indexed_dpd_varray.cxx
xrq-phys/tblis
fc9be95ddb7906853c85931b5029b3011fe60587
[ "BSD-3-Clause" ]
null
null
null
src/external/marray/test/indexed_dpd_varray.cxx
xrq-phys/tblis
fc9be95ddb7906853c85931b5029b3011fe60587
[ "BSD-3-Clause" ]
null
null
null
#include "gtest/gtest.h" #include "indexed_dpd_varray.hpp" using namespace std; using namespace MArray; static dpd_layout layouts[6] = { PREFIX_ROW_MAJOR, PREFIX_COLUMN_MAJOR, BLOCKED_ROW_MAJOR, BLOCKED_COLUMN_MAJOR, BALANCED_ROW_MAJOR, BALANCED_COLUMN_MAJOR, }; static dim_vector perms[6] = {{3,2,1,0}, {0,1,2,3}, {3,2,1,0}, {0,1,2,3}, {3,2,1,0}, {0,1,2,3}}; static irrep_vector irreps[8] = {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}, {1,1,1,0}, {0,0,0,1}, {1,1,0,1}, {1,0,1,1}, {0,1,1,1}}; static len_vector lengths[8] = {{1,2,1,3}, {3,2,1,3}, {3,2,2,3}, {1,2,2,3}, {3,2,1,4}, {1,2,1,4}, {1,2,2,4}, {3,2,2,4}}; static stride_vector strides[6][8] = { {{42,11, 3, 1}, {42,11, 3, 1}, {42,10, 3, 1}, {42,10, 3, 1}, {42,10, 4, 1}, {42,10, 4, 1}, {42,11, 4, 1}, {42,11, 4, 1}}, {{ 1, 1, 8,24}, { 1, 3, 8,24}, { 1, 3, 8,24}, { 1, 1, 8,24}, { 1, 3, 8,24}, { 1, 1, 8,24}, { 1, 1, 8,24}, { 1, 3, 8,24}}, {{ 6, 3, 3, 1}, { 6, 3, 3, 1}, {12, 6, 3, 1}, {12, 6, 3, 1}, { 8, 4, 4, 1}, { 8, 4, 4, 1}, {16, 8, 4, 1}, {16, 8, 4, 1}}, {{ 1, 1, 2, 2}, { 1, 3, 6, 6}, { 1, 3, 6,12}, { 1, 1, 2, 4}, { 1, 3, 6, 6}, { 1, 1, 2, 2}, { 1, 1, 2, 4}, { 1, 3, 6,12}}, {{22,11, 3, 1}, {22,11, 3, 1}, {20,10, 3, 1}, {20,10, 3, 1}, {20,10, 4, 1}, {20,10, 4, 1}, {22,11, 4, 1}, {22,11, 4, 1}}, {{ 1, 1, 8, 8}, { 1, 3, 8, 8}, { 1, 3, 8,16}, { 1, 1, 8,16}, { 1, 3, 8, 8}, { 1, 1, 8, 8}, { 1, 1, 8,16}, { 1, 3, 8,16}} }; static stride_type offsets[6][8] = { {126, 20, 4,152, 0,148,129, 23}, { 0, 2, 8, 14, 72, 78, 80, 82}, {162,144, 96,132, 0, 24, 80, 32}, { 0, 42,108, 22,144, 34, 6, 60}, { 80+66, 80 , 0+4, 0+60+4, 0 , 0+60, 80+66+3, 80 +3}, { 0 , 0 +2, 88 , 88 +6, 88+48, 88+48+6, 0+24, 0+24+2} }; #define CHECK_INDEXED_DPD_VARRAY_RESET(v) \ EXPECT_EQ(0u, v.dimension()); \ EXPECT_EQ(0u, v.dense_dimension()); \ EXPECT_EQ(0u, v.indexed_dimension()); \ EXPECT_EQ(1u, v.num_indices()); \ EXPECT_EQ((dim_vector{}), v.permutation()); \ EXPECT_EQ((matrix<len_type>{}), v.lengths()); \ EXPECT_EQ(0u, v.data().size()); #define CHECK_INDEXED_DPD_VARRAY(v,j,value,...) \ SCOPED_TRACE(j); \ EXPECT_EQ(6u, v.dimension()); \ EXPECT_EQ(4u, v.dense_dimension()); \ EXPECT_EQ(2u, v.indexed_dimension()); \ EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}), v.lengths()); \ EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}}), v.dense_lengths()); \ EXPECT_EQ((len_vector{2, 5}), v.indexed_lengths()); \ EXPECT_EQ(3u, v.num_indices()); \ EXPECT_EQ((irrep_vector{1, 1}), v.indexed_irreps()); \ EXPECT_EQ((matrix<len_type>{{0, 0}, {1, 3}, {0, 3}}), v.indices()); \ EXPECT_EQ(value, v.data(0)[0]); \ EXPECT_EQ(1u, v.irrep()); \ EXPECT_EQ(2u, v.num_irreps()); \ EXPECT_EQ(perms[j], v.permutation()); \ \ for (int m = 0;m < 3u;m++) \ { \ SCOPED_TRACE(m); \ { \ auto vs = v[m](1,0,0,0); \ EXPECT_EQ(v.data(m) + offsets[j][0], vs.data()); \ for (int k = 0;k < 4;k++) \ { \ SCOPED_TRACE(k); \ EXPECT_EQ(lengths[0][k], vs.length(k)); \ EXPECT_EQ(strides[j][0][k], vs.stride(k)); \ } \ } \ \ { \ auto vs = v[m]({0,1,0,0}); \ EXPECT_EQ(v.data(m) + offsets[j][1], vs.data()); \ EXPECT_EQ(lengths[1], vs.lengths()); \ EXPECT_EQ(strides[j][1], vs.strides()); \ } \ \ for (int i = 2;i < 8;i++) \ { \ SCOPED_TRACE(i); \ auto vs = v[m](irreps[i]); \ EXPECT_EQ(v.data(m) + offsets[j][i], vs.data()); \ EXPECT_EQ(lengths[i], vs.lengths()); \ EXPECT_EQ(strides[j][i], vs.strides()); \ } \ } TEST(indexed_dpd_varray, constructor) { indexed_dpd_varray<double> v1; CHECK_INDEXED_DPD_VARRAY_RESET(v1) for (int j = 0;j < 6;j++) { indexed_dpd_varray<double> v2(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, layouts[j]); CHECK_INDEXED_DPD_VARRAY(v2, j, 0.0) indexed_dpd_varray<double> v21(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, 1.0, layouts[j]); CHECK_INDEXED_DPD_VARRAY(v21, j, 1.0) indexed_dpd_varray<double> v5(v21.view(), layouts[j]); CHECK_INDEXED_DPD_VARRAY(v5, j, 1.0) indexed_dpd_varray<double> v52(v21.cview(), layouts[j]); CHECK_INDEXED_DPD_VARRAY(v52, j, 1.0) indexed_dpd_varray<double> v51(v21); CHECK_INDEXED_DPD_VARRAY(v51, j, 1.0) indexed_dpd_varray<double> v53(v21, layouts[j]); CHECK_INDEXED_DPD_VARRAY(v53, j, 1.0) } } TEST(indexed_dpd_varray, reset) { indexed_dpd_varray<double> v1; CHECK_INDEXED_DPD_VARRAY_RESET(v1) for (int j = 0;j < 6;j++) { indexed_dpd_varray<double> v2(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, 1.0, layouts[j]); v1.reset(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, layouts[j]); CHECK_INDEXED_DPD_VARRAY(v1, j, 0.0) v1.reset(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, 1.0, layouts[j]); CHECK_INDEXED_DPD_VARRAY(v1, j, 1.0) v1.reset(v2.view(), layouts[j]); CHECK_INDEXED_DPD_VARRAY(v1, j, 1.0) v1.reset(v2.cview(), layouts[j]); CHECK_INDEXED_DPD_VARRAY(v1, j, 1.0) v1.reset(v2); CHECK_INDEXED_DPD_VARRAY(v1, j, 1.0) v1.reset(v2, layouts[j]); CHECK_INDEXED_DPD_VARRAY(v1, j, 1.0) } v1.reset(); CHECK_INDEXED_DPD_VARRAY_RESET(v1) } TEST(indexed_dpd_varray, view) { indexed_dpd_varray<double> v1(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, 1.0, layouts[0]); auto v2 = v1.cview(); CHECK_INDEXED_DPD_VARRAY(v2, 0, 1.0) auto v3 = v1.view(); CHECK_INDEXED_DPD_VARRAY(v3, 0, 1.0) auto v4 = const_cast<const indexed_dpd_varray<double>&>(v1).view(); CHECK_INDEXED_DPD_VARRAY(v4, 0, 1.0) } TEST(indexed_dpd_varray, access) { indexed_dpd_varray<double> v1(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, 1.0, layouts[0]); auto v2 = v1[0]; EXPECT_EQ(v1.data(0), v2.data()); EXPECT_EQ(1u, v2.irrep()); EXPECT_EQ(2u, v2.num_irreps()); EXPECT_EQ(perms[0], v2.permutation()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}}), v2.lengths()); auto v3 = const_cast<const indexed_dpd_varray<double>&>(v1)[2]; EXPECT_EQ(v1.data(2), v3.data()); EXPECT_EQ(1u, v3.irrep()); EXPECT_EQ(2u, v3.num_irreps()); EXPECT_EQ(perms[0], v3.permutation()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}}), v3.lengths()); } TEST(indexed_dpd_varray, index_iteration) { int indices[3][2] = {{0, 0}, {1, 3}, {0, 3}}; array<int,3> visited; indexed_dpd_varray<double> v1(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, 1.0, layouts[0]); const indexed_dpd_varray<double> v2(v1); visited = {}; v1.for_each_index( [&](const dpd_varray_view<double>& v, const index_vector& idx) { EXPECT_EQ(idx.size(), 2u); len_type i = idx[0]; len_type j = idx[1]; bool found = false; for (int m = 0;m < 3;m++) { if (i == indices[m][0] && j == indices[m][1]) { EXPECT_EQ(v1.data(m), v.data()); found = true; visited[m]++; } } EXPECT_TRUE(found); EXPECT_EQ(1u, v.irrep()); EXPECT_EQ(2u, v.num_irreps()); EXPECT_EQ(perms[0], v.permutation()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}}), v.lengths()); }); for (len_type i = 0;i < 3;i++) { EXPECT_EQ(visited[i], 1); } visited = {}; v2.for_each_index( [&](const dpd_varray_view<const double>& v, const index_vector& idx) { EXPECT_EQ(idx.size(), 2u); len_type i = idx[0]; len_type j = idx[1]; bool found = false; for (int m = 0;m < 3;m++) { if (i == indices[m][0] && j == indices[m][1]) { EXPECT_EQ(v2.data(m), v.data()); found = true; visited[m]++; } } EXPECT_TRUE(found); EXPECT_EQ(1u, v.irrep()); EXPECT_EQ(2u, v.num_irreps()); EXPECT_EQ(perms[0], v.permutation()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}}), v.lengths()); }); for (len_type i = 0;i < 3;i++) { EXPECT_EQ(visited[i], 1); } visited = {}; v1.for_each_index<4,2>( [&](const dpd_marray_view<double,4>& v, len_type i, len_type j) { bool found = false; for (int m = 0;m < 3;m++) { if (i == indices[m][0] && j == indices[m][1]) { EXPECT_EQ(v1.data(m), v.data()); found = true; visited[m]++; } } EXPECT_TRUE(found); EXPECT_EQ(1u, v.irrep()); EXPECT_EQ(2u, v.num_irreps()); EXPECT_EQ((*reinterpret_cast<std::array<int,4>*>(perms[0].data())), v.permutation()); EXPECT_EQ((std::array<std::array<len_type,8>,4>{{{3, 1}, {2, 2}, {1, 2}, {3, 4}}}), v.lengths()); }); for (len_type i = 0;i < 3;i++) { EXPECT_EQ(visited[i], 1); } visited = {}; v2.for_each_index<4,2>( [&](const dpd_marray_view<const double,4>& v, len_type i, len_type j) { bool found = false; for (int m = 0;m < 3;m++) { if (i == indices[m][0] && j == indices[m][1]) { EXPECT_EQ(v2.data(m), v.data()); found = true; visited[m]++; } } EXPECT_TRUE(found); EXPECT_EQ(1u, v.irrep()); EXPECT_EQ(2u, v.num_irreps()); EXPECT_EQ((*reinterpret_cast<std::array<int,4>*>(perms[0].data())), v.permutation()); EXPECT_EQ((std::array<std::array<len_type,8>,4>{{{3, 1}, {2, 2}, {1, 2}, {3, 4}}}), v.lengths()); }); for (len_type i = 0;i < 3;i++) { EXPECT_EQ(visited[i], 1); } } TEST(indexed_dpd_varray, element_iteration) { array<len_vector,3> indices = {{{0, 0}, {1, 3}, {0, 3}}}; array<array<int,3>,31> visited; array<len_vector,5> len = {{{2, 3}, {1, 2}, {3, 1}, {2, 2}, {4, 5}}}; indexed_dpd_varray<double> v1(0, 2, len, vector<int>{1, 1}, indices, 1.0, layouts[0]); const indexed_dpd_varray<double> v2(v1); visited = {}; v1.for_each_element( [&](double& v, const irrep_vector& irreps, const len_vector& idx) { EXPECT_EQ(irreps.size(), 5u); EXPECT_EQ(idx.size(), 5u); int a = irreps[0]; int b = irreps[1]; int c = irreps[2]; int d = irreps[3]; int e = irreps[4]; EXPECT_LT(a, 2u); EXPECT_LT(b, 2u); EXPECT_LT(c, 2u); EXPECT_EQ(d, 1u); EXPECT_EQ(e, 1u); EXPECT_EQ(a^b^c^d^e, 0u); len_type i = idx[0]; len_type j = idx[1]; len_type k = idx[2]; len_type l = idx[3]; len_type m = idx[4]; EXPECT_GE(i, 0); EXPECT_LT(i, len[0][a]); EXPECT_GE(j, 0); EXPECT_LT(j, len[1][b]); EXPECT_GE(k, 0); EXPECT_LT(k, len[2][c]); bool found = false; for (int n = 0;n < 3;n++) { if (l == indices[n][0] && m == indices[n][1]) { auto v3 = v1[n](a, b, c); EXPECT_EQ(&v, &v3(i, j, k)); visited[&v - v1.data(n)][n]++; found = true; } } EXPECT_TRUE(found); }); for (len_type i = 0;i < 31;i++) { for (len_type j = 0;j < 3;j++) { EXPECT_EQ(visited[i][j], 1); } } visited = {}; v2.for_each_element( [&](const double& v, const irrep_vector& irreps, const len_vector& idx) { EXPECT_EQ(irreps.size(), 5u); EXPECT_EQ(idx.size(), 5u); int a = irreps[0]; int b = irreps[1]; int c = irreps[2]; int d = irreps[3]; int e = irreps[4]; EXPECT_LT(a, 2u); EXPECT_LT(b, 2u); EXPECT_LT(c, 2u); EXPECT_EQ(d, 1u); EXPECT_EQ(e, 1u); EXPECT_EQ(a^b^c^d^e, 0u); len_type i = idx[0]; len_type j = idx[1]; len_type k = idx[2]; len_type l = idx[3]; len_type m = idx[4]; EXPECT_GE(i, 0); EXPECT_LT(i, len[0][a]); EXPECT_GE(j, 0); EXPECT_LT(j, len[1][b]); EXPECT_GE(k, 0); EXPECT_LT(k, len[2][c]); bool found = false; for (int n = 0;n < 3;n++) { if (l == indices[n][0] && m == indices[n][1]) { auto v3 = v2[n](a, b, c); EXPECT_EQ(&v, &v3(i, j, k)); visited[&v - v2.data(n)][n]++; found = true; } } EXPECT_TRUE(found); }); for (len_type i = 0;i < 31;i++) { for (len_type j = 0;j < 3;j++) { EXPECT_EQ(visited[i][j], 1); } } visited = {}; v1.for_each_element<3,2>( [&](double& v, int a, int b, int c, int d, int e, len_type i, len_type j, len_type k, len_type l, len_type m) { EXPECT_LT(a, 2u); EXPECT_LT(b, 2u); EXPECT_LT(c, 2u); EXPECT_EQ(d, 1u); EXPECT_EQ(e, 1u); EXPECT_EQ(a^b^c^d^e, 0u); EXPECT_GE(i, 0); EXPECT_LT(i, len[0][a]); EXPECT_GE(j, 0); EXPECT_LT(j, len[1][b]); EXPECT_GE(k, 0); EXPECT_LT(k, len[2][c]); bool found = false; for (int n = 0;n < 3;n++) { if (l == indices[n][0] && m == indices[n][1]) { auto v3 = v1[n](a, b, c); EXPECT_EQ(&v, &v3(i, j, k)); visited[&v - v1.data(n)][n]++; found = true; } } EXPECT_TRUE(found); }); for (len_type i = 0;i < 31;i++) { for (len_type j = 0;j < 3;j++) { EXPECT_EQ(visited[i][j], 1); } } visited = {}; v2.for_each_element<3,2>( [&](const double& v, int a, int b, int c, int d, int e, len_type i, len_type j, len_type k, len_type l, len_type m) { EXPECT_LT(a, 2u); EXPECT_LT(b, 2u); EXPECT_LT(c, 2u); EXPECT_EQ(d, 1u); EXPECT_EQ(e, 1u); EXPECT_EQ(a^b^c^d^e, 0u); EXPECT_GE(i, 0); EXPECT_LT(i, len[0][a]); EXPECT_GE(j, 0); EXPECT_LT(j, len[1][b]); EXPECT_GE(k, 0); EXPECT_LT(k, len[2][c]); bool found = false; for (int n = 0;n < 3;n++) { if (l == indices[n][0] && m == indices[n][1]) { auto v3 = v2[n](a, b, c); EXPECT_EQ(&v, &v3(i, j, k)); visited[&v - v2.data(n)][n]++; found = true; } } EXPECT_TRUE(found); }); for (len_type i = 0;i < 31;i++) { for (len_type j = 0;j < 3;j++) { EXPECT_EQ(visited[i][j], 1); } } } TEST(indexed_dpd_varray, swap) { indexed_dpd_varray<double> v1(1, 2, {{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}, {1, 1}, {{0, 0}, {1, 3}, {0, 3}}, 1.0, layouts[0]); indexed_dpd_varray<double> v2(0, 2, {{2, 3}, {1, 2}, {3, 1}, {2, 2}, {4, 5}}, {1, 0}, {{0, 0}, {1, 0}, {1, 2}}, 1.0, layouts[0]); auto data1 = v1.data(); auto data2 = v2.data(); EXPECT_EQ(6u, v1.dimension()); EXPECT_EQ(4u, v1.dense_dimension()); EXPECT_EQ(2u, v1.indexed_dimension()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}), v1.lengths()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}}), v1.dense_lengths()); EXPECT_EQ((len_vector{2, 5}), v1.indexed_lengths()); EXPECT_EQ(3, v1.num_indices()); EXPECT_EQ((irrep_vector{1, 1}), v1.indexed_irreps()); EXPECT_EQ((matrix<len_type>{{0, 0}, {1, 3}, {0, 3}}), v1.indices()); EXPECT_EQ(1u, v1.irrep()); EXPECT_EQ(2u, v1.num_irreps()); EXPECT_EQ(5u, v2.dimension()); EXPECT_EQ(3u, v2.dense_dimension()); EXPECT_EQ(2u, v2.indexed_dimension()); EXPECT_EQ((matrix<len_type>{{2, 3}, {1, 2}, {3, 1}, {2, 2}, {4, 5}}), v2.lengths()); EXPECT_EQ((matrix<len_type>{{2, 3}, {1, 2}, {3, 1}}), v2.dense_lengths()); EXPECT_EQ((len_vector{2, 4}), v2.indexed_lengths()); EXPECT_EQ(3, v2.num_indices()); EXPECT_EQ((irrep_vector{1, 0}), v2.indexed_irreps()); EXPECT_EQ((matrix<len_type>{{0, 0}, {1, 0}, {1, 2}}), v2.indices()); EXPECT_EQ(0u, v2.irrep()); EXPECT_EQ(2u, v2.num_irreps()); v1.swap(v2); EXPECT_EQ(6u, v2.dimension()); EXPECT_EQ(4u, v2.dense_dimension()); EXPECT_EQ(2u, v2.indexed_dimension()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}), v2.lengths()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}}), v2.dense_lengths()); EXPECT_EQ((len_vector{2, 5}), v2.indexed_lengths()); EXPECT_EQ(3, v2.num_indices()); EXPECT_EQ((irrep_vector{1, 1}), v2.indexed_irreps()); EXPECT_EQ((matrix<len_type>{{0, 0}, {1, 3}, {0, 3}}), v2.indices()); EXPECT_EQ(1u, v2.irrep()); EXPECT_EQ(2u, v2.num_irreps()); EXPECT_EQ(5u, v1.dimension()); EXPECT_EQ(3u, v1.dense_dimension()); EXPECT_EQ(2u, v1.indexed_dimension()); EXPECT_EQ((matrix<len_type>{{2, 3}, {1, 2}, {3, 1}, {2, 2}, {4, 5}}), v1.lengths()); EXPECT_EQ((matrix<len_type>{{2, 3}, {1, 2}, {3, 1}}), v1.dense_lengths()); EXPECT_EQ((len_vector{2, 4}), v1.indexed_lengths()); EXPECT_EQ(3, v1.num_indices()); EXPECT_EQ((irrep_vector{1, 0}), v1.indexed_irreps()); EXPECT_EQ((matrix<len_type>{{0, 0}, {1, 0}, {1, 2}}), v1.indices()); EXPECT_EQ(0u, v1.irrep()); EXPECT_EQ(2u, v1.num_irreps()); swap(v2, v1); EXPECT_EQ(6u, v1.dimension()); EXPECT_EQ(4u, v1.dense_dimension()); EXPECT_EQ(2u, v1.indexed_dimension()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}, {2, 2}, {4, 5}}), v1.lengths()); EXPECT_EQ((matrix<len_type>{{3, 1}, {2, 2}, {1, 2}, {3, 4}}), v1.dense_lengths()); EXPECT_EQ((len_vector{2, 5}), v1.indexed_lengths()); EXPECT_EQ(3, v1.num_indices()); EXPECT_EQ((irrep_vector{1, 1}), v1.indexed_irreps()); EXPECT_EQ((matrix<len_type>{{0, 0}, {1, 3}, {0, 3}}), v1.indices()); EXPECT_EQ(1u, v1.irrep()); EXPECT_EQ(2u, v1.num_irreps()); EXPECT_EQ(5u, v2.dimension()); EXPECT_EQ(3u, v2.dense_dimension()); EXPECT_EQ(2u, v2.indexed_dimension()); EXPECT_EQ((matrix<len_type>{{2, 3}, {1, 2}, {3, 1}, {2, 2}, {4, 5}}), v2.lengths()); EXPECT_EQ((matrix<len_type>{{2, 3}, {1, 2}, {3, 1}}), v2.dense_lengths()); EXPECT_EQ((len_vector{2, 4}), v2.indexed_lengths()); EXPECT_EQ(3, v2.num_indices()); EXPECT_EQ((irrep_vector{1, 0}), v2.indexed_irreps()); EXPECT_EQ((matrix<len_type>{{0, 0}, {1, 0}, {1, 2}}), v2.indices()); EXPECT_EQ(0u, v2.irrep()); EXPECT_EQ(2u, v2.num_irreps()); }
33.031457
105
0.478272
xrq-phys
792eef6bec38f4ac702f6857dfe889116b1e3181
8,757
cpp
C++
data/121.cpp
TianyiChen/rdcpp-data
75c6868c876511e3ce143fdc3c08ddd74c7aa4ea
[ "MIT" ]
null
null
null
data/121.cpp
TianyiChen/rdcpp-data
75c6868c876511e3ce143fdc3c08ddd74c7aa4ea
[ "MIT" ]
null
null
null
data/121.cpp
TianyiChen/rdcpp-data
75c6868c876511e3ce143fdc3c08ddd74c7aa4ea
[ "MIT" ]
null
null
null
int v, g4U , WW , WtYKC,Yu,Fuf /*7q*/,aDKMr, U3 , fQ, Hnl8 , kII , wd,kAx,d5,dt83 , Ax ,//M m, se ,jX , hX6 , pNn,tuaf, W4 , HD, Pr,//e yIm9 ,P7A ,/*d*/esSeWz ,Yi8NA, tT , k1E6,CM, Wp ,eGQ/*HZ*/, S, LLm , mO ,tnO3//6 , PRO, k9td, GCN; void f_f0(){ { { return ; return ; /*wtv7*/}{ return ; {{/*X8Z*/ { } ; //JNA }} { {{ } } ; { if(true) { }else { }{ }}// } return ;{ //NP {//aUYT } return ;}/*17*/ } { for(int i=1; i< 1 ;++i ){ ;{ } }{int M; volatile int P6,FL ,i8 ; M = i8//ck + P6 + FL;//EL8 }{return ;; ;} } {volatile int Jos ,iGpx , ftX//4Fo , FHd, TGK ; GCN =TGK+ Jos+iGpx +ftX + FHd ;if( true )//Lqh {return ;{ } { /*A*/volatile int sla /*r*/; v = sla ;{ } { //BT } }} else { for(int i=1;i<2;++i ) { int lsm ;volatile int AV//t ;if(true )if ( true) {for(int i=1 ; i< /*67CX*/3;++i) { } return//vq ; // { { }} } else { /*CCAr*/} else lsm/*tF*/=/*k*/ AV ; { } }{return // ; } ;}if( true ) { for (int i=1/*AQbtP*/ ; i< 4 /*K*/;++i ) if ( true/*Wc*/) {} else {}{ return ; //QqK for (int i=1 ;/*NplA*/i<5;++i) /*ZIXB*/ {} } } else {//E7 volatile int krfG //9sWek ,jIv , sN2//wX ;for(int i=1 ;/*Tv*/ i<6 ;++i) {; } g4U =sN2+krfG+ jIv ;} } return ; } { { for (int i=1//NQ ; i< 7 ;++i){{/*s*/}{ {}{ int V5xt ;volatile int TWy;if /*n*/ (true/*T*/){ }else V5xt=//Ks TWy/*FF*/;} }} { { ; // { } } ; }}{for (int i=1 ;//oud i<8 ;++i ); ; { volatile int JqJjehw , /*cze*/dQ /*J*/ ;if(true) { { }} else return ;{{ } } /*G*/if( true) { {} {}} else WW= dQ + JqJjehw ;} return ;}{ //9fV4 int fS ;volatile int hG ,HC, // bty ,xyx , WfSV , e9 ,H6 /*Ha*/;;{ volatile int D ,N2g/*A*/ ,NgC;for (int i=1 ;//e i< /*EZ8*/9;++i )WtYKC = NgC +D + /*fM3e*/N2g;} fS = H6+hG +HC + bty ; for//Jj1 //K (int i=1;i<10;++i )Yu= xyx+WfSV+ e9;}{{{ if /*8s*/ (true//G6Cmrc ) {}else{ { } } } ; return ;} for(int i=1;/*GJcQ*/ /*P*/i< 11 ;++i )return//kaK ; } } return ;/*9*/for (int i=1 ; i< 12 ;++i ) ; return ;}void f_f1(){ if (// /*4uOW*/true/*3*/) return ;else {if/*Q*/( true){volatile int kJG ,t//4 //A , Rhm; {//i5 {}{ return ; }/*5*/ } { volatile int oNtG , bTm,ShwH; {//fo }{//3 volatile int l ,B5,v7 ; if (true);else//8 for (int i=1; i<13 ;++i )Fuf=v7 + l + B5 ;/*PpHl*/ {//z6 } } aDKMr //a =ShwH + oNtG+ bTm; } U3= Rhm +/**/kJG +t; return ; } else{volatile int Q , QrJn /**/,Ng, WZusW ; fQ =WZusW+Q + QrJn + Ng ; { volatile int RX8a , Gm2l ; //9 for (int i=1 ; i< 14;++i//96c )Hnl8= //8 Gm2l + RX8a ;//18 } {for (int i=1; i<15;++i){ } { }/*ISd*/{//sZ }/*Dj*/} } return ; { for //u (int //5 i=1; i<16 ;++i); {return ; for (int i=1; i<17 ;++i )for(int i=1;i< 18;++i ) {volatile int /*al*/ ry9 , o0W,i ; kII=i + ry9+ o0W ; } {return ; for(int i=1;i<19;++i ) if (true ) return ; else return ;}}} //kQ1FE /*Y*/{ if (//nV true )/*F1*/ { if(true){ /*dp*/}else for (int i=1; i<20 ;++i ){ for (int i=1 ;i< 21;++i // ) return ; }}else { if( true ){} else ; return ;} //8 {return ;/*fAb*/}return/*b*/ ; } };{ { ;{{ ; } for(int i=1; i< 22;++i) { } } } for (int i=1;//A i<23 //mu ;++i ){{if(//T8D true ){//t4 ;/*Yf*/ }else {volatile int k0/**/,Rqgn8X,wMB ;/*K*/ wd=/*LUX*/wMB + k0+Rqgn8X ; }{}/*P8o*/}return ; return ;/*40*/{int k3 ;volatile int Tu9n //V0 , w, WB , LdHPw ; k3= LdHPw+ Tu9n+w +WB ; } } { {{ { }}{volatile int bN6;/*ct*//*I*/for (int i=1;i</*imL*/ 24;++i )kAx= bN6 ;}for(int i=1 ; i<25;++i //4SB )for (int i=1 ; i< 26 ;++i ){} } { return//B ;{ volatile int oec , tw , cX7/*gD*/;d5= cX7 +/*e*/oec +tw;} } } {volatile int r20w , wMW, Mf ; { { if(true ) if(/*mp*/true ) { } else ;else{}} { } }dt83= Mf + r20w +wMW ;}/*hJU*/}{ volatile int A4gZ , A8WB ,zabxMg,DF ; { {{ }{ { } }for/*zt*///T0 (int i=1;i<27;++i ) for (int i=1 ;i< 28 ;++i ) { { { }}}}{ { return ; }{ volatile int VcF4kWS , n3 ; { } return ; { volatile int BR ; for (int i=1 /*dOCC*/ ; i< 29 ;++i )Ax =BR //0GSs ; /**/}m= n3 +VcF4kWS ;//U //BA }return ;{ for (int i=1 ;i<//zg 30 ;++i//C ) return/*MxF*/ ; } } { {//H return ;}if /*B*/( true )for (int i=1 ;//Tp7 i<31//Z ;++i ) for (int i=1/*B*/ ;i< 32;++i ){ }else ;/*mA*/for (int i=1 ;i<33 ;++i ) ;} } { int Guz ; volatile int KQ, uP , yn; for(int i=1;i< 34 ;++i){ { volatile int YA , WxyfG; se= WxyfG +//bw YA ;;} ;} if(true ){{ volatile int wdW ,u1IMa ; if( true )for(int i=1 ;i<35 ;++i ) if(true) jX = u1IMa+ wdW ;/*nl*/ else{{ } }else ; } }else for (int i=1;i< 36//5azqZ ;++i) /*6*/{ volatile int xb ,b6V , t4;hX6 = t4 +xb +b6V ;for(int i=1 ;i</*Gvj*/37 ;++i)return ;; }Guz=yn + KQ + //Q9 uP;{ return ;//N { } } if ( true) return ;else{ if ( true) { if(true ) { } else { } {} { }}else return ; for (int i=1 ; i< 38 ;++i ) ;}}pNn = DF +A4gZ +A8WB// +zabxMg; return ;{ volatile int/*UFf*/ Na , L0E8 , JBbK ;for (int i=1 ; /*M*/ i<39;++i )//V {{ } {{ volatile int j4b ;{ }for (int i=1 ; i<40 ;++i ); for (int i=1 ; i< 41 ;++i) tuaf =j4b ;} }{ } } { {}{ }} if (true ) W4 =JBbK +Na+L0E8;else { for//Y (int i=1 ; i<42;++i) return ; }} } ; return ; } void f_f2 () { volatile int TBkOA /*lPHt*/ ,//LY R ,yB3, ee ,YrTwp, jKXf ;{ {{ //Zyn //pD4X volatile int wKL ,DH ;for (int i=1; i< 43;++i)if/*meqp9*/ (true ) HD =DH + wKL//b1P ; else //qZU return ;} { { }return ; }} ; { volatile int cL ,//iPkZP P16/*L*/ ,S7x9/*pJU*/ , sDb ,/*qn*/// amitfv ; Pr=amitfv +cL + P16/*CosH*//**/+ S7x9 +sDb ;{return ; };//s }{ /*kZ*/ for (int i=1; i< 44 ;++i );{ if ( true) if ( true )//C ;else {volatile int Eu ;/*g*/for//q (int i=1;i<45 ;++i ) yIm9 = Eu ; return ; for(int i=1;i< 46;++i) for (int i=1; i< 47//j12 ;++i ){}} else{ }; }for(int i=1; i<//tm9 48 ;++i //m ) {/*5vH*/;}return ; }return ;} P7A =jKXf+ TBkOA// + R + yB3+ ee+ YrTwp // ; { return ;/*j*/return ; { /*jl*/{ { {//g }}/*cC*/ } for/*Ry*/(int /*V*/i=1 ; i<49 ;++i )if (true )/**/{ int zvF ; volatile int gr//l , /*R*/y5e; { } zvF=y5e +gr ; if( true//FL ) { {}//Lk { }} else{ for(int i=1 ; i< 50 ;++i// ) {}}}else for (int i=1 ;i< 51 ;++i); } };//jc return ; return ; //At }int main () {;; {volatile int lC ,Zs ,bbB, z4r ;{ {volatile int Z ,IC ,aKGAb , qwumrp , aMZ2; esSeWz = aMZ2/**/+ Z ; for(int i=1 ; i< 52;++i )if//kI (true ){} else Yi8NA =IC +aKGAb+ qwumrp//e ;return /*eG*/ 1535424636 ;}; ; { { { }//2 } { { }} } }{ int nv ;volatile int ea2, YJhh , A ;/**/{ volatile int Tt,mpy;if ( true )tT = mpy +Tt; else { {}}{ } /*G*/// if (/*MNT*/true ) {} else {//W } } if( true )if( true ) if (true ) { {{}}/*X*/ {}; } else for (int i=1;i< 53 ;++i){ { }//iM { }}else nv =A+ ea2 +YJhh; else if ( true ) {{ ;; { }}}else {int Jsf ;volatile int cab , No ,Unoxt ,/**/ bqJ ,/*D*/ H;k1E6/*H*/=H+cab//5 +No;if( true/*9*/) { } else for (int i=1; i< 54 ;++i )for (int i=1 ; i< 55 ;++i)Jsf = Unoxt + bqJ/*B*/; }} { for(int i=1 ; i<56 ;++i )/*0vo*/{/*W*/volatile int hfS ,W, zB; CM =zB+ hfS+ W;} { { ; } {{ }{} } for/*g6*/(int i=1; i< 57;++i)return 745506281 ;}} Wp =/**///LN z4r+ lC+ Zs + bbB ; } { {{ { return 356162911; { }} } { ;if( true ) for (int i=1 ;i< 58 ;++i /*8DA*/ ){ }else/**/{return 1879603641; } if( /**///Q true)/**/{ for (int i=1 ; i<59 ;++i ) { if //TH /*n*/( true ){}else for (int i=1;i< 60;++i){ volatile int// U7NqC ;/*5*/ eGQ=U7NqC; } {}} } else{ } }return // 1339832199;};{{{ } //xJ } if( true )if ( true)for(int i=1 ;i< 61 ;++i){ int SzH ; volatile int Ldq,Yhv, Ee ,k//0 , /*6*/mS ; SzH=mS+ Ldq ;if( true)//A { //7N9 }else S= Yhv + Ee + /*6q*/ k;}else for(int i=1 ; i< 62;++i ) return 622765840;else if ( true) { volatile int P , Ff , jsze , vn ;LLm= vn+ P +Ff +jsze ; } else if//Zp4B (true/**/) for(int i=1; i< 63 //Q ;++i )return 1827256872 ; else//J0 { volatile int Lz , OQykZZ , Tt8 ,vgMS; if (true) ; else /*W7*/ mO /*t8b*/ = vgMS+Lz + OQykZZ + Tt8;{return 1805139222 ;}} { { } } } { int G7k;volatile int JO ,/*sN6*/BAT//9 , J54 , CG ,/*GrtI*/TY, I8 ;G7k =I8 + JO+ BAT; { volatile int /*vu8*/ vGDA5k/*Fq*/,MBsB/*gRN*/;{ } return 217537407 ; tnO3= MBsB +vGDA5k; }for (int /*Vol*/ i=1 ;i<64 ;++i/**/){ volatile int hqq , Bkeq , Th ;for (int i=1;i<65 /*sgb7*/;++i ) { { } } PRO = Th+ hqq+ Bkeq;} k9td //lMi3 =J54 +CG +TY ; //OR ;}}}
10.588875
82
0.444787
TianyiChen
79304246b4aa17ff848ca3fb5d38677493231890
4,242
cpp
C++
src/hooks/VRController.cpp
Lythium4848/SmoothedController
97fb5cb547637f41565b563a13dc6a1e90f1e51f
[ "MIT" ]
null
null
null
src/hooks/VRController.cpp
Lythium4848/SmoothedController
97fb5cb547637f41565b563a13dc6a1e90f1e51f
[ "MIT" ]
null
null
null
src/hooks/VRController.cpp
Lythium4848/SmoothedController
97fb5cb547637f41565b563a13dc6a1e90f1e51f
[ "MIT" ]
null
null
null
#include "SmoothedController.hpp" #include "SmoothedControllerConfig.hpp" #include "Wrapper.hpp" #include <map> #include "GlobalNamespace/IVRPlatformHelper.hpp" #include "GlobalNamespace/VRController.hpp" #include "GlobalNamespace/VRControllerTransformOffset.hpp" #include "System/Math.hpp" #include "UnityEngine/Mathf.hpp" #include "UnityEngine/Time.hpp" #include "UnityEngine/XR/XRNode.hpp" std::map<UnityEngine::XR::XRNode, SafePtr<SmoothedController::Wrapper>> wrappers; void SmoothController(GlobalNamespace::VRController* instance) { using namespace System; using namespace System::Collections::Generic; using namespace UnityEngine; using namespace UnityEngine::XR; if (!instance || !getSmoothedControllerConfig().Enabled.GetValue()) { return; } static float posSmoth = 20.f - Mathf::Clamp(getSmoothedControllerConfig().PositionSmoothing.GetValue(), 0.f, 20.f); static float rotSmoth = 20.f - Mathf::Clamp(getSmoothedControllerConfig().RotationSmoothing.GetValue(), 0.f, 20.f); SafePtr<SmoothedController::Wrapper> wrapperI = nullptr; if (wrappers.find(instance->get_node()) == wrappers.end()) { wrapperI = CRASH_UNLESS(il2cpp_utils::New<SmoothedController::Wrapper*>()); wrappers[instance->get_node()] = *wrapperI; } else { wrapperI = *wrappers[instance->get_node()]; } float angDiff = Quaternion::Angle(wrapperI->smoothedRotation, instance->get_transform()->get_localRotation()); wrapperI->angleVelocitySnap = Math::Min(wrapperI->angleVelocitySnap + angDiff, 90.f); float snapMulti = Mathf::Clamp(wrapperI->angleVelocitySnap / getSmoothedControllerConfig().SmallMovementThresholdAngle.GetValue(), .1f, 2.5f); if (wrapperI->angleVelocitySnap > .1f) { wrapperI->angleVelocitySnap -= Math::Max(.4f, wrapperI->angleVelocitySnap / 1.7f); } if (getSmoothedControllerConfig().PositionSmoothing.GetValue() > 0.f) { wrapperI->smoothedPosition = Vector3::Lerp(wrapperI->smoothedPosition, instance->get_transform()->get_localPosition(), posSmoth * Time::get_deltaTime() * snapMulti); instance->get_transform()->set_localPosition(wrapperI->smoothedPosition); } if (getSmoothedControllerConfig().RotationSmoothing.GetValue() > 0.f) { wrapperI->smoothedRotation = Quaternion::Lerp(wrapperI->smoothedRotation, instance->get_transform()->get_localRotation(), rotSmoth * Time::get_deltaTime() * snapMulti); instance->get_transform()->set_localRotation(wrapperI->smoothedRotation); } } MAKE_HOOK_MATCH( VRController_Update, &GlobalNamespace::VRController::Update, void, GlobalNamespace::VRController* self ) { using namespace UnityEngine; using namespace UnityEngine::XR; // Because Quest is dumb and we dont have transpilers, we gotta reimplement this entire method. :D Vector3 lastTrackedPosition; Quaternion localRotation; if (!self->vrPlatformHelper->GetNodePose(self->node, self->nodeIdx, lastTrackedPosition, localRotation)) { if (self->lastTrackedPosition != Vector3::get_zero()) { lastTrackedPosition = self->lastTrackedPosition; } else if (self->node == XRNode::_get_LeftHand()) { lastTrackedPosition = Vector3(-.2f, .05f, .0f); } else if (self->node == XRNode::_get_RightHand()) { lastTrackedPosition = Vector3(.2f, .05f, .0f); } } else { self->lastTrackedPosition = lastTrackedPosition; } self->get_transform()->set_localPosition(lastTrackedPosition); self->get_transform()->set_localRotation(localRotation); if (self->get_gameObject()->get_name()->StartsWith(il2cpp_utils::newcsstr("Controller"))) { SmoothController(self); } if (self->transformOffset != nullptr) { self->vrPlatformHelper->AdjustControllerTransform(self->node, self->get_transform(), self->transformOffset->get_positionOffset(), self->transformOffset->get_rotationOffset()); return; } self->vrPlatformHelper->AdjustControllerTransform(self->node, self->get_transform(), Vector3::get_zero(), Vector3::get_zero()); } void SmoothedController::Hooks::VRController() { INSTALL_HOOK(getLogger(), VRController_Update); }
42.42
183
0.7157
Lythium4848
79310b5ae511e49799a3979344f4ec74764770f6
1,217
cpp
C++
codeforces/C - Meme Problem/Accepted.cpp
kzvd4729/Problem-Solving
13b105e725a4c2f8db7fecc5d7a8f932b9fef4ab
[ "MIT" ]
1
2022-02-11T16:55:36.000Z
2022-02-11T16:55:36.000Z
codeforces/C - Meme Problem/Accepted.cpp
kzvd4729/Problem-Solving
13b105e725a4c2f8db7fecc5d7a8f932b9fef4ab
[ "MIT" ]
null
null
null
codeforces/C - Meme Problem/Accepted.cpp
kzvd4729/Problem-Solving
13b105e725a4c2f8db7fecc5d7a8f932b9fef4ab
[ "MIT" ]
null
null
null
/**************************************************************************************** * @author: * kzvd4729 created: Nov/12/2018 21:14 * solution_verdict: Accepted language: GNU C++14 * run_time: 15 ms memory_used: 11700 KB * problem: https://codeforces.com/contest/1076/problem/C ****************************************************************************************/ #include<bits/stdc++.h> #define long long long using namespace std; const int N=1e6; int fg[N+2]; double ans[N+2]; int main() { ios_base::sync_with_stdio(0);cin.tie(0); for(int i=0;i<=1000;i++) { double x=i*1.0; double lo=0.0,hi=x/2.0,md; if(((hi*hi)+0.0000001)<x)fg[i]=1; int loop=100; while(loop--) { md=(lo+hi)/2.0; if((md*(x-md))>x)hi=md; else lo=md; } ans[i]=md; } int t;cin>>t; while(t--) { int n;cin>>n; if(fg[n])cout<<"N"<<endl; else { cout<<"Y "; cout<<setprecision(10)<<fixed<<(n*1.0)-ans[n]<<" "<<ans[n]<<endl; } } return 0; }
28.97619
111
0.384552
kzvd4729
7932a58c90fe486bea90a3f67d3fbe32025c38d3
11,397
cpp
C++
CodeGenere/photogram/cEqAppui_X_C2MPolyn7.cpp
kikislater/micmac
3009dbdad62b3ad906ec882b74b85a3db86ca755
[ "CECILL-B" ]
451
2016-11-25T09:40:28.000Z
2022-03-30T04:20:42.000Z
CodeGenere/photogram/cEqAppui_X_C2MPolyn7.cpp
kikislater/micmac
3009dbdad62b3ad906ec882b74b85a3db86ca755
[ "CECILL-B" ]
143
2016-11-25T20:35:57.000Z
2022-03-01T11:58:02.000Z
CodeGenere/photogram/cEqAppui_X_C2MPolyn7.cpp
kikislater/micmac
3009dbdad62b3ad906ec882b74b85a3db86ca755
[ "CECILL-B" ]
139
2016-12-02T10:26:21.000Z
2022-03-10T19:40:29.000Z
// File Automatically generated by eLiSe #include "general/all.h" #include "private/all.h" #include "cEqAppui_X_C2MPolyn7.h" cEqAppui_X_C2MPolyn7::cEqAppui_X_C2MPolyn7(): cElCompiledFonc(1) { AddIntRef (cIncIntervale("Intr",0,69)); AddIntRef (cIncIntervale("Orient",69,75)); Close(false); } void cEqAppui_X_C2MPolyn7::ComputeVal() { double tmp0_ = mCompCoord[69]; double tmp1_ = mCompCoord[70]; double tmp2_ = cos(tmp1_); double tmp3_ = sin(tmp0_); double tmp4_ = cos(tmp0_); double tmp5_ = sin(tmp1_); double tmp6_ = mCompCoord[71]; double tmp7_ = mCompCoord[72]; double tmp8_ = mLocXTer-tmp7_; double tmp9_ = sin(tmp6_); double tmp10_ = -(tmp9_); double tmp11_ = -(tmp5_); double tmp12_ = cos(tmp6_); double tmp13_ = mCompCoord[73]; double tmp14_ = mLocYTer-tmp13_; double tmp15_ = mCompCoord[74]; double tmp16_ = mLocZTer-tmp15_; double tmp17_ = mLocXIm/mLocPolyn7_State_0_0; double tmp18_ = mLocYIm/mLocPolyn7_State_0_0; double tmp19_ = (tmp17_)*(tmp17_); double tmp20_ = (tmp18_)*(tmp18_); double tmp21_ = tmp19_*(tmp17_); double tmp22_ = (tmp18_)*(tmp17_); double tmp23_ = tmp22_*(tmp17_); double tmp24_ = tmp20_*(tmp17_); double tmp25_ = (tmp18_)*tmp20_; double tmp26_ = tmp21_*(tmp17_); double tmp27_ = tmp23_*(tmp17_); double tmp28_ = tmp24_*(tmp17_); double tmp29_ = tmp25_*(tmp17_); double tmp30_ = (tmp18_)*tmp25_; double tmp31_ = tmp26_*(tmp17_); double tmp32_ = tmp27_*(tmp17_); double tmp33_ = tmp28_*(tmp17_); double tmp34_ = tmp29_*(tmp17_); double tmp35_ = tmp30_*(tmp17_); double tmp36_ = (tmp18_)*tmp30_; double tmp37_ = tmp31_*(tmp17_); double tmp38_ = tmp32_*(tmp17_); double tmp39_ = tmp33_*(tmp17_); double tmp40_ = tmp34_*(tmp17_); double tmp41_ = tmp35_*(tmp17_); double tmp42_ = tmp36_*(tmp17_); double tmp43_ = (tmp18_)*tmp36_; mVal[0] = (mCompCoord[1]+mCompCoord[0]*((tmp4_*tmp2_*(tmp8_)+tmp3_*tmp2_*(tmp14_)+tmp5_*(tmp16_))/((-(tmp3_)*tmp10_+tmp4_*tmp11_*tmp12_)*(tmp8_)+(tmp4_*tmp10_+tmp3_*tmp11_*tmp12_)*(tmp14_)+tmp2_*tmp12_*(tmp16_))))-((((1+mCompCoord[3])*(tmp17_)+mCompCoord[4]*(tmp18_))-mCompCoord[5]*2*tmp19_+mCompCoord[6]*(tmp17_)*(tmp18_)+mCompCoord[7]*tmp20_)*mLocPolyn7_State_0_0+(mCompCoord[9]*tmp21_+mCompCoord[10]*tmp23_+mCompCoord[11]*tmp24_+mCompCoord[12]*tmp25_+mCompCoord[17]*tmp26_+mCompCoord[18]*tmp27_+mCompCoord[19]*tmp28_+mCompCoord[20]*tmp29_+mCompCoord[21]*tmp30_+mCompCoord[27]*tmp31_+mCompCoord[28]*tmp32_+mCompCoord[29]*tmp33_+mCompCoord[30]*tmp34_+mCompCoord[31]*tmp35_+mCompCoord[32]*tmp36_+mCompCoord[39]*tmp37_+mCompCoord[40]*tmp38_+mCompCoord[41]*tmp39_+mCompCoord[42]*tmp40_+mCompCoord[43]*tmp41_+mCompCoord[44]*tmp42_+mCompCoord[45]*tmp43_+mCompCoord[53]*tmp37_*(tmp17_)+mCompCoord[54]*tmp38_*(tmp17_)+mCompCoord[55]*tmp39_*(tmp17_)+mCompCoord[56]*tmp40_*(tmp17_)+mCompCoord[57]*tmp41_*(tmp17_)+mCompCoord[58]*tmp42_*(tmp17_)+mCompCoord[59]*tmp43_*(tmp17_)+mCompCoord[60]*(tmp18_)*tmp43_)*mLocPolyn7_State_0_0); } void cEqAppui_X_C2MPolyn7::ComputeValDeriv() { double tmp0_ = mCompCoord[69]; double tmp1_ = mCompCoord[70]; double tmp2_ = cos(tmp1_); double tmp3_ = sin(tmp0_); double tmp4_ = cos(tmp0_); double tmp5_ = sin(tmp1_); double tmp6_ = mCompCoord[71]; double tmp7_ = mCompCoord[72]; double tmp8_ = mLocXTer-tmp7_; double tmp9_ = sin(tmp6_); double tmp10_ = -(tmp9_); double tmp11_ = -(tmp5_); double tmp12_ = cos(tmp6_); double tmp13_ = mCompCoord[73]; double tmp14_ = mLocYTer-tmp13_; double tmp15_ = mCompCoord[74]; double tmp16_ = mLocZTer-tmp15_; double tmp17_ = mLocXIm/mLocPolyn7_State_0_0; double tmp18_ = mLocYIm/mLocPolyn7_State_0_0; double tmp19_ = (tmp17_)*(tmp17_); double tmp20_ = (tmp18_)*(tmp18_); double tmp21_ = tmp19_*(tmp17_); double tmp22_ = (tmp18_)*(tmp17_); double tmp23_ = tmp22_*(tmp17_); double tmp24_ = tmp20_*(tmp17_); double tmp25_ = (tmp18_)*tmp20_; double tmp26_ = tmp21_*(tmp17_); double tmp27_ = tmp23_*(tmp17_); double tmp28_ = tmp24_*(tmp17_); double tmp29_ = tmp25_*(tmp17_); double tmp30_ = (tmp18_)*tmp25_; double tmp31_ = tmp26_*(tmp17_); double tmp32_ = tmp27_*(tmp17_); double tmp33_ = tmp28_*(tmp17_); double tmp34_ = tmp29_*(tmp17_); double tmp35_ = tmp30_*(tmp17_); double tmp36_ = (tmp18_)*tmp30_; double tmp37_ = tmp31_*(tmp17_); double tmp38_ = tmp32_*(tmp17_); double tmp39_ = tmp33_*(tmp17_); double tmp40_ = tmp34_*(tmp17_); double tmp41_ = tmp35_*(tmp17_); double tmp42_ = tmp36_*(tmp17_); double tmp43_ = (tmp18_)*tmp36_; double tmp44_ = tmp4_*tmp2_; double tmp45_ = tmp44_*(tmp8_); double tmp46_ = tmp3_*tmp2_; double tmp47_ = tmp46_*(tmp14_); double tmp48_ = tmp45_+tmp47_; double tmp49_ = tmp5_*(tmp16_); double tmp50_ = tmp48_+tmp49_; double tmp51_ = -(tmp3_); double tmp52_ = tmp51_*tmp10_; double tmp53_ = tmp4_*tmp11_; double tmp54_ = tmp53_*tmp12_; double tmp55_ = tmp52_+tmp54_; double tmp56_ = (tmp55_)*(tmp8_); double tmp57_ = tmp4_*tmp10_; double tmp58_ = tmp3_*tmp11_; double tmp59_ = tmp58_*tmp12_; double tmp60_ = tmp57_+tmp59_; double tmp61_ = (tmp60_)*(tmp14_); double tmp62_ = tmp56_+tmp61_; double tmp63_ = tmp2_*tmp12_; double tmp64_ = tmp63_*(tmp16_); double tmp65_ = tmp62_+tmp64_; double tmp66_ = (tmp50_)/(tmp65_); double tmp67_ = (tmp17_)*(tmp18_); double tmp68_ = tmp37_*(tmp17_); double tmp69_ = tmp38_*(tmp17_); double tmp70_ = tmp39_*(tmp17_); double tmp71_ = tmp40_*(tmp17_); double tmp72_ = tmp41_*(tmp17_); double tmp73_ = tmp42_*(tmp17_); double tmp74_ = tmp43_*(tmp17_); double tmp75_ = (tmp18_)*tmp43_; double tmp76_ = -(1); double tmp77_ = tmp76_*tmp3_; double tmp78_ = mCompCoord[0]; double tmp79_ = tmp76_*tmp5_; double tmp80_ = -(tmp2_); double tmp81_ = ElSquare(tmp65_); double tmp82_ = -(tmp12_); double tmp83_ = tmp76_*tmp9_; mVal[0] = (mCompCoord[1]+tmp78_*(tmp66_))-((((1+mCompCoord[3])*(tmp17_)+mCompCoord[4]*(tmp18_))-mCompCoord[5]*2*tmp19_+mCompCoord[6]*tmp67_+mCompCoord[7]*tmp20_)*mLocPolyn7_State_0_0+(mCompCoord[9]*tmp21_+mCompCoord[10]*tmp23_+mCompCoord[11]*tmp24_+mCompCoord[12]*tmp25_+mCompCoord[17]*tmp26_+mCompCoord[18]*tmp27_+mCompCoord[19]*tmp28_+mCompCoord[20]*tmp29_+mCompCoord[21]*tmp30_+mCompCoord[27]*tmp31_+mCompCoord[28]*tmp32_+mCompCoord[29]*tmp33_+mCompCoord[30]*tmp34_+mCompCoord[31]*tmp35_+mCompCoord[32]*tmp36_+mCompCoord[39]*tmp37_+mCompCoord[40]*tmp38_+mCompCoord[41]*tmp39_+mCompCoord[42]*tmp40_+mCompCoord[43]*tmp41_+mCompCoord[44]*tmp42_+mCompCoord[45]*tmp43_+mCompCoord[53]*tmp68_+mCompCoord[54]*tmp69_+mCompCoord[55]*tmp70_+mCompCoord[56]*tmp71_+mCompCoord[57]*tmp72_+mCompCoord[58]*tmp73_+mCompCoord[59]*tmp74_+mCompCoord[60]*tmp75_)*mLocPolyn7_State_0_0); mCompDer[0][0] = tmp66_; mCompDer[0][1] = 1; mCompDer[0][2] = 0; mCompDer[0][3] = -((tmp17_)*mLocPolyn7_State_0_0); mCompDer[0][4] = -((tmp18_)*mLocPolyn7_State_0_0); mCompDer[0][5] = -(-(2*tmp19_)*mLocPolyn7_State_0_0); mCompDer[0][6] = -(tmp67_*mLocPolyn7_State_0_0); mCompDer[0][7] = -(tmp20_*mLocPolyn7_State_0_0); mCompDer[0][8] = 0; mCompDer[0][9] = -(tmp21_*mLocPolyn7_State_0_0); mCompDer[0][10] = -(tmp23_*mLocPolyn7_State_0_0); mCompDer[0][11] = -(tmp24_*mLocPolyn7_State_0_0); mCompDer[0][12] = -(tmp25_*mLocPolyn7_State_0_0); mCompDer[0][13] = 0; mCompDer[0][14] = 0; mCompDer[0][15] = 0; mCompDer[0][16] = 0; mCompDer[0][17] = -(tmp26_*mLocPolyn7_State_0_0); mCompDer[0][18] = -(tmp27_*mLocPolyn7_State_0_0); mCompDer[0][19] = -(tmp28_*mLocPolyn7_State_0_0); mCompDer[0][20] = -(tmp29_*mLocPolyn7_State_0_0); mCompDer[0][21] = -(tmp30_*mLocPolyn7_State_0_0); mCompDer[0][22] = 0; mCompDer[0][23] = 0; mCompDer[0][24] = 0; mCompDer[0][25] = 0; mCompDer[0][26] = 0; mCompDer[0][27] = -(tmp31_*mLocPolyn7_State_0_0); mCompDer[0][28] = -(tmp32_*mLocPolyn7_State_0_0); mCompDer[0][29] = -(tmp33_*mLocPolyn7_State_0_0); mCompDer[0][30] = -(tmp34_*mLocPolyn7_State_0_0); mCompDer[0][31] = -(tmp35_*mLocPolyn7_State_0_0); mCompDer[0][32] = -(tmp36_*mLocPolyn7_State_0_0); mCompDer[0][33] = 0; mCompDer[0][34] = 0; mCompDer[0][35] = 0; mCompDer[0][36] = 0; mCompDer[0][37] = 0; mCompDer[0][38] = 0; mCompDer[0][39] = -(tmp37_*mLocPolyn7_State_0_0); mCompDer[0][40] = -(tmp38_*mLocPolyn7_State_0_0); mCompDer[0][41] = -(tmp39_*mLocPolyn7_State_0_0); mCompDer[0][42] = -(tmp40_*mLocPolyn7_State_0_0); mCompDer[0][43] = -(tmp41_*mLocPolyn7_State_0_0); mCompDer[0][44] = -(tmp42_*mLocPolyn7_State_0_0); mCompDer[0][45] = -(tmp43_*mLocPolyn7_State_0_0); mCompDer[0][46] = 0; mCompDer[0][47] = 0; mCompDer[0][48] = 0; mCompDer[0][49] = 0; mCompDer[0][50] = 0; mCompDer[0][51] = 0; mCompDer[0][52] = 0; mCompDer[0][53] = -(tmp68_*mLocPolyn7_State_0_0); mCompDer[0][54] = -(tmp69_*mLocPolyn7_State_0_0); mCompDer[0][55] = -(tmp70_*mLocPolyn7_State_0_0); mCompDer[0][56] = -(tmp71_*mLocPolyn7_State_0_0); mCompDer[0][57] = -(tmp72_*mLocPolyn7_State_0_0); mCompDer[0][58] = -(tmp73_*mLocPolyn7_State_0_0); mCompDer[0][59] = -(tmp74_*mLocPolyn7_State_0_0); mCompDer[0][60] = -(tmp75_*mLocPolyn7_State_0_0); mCompDer[0][61] = 0; mCompDer[0][62] = 0; mCompDer[0][63] = 0; mCompDer[0][64] = 0; mCompDer[0][65] = 0; mCompDer[0][66] = 0; mCompDer[0][67] = 0; mCompDer[0][68] = 0; mCompDer[0][69] = (((tmp77_*tmp2_*(tmp8_)+tmp44_*(tmp14_))*(tmp65_)-(tmp50_)*((-(tmp4_)*tmp10_+tmp77_*tmp11_*tmp12_)*(tmp8_)+(tmp77_*tmp10_+tmp54_)*(tmp14_)))/tmp81_)*tmp78_; mCompDer[0][70] = (((tmp79_*tmp4_*(tmp8_)+tmp79_*tmp3_*(tmp14_)+tmp2_*(tmp16_))*(tmp65_)-(tmp50_)*(tmp80_*tmp4_*tmp12_*(tmp8_)+tmp80_*tmp3_*tmp12_*(tmp14_)+tmp79_*tmp12_*(tmp16_)))/tmp81_)*tmp78_; mCompDer[0][71] = (-((tmp50_)*((tmp82_*tmp51_+tmp83_*tmp53_)*(tmp8_)+(tmp82_*tmp4_+tmp83_*tmp58_)*(tmp14_)+tmp83_*tmp2_*(tmp16_)))/tmp81_)*tmp78_; mCompDer[0][72] = ((tmp76_*tmp44_*(tmp65_)-(tmp50_)*tmp76_*(tmp55_))/tmp81_)*tmp78_; mCompDer[0][73] = ((tmp76_*tmp46_*(tmp65_)-(tmp50_)*tmp76_*(tmp60_))/tmp81_)*tmp78_; mCompDer[0][74] = ((tmp79_*(tmp65_)-(tmp50_)*tmp76_*tmp63_)/tmp81_)*tmp78_; } void cEqAppui_X_C2MPolyn7::ComputeValDerivHessian() { ELISE_ASSERT(false,"Foncteur cEqAppui_X_C2MPolyn7 Has no Der Sec"); } void cEqAppui_X_C2MPolyn7::SetPolyn7_State_0_0(double aVal){ mLocPolyn7_State_0_0 = aVal;} void cEqAppui_X_C2MPolyn7::SetXIm(double aVal){ mLocXIm = aVal;} void cEqAppui_X_C2MPolyn7::SetXTer(double aVal){ mLocXTer = aVal;} void cEqAppui_X_C2MPolyn7::SetYIm(double aVal){ mLocYIm = aVal;} void cEqAppui_X_C2MPolyn7::SetYTer(double aVal){ mLocYTer = aVal;} void cEqAppui_X_C2MPolyn7::SetZTer(double aVal){ mLocZTer = aVal;} double * cEqAppui_X_C2MPolyn7::AdrVarLocFromString(const std::string & aName) { if (aName == "Polyn7_State_0_0") return & mLocPolyn7_State_0_0; if (aName == "XIm") return & mLocXIm; if (aName == "XTer") return & mLocXTer; if (aName == "YIm") return & mLocYIm; if (aName == "YTer") return & mLocYTer; if (aName == "ZTer") return & mLocZTer; return 0; } cElCompiledFonc::cAutoAddEntry cEqAppui_X_C2MPolyn7::mTheAuto("cEqAppui_X_C2MPolyn7",cEqAppui_X_C2MPolyn7::Alloc); cElCompiledFonc * cEqAppui_X_C2MPolyn7::Alloc() { return new cEqAppui_X_C2MPolyn7(); }
42.211111
1,123
0.697903
kikislater
a6a89fa8355feac8f43f05f3960f766db13c8997
489
cpp
C++
src/Source/Chunks/Shex/SyncFlags.cpp
tgjones/slimshader-cpp
a1833e2eccf32cccfe33aa7613772503eca963ee
[ "MIT" ]
20
2015-03-29T02:14:03.000Z
2021-11-14T12:27:02.000Z
src/Source/Chunks/Shex/SyncFlags.cpp
tgjones/slimshader-cpp
a1833e2eccf32cccfe33aa7613772503eca963ee
[ "MIT" ]
null
null
null
src/Source/Chunks/Shex/SyncFlags.cpp
tgjones/slimshader-cpp
a1833e2eccf32cccfe33aa7613772503eca963ee
[ "MIT" ]
12
2015-05-04T06:39:10.000Z
2022-02-23T06:48:04.000Z
#include "PCH.h" #include "SyncFlags.h" #include "Decoder.h" using namespace std; using namespace SlimShader; string SlimShader::ToString(SyncFlags value) { string result; if (HasFlag(value, SyncFlags::UnorderedAccessViewGlobal)) result += "_uglobal"; if (HasFlag(value, SyncFlags::UnorderedAccessViewGroup)) result += "_ugroup"; if (HasFlag(value, SyncFlags::SharedMemory)) result += "_g"; if (HasFlag(value, SyncFlags::ThreadsInGroup)) result += "_t"; return result; }
21.26087
58
0.728016
tgjones
a6a8ceb77adb2c3b96880b5d88bdb570f2046c04
1,660
cpp
C++
cpu_version/convert/bvec_line.cpp
takanokage/Product-Quantization-Tree
2651ba871100ff4c0ccef42ba57e871fbc6181f8
[ "MIT" ]
98
2016-07-18T07:38:07.000Z
2022-02-02T15:28:01.000Z
cpu_version/convert/bvec_line.cpp
takanokage/Product-Quantization-Tree
2651ba871100ff4c0ccef42ba57e871fbc6181f8
[ "MIT" ]
14
2016-08-03T08:43:36.000Z
2017-11-02T14:39:41.000Z
cpu_version/convert/bvec_line.cpp
takanokage/Product-Quantization-Tree
2651ba871100ff4c0ccef42ba57e871fbc6181f8
[ "MIT" ]
36
2016-07-27T13:47:12.000Z
2020-07-13T14:34:46.000Z
#include <iostream> #include <fstream> #include <string> #include <stdexcept> #include <cassert> #include "../helper.hpp" #include "../filehelper.hpp" #include "../iterator/memiterator.hpp" #include "../iterator/bvecsiterator.hpp" using namespace std; int main(int argc, char const *argv[]) { int line = atoi(argv[1]); { string bvecs = "/graphics/projects/scratch/ANNSIFTDB/ANN_SIFT1B/bigann_base.bvecs"; //string bvecs = "/graphics/projects/scratch/ANNSIFTDB/ANN_SIFT1B/bigann_query.bvecs"; uint8_t *data2 = readBatchJegou(bvecs.c_str(), line, 1); int sum = 0; for (int i = 0; i < 128; ++i) { cout << (int)data2[i] << " "; sum += (int)data2[i]; } cout << endl; cout << "sum " << sum << endl; delete[] data2; } { string bvecs = "/graphics/projects/scratch/ANNSIFTDB/ANN_SIFT1B/base1M.umem"; //string bvecs = "/graphics/projects/scratch/ANNSIFTDB/ANN_SIFT1B/query.umem"; uint n = 0; uint d = 0; header(bvecs, n, d); cout << "header n " << n << endl; cout << "header d " << d << endl; memiterator<float, uint8_t> base_set; base_set.open(bvecs.c_str()); cout << "header n " << base_set.num() << endl; float *lean_data = base_set.addr(line); int sum = 0; for (int i = 0; i < 128; ++i) { cout << lean_data[i] << " "; sum += lean_data[i]; } cout << endl; cout << "sum " << sum << endl; //read(bvecs, n, d, uint * ptr, uint len, uint offset = 0) } return 0; }
24.776119
94
0.535542
takanokage
a6ad7d04af16f841c3f6d589f8cfa2d216c17457
2,226
cpp
C++
deform_control/external_libs/OpenSceneGraph-2.8.5/examples/osgwidgetstyled/osgwidgetstyled.cpp
UM-ARM-Lab/mab_ms
f199f05b88060182cfbb47706bd1ff3479032c43
[ "BSD-2-Clause" ]
3
2018-08-20T12:12:43.000Z
2021-06-06T09:43:27.000Z
deform_control/external_libs/OpenSceneGraph-2.8.5/examples/osgwidgetstyled/osgwidgetstyled.cpp
UM-ARM-Lab/mab_ms
f199f05b88060182cfbb47706bd1ff3479032c43
[ "BSD-2-Clause" ]
null
null
null
deform_control/external_libs/OpenSceneGraph-2.8.5/examples/osgwidgetstyled/osgwidgetstyled.cpp
UM-ARM-Lab/mab_ms
f199f05b88060182cfbb47706bd1ff3479032c43
[ "BSD-2-Clause" ]
1
2022-03-31T03:12:23.000Z
2022-03-31T03:12:23.000Z
// -*-c++-*- osgWidget - Code by: Jeremy Moles (cubicool) 2007-2008 // $Id: osgwidgetshader.cpp 28 2008-03-26 15:26:48Z cubicool $ #include <osgWidget/Util> #include <osgWidget/WindowManager> #include <osgWidget/StyleManager> #include <osgWidget/Box> const unsigned int MASK_2D = 0xF0000000; const std::string& STYLE1 = "color 0 0 0 128\n" "padding 5\n" ; const std::string& STYLE2 = "color 1.0 0.5 0.0\n" ; const std::string& STYLE3 = "fill true\n" ; const std::string& STYLE4 = "pos 100.0 100.0\n" "size 600 600\n" ; class CustomStyled: public osgWidget::Widget { }; class CustomStyle: public osgWidget::Style { virtual bool applyStyle(osgWidget::Widget* w, osgWidget::Reader r) { CustomStyled* cs = dynamic_cast<CustomStyled*>(w); if(!cs) return false; osgWidget::warn() << "Here, okay." << std::endl; return true; } }; int main(int argc, char** argv) { osgViewer::Viewer viewer; osgWidget::WindowManager* wm = new osgWidget::WindowManager( &viewer, 1280.0f, 1024.0f, MASK_2D ); osgWidget::Box* box = new osgWidget::Box("box", osgWidget::Box::VERTICAL); osgWidget::Widget* widget1 = new osgWidget::Widget("w1", 200.0f, 200.0f); osgWidget::Widget* widget2 = new osgWidget::Widget("w2", 100.0f, 100.0f); osgWidget::Widget* widget3 = new osgWidget::Widget("w3", 0.0f, 0.0f); // CustomStyled* cs = new CustomStyled(); // Yep. wm->getStyleManager()->addStyle(new osgWidget::Style("widget.style1", STYLE1)); wm->getStyleManager()->addStyle(new osgWidget::Style("widget.style2", STYLE2)); wm->getStyleManager()->addStyle(new osgWidget::Style("spacer", STYLE3)); wm->getStyleManager()->addStyle(new osgWidget::Style("window", STYLE4)); // wm->getStyleManager()->addStyle(new CustomStyle("widget", "")); widget1->setStyle("widget.style1"); widget2->setStyle("widget.style2"); widget3->setStyle("spacer"); box->setStyle("window"); box->addWidget(widget1); box->addWidget(widget2); box->addWidget(widget3); wm->addChild(box); // box->resizePercent(0.0f, 100.0f); return osgWidget::createExample(viewer, wm); }
26.5
83
0.642408
UM-ARM-Lab
a6adc86952e2aaaf222165215ac13cab3edc4f07
651
cpp
C++
data/ias_perception/cop_sr4_plugins/src/swissRangerRemoteSensor.cpp
khairulislam/phys
fc702520fcd3b23022b9253e7d94f878978b4500
[ "MIT" ]
null
null
null
data/ias_perception/cop_sr4_plugins/src/swissRangerRemoteSensor.cpp
khairulislam/phys
fc702520fcd3b23022b9253e7d94f878978b4500
[ "MIT" ]
null
null
null
data/ias_perception/cop_sr4_plugins/src/swissRangerRemoteSensor.cpp
khairulislam/phys
fc702520fcd3b23022b9253e7d94f878978b4500
[ "MIT" ]
null
null
null
#include "pluginlib/class_list_macros.h" #include "RangeSensor.h" #include "SegmentPrototype.h" class SwissRangerRemoteSensor : public cop::RangeSensor { public: virtual std::string GetName() const{return XML_NODE_SWISSRANGER;}; }; /** Sensor Plugin*/ PLUGINLIB_REGISTER_CLASS(SwissRangerRemoteSensor, SwissRangerRemoteSensor, cop::Sensor) PLUGINLIB_REGISTER_CLASS(RangeSensor, cop::RangeSensor, cop::Sensor) /** Cluster Detector Plugin */ //PLUGINLIB_REGISTER_CLASS(ClusterDetector, cop::ClusterDetector, cop::LocateAlgorithm) /** Cluster Descriptor Plugin */ PLUGINLIB_REGISTER_CLASS(SegmentPrototype, cop::SegmentPrototype, cop::Descriptor)
32.55
87
0.806452
khairulislam
a6ae01a0d384bdfa265c3da954710c2fb0cd6037
636
cpp
C++
server/src/main.cpp
silverthreadk/Mafia2
275f7e9fb63a98bcb5781c4d388a63da16a63213
[ "BSL-1.0" ]
null
null
null
server/src/main.cpp
silverthreadk/Mafia2
275f7e9fb63a98bcb5781c4d388a63da16a63213
[ "BSL-1.0" ]
null
null
null
server/src/main.cpp
silverthreadk/Mafia2
275f7e9fb63a98bcb5781c4d388a63da16a63213
[ "BSL-1.0" ]
null
null
null
#include <iostream> #include "server.h" int main(int argc, char* argv[]) { try { if (argc < 2) { std::cerr << "Usage: Server <port> [<port> ...]\n"; return 1; } boost::asio::io_context io_context; std::list<Server> servers; for (int i = 1; i < argc; ++i) { boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), std::atoi(argv[i])); servers.emplace_back(io_context, endpoint); } io_context.run(); } catch (std::exception& e) { std::cerr << "Exception: " << e.what() << "\n"; } return 0; }
23.555556
100
0.492138
silverthreadk
a6af98ea81cf6041f60789187af3f22c0bf4658f
8,684
hxx
C++
src/lapack_wrapper/code++/trid.hxx
ceccocats/LapackWrapper
fea6aa41849ffe5440fa3195c36f74e45e36b414
[ "BSD-4-Clause" ]
3
2021-05-19T14:33:59.000Z
2022-03-14T02:12:47.000Z
src/lapack_wrapper/code++/trid.hxx
ceccocats/LapackWrapper
fea6aa41849ffe5440fa3195c36f74e45e36b414
[ "BSD-4-Clause" ]
null
null
null
src/lapack_wrapper/code++/trid.hxx
ceccocats/LapackWrapper
fea6aa41849ffe5440fa3195c36f74e45e36b414
[ "BSD-4-Clause" ]
1
2020-01-24T15:10:34.000Z
2020-01-24T15:10:34.000Z
/*--------------------------------------------------------------------------*\ | | | Copyright (C) 2019 | | | | , __ , __ | | /|/ \ /|/ \ | | | __/ _ ,_ | __/ _ ,_ | | | \|/ / | | | | \|/ / | | | | | |(__/|__/ |_/ \_/|/|(__/|__/ |_/ \_/|/ | | /| /| | | \| \| | | | | Enrico Bertolazzi | | Dipartimento di Ingegneria Industriale | | Universita` degli Studi di Trento | | email: enrico.bertolazzi@unitn.it | | | \*--------------------------------------------------------------------------*/ /// /// file: trid.hxx /// namespace lapack_wrapper { //============================================================================ /*\ :|: _____ _ _ _ _ ____ ____ ____ :|: |_ _| __(_) __| (_) __ _ __ _ ___ _ __ __ _| / ___|| _ \| _ \ :|: | || '__| |/ _` | |/ _` |/ _` |/ _ \| '_ \ / _` | \___ \| |_) | | | | :|: | || | | | (_| | | (_| | (_| | (_) | | | | (_| | |___) | __/| |_| | :|: |_||_| |_|\__,_|_|\__,_|\__, |\___/|_| |_|\__,_|_|____/|_| |____/ :|: |___/ \*/ template <typename T> class TridiagonalSPD : public LinearSystemSolver<T> { public: typedef T valueType; private: Malloc<valueType> allocReals; valueType * L; valueType * D; valueType * WORK; integer nRC; public: TridiagonalSPD() : allocReals("allocReals") , nRC(0) {} virtual ~TridiagonalSPD() LAPACK_WRAPPER_OVERRIDE { allocReals.free(); } valueType cond1( valueType norm1 ) const; void factorize( char const who[], integer N, valueType const _L[], valueType const _D[] ); /*\ :|: _ _ _ :|: __ _(_)_ __| |_ _ _ __ _| |___ :|: \ \ / / | '__| __| | | |/ _` | / __| :|: \ V /| | | | |_| |_| | (_| | \__ \ :|: \_/ |_|_| \__|\__,_|\__,_|_|___/ \*/ virtual void solve( valueType xb[] ) const LAPACK_WRAPPER_OVERRIDE; virtual void t_solve( valueType xb[] ) const LAPACK_WRAPPER_OVERRIDE; virtual void solve( integer nrhs, valueType xb[], integer ldXB ) const LAPACK_WRAPPER_OVERRIDE; virtual void t_solve( integer nrhs, valueType xb[], integer ldXB ) const LAPACK_WRAPPER_OVERRIDE; /*\ :|: _ :|: / \ _ ___ __ :|: / _ \| | | \ \/ / :|: / ___ \ |_| |> < :|: /_/ \_\__,_/_/\_\ :|: \*/ void axpy( integer N, valueType alpha, valueType const L[], valueType const D[], valueType const x[], valueType beta, valueType y[] ) const; }; //============================================================================ /*\ :|: _____ _ _ _ _ _ _ _ :|: |_ _| __(_) __| (_) __ _ __ _ ___ _ __ __ _| | | | | | | :|: | || '__| |/ _` | |/ _` |/ _` |/ _ \| '_ \ / _` | | | | | | | :|: | || | | | (_| | | (_| | (_| | (_) | | | | (_| | | |__| |_| | :|: |_||_| |_|\__,_|_|\__,_|\__, |\___/|_| |_|\__,_|_|_____\___/ :|: |___/ \*/ template <typename T> class TridiagonalLU : public LinearSystemSolver<T> { public: typedef T valueType; private: Malloc<valueType> allocReals; Malloc<integer> allocIntegers; valueType * L; valueType * D; valueType * U; valueType * U2; valueType * WORK; integer * IPIV; integer * IWORK; integer nRC; public: TridiagonalLU() : allocReals("TridiagonalLU-allocReals") , allocIntegers("TridiagonalLU-allocIntegers") , nRC(0) {} virtual ~TridiagonalLU() LAPACK_WRAPPER_OVERRIDE { allocReals.free(); allocIntegers.free(); } valueType cond1( valueType norm1 ) const; valueType condInf( valueType normInf ) const; void factorize( char const who[], integer N, valueType const _L[], valueType const _D[], valueType const _U[] ); /*\ :|: _ _ _ :|: __ _(_)_ __| |_ _ _ __ _| |___ :|: \ \ / / | '__| __| | | |/ _` | / __| :|: \ V /| | | | |_| |_| | (_| | \__ \ :|: \_/ |_|_| \__|\__,_|\__,_|_|___/ \*/ virtual void solve( valueType xb[] ) const LAPACK_WRAPPER_OVERRIDE; virtual void t_solve( valueType xb[] ) const LAPACK_WRAPPER_OVERRIDE; virtual void solve( integer nrhs, valueType xb[], integer ldXB ) const LAPACK_WRAPPER_OVERRIDE; virtual void t_solve( integer nrhs, valueType xb[], integer ldXB ) const LAPACK_WRAPPER_OVERRIDE; /*\ :|: _ :|: / \ _ ___ __ :|: / _ \| | | \ \/ / :|: / ___ \ |_| |> < :|: /_/ \_\__,_/_/\_\ :|: \*/ void axpy( integer N, valueType alpha, valueType const L[], valueType const D[], valueType const U[], valueType const x[], valueType beta, valueType y[] ) const; }; //============================================================================ /*\ :|: _____ _ _ _ _ ___ ____ :|: |_ _| __(_) __| (_) __ _ __ _ ___ _ __ __ _| |/ _ \| _ \ :|: | || '__| |/ _` | |/ _` |/ _` |/ _ \| '_ \ / _` | | | | | |_) | :|: | || | | | (_| | | (_| | (_| | (_) | | | | (_| | | |_| | _ < :|: |_||_| |_|\__,_|_|\__,_|\__, |\___/|_| |_|\__,_|_|\__\_\_| \_\ :|: |___/ \*/ template <typename T> class TridiagonalQR : public LinearSystemSolver<T> { public: typedef T valueType; private: Malloc<valueType> allocReals; valueType * C; // rotazioni givens valueType * S; valueType * BD; // band triangular matrix valueType * BU; // band triangular matrix valueType * BU2; // band triangular matrix valueType normInfA; integer nRC; void Rsolve( valueType xb[] ) const; void RsolveTransposed( valueType xb[] ) const; public: TridiagonalQR() : allocReals("allocReals") , nRC(0) {} virtual ~TridiagonalQR() LAPACK_WRAPPER_OVERRIDE { allocReals.free(); } void factorize( char const who[], integer N, valueType const L[], valueType const D[], valueType const U[] ); void lsq( integer nrhs, T RHS[], integer ldRHS, T lambda ) const; /*\ :|: _ _ _ :|: __ _(_)_ __| |_ _ _ __ _| |___ :|: \ \ / / | '__| __| | | |/ _` | / __| :|: \ V /| | | | |_| |_| | (_| | \__ \ :|: \_/ |_|_| \__|\__,_|\__,_|_|___/ \*/ virtual void solve( valueType xb[] ) const LAPACK_WRAPPER_OVERRIDE; virtual void t_solve( valueType xb[] ) const LAPACK_WRAPPER_OVERRIDE; virtual void solve( integer nrhs, valueType xb[], integer ldXB ) const LAPACK_WRAPPER_OVERRIDE; virtual void t_solve( integer nrhs, valueType xb[], integer ldXB ) const LAPACK_WRAPPER_OVERRIDE; /*\ :|: _ :|: / \ _ ___ __ :|: / _ \| | | \ \/ / :|: / ___ \ |_| |> < :|: /_/ \_\__,_/_/\_\ :|: \*/ void axpy( integer N, valueType alpha, valueType const L[], valueType const D[], valueType const U[], valueType const x[], valueType beta, valueType y[] ) const; }; } /// /// eof: trid.hxx ///
24.461972
80
0.376324
ceccocats
a6b04db6b50d7a607d55726b59212303ae9477ff
2,721
cpp
C++
server/src/MediaLibraryServer.cpp
jabaa/MediaLibraryServer
52caf9adc40694300adade33f89d86cf32960efd
[ "MIT" ]
null
null
null
server/src/MediaLibraryServer.cpp
jabaa/MediaLibraryServer
52caf9adc40694300adade33f89d86cf32960efd
[ "MIT" ]
null
null
null
server/src/MediaLibraryServer.cpp
jabaa/MediaLibraryServer
52caf9adc40694300adade33f89d86cf32960efd
[ "MIT" ]
null
null
null
#include "MediaLibraryServer.hpp" MediaLibraryServer::MediaLibraryServer() : configs(), help(false) {} void MediaLibraryServer::initialize(Application &self) { loadConfiguration(); logger().information(fmt::format("Configs: {}", configs.size())); for (const auto &c : configs) { try { loadConfiguration(c); } catch (const Poco::InvalidArgumentException &e) { logger().warning( fmt::format("Poco::InvalidArgumentException: {}", e.what())); } } Poco::Util::ServerApplication::initialize(self); } void MediaLibraryServer::uninitialize() { Poco::Util::ServerApplication::uninitialize(); } void MediaLibraryServer::defineOptions(Poco::Util::OptionSet &options) { ServerApplication::defineOptions(options); options.addOption( Poco::Util::Option("help", "h", "display argument help information") .required(false) .repeatable(false) .callback(Poco::Util::OptionCallback<MediaLibraryServer>( this, &MediaLibraryServer::handleHelp))); options.addOption( Poco::Util::Option("config", "c", "add a path to a configuration") .required(false) .repeatable(true) .argument("path", true) .callback(Poco::Util::OptionCallback<MediaLibraryServer>( this, &MediaLibraryServer::addConfig))); } void MediaLibraryServer::handleHelp(const std::string &, const std::string &) { Poco::Util::HelpFormatter helpFormatter(options()); helpFormatter.setCommand(commandName()); helpFormatter.setUsage("OPTIONS"); helpFormatter.setHeader( "A web server that serves the current date and time."); helpFormatter.format(std::cout); help = true; stopOptionsProcessing(); } void MediaLibraryServer::addConfig( const std::string &, const std::string &value) { if (std::find(configs.begin(), configs.end(), value) == configs.end()) { configs.emplace_back(value); } } int MediaLibraryServer::main(const std::vector<std::string> &) { if (help) { return Application::EXIT_OK; } if (!config().has(MEDIA_LIBRARY_SERVER__WEBROOT)) { logger().error("Can't initialize server. Webroot is not set"); return Application::EXIT_USAGE; } unsigned short port = static_cast<unsigned short>( config().getInt(MEDIA_LIBRARY_SERVER__PORT, 8080)); Poco::Net::ServerSocket svs(port); Poco::Net::HTTPServer srv(new HttpRequestHandlerFactory(), svs, new Poco::Net::HTTPServerParams); srv.start(); waitForTerminationRequest(); srv.stop(); return Application::EXIT_OK; }
33.592593
79
0.639838
jabaa
a6b22e3fd5edcee8e9d457fa79fc3283767ac12d
777
hpp
C++
Bibliotecas_e_Drives/Bibliot_ESP8266_ESP32_IDE-Arduino/ArduinoWebsockets/src/tiny_websockets/network/windows/win_tcp_server.hpp
francenylson/Robotica_ESP8266
882568b2656d319144aa19b3f34a0caf3c132b22
[ "MIT" ]
null
null
null
Bibliotecas_e_Drives/Bibliot_ESP8266_ESP32_IDE-Arduino/ArduinoWebsockets/src/tiny_websockets/network/windows/win_tcp_server.hpp
francenylson/Robotica_ESP8266
882568b2656d319144aa19b3f34a0caf3c132b22
[ "MIT" ]
null
null
null
Bibliotecas_e_Drives/Bibliot_ESP8266_ESP32_IDE-Arduino/ArduinoWebsockets/src/tiny_websockets/network/windows/win_tcp_server.hpp
francenylson/Robotica_ESP8266
882568b2656d319144aa19b3f34a0caf3c132b22
[ "MIT" ]
null
null
null
#pragma once #ifdef _WIN32 #include <tiny_websockets/internals/ws_common.hpp> #include <tiny_websockets/network/tcp_server.hpp> #define WIN32_LEAN_AND_MEAN #undef _WIN32_WINNT #define _WIN32_WINNT 0x501 #include <winsock2.h> #include <windows.h> #include <ws2tcpip.h> #include <stdlib.h> #include <stdio.h> namespace websockets { namespace network { class WinTcpServer : public TcpServer { public: bool listen(uint16_t port) override; TcpClient* accept() override; bool available() override; bool poll() override; void close() override; virtual ~WinTcpServer(); protected: int getSocket() const override; private: SOCKET socket; }; }} // websockets::network #endif // #ifdef _WIN32
20.447368
50
0.682111
francenylson
a6b23fcdce80779e333deb13b4de4e1d8816c3c4
2,088
cpp
C++
Analysis/MapLab/min_common_lib_test/test_temp_file.cpp
konradotto/TS
bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e
[ "Apache-2.0" ]
125
2015-01-22T05:43:23.000Z
2022-03-22T17:15:59.000Z
Analysis/MapLab/min_common_lib_test/test_temp_file.cpp
konradotto/TS
bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e
[ "Apache-2.0" ]
59
2015-02-10T09:13:06.000Z
2021-11-11T02:32:38.000Z
Analysis/MapLab/min_common_lib_test/test_temp_file.cpp
konradotto/TS
bf088bd8432b1e3f4b8c8c083650a30d9ef2ae2e
[ "Apache-2.0" ]
98
2015-01-17T01:25:10.000Z
2022-03-18T17:29:42.000Z
/* Copyright (C) 2015 Ion Torrent Systems, Inc. All Rights Reserved. */ ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// #include "test_temp_file.h" #include <unistd.h> #include <fcntl.h> #include <fileutils.h> bool TestTempFile::process () { std::string default_tmpdir = temp_dir (); o_ << "Default temp directory is " << default_tmpdir << std::endl; std::string current_tmpdir = temp_dir ("."); o_ << "Temp directory for passed '.' is " << current_tmpdir << std::endl; std::string default_fname = make_temp_fname (); o_ << "Default temp file name is " << default_fname << std::endl; std::string kokos_fname = make_temp_fname (NULL, "kokos_"); o_ << "Temp file name for prefix 'kokos_' is " << kokos_fname << std::endl; std::string dest; int fhandle = make_linked_temp_file (dest); o_ << "Temp file created, name is " << dest << ", fhandle is " << fhandle << std::endl; const char TESTDATA [] = "This Is Test Data!"; size_t wr = ::write (fhandle, TESTDATA, sizeof (TESTDATA)); if (wr != sizeof (TESTDATA)) ers << "Unable to write complete test string" << Throw; if (::close (fhandle)) ers << "Unable to close file" << Throw; o_ << wr << " bytes written, file closed" << std::endl; char buf [sizeof (TESTDATA)]; fhandle = ::open64 (dest.c_str (), O_RDONLY); if (fhandle == -1) ers << "Unable to reopen file for reading" << Throw; size_t rd = ::read (fhandle, buf, sizeof (TESTDATA)); if (rd != sizeof (TESTDATA)) ers << "Can not fully read data from file" << Throw; if (strcmp (buf, TESTDATA)) ers << "Wrong data read: " << buf << ", expected " << TESTDATA << Throw; if (::close (fhandle)) ers << "Unable to close file" << Throw; if (::unlink (dest.c_str ())) ers << "Unable to unlink file " << dest << Throw; o_ << "write / close / reopen / read / verify / unlink test successfull" << std::endl; return true; }
40.941176
91
0.55795
konradotto
a6b2aa30c32d3e2c41525105c5e27b15eb01670a
593
cpp
C++
hooks/weapons/weapon_fire_inject.cpp
Lucifirius/yzoriansteampunk
7b629ffd9740f0ff3db1fb8cffe07f45b7528854
[ "Unlicense" ]
null
null
null
hooks/weapons/weapon_fire_inject.cpp
Lucifirius/yzoriansteampunk
7b629ffd9740f0ff3db1fb8cffe07f45b7528854
[ "Unlicense" ]
null
null
null
hooks/weapons/weapon_fire_inject.cpp
Lucifirius/yzoriansteampunk
7b629ffd9740f0ff3db1fb8cffe07f45b7528854
[ "Unlicense" ]
null
null
null
//Injector source file for the Weapon Fire hook module. #include "weapon_fire.h" #include <hook_tools.h> namespace { void __declspec(naked) fireWeaponWrapper() { static CUnit* unit; static u8 weaponId; __asm { PUSH EBP MOV EBP, ESP MOVZX EAX, [EBP+0x08] MOV weaponId, AL MOV unit, ESI PUSHAD } hooks::fireWeaponHook(unit, weaponId); __asm { POPAD MOV ESP, EBP POP EBP RETN 4 } } } //Unnamed namespace extern const u32 Func_FireUnitWeapon; namespace hooks { void injectWeaponFireHooks() { jmpPatch(fireWeaponWrapper, Func_FireUnitWeapon, 0); } } //hooks
13.790698
55
0.709949
Lucifirius
a6b383c81ac60616678be98f148ad798a3755cec
200,736
inl
C++
2d_samples/pmj02_344.inl
st-ario/rayme
315c57c23f4aa4934a8a80e84e3243acd3400808
[ "MIT" ]
1
2021-12-10T23:35:04.000Z
2021-12-10T23:35:04.000Z
2d_samples/pmj02_344.inl
st-ario/rayme
315c57c23f4aa4934a8a80e84e3243acd3400808
[ "MIT" ]
null
null
null
2d_samples/pmj02_344.inl
st-ario/rayme
315c57c23f4aa4934a8a80e84e3243acd3400808
[ "MIT" ]
null
null
null
{std::array<float,2>{0.228854537f, 0.699147999f}, std::array<float,2>{0.952923894f, 0.237815425f}, std::array<float,2>{0.70954746f, 0.808866024f}, std::array<float,2>{0.422894925f, 0.445519507f}, std::array<float,2>{0.30648163f, 0.966786563f}, std::array<float,2>{0.569666564f, 0.372576654f}, std::array<float,2>{0.808057725f, 0.624266744f}, std::array<float,2>{0.0640059263f, 0.0857866481f}, std::array<float,2>{0.449965656f, 0.539549291f}, std::array<float,2>{0.642266452f, 0.0281394627f}, std::array<float,2>{0.916106582f, 0.927732527f}, std::array<float,2>{0.163366735f, 0.295351088f}, std::array<float,2>{0.0553571135f, 0.831291735f}, std::array<float,2>{0.835504651f, 0.387248397f}, std::array<float,2>{0.518502235f, 0.647173285f}, std::array<float,2>{0.337633461f, 0.14827697f}, std::array<float,2>{0.102396838f, 0.576171517f}, std::array<float,2>{0.752262235f, 0.10761264f}, std::array<float,2>{0.597673953f, 0.993513465f}, std::array<float,2>{0.255222142f, 0.341780216f}, std::array<float,2>{0.380553365f, 0.758518815f}, std::array<float,2>{0.749239326f, 0.493067414f}, std::array<float,2>{0.992315292f, 0.72107017f}, std::array<float,2>{0.209763333f, 0.214101866f}, std::array<float,2>{0.346545368f, 0.661418617f}, std::array<float,2>{0.533296049f, 0.167133316f}, std::array<float,2>{0.861511052f, 0.847624123f}, std::array<float,2>{0.000147525221f, 0.411086053f}, std::array<float,2>{0.146902233f, 0.898221612f}, std::array<float,2>{0.88700211f, 0.252441972f}, std::array<float,2>{0.659477174f, 0.530583799f}, std::array<float,2>{0.47502172f, 0.0334195197f}, std::array<float,2>{0.0307783373f, 0.631329358f}, std::array<float,2>{0.85286665f, 0.138047621f}, std::array<float,2>{0.56205982f, 0.812727571f}, std::array<float,2>{0.374800742f, 0.403753787f}, std::array<float,2>{0.484699607f, 0.908915222f}, std::array<float,2>{0.67899406f, 0.297136843f}, std::array<float,2>{0.890980601f, 0.55475992f}, std::array<float,2>{0.134954736f, 0.0139555605f}, std::array<float,2>{0.277899086f, 0.595706463f}, std::array<float,2>{0.617442787f, 0.0684518144f}, std::array<float,2>{0.775208116f, 0.951279938f}, std::array<float,2>{0.120081775f, 0.356185615f}, std::array<float,2>{0.196613565f, 0.783655703f}, std::array<float,2>{0.979151905f, 0.455324799f}, std::array<float,2>{0.724030674f, 0.706582189f}, std::array<float,2>{0.392209649f, 0.225704849f}, std::array<float,2>{0.174870104f, 0.501496434f}, std::array<float,2>{0.934394836f, 0.0568016917f}, std::array<float,2>{0.629261732f, 0.876619935f}, std::array<float,2>{0.466837138f, 0.273116499f}, std::array<float,2>{0.314677447f, 0.870657682f}, std::array<float,2>{0.510174572f, 0.427964419f}, std::array<float,2>{0.822266698f, 0.673307955f}, std::array<float,2>{0.0385836624f, 0.182080925f}, std::array<float,2>{0.413521081f, 0.739377618f}, std::array<float,2>{0.702884912f, 0.201707125f}, std::array<float,2>{0.956062973f, 0.766449273f}, std::array<float,2>{0.243516356f, 0.469329387f}, std::array<float,2>{0.0836177692f, 0.982613206f}, std::array<float,2>{0.781338096f, 0.321356297f}, std::array<float,2>{0.578647077f, 0.592184067f}, std::array<float,2>{0.295264781f, 0.11001078f}, std::array<float,2>{0.125748739f, 0.682356238f}, std::array<float,2>{0.901858628f, 0.173525453f}, std::array<float,2>{0.684011519f, 0.861503363f}, std::array<float,2>{0.495577037f, 0.435178071f}, std::array<float,2>{0.360116541f, 0.884783149f}, std::array<float,2>{0.549943566f, 0.280314386f}, std::array<float,2>{0.846073747f, 0.514712155f}, std::array<float,2>{0.0204511974f, 0.0523715429f}, std::array<float,2>{0.401484281f, 0.580371737f}, std::array<float,2>{0.730837524f, 0.122942775f}, std::array<float,2>{0.976035297f, 0.969501853f}, std::array<float,2>{0.193014741f, 0.320206076f}, std::array<float,2>{0.110168256f, 0.773463428f}, std::array<float,2>{0.769399881f, 0.47796458f}, std::array<float,2>{0.611301661f, 0.747958064f}, std::array<float,2>{0.272913814f, 0.190836251f}, std::array<float,2>{0.0408542976f, 0.554521203f}, std::array<float,2>{0.814290464f, 0.00757627096f}, std::array<float,2>{0.505246997f, 0.918568313f}, std::array<float,2>{0.321374297f, 0.308784574f}, std::array<float,2>{0.458367586f, 0.820905268f}, std::array<float,2>{0.635493577f, 0.396799028f}, std::array<float,2>{0.926512241f, 0.639851809f}, std::array<float,2>{0.185262173f, 0.127789587f}, std::array<float,2>{0.281331867f, 0.716848373f}, std::array<float,2>{0.588846564f, 0.232830867f}, std::array<float,2>{0.79434818f, 0.789590955f}, std::array<float,2>{0.0911184475f, 0.467726558f}, std::array<float,2>{0.239622846f, 0.938609779f}, std::array<float,2>{0.968136847f, 0.350122899f}, std::array<float,2>{0.691112995f, 0.607357502f}, std::array<float,2>{0.414320856f, 0.0775245056f}, std::array<float,2>{0.0735915229f, 0.733716071f}, std::array<float,2>{0.799731195f, 0.206218496f}, std::array<float,2>{0.573680162f, 0.756621242f}, std::array<float,2>{0.301793277f, 0.48942101f}, std::array<float,2>{0.433246523f, 0.985693753f}, std::array<float,2>{0.712837934f, 0.33529222f}, std::array<float,2>{0.943504214f, 0.566468298f}, std::array<float,2>{0.223297283f, 0.101519577f}, std::array<float,2>{0.332776308f, 0.521107316f}, std::array<float,2>{0.527191341f, 0.0400738791f}, std::array<float,2>{0.843552649f, 0.89920187f}, std::array<float,2>{0.0519144386f, 0.265404135f}, std::array<float,2>{0.165046677f, 0.855914354f}, std::array<float,2>{0.910322011f, 0.41940698f}, std::array<float,2>{0.648812473f, 0.66599071f}, std::array<float,2>{0.441175222f, 0.160486192f}, std::array<float,2>{0.214720249f, 0.611247659f}, std::array<float,2>{0.989794433f, 0.0859829336f}, std::array<float,2>{0.737735152f, 0.954890728f}, std::array<float,2>{0.38525039f, 0.359699816f}, std::array<float,2>{0.259371668f, 0.797128916f}, std::array<float,2>{0.607369602f, 0.44456625f}, std::array<float,2>{0.762625754f, 0.690574586f}, std::array<float,2>{0.0991009399f, 0.247358203f}, std::array<float,2>{0.483793944f, 0.653531611f}, std::array<float,2>{0.668956578f, 0.152844802f}, std::array<float,2>{0.882029176f, 0.838077247f}, std::array<float,2>{0.150356084f, 0.382148117f}, std::array<float,2>{0.0105767259f, 0.933731139f}, std::array<float,2>{0.874123275f, 0.285107434f}, std::array<float,2>{0.540078938f, 0.534193695f}, std::array<float,2>{0.355032265f, 0.0209324248f}, std::array<float,2>{0.159394264f, 0.744783819f}, std::array<float,2>{0.917981625f, 0.193170503f}, std::array<float,2>{0.64613694f, 0.779729605f}, std::array<float,2>{0.44918406f, 0.480979443f}, std::array<float,2>{0.343522012f, 0.975869775f}, std::array<float,2>{0.521855175f, 0.31291768f}, std::array<float,2>{0.829633892f, 0.582173526f}, std::array<float,2>{0.0606718175f, 0.120824173f}, std::array<float,2>{0.425996035f, 0.510507166f}, std::array<float,2>{0.704169154f, 0.0495118313f}, std::array<float,2>{0.947782278f, 0.887764633f}, std::array<float,2>{0.23421149f, 0.275549829f}, std::array<float,2>{0.068789497f, 0.865595698f}, std::array<float,2>{0.81160605f, 0.429752618f}, std::array<float,2>{0.56572628f, 0.685147941f}, std::array<float,2>{0.310299575f, 0.177456141f}, std::array<float,2>{0.00715639722f, 0.604965329f}, std::array<float,2>{0.864150822f, 0.0712434873f}, std::array<float,2>{0.536175013f, 0.944919288f}, std::array<float,2>{0.349377185f, 0.345806658f}, std::array<float,2>{0.470420837f, 0.793329895f}, std::array<float,2>{0.663675547f, 0.464315683f}, std::array<float,2>{0.886545062f, 0.713041842f}, std::array<float,2>{0.142806053f, 0.228723973f}, std::array<float,2>{0.251178503f, 0.635650516f}, std::array<float,2>{0.596480906f, 0.131009579f}, std::array<float,2>{0.757166564f, 0.824319065f}, std::array<float,2>{0.108883664f, 0.390849024f}, std::array<float,2>{0.205640197f, 0.916798532f}, std::array<float,2>{0.99645859f, 0.305241257f}, std::array<float,2>{0.74554497f, 0.549429715f}, std::array<float,2>{0.37803936f, 0.00276688696f}, std::array<float,2>{0.124696575f, 0.668128788f}, std::array<float,2>{0.779143453f, 0.159246907f}, std::array<float,2>{0.621881187f, 0.852713585f}, std::array<float,2>{0.277069807f, 0.415876925f}, std::array<float,2>{0.396416575f, 0.90580523f}, std::array<float,2>{0.722299814f, 0.261476815f}, std::array<float,2>{0.983914435f, 0.518451035f}, std::array<float,2>{0.200962767f, 0.0458805375f}, std::array<float,2>{0.369603992f, 0.564335763f}, std::array<float,2>{0.556571007f, 0.0942253917f}, std::array<float,2>{0.858289182f, 0.989390671f}, std::array<float,2>{0.0242793281f, 0.329719096f}, std::array<float,2>{0.138841465f, 0.753140092f}, std::array<float,2>{0.8971591f, 0.485942215f}, std::array<float,2>{0.672089994f, 0.730384052f}, std::array<float,2>{0.490196705f, 0.20873329f}, std::array<float,2>{0.24776563f, 0.538816273f}, std::array<float,2>{0.959113538f, 0.0174312685f}, std::array<float,2>{0.69783783f, 0.930477977f}, std::array<float,2>{0.409939885f, 0.288513094f}, std::array<float,2>{0.292963862f, 0.839960158f}, std::array<float,2>{0.584650993f, 0.376484364f}, std::array<float,2>{0.786014318f, 0.650705755f}, std::array<float,2>{0.0819639266f, 0.148475572f}, std::array<float,2>{0.461939871f, 0.694781244f}, std::array<float,2>{0.62725246f, 0.246060789f}, std::array<float,2>{0.929906428f, 0.803132117f}, std::array<float,2>{0.177703947f, 0.440295815f}, std::array<float,2>{0.0325124934f, 0.958020389f}, std::array<float,2>{0.825307667f, 0.364049107f}, std::array<float,2>{0.514864445f, 0.614893675f}, std::array<float,2>{0.320026547f, 0.0903000161f}, std::array<float,2>{0.188713536f, 0.641161978f}, std::array<float,2>{0.970804214f, 0.142178401f}, std::array<float,2>{0.730075777f, 0.834768593f}, std::array<float,2>{0.405819803f, 0.382867008f}, std::array<float,2>{0.266442448f, 0.924963713f}, std::array<float,2>{0.616432011f, 0.290228277f}, std::array<float,2>{0.769776046f, 0.543260932f}, std::array<float,2>{0.113304816f, 0.0271579176f}, std::array<float,2>{0.499370635f, 0.619900227f}, std::array<float,2>{0.680188239f, 0.0803615302f}, std::array<float,2>{0.904478848f, 0.963642359f}, std::array<float,2>{0.13131626f, 0.369936854f}, std::array<float,2>{0.0168664549f, 0.806867957f}, std::array<float,2>{0.847926021f, 0.449717879f}, std::array<float,2>{0.554129601f, 0.699730217f}, std::array<float,2>{0.366654992f, 0.240013227f}, std::array<float,2>{0.0879876316f, 0.527181387f}, std::array<float,2>{0.789907873f, 0.0372415856f}, std::array<float,2>{0.590043366f, 0.892857075f}, std::array<float,2>{0.289011419f, 0.255867064f}, std::array<float,2>{0.418325394f, 0.850404918f}, std::array<float,2>{0.691848159f, 0.409888059f}, std::array<float,2>{0.964174449f, 0.658270538f}, std::array<float,2>{0.235051394f, 0.168025509f}, std::array<float,2>{0.32448411f, 0.72330308f}, std::array<float,2>{0.503049433f, 0.21661219f}, std::array<float,2>{0.820288301f, 0.763198972f}, std::array<float,2>{0.0468605869f, 0.49824518f}, std::array<float,2>{0.181440547f, 0.998392522f}, std::array<float,2>{0.923024297f, 0.3395257f}, std::array<float,2>{0.639219582f, 0.571611345f}, std::array<float,2>{0.455766469f, 0.10198158f}, std::array<float,2>{0.0497296154f, 0.70867902f}, std::array<float,2>{0.838302195f, 0.220508948f}, std::array<float,2>{0.530905902f, 0.786215901f}, std::array<float,2>{0.330670625f, 0.458915472f}, std::array<float,2>{0.442171156f, 0.945900798f}, std::array<float,2>{0.652604938f, 0.355260938f}, std::array<float,2>{0.909218907f, 0.600652397f}, std::array<float,2>{0.168747649f, 0.063365452f}, std::array<float,2>{0.300554603f, 0.561914742f}, std::array<float,2>{0.575746357f, 0.0114891576f}, std::array<float,2>{0.803700686f, 0.913764119f}, std::array<float,2>{0.0772512332f, 0.302632064f}, std::array<float,2>{0.220018551f, 0.818413258f}, std::array<float,2>{0.940444589f, 0.400071055f}, std::array<float,2>{0.71727562f, 0.627962887f}, std::array<float,2>{0.436092407f, 0.135138407f}, std::array<float,2>{0.153833643f, 0.588145792f}, std::array<float,2>{0.876194f, 0.115563467f}, std::array<float,2>{0.665824175f, 0.977480173f}, std::array<float,2>{0.479826033f, 0.32468465f}, std::array<float,2>{0.355835885f, 0.772928536f}, std::array<float,2>{0.543976068f, 0.476122528f}, std::array<float,2>{0.870344162f, 0.735672116f}, std::array<float,2>{0.014430589f, 0.197334811f}, std::array<float,2>{0.390476823f, 0.679045081f}, std::array<float,2>{0.74140054f, 0.187232494f}, std::array<float,2>{0.987408876f, 0.874382019f}, std::array<float,2>{0.21738416f, 0.424224079f}, std::array<float,2>{0.0965783596f, 0.882451177f}, std::array<float,2>{0.760753393f, 0.268703729f}, std::array<float,2>{0.603039861f, 0.504784822f}, std::array<float,2>{0.263723165f, 0.0607873239f}, std::array<float,2>{0.207085326f, 0.719506323f}, std::array<float,2>{0.995275795f, 0.212766558f}, std::array<float,2>{0.747832716f, 0.760200441f}, std::array<float,2>{0.381402999f, 0.494668543f}, std::array<float,2>{0.25720796f, 0.995213091f}, std::array<float,2>{0.600749671f, 0.343706727f}, std::array<float,2>{0.750037551f, 0.577989638f}, std::array<float,2>{0.104814932f, 0.106927484f}, std::array<float,2>{0.472789288f, 0.527532279f}, std::array<float,2>{0.656395495f, 0.0320011005f}, std::array<float,2>{0.889411032f, 0.895987809f}, std::array<float,2>{0.145430833f, 0.251098454f}, std::array<float,2>{0.00199523452f, 0.845520318f}, std::array<float,2>{0.860383928f, 0.412460268f}, std::array<float,2>{0.531681478f, 0.662232697f}, std::array<float,2>{0.343942493f, 0.16458112f}, std::array<float,2>{0.0644731671f, 0.62240535f}, std::array<float,2>{0.805731833f, 0.0837097988f}, std::array<float,2>{0.568265975f, 0.96692121f}, std::array<float,2>{0.306791425f, 0.374401003f}, std::array<float,2>{0.425586164f, 0.81141752f}, std::array<float,2>{0.707920134f, 0.447352171f}, std::array<float,2>{0.951115429f, 0.695452869f}, std::array<float,2>{0.227450147f, 0.236211479f}, std::array<float,2>{0.338466465f, 0.645902216f}, std::array<float,2>{0.517474115f, 0.144954637f}, std::array<float,2>{0.832675278f, 0.829187214f}, std::array<float,2>{0.0573786907f, 0.390318394f}, std::array<float,2>{0.161509603f, 0.927776814f}, std::array<float,2>{0.915704489f, 0.293897092f}, std::array<float,2>{0.642887235f, 0.541985333f}, std::array<float,2>{0.451747149f, 0.0302339718f}, std::array<float,2>{0.0361896381f, 0.675757289f}, std::array<float,2>{0.820796669f, 0.180977225f}, std::array<float,2>{0.509142339f, 0.868184865f}, std::array<float,2>{0.313532352f, 0.426736206f}, std::array<float,2>{0.466424167f, 0.876958132f}, std::array<float,2>{0.631872952f, 0.270758361f}, std::array<float,2>{0.936006844f, 0.503409624f}, std::array<float,2>{0.172356218f, 0.0557202697f}, std::array<float,2>{0.293373436f, 0.59111172f}, std::array<float,2>{0.581210673f, 0.112671323f}, std::array<float,2>{0.784780622f, 0.981170475f}, std::array<float,2>{0.0846455395f, 0.323001623f}, std::array<float,2>{0.244295433f, 0.769209146f}, std::array<float,2>{0.953390241f, 0.471207947f}, std::array<float,2>{0.700271726f, 0.740424514f}, std::array<float,2>{0.411935657f, 0.200300351f}, std::array<float,2>{0.13331221f, 0.557663321f}, std::array<float,2>{0.892813265f, 0.0136104682f}, std::array<float,2>{0.675903261f, 0.907286584f}, std::array<float,2>{0.487975717f, 0.300055504f}, std::array<float,2>{0.371160388f, 0.816306353f}, std::array<float,2>{0.560237885f, 0.406133801f}, std::array<float,2>{0.854894698f, 0.629515946f}, std::array<float,2>{0.0286249667f, 0.140236676f}, std::array<float,2>{0.392856836f, 0.70374018f}, std::array<float,2>{0.726179242f, 0.224290133f}, std::array<float,2>{0.976661325f, 0.782652855f}, std::array<float,2>{0.198074281f, 0.453656673f}, std::array<float,2>{0.118871599f, 0.950847745f}, std::array<float,2>{0.776051641f, 0.358620942f}, std::array<float,2>{0.619683206f, 0.595018566f}, std::array<float,2>{0.279778898f, 0.0664967299f}, std::array<float,2>{0.187445357f, 0.637826562f}, std::array<float,2>{0.928796113f, 0.125601336f}, std::array<float,2>{0.63460201f, 0.822441399f}, std::array<float,2>{0.45915094f, 0.39506337f}, std::array<float,2>{0.322861522f, 0.920560956f}, std::array<float,2>{0.506286681f, 0.31156826f}, std::array<float,2>{0.816140294f, 0.552370012f}, std::array<float,2>{0.0416891202f, 0.00504122209f}, std::array<float,2>{0.416713625f, 0.608368576f}, std::array<float,2>{0.688610196f, 0.0756171048f}, std::array<float,2>{0.965874374f, 0.940506101f}, std::array<float,2>{0.241365731f, 0.349263579f}, std::array<float,2>{0.093159087f, 0.792377591f}, std::array<float,2>{0.796546102f, 0.466754943f}, std::array<float,2>{0.586238801f, 0.714913368f}, std::array<float,2>{0.284611195f, 0.232401088f}, std::array<float,2>{0.0218862873f, 0.513572574f}, std::array<float,2>{0.845663071f, 0.0538301356f}, std::array<float,2>{0.548169434f, 0.884124756f}, std::array<float,2>{0.362306654f, 0.277679771f}, std::array<float,2>{0.49364531f, 0.859865904f}, std::array<float,2>{0.685570657f, 0.437006205f}, std::array<float,2>{0.899942279f, 0.680438876f}, std::array<float,2>{0.128336951f, 0.175205514f}, std::array<float,2>{0.270082653f, 0.749388754f}, std::array<float,2>{0.611652195f, 0.188101172f}, std::array<float,2>{0.766854346f, 0.777070165f}, std::array<float,2>{0.113123439f, 0.480089635f}, std::array<float,2>{0.193446264f, 0.972532034f}, std::array<float,2>{0.973333061f, 0.317575783f}, std::array<float,2>{0.732998073f, 0.578996897f}, std::array<float,2>{0.398453474f, 0.12387684f}, std::array<float,2>{0.10099081f, 0.688661039f}, std::array<float,2>{0.764051735f, 0.248881876f}, std::array<float,2>{0.608300745f, 0.800691009f}, std::array<float,2>{0.260563403f, 0.443057805f}, std::array<float,2>{0.384527445f, 0.956041217f}, std::array<float,2>{0.735477507f, 0.362866729f}, std::array<float,2>{0.990255892f, 0.611448526f}, std::array<float,2>{0.211231411f, 0.0880861506f}, std::array<float,2>{0.351650506f, 0.532263219f}, std::array<float,2>{0.5416013f, 0.0223800372f}, std::array<float,2>{0.871493757f, 0.937298298f}, std::array<float,2>{0.0080119241f, 0.281284779f}, std::array<float,2>{0.152002856f, 0.837637484f}, std::array<float,2>{0.879971802f, 0.379930049f}, std::array<float,2>{0.670384169f, 0.654540479f}, std::array<float,2>{0.480564266f, 0.156039715f}, std::array<float,2>{0.226345614f, 0.569787502f}, std::array<float,2>{0.941581309f, 0.0984032676f}, std::array<float,2>{0.71298337f, 0.986433983f}, std::array<float,2>{0.430967212f, 0.333913714f}, std::array<float,2>{0.304384768f, 0.75464201f}, std::array<float,2>{0.570320964f, 0.490671158f}, std::array<float,2>{0.798012972f, 0.731178105f}, std::array<float,2>{0.0705216154f, 0.203237981f}, std::array<float,2>{0.438865304f, 0.666171253f}, std::array<float,2>{0.651893973f, 0.162221715f}, std::array<float,2>{0.913696349f, 0.859078765f}, std::array<float,2>{0.167643413f, 0.421679258f}, std::array<float,2>{0.0533023588f, 0.901845872f}, std::array<float,2>{0.840926528f, 0.263061672f}, std::array<float,2>{0.523897707f, 0.521742582f}, std::array<float,2>{0.334713608f, 0.042089466f}, std::array<float,2>{0.140826851f, 0.712578595f}, std::array<float,2>{0.883756816f, 0.22744827f}, std::array<float,2>{0.662026525f, 0.795954764f}, std::array<float,2>{0.471771955f, 0.461058706f}, std::array<float,2>{0.350060135f, 0.942040801f}, std::array<float,2>{0.537315249f, 0.344471902f}, std::array<float,2>{0.865700901f, 0.602428019f}, std::array<float,2>{0.00436072657f, 0.073118709f}, std::array<float,2>{0.376302838f, 0.548274219f}, std::array<float,2>{0.743275166f, 0.000795813161f}, std::array<float,2>{0.998198509f, 0.915487051f}, std::array<float,2>{0.205013618f, 0.307862937f}, std::array<float,2>{0.106220111f, 0.828049719f}, std::array<float,2>{0.754392624f, 0.392597467f}, std::array<float,2>{0.59528029f, 0.633599281f}, std::array<float,2>{0.252176046f, 0.130284742f}, std::array<float,2>{0.0600601733f, 0.58471483f}, std::array<float,2>{0.83148402f, 0.117491156f}, std::array<float,2>{0.52076602f, 0.973038256f}, std::array<float,2>{0.340089411f, 0.316103309f}, std::array<float,2>{0.446368247f, 0.778573513f}, std::array<float,2>{0.646814823f, 0.483137488f}, std::array<float,2>{0.920656025f, 0.743535101f}, std::array<float,2>{0.158030599f, 0.193980351f}, std::array<float,2>{0.311669677f, 0.685949028f}, std::array<float,2>{0.563671291f, 0.178207979f}, std::array<float,2>{0.809124172f, 0.863839388f}, std::array<float,2>{0.0665836334f, 0.432446659f}, std::array<float,2>{0.231074542f, 0.888901114f}, std::array<float,2>{0.947014272f, 0.273456752f}, std::array<float,2>{0.706228912f, 0.508774579f}, std::array<float,2>{0.42922467f, 0.0470957309f}, std::array<float,2>{0.0796649307f, 0.650031984f}, std::array<float,2>{0.787753165f, 0.151214704f}, std::array<float,2>{0.583395958f, 0.843715191f}, std::array<float,2>{0.290666878f, 0.377878159f}, std::array<float,2>{0.407361567f, 0.932293773f}, std::array<float,2>{0.696286559f, 0.286685258f}, std::array<float,2>{0.958786249f, 0.536532402f}, std::array<float,2>{0.249072343f, 0.0189339351f}, std::array<float,2>{0.317650706f, 0.615462661f}, std::array<float,2>{0.512891173f, 0.0919862762f}, std::array<float,2>{0.827298582f, 0.959684551f}, std::array<float,2>{0.0348843373f, 0.365692794f}, std::array<float,2>{0.179310054f, 0.801614106f}, std::array<float,2>{0.932823062f, 0.43888247f}, std::array<float,2>{0.625038922f, 0.692159235f}, std::array<float,2>{0.463384777f, 0.242265925f}, std::array<float,2>{0.201920509f, 0.516088188f}, std::array<float,2>{0.980754972f, 0.0442488976f}, std::array<float,2>{0.719977915f, 0.904062986f}, std::array<float,2>{0.398348212f, 0.257988364f}, std::array<float,2>{0.274874687f, 0.854375064f}, std::array<float,2>{0.623220384f, 0.416990668f}, std::array<float,2>{0.780627131f, 0.670711637f}, std::array<float,2>{0.122845061f, 0.157503769f}, std::array<float,2>{0.490499467f, 0.7278108f}, std::array<float,2>{0.674741507f, 0.209241495f}, std::array<float,2>{0.89608568f, 0.750126898f}, std::array<float,2>{0.13693276f, 0.487814188f}, std::array<float,2>{0.0258383676f, 0.991808474f}, std::array<float,2>{0.855920076f, 0.330858737f}, std::array<float,2>{0.556971252f, 0.564623177f}, std::array<float,2>{0.368411779f, 0.0961024463f}, std::array<float,2>{0.237628266f, 0.656571865f}, std::array<float,2>{0.961794913f, 0.171495914f}, std::array<float,2>{0.694239974f, 0.84853822f}, std::array<float,2>{0.420010835f, 0.4065063f}, std::array<float,2>{0.286863178f, 0.891130328f}, std::array<float,2>{0.593571424f, 0.254113555f}, std::array<float,2>{0.791040242f, 0.524650156f}, std::array<float,2>{0.0861809552f, 0.0363583826f}, std::array<float,2>{0.45325613f, 0.572714984f}, std::array<float,2>{0.637186944f, 0.104399949f}, std::array<float,2>{0.924885333f, 0.996131241f}, std::array<float,2>{0.181675822f, 0.336746156f}, std::array<float,2>{0.0429695956f, 0.764970958f}, std::array<float,2>{0.816810489f, 0.496132821f}, std::array<float,2>{0.500040293f, 0.72611779f}, std::array<float,2>{0.32800132f, 0.217818707f}, std::array<float,2>{0.117075115f, 0.546728253f}, std::array<float,2>{0.773234069f, 0.0234574266f}, std::array<float,2>{0.61483109f, 0.923043787f}, std::array<float,2>{0.268917143f, 0.292104661f}, std::array<float,2>{0.403369933f, 0.833701134f}, std::array<float,2>{0.727993965f, 0.385695934f}, std::array<float,2>{0.969537854f, 0.643620551f}, std::array<float,2>{0.189462617f, 0.144147724f}, std::array<float,2>{0.363894194f, 0.701736569f}, std::array<float,2>{0.55121243f, 0.240450695f}, std::array<float,2>{0.850582838f, 0.804977655f}, std::array<float,2>{0.0183366258f, 0.451224715f}, std::array<float,2>{0.129502848f, 0.961287856f}, std::array<float,2>{0.904059887f, 0.368861109f}, std::array<float,2>{0.682823718f, 0.617994666f}, std::array<float,2>{0.496241003f, 0.0797935575f}, std::array<float,2>{0.0123889949f, 0.738103628f}, std::array<float,2>{0.868696094f, 0.195557326f}, std::array<float,2>{0.545740128f, 0.769993305f}, std::array<float,2>{0.357985586f, 0.473159581f}, std::array<float,2>{0.477347583f, 0.97875607f}, std::array<float,2>{0.667345583f, 0.327719152f}, std::array<float,2>{0.878333807f, 0.587323844f}, std::array<float,2>{0.154399887f, 0.113860793f}, std::array<float,2>{0.262790799f, 0.506552815f}, std::array<float,2>{0.604467511f, 0.0595012903f}, std::array<float,2>{0.758004427f, 0.879553974f}, std::array<float,2>{0.0938281789f, 0.266924798f}, std::array<float,2>{0.215201169f, 0.871902287f}, std::array<float,2>{0.984707773f, 0.423148781f}, std::array<float,2>{0.740140796f, 0.676416516f}, std::array<float,2>{0.388376266f, 0.185115874f}, std::array<float,2>{0.171792477f, 0.5976758f}, std::array<float,2>{0.907753229f, 0.0649792328f}, std::array<float,2>{0.656072438f, 0.948198557f}, std::array<float,2>{0.444215089f, 0.352431536f}, std::array<float,2>{0.32915163f, 0.788270652f}, std::array<float,2>{0.528372109f, 0.459258169f}, std::array<float,2>{0.837271392f, 0.709498107f}, std::array<float,2>{0.0484775007f, 0.222163469f}, std::array<float,2>{0.435107112f, 0.626204789f}, std::array<float,2>{0.715209603f, 0.133827448f}, std::array<float,2>{0.9385795f, 0.817133546f}, std::array<float,2>{0.222084612f, 0.400698036f}, std::array<float,2>{0.0743567795f, 0.911792338f}, std::array<float,2>{0.802231848f, 0.302775472f}, std::array<float,2>{0.57755506f, 0.559847295f}, std::array<float,2>{0.2968961f, 0.00848079473f}, std::array<float,2>{0.198353618f, 0.705350041f}, std::array<float,2>{0.977547228f, 0.225303814f}, std::array<float,2>{0.724888444f, 0.784558475f}, std::array<float,2>{0.393895268f, 0.456056207f}, std::array<float,2>{0.28104195f, 0.952279747f}, std::array<float,2>{0.620368898f, 0.357308924f}, std::array<float,2>{0.776543021f, 0.596955597f}, std::array<float,2>{0.118027993f, 0.0701151192f}, std::array<float,2>{0.486973405f, 0.556323051f}, std::array<float,2>{0.677076757f, 0.0154091856f}, std::array<float,2>{0.893863916f, 0.909223974f}, std::array<float,2>{0.134517983f, 0.29848516f}, std::array<float,2>{0.0273625031f, 0.814441442f}, std::array<float,2>{0.853539109f, 0.40285489f}, std::array<float,2>{0.559447348f, 0.632733822f}, std::array<float,2>{0.372381538f, 0.137204379f}, std::array<float,2>{0.0851033553f, 0.593471467f}, std::array<float,2>{0.783750057f, 0.111253001f}, std::array<float,2>{0.58045423f, 0.984254301f}, std::array<float,2>{0.294791579f, 0.320319474f}, std::array<float,2>{0.410232544f, 0.767269731f}, std::array<float,2>{0.700003088f, 0.470097244f}, std::array<float,2>{0.954560816f, 0.738585651f}, std::array<float,2>{0.245417461f, 0.202207223f}, std::array<float,2>{0.313123345f, 0.672799885f}, std::array<float,2>{0.508530319f, 0.182811007f}, std::array<float,2>{0.821426272f, 0.869554043f}, std::array<float,2>{0.0358752906f, 0.428814858f}, std::array<float,2>{0.173033819f, 0.8752473f}, std::array<float,2>{0.937126279f, 0.271924198f}, std::array<float,2>{0.63171339f, 0.500071228f}, std::array<float,2>{0.464847565f, 0.0583661757f}, std::array<float,2>{0.0581922345f, 0.647583246f}, std::array<float,2>{0.833968937f, 0.146958604f}, std::array<float,2>{0.516410232f, 0.830939531f}, std::array<float,2>{0.339375556f, 0.387794256f}, std::array<float,2>{0.452631921f, 0.926061571f}, std::array<float,2>{0.64384377f, 0.296162844f}, std::array<float,2>{0.914115846f, 0.540435672f}, std::array<float,2>{0.160645291f, 0.0292402525f}, std::array<float,2>{0.307932764f, 0.623484075f}, std::array<float,2>{0.56684655f, 0.0848862901f}, std::array<float,2>{0.805402458f, 0.965060115f}, std::array<float,2>{0.0663034841f, 0.37137863f}, std::array<float,2>{0.228042364f, 0.809786975f}, std::array<float,2>{0.950029552f, 0.446656108f}, std::array<float,2>{0.70848465f, 0.698037088f}, std::array<float,2>{0.423976451f, 0.236823723f}, std::array<float,2>{0.145672172f, 0.529311538f}, std::array<float,2>{0.890387833f, 0.035143245f}, std::array<float,2>{0.657497227f, 0.897174776f}, std::array<float,2>{0.474128187f, 0.253154904f}, std::array<float,2>{0.345447183f, 0.846111774f}, std::array<float,2>{0.532909453f, 0.411477119f}, std::array<float,2>{0.859765947f, 0.660994947f}, std::array<float,2>{0.00364842871f, 0.166557372f}, std::array<float,2>{0.382030278f, 0.722050011f}, std::array<float,2>{0.746892333f, 0.213481292f}, std::array<float,2>{0.994965911f, 0.759750009f}, std::array<float,2>{0.208026141f, 0.49407354f}, std::array<float,2>{0.103889287f, 0.992439508f}, std::array<float,2>{0.751292109f, 0.339870304f}, std::array<float,2>{0.599798381f, 0.574478805f}, std::array<float,2>{0.256655425f, 0.109061502f}, std::array<float,2>{0.166375563f, 0.664063334f}, std::array<float,2>{0.912704289f, 0.161428586f}, std::array<float,2>{0.650660634f, 0.856903553f}, std::array<float,2>{0.438272446f, 0.418838978f}, std::array<float,2>{0.335522532f, 0.899503589f}, std::array<float,2>{0.52529335f, 0.264628053f}, std::array<float,2>{0.839854419f, 0.519900918f}, std::array<float,2>{0.0541126542f, 0.0396946296f}, std::array<float,2>{0.430312037f, 0.568338335f}, std::array<float,2>{0.713883102f, 0.100008525f}, std::array<float,2>{0.943300426f, 0.985150695f}, std::array<float,2>{0.225419447f, 0.334620178f}, std::array<float,2>{0.0719853565f, 0.756938696f}, std::array<float,2>{0.796989143f, 0.488899142f}, std::array<float,2>{0.571714342f, 0.733163118f}, std::array<float,2>{0.303210616f, 0.205823958f}, std::array<float,2>{0.00945513882f, 0.533566475f}, std::array<float,2>{0.872899532f, 0.0198053457f}, std::array<float,2>{0.542484343f, 0.934687555f}, std::array<float,2>{0.352872282f, 0.283866525f}, std::array<float,2>{0.481636167f, 0.839624286f}, std::array<float,2>{0.671268582f, 0.381634861f}, std::array<float,2>{0.879456222f, 0.652939618f}, std::array<float,2>{0.150470152f, 0.153855875f}, std::array<float,2>{0.260986149f, 0.689521074f}, std::array<float,2>{0.609246492f, 0.247034937f}, std::array<float,2>{0.765197277f, 0.798470497f}, std::array<float,2>{0.100434341f, 0.444088608f}, std::array<float,2>{0.212244958f, 0.953431487f}, std::array<float,2>{0.991885364f, 0.361154377f}, std::array<float,2>{0.73496294f, 0.60996592f}, std::array<float,2>{0.383426607f, 0.087129809f}, std::array<float,2>{0.111551441f, 0.74648726f}, std::array<float,2>{0.766311824f, 0.189456284f}, std::array<float,2>{0.612913191f, 0.77499181f}, std::array<float,2>{0.270748556f, 0.476603389f}, std::array<float,2>{0.399494827f, 0.970330596f}, std::array<float,2>{0.734219968f, 0.31909737f}, std::array<float,2>{0.973746777f, 0.581094921f}, std::array<float,2>{0.195291698f, 0.121878207f}, std::array<float,2>{0.361719519f, 0.514372826f}, std::array<float,2>{0.547782958f, 0.0515670627f}, std::array<float,2>{0.844028056f, 0.88635391f}, std::array<float,2>{0.0230330061f, 0.279949039f}, std::array<float,2>{0.127074778f, 0.862742841f}, std::array<float,2>{0.899412632f, 0.433597118f}, std::array<float,2>{0.686952651f, 0.682905853f}, std::array<float,2>{0.492378682f, 0.172838926f}, std::array<float,2>{0.241082609f, 0.60608989f}, std::array<float,2>{0.965220571f, 0.0769272968f}, std::array<float,2>{0.687539399f, 0.937658191f}, std::array<float,2>{0.417334795f, 0.350808114f}, std::array<float,2>{0.28389594f, 0.790737092f}, std::array<float,2>{0.5875687f, 0.468415916f}, std::array<float,2>{0.794971585f, 0.718454897f}, std::array<float,2>{0.0921529382f, 0.23378849f}, std::array<float,2>{0.46075201f, 0.639607906f}, std::array<float,2>{0.633591235f, 0.128144324f}, std::array<float,2>{0.928544343f, 0.82159102f}, std::array<float,2>{0.185927093f, 0.397624224f}, std::array<float,2>{0.0428310968f, 0.919408679f}, std::array<float,2>{0.814981222f, 0.310393184f}, std::array<float,2>{0.507084072f, 0.553271949f}, std::array<float,2>{0.323779017f, 0.00620458508f}, std::array<float,2>{0.138425902f, 0.72934413f}, std::array<float,2>{0.894721508f, 0.207382053f}, std::array<float,2>{0.675161958f, 0.751957774f}, std::array<float,2>{0.49205178f, 0.48497653f}, std::array<float,2>{0.367403358f, 0.9891119f}, std::array<float,2>{0.558354437f, 0.328415394f}, std::array<float,2>{0.856871188f, 0.562684357f}, std::array<float,2>{0.0272230543f, 0.0956414714f}, std::array<float,2>{0.397002637f, 0.519032121f}, std::array<float,2>{0.719166636f, 0.0466850176f}, std::array<float,2>{0.981594026f, 0.905084491f}, std::array<float,2>{0.202349648f, 0.260096133f}, std::array<float,2>{0.121587291f, 0.852242887f}, std::array<float,2>{0.77937597f, 0.414375186f}, std::array<float,2>{0.624831438f, 0.669763744f}, std::array<float,2>{0.273439854f, 0.159081265f}, std::array<float,2>{0.0333437361f, 0.613649309f}, std::array<float,2>{0.826896191f, 0.0916245133f}, std::array<float,2>{0.512130141f, 0.957691014f}, std::array<float,2>{0.316540569f, 0.364385813f}, std::array<float,2>{0.464466512f, 0.80394417f}, std::array<float,2>{0.626043916f, 0.441232204f}, std::array<float,2>{0.931726873f, 0.69344914f}, std::array<float,2>{0.177975804f, 0.244418055f}, std::array<float,2>{0.289656699f, 0.65198493f}, std::array<float,2>{0.582499206f, 0.15027222f}, std::array<float,2>{0.788241565f, 0.841341972f}, std::array<float,2>{0.079035677f, 0.375526875f}, std::array<float,2>{0.248293743f, 0.931526005f}, std::array<float,2>{0.957994461f, 0.288057685f}, std::array<float,2>{0.696400166f, 0.537968516f}, std::array<float,2>{0.406309873f, 0.0165430326f}, std::array<float,2>{0.0679653436f, 0.684071898f}, std::array<float,2>{0.81015408f, 0.176118642f}, std::array<float,2>{0.562678933f, 0.866719902f}, std::array<float,2>{0.31086728f, 0.431108177f}, std::array<float,2>{0.427851349f, 0.887146592f}, std::array<float,2>{0.705088198f, 0.277139634f}, std::array<float,2>{0.945932388f, 0.511170328f}, std::array<float,2>{0.231492788f, 0.0506841987f}, std::array<float,2>{0.341667801f, 0.583524227f}, std::array<float,2>{0.520363629f, 0.11954999f}, std::array<float,2>{0.830456674f, 0.975054801f}, std::array<float,2>{0.0587947965f, 0.314109594f}, std::array<float,2>{0.156545743f, 0.780775726f}, std::array<float,2>{0.9209342f, 0.481921256f}, std::array<float,2>{0.647974193f, 0.745482445f}, std::array<float,2>{0.445472062f, 0.192279831f}, std::array<float,2>{0.20406422f, 0.550323963f}, std::array<float,2>{0.999302924f, 0.00307429675f}, std::array<float,2>{0.742599845f, 0.917119443f}, std::array<float,2>{0.375498086f, 0.305851936f}, std::array<float,2>{0.253208011f, 0.825610697f}, std::array<float,2>{0.594528437f, 0.392264128f}, std::array<float,2>{0.755131364f, 0.636311769f}, std::array<float,2>{0.106929034f, 0.132233173f}, std::array<float,2>{0.470763713f, 0.714264393f}, std::array<float,2>{0.660809278f, 0.230053991f}, std::array<float,2>{0.884679735f, 0.794676423f}, std::array<float,2>{0.141983509f, 0.463615626f}, std::array<float,2>{0.00576416496f, 0.943493307f}, std::array<float,2>{0.867061377f, 0.346931159f}, std::array<float,2>{0.538762927f, 0.604147077f}, std::array<float,2>{0.351433963f, 0.0718373433f}, std::array<float,2>{0.22137928f, 0.627169132f}, std::array<float,2>{0.938091397f, 0.136678979f}, std::array<float,2>{0.716186464f, 0.81980443f}, std::array<float,2>{0.434225023f, 0.399159163f}, std::array<float,2>{0.298823565f, 0.912542403f}, std::array<float,2>{0.576243401f, 0.301015109f}, std::array<float,2>{0.801096559f, 0.561006367f}, std::array<float,2>{0.0757329091f, 0.00978708547f}, std::array<float,2>{0.444561988f, 0.600515962f}, std::array<float,2>{0.654433966f, 0.0635691583f}, std::array<float,2>{0.906464577f, 0.947085917f}, std::array<float,2>{0.170128137f, 0.354228616f}, std::array<float,2>{0.0472456217f, 0.785315335f}, std::array<float,2>{0.836328804f, 0.457959443f}, std::array<float,2>{0.52820152f, 0.707498848f}, std::array<float,2>{0.329058379f, 0.21949999f}, std::array<float,2>{0.0952759832f, 0.505185366f}, std::array<float,2>{0.759320855f, 0.0615687147f}, std::array<float,2>{0.605199277f, 0.881360829f}, std::array<float,2>{0.262651801f, 0.267836392f}, std::array<float,2>{0.386819601f, 0.873510718f}, std::array<float,2>{0.738980114f, 0.4250561f}, std::array<float,2>{0.985915482f, 0.678595364f}, std::array<float,2>{0.216233373f, 0.18603155f}, std::array<float,2>{0.358517021f, 0.735251665f}, std::array<float,2>{0.546186924f, 0.198819935f}, std::array<float,2>{0.867381155f, 0.772350132f}, std::array<float,2>{0.0133275464f, 0.47481066f}, std::array<float,2>{0.155512422f, 0.978120744f}, std::array<float,2>{0.877741098f, 0.325943381f}, std::array<float,2>{0.666917026f, 0.589565873f}, std::array<float,2>{0.478039175f, 0.116433077f}, std::array<float,2>{0.0192628242f, 0.700333655f}, std::array<float,2>{0.851330698f, 0.238759339f}, std::array<float,2>{0.551778913f, 0.80834341f}, std::array<float,2>{0.365206093f, 0.450650454f}, std::array<float,2>{0.497677624f, 0.964593112f}, std::array<float,2>{0.682450831f, 0.371042013f}, std::array<float,2>{0.903259039f, 0.620950878f}, std::array<float,2>{0.130574539f, 0.0818475336f}, std::array<float,2>{0.267653763f, 0.544821978f}, std::array<float,2>{0.613858461f, 0.0258654561f}, std::array<float,2>{0.772010028f, 0.924349606f}, std::array<float,2>{0.11568778f, 0.29001826f}, std::array<float,2>{0.19104743f, 0.835596979f}, std::array<float,2>{0.97015655f, 0.384508878f}, std::array<float,2>{0.727180719f, 0.641701162f}, std::array<float,2>{0.403219491f, 0.140696049f}, std::array<float,2>{0.183481634f, 0.571125865f}, std::array<float,2>{0.924632967f, 0.102980211f}, std::array<float,2>{0.638521552f, 0.99966681f}, std::array<float,2>{0.454971105f, 0.337998211f}, std::array<float,2>{0.32651031f, 0.762612045f}, std::array<float,2>{0.50132978f, 0.49931109f}, std::array<float,2>{0.818273365f, 0.723840952f}, std::array<float,2>{0.043959666f, 0.214846849f}, std::array<float,2>{0.420917809f, 0.659234881f}, std::array<float,2>{0.694456816f, 0.169646785f}, std::array<float,2>{0.962756097f, 0.851280749f}, std::array<float,2>{0.236881346f, 0.408765495f}, std::array<float,2>{0.0872652233f, 0.894180894f}, std::array<float,2>{0.792125821f, 0.256937027f}, std::array<float,2>{0.592701972f, 0.525878429f}, std::array<float,2>{0.285705596f, 0.0388379656f}, std::array<float,2>{0.242791981f, 0.742120385f}, std::array<float,2>{0.955154538f, 0.199446052f}, std::array<float,2>{0.701287627f, 0.768465698f}, std::array<float,2>{0.412846446f, 0.472580522f}, std::array<float,2>{0.296634287f, 0.981830418f}, std::array<float,2>{0.579833865f, 0.323571533f}, std::array<float,2>{0.782436609f, 0.590551257f}, std::array<float,2>{0.0828887224f, 0.111811943f}, std::array<float,2>{0.467810124f, 0.502863824f}, std::array<float,2>{0.630856276f, 0.055326324f}, std::array<float,2>{0.934631407f, 0.878294408f}, std::array<float,2>{0.174579248f, 0.269910693f}, std::array<float,2>{0.0376116559f, 0.867613733f}, std::array<float,2>{0.824198544f, 0.427137583f}, std::array<float,2>{0.511481822f, 0.674100578f}, std::array<float,2>{0.315474033f, 0.179826647f}, std::array<float,2>{0.120191082f, 0.59446609f}, std::array<float,2>{0.773820758f, 0.0675684959f}, std::array<float,2>{0.618604898f, 0.949377894f}, std::array<float,2>{0.279159188f, 0.357540011f}, std::array<float,2>{0.390635312f, 0.782185018f}, std::array<float,2>{0.722788393f, 0.454897076f}, std::array<float,2>{0.980154276f, 0.704720497f}, std::array<float,2>{0.195719898f, 0.222666398f}, std::array<float,2>{0.373426497f, 0.630590737f}, std::array<float,2>{0.560795069f, 0.13907142f}, std::array<float,2>{0.85163784f, 0.814610064f}, std::array<float,2>{0.0299052056f, 0.404980391f}, std::array<float,2>{0.135818481f, 0.907034755f}, std::array<float,2>{0.892332971f, 0.299606383f}, std::array<float,2>{0.678363264f, 0.557296097f}, std::array<float,2>{0.48585251f, 0.0123286471f}, std::array<float,2>{0.00149106549f, 0.66323477f}, std::array<float,2>{0.862353027f, 0.165640458f}, std::array<float,2>{0.534538805f, 0.844163656f}, std::array<float,2>{0.347073585f, 0.413327605f}, std::array<float,2>{0.475852042f, 0.895248353f}, std::array<float,2>{0.65911144f, 0.25029406f}, std::array<float,2>{0.888244808f, 0.528619528f}, std::array<float,2>{0.147818446f, 0.0329032727f}, std::array<float,2>{0.254048735f, 0.576619506f}, std::array<float,2>{0.599475384f, 0.105856508f}, std::array<float,2>{0.753123283f, 0.994272172f}, std::array<float,2>{0.102757961f, 0.342596233f}, std::array<float,2>{0.21028693f, 0.761661112f}, std::array<float,2>{0.993424475f, 0.495298326f}, std::array<float,2>{0.749016523f, 0.720687032f}, std::array<float,2>{0.379131883f, 0.21102646f}, std::array<float,2>{0.162502989f, 0.542443573f}, std::array<float,2>{0.917814434f, 0.030742256f}, std::array<float,2>{0.640682697f, 0.929650009f}, std::array<float,2>{0.451157868f, 0.294678271f}, std::array<float,2>{0.3361184f, 0.82893312f}, std::array<float,2>{0.51863265f, 0.389610261f}, std::array<float,2>{0.834457219f, 0.644886196f}, std::array<float,2>{0.05575395f, 0.146240041f}, std::array<float,2>{0.421972632f, 0.696355462f}, std::array<float,2>{0.710522413f, 0.23529689f}, std::array<float,2>{0.951606214f, 0.811581969f}, std::array<float,2>{0.230448991f, 0.44920069f}, std::array<float,2>{0.0628052801f, 0.968414068f}, std::array<float,2>{0.807561219f, 0.37330988f}, std::array<float,2>{0.569074869f, 0.621737123f}, std::array<float,2>{0.304947913f, 0.0820510313f}, std::array<float,2>{0.148476794f, 0.655953526f}, std::array<float,2>{0.881060541f, 0.154908508f}, std::array<float,2>{0.668206155f, 0.836868465f}, std::array<float,2>{0.482720017f, 0.379858017f}, std::array<float,2>{0.353617072f, 0.936368346f}, std::array<float,2>{0.539360225f, 0.283008754f}, std::array<float,2>{0.873062789f, 0.531300664f}, std::array<float,2>{0.0115441252f, 0.0230156127f}, std::array<float,2>{0.38659665f, 0.612578273f}, std::array<float,2>{0.736863017f, 0.0890674293f}, std::array<float,2>{0.988411427f, 0.956217885f}, std::array<float,2>{0.213264629f, 0.361523241f}, std::array<float,2>{0.0978882462f, 0.799464583f}, std::array<float,2>{0.763291299f, 0.441515326f}, std::array<float,2>{0.60636276f, 0.687627673f}, std::array<float,2>{0.258146614f, 0.249046281f}, std::array<float,2>{0.0508700348f, 0.522789121f}, std::array<float,2>{0.842144549f, 0.0415820107f}, std::array<float,2>{0.526096225f, 0.900894046f}, std::array<float,2>{0.333108455f, 0.261897326f}, std::array<float,2>{0.440159202f, 0.857773066f}, std::array<float,2>{0.649486899f, 0.420517713f}, std::array<float,2>{0.911550939f, 0.667700589f}, std::array<float,2>{0.164420351f, 0.163605869f}, std::array<float,2>{0.300810635f, 0.731802583f}, std::array<float,2>{0.573197842f, 0.204376757f}, std::array<float,2>{0.799890101f, 0.755654693f}, std::array<float,2>{0.0722996071f, 0.491484344f}, std::array<float,2>{0.224424779f, 0.988043845f}, std::array<float,2>{0.945184529f, 0.332700968f}, std::array<float,2>{0.711776316f, 0.569155693f}, std::array<float,2>{0.43244499f, 0.099093549f}, std::array<float,2>{0.0901926607f, 0.716198921f}, std::array<float,2>{0.793058991f, 0.23115696f}, std::array<float,2>{0.589428425f, 0.791854143f}, std::array<float,2>{0.282750338f, 0.464915246f}, std::array<float,2>{0.415350199f, 0.93948859f}, std::array<float,2>{0.689616561f, 0.347789139f}, std::array<float,2>{0.967331767f, 0.608663619f}, std::array<float,2>{0.238721013f, 0.0743105933f}, std::array<float,2>{0.320988089f, 0.551601827f}, std::array<float,2>{0.504053771f, 0.00482521439f}, std::array<float,2>{0.813021839f, 0.921622932f}, std::array<float,2>{0.0399984717f, 0.31084767f}, std::array<float,2>{0.184347704f, 0.823897004f}, std::array<float,2>{0.926791608f, 0.396387756f}, std::array<float,2>{0.636148632f, 0.636797249f}, std::array<float,2>{0.457479805f, 0.126618564f}, std::array<float,2>{0.191539094f, 0.579126894f}, std::array<float,2>{0.975152075f, 0.12423414f}, std::array<float,2>{0.731524229f, 0.970994353f}, std::array<float,2>{0.400911599f, 0.317227811f}, std::array<float,2>{0.271602631f, 0.775540113f}, std::array<float,2>{0.609942913f, 0.479144186f}, std::array<float,2>{0.767849028f, 0.748777926f}, std::array<float,2>{0.110821061f, 0.189305916f}, std::array<float,2>{0.49499324f, 0.680685699f}, std::array<float,2>{0.684896111f, 0.174634606f}, std::array<float,2>{0.900646269f, 0.861034572f}, std::array<float,2>{0.126680121f, 0.435792804f}, std::array<float,2>{0.0205540899f, 0.882973492f}, std::array<float,2>{0.847479582f, 0.278833836f}, std::array<float,2>{0.549363852f, 0.512612343f}, std::array<float,2>{0.360746771f, 0.0530666038f}, std::array<float,2>{0.175918445f, 0.693093777f}, std::array<float,2>{0.931509018f, 0.243771791f}, std::array<float,2>{0.628005028f, 0.80208391f}, std::array<float,2>{0.461044997f, 0.438103318f}, std::array<float,2>{0.319248617f, 0.960047305f}, std::array<float,2>{0.513697863f, 0.366243243f}, std::array<float,2>{0.824493647f, 0.616742015f}, std::array<float,2>{0.031390164f, 0.0933844522f}, std::array<float,2>{0.409077168f, 0.535744786f}, std::array<float,2>{0.699039996f, 0.0182803199f}, std::array<float,2>{0.960353434f, 0.932968676f}, std::array<float,2>{0.246638507f, 0.28549993f}, std::array<float,2>{0.0807534084f, 0.842149734f}, std::array<float,2>{0.786434412f, 0.378586829f}, std::array<float,2>{0.585286677f, 0.648676157f}, std::array<float,2>{0.291968256f, 0.151392028f}, std::array<float,2>{0.0253385361f, 0.566256881f}, std::array<float,2>{0.859025657f, 0.0974675566f}, std::array<float,2>{0.554962337f, 0.990661204f}, std::array<float,2>{0.370138437f, 0.331698626f}, std::array<float,2>{0.4887743f, 0.751286209f}, std::array<float,2>{0.673309565f, 0.486339211f}, std::array<float,2>{0.898211837f, 0.726577342f}, std::array<float,2>{0.139979854f, 0.21009469f}, std::array<float,2>{0.276138633f, 0.671786487f}, std::array<float,2>{0.622616529f, 0.157089397f}, std::array<float,2>{0.778219342f, 0.855231047f}, std::array<float,2>{0.124004953f, 0.417583257f}, std::array<float,2>{0.199948341f, 0.903153002f}, std::array<float,2>{0.9830001f, 0.259581447f}, std::array<float,2>{0.721178055f, 0.517049432f}, std::array<float,2>{0.395016223f, 0.0432354212f}, std::array<float,2>{0.108302549f, 0.634608805f}, std::array<float,2>{0.756195724f, 0.129172549f}, std::array<float,2>{0.597282112f, 0.826989233f}, std::array<float,2>{0.250636965f, 0.393838674f}, std::array<float,2>{0.377607673f, 0.914835215f}, std::array<float,2>{0.744908571f, 0.306712478f}, std::array<float,2>{0.997681856f, 0.547745705f}, std::array<float,2>{0.206257582f, 0.00124672067f}, std::array<float,2>{0.347821712f, 0.602924585f}, std::array<float,2>{0.535531104f, 0.0739940703f}, std::array<float,2>{0.864638448f, 0.94332546f}, std::array<float,2>{0.00608697487f, 0.344857454f}, std::array<float,2>{0.144491106f, 0.795526922f}, std::array<float,2>{0.885281503f, 0.462103307f}, std::array<float,2>{0.662568867f, 0.71155262f}, std::array<float,2>{0.469504654f, 0.22770083f}, std::array<float,2>{0.233234733f, 0.509381115f}, std::array<float,2>{0.949145615f, 0.0483776368f}, std::array<float,2>{0.703289449f, 0.890007079f}, std::array<float,2>{0.427132219f, 0.274615616f}, std::array<float,2>{0.308788359f, 0.865222454f}, std::array<float,2>{0.564776659f, 0.433096826f}, std::array<float,2>{0.810959578f, 0.687231362f}, std::array<float,2>{0.0696718395f, 0.179674566f}, std::array<float,2>{0.447281063f, 0.743160248f}, std::array<float,2>{0.64475894f, 0.194977731f}, std::array<float,2>{0.919010043f, 0.778151095f}, std::array<float,2>{0.158708185f, 0.483831227f}, std::array<float,2>{0.0616695024f, 0.973937154f}, std::array<float,2>{0.828360021f, 0.314827979f}, std::array<float,2>{0.523291349f, 0.585264802f}, std::array<float,2>{0.341943473f, 0.118437253f}, std::array<float,2>{0.218546361f, 0.677212238f}, std::array<float,2>{0.986721992f, 0.184006572f}, std::array<float,2>{0.740788281f, 0.872193158f}, std::array<float,2>{0.3895742f, 0.422763437f}, std::array<float,2>{0.265034914f, 0.880363464f}, std::array<float,2>{0.601945817f, 0.266079396f}, std::array<float,2>{0.759911537f, 0.507666767f}, std::array<float,2>{0.0976196751f, 0.0602381043f}, std::array<float,2>{0.479317933f, 0.585978806f}, std::array<float,2>{0.664372623f, 0.11509905f}, std::array<float,2>{0.87551868f, 0.979967058f}, std::array<float,2>{0.152415246f, 0.326800019f}, std::array<float,2>{0.0150308097f, 0.770561278f}, std::array<float,2>{0.869978011f, 0.47458455f}, std::array<float,2>{0.543108165f, 0.736880004f}, std::array<float,2>{0.356891662f, 0.196841642f}, std::array<float,2>{0.0767678916f, 0.559311271f}, std::array<float,2>{0.804019153f, 0.00965047907f}, std::array<float,2>{0.574713111f, 0.910352528f}, std::array<float,2>{0.299004704f, 0.304289341f}, std::array<float,2>{0.437047899f, 0.817623377f}, std::array<float,2>{0.718320906f, 0.401382476f}, std::array<float,2>{0.939487576f, 0.625316083f}, std::array<float,2>{0.2197247f, 0.133782387f}, std::array<float,2>{0.331703603f, 0.710364163f}, std::array<float,2>{0.530058086f, 0.221244007f}, std::array<float,2>{0.839769065f, 0.787349641f}, std::array<float,2>{0.0498480275f, 0.460071325f}, std::array<float,2>{0.169370145f, 0.949012935f}, std::array<float,2>{0.908441663f, 0.353073895f}, std::array<float,2>{0.653892517f, 0.599016488f}, std::array<float,2>{0.443083942f, 0.0658430457f}, std::array<float,2>{0.0449291803f, 0.724970996f}, std::array<float,2>{0.818415999f, 0.217340454f}, std::array<float,2>{0.502677321f, 0.764202297f}, std::array<float,2>{0.325403094f, 0.497745574f}, std::array<float,2>{0.456689745f, 0.997792482f}, std::array<float,2>{0.640285671f, 0.336967111f}, std::array<float,2>{0.922581792f, 0.574039638f}, std::array<float,2>{0.180159599f, 0.104681805f}, std::array<float,2>{0.287967801f, 0.523862064f}, std::array<float,2>{0.591078639f, 0.0360857323f}, std::array<float,2>{0.790205479f, 0.891679585f}, std::array<float,2>{0.0892919227f, 0.25530526f}, std::array<float,2>{0.235835716f, 0.849219441f}, std::array<float,2>{0.963761032f, 0.407731503f}, std::array<float,2>{0.693111062f, 0.658062398f}, std::array<float,2>{0.419875234f, 0.170573354f}, std::array<float,2>{0.132369965f, 0.618761659f}, std::array<float,2>{0.905879617f, 0.0786823183f}, std::array<float,2>{0.6814996f, 0.962706149f}, std::array<float,2>{0.498564899f, 0.367587119f}, std::array<float,2>{0.366105765f, 0.806013107f}, std::array<float,2>{0.553330183f, 0.453015298f}, std::array<float,2>{0.848799586f, 0.70259732f}, std::array<float,2>{0.0159114096f, 0.241540223f}, std::array<float,2>{0.404881477f, 0.643272758f}, std::array<float,2>{0.72868526f, 0.143297076f}, std::array<float,2>{0.97254777f, 0.83294028f}, std::array<float,2>{0.188193768f, 0.386292964f}, std::array<float,2>{0.114502259f, 0.92196095f}, std::array<float,2>{0.770982921f, 0.29179737f}, std::array<float,2>{0.615850747f, 0.545744121f}, std::array<float,2>{0.266677439f, 0.0248108059f}, std::array<float,2>{0.239213124f, 0.718201995f}, std::array<float,2>{0.966898203f, 0.233918145f}, std::array<float,2>{0.690142095f, 0.790497065f}, std::array<float,2>{0.415875733f, 0.468133003f}, std::array<float,2>{0.282357603f, 0.938373864f}, std::array<float,2>{0.589269519f, 0.351545334f}, std::array<float,2>{0.793503523f, 0.605835557f}, std::array<float,2>{0.090415217f, 0.0763933733f}, std::array<float,2>{0.457675189f, 0.553187013f}, std::array<float,2>{0.636634946f, 0.00670744525f}, std::array<float,2>{0.927343726f, 0.919706762f}, std::array<float,2>{0.183627978f, 0.309962064f}, std::array<float,2>{0.0394527838f, 0.822019637f}, std::array<float,2>{0.812760055f, 0.398171335f}, std::array<float,2>{0.504679024f, 0.638965487f}, std::array<float,2>{0.3206321f, 0.128720075f}, std::array<float,2>{0.110896863f, 0.58158201f}, std::array<float,2>{0.768291414f, 0.121575885f}, std::array<float,2>{0.609472096f, 0.970210135f}, std::array<float,2>{0.272384346f, 0.318625242f}, std::array<float,2>{0.400663108f, 0.774803698f}, std::array<float,2>{0.731939375f, 0.477181047f}, std::array<float,2>{0.974668384f, 0.74682641f}, std::array<float,2>{0.192176789f, 0.190171003f}, std::array<float,2>{0.360978544f, 0.683312237f}, std::array<float,2>{0.549245656f, 0.172240213f}, std::array<float,2>{0.847077131f, 0.863273144f}, std::array<float,2>{0.0211492665f, 0.434280455f}, std::array<float,2>{0.126205415f, 0.885759413f}, std::array<float,2>{0.900907576f, 0.279337496f}, std::array<float,2>{0.685096443f, 0.513999641f}, std::array<float,2>{0.494475812f, 0.0510785319f}, std::array<float,2>{0.0109835695f, 0.652401149f}, std::array<float,2>{0.873646677f, 0.153767273f}, std::array<float,2>{0.539703548f, 0.839077055f}, std::array<float,2>{0.354203582f, 0.381075561f}, std::array<float,2>{0.483073831f, 0.935480714f}, std::array<float,2>{0.668824136f, 0.283488572f}, std::array<float,2>{0.881450236f, 0.534150302f}, std::array<float,2>{0.148960546f, 0.0202034954f}, std::array<float,2>{0.258689761f, 0.6096012f}, std::array<float,2>{0.605554819f, 0.0876535401f}, std::array<float,2>{0.762765408f, 0.953879297f}, std::array<float,2>{0.0984109268f, 0.360822886f}, std::array<float,2>{0.213444561f, 0.798065662f}, std::array<float,2>{0.988841295f, 0.443778098f}, std::array<float,2>{0.736466467f, 0.690135717f}, std::array<float,2>{0.385868102f, 0.246121541f}, std::array<float,2>{0.164579615f, 0.520402431f}, std::array<float,2>{0.911764026f, 0.0395446941f}, std::array<float,2>{0.650192559f, 0.900103211f}, std::array<float,2>{0.43975988f, 0.263911635f}, std::array<float,2>{0.333513588f, 0.857239962f}, std::array<float,2>{0.525777757f, 0.418084502f}, std::array<float,2>{0.842432797f, 0.664900661f}, std::array<float,2>{0.0513070188f, 0.16181758f}, std::array<float,2>{0.431664467f, 0.732718349f}, std::array<float,2>{0.71111536f, 0.205165088f}, std::array<float,2>{0.944517076f, 0.757475972f}, std::array<float,2>{0.223666579f, 0.488764673f}, std::array<float,2>{0.0732097253f, 0.984597981f}, std::array<float,2>{0.800424695f, 0.334428042f}, std::array<float,2>{0.572733343f, 0.567505121f}, std::array<float,2>{0.30137378f, 0.100478493f}, std::array<float,2>{0.148215115f, 0.660593331f}, std::array<float,2>{0.887945712f, 0.166093796f}, std::array<float,2>{0.658635139f, 0.846471488f}, std::array<float,2>{0.476132482f, 0.411855817f}, std::array<float,2>{0.347452134f, 0.896886706f}, std::array<float,2>{0.534908772f, 0.253513485f}, std::array<float,2>{0.863038361f, 0.530270278f}, std::array<float,2>{0.00126229704f, 0.0346268006f}, std::array<float,2>{0.379800737f, 0.574973822f}, std::array<float,2>{0.748108983f, 0.108424492f}, std::array<float,2>{0.99372524f, 0.993134141f}, std::array<float,2>{0.210666329f, 0.340608239f}, std::array<float,2>{0.10338179f, 0.759113431f}, std::array<float,2>{0.753621817f, 0.493212581f}, std::array<float,2>{0.598932028f, 0.722444236f}, std::array<float,2>{0.254728138f, 0.213311404f}, std::array<float,2>{0.0562301688f, 0.540831447f}, std::array<float,2>{0.834759414f, 0.0287464578f}, std::array<float,2>{0.519253492f, 0.926621437f}, std::array<float,2>{0.336660326f, 0.296845824f}, std::array<float,2>{0.450255454f, 0.830335259f}, std::array<float,2>{0.64142257f, 0.388317019f}, std::array<float,2>{0.917211652f, 0.648376703f}, std::array<float,2>{0.162732095f, 0.14739731f}, std::array<float,2>{0.305550069f, 0.697515666f}, std::array<float,2>{0.568756759f, 0.236608654f}, std::array<float,2>{0.806852937f, 0.810256124f}, std::array<float,2>{0.0633601546f, 0.447088152f}, std::array<float,2>{0.22954075f, 0.965679049f}, std::array<float,2>{0.951910257f, 0.37179184f}, std::array<float,2>{0.71002984f, 0.623832226f}, std::array<float,2>{0.422739714f, 0.0841385275f}, std::array<float,2>{0.0821317509f, 0.739059985f}, std::array<float,2>{0.782768428f, 0.202645093f}, std::array<float,2>{0.579472423f, 0.766662419f}, std::array<float,2>{0.296341568f, 0.470481455f}, std::array<float,2>{0.412345737f, 0.983447552f}, std::array<float,2>{0.701839626f, 0.320899516f}, std::array<float,2>{0.955725431f, 0.593048275f}, std::array<float,2>{0.242513865f, 0.11070592f}, std::array<float,2>{0.31602484f, 0.500743389f}, std::array<float,2>{0.51079607f, 0.0578308329f}, std::array<float,2>{0.823657572f, 0.875657201f}, std::array<float,2>{0.0374514945f, 0.272275537f}, std::array<float,2>{0.173930958f, 0.869878531f}, std::array<float,2>{0.935464501f, 0.429237396f}, std::array<float,2>{0.630057752f, 0.671925604f}, std::array<float,2>{0.468671769f, 0.18350786f}, std::array<float,2>{0.196185797f, 0.597503901f}, std::array<float,2>{0.979545295f, 0.0693710819f}, std::array<float,2>{0.723277748f, 0.952716112f}, std::array<float,2>{0.391263723f, 0.356884897f}, std::array<float,2>{0.278339326f, 0.785020709f}, std::array<float,2>{0.619042397f, 0.456753731f}, std::array<float,2>{0.774220467f, 0.705586076f}, std::array<float,2>{0.121075183f, 0.224726692f}, std::array<float,2>{0.485495657f, 0.63220942f}, std::array<float,2>{0.677847207f, 0.137517437f}, std::array<float,2>{0.892015338f, 0.813638926f}, std::array<float,2>{0.136609092f, 0.402479112f}, std::array<float,2>{0.0295480918f, 0.910013199f}, std::array<float,2>{0.852468133f, 0.298081398f}, std::array<float,2>{0.561086357f, 0.556086063f}, std::array<float,2>{0.373831034f, 0.0149201276f}, std::array<float,2>{0.18065083f, 0.72421658f}, std::array<float,2>{0.922256947f, 0.215707242f}, std::array<float,2>{0.639896929f, 0.761911094f}, std::array<float,2>{0.456326425f, 0.499806821f}, std::array<float,2>{0.325722098f, 0.999110162f}, std::array<float,2>{0.502183557f, 0.338483334f}, std::array<float,2>{0.819298387f, 0.570750117f}, std::array<float,2>{0.0458126925f, 0.103366897f}, std::array<float,2>{0.419215024f, 0.526135921f}, std::array<float,2>{0.692765236f, 0.0381751098f}, std::array<float,2>{0.963283062f, 0.893589675f}, std::array<float,2>{0.236253321f, 0.257535011f}, std::array<float,2>{0.0895878896f, 0.850785553f}, std::array<float,2>{0.790987492f, 0.408386111f}, std::array<float,2>{0.591733515f, 0.660058439f}, std::array<float,2>{0.287372857f, 0.168960616f}, std::array<float,2>{0.0163675174f, 0.620296955f}, std::array<float,2>{0.849545896f, 0.0814819336f}, std::array<float,2>{0.5528543f, 0.964160621f}, std::array<float,2>{0.365274251f, 0.370220482f}, std::array<float,2>{0.498468995f, 0.808031261f}, std::array<float,2>{0.680845439f, 0.450862497f}, std::array<float,2>{0.905413687f, 0.700987041f}, std::array<float,2>{0.13207145f, 0.238972142f}, std::array<float,2>{0.267142266f, 0.64225477f}, std::array<float,2>{0.615240872f, 0.141280994f}, std::array<float,2>{0.771393776f, 0.835440159f}, std::array<float,2>{0.11513795f, 0.383836031f}, std::array<float,2>{0.187626123f, 0.924126983f}, std::array<float,2>{0.971774876f, 0.289267242f}, std::array<float,2>{0.72932446f, 0.544278145f}, std::array<float,2>{0.404770017f, 0.0261816159f}, std::array<float,2>{0.0968742594f, 0.677932143f}, std::array<float,2>{0.760624349f, 0.186443269f}, std::array<float,2>{0.602295637f, 0.87375313f}, std::array<float,2>{0.265158147f, 0.425395548f}, std::array<float,2>{0.388969779f, 0.880870104f}, std::array<float,2>{0.740283668f, 0.268271595f}, std::array<float,2>{0.987274885f, 0.505646646f}, std::array<float,2>{0.218100294f, 0.0621183254f}, std::array<float,2>{0.35704872f, 0.589126468f}, std::array<float,2>{0.543542325f, 0.116931371f}, std::array<float,2>{0.869143367f, 0.97780031f}, std::array<float,2>{0.0154579151f, 0.325242817f}, std::array<float,2>{0.153202534f, 0.771849036f}, std::array<float,2>{0.875006974f, 0.475212216f}, std::array<float,2>{0.664809942f, 0.734623075f}, std::array<float,2>{0.478726447f, 0.198512718f}, std::array<float,2>{0.219117552f, 0.561063409f}, std::array<float,2>{0.940258205f, 0.0106681976f}, std::array<float,2>{0.718030095f, 0.912972867f}, std::array<float,2>{0.436743289f, 0.30158779f}, std::array<float,2>{0.299443424f, 0.819892764f}, std::array<float,2>{0.574275494f, 0.398445219f}, std::array<float,2>{0.804338515f, 0.627904654f}, std::array<float,2>{0.0762071684f, 0.136164278f}, std::array<float,2>{0.442451388f, 0.707790554f}, std::array<float,2>{0.653335035f, 0.219022706f}, std::array<float,2>{0.908737659f, 0.785680115f}, std::array<float,2>{0.169882059f, 0.457278579f}, std::array<float,2>{0.0503452457f, 0.946536124f}, std::array<float,2>{0.839171827f, 0.353704453f}, std::array<float,2>{0.529782116f, 0.599760294f}, std::array<float,2>{0.331419498f, 0.0643877685f}, std::array<float,2>{0.206838965f, 0.635830402f}, std::array<float,2>{0.997513354f, 0.132431045f}, std::array<float,2>{0.744422019f, 0.826156974f}, std::array<float,2>{0.377303481f, 0.391808629f}, std::array<float,2>{0.250115275f, 0.917671442f}, std::array<float,2>{0.596784472f, 0.306288332f}, std::array<float,2>{0.756656349f, 0.550037801f}, std::array<float,2>{0.10787154f, 0.00382158044f}, std::array<float,2>{0.469131678f, 0.603891671f}, std::array<float,2>{0.662732184f, 0.0715479925f}, std::array<float,2>{0.884815335f, 0.943911135f}, std::array<float,2>{0.143827319f, 0.347599298f}, std::array<float,2>{0.00662930915f, 0.794298232f}, std::array<float,2>{0.865125716f, 0.463074595f}, std::array<float,2>{0.536038816f, 0.714554489f}, std::array<float,2>{0.348619312f, 0.229818016f}, std::array<float,2>{0.0698954239f, 0.511692762f}, std::array<float,2>{0.811193049f, 0.0498535819f}, std::array<float,2>{0.565036356f, 0.887541056f}, std::array<float,2>{0.309427142f, 0.276374042f}, std::array<float,2>{0.427553922f, 0.86657095f}, std::array<float,2>{0.703763783f, 0.431627631f}, std::array<float,2>{0.948564768f, 0.684389889f}, std::array<float,2>{0.232490271f, 0.176492617f}, std::array<float,2>{0.342615217f, 0.746024847f}, std::array<float,2>{0.522858322f, 0.191521764f}, std::array<float,2>{0.828895032f, 0.780641079f}, std::array<float,2>{0.0623742379f, 0.482236028f}, std::array<float,2>{0.158687845f, 0.975274622f}, std::array<float,2>{0.91954726f, 0.313747555f}, std::array<float,2>{0.645309925f, 0.583433807f}, std::array<float,2>{0.448164463f, 0.119875744f}, std::array<float,2>{0.0318350419f, 0.694097817f}, std::array<float,2>{0.825131059f, 0.244736239f}, std::array<float,2>{0.514200687f, 0.804621458f}, std::array<float,2>{0.31884712f, 0.440669954f}, std::array<float,2>{0.461482972f, 0.957408965f}, std::array<float,2>{0.628715336f, 0.365109682f}, std::array<float,2>{0.931030869f, 0.614177465f}, std::array<float,2>{0.176703587f, 0.0911220238f}, std::array<float,2>{0.291034222f, 0.537214518f}, std::array<float,2>{0.585802436f, 0.0160399266f}, std::array<float,2>{0.786915839f, 0.931152105f}, std::array<float,2>{0.080299072f, 0.287468463f}, std::array<float,2>{0.246360585f, 0.840970159f}, std::array<float,2>{0.960654378f, 0.375116944f}, std::array<float,2>{0.698555529f, 0.651690543f}, std::array<float,2>{0.408667147f, 0.149708316f}, std::array<float,2>{0.140464678f, 0.563153327f}, std::array<float,2>{0.897664189f, 0.0949208587f}, std::array<float,2>{0.673668265f, 0.98873198f}, std::array<float,2>{0.488536179f, 0.328992486f}, std::array<float,2>{0.370634794f, 0.752706528f}, std::array<float,2>{0.555380583f, 0.484771907f}, std::array<float,2>{0.858651936f, 0.728852391f}, std::array<float,2>{0.0244715698f, 0.207969263f}, std::array<float,2>{0.395481855f, 0.669068635f}, std::array<float,2>{0.721578121f, 0.158263192f}, std::array<float,2>{0.982521594f, 0.852035224f}, std::array<float,2>{0.199400872f, 0.414931208f}, std::array<float,2>{0.123464346f, 0.904708445f}, std::array<float,2>{0.777716577f, 0.260412216f}, std::array<float,2>{0.622221112f, 0.519123375f}, std::array<float,2>{0.275547385f, 0.0460608043f}, std::array<float,2>{0.194527835f, 0.748373866f}, std::array<float,2>{0.974462867f, 0.188687742f}, std::array<float,2>{0.733784437f, 0.775881052f}, std::array<float,2>{0.400031388f, 0.478771597f}, std::array<float,2>{0.271344602f, 0.97159934f}, std::array<float,2>{0.612475455f, 0.316881835f}, std::array<float,2>{0.765905976f, 0.579685748f}, std::array<float,2>{0.111990377f, 0.124798723f}, std::array<float,2>{0.49295637f, 0.512060523f}, std::array<float,2>{0.687034369f, 0.0535998717f}, std::array<float,2>{0.898441076f, 0.883405328f}, std::array<float,2>{0.127549589f, 0.278527945f}, std::array<float,2>{0.0229007471f, 0.860426605f}, std::array<float,2>{0.844617844f, 0.436341763f}, std::array<float,2>{0.546988368f, 0.681599975f}, std::array<float,2>{0.36215049f, 0.174118161f}, std::array<float,2>{0.0924067423f, 0.609000862f}, std::array<float,2>{0.795609713f, 0.0747654885f}, std::array<float,2>{0.587109089f, 0.939955294f}, std::array<float,2>{0.283400178f, 0.348519474f}, std::array<float,2>{0.417684466f, 0.791234851f}, std::array<float,2>{0.688282788f, 0.465411544f}, std::array<float,2>{0.965606034f, 0.716698527f}, std::array<float,2>{0.240467682f, 0.230507761f}, std::array<float,2>{0.323351085f, 0.637289345f}, std::array<float,2>{0.507367074f, 0.126291588f}, std::array<float,2>{0.81448561f, 0.823288202f}, std::array<float,2>{0.0420539342f, 0.395666152f}, std::array<float,2>{0.186269999f, 0.921123862f}, std::array<float,2>{0.928197563f, 0.311210185f}, std::array<float,2>{0.633165717f, 0.550957978f}, std::array<float,2>{0.460030913f, 0.00398137281f}, std::array<float,2>{0.0545352139f, 0.667369306f}, std::array<float,2>{0.840626895f, 0.163125068f}, std::array<float,2>{0.524427295f, 0.858206332f}, std::array<float,2>{0.335229456f, 0.42015785f}, std::array<float,2>{0.43776536f, 0.900408208f}, std::array<float,2>{0.651113391f, 0.262633532f}, std::array<float,2>{0.912375927f, 0.523096204f}, std::array<float,2>{0.166803032f, 0.0410335362f}, std::array<float,2>{0.303409159f, 0.568497598f}, std::array<float,2>{0.571925938f, 0.0994145125f}, std::array<float,2>{0.797781467f, 0.987770975f}, std::array<float,2>{0.0714753941f, 0.332092881f}, std::array<float,2>{0.224708393f, 0.755223811f}, std::array<float,2>{0.942835271f, 0.491931468f}, std::array<float,2>{0.714479446f, 0.73217684f}, std::array<float,2>{0.429870486f, 0.204647303f}, std::array<float,2>{0.151055112f, 0.532103062f}, std::array<float,2>{0.879229367f, 0.0226135794f}, std::array<float,2>{0.671715617f, 0.935948312f}, std::array<float,2>{0.482364714f, 0.28261742f}, std::array<float,2>{0.353387654f, 0.836320043f}, std::array<float,2>{0.542155564f, 0.379229993f}, std::array<float,2>{0.872429669f, 0.655742705f}, std::array<float,2>{0.00879595429f, 0.154462054f}, std::array<float,2>{0.382863015f, 0.688441157f}, std::array<float,2>{0.734779835f, 0.249877304f}, std::array<float,2>{0.991614699f, 0.79894495f}, std::array<float,2>{0.212788492f, 0.442163795f}, std::array<float,2>{0.0997586772f, 0.956596017f}, std::array<float,2>{0.764912963f, 0.36205858f}, std::array<float,2>{0.6086694f, 0.613044977f}, std::array<float,2>{0.261285365f, 0.0894983038f}, std::array<float,2>{0.160221472f, 0.645263255f}, std::array<float,2>{0.914886117f, 0.145592779f}, std::array<float,2>{0.644212067f, 0.828547776f}, std::array<float,2>{0.452769905f, 0.388716936f}, std::array<float,2>{0.339007735f, 0.928854108f}, std::array<float,2>{0.515759766f, 0.294429094f}, std::array<float,2>{0.833374262f, 0.542491972f}, std::array<float,2>{0.0576180816f, 0.0308535397f}, std::array<float,2>{0.424604684f, 0.621484399f}, std::array<float,2>{0.708800673f, 0.0828405172f}, std::array<float,2>{0.949259996f, 0.9680776f}, std::array<float,2>{0.227899656f, 0.373733163f}, std::array<float,2>{0.0656790286f, 0.81201601f}, std::array<float,2>{0.805121422f, 0.448400468f}, std::array<float,2>{0.566997886f, 0.697242558f}, std::array<float,2>{0.308122903f, 0.234577417f}, std::array<float,2>{0.00308411638f, 0.529051542f}, std::array<float,2>{0.860346913f, 0.0325319134f}, std::array<float,2>{0.532377124f, 0.894555748f}, std::array<float,2>{0.345039964f, 0.250880003f}, std::array<float,2>{0.473748714f, 0.844453633f}, std::array<float,2>{0.658058286f, 0.413850725f}, std::array<float,2>{0.890066504f, 0.663744986f}, std::array<float,2>{0.146249101f, 0.165245533f}, std::array<float,2>{0.256137133f, 0.719822347f}, std::array<float,2>{0.600186408f, 0.211444631f}, std::array<float,2>{0.751882315f, 0.761213541f}, std::array<float,2>{0.104342736f, 0.495729178f}, std::array<float,2>{0.20878993f, 0.994870245f}, std::array<float,2>{0.994506955f, 0.341890395f}, std::array<float,2>{0.746181965f, 0.57671392f}, std::array<float,2>{0.382520527f, 0.105971158f}, std::array<float,2>{0.117230713f, 0.704422176f}, std::array<float,2>{0.777305901f, 0.223560333f}, std::array<float,2>{0.621058047f, 0.781616032f}, std::array<float,2>{0.280432582f, 0.454280168f}, std::array<float,2>{0.394248009f, 0.950151503f}, std::array<float,2>{0.72523582f, 0.358163923f}, std::array<float,2>{0.978234649f, 0.594116688f}, std::array<float,2>{0.199193865f, 0.0680422634f}, std::array<float,2>{0.372558951f, 0.556705832f}, std::array<float,2>{0.558906555f, 0.0121432729f}, std::array<float,2>{0.854378819f, 0.906263947f}, std::array<float,2>{0.0280377939f, 0.299037904f}, std::array<float,2>{0.133951917f, 0.815324545f}, std::array<float,2>{0.894300222f, 0.40434736f}, std::array<float,2>{0.677450716f, 0.630034983f}, std::array<float,2>{0.486732453f, 0.139407128f}, std::array<float,2>{0.245676652f, 0.590056002f}, std::array<float,2>{0.954888582f, 0.111932412f}, std::array<float,2>{0.699516535f, 0.981973112f}, std::array<float,2>{0.410673559f, 0.323791862f}, std::array<float,2>{0.294326097f, 0.767733216f}, std::array<float,2>{0.580598354f, 0.472100466f}, std::array<float,2>{0.783254087f, 0.741339624f}, std::array<float,2>{0.0855722204f, 0.199961215f}, std::array<float,2>{0.465382963f, 0.674711287f}, std::array<float,2>{0.630917668f, 0.180257559f}, std::array<float,2>{0.93691808f, 0.868141353f}, std::array<float,2>{0.17349723f, 0.427610368f}, std::array<float,2>{0.035180185f, 0.878639221f}, std::array<float,2>{0.822208345f, 0.270456344f}, std::array<float,2>{0.508218825f, 0.502119541f}, std::array<float,2>{0.312743336f, 0.0551325306f}, std::array<float,2>{0.129930124f, 0.702640176f}, std::array<float,2>{0.902678788f, 0.241921008f}, std::array<float,2>{0.682072043f, 0.806594908f}, std::array<float,2>{0.497417241f, 0.452205718f}, std::array<float,2>{0.364307642f, 0.962362885f}, std::array<float,2>{0.552482843f, 0.367683768f}, std::array<float,2>{0.850927949f, 0.618364215f}, std::array<float,2>{0.0189891607f, 0.0782463923f}, std::array<float,2>{0.402374268f, 0.545348346f}, std::array<float,2>{0.726855099f, 0.0251684599f}, std::array<float,2>{0.970650077f, 0.922750115f}, std::array<float,2>{0.190799057f, 0.291306823f}, std::array<float,2>{0.115895115f, 0.832045257f}, std::array<float,2>{0.771612406f, 0.386173874f}, std::array<float,2>{0.613578618f, 0.642948449f}, std::array<float,2>{0.268089741f, 0.142928049f}, std::array<float,2>{0.0445286818f, 0.573296666f}, std::array<float,2>{0.817738056f, 0.105179638f}, std::array<float,2>{0.501902342f, 0.997193992f}, std::array<float,2>{0.326667249f, 0.337872028f}, std::array<float,2>{0.45410496f, 0.763972282f}, std::array<float,2>{0.638029397f, 0.49711588f}, std::array<float,2>{0.924064517f, 0.725539744f}, std::array<float,2>{0.182942554f, 0.217071116f}, std::array<float,2>{0.285566002f, 0.657367051f}, std::array<float,2>{0.591984391f, 0.170256659f}, std::array<float,2>{0.792802334f, 0.84901768f}, std::array<float,2>{0.0878497362f, 0.407696337f}, std::array<float,2>{0.236333013f, 0.892450929f}, std::array<float,2>{0.96201396f, 0.255485296f}, std::array<float,2>{0.695096791f, 0.524064064f}, std::array<float,2>{0.421513259f, 0.0353559591f}, std::array<float,2>{0.0753807127f, 0.625918329f}, std::array<float,2>{0.801378191f, 0.1331826f}, std::array<float,2>{0.576707184f, 0.818194211f}, std::array<float,2>{0.298168838f, 0.402207017f}, std::array<float,2>{0.433685452f, 0.911024749f}, std::array<float,2>{0.716513932f, 0.304125816f}, std::array<float,2>{0.937739968f, 0.558701575f}, std::array<float,2>{0.221086591f, 0.00925828051f}, std::array<float,2>{0.328510016f, 0.599253356f}, std::array<float,2>{0.527825296f, 0.0660931021f}, std::array<float,2>{0.836887538f, 0.948351383f}, std::array<float,2>{0.0477815196f, 0.352797955f}, std::array<float,2>{0.170613632f, 0.787696302f}, std::array<float,2>{0.906810522f, 0.460758954f}, std::array<float,2>{0.655269206f, 0.710670054f}, std::array<float,2>{0.444867045f, 0.220990777f}, std::array<float,2>{0.216523334f, 0.506970167f}, std::array<float,2>{0.985433638f, 0.0597608872f}, std::array<float,2>{0.7386204f, 0.880709529f}, std::array<float,2>{0.38749212f, 0.266537279f}, std::array<float,2>{0.26193881f, 0.872905672f}, std::array<float,2>{0.604644895f, 0.422221035f}, std::array<float,2>{0.759055316f, 0.677684009f}, std::array<float,2>{0.0947439373f, 0.184089407f}, std::array<float,2>{0.477805376f, 0.736422122f}, std::array<float,2>{0.66629082f, 0.196589008f}, std::array<float,2>{0.877248704f, 0.771402776f}, std::array<float,2>{0.156170681f, 0.473649412f}, std::array<float,2>{0.0129263205f, 0.98045522f}, std::array<float,2>{0.867773294f, 0.326316625f}, std::array<float,2>{0.546869278f, 0.586436033f}, std::array<float,2>{0.359058976f, 0.114557527f}, std::array<float,2>{0.23201932f, 0.686917841f}, std::array<float,2>{0.945492327f, 0.178847075f}, std::array<float,2>{0.70581162f, 0.864385664f}, std::array<float,2>{0.428596705f, 0.433331341f}, std::array<float,2>{0.311343402f, 0.890343547f}, std::array<float,2>{0.563172579f, 0.275340527f}, std::array<float,2>{0.809890866f, 0.509046555f}, std::array<float,2>{0.0678140894f, 0.0481549054f}, std::array<float,2>{0.446020424f, 0.58579421f}, std::array<float,2>{0.647877932f, 0.118761688f}, std::array<float,2>{0.921450555f, 0.974244654f}, std::array<float,2>{0.157189384f, 0.315329462f}, std::array<float,2>{0.0593784042f, 0.777348399f}, std::array<float,2>{0.830639899f, 0.48428455f}, std::array<float,2>{0.519940257f, 0.742496908f}, std::array<float,2>{0.340831965f, 0.194381356f}, std::array<float,2>{0.106996603f, 0.547027588f}, std::array<float,2>{0.755686522f, 0.001761419f}, std::array<float,2>{0.593930602f, 0.91442126f}, std::array<float,2>{0.253594518f, 0.307295829f}, std::array<float,2>{0.375156462f, 0.826387107f}, std::array<float,2>{0.743159175f, 0.394096613f}, std::array<float,2>{0.999767065f, 0.633942366f}, std::array<float,2>{0.20321703f, 0.129429728f}, std::array<float,2>{0.35071981f, 0.71131593f}, std::array<float,2>{0.538373649f, 0.228331536f}, std::array<float,2>{0.866375983f, 0.795185208f}, std::array<float,2>{0.00494626351f, 0.462855697f}, std::array<float,2>{0.142177522f, 0.942717433f}, std::array<float,2>{0.883910716f, 0.345344156f}, std::array<float,2>{0.660425186f, 0.603222907f}, std::array<float,2>{0.471456259f, 0.0735496283f}, std::array<float,2>{0.0265294313f, 0.727051079f}, std::array<float,2>{0.857117534f, 0.210795835f}, std::array<float,2>{0.557683229f, 0.75163871f}, std::array<float,2>{0.368117183f, 0.487032384f}, std::array<float,2>{0.491589218f, 0.991048634f}, std::array<float,2>{0.67565608f, 0.331358731f}, std::array<float,2>{0.895214319f, 0.565558672f}, std::array<float,2>{0.137837738f, 0.0971128196f}, std::array<float,2>{0.273994088f, 0.517538369f}, std::array<float,2>{0.62450856f, 0.0435598642f}, std::array<float,2>{0.780233085f, 0.90265429f}, std::array<float,2>{0.121567123f, 0.259176791f}, std::array<float,2>{0.202669933f, 0.854857326f}, std::array<float,2>{0.981972992f, 0.417383403f}, std::array<float,2>{0.719713688f, 0.671198726f}, std::array<float,2>{0.396587968f, 0.156287298f}, std::array<float,2>{0.178413644f, 0.616465092f}, std::array<float,2>{0.932316661f, 0.0927808061f}, std::array<float,2>{0.626837611f, 0.960877001f}, std::array<float,2>{0.464108258f, 0.367108583f}, std::array<float,2>{0.317209452f, 0.8027246f}, std::array<float,2>{0.51244992f, 0.437832773f}, std::array<float,2>{0.826566696f, 0.69251734f}, std::array<float,2>{0.0341055579f, 0.243537754f}, std::array<float,2>{0.406918645f, 0.649209321f}, std::array<float,2>{0.697098672f, 0.15223752f}, std::array<float,2>{0.957288146f, 0.842427611f}, std::array<float,2>{0.24890478f, 0.377972305f}, std::array<float,2>{0.0782421157f, 0.93335408f}, std::array<float,2>{0.788667262f, 0.286063313f}, std::array<float,2>{0.582900226f, 0.535610557f}, std::array<float,2>{0.289223582f, 0.0178412013f}, std::array<float,2>{0.211481735f, 0.691364229f}, std::array<float,2>{0.991084099f, 0.247855365f}, std::array<float,2>{0.73624897f, 0.797425449f}, std::array<float,2>{0.383946091f, 0.445238322f}, std::array<float,2>{0.25999701f, 0.954491079f}, std::array<float,2>{0.60777235f, 0.360320419f}, std::array<float,2>{0.764608085f, 0.6106745f}, std::array<float,2>{0.101457663f, 0.0867553949f}, std::array<float,2>{0.481216878f, 0.534969687f}, std::array<float,2>{0.670728326f, 0.0214767791f}, std::array<float,2>{0.880395353f, 0.934464872f}, std::array<float,2>{0.151677623f, 0.284525156f}, std::array<float,2>{0.00877177715f, 0.838688135f}, std::array<float,2>{0.871986985f, 0.382429987f}, std::array<float,2>{0.541080356f, 0.654208124f}, std::array<float,2>{0.352362692f, 0.152426839f}, std::array<float,2>{0.0712610111f, 0.567151129f}, std::array<float,2>{0.798431277f, 0.100797243f}, std::array<float,2>{0.570882678f, 0.985964119f}, std::array<float,2>{0.30397141f, 0.33565709f}, std::array<float,2>{0.431193024f, 0.755866945f}, std::array<float,2>{0.713686049f, 0.489777118f}, std::array<float,2>{0.942253888f, 0.734306216f}, std::array<float,2>{0.225971758f, 0.206853971f}, std::array<float,2>{0.334253609f, 0.665267587f}, std::array<float,2>{0.524066925f, 0.160814777f}, std::array<float,2>{0.841582835f, 0.856316626f}, std::array<float,2>{0.0530430675f, 0.419767261f}, std::array<float,2>{0.167439684f, 0.898579061f}, std::array<float,2>{0.913099885f, 0.264882892f}, std::array<float,2>{0.65137738f, 0.52081269f}, std::array<float,2>{0.439333498f, 0.0408926755f}, std::array<float,2>{0.0410444736f, 0.640549839f}, std::array<float,2>{0.815891445f, 0.127050593f}, std::array<float,2>{0.506602407f, 0.820505619f}, std::array<float,2>{0.322563738f, 0.396985173f}, std::array<float,2>{0.459676445f, 0.917991161f}, std::array<float,2>{0.63383466f, 0.309179068f}, std::array<float,2>{0.929264903f, 0.553933263f}, std::array<float,2>{0.186702311f, 0.00703546591f}, std::array<float,2>{0.284961224f, 0.606571317f}, std::array<float,2>{0.586857498f, 0.0776885748f}, std::array<float,2>{0.796166539f, 0.939377546f}, std::array<float,2>{0.0933146924f, 0.349750072f}, std::array<float,2>{0.241818517f, 0.789136648f}, std::array<float,2>{0.96643275f, 0.467102408f}, std::array<float,2>{0.689098895f, 0.717347145f}, std::array<float,2>{0.416413665f, 0.233384296f}, std::array<float,2>{0.12889953f, 0.515194535f}, std::array<float,2>{0.899420679f, 0.0518107414f}, std::array<float,2>{0.686433613f, 0.885726273f}, std::array<float,2>{0.493836731f, 0.280852944f}, std::array<float,2>{0.363203555f, 0.861918211f}, std::array<float,2>{0.548486114f, 0.435019076f}, std::array<float,2>{0.844768107f, 0.682085752f}, std::array<float,2>{0.0222343039f, 0.172936916f}, std::array<float,2>{0.39911896f, 0.747198939f}, std::array<float,2>{0.732575238f, 0.191249356f}, std::array<float,2>{0.972872496f, 0.77411902f}, std::array<float,2>{0.194066539f, 0.478191227f}, std::array<float,2>{0.112345107f, 0.968951225f}, std::array<float,2>{0.767479062f, 0.319536328f}, std::array<float,2>{0.612062752f, 0.580754876f}, std::array<float,2>{0.269861817f, 0.122315109f}, std::array<float,2>{0.172736138f, 0.673358679f}, std::array<float,2>{0.93608892f, 0.182433665f}, std::array<float,2>{0.632637858f, 0.870467842f}, std::array<float,2>{0.465844512f, 0.428233892f}, std::array<float,2>{0.314151376f, 0.876261055f}, std::array<float,2>{0.509383976f, 0.27256462f}, std::array<float,2>{0.821253777f, 0.501455307f}, std::array<float,2>{0.0370545872f, 0.0572191402f}, std::array<float,2>{0.411368489f, 0.592755377f}, std::array<float,2>{0.700926602f, 0.109701484f}, std::array<float,2>{0.953685522f, 0.983015835f}, std::array<float,2>{0.244764581f, 0.322257608f}, std::array<float,2>{0.0840299129f, 0.765908301f}, std::array<float,2>{0.784367681f, 0.469043821f}, std::array<float,2>{0.581840515f, 0.740059793f}, std::array<float,2>{0.293540657f, 0.201444194f}, std::array<float,2>{0.0291721318f, 0.555650294f}, std::array<float,2>{0.855390489f, 0.014320693f}, std::array<float,2>{0.559966624f, 0.908503711f}, std::array<float,2>{0.37167725f, 0.297833949f}, std::array<float,2>{0.487674534f, 0.812998652f}, std::array<float,2>{0.676707923f, 0.403978616f}, std::array<float,2>{0.893524468f, 0.631624937f}, std::array<float,2>{0.133262262f, 0.138575211f}, std::array<float,2>{0.279994875f, 0.706111908f}, std::array<float,2>{0.619387031f, 0.226436704f}, std::array<float,2>{0.775434732f, 0.783875227f}, std::array<float,2>{0.118338645f, 0.455826759f}, std::array<float,2>{0.197575644f, 0.952099144f}, std::array<float,2>{0.977220953f, 0.355896831f}, std::array<float,2>{0.725964248f, 0.596547961f}, std::array<float,2>{0.393273383f, 0.0690070614f}, std::array<float,2>{0.105227895f, 0.721349776f}, std::array<float,2>{0.75066179f, 0.214740261f}, std::array<float,2>{0.601282895f, 0.758232474f}, std::array<float,2>{0.257554322f, 0.492307156f}, std::array<float,2>{0.381316066f, 0.993816078f}, std::array<float,2>{0.747477233f, 0.341273367f}, std::array<float,2>{0.996021986f, 0.575195789f}, std::array<float,2>{0.208006471f, 0.108363159f}, std::array<float,2>{0.344667614f, 0.530978203f}, std::array<float,2>{0.532197714f, 0.0339628272f}, std::array<float,2>{0.86110574f, 0.897873998f}, std::array<float,2>{0.00289804838f, 0.252195209f}, std::array<float,2>{0.144835874f, 0.847129881f}, std::array<float,2>{0.889099658f, 0.410253704f}, std::array<float,2>{0.656963408f, 0.661709368f}, std::array<float,2>{0.473302007f, 0.167902216f}, std::array<float,2>{0.226985484f, 0.624943972f}, std::array<float,2>{0.950533986f, 0.0851776302f}, std::array<float,2>{0.707084775f, 0.966053724f}, std::array<float,2>{0.425212026f, 0.372493595f}, std::array<float,2>{0.307369888f, 0.809497893f}, std::array<float,2>{0.567474246f, 0.44614929f}, std::array<float,2>{0.806602836f, 0.698639214f}, std::array<float,2>{0.0650943965f, 0.237455443f}, std::array<float,2>{0.451221526f, 0.646612108f}, std::array<float,2>{0.643422127f, 0.147779226f}, std::array<float,2>{0.91517067f, 0.831706583f}, std::array<float,2>{0.161867619f, 0.386990756f}, std::array<float,2>{0.0570688061f, 0.927092552f}, std::array<float,2>{0.83233732f, 0.295705795f}, std::array<float,2>{0.516894698f, 0.539818466f}, std::array<float,2>{0.337930202f, 0.0277366582f}, std::array<float,2>{0.15482989f, 0.736222565f}, std::array<float,2>{0.878790259f, 0.19810468f}, std::array<float,2>{0.667963386f, 0.773384929f}, std::array<float,2>{0.476586819f, 0.475991994f}, std::array<float,2>{0.357570827f, 0.976620853f}, std::array<float,2>{0.545090437f, 0.324902177f}, std::array<float,2>{0.868530571f, 0.588586271f}, std::array<float,2>{0.0117308646f, 0.115801677f}, std::array<float,2>{0.387986064f, 0.504310906f}, std::array<float,2>{0.739662409f, 0.0611219294f}, std::array<float,2>{0.985158503f, 0.882224619f}, std::array<float,2>{0.215520546f, 0.269105732f}, std::array<float,2>{0.0945756808f, 0.87480557f}, std::array<float,2>{0.758491158f, 0.424591392f}, std::array<float,2>{0.603889108f, 0.679321408f}, std::array<float,2>{0.263219446f, 0.186877117f}, std::array<float,2>{0.0479964986f, 0.60126102f}, std::array<float,2>{0.83780092f, 0.0628050715f}, std::array<float,2>{0.529157817f, 0.945489049f}, std::array<float,2>{0.329680294f, 0.354670852f}, std::array<float,2>{0.443462521f, 0.786812127f}, std::array<float,2>{0.655508459f, 0.458050847f}, std::array<float,2>{0.907675922f, 0.708337784f}, std::array<float,2>{0.171232253f, 0.219830483f}, std::array<float,2>{0.297387689f, 0.628438234f}, std::array<float,2>{0.578077674f, 0.135490388f}, std::array<float,2>{0.802405834f, 0.819159865f}, std::array<float,2>{0.0751290098f, 0.399665177f}, std::array<float,2>{0.222419888f, 0.913379967f}, std::array<float,2>{0.939249873f, 0.302134901f}, std::array<float,2>{0.71553719f, 0.562253594f}, std::array<float,2>{0.435026139f, 0.0112100802f}, std::array<float,2>{0.0868129954f, 0.65873313f}, std::array<float,2>{0.791782916f, 0.168719396f}, std::array<float,2>{0.59324646f, 0.849924922f}, std::array<float,2>{0.28627193f, 0.409326881f}, std::array<float,2>{0.420750976f, 0.893149436f}, std::array<float,2>{0.693802595f, 0.25649178f}, std::array<float,2>{0.961360455f, 0.526607871f}, std::array<float,2>{0.237852454f, 0.0380079485f}, std::array<float,2>{0.327225417f, 0.571933329f}, std::array<float,2>{0.500615895f, 0.102107234f}, std::array<float,2>{0.817156911f, 0.998897672f}, std::array<float,2>{0.0436340831f, 0.339003563f}, std::array<float,2>{0.182503134f, 0.763054252f}, std::array<float,2>{0.925418675f, 0.49884671f}, std::array<float,2>{0.637508392f, 0.722741008f}, std::array<float,2>{0.453978449f, 0.21601218f}, std::array<float,2>{0.19034563f, 0.543805122f}, std::array<float,2>{0.969085932f, 0.0265282281f}, std::array<float,2>{0.728214383f, 0.925305367f}, std::array<float,2>{0.404273689f, 0.290627629f}, std::array<float,2>{0.269223869f, 0.834223866f}, std::array<float,2>{0.614335418f, 0.383529007f}, std::array<float,2>{0.772481263f, 0.640864134f}, std::array<float,2>{0.116478518f, 0.141953275f}, std::array<float,2>{0.496819526f, 0.699656427f}, std::array<float,2>{0.683484077f, 0.239632651f}, std::array<float,2>{0.903543413f, 0.807568133f}, std::array<float,2>{0.12911813f, 0.449396372f}, std::array<float,2>{0.017691385f, 0.963022768f}, std::array<float,2>{0.849982798f, 0.369522959f}, std::array<float,2>{0.551324368f, 0.619289517f}, std::array<float,2>{0.363316327f, 0.08083307f}, std::array<float,2>{0.249591559f, 0.650905371f}, std::array<float,2>{0.958125532f, 0.148947582f}, std::array<float,2>{0.695736885f, 0.840347946f}, std::array<float,2>{0.408124268f, 0.375981212f}, std::array<float,2>{0.290311962f, 0.929979801f}, std::array<float,2>{0.583845139f, 0.288949549f}, std::array<float,2>{0.78735888f, 0.538535357f}, std::array<float,2>{0.0792205855f, 0.0170724597f}, std::array<float,2>{0.463012129f, 0.614540637f}, std::array<float,2>{0.625655413f, 0.0906477571f}, std::array<float,2>{0.933549702f, 0.958631396f}, std::array<float,2>{0.179007217f, 0.363610834f}, std::array<float,2>{0.0343191959f, 0.803706586f}, std::array<float,2>{0.827672601f, 0.439873308f}, std::array<float,2>{0.513256431f, 0.694969893f}, std::array<float,2>{0.317875922f, 0.24513945f}, std::array<float,2>{0.122384146f, 0.517962813f}, std::array<float,2>{0.781131685f, 0.0451618657f}, std::array<float,2>{0.623536289f, 0.905300856f}, std::array<float,2>{0.275073379f, 0.261112928f}, std::array<float,2>{0.397646934f, 0.853140116f}, std::array<float,2>{0.720373929f, 0.415231079f}, std::array<float,2>{0.981253386f, 0.66871506f}, std::array<float,2>{0.201365009f, 0.160013452f}, std::array<float,2>{0.368687898f, 0.72989285f}, std::array<float,2>{0.557346046f, 0.208068177f}, std::array<float,2>{0.856197596f, 0.753623664f}, std::array<float,2>{0.0263608042f, 0.485432923f}, std::array<float,2>{0.137319729f, 0.990057528f}, std::array<float,2>{0.895635962f, 0.32933557f}, std::array<float,2>{0.67402935f, 0.563499212f}, std::array<float,2>{0.491020441f, 0.0945020095f}, std::array<float,2>{0.00483176019f, 0.713386893f}, std::array<float,2>{0.866094649f, 0.229419142f}, std::array<float,2>{0.537860036f, 0.793638051f}, std::array<float,2>{0.350314826f, 0.464428455f}, std::array<float,2>{0.472641557f, 0.944455087f}, std::array<float,2>{0.661534905f, 0.346416801f}, std::array<float,2>{0.883019626f, 0.605224431f}, std::array<float,2>{0.141598985f, 0.0703192055f}, std::array<float,2>{0.252721876f, 0.548925757f}, std::array<float,2>{0.594840348f, 0.00214414066f}, std::array<float,2>{0.754721642f, 0.916416049f}, std::array<float,2>{0.105918512f, 0.305061877f}, std::array<float,2>{0.204552576f, 0.825188458f}, std::array<float,2>{0.998985231f, 0.391480535f}, std::array<float,2>{0.744107604f, 0.635078728f}, std::array<float,2>{0.376770407f, 0.131536782f}, std::array<float,2>{0.157417402f, 0.582690775f}, std::array<float,2>{0.920135021f, 0.12043079f}, std::array<float,2>{0.647093117f, 0.976435781f}, std::array<float,2>{0.447248697f, 0.313109696f}, std::array<float,2>{0.340341061f, 0.779851019f}, std::array<float,2>{0.521185994f, 0.480745167f}, std::array<float,2>{0.831955075f, 0.744327426f}, std::array<float,2>{0.0600552298f, 0.192428932f}, std::array<float,2>{0.428824604f, 0.685018718f}, std::array<float,2>{0.707018197f, 0.177196741f}, std::array<float,2>{0.946510196f, 0.866056085f}, std::array<float,2>{0.230945438f, 0.430517733f}, std::array<float,2>{0.0671863481f, 0.888382494f}, std::array<float,2>{0.808803976f, 0.276110798f}, std::array<float,2>{0.564184487f, 0.510108829f}, std::array<float,2>{0.312321991f, 0.0489769354f}, std::array<float,2>{0.222813979f, 0.730725944f}, std::array<float,2>{0.943985999f, 0.204090968f}, std::array<float,2>{0.712392151f, 0.754385233f}, std::array<float,2>{0.432859212f, 0.491159856f}, std::array<float,2>{0.302523285f, 0.986902595f}, std::array<float,2>{0.574088335f, 0.333382159f}, std::array<float,2>{0.798928142f, 0.57023102f}, std::array<float,2>{0.0740481243f, 0.097917065f}, std::array<float,2>{0.440705866f, 0.522412121f}, std::array<float,2>{0.649062634f, 0.0429424718f}, std::array<float,2>{0.910892546f, 0.902114511f}, std::array<float,2>{0.165629178f, 0.263423771f}, std::array<float,2>{0.0524577759f, 0.858825564f}, std::array<float,2>{0.843140721f, 0.421145707f}, std::array<float,2>{0.526382208f, 0.666683614f}, std::array<float,2>{0.332174182f, 0.162770763f}, std::array<float,2>{0.0992919505f, 0.611937582f}, std::array<float,2>{0.761925161f, 0.0887284577f}, std::array<float,2>{0.606823146f, 0.95534575f}, std::array<float,2>{0.259224802f, 0.362707943f}, std::array<float,2>{0.385266483f, 0.799953461f}, std::array<float,2>{0.738182843f, 0.442658097f}, std::array<float,2>{0.989506423f, 0.689332187f}, std::array<float,2>{0.213881418f, 0.248503625f}, std::array<float,2>{0.354692608f, 0.654940486f}, std::array<float,2>{0.540868044f, 0.155509159f}, std::array<float,2>{0.874904335f, 0.837021708f}, std::array<float,2>{0.0100752823f, 0.38058421f}, std::array<float,2>{0.14945358f, 0.937008321f}, std::array<float,2>{0.88259697f, 0.282045722f}, std::array<float,2>{0.669883549f, 0.533185303f}, std::array<float,2>{0.483952045f, 0.0218645725f}, std::array<float,2>{0.0197272412f, 0.679852426f}, std::array<float,2>{0.846253097f, 0.175765917f}, std::array<float,2>{0.550745666f, 0.859423518f}, std::array<float,2>{0.359686494f, 0.437117934f}, std::array<float,2>{0.495812625f, 0.884757519f}, std::array<float,2>{0.684462011f, 0.277866453f}, std::array<float,2>{0.901810646f, 0.51314044f}, std::array<float,2>{0.125379816f, 0.0543362387f}, std::array<float,2>{0.27329272f, 0.578162134f}, std::array<float,2>{0.610490382f, 0.123204254f}, std::array<float,2>{0.768990338f, 0.971722841f}, std::array<float,2>{0.109813906f, 0.31824705f}, std::array<float,2>{0.192740157f, 0.77681917f}, std::array<float,2>{0.976530492f, 0.479826957f}, std::array<float,2>{0.731149673f, 0.749716401f}, std::array<float,2>{0.402252138f, 0.187762693f}, std::array<float,2>{0.184731424f, 0.552226305f}, std::array<float,2>{0.926068366f, 0.00565165561f}, std::array<float,2>{0.635101378f, 0.920034945f}, std::array<float,2>{0.458611369f, 0.312073886f}, std::array<float,2>{0.322203666f, 0.822808921f}, std::array<float,2>{0.505677998f, 0.394794703f}, std::array<float,2>{0.813670814f, 0.638282418f}, std::array<float,2>{0.0401260443f, 0.125170007f}, std::array<float,2>{0.414873809f, 0.7156322f}, std::array<float,2>{0.690532207f, 0.231562063f}, std::array<float,2>{0.96827352f, 0.792932153f}, std::array<float,2>{0.239980012f, 0.466038376f}, std::array<float,2>{0.0913877785f, 0.941044152f}, std::array<float,2>{0.794766366f, 0.348941386f}, std::array<float,2>{0.588366687f, 0.607714593f}, std::array<float,2>{0.281773448f, 0.0761645362f}, std::array<float,2>{0.135334849f, 0.628998935f}, std::array<float,2>{0.891361356f, 0.139999807f}, std::array<float,2>{0.679398477f, 0.81553179f}, std::array<float,2>{0.485153854f, 0.405541718f}, std::array<float,2>{0.374190778f, 0.907745659f}, std::array<float,2>{0.561739624f, 0.300728649f}, std::array<float,2>{0.853196442f, 0.55846405f}, std::array<float,2>{0.0307256151f, 0.0126954978f}, std::array<float,2>{0.391650856f, 0.595316112f}, std::array<float,2>{0.724590063f, 0.0670912936f}, std::array<float,2>{0.978993237f, 0.950555146f}, std::array<float,2>{0.196890742f, 0.359218776f}, std::array<float,2>{0.119296163f, 0.782980382f}, std::array<float,2>{0.774495184f, 0.453307301f}, std::array<float,2>{0.618127048f, 0.703513741f}, std::array<float,2>{0.27777651f, 0.223799348f}, std::array<float,2>{0.0381537303f, 0.50380826f}, std::array<float,2>{0.823049188f, 0.0561586954f}, std::array<float,2>{0.510556161f, 0.877463579f}, std::array<float,2>{0.315413833f, 0.271306992f}, std::array<float,2>{0.467699081f, 0.868913352f}, std::array<float,2>{0.629537582f, 0.425924897f}, std::array<float,2>{0.933900535f, 0.67491293f}, std::array<float,2>{0.175455883f, 0.181513727f}, std::array<float,2>{0.295724839f, 0.74097544f}, std::array<float,2>{0.578584015f, 0.201000974f}, std::array<float,2>{0.782124758f, 0.768565476f}, std::array<float,2>{0.0831291825f, 0.471175581f}, std::array<float,2>{0.24390322f, 0.980785728f}, std::array<float,2>{0.956781983f, 0.322596997f}, std::array<float,2>{0.702221036f, 0.591451943f}, std::array<float,2>{0.413948894f, 0.113082357f}, std::array<float,2>{0.0638281852f, 0.696143687f}, std::array<float,2>{0.808223546f, 0.235673293f}, std::array<float,2>{0.570110381f, 0.810745418f}, std::array<float,2>{0.305793881f, 0.447949737f}, std::array<float,2>{0.423435658f, 0.967344999f}, std::array<float,2>{0.709291518f, 0.374583006f}, std::array<float,2>{0.95259732f, 0.622979105f}, std::array<float,2>{0.229324967f, 0.0830474645f}, std::array<float,2>{0.336962342f, 0.541358173f}, std::array<float,2>{0.517710268f, 0.0293200146f}, std::array<float,2>{0.835433662f, 0.928257704f}, std::array<float,2>{0.054890912f, 0.293166339f}, std::array<float,2>{0.163965657f, 0.829761863f}, std::array<float,2>{0.916722059f, 0.390046358f}, std::array<float,2>{0.641679168f, 0.646464646f}, std::array<float,2>{0.449319065f, 0.145445764f}, std::array<float,2>{0.209471777f, 0.577324688f}, std::array<float,2>{0.992726505f, 0.107036427f}, std::array<float,2>{0.749877751f, 0.995989263f}, std::array<float,2>{0.380286634f, 0.343237489f}, std::array<float,2>{0.255538642f, 0.760483921f}, std::array<float,2>{0.598312438f, 0.494181782f}, std::array<float,2>{0.752483606f, 0.719046056f}, std::array<float,2>{0.101861432f, 0.212005854f}, std::array<float,2>{0.475186825f, 0.663025975f}, std::array<float,2>{0.660024762f, 0.164348111f}, std::array<float,2>{0.88726151f, 0.844893157f}, std::array<float,2>{0.147073478f, 0.412875891f}, std::array<float,2>{0.000574618112f, 0.896224618f}, std::array<float,2>{0.861928761f, 0.25185293f}, std::array<float,2>{0.533865869f, 0.527997077f}, std::array<float,2>{0.34605971f, 0.0313968509f}, std::array<float,2>{0.168173447f, 0.709296048f}, std::array<float,2>{0.909844279f, 0.222600088f}, std::array<float,2>{0.652909577f, 0.788683593f}, std::array<float,2>{0.441879958f, 0.459870756f}, std::array<float,2>{0.330455214f, 0.947581291f}, std::array<float,2>{0.530456305f, 0.351888627f}, std::array<float,2>{0.838732898f, 0.598626673f}, std::array<float,2>{0.048868034f, 0.0649305135f}, std::array<float,2>{0.435787141f, 0.560378015f}, std::array<float,2>{0.7172876f, 0.00792348664f}, std::array<float,2>{0.941288412f, 0.911391675f}, std::array<float,2>{0.220217973f, 0.303478122f}, std::array<float,2>{0.0776922181f, 0.816841722f}, std::array<float,2>{0.802792192f, 0.400975645f}, std::array<float,2>{0.5756405f, 0.626505613f}, std::array<float,2>{0.300062507f, 0.134345174f}, std::array<float,2>{0.0139549924f, 0.587645113f}, std::array<float,2>{0.870661139f, 0.113752142f}, std::array<float,2>{0.544549823f, 0.979407668f}, std::array<float,2>{0.356270432f, 0.327213019f}, std::array<float,2>{0.480383426f, 0.770258784f}, std::array<float,2>{0.665077686f, 0.472755551f}, std::array<float,2>{0.876823008f, 0.737753391f}, std::array<float,2>{0.153526589f, 0.195885569f}, std::array<float,2>{0.264360309f, 0.676023245f}, std::array<float,2>{0.602744162f, 0.184602812f}, std::array<float,2>{0.761241376f, 0.871443391f}, std::array<float,2>{0.0958521217f, 0.42351526f}, std::array<float,2>{0.216839835f, 0.879047096f}, std::array<float,2>{0.988026083f, 0.267485261f}, std::array<float,2>{0.741793513f, 0.506297231f}, std::array<float,2>{0.389822304f, 0.0586451739f}, std::array<float,2>{0.113865718f, 0.644399643f}, std::array<float,2>{0.770160437f, 0.143997118f}, std::array<float,2>{0.617063105f, 0.833145857f}, std::array<float,2>{0.265763372f, 0.385169744f}, std::array<float,2>{0.405474395f, 0.92335093f}, std::array<float,2>{0.729673386f, 0.292744428f}, std::array<float,2>{0.971289754f, 0.545906723f}, std::array<float,2>{0.189001784f, 0.0241279695f}, std::array<float,2>{0.366768897f, 0.617369831f}, std::array<float,2>{0.554601669f, 0.0793028623f}, std::array<float,2>{0.848369479f, 0.961695492f}, std::array<float,2>{0.0174906235f, 0.368179828f}, std::array<float,2>{0.131440207f, 0.805337846f}, std::array<float,2>{0.904846847f, 0.451711923f}, std::array<float,2>{0.680152297f, 0.701385796f}, std::array<float,2>{0.499826193f, 0.24090685f}, std::array<float,2>{0.234385654f, 0.525128007f}, std::array<float,2>{0.964551449f, 0.0369021185f}, std::array<float,2>{0.692350328f, 0.890666485f}, std::array<float,2>{0.418521374f, 0.254416972f}, std::array<float,2>{0.288417459f, 0.848063648f}, std::array<float,2>{0.59041667f, 0.406860024f}, std::array<float,2>{0.789075971f, 0.656870604f}, std::array<float,2>{0.0884061903f, 0.171328828f}, std::array<float,2>{0.455398142f, 0.725964785f}, std::array<float,2>{0.638921201f, 0.21846506f}, std::array<float,2>{0.923774302f, 0.765392303f}, std::array<float,2>{0.180802777f, 0.496708542f}, std::array<float,2>{0.046367377f, 0.996792257f}, std::array<float,2>{0.819666207f, 0.336359769f}, std::array<float,2>{0.503538311f, 0.573075712f}, std::array<float,2>{0.32506755f, 0.10384085f}, std::array<float,2>{0.20065096f, 0.670091987f}, std::array<float,2>{0.983710706f, 0.158044919f}, std::array<float,2>{0.72181052f, 0.8538661f}, std::array<float,2>{0.39561522f, 0.416226745f}, std::array<float,2>{0.276831329f, 0.9037714f}, std::array<float,2>{0.621542454f, 0.258676231f}, std::array<float,2>{0.778649092f, 0.516206503f}, std::array<float,2>{0.124260254f, 0.0444568954f}, std::array<float,2>{0.489406735f, 0.565082967f}, std::array<float,2>{0.672415853f, 0.096298188f}, std::array<float,2>{0.896719992f, 0.991343796f}, std::array<float,2>{0.139633149f, 0.330448717f}, std::array<float,2>{0.0237305518f, 0.750856221f}, std::array<float,2>{0.85754931f, 0.487385035f}, std::array<float,2>{0.555685222f, 0.728316128f}, std::array<float,2>{0.369775474f, 0.209893882f}, std::array<float,2>{0.0815049931f, 0.536805212f}, std::array<float,2>{0.785250843f, 0.0191784054f}, std::array<float,2>{0.584285438f, 0.931778252f}, std::array<float,2>{0.292274714f, 0.286319911f}, std::array<float,2>{0.409232199f, 0.843146682f}, std::array<float,2>{0.697735667f, 0.377417207f}, std::array<float,2>{0.95957917f, 0.649856567f}, std::array<float,2>{0.247141302f, 0.150451288f}, std::array<float,2>{0.319480985f, 0.691787422f}, std::array<float,2>{0.515281081f, 0.242889822f}, std::array<float,2>{0.825810194f, 0.800944209f}, std::array<float,2>{0.033028625f, 0.439427376f}, std::array<float,2>{0.176885247f, 0.959268034f}, std::array<float,2>{0.930579245f, 0.366038114f}, std::array<float,2>{0.627852917f, 0.616206169f}, std::array<float,2>{0.462720722f, 0.0926957205f}, std::array<float,2>{0.0614670776f, 0.743889213f}, std::array<float,2>{0.829311013f, 0.193441659f}, std::array<float,2>{0.522391498f, 0.779172361f}, std::array<float,2>{0.343127728f, 0.482857049f}, std::array<float,2>{0.448414385f, 0.97335273f}, std::array<float,2>{0.64594841f, 0.315808207f}, std::array<float,2>{0.918557942f, 0.584297657f}, std::array<float,2>{0.159913331f, 0.117807381f}, std::array<float,2>{0.309835613f, 0.50823915f}, std::array<float,2>{0.566008747f, 0.0474746972f}, std::array<float,2>{0.812191546f, 0.889532506f}, std::array<float,2>{0.0690924451f, 0.274138808f}, std::array<float,2>{0.233611837f, 0.863375008f}, std::array<float,2>{0.947648466f, 0.431823552f}, std::array<float,2>{0.704724431f, 0.686107218f}, std::array<float,2>{0.426729918f, 0.178565919f}, std::array<float,2>{0.143541738f, 0.60170269f}, std::array<float,2>{0.886211038f, 0.0725934654f}, std::array<float,2>{0.66348213f, 0.941417813f}, std::array<float,2>{0.47000733f, 0.344064713f}, std::array<float,2>{0.349081457f, 0.79646492f}, std::array<float,2>{0.536761701f, 0.461720377f}, std::array<float,2>{0.863412261f, 0.712119877f}, std::array<float,2>{0.00759359449f, 0.226759195f}, std::array<float,2>{0.378465354f, 0.633101344f}, std::array<float,2>{0.745760977f, 0.130665556f}, std::array<float,2>{0.997021794f, 0.827393711f}, std::array<float,2>{0.205333948f, 0.393478513f}, std::array<float,2>{0.108987294f, 0.915836275f}, std::array<float,2>{0.757707655f, 0.308265716f}, std::array<float,2>{0.595973194f, 0.548491001f}, std::array<float,2>{0.251762539f, 0.000449750252f}, std::array<float,2>{0.24683851f, 0.695251703f}, std::array<float,2>{0.960166752f, 0.245466128f}, std::array<float,2>{0.698911786f, 0.803361058f}, std::array<float,2>{0.408817023f, 0.439499527f}, std::array<float,2>{0.291633785f, 0.958870411f}, std::array<float,2>{0.585062921f, 0.36349389f}, std::array<float,2>{0.786143005f, 0.614366472f}, std::array<float,2>{0.0808397532f, 0.090433985f}, std::array<float,2>{0.461412728f, 0.538166404f}, std::array<float,2>{0.628227949f, 0.0166481994f}, std::array<float,2>{0.931325436f, 0.929690599f}, std::array<float,2>{0.176112562f, 0.288771033f}, std::array<float,2>{0.0315004773f, 0.84079051f}, std::array<float,2>{0.824362814f, 0.376297683f}, std::array<float,2>{0.514031589f, 0.651226044f}, std::array<float,2>{0.318926841f, 0.149303347f}, std::array<float,2>{0.123697907f, 0.563858569f}, std::array<float,2>{0.778018236f, 0.0944163054f}, std::array<float,2>{0.622993648f, 0.989789784f}, std::array<float,2>{0.275909215f, 0.329575151f}, std::array<float,2>{0.394725323f, 0.753740788f}, std::array<float,2>{0.720891178f, 0.48571974f}, std::array<float,2>{0.983159721f, 0.72966367f}, std::array<float,2>{0.200036108f, 0.208320171f}, std::array<float,2>{0.370443076f, 0.668461859f}, std::array<float,2>{0.55492419f, 0.15980342f}, std::array<float,2>{0.859142661f, 0.853428364f}, std::array<float,2>{0.0251059569f, 0.415391773f}, std::array<float,2>{0.139822915f, 0.905760884f}, std::array<float,2>{0.898117542f, 0.260923505f}, std::array<float,2>{0.673033237f, 0.517658949f}, std::array<float,2>{0.489190817f, 0.0452721082f}, std::array<float,2>{0.00616125436f, 0.634805202f}, std::array<float,2>{0.86441499f, 0.131637231f}, std::array<float,2>{0.535285652f, 0.824831665f}, std::array<float,2>{0.348005861f, 0.391165048f}, std::array<float,2>{0.469309866f, 0.916083097f}, std::array<float,2>{0.66217804f, 0.304792106f}, std::array<float,2>{0.88563931f, 0.54924798f}, std::array<float,2>{0.144261271f, 0.00235777488f}, std::array<float,2>{0.25087437f, 0.605433047f}, std::array<float,2>{0.597579479f, 0.0707941353f}, std::array<float,2>{0.756102145f, 0.944670558f}, std::array<float,2>{0.107941397f, 0.346558928f}, std::array<float,2>{0.206450343f, 0.793842256f}, std::array<float,2>{0.99792999f, 0.464804977f}, std::array<float,2>{0.744758844f, 0.713738859f}, std::array<float,2>{0.377746075f, 0.229158804f}, std::array<float,2>{0.159069225f, 0.509791136f}, std::array<float,2>{0.919284642f, 0.0491519272f}, std::array<float,2>{0.644969642f, 0.888518274f}, std::array<float,2>{0.447576642f, 0.276171625f}, std::array<float,2>{0.342222303f, 0.865764976f}, std::array<float,2>{0.523083389f, 0.430308819f}, std::array<float,2>{0.828513622f, 0.684728324f}, std::array<float,2>{0.0618419275f, 0.176773831f}, std::array<float,2>{0.426984936f, 0.744544685f}, std::array<float,2>{0.70353502f, 0.19271487f}, std::array<float,2>{0.94884485f, 0.780046046f}, std::array<float,2>{0.232994795f, 0.480680525f}, std::array<float,2>{0.0694697052f, 0.976243734f}, std::array<float,2>{0.8107481f, 0.313338339f}, std::array<float,2>{0.564528525f, 0.582940698f}, std::array<float,2>{0.309000701f, 0.120207831f}, std::array<float,2>{0.152767926f, 0.679552734f}, std::array<float,2>{0.875927508f, 0.186721161f}, std::array<float,2>{0.664081275f, 0.874600112f}, std::array<float,2>{0.479243279f, 0.424392372f}, std::array<float,2>{0.356568754f, 0.881889641f}, std::array<float,2>{0.543353617f, 0.269345462f}, std::array<float,2>{0.869676709f, 0.50408566f}, std::array<float,2>{0.0146834338f, 0.0613781959f}, std::array<float,2>{0.389282405f, 0.588865519f}, std::array<float,2>{0.741136551f, 0.116126508f}, std::array<float,2>{0.986472726f, 0.976981819f}, std::array<float,2>{0.218389675f, 0.325171143f}, std::array<float,2>{0.0973349586f, 0.773072779f}, std::array<float,2>{0.760039806f, 0.475812584f}, std::array<float,2>{0.601586103f, 0.736006916f}, std::array<float,2>{0.264882296f, 0.197821543f}, std::array<float,2>{0.0502852686f, 0.56235832f}, std::array<float,2>{0.839369595f, 0.0108393263f}, std::array<float,2>{0.529819608f, 0.913205624f}, std::array<float,2>{0.332023174f, 0.301963687f}, std::array<float,2>{0.443148762f, 0.819019556f}, std::array<float,2>{0.654190183f, 0.399440944f}, std::array<float,2>{0.908452451f, 0.628829479f}, std::array<float,2>{0.168987975f, 0.135577232f}, std::array<float,2>{0.299239397f, 0.708056867f}, std::array<float,2>{0.574960768f, 0.220094576f}, std::array<float,2>{0.803890586f, 0.787041724f}, std::array<float,2>{0.0771482363f, 0.458417296f}, std::array<float,2>{0.219426826f, 0.945700049f}, std::array<float,2>{0.939791143f, 0.354910374f}, std::array<float,2>{0.7186988f, 0.601522684f}, std::array<float,2>{0.437291563f, 0.062657252f}, std::array<float,2>{0.0889066681f, 0.723048389f}, std::array<float,2>{0.790507793f, 0.216171652f}, std::array<float,2>{0.591035366f, 0.762855172f}, std::array<float,2>{0.287614137f, 0.498546898f}, std::array<float,2>{0.419534266f, 0.998731077f}, std::array<float,2>{0.693184435f, 0.339344174f}, std::array<float,2>{0.963608325f, 0.572114468f}, std::array<float,2>{0.235356972f, 0.102516167f}, std::array<float,2>{0.325551897f, 0.52676034f}, std::array<float,2>{0.502768159f, 0.0377337225f}, std::array<float,2>{0.818750501f, 0.893325806f}, std::array<float,2>{0.0452221408f, 0.256617099f}, std::array<float,2>{0.179776698f, 0.849839687f}, std::array<float,2>{0.922708571f, 0.409522831f}, std::array<float,2>{0.640538812f, 0.658936977f}, std::array<float,2>{0.456816435f, 0.168601543f}, std::array<float,2>{0.188286081f, 0.619507253f}, std::array<float,2>{0.972231567f, 0.0807669535f}, std::array<float,2>{0.728821039f, 0.963151157f}, std::array<float,2>{0.405097365f, 0.36915648f}, std::array<float,2>{0.267008245f, 0.807158768f}, std::array<float,2>{0.616196632f, 0.449652016f}, std::array<float,2>{0.770653009f, 0.699304819f}, std::array<float,2>{0.114344962f, 0.239436701f}, std::array<float,2>{0.498998404f, 0.640887558f}, std::array<float,2>{0.681272566f, 0.141700745f}, std::array<float,2>{0.906159103f, 0.83443439f}, std::array<float,2>{0.13272959f, 0.383619189f}, std::array<float,2>{0.0158549417f, 0.925601542f}, std::array<float,2>{0.848894119f, 0.290866047f}, std::array<float,2>{0.553622782f, 0.543531239f}, std::array<float,2>{0.365962654f, 0.0267043002f}, std::array<float,2>{0.174447179f, 0.739770412f}, std::array<float,2>{0.934879303f, 0.201200515f}, std::array<float,2>{0.630403936f, 0.765840709f}, std::array<float,2>{0.468127131f, 0.468900383f}, std::array<float,2>{0.315798908f, 0.983374178f}, std::array<float,2>{0.5112679f, 0.321985841f}, std::array<float,2>{0.823876917f, 0.5923388f}, std::array<float,2>{0.0380633548f, 0.109413885f}, std::array<float,2>{0.412702024f, 0.501041472f}, std::array<float,2>{0.70145905f, 0.0574624166f}, std::array<float,2>{0.955429971f, 0.876018703f}, std::array<float,2>{0.242978096f, 0.272874564f}, std::array<float,2>{0.0827334672f, 0.870122492f}, std::array<float,2>{0.782661498f, 0.428558975f}, std::array<float,2>{0.579949737f, 0.673609912f}, std::array<float,2>{0.296422154f, 0.182286486f}, std::array<float,2>{0.0302350707f, 0.596246123f}, std::array<float,2>{0.851922452f, 0.0692353845f}, std::array<float,2>{0.560727119f, 0.951873839f}, std::array<float,2>{0.373219281f, 0.355596185f}, std::array<float,2>{0.486280322f, 0.784085095f}, std::array<float,2>{0.678622425f, 0.455640554f}, std::array<float,2>{0.892375171f, 0.706460953f}, std::array<float,2>{0.136003718f, 0.226118863f}, std::array<float,2>{0.27892676f, 0.631408513f}, std::array<float,2>{0.61829412f, 0.138198107f}, std::array<float,2>{0.77353543f, 0.813297451f}, std::array<float,2>{0.120527811f, 0.404286146f}, std::array<float,2>{0.195501819f, 0.908277988f}, std::array<float,2>{0.980413556f, 0.297537267f}, std::array<float,2>{0.723141134f, 0.555294394f}, std::array<float,2>{0.390981644f, 0.0145213017f}, std::array<float,2>{0.103026569f, 0.66206634f}, std::array<float,2>{0.753292322f, 0.167610809f}, std::array<float,2>{0.599296033f, 0.84678334f}, std::array<float,2>{0.254330188f, 0.410431474f}, std::array<float,2>{0.379163235f, 0.897461176f}, std::array<float,2>{0.748620927f, 0.25228399f}, std::array<float,2>{0.993200958f, 0.531179607f}, std::array<float,2>{0.21014002f, 0.0339216739f}, std::array<float,2>{0.346718341f, 0.575671732f}, std::array<float,2>{0.534393668f, 0.10803239f}, std::array<float,2>{0.862699986f, 0.993903935f}, std::array<float,2>{0.00183828908f, 0.340990335f}, std::array<float,2>{0.147492662f, 0.757967651f}, std::array<float,2>{0.888478696f, 0.492454052f}, std::array<float,2>{0.658712447f, 0.721533954f}, std::array<float,2>{0.475590527f, 0.214550123f}, std::array<float,2>{0.230108202f, 0.539634109f}, std::array<float,2>{0.95132184f, 0.0275247246f}, std::array<float,2>{0.710859895f, 0.926783085f}, std::array<float,2>{0.422211051f, 0.295455456f}, std::array<float,2>{0.304906934f, 0.831848025f}, std::array<float,2>{0.569188833f, 0.386924297f}, std::array<float,2>{0.807172716f, 0.646785259f}, std::array<float,2>{0.0625159815f, 0.147611216f}, std::array<float,2>{0.45069769f, 0.69828254f}, std::array<float,2>{0.641083837f, 0.237763107f}, std::array<float,2>{0.917554975f, 0.809286952f}, std::array<float,2>{0.162351608f, 0.445856273f}, std::array<float,2>{0.0560439862f, 0.9660694f}, std::array<float,2>{0.834052503f, 0.372291833f}, std::array<float,2>{0.51899159f, 0.624629378f}, std::array<float,2>{0.336375505f, 0.0853682533f}, std::array<float,2>{0.212905079f, 0.653978825f}, std::array<float,2>{0.9887622f, 0.152733698f}, std::array<float,2>{0.737114608f, 0.838463604f}, std::array<float,2>{0.386277288f, 0.382752478f}, std::array<float,2>{0.25788191f, 0.934228182f}, std::array<float,2>{0.606074452f, 0.284304261f}, std::array<float,2>{0.763651848f, 0.534816027f}, std::array<float,2>{0.0980429649f, 0.0212202985f}, std::array<float,2>{0.482432246f, 0.610579967f}, std::array<float,2>{0.668328404f, 0.0864880458f}, std::array<float,2>{0.881314278f, 0.954343975f}, std::array<float,2>{0.148765072f, 0.36007151f}, std::array<float,2>{0.0114641637f, 0.797749102f}, std::array<float,2>{0.873360455f, 0.444835693f}, std::array<float,2>{0.539256215f, 0.691075027f}, std::array<float,2>{0.353961974f, 0.247666478f}, std::array<float,2>{0.0726846755f, 0.52053535f}, std::array<float,2>{0.800274312f, 0.0405916125f}, std::array<float,2>{0.572838724f, 0.898837745f}, std::array<float,2>{0.3012622f, 0.265081048f}, std::array<float,2>{0.432235479f, 0.856077313f}, std::array<float,2>{0.711528301f, 0.419454128f}, std::array<float,2>{0.944893956f, 0.665413558f}, std::array<float,2>{0.22432676f, 0.16095145f}, std::array<float,2>{0.333318472f, 0.733948529f}, std::array<float,2>{0.52624315f, 0.206781268f}, std::array<float,2>{0.841930449f, 0.756136715f}, std::array<float,2>{0.0511292554f, 0.490125984f}, std::array<float,2>{0.164305285f, 0.986160278f}, std::array<float,2>{0.911290467f, 0.33571133f}, std::array<float,2>{0.649672985f, 0.566900551f}, std::array<float,2>{0.440289855f, 0.100959793f}, std::array<float,2>{0.0396676473f, 0.717660725f}, std::array<float,2>{0.813454747f, 0.232958585f}, std::array<float,2>{0.50435394f, 0.789373934f}, std::array<float,2>{0.321159095f, 0.466856837f}, std::array<float,2>{0.457051128f, 0.939121008f}, std::array<float,2>{0.63577199f, 0.350029677f}, std::array<float,2>{0.927172303f, 0.60676074f}, std::array<float,2>{0.184168056f, 0.0780845806f}, std::array<float,2>{0.283177316f, 0.554136753f}, std::array<float,2>{0.589840949f, 0.00711262226f}, std::array<float,2>{0.793318093f, 0.918383896f}, std::array<float,2>{0.0900841355f, 0.309406549f}, std::array<float,2>{0.238496333f, 0.820728302f}, std::array<float,2>{0.967551231f, 0.397445291f}, std::array<float,2>{0.689831972f, 0.640289366f}, std::array<float,2>{0.415087163f, 0.127262443f}, std::array<float,2>{0.126773521f, 0.580985606f}, std::array<float,2>{0.900495887f, 0.12224301f}, std::array<float,2>{0.684727073f, 0.969220936f}, std::array<float,2>{0.494736403f, 0.319716305f}, std::array<float,2>{0.360522717f, 0.774316788f}, std::array<float,2>{0.549562633f, 0.478471786f}, std::array<float,2>{0.847397029f, 0.747463703f}, std::array<float,2>{0.0208448432f, 0.191074103f}, std::array<float,2>{0.401269436f, 0.681862414f}, std::array<float,2>{0.731815815f, 0.173113212f}, std::array<float,2>{0.975462139f, 0.862122059f}, std::array<float,2>{0.191782892f, 0.434720695f}, std::array<float,2>{0.110375576f, 0.88543278f}, std::array<float,2>{0.76771611f, 0.281237036f}, std::array<float,2>{0.61017108f, 0.515599668f}, std::array<float,2>{0.27194196f, 0.0520797744f}, std::array<float,2>{0.202563941f, 0.728265703f}, std::array<float,2>{0.981905878f, 0.209507331f}, std::array<float,2>{0.718765914f, 0.750723541f}, std::array<float,2>{0.397236615f, 0.48769474f}, std::array<float,2>{0.273772717f, 0.991593063f}, std::array<float,2>{0.624633014f, 0.330189705f}, std::array<float,2>{0.779555261f, 0.565273523f}, std::array<float,2>{0.121834897f, 0.096547462f}, std::array<float,2>{0.491897136f, 0.516455054f}, std::array<float,2>{0.674939334f, 0.0447062664f}, std::array<float,2>{0.894923568f, 0.903415203f}, std::array<float,2>{0.138556451f, 0.258315176f}, std::array<float,2>{0.0268866643f, 0.853640079f}, std::array<float,2>{0.856562018f, 0.416355282f}, std::array<float,2>{0.558212042f, 0.670393765f}, std::array<float,2>{0.367560595f, 0.157760173f}, std::array<float,2>{0.0786406547f, 0.615829289f}, std::array<float,2>{0.788517177f, 0.0924696326f}, std::array<float,2>{0.582040727f, 0.95914042f}, std::array<float,2>{0.289977223f, 0.365925014f}, std::array<float,2>{0.406721324f, 0.801230788f}, std::array<float,2>{0.696692467f, 0.439100742f}, std::array<float,2>{0.957556188f, 0.691629827f}, std::array<float,2>{0.248136818f, 0.242989808f}, std::array<float,2>{0.316864729f, 0.649449229f}, std::array<float,2>{0.511954844f, 0.150726318f}, std::array<float,2>{0.827121496f, 0.842838347f}, std::array<float,2>{0.0336504467f, 0.377130955f}, std::array<float,2>{0.178139925f, 0.932065547f}, std::array<float,2>{0.931960225f, 0.286510795f}, std::array<float,2>{0.626386642f, 0.537071586f}, std::array<float,2>{0.464648545f, 0.0195243675f}, std::array<float,2>{0.058899384f, 0.686428905f}, std::array<float,2>{0.830245733f, 0.178292111f}, std::array<float,2>{0.52018708f, 0.863736689f}, std::array<float,2>{0.341498375f, 0.43189469f}, std::array<float,2>{0.445559621f, 0.889201641f}, std::array<float,2>{0.648378015f, 0.274173051f}, std::array<float,2>{0.921373606f, 0.508042634f}, std::array<float,2>{0.156332105f, 0.0476790033f}, std::array<float,2>{0.310664088f, 0.584134698f}, std::array<float,2>{0.562874615f, 0.117977545f}, std::array<float,2>{0.810370684f, 0.973436654f}, std::array<float,2>{0.068170622f, 0.315594405f}, std::array<float,2>{0.231783584f, 0.77897644f}, std::array<float,2>{0.946222186f, 0.482436419f}, std::array<float,2>{0.70548147f, 0.74413085f}, std::array<float,2>{0.428114593f, 0.193739787f}, std::array<float,2>{0.141675532f, 0.548782706f}, std::array<float,2>{0.884318054f, 2.49664481e-05f}, std::array<float,2>{0.661041796f, 0.915644705f}, std::array<float,2>{0.471079469f, 0.308511287f}, std::array<float,2>{0.351290733f, 0.827183127f}, std::array<float,2>{0.538930237f, 0.393109441f}, std::array<float,2>{0.866772234f, 0.632865191f}, std::array<float,2>{0.00539479824f, 0.130451486f}, std::array<float,2>{0.375885189f, 0.71219784f}, std::array<float,2>{0.742297828f, 0.227046043f}, std::array<float,2>{0.999193609f, 0.796700358f}, std::array<float,2>{0.203697592f, 0.461566001f}, std::array<float,2>{0.106658563f, 0.94168365f}, std::array<float,2>{0.75491488f, 0.343916357f}, std::array<float,2>{0.59437561f, 0.601947844f}, std::array<float,2>{0.253048927f, 0.0722864419f}, std::array<float,2>{0.170166343f, 0.626832008f}, std::array<float,2>{0.906524122f, 0.134571627f}, std::array<float,2>{0.654704034f, 0.81653595f}, std::array<float,2>{0.444601864f, 0.40125677f}, std::array<float,2>{0.328635693f, 0.911350012f}, std::array<float,2>{0.527858555f, 0.303265482f}, std::array<float,2>{0.836126745f, 0.560162067f}, std::array<float,2>{0.046987772f, 0.00810967479f}, std::array<float,2>{0.434525847f, 0.598195076f}, std::array<float,2>{0.715844274f, 0.0644981414f}, std::array<float,2>{0.938292325f, 0.947461545f}, std::array<float,2>{0.221638411f, 0.351654857f}, std::array<float,2>{0.0760327354f, 0.788987339f}, std::array<float,2>{0.800813198f, 0.459626526f}, std::array<float,2>{0.576568842f, 0.70906657f}, std::array<float,2>{0.298455417f, 0.222209558f}, std::array<float,2>{0.0134666432f, 0.506004155f}, std::array<float,2>{0.86761272f, 0.0589805469f}, std::array<float,2>{0.545900762f, 0.879181981f}, std::array<float,2>{0.358657092f, 0.267159015f}, std::array<float,2>{0.478310227f, 0.871130705f}, std::array<float,2>{0.666742861f, 0.423702449f}, std::array<float,2>{0.877539754f, 0.676199317f}, std::array<float,2>{0.155676052f, 0.184932932f}, std::array<float,2>{0.262414128f, 0.737400413f}, std::array<float,2>{0.605275452f, 0.196285188f}, std::array<float,2>{0.759548903f, 0.770412922f}, std::array<float,2>{0.0956696048f, 0.473075837f}, std::array<float,2>{0.216037586f, 0.97918272f}, std::array<float,2>{0.986190557f, 0.327594757f}, std::array<float,2>{0.739103675f, 0.587827206f}, std::array<float,2>{0.387084812f, 0.113285162f}, std::array<float,2>{0.115435302f, 0.701639712f}, std::array<float,2>{0.772372782f, 0.241043314f}, std::array<float,2>{0.614061773f, 0.805472314f}, std::array<float,2>{0.267970026f, 0.452052206f}, std::array<float,2>{0.402854174f, 0.961500108f}, std::array<float,2>{0.727509499f, 0.368463695f}, std::array<float,2>{0.969843447f, 0.617561817f}, std::array<float,2>{0.191339567f, 0.0795062631f}, std::array<float,2>{0.364847392f, 0.546277821f}, std::array<float,2>{0.552186668f, 0.024213735f}, std::array<float,2>{0.851075768f, 0.923792243f}, std::array<float,2>{0.0192872956f, 0.292523533f}, std::array<float,2>{0.130814761f, 0.833346963f}, std::array<float,2>{0.902935266f, 0.384922177f}, std::array<float,2>{0.682308912f, 0.644128561f}, std::array<float,2>{0.497838438f, 0.143705532f}, std::array<float,2>{0.237157732f, 0.572905719f}, std::array<float,2>{0.962599933f, 0.103560843f}, std::array<float,2>{0.694707096f, 0.996920705f}, std::array<float,2>{0.421349436f, 0.335990667f}, std::array<float,2>{0.286013424f, 0.765194237f}, std::array<float,2>{0.592396259f, 0.496833265f}, std::array<float,2>{0.792314768f, 0.725795269f}, std::array<float,2>{0.0869526789f, 0.218702137f}, std::array<float,2>{0.454607636f, 0.657088757f}, std::array<float,2>{0.638290524f, 0.171058908f}, std::array<float,2>{0.924442589f, 0.847858906f}, std::array<float,2>{0.183170661f, 0.407035291f}, std::array<float,2>{0.0442268103f, 0.891039252f}, std::array<float,2>{0.817991614f, 0.254844844f}, std::array<float,2>{0.50112319f, 0.525191963f}, std::array<float,2>{0.326357812f, 0.0367130786f}, std::array<float,2>{0.134762064f, 0.703287601f}, std::array<float,2>{0.893590152f, 0.224012613f}, std::array<float,2>{0.676887453f, 0.782887459f}, std::array<float,2>{0.487264901f, 0.453526914f}, std::array<float,2>{0.372089803f, 0.9503299f}, std::array<float,2>{0.559227586f, 0.358960509f}, std::array<float,2>{0.853838921f, 0.595563293f}, std::array<float,2>{0.0276680272f, 0.0673389807f}, std::array<float,2>{0.393570393f, 0.558304429f}, std::array<float,2>{0.724637806f, 0.0130610485f}, std::array<float,2>{0.977999806f, 0.908051848f}, std::array<float,2>{0.198672995f, 0.300414979f}, std::array<float,2>{0.117857121f, 0.815792382f}, std::array<float,2>{0.776848435f, 0.405447006f}, std::array<float,2>{0.620212555f, 0.629191279f}, std::array<float,2>{0.280833453f, 0.139842734f}, std::array<float,2>{0.0360745713f, 0.591646969f}, std::array<float,2>{0.82167536f, 0.113001309f}, std::array<float,2>{0.508672833f, 0.980505884f}, std::array<float,2>{0.313236266f, 0.322463304f}, std::array<float,2>{0.465167612f, 0.769022882f}, std::array<float,2>{0.631503344f, 0.47082293f}, std::array<float,2>{0.937446415f, 0.740906954f}, std::array<float,2>{0.173305795f, 0.200780079f}, std::array<float,2>{0.294643849f, 0.675186276f}, std::array<float,2>{0.580102324f, 0.181221411f}, std::array<float,2>{0.783961892f, 0.868881643f}, std::array<float,2>{0.085361667f, 0.42611146f}, std::array<float,2>{0.245263919f, 0.877879798f}, std::array<float,2>{0.954206586f, 0.271037072f}, std::array<float,2>{0.699807286f, 0.503548443f}, std::array<float,2>{0.410610259f, 0.056518171f}, std::array<float,2>{0.0661406368f, 0.646173775f}, std::array<float,2>{0.805662274f, 0.145042673f}, std::array<float,2>{0.566426277f, 0.829973638f}, std::array<float,2>{0.307702094f, 0.389825344f}, std::array<float,2>{0.424222171f, 0.928645134f}, std::array<float,2>{0.7082358f, 0.293456495f}, std::array<float,2>{0.949872315f, 0.541175723f}, std::array<float,2>{0.228504613f, 0.0296114534f}, std::array<float,2>{0.339637399f, 0.622650802f}, std::array<float,2>{0.516321242f, 0.0834264085f}, std::array<float,2>{0.833648205f, 0.967708886f}, std::array<float,2>{0.058367528f, 0.374796957f}, std::array<float,2>{0.160975397f, 0.81094867f}, std::array<float,2>{0.914510369f, 0.448234886f}, std::array<float,2>{0.643715203f, 0.695821106f}, std::array<float,2>{0.452191144f, 0.235579267f}, std::array<float,2>{0.208263665f, 0.528236091f}, std::array<float,2>{0.99466455f, 0.0316442139f}, std::array<float,2>{0.746633291f, 0.896277428f}, std::array<float,2>{0.382140487f, 0.251526326f}, std::array<float,2>{0.256388456f, 0.845040858f}, std::array<float,2>{0.599912822f, 0.412747681f}, std::array<float,2>{0.751167178f, 0.662603259f}, std::array<float,2>{0.10367237f, 0.164268062f}, std::array<float,2>{0.474554032f, 0.718961298f}, std::array<float,2>{0.657455325f, 0.212241516f}, std::array<float,2>{0.890168011f, 0.760548353f}, std::array<float,2>{0.14597632f, 0.494415551f}, std::array<float,2>{0.00383831048f, 0.9956339f}, std::array<float,2>{0.859479427f, 0.342804521f}, std::array<float,2>{0.533133566f, 0.57750535f}, std::array<float,2>{0.345496118f, 0.107396856f}, std::array<float,2>{0.22518225f, 0.666958511f}, std::array<float,2>{0.942933917f, 0.16290164f}, std::array<float,2>{0.714167416f, 0.858512342f}, std::array<float,2>{0.430542201f, 0.4209795f}, std::array<float,2>{0.302745938f, 0.901858389f}, std::array<float,2>{0.571291924f, 0.263449013f}, std::array<float,2>{0.797168374f, 0.521990776f}, std::array<float,2>{0.0722019225f, 0.0426789187f}, std::array<float,2>{0.4381845f, 0.570015788f}, std::array<float,2>{0.650446415f, 0.0976808891f}, std::array<float,2>{0.91297698f, 0.987217009f}, std::array<float,2>{0.166206419f, 0.333233356f}, std::array<float,2>{0.0537537001f, 0.753969848f}, std::array<float,2>{0.840283751f, 0.490812391f}, std::array<float,2>{0.525097251f, 0.730606735f}, std::array<float,2>{0.335819989f, 0.203776628f}, std::array<float,2>{0.1001762f, 0.532823622f}, std::array<float,2>{0.765567183f, 0.0215239134f}, std::array<float,2>{0.609020174f, 0.936653674f}, std::array<float,2>{0.261117369f, 0.281833708f}, std::array<float,2>{0.383609414f, 0.837235332f}, std::array<float,2>{0.735186517f, 0.380793452f}, std::array<float,2>{0.992177188f, 0.655102611f}, std::array<float,2>{0.212144926f, 0.155630678f}, std::array<float,2>{0.352773428f, 0.689113915f}, std::array<float,2>{0.542939723f, 0.248213157f}, std::array<float,2>{0.872796118f, 0.800085008f}, std::array<float,2>{0.00973092671f, 0.442484379f}, std::array<float,2>{0.150753573f, 0.955221832f}, std::array<float,2>{0.879707932f, 0.362305105f}, std::array<float,2>{0.670967579f, 0.612223148f}, std::array<float,2>{0.481703162f, 0.0884469673f}, std::array<float,2>{0.0231960099f, 0.749767661f}, std::array<float,2>{0.843898296f, 0.187645227f}, std::array<float,2>{0.547420263f, 0.776430726f}, std::array<float,2>{0.361393332f, 0.479524016f}, std::array<float,2>{0.492526889f, 0.972094238f}, std::array<float,2>{0.68661809f, 0.317997158f}, std::array<float,2>{0.899045885f, 0.578542471f}, std::array<float,2>{0.127262101f, 0.123440176f}, std::array<float,2>{0.270804644f, 0.512878239f}, std::array<float,2>{0.613054156f, 0.0546768904f}, std::array<float,2>{0.766466856f, 0.88449043f}, std::array<float,2>{0.11163941f, 0.278096616f}, std::array<float,2>{0.195006132f, 0.859741807f}, std::array<float,2>{0.973944187f, 0.437296152f}, std::array<float,2>{0.733948886f, 0.680064857f}, std::array<float,2>{0.39981547f, 0.175425723f}, std::array<float,2>{0.185586154f, 0.607635558f}, std::array<float,2>{0.928443968f, 0.0757049769f}, std::array<float,2>{0.633373559f, 0.941282392f}, std::array<float,2>{0.460449457f, 0.348867655f}, std::array<float,2>{0.324013591f, 0.792702734f}, std::array<float,2>{0.506875634f, 0.466195613f}, std::array<float,2>{0.815256417f, 0.715499759f}, std::array<float,2>{0.042584803f, 0.23170428f}, std::array<float,2>{0.41720739f, 0.63858366f}, std::array<float,2>{0.687844157f, 0.125349492f}, std::array<float,2>{0.964876771f, 0.823225796f}, std::array<float,2>{0.240732685f, 0.394715488f}, std::array<float,2>{0.09199889f, 0.920407116f}, std::array<float,2>{0.795278132f, 0.312323302f}, std::array<float,2>{0.587784111f, 0.551903427f}, std::array<float,2>{0.284112483f, 0.00546104368f}, std::array<float,2>{0.204738632f, 0.714654863f}, std::array<float,2>{0.99852252f, 0.229717553f}, std::array<float,2>{0.743635356f, 0.793959439f}, std::array<float,2>{0.376016051f, 0.463331074f}, std::array<float,2>{0.252259105f, 0.944301426f}, std::array<float,2>{0.595618367f, 0.34728846f}, std::array<float,2>{0.754000843f, 0.603733897f}, std::array<float,2>{0.105987012f, 0.0713608339f}, std::array<float,2>{0.471933693f, 0.550119579f}, std::array<float,2>{0.661786497f, 0.0036272225f}, std::array<float,2>{0.883469939f, 0.917740881f}, std::array<float,2>{0.140921026f, 0.306468397f}, std::array<float,2>{0.00406756019f, 0.825687706f}, std::array<float,2>{0.865323186f, 0.391974419f}, std::array<float,2>{0.537558377f, 0.636173725f}, std::array<float,2>{0.34979248f, 0.132685706f}, std::array<float,2>{0.0668671355f, 0.58318305f}, std::array<float,2>{0.809494495f, 0.119756453f}, std::array<float,2>{0.563762128f, 0.975477159f}, std::array<float,2>{0.31185326f, 0.313504845f}, std::array<float,2>{0.429533333f, 0.780301392f}, std::array<float,2>{0.706301033f, 0.482049137f}, std::array<float,2>{0.947261274f, 0.745663166f}, std::array<float,2>{0.231273592f, 0.191821098f}, std::array<float,2>{0.33985281f, 0.68423003f}, std::array<float,2>{0.520527422f, 0.176550314f}, std::array<float,2>{0.831141055f, 0.866300523f}, std::array<float,2>{0.0603572316f, 0.431298941f}, std::array<float,2>{0.157725915f, 0.887265861f}, std::array<float,2>{0.920600951f, 0.27670756f}, std::array<float,2>{0.64651376f, 0.511305153f}, std::array<float,2>{0.4466438f, 0.0500758365f}, std::array<float,2>{0.0350124016f, 0.65155834f}, std::array<float,2>{0.827419758f, 0.149626419f}, std::array<float,2>{0.51302439f, 0.84124583f}, std::array<float,2>{0.317467153f, 0.375339776f}, std::array<float,2>{0.463698596f, 0.930880189f}, std::array<float,2>{0.625346422f, 0.287193f}, std::array<float,2>{0.932935596f, 0.537409544f}, std::array<float,2>{0.179631621f, 0.0157967974f}, std::array<float,2>{0.290996075f, 0.613891423f}, std::array<float,2>{0.583118439f, 0.0908253565f}, std::array<float,2>{0.787859499f, 0.957157493f}, std::array<float,2>{0.0798873901f, 0.364868581f}, std::array<float,2>{0.249368206f, 0.804362476f}, std::array<float,2>{0.958499491f, 0.440713733f}, std::array<float,2>{0.695869088f, 0.693957865f}, std::array<float,2>{0.407481879f, 0.245064199f}, std::array<float,2>{0.137083411f, 0.519403875f}, std::array<float,2>{0.896346688f, 0.046168182f}, std::array<float,2>{0.674471319f, 0.904351056f}, std::array<float,2>{0.490442067f, 0.260509908f}, std::array<float,2>{0.368403882f, 0.851609886f}, std::array<float,2>{0.556806684f, 0.414662331f}, std::array<float,2>{0.855552375f, 0.669383168f}, std::array<float,2>{0.02547759f, 0.158480689f}, std::array<float,2>{0.398090124f, 0.728551805f}, std::array<float,2>{0.719866216f, 0.207545742f}, std::array<float,2>{0.980670154f, 0.752607942f}, std::array<float,2>{0.201818839f, 0.484493822f}, std::array<float,2>{0.122635201f, 0.988286257f}, std::array<float,2>{0.78049475f, 0.328834653f}, std::array<float,2>{0.623356462f, 0.563378751f}, std::array<float,2>{0.274600565f, 0.0949965641f}, std::array<float,2>{0.181892589f, 0.659670234f}, std::array<float,2>{0.925118685f, 0.16936937f}, std::array<float,2>{0.636743426f, 0.850942791f}, std::array<float,2>{0.453497171f, 0.408562303f}, std::array<float,2>{0.32774052f, 0.893841505f}, std::array<float,2>{0.5003438f, 0.257612348f}, std::array<float,2>{0.816442192f, 0.52610296f}, std::array<float,2>{0.0432262085f, 0.0383560508f}, std::array<float,2>{0.420302778f, 0.570454597f}, std::array<float,2>{0.694090962f, 0.103270493f}, std::array<float,2>{0.96158874f, 0.999295592f}, std::array<float,2>{0.237360984f, 0.338854581f}, std::array<float,2>{0.0863705948f, 0.762170434f}, std::array<float,2>{0.791395843f, 0.499616057f}, std::array<float,2>{0.593315661f, 0.72451359f}, std::array<float,2>{0.286956906f, 0.215342477f}, std::array<float,2>{0.0182470679f, 0.544143021f}, std::array<float,2>{0.850194931f, 0.0260699056f}, std::array<float,2>{0.55079031f, 0.923995852f}, std::array<float,2>{0.364121765f, 0.289482147f}, std::array<float,2>{0.496415347f, 0.835163295f}, std::array<float,2>{0.682979643f, 0.384192944f}, std::array<float,2>{0.903818429f, 0.642461777f}, std::array<float,2>{0.129675552f, 0.141532063f}, std::array<float,2>{0.268669814f, 0.700886428f}, std::array<float,2>{0.615178585f, 0.239051908f}, std::array<float,2>{0.773133993f, 0.807778239f}, std::array<float,2>{0.116913103f, 0.451042563f}, std::array<float,2>{0.189847082f, 0.963949323f}, std::array<float,2>{0.969341218f, 0.370362997f}, std::array<float,2>{0.727553129f, 0.620398283f}, std::array<float,2>{0.403627068f, 0.0810856149f}, std::array<float,2>{0.0941717997f, 0.734448731f}, std::array<float,2>{0.758087814f, 0.198400542f}, std::array<float,2>{0.604022563f, 0.771678746f}, std::array<float,2>{0.263162941f, 0.475502938f}, std::array<float,2>{0.388492256f, 0.977561593f}, std::array<float,2>{0.739842653f, 0.325451195f}, std::array<float,2>{0.984594107f, 0.589008808f}, std::array<float,2>{0.215069577f, 0.117049754f}, std::array<float,2>{0.358222216f, 0.505432487f}, std::array<float,2>{0.545430124f, 0.0624581203f}, std::array<float,2>{0.869018197f, 0.881261706f}, std::array<float,2>{0.0124625796f, 0.268433511f}, std::array<float,2>{0.154735118f, 0.873888195f}, std::array<float,2>{0.878122509f, 0.425690442f}, std::array<float,2>{0.667196035f, 0.678051293f}, std::array<float,2>{0.477218121f, 0.18625769f}, std::array<float,2>{0.221805066f, 0.600030303f}, std::array<float,2>{0.938911438f, 0.0641293377f}, std::array<float,2>{0.715031326f, 0.946320057f}, std::array<float,2>{0.43537277f, 0.353915721f}, std::array<float,2>{0.297245145f, 0.785989344f}, std::array<float,2>{0.577304661f, 0.457253307f}, std::array<float,2>{0.801771283f, 0.707617223f}, std::array<float,2>{0.0746295601f, 0.218779832f}, std::array<float,2>{0.444077671f, 0.627506912f}, std::array<float,2>{0.655855119f, 0.135804474f}, std::array<float,2>{0.908173859f, 0.8202191f}, std::array<float,2>{0.171628401f, 0.398753434f}, std::array<float,2>{0.0486109331f, 0.912642717f}, std::array<float,2>{0.837124228f, 0.301325589f}, std::array<float,2>{0.528666973f, 0.561477959f}, std::array<float,2>{0.329452425f, 0.0102750231f}, std::array<float,2>{0.145127788f, 0.722207427f}, std::array<float,2>{0.889221966f, 0.212948427f}, std::array<float,2>{0.656639934f, 0.759002328f}, std::array<float,2>{0.472994328f, 0.493413448f}, std::array<float,2>{0.344065636f, 0.992725909f}, std::array<float,2>{0.531287551f, 0.340345591f}, std::array<float,2>{0.860695362f, 0.574745119f}, std::array<float,2>{0.00224822666f, 0.108875424f}, std::array<float,2>{0.381721616f, 0.529849887f}, std::array<float,2>{0.747744083f, 0.034206003f}, std::array<float,2>{0.995445609f, 0.896569788f}, std::array<float,2>{0.20748423f, 0.253719509f}, std::array<float,2>{0.104514018f, 0.846244574f}, std::array<float,2>{0.750466228f, 0.411889404f}, std::array<float,2>{0.600961566f, 0.660223246f}, std::array<float,2>{0.256924957f, 0.166387379f}, std::array<float,2>{0.057281848f, 0.623571575f}, std::array<float,2>{0.832917213f, 0.0843089223f}, std::array<float,2>{0.517275751f, 0.965530992f}, std::array<float,2>{0.338803649f, 0.371994942f}, std::array<float,2>{0.451918006f, 0.810343266f}, std::array<float,2>{0.642607033f, 0.446903199f}, std::array<float,2>{0.91591382f, 0.697353899f}, std::array<float,2>{0.161207318f, 0.236530349f}, std::array<float,2>{0.306958318f, 0.648041129f}, std::array<float,2>{0.567939639f, 0.147134766f}, std::array<float,2>{0.80599308f, 0.830266178f}, std::array<float,2>{0.0648305789f, 0.388629675f}, std::array<float,2>{0.227147549f, 0.926347196f}, std::array<float,2>{0.950766087f, 0.296535909f}, std::array<float,2>{0.707593024f, 0.540693998f}, std::array<float,2>{0.425507009f, 0.0283748228f}, std::array<float,2>{0.0847726241f, 0.672176898f}, std::array<float,2>{0.784996212f, 0.183286875f}, std::array<float,2>{0.581379116f, 0.869682133f}, std::array<float,2>{0.293100506f, 0.429669797f}, std::array<float,2>{0.411784679f, 0.875757694f}, std::array<float,2>{0.700521111f, 0.272215694f}, std::array<float,2>{0.95312804f, 0.50055486f}, std::array<float,2>{0.244558781f, 0.0580042787f}, std::array<float,2>{0.313842952f, 0.592976511f}, std::array<float,2>{0.508867681f, 0.110440329f}, std::array<float,2>{0.820509195f, 0.983675957f}, std::array<float,2>{0.0366028585f, 0.321199954f}, std::array<float,2>{0.172036558f, 0.766862214f}, std::array<float,2>{0.935676455f, 0.470309883f}, std::array<float,2>{0.632252634f, 0.738919139f}, std::array<float,2>{0.466793597f, 0.202947572f}, std::array<float,2>{0.197962299f, 0.555726171f}, std::array<float,2>{0.976964176f, 0.0146552697f}, std::array<float,2>{0.726432383f, 0.909901857f}, std::array<float,2>{0.392610043f, 0.298171163f}, std::array<float,2>{0.279411912f, 0.813775778f}, std::array<float,2>{0.619880676f, 0.402649224f}, std::array<float,2>{0.776280582f, 0.631909549f}, std::array<float,2>{0.119004123f, 0.137270913f}, std::array<float,2>{0.488182932f, 0.705958784f}, std::array<float,2>{0.676032364f, 0.225002185f}, std::array<float,2>{0.892916977f, 0.784833252f}, std::array<float,2>{0.133593678f, 0.45687443f}, std::array<float,2>{0.0284885783f, 0.952978611f}, std::array<float,2>{0.854536593f, 0.356535733f}, std::array<float,2>{0.560457528f, 0.597317576f}, std::array<float,2>{0.37156415f, 0.069685407f}, std::array<float,2>{0.241509303f, 0.638726413f}, std::array<float,2>{0.966149926f, 0.128533244f}, std::array<float,2>{0.688788474f, 0.822083354f}, std::array<float,2>{0.416763633f, 0.398241401f}, std::array<float,2>{0.284347594f, 0.919464767f}, std::array<float,2>{0.586149931f, 0.309722573f}, std::array<float,2>{0.796871066f, 0.552880406f}, std::array<float,2>{0.0929906666f, 0.00647303183f}, std::array<float,2>{0.459247738f, 0.605656683f}, std::array<float,2>{0.634396493f, 0.0765809193f}, std::array<float,2>{0.929097533f, 0.938138485f}, std::array<float,2>{0.187168092f, 0.35128805f}, std::array<float,2>{0.0418924838f, 0.790061653f}, std::array<float,2>{0.816300333f, 0.467829555f}, std::array<float,2>{0.505973697f, 0.717775702f}, std::array<float,2>{0.323072046f, 0.234260112f}, std::array<float,2>{0.112892926f, 0.513825178f}, std::array<float,2>{0.766618729f, 0.0510137901f}, std::array<float,2>{0.611512363f, 0.886061728f}, std::array<float,2>{0.270460159f, 0.279753596f}, std::array<float,2>{0.398894221f, 0.862943411f}, std::array<float,2>{0.733226836f, 0.434376478f}, std::array<float,2>{0.973428845f, 0.683363378f}, std::array<float,2>{0.193840876f, 0.171955556f}, std::array<float,2>{0.362634182f, 0.746608555f}, std::array<float,2>{0.548083603f, 0.190236688f}, std::array<float,2>{0.84537369f, 0.774437308f}, std::array<float,2>{0.0215165894f, 0.477424085f}, std::array<float,2>{0.128012434f, 0.969784141f}, std::array<float,2>{0.900330365f, 0.318415731f}, std::array<float,2>{0.685967445f, 0.582022309f}, std::array<float,2>{0.493360162f, 0.121135302f}, std::array<float,2>{0.00824728142f, 0.690248013f}, std::array<float,2>{0.871125221f, 0.246499032f}, std::array<float,2>{0.54181993f, 0.798166037f}, std::array<float,2>{0.351861984f, 0.443465203f}, std::array<float,2>{0.480913579f, 0.953702509f}, std::array<float,2>{0.669945121f, 0.360520542f}, std::array<float,2>{0.880175292f, 0.609630167f}, std::array<float,2>{0.152297437f, 0.0876136199f}, std::array<float,2>{0.260473073f, 0.533751726f}, std::array<float,2>{0.607922256f, 0.0204579588f}, std::array<float,2>{0.763843119f, 0.935134292f}, std::array<float,2>{0.10080006f, 0.283441991f}, std::array<float,2>{0.211057618f, 0.839342654f}, std::array<float,2>{0.990641475f, 0.381190151f}, std::array<float,2>{0.735670924f, 0.652593613f}, std::array<float,2>{0.384499073f, 0.153455287f}, std::array<float,2>{0.167946562f, 0.567824066f}, std::array<float,2>{0.913952649f, 0.100116596f}, std::array<float,2>{0.652307689f, 0.98477f}, std::array<float,2>{0.438633263f, 0.334068507f}, std::array<float,2>{0.334881753f, 0.757661343f}, std::array<float,2>{0.523650169f, 0.488292754f}, std::array<float,2>{0.841281533f, 0.732490301f}, std::array<float,2>{0.053596925f, 0.205366746f}, std::array<float,2>{0.430720508f, 0.664624631f}, std::array<float,2>{0.713366508f, 0.162057534f}, std::array<float,2>{0.941821814f, 0.857102036f}, std::array<float,2>{0.2261969f, 0.418238372f}, std::array<float,2>{0.0706847385f, 0.900150239f}, std::array<float,2>{0.79824245f, 0.263993144f}, std::array<float,2>{0.570602357f, 0.520061195f}, std::array<float,2>{0.304615289f, 0.0392452888f}, std::array<float,2>{0.233983457f, 0.74222815f}, std::array<float,2>{0.948030949f, 0.194755003f}, std::array<float,2>{0.704378486f, 0.777753711f}, std::array<float,2>{0.426113546f, 0.484013468f}, std::array<float,2>{0.310413212f, 0.974368274f}, std::array<float,2>{0.565543473f, 0.314986676f}, std::array<float,2>{0.811863959f, 0.585583448f}, std::array<float,2>{0.0685896352f, 0.119056351f}, std::array<float,2>{0.448961884f, 0.508896768f}, std::array<float,2>{0.646424711f, 0.04788379f}, std::array<float,2>{0.91838181f, 0.890468836f}, std::array<float,2>{0.159456208f, 0.275001526f}, std::array<float,2>{0.0609771386f, 0.864678979f}, std::array<float,2>{0.830037892f, 0.43358773f}, std::array<float,2>{0.521727979f, 0.686575711f}, std::array<float,2>{0.343501687f, 0.179064751f}, std::array<float,2>{0.108560637f, 0.603327513f}, std::array<float,2>{0.756881773f, 0.0734681189f}, std::array<float,2>{0.596273839f, 0.94257021f}, std::array<float,2>{0.25132826f, 0.345642239f}, std::array<float,2>{0.378181428f, 0.795052052f}, std::array<float,2>{0.745192409f, 0.462464571f}, std::array<float,2>{0.996306002f, 0.711045802f}, std::array<float,2>{0.205907613f, 0.228261143f}, std::array<float,2>{0.34923175f, 0.634114623f}, std::array<float,2>{0.536422253f, 0.129691735f}, std::array<float,2>{0.863868117f, 0.826575518f}, std::array<float,2>{0.00702424999f, 0.394488603f}, std::array<float,2>{0.14297393f, 0.914189875f}, std::array<float,2>{0.886449218f, 0.307510942f}, std::array<float,2>{0.663903058f, 0.547313094f}, std::array<float,2>{0.470585376f, 0.00157610874f}, std::array<float,2>{0.0240002945f, 0.670903146f}, std::array<float,2>{0.858112276f, 0.156624943f}, std::array<float,2>{0.556252241f, 0.854526699f}, std::array<float,2>{0.369319737f, 0.417143404f}, std::array<float,2>{0.489984363f, 0.902505457f}, std::array<float,2>{0.672180653f, 0.258986771f}, std::array<float,2>{0.897379756f, 0.517117679f}, std::array<float,2>{0.139011934f, 0.0438748933f}, std::array<float,2>{0.277189672f, 0.565778553f}, std::array<float,2>{0.621599317f, 0.0966845453f}, std::array<float,2>{0.778988957f, 0.990825593f}, std::array<float,2>{0.124816798f, 0.331190586f}, std::array<float,2>{0.200799078f, 0.751743257f}, std::array<float,2>{0.984326601f, 0.487066269f}, std::array<float,2>{0.722419858f, 0.727313161f}, std::array<float,2>{0.396066666f, 0.210479721f}, std::array<float,2>{0.177310139f, 0.535157144f}, std::array<float,2>{0.930157542f, 0.0176613368f}, std::array<float,2>{0.626995802f, 0.933260441f}, std::array<float,2>{0.462367505f, 0.285804719f}, std::array<float,2>{0.320147723f, 0.84270674f}, std::array<float,2>{0.514997423f, 0.378295958f}, std::array<float,2>{0.825496078f, 0.649146855f}, std::array<float,2>{0.0323582292f, 0.151967838f}, std::array<float,2>{0.409676343f, 0.692817986f}, std::array<float,2>{0.698240876f, 0.243182525f}, std::array<float,2>{0.959230125f, 0.802439809f}, std::array<float,2>{0.24804315f, 0.437594444f}, std::array<float,2>{0.0817339122f, 0.960535407f}, std::array<float,2>{0.785692871f, 0.366914958f}, std::array<float,2>{0.584922552f, 0.616414309f}, std::array<float,2>{0.292704314f, 0.0931157917f}, std::array<float,2>{0.131083369f, 0.642626405f}, std::array<float,2>{0.904723644f, 0.142713487f}, std::array<float,2>{0.680648685f, 0.832485616f}, std::array<float,2>{0.499024361f, 0.385872632f}, std::array<float,2>{0.366298288f, 0.922605157f}, std::array<float,2>{0.55371815f, 0.291199178f}, std::array<float,2>{0.847819865f, 0.545117319f}, std::array<float,2>{0.0167027097f, 0.0250548441f}, std::array<float,2>{0.406104833f, 0.618608773f}, std::array<float,2>{0.730460882f, 0.0784721673f}, std::array<float,2>{0.971030295f, 0.962068021f}, std::array<float,2>{0.188787043f, 0.367977858f}, std::array<float,2>{0.113645554f, 0.806204915f}, std::array<float,2>{0.769554734f, 0.452437282f}, std::array<float,2>{0.616624355f, 0.703089833f}, std::array<float,2>{0.266185015f, 0.24205929f}, std::array<float,2>{0.0464844666f, 0.524229705f}, std::array<float,2>{0.819903612f, 0.0354779288f}, std::array<float,2>{0.503402889f, 0.892175972f}, std::array<float,2>{0.324382961f, 0.255753875f}, std::array<float,2>{0.455933064f, 0.848863065f}, std::array<float,2>{0.639515221f, 0.407415956f}, std::array<float,2>{0.923201859f, 0.657615244f}, std::array<float,2>{0.181388766f, 0.169973657f}, std::array<float,2>{0.288576216f, 0.725301981f}, std::array<float,2>{0.590143263f, 0.21696572f}, std::array<float,2>{0.789629579f, 0.76383394f}, std::array<float,2>{0.0882453769f, 0.49740991f}, std::array<float,2>{0.235201553f, 0.997367442f}, std::array<float,2>{0.963901818f, 0.337424695f}, std::array<float,2>{0.69151175f, 0.573577762f}, std::array<float,2>{0.418180048f, 0.105411828f}, std::array<float,2>{0.0775383189f, 0.710852444f}, std::array<float,2>{0.803429902f, 0.220817149f}, std::array<float,2>{0.575943828f, 0.788005769f}, std::array<float,2>{0.300460309f, 0.460633785f}, std::array<float,2>{0.436334044f, 0.948715508f}, std::array<float,2>{0.716948152f, 0.35275948f}, std::array<float,2>{0.940898001f, 0.599467754f}, std::array<float,2>{0.219771534f, 0.0661869124f}, std::array<float,2>{0.33101359f, 0.559072375f}, std::array<float,2>{0.531062901f, 0.00879038032f}, std::array<float,2>{0.837954879f, 0.910769165f}, std::array<float,2>{0.0493488796f, 0.303943098f}, std::array<float,2>{0.168698072f, 0.818025887f}, std::array<float,2>{0.909588099f, 0.402093381f}, std::array<float,2>{0.652435303f, 0.625708103f}, std::array<float,2>{0.441916287f, 0.133037508f}, std::array<float,2>{0.2175868f, 0.586864531f}, std::array<float,2>{0.987661123f, 0.114463903f}, std::array<float,2>{0.741692841f, 0.980010271f}, std::array<float,2>{0.390149564f, 0.326526105f}, std::array<float,2>{0.264124632f, 0.771045148f}, std::array<float,2>{0.60332644f, 0.473882973f}, std::array<float,2>{0.761070549f, 0.736730993f}, std::array<float,2>{0.0964243785f, 0.196400851f}, std::array<float,2>{0.479572535f, 0.677371502f}, std::array<float,2>{0.665597737f, 0.184361652f}, std::array<float,2>{0.876441836f, 0.872737408f}, std::array<float,2>{0.154169559f, 0.421976745f}, std::array<float,2>{0.0144006386f, 0.880545259f}, std::array<float,2>{0.870472729f, 0.266348273f}, std::array<float,2>{0.544397652f, 0.507316649f}, std::array<float,2>{0.355659097f, 0.0598463416f}, std::array<float,2>{0.163189083f, 0.696876764f}, std::array<float,2>{0.916483045f, 0.234794348f}, std::array<float,2>{0.642480314f, 0.812295973f}, std::array<float,2>{0.449916214f, 0.448637903f}, std::array<float,2>{0.337666601f, 0.968009412f}, std::array<float,2>{0.518293619f, 0.373964727f}, std::array<float,2>{0.835734904f, 0.621136785f}, std::array<float,2>{0.0554666594f, 0.0826425627f}, std::array<float,2>{0.423273265f, 0.542732656f}, std::array<float,2>{0.709837615f, 0.03104195f}, std::array<float,2>{0.952828348f, 0.929157078f}, std::array<float,2>{0.228593811f, 0.29418835f}, std::array<float,2>{0.0642726049f, 0.828359306f}, std::array<float,2>{0.807709515f, 0.389051884f}, std::array<float,2>{0.569469512f, 0.64530015f}, std::array<float,2>{0.306372613f, 0.145899475f}, std::array<float,2>{0.000379197882f, 0.57691896f}, std::array<float,2>{0.861668348f, 0.106365055f}, std::array<float,2>{0.533650935f, 0.99504149f}, std::array<float,2>{0.346283793f, 0.342263818f}, std::array<float,2>{0.474849284f, 0.760787666f}, std::array<float,2>{0.659196198f, 0.495872796f}, std::array<float,2>{0.886738539f, 0.7200858f}, std::array<float,2>{0.146664798f, 0.211687058f}, std::array<float,2>{0.254896641f, 0.664055824f}, std::array<float,2>{0.597956598f, 0.165462688f}, std::array<float,2>{0.752145946f, 0.844591022f}, std::array<float,2>{0.102075793f, 0.413653642f}, std::array<float,2>{0.209509552f, 0.894824326f}, std::array<float,2>{0.992576957f, 0.250558943f}, std::array<float,2>{0.749466538f, 0.529133201f}, std::array<float,2>{0.380817294f, 0.0322440527f}, std::array<float,2>{0.119757123f, 0.630262077f}, std::array<float,2>{0.775010467f, 0.139313176f}, std::array<float,2>{0.617393792f, 0.81499505f}, std::array<float,2>{0.278115004f, 0.404765278f}, std::array<float,2>{0.392425358f, 0.906521797f}, std::array<float,2>{0.723662853f, 0.299259454f}, std::array<float,2>{0.979276419f, 0.557060719f}, std::array<float,2>{0.196458995f, 0.0117799826f}, std::array<float,2>{0.374714285f, 0.593815982f}, std::array<float,2>{0.562349558f, 0.0681917816f}, std::array<float,2>{0.852603734f, 0.949793994f}, std::array<float,2>{0.0310979746f, 0.358103961f}, std::array<float,2>{0.13514404f, 0.781384468f}, std::array<float,2>{0.890703022f, 0.454486281f}, std::array<float,2>{0.678793252f, 0.704269707f}, std::array<float,2>{0.484380037f, 0.223322123f}, std::array<float,2>{0.243396595f, 0.502326667f}, std::array<float,2>{0.956329644f, 0.0549287982f}, std::array<float,2>{0.702642739f, 0.878696144f}, std::array<float,2>{0.413230449f, 0.27023083f}, std::array<float,2>{0.29502964f, 0.867833972f}, std::array<float,2>{0.578955889f, 0.427281499f}, std::array<float,2>{0.781539321f, 0.674509466f}, std::array<float,2>{0.0838971511f, 0.180577174f}, std::array<float,2>{0.467056394f, 0.741544127f}, std::array<float,2>{0.628926039f, 0.199831605f}, std::array<float,2>{0.934311271f, 0.767988205f}, std::array<float,2>{0.17511341f, 0.471854657f}, std::array<float,2>{0.0388795398f, 0.982344449f}, std::array<float,2>{0.822548211f, 0.323996246f}, std::array<float,2>{0.509971201f, 0.590132833f}, std::array<float,2>{0.314745188f, 0.112103589f}, std::array<float,2>{0.19324179f, 0.68134582f}, std::array<float,2>{0.975763619f, 0.174014345f}, std::array<float,2>{0.730625868f, 0.860749066f}, std::array<float,2>{0.401614696f, 0.436054349f}, std::array<float,2>{0.272548586f, 0.883612394f}, std::array<float,2>{0.610846877f, 0.278639227f}, std::array<float,2>{0.769078612f, 0.511724412f}, std::array<float,2>{0.109864406f, 0.053294234f}, std::array<float,2>{0.495127827f, 0.579947352f}, std::array<float,2>{0.68366611f, 0.124540202f}, std::array<float,2>{0.902266502f, 0.97140497f}, std::array<float,2>{0.125707164f, 0.316649914f}, std::array<float,2>{0.0200975221f, 0.776292384f}, std::array<float,2>{0.845717013f, 0.478588939f}, std::array<float,2>{0.55009228f, 0.748152316f}, std::array<float,2>{0.360026687f, 0.18893896f}, std::array<float,2>{0.0910009667f, 0.551134288f}, std::array<float,2>{0.794025302f, 0.00423242198f}, std::array<float,2>{0.588463187f, 0.921341538f}, std::array<float,2>{0.281501651f, 0.311390877f}, std::array<float,2>{0.414070129f, 0.823648214f}, std::array<float,2>{0.691344261f, 0.395802945f}, std::array<float,2>{0.967891276f, 0.637592912f}, std::array<float,2>{0.239288837f, 0.126177967f}, std::array<float,2>{0.321586043f, 0.716545224f}, std::array<float,2>{0.50489831f, 0.230917215f}, std::array<float,2>{0.813980579f, 0.791418374f}, std::array<float,2>{0.0406748541f, 0.465741396f}, std::array<float,2>{0.185504645f, 0.940372467f}, std::array<float,2>{0.926713109f, 0.348315209f}, std::array<float,2>{0.635706604f, 0.609345853f}, std::array<float,2>{0.458111197f, 0.0750462413f}, std::array<float,2>{0.0521634817f, 0.732369959f}, std::array<float,2>{0.843367279f, 0.20490028f}, std::array<float,2>{0.526968002f, 0.754927635f}, std::array<float,2>{0.332599699f, 0.492130309f}, std::array<float,2>{0.440959573f, 0.987481534f}, std::array<float,2>{0.648533285f, 0.332416981f}, std::array<float,2>{0.91042161f, 0.568664789f}, std::array<float,2>{0.165371984f, 0.0991677567f}, std::array<float,2>{0.302161127f, 0.523431242f}, std::array<float,2>{0.573338807f, 0.0413570628f}, std::array<float,2>{0.799501002f, 0.900852501f}, std::array<float,2>{0.073465623f, 0.262222648f}, std::array<float,2>{0.223411798f, 0.858035028f}, std::array<float,2>{0.943628073f, 0.42039147f}, std::array<float,2>{0.712630272f, 0.667082846f}, std::array<float,2>{0.43358326f, 0.163408414f}, std::array<float,2>{0.150041729f, 0.612978458f}, std::array<float,2>{0.882176161f, 0.089730069f}, std::array<float,2>{0.669292629f, 0.956852674f}, std::array<float,2>{0.483547688f, 0.362260491f}, std::array<float,2>{0.355466664f, 0.799108148f}, std::array<float,2>{0.54028815f, 0.441908598f}, std::array<float,2>{0.874371409f, 0.688039958f}, std::array<float,2>{0.0103569571f, 0.249680683f}, std::array<float,2>{0.38484779f, 0.655295789f}, std::array<float,2>{0.737449765f, 0.15474464f}, std::array<float,2>{0.990105569f, 0.835938275f}, std::array<float,2>{0.214584589f, 0.379029632f}, std::array<float,2>{0.0986338705f, 0.935663104f}, std::array<float,2>{0.762327373f, 0.282283634f}, std::array<float,2>{0.607085466f, 0.531881273f}, std::array<float,2>{0.259677917f, 0.0227670576f}, std::array<float,2>{0.220579222f, 0.707262874f}, std::array<float,2>{0.940983534f, 0.219474941f}, std::array<float,2>{0.717745185f, 0.785552084f}, std::array<float,2>{0.435931653f, 0.45769155f}, std::array<float,2>{0.299860656f, 0.946975648f}, std::array<float,2>{0.575265765f, 0.354251355f}, std::array<float,2>{0.803166687f, 0.600111604f}, std::array<float,2>{0.0780367032f, 0.0639604405f}, std::array<float,2>{0.441471487f, 0.560600817f}, std::array<float,2>{0.653258502f, 0.0100716539f}, std::array<float,2>{0.910066247f, 0.912261486f}, std::array<float,2>{0.168270633f, 0.301084995f}, std::array<float,2>{0.0491848923f, 0.819491804f}, std::array<float,2>{0.838522851f, 0.39924401f}, std::array<float,2>{0.530644655f, 0.627382278f}, std::array<float,2>{0.330084294f, 0.136429995f}, std::array<float,2>{0.0960080922f, 0.589651763f}, std::array<float,2>{0.761530042f, 0.116508469f}, std::array<float,2>{0.602913678f, 0.97831893f}, std::array<float,2>{0.264540166f, 0.325820386f}, std::array<float,2>{0.390055656f, 0.77206862f}, std::array<float,2>{0.742162287f, 0.474916637f}, std::array<float,2>{0.988195896f, 0.734981656f}, std::array<float,2>{0.217133626f, 0.199195638f}, std::array<float,2>{0.35607034f, 0.67838347f}, std::array<float,2>{0.544905424f, 0.185650304f}, std::array<float,2>{0.870872617f, 0.873083234f}, std::array<float,2>{0.0139028206f, 0.424878567f}, std::array<float,2>{0.153645739f, 0.881593883f}, std::array<float,2>{0.876482248f, 0.267767251f}, std::array<float,2>{0.665305316f, 0.505066276f}, std::array<float,2>{0.480077416f, 0.0619325005f}, std::array<float,2>{0.0172706023f, 0.642044067f}, std::array<float,2>{0.848596334f, 0.140972301f}, std::array<float,2>{0.554328918f, 0.835809112f}, std::array<float,2>{0.366978496f, 0.384716362f}, std::array<float,2>{0.499693304f, 0.924685538f}, std::array<float,2>{0.679744899f, 0.289722204f}, std::array<float,2>{0.905172884f, 0.544518709f}, std::array<float,2>{0.131772354f, 0.0255864356f}, std::array<float,2>{0.265975505f, 0.620811939f}, std::array<float,2>{0.616738081f, 0.0815604106f}, std::array<float,2>{0.770408034f, 0.964731395f}, std::array<float,2>{0.114191324f, 0.370651245f}, std::array<float,2>{0.189448893f, 0.808486581f}, std::array<float,2>{0.971626103f, 0.450312912f}, std::array<float,2>{0.72979039f, 0.700507224f}, std::array<float,2>{0.405713379f, 0.238423452f}, std::array<float,2>{0.181085229f, 0.525523603f}, std::array<float,2>{0.923417926f, 0.0387467854f}, std::array<float,2>{0.638719499f, 0.894364893f}, std::array<float,2>{0.455217451f, 0.257099986f}, std::array<float,2>{0.324893445f, 0.851525664f}, std::array<float,2>{0.503673613f, 0.409097821f}, std::array<float,2>{0.81951791f, 0.659630358f}, std::array<float,2>{0.046020329f, 0.169903532f}, std::array<float,2>{0.418933183f, 0.72396934f}, std::array<float,2>{0.691922963f, 0.215312943f}, std::array<float,2>{0.964634418f, 0.762296557f}, std::array<float,2>{0.234808356f, 0.499086231f}, std::array<float,2>{0.0888094008f, 0.999821782f}, std::array<float,2>{0.789374411f, 0.338267803f}, std::array<float,2>{0.590807021f, 0.570919216f}, std::array<float,2>{0.288091868f, 0.102731161f}, std::array<float,2>{0.139345154f, 0.66945833f}, std::array<float,2>{0.896824419f, 0.15892911f}, std::array<float,2>{0.672650337f, 0.852408588f}, std::array<float,2>{0.489553869f, 0.414147437f}, std::array<float,2>{0.370020241f, 0.904859185f}, std::array<float,2>{0.556018353f, 0.25993526f}, std::array<float,2>{0.857870996f, 0.518761277f}, std::array<float,2>{0.0234874859f, 0.046560362f}, std::array<float,2>{0.39578265f, 0.562947989f}, std::array<float,2>{0.722074449f, 0.0954173207f}, std::array<float,2>{0.983543396f, 0.988788188f}, std::array<float,2>{0.200417981f, 0.328267813f}, std::array<float,2>{0.124372728f, 0.752370894f}, std::array<float,2>{0.778427005f, 0.485145837f}, std::array<float,2>{0.621172547f, 0.729100585f}, std::array<float,2>{0.276515156f, 0.207094401f}, std::array<float,2>{0.0328630432f, 0.537727177f}, std::array<float,2>{0.826061249f, 0.016259186f}, std::array<float,2>{0.51560843f, 0.931219935f}, std::array<float,2>{0.319624007f, 0.287671715f}, std::array<float,2>{0.462492406f, 0.841656804f}, std::array<float,2>{0.627448499f, 0.375766337f}, std::array<float,2>{0.930392742f, 0.652182996f}, std::array<float,2>{0.177069664f, 0.149923161f}, std::array<float,2>{0.292078942f, 0.693712652f}, std::array<float,2>{0.584023833f, 0.244358361f}, std::array<float,2>{0.785425067f, 0.804060817f}, std::array<float,2>{0.0810872465f, 0.440962046f}, std::array<float,2>{0.24741362f, 0.957971394f}, std::array<float,2>{0.959851205f, 0.364591777f}, std::array<float,2>{0.6972996f, 0.613391042f}, std::array<float,2>{0.409502089f, 0.0914470404f}, std::array<float,2>{0.0690795481f, 0.745261014f}, std::array<float,2>{0.812388122f, 0.192084581f}, std::array<float,2>{0.566388547f, 0.781112313f}, std::array<float,2>{0.309581727f, 0.481508344f}, std::array<float,2>{0.426409304f, 0.974796712f}, std::array<float,2>{0.705041051f, 0.314248413f}, std::array<float,2>{0.947327077f, 0.583871484f}, std::array<float,2>{0.233774245f, 0.119257212f}, std::array<float,2>{0.342962354f, 0.510753214f}, std::array<float,2>{0.521983027f, 0.0503087044f}, std::array<float,2>{0.829510987f, 0.886914432f}, std::array<float,2>{0.061227534f, 0.276946723f}, std::array<float,2>{0.159827739f, 0.866991818f}, std::array<float,2>{0.918943286f, 0.430767238f}, std::array<float,2>{0.645726323f, 0.68381989f}, std::array<float,2>{0.448548526f, 0.175984934f}, std::array<float,2>{0.205166325f, 0.604285419f}, std::array<float,2>{0.996612608f, 0.0720972717f}, std::array<float,2>{0.74597466f, 0.943814814f}, std::array<float,2>{0.378712565f, 0.346770316f}, std::array<float,2>{0.251552463f, 0.794754863f}, std::array<float,2>{0.595769823f, 0.463639706f}, std::array<float,2>{0.757389426f, 0.714079201f}, std::array<float,2>{0.109337687f, 0.230420828f}, std::array<float,2>{0.469901472f, 0.636612475f}, std::array<float,2>{0.663147449f, 0.131867453f}, std::array<float,2>{0.885744452f, 0.825284362f}, std::array<float,2>{0.143100992f, 0.392400533f}, std::array<float,2>{0.00751985842f, 0.917281091f}, std::array<float,2>{0.863760233f, 0.306099713f}, std::array<float,2>{0.537021995f, 0.550742865f}, std::array<float,2>{0.348870248f, 0.0031897882f}, std::array<float,2>{0.165885329f, 0.733150303f}, std::array<float,2>{0.910839736f, 0.205734238f}, std::array<float,2>{0.649186671f, 0.757251441f}, std::array<float,2>{0.440486699f, 0.489130795f}, std::array<float,2>{0.332416207f, 0.984868526f}, std::array<float,2>{0.52670145f, 0.334958583f}, std::array<float,2>{0.842975438f, 0.568029046f}, std::array<float,2>{0.0526117235f, 0.099613294f}, std::array<float,2>{0.433079511f, 0.519734383f}, std::array<float,2>{0.711937249f, 0.0399080589f}, std::array<float,2>{0.94429934f, 0.899836302f}, std::array<float,2>{0.222925112f, 0.264404178f}, std::array<float,2>{0.0737873763f, 0.856447935f}, std::array<float,2>{0.799156547f, 0.418607235f}, std::array<float,2>{0.573914289f, 0.66453135f}, std::array<float,2>{0.302280217f, 0.161287725f}, std::array<float,2>{0.00990392454f, 0.610182464f}, std::array<float,2>{0.874663711f, 0.0872846916f}, std::array<float,2>{0.540617108f, 0.953318655f}, std::array<float,2>{0.354759514f, 0.361014158f}, std::array<float,2>{0.48433128f, 0.798824251f}, std::array<float,2>{0.669515491f, 0.444167107f}, std::array<float,2>{0.882465184f, 0.689714193f}, std::array<float,2>{0.149696827f, 0.246641189f}, std::array<float,2>{0.258951336f, 0.653281331f}, std::array<float,2>{0.606572866f, 0.154077753f}, std::array<float,2>{0.761975288f, 0.839374304f}, std::array<float,2>{0.0995097235f, 0.381580681f}, std::array<float,2>{0.21424669f, 0.935022175f}, std::array<float,2>{0.989307821f, 0.284059584f}, std::array<float,2>{0.737899423f, 0.53327167f}, std::array<float,2>{0.385591745f, 0.0196873434f}, std::array<float,2>{0.109548055f, 0.682715356f}, std::array<float,2>{0.768579662f, 0.172583804f}, std::array<float,2>{0.610727549f, 0.862383842f}, std::array<float,2>{0.273192018f, 0.433847815f}, std::array<float,2>{0.401975632f, 0.886552095f}, std::array<float,2>{0.731397629f, 0.280186862f}, std::array<float,2>{0.976291955f, 0.514570415f}, std::array<float,2>{0.192462906f, 0.0513128117f}, std::array<float,2>{0.359549642f, 0.581528604f}, std::array<float,2>{0.550331414f, 0.121711247f}, std::array<float,2>{0.846508563f, 0.970501661f}, std::array<float,2>{0.0197992492f, 0.319019824f}, std::array<float,2>{0.125039175f, 0.775337458f}, std::array<float,2>{0.90145129f, 0.476897776f}, std::array<float,2>{0.684154749f, 0.746325731f}, std::array<float,2>{0.495956689f, 0.189807788f}, std::array<float,2>{0.240010515f, 0.55350548f}, std::array<float,2>{0.968577147f, 0.00587971509f}, std::array<float,2>{0.690754831f, 0.91904825f}, std::array<float,2>{0.414580524f, 0.31007269f}, std::array<float,2>{0.282056272f, 0.821411908f}, std::array<float,2>{0.587989926f, 0.397877663f}, std::array<float,2>{0.794670701f, 0.639280856f}, std::array<float,2>{0.0917946547f, 0.12839371f}, std::array<float,2>{0.458920568f, 0.718689442f}, std::array<float,2>{0.634891629f, 0.233449295f}, std::array<float,2>{0.926014185f, 0.790827036f}, std::array<float,2>{0.18482478f, 0.468620032f}, std::array<float,2>{0.0405253395f, 0.93777442f}, std::array<float,2>{0.813942254f, 0.350836873f}, std::array<float,2>{0.505528569f, 0.606280148f}, std::array<float,2>{0.321818829f, 0.076742582f}, std::array<float,2>{0.197244063f, 0.632365465f}, std::array<float,2>{0.978583276f, 0.136831805f}, std::array<float,2>{0.724238217f, 0.814207554f}, std::array<float,2>{0.391946256f, 0.403142869f}, std::array<float,2>{0.277424157f, 0.909606814f}, std::array<float,2>{0.617882788f, 0.298634797f}, std::array<float,2>{0.774823546f, 0.556535304f}, std::array<float,2>{0.119388632f, 0.0151423598f}, std::array<float,2>{0.484979898f, 0.596809208f}, std::array<float,2>{0.679590583f, 0.0698701367f}, std::array<float,2>{0.891156733f, 0.952474833f}, std::array<float,2>{0.135655373f, 0.357151896f}, std::array<float,2>{0.0304352473f, 0.784384549f}, std::array<float,2>{0.853495538f, 0.456396967f}, std::array<float,2>{0.561994195f, 0.705315232f}, std::array<float,2>{0.374465764f, 0.225493938f}, std::array<float,2>{0.0834935233f, 0.500252903f}, std::array<float,2>{0.781749249f, 0.0583132356f}, std::array<float,2>{0.578278661f, 0.875100076f}, std::array<float,2>{0.295454651f, 0.271584511f}, std::array<float,2>{0.413699657f, 0.86925137f}, std::array<float,2>{0.702602148f, 0.42903778f}, std::array<float,2>{0.956951618f, 0.67243892f}, std::array<float,2>{0.243710488f, 0.182929844f}, std::array<float,2>{0.314965725f, 0.738465548f}, std::array<float,2>{0.510311604f, 0.202429846f}, std::array<float,2>{0.822926521f, 0.767437994f}, std::array<float,2>{0.038381882f, 0.469863772f}, std::array<float,2>{0.17559512f, 0.984100819f}, std::array<float,2>{0.933646142f, 0.320594013f}, std::array<float,2>{0.629755735f, 0.593690693f}, std::array<float,2>{0.467431664f, 0.110965155f}, std::array<float,2>{0.0550580733f, 0.697856069f}, std::array<float,2>{0.83498162f, 0.237211928f}, std::array<float,2>{0.517966747f, 0.809853256f}, std::array<float,2>{0.337221205f, 0.446517825f}, std::array<float,2>{0.449676663f, 0.965116143f}, std::array<float,2>{0.642009735f, 0.371116072f}, std::array<float,2>{0.916870594f, 0.623126864f}, std::array<float,2>{0.163601726f, 0.0845309421f}, std::array<float,2>{0.305915296f, 0.540190637f}, std::array<float,2>{0.56988138f, 0.0288863089f}, std::array<float,2>{0.808353603f, 0.926002145f}, std::array<float,2>{0.0635433942f, 0.295916051f}, std::array<float,2>{0.229236796f, 0.830727339f}, std::array<float,2>{0.952381551f, 0.388182789f}, std::array<float,2>{0.709140241f, 0.647895992f}, std::array<float,2>{0.423606306f, 0.14651376f}, std::array<float,2>{0.147376493f, 0.574457288f}, std::array<float,2>{0.887453735f, 0.109323055f}, std::array<float,2>{0.659804165f, 0.992342591f}, std::array<float,2>{0.475482404f, 0.340218246f}, std::array<float,2>{0.345720172f, 0.759296775f}, std::array<float,2>{0.534020543f, 0.4936966f}, std::array<float,2>{0.862083137f, 0.721857786f}, std::array<float,2>{0.000904056069f, 0.213851318f}, std::array<float,2>{0.379898965f, 0.660682559f}, std::array<float,2>{0.749573708f, 0.166855022f}, std::array<float,2>{0.992955565f, 0.845772147f}, std::array<float,2>{0.209072426f, 0.411217481f}, std::array<float,2>{0.101750769f, 0.897264659f}, std::array<float,2>{0.75274694f, 0.253384084f}, std::array<float,2>{0.598584056f, 0.529634655f}, std::array<float,2>{0.255748451f, 0.0347415544f}, std::array<float,2>{0.215761185f, 0.737296879f}, std::array<float,2>{0.984866738f, 0.197252393f}, std::array<float,2>{0.739475846f, 0.770822048f}, std::array<float,2>{0.38769564f, 0.47431916f}, std::array<float,2>{0.263534844f, 0.979629397f}, std::array<float,2>{0.603638172f, 0.3271074f}, std::array<float,2>{0.758756578f, 0.586316228f}, std::array<float,2>{0.0943036079f, 0.114902966f}, std::array<float,2>{0.476942509f, 0.507474363f}, std::array<float,2>{0.667553186f, 0.060386084f}, std::array<float,2>{0.878454685f, 0.880078197f}, std::array<float,2>{0.155231103f, 0.265701532f}, std::array<float,2>{0.0121667804f, 0.872393072f}, std::array<float,2>{0.868228137f, 0.422592998f}, std::array<float,2>{0.54525727f, 0.676958382f}, std::array<float,2>{0.35769555f, 0.183777526f}, std::array<float,2>{0.0748607293f, 0.598772228f}, std::array<float,2>{0.80259788f, 0.0654901043f}, std::array<float,2>{0.577728331f, 0.948887169f}, std::array<float,2>{0.297822237f, 0.353348136f}, std::array<float,2>{0.434680611f, 0.787476838f}, std::array<float,2>{0.715680122f, 0.46037519f}, std::array<float,2>{0.939025223f, 0.710128546f}, std::array<float,2>{0.222276196f, 0.221640065f}, std::array<float,2>{0.329970509f, 0.625134826f}, std::array<float,2>{0.528900802f, 0.133380845f}, std::array<float,2>{0.83749938f, 0.817725778f}, std::array<float,2>{0.0481211059f, 0.401774257f}, std::array<float,2>{0.171018466f, 0.910410523f}, std::array<float,2>{0.907317817f, 0.304492325f}, std::array<float,2>{0.655540168f, 0.559478581f}, std::array<float,2>{0.443800598f, 0.00946646929f}, std::array<float,2>{0.0438701883f, 0.657843053f}, std::array<float,2>{0.816990852f, 0.17088154f}, std::array<float,2>{0.500924706f, 0.849532604f}, std::array<float,2>{0.32743004f, 0.408045083f}, std::array<float,2>{0.453691274f, 0.892039776f}, std::array<float,2>{0.637348592f, 0.254975528f}, std::array<float,2>{0.925737679f, 0.523647189f}, std::array<float,2>{0.182202876f, 0.0357211456f}, std::array<float,2>{0.286476225f, 0.573790669f}, std::array<float,2>{0.592837393f, 0.104837961f}, std::array<float,2>{0.791630745f, 0.997847378f}, std::array<float,2>{0.0864820033f, 0.337201923f}, std::array<float,2>{0.238142073f, 0.764502943f}, std::array<float,2>{0.961115062f, 0.498002112f}, std::array<float,2>{0.693575203f, 0.724694848f}, std::array<float,2>{0.420550853f, 0.217577174f}, std::array<float,2>{0.12933135f, 0.545500457f}, std::array<float,2>{0.903649986f, 0.0244403239f}, std::array<float,2>{0.683111846f, 0.922345042f}, std::array<float,2>{0.49698624f, 0.291723132f}, std::array<float,2>{0.363558918f, 0.832647264f}, std::array<float,2>{0.551556587f, 0.386686742f}, std::array<float,2>{0.849805951f, 0.643436491f}, std::array<float,2>{0.0180323999f, 0.143467277f}, std::array<float,2>{0.403955162f, 0.702384472f}, std::array<float,2>{0.728331208f, 0.24137798f}, std::array<float,2>{0.968946517f, 0.805817902f}, std::array<float,2>{0.18996729f, 0.452788651f}, std::array<float,2>{0.116436005f, 0.962592602f}, std::array<float,2>{0.772812784f, 0.367319942f}, std::array<float,2>{0.614581645f, 0.618942559f}, std::array<float,2>{0.269516557f, 0.0789044797f}, std::array<float,2>{0.178871349f, 0.648795903f}, std::array<float,2>{0.933261395f, 0.151767567f}, std::array<float,2>{0.625739336f, 0.841811001f}, std::array<float,2>{0.463270217f, 0.378862798f}, std::array<float,2>{0.318250656f, 0.932757795f}, std::array<float,2>{0.513619423f, 0.285290837f}, std::array<float,2>{0.827920914f, 0.536002517f}, std::array<float,2>{0.0346669108f, 0.0183957573f}, std::array<float,2>{0.407845229f, 0.61709702f}, std::array<float,2>{0.695437133f, 0.093735829f}, std::array<float,2>{0.958423615f, 0.960364759f}, std::array<float,2>{0.249836162f, 0.366490185f}, std::array<float,2>{0.0795654804f, 0.80191499f}, std::array<float,2>{0.787141681f, 0.438447356f}, std::array<float,2>{0.583603799f, 0.693125725f}, std::array<float,2>{0.290272027f, 0.243900433f}, std::array<float,2>{0.0259991363f, 0.516674459f}, std::array<float,2>{0.856292248f, 0.0430014431f}, std::array<float,2>{0.557615697f, 0.903048694f}, std::array<float,2>{0.368947178f, 0.25947392f}, std::array<float,2>{0.490802914f, 0.854980528f}, std::array<float,2>{0.674236357f, 0.41793111f}, std::array<float,2>{0.895932078f, 0.671520293f}, std::array<float,2>{0.137513503f, 0.156927347f}, std::array<float,2>{0.275372803f, 0.726821184f}, std::array<float,2>{0.623949409f, 0.210307747f}, std::array<float,2>{0.780780792f, 0.751107395f}, std::array<float,2>{0.122144416f, 0.486619532f}, std::array<float,2>{0.201469526f, 0.990448475f}, std::array<float,2>{0.981115878f, 0.331824601f}, std::array<float,2>{0.72056073f, 0.565950394f}, std::array<float,2>{0.39792797f, 0.0972924754f}, std::array<float,2>{0.105480492f, 0.711899221f}, std::array<float,2>{0.754583895f, 0.227955148f}, std::array<float,2>{0.595107675f, 0.795680285f}, std::array<float,2>{0.252551407f, 0.462344497f}, std::array<float,2>{0.376534253f, 0.943112016f}, std::array<float,2>{0.743771911f, 0.344979227f}, std::array<float,2>{0.998642385f, 0.602601707f}, std::array<float,2>{0.204231545f, 0.0737321675f}, std::array<float,2>{0.350390434f, 0.54746002f}, std::array<float,2>{0.537682176f, 0.00106566271f}, std::array<float,2>{0.865893841f, 0.914761364f}, std::array<float,2>{0.00441390695f, 0.30692634f}, std::array<float,2>{0.141303867f, 0.826710582f}, std::array<float,2>{0.883069515f, 0.393684536f}, std::array<float,2>{0.661308527f, 0.634512484f}, std::array<float,2>{0.472400993f, 0.128907159f}, std::array<float,2>{0.230558991f, 0.585082412f}, std::array<float,2>{0.946767449f, 0.118303128f}, std::array<float,2>{0.706730127f, 0.973801196f}, std::array<float,2>{0.429059505f, 0.314656943f}, std::array<float,2>{0.312056899f, 0.777878821f}, std::array<float,2>{0.564254284f, 0.483513683f}, std::array<float,2>{0.808976293f, 0.742904305f}, std::array<float,2>{0.0670873299f, 0.195073411f}, std::array<float,2>{0.446989477f, 0.687406063f}, std::array<float,2>{0.647221386f, 0.179290891f}, std::array<float,2>{0.920242608f, 0.864988744f}, std::array<float,2>{0.157560349f, 0.432711124f}, std::array<float,2>{0.0595927536f, 0.889676332f}, std::array<float,2>{0.831724524f, 0.274862647f}, std::array<float,2>{0.521439075f, 0.509700656f}, std::array<float,2>{0.340622872f, 0.0486166067f}, std::array<float,2>{0.151426211f, 0.687924564f}, std::array<float,2>{0.880744517f, 0.24949421f}, std::array<float,2>{0.670632541f, 0.799648225f}, std::array<float,2>{0.481065512f, 0.44189167f}, std::array<float,2>{0.352278113f, 0.956360817f}, std::array<float,2>{0.54144311f, 0.361605197f}, std::array<float,2>{0.871763885f, 0.612361133f}, std::array<float,2>{0.00848639943f, 0.0892132595f}, std::array<float,2>{0.384133995f, 0.531608403f}, std::array<float,2>{0.73588872f, 0.0234228875f}, std::array<float,2>{0.990836442f, 0.936263859f}, std::array<float,2>{0.211815804f, 0.282799602f}, std::array<float,2>{0.101108357f, 0.836620629f}, std::array<float,2>{0.764243603f, 0.37956515f}, std::array<float,2>{0.607533693f, 0.656189024f}, std::array<float,2>{0.260087729f, 0.155270576f}, std::array<float,2>{0.0527875759f, 0.569023609f}, std::array<float,2>{0.84150672f, 0.0988055989f}, std::array<float,2>{0.524271548f, 0.987881422f}, std::array<float,2>{0.334202498f, 0.332900822f}, std::array<float,2>{0.439195871f, 0.75537324f}, std::array<float,2>{0.651792347f, 0.491443634f}, std::array<float,2>{0.913554728f, 0.731616139f}, std::array<float,2>{0.167107418f, 0.204283386f}, std::array<float,2>{0.303735852f, 0.667785466f}, std::array<float,2>{0.571253061f, 0.163899526f}, std::array<float,2>{0.798728943f, 0.857451677f}, std::array<float,2>{0.0708400756f, 0.420767486f}, std::array<float,2>{0.225742847f, 0.901287615f}, std::array<float,2>{0.942074358f, 0.26219362f}, std::array<float,2>{0.713416398f, 0.52259165f}, std::array<float,2>{0.431584477f, 0.0418021232f}, std::array<float,2>{0.0937464312f, 0.636972487f}, std::array<float,2>{0.796037793f, 0.126753017f}, std::array<float,2>{0.586484551f, 0.824052274f}, std::array<float,2>{0.284762859f, 0.396037042f}, std::array<float,2>{0.416179836f, 0.921667278f}, std::array<float,2>{0.689299166f, 0.310651213f}, std::array<float,2>{0.966587305f, 0.551333725f}, std::array<float,2>{0.242032886f, 0.00457293447f}, std::array<float,2>{0.322440594f, 0.608469129f}, std::array<float,2>{0.506578803f, 0.0746225417f}, std::array<float,2>{0.815459847f, 0.939799845f}, std::array<float,2>{0.0412731431f, 0.348132759f}, std::array<float,2>{0.186950207f, 0.791709423f}, std::array<float,2>{0.929566026f, 0.465222687f}, std::array<float,2>{0.634191275f, 0.715829134f}, std::array<float,2>{0.45983991f, 0.231423348f}, std::array<float,2>{0.194136947f, 0.512313843f}, std::array<float,2>{0.972963393f, 0.0528749935f}, std::array<float,2>{0.732731879f, 0.883143365f}, std::array<float,2>{0.399185061f, 0.279083043f}, std::array<float,2>{0.269661516f, 0.861095965f}, std::array<float,2>{0.611863554f, 0.435725898f}, std::array<float,2>{0.767162859f, 0.680914223f}, std::array<float,2>{0.112662248f, 0.174324483f}, std::array<float,2>{0.494069338f, 0.74891752f}, std::array<float,2>{0.686156571f, 0.188989148f}, std::array<float,2>{0.899727464f, 0.775776088f}, std::array<float,2>{0.128476724f, 0.479418218f}, std::array<float,2>{0.0221067443f, 0.970802844f}, std::array<float,2>{0.845198274f, 0.317125052f}, std::array<float,2>{0.548816323f, 0.579349756f}, std::array<float,2>{0.362989187f, 0.124398865f}, std::array<float,2>{0.245031267f, 0.673943818f}, std::array<float,2>{0.953973651f, 0.18008405f}, std::array<float,2>{0.701090753f, 0.86738199f}, std::array<float,2>{0.411433965f, 0.426932275f}, std::array<float,2>{0.293915987f, 0.878090262f}, std::array<float,2>{0.581701398f, 0.26965037f}, std::array<float,2>{0.784522653f, 0.502594352f}, std::array<float,2>{0.0844039395f, 0.0555751212f}, std::array<float,2>{0.466144115f, 0.590608597f}, std::array<float,2>{0.632360876f, 0.111539833f}, std::array<float,2>{0.936322927f, 0.981519818f}, std::array<float,2>{0.172493875f, 0.323403984f}, std::array<float,2>{0.036733821f, 0.768124819f}, std::array<float,2>{0.820991337f, 0.47237134f}, std::array<float,2>{0.509733677f, 0.741922855f}, std::array<float,2>{0.314299464f, 0.199514031f}, std::array<float,2>{0.118590824f, 0.5574525f}, std::array<float,2>{0.775869071f, 0.0126315933f}, std::array<float,2>{0.619313836f, 0.906910181f}, std::array<float,2>{0.280242711f, 0.299417287f}, std::array<float,2>{0.393532991f, 0.814910352f}, std::array<float,2>{0.725749135f, 0.405236006f}, std::array<float,2>{0.977360249f, 0.630846679f}, std::array<float,2>{0.197455615f, 0.138747096f}, std::array<float,2>{0.371883601f, 0.705049336f}, std::array<float,2>{0.559687853f, 0.223088264f}, std::array<float,2>{0.855041087f, 0.781905055f}, std::array<float,2>{0.0289167333f, 0.454675466f}, std::array<float,2>{0.132873148f, 0.949517727f}, std::array<float,2>{0.893293262f, 0.357777804f}, std::array<float,2>{0.676347136f, 0.594599128f}, std::array<float,2>{0.487411678f, 0.0677877963f}, std::array<float,2>{0.00256581954f, 0.72045207f}, std::array<float,2>{0.860966802f, 0.211368427f}, std::array<float,2>{0.531745315f, 0.761472523f}, std::array<float,2>{0.344414979f, 0.495437801f}, std::array<float,2>{0.473625988f, 0.994504631f}, std::array<float,2>{0.657020986f, 0.342408866f}, std::array<float,2>{0.888826072f, 0.5761922f}, std::array<float,2>{0.144692212f, 0.105507992f}, std::array<float,2>{0.257729173f, 0.528417289f}, std::array<float,2>{0.601545572f, 0.0330738276f}, std::array<float,2>{0.75076139f, 0.895328701f}, std::array<float,2>{0.105105683f, 0.250198871f}, std::array<float,2>{0.207568899f, 0.843812883f}, std::array<float,2>{0.995800436f, 0.413434356f}, std::array<float,2>{0.747313559f, 0.663492739f}, std::array<float,2>{0.381066829f, 0.165824413f}, std::array<float,2>{0.161715969f, 0.621950209f}, std::array<float,2>{0.915290534f, 0.0824448913f}, std::array<float,2>{0.643220127f, 0.968618989f}, std::array<float,2>{0.451522857f, 0.373201877f}, std::array<float,2>{0.338279277f, 0.811885655f}, std::array<float,2>{0.516608238f, 0.44879204f}, std::array<float,2>{0.832205892f, 0.69654119f}, std::array<float,2>{0.0567609258f, 0.235025913f}, std::array<float,2>{0.425023526f, 0.644759595f}, std::array<float,2>{0.707432449f, 0.14641583f}, std::array<float,2>{0.950293243f, 0.828633785f}, std::array<float,2>{0.226769656f, 0.389203131f}, std::array<float,2>{0.0652003735f, 0.929335237f}, std::array<float,2>{0.806241512f, 0.294549763f}, std::array<float,2>{0.567700922f, 0.54212743f}, std::array<float,2>{0.307605267f, 0.0304042418f}, std::array<float,2>{0.190580159f, 0.700047672f}, std::array<float,2>{0.970302939f, 0.239751294f}, std::array<float,2>{0.726667285f, 0.807020962f}, std::array<float,2>{0.402798772f, 0.449957639f}, std::array<float,2>{0.268468022f, 0.963622332f}, std::array<float,2>{0.613323987f, 0.369653881f}, std::array<float,2>{0.771911323f, 0.619790196f}, std::array<float,2>{0.116023354f, 0.0801600441f}, std::array<float,2>{0.497214615f, 0.543210506f}, std::array<float,2>{0.681774318f, 0.027047608f}, std::array<float,2>{0.902427852f, 0.925058484f}, std::array<float,2>{0.130201787f, 0.290366799f}, std::array<float,2>{0.0187073387f, 0.834556103f}, std::array<float,2>{0.850822449f, 0.383082658f}, std::array<float,2>{0.552684486f, 0.641582668f}, std::array<float,2>{0.364639908f, 0.142552599f}, std::array<float,2>{0.0875363648f, 0.571289778f}, std::array<float,2>{0.79259938f, 0.10162016f}, std::array<float,2>{0.592154384f, 0.998220682f}, std::array<float,2>{0.285226762f, 0.339703888f}, std::array<float,2>{0.421848446f, 0.763608515f}, std::array<float,2>{0.695039392f, 0.498373836f}, std::array<float,2>{0.962210476f, 0.72342068f}, std::array<float,2>{0.236613035f, 0.216416553f}, std::array<float,2>{0.32712549f, 0.658581853f}, std::array<float,2>{0.501568019f, 0.168346301f}, std::array<float,2>{0.817597508f, 0.850233912f}, std::array<float,2>{0.0448192134f, 0.410060138f}, std::array<float,2>{0.182694301f, 0.892788768f}, std::array<float,2>{0.924168944f, 0.256124705f}, std::array<float,2>{0.637738705f, 0.526940763f}, std::array<float,2>{0.454358757f, 0.0375974514f}, std::array<float,2>{0.0473921783f, 0.628363252f}, std::array<float,2>{0.836614311f, 0.134774625f}, std::array<float,2>{0.527415216f, 0.818621516f}, std::array<float,2>{0.328306854f, 0.400204122f}, std::array<float,2>{0.445170969f, 0.913916707f}, std::array<float,2>{0.654868722f, 0.302314579f}, std::array<float,2>{0.907079399f, 0.561535597f}, std::array<float,2>{0.170734808f, 0.0113632474f}, std::array<float,2>{0.297909439f, 0.600951791f}, std::array<float,2>{0.577086031f, 0.0631809458f}, std::array<float,2>{0.80164212f, 0.946143329f}, std::array<float,2>{0.0755848959f, 0.355080158f}, std::array<float,2>{0.22077395f, 0.786552072f}, std::array<float,2>{0.937862337f, 0.458704025f}, std::array<float,2>{0.716673553f, 0.708823383f}, std::array<float,2>{0.433945388f, 0.220424205f}, std::array<float,2>{0.155884981f, 0.50447917f}, std::array<float,2>{0.877157867f, 0.0610066913f}, std::array<float,2>{0.666050136f, 0.882810771f}, std::array<float,2>{0.477782786f, 0.268903583f}, std::array<float,2>{0.359330773f, 0.874182582f}, std::array<float,2>{0.546490192f, 0.423986197f}, std::array<float,2>{0.868119895f, 0.678846419f}, std::array<float,2>{0.0131312488f, 0.18747595f}, std::array<float,2>{0.387385905f, 0.735540271f}, std::array<float,2>{0.738514006f, 0.19756785f}, std::array<float,2>{0.985769808f, 0.772579551f}, std::array<float,2>{0.216587603f, 0.476437449f}, std::array<float,2>{0.0952084437f, 0.977078855f}, std::array<float,2>{0.759009242f, 0.324407756f}, std::array<float,2>{0.604861557f, 0.5880633f}, std::array<float,2>{0.261990041f, 0.115429133f}, std::array<float,2>{0.156879216f, 0.685519755f}, std::array<float,2>{0.921724558f, 0.177498177f}, std::array<float,2>{0.647703707f, 0.865398705f}, std::array<float,2>{0.44617933f, 0.429983437f}, std::array<float,2>{0.341250449f, 0.888173699f}, std::array<float,2>{0.519650698f, 0.275837332f}, std::array<float,2>{0.831005752f, 0.510337234f}, std::array<float,2>{0.0591836721f, 0.0495621413f}, std::array<float,2>{0.428317457f, 0.582302213f}, std::array<float,2>{0.705679297f, 0.120920487f}, std::array<float,2>{0.94573307f, 0.975698531f}, std::array<float,2>{0.232279316f, 0.312711269f}, std::array<float,2>{0.0675631836f, 0.779469728f}, std::array<float,2>{0.80960685f, 0.481348813f}, std::array<float,2>{0.563416421f, 0.745080709f}, std::array<float,2>{0.311112195f, 0.192943797f}, std::array<float,2>{0.00530493073f, 0.549799383f}, std::array<float,2>{0.866641402f, 0.00266600051f}, std::array<float,2>{0.538250744f, 0.916699767f}, std::array<float,2>{0.350882649f, 0.305568665f}, std::array<float,2>{0.47134465f, 0.824508071f}, std::array<float,2>{0.660182416f, 0.390878946f}, std::array<float,2>{0.884209454f, 0.63539207f}, std::array<float,2>{0.14240104f, 0.131233439f}, std::array<float,2>{0.253724426f, 0.713213086f}, std::array<float,2>{0.594092607f, 0.228971168f}, std::array<float,2>{0.755548358f, 0.793044508f}, std::array<float,2>{0.107282557f, 0.463923395f}, std::array<float,2>{0.203506947f, 0.945158303f}, std::array<float,2>{0.999589443f, 0.346012831f}, std::array<float,2>{0.74289f, 0.604684472f}, std::array<float,2>{0.375338137f, 0.0709837973f}, std::array<float,2>{0.1210967f, 0.730205536f}, std::array<float,2>{0.780010641f, 0.208908349f}, std::array<float,2>{0.624225795f, 0.75327915f}, std::array<float,2>{0.274413288f, 0.486128986f}, std::array<float,2>{0.396959394f, 0.98961848f}, std::array<float,2>{0.71923852f, 0.329996496f}, std::array<float,2>{0.982385755f, 0.563982546f}, std::array<float,2>{0.202892244f, 0.0938229859f}, std::array<float,2>{0.36776036f, 0.51813972f}, std::array<float,2>{0.558047056f, 0.0454246663f}, std::array<float,2>{0.857409894f, 0.906221151f}, std::array<float,2>{0.0267262477f, 0.261325955f}, std::array<float,2>{0.138078332f, 0.852823198f}, std::array<float,2>{0.895478725f, 0.415564448f}, std::array<float,2>{0.675506294f, 0.668425322f}, std::array<float,2>{0.491300225f, 0.159464583f}, std::array<float,2>{0.248557895f, 0.61512053f}, std::array<float,2>{0.957177162f, 0.0900199562f}, std::array<float,2>{0.696854353f, 0.958450258f}, std::array<float,2>{0.406987011f, 0.363855243f}, std::array<float,2>{0.289486408f, 0.802760541f}, std::array<float,2>{0.582586765f, 0.440112561f}, std::array<float,2>{0.788870156f, 0.69435221f}, std::array<float,2>{0.0786080733f, 0.245661572f}, std::array<float,2>{0.464284867f, 0.650516689f}, std::array<float,2>{0.626482189f, 0.148882717f}, std::array<float,2>{0.932442427f, 0.840193748f}, std::array<float,2>{0.178645149f, 0.376836836f}, std::array<float,2>{0.0337538682f, 0.93039906f}, std::array<float,2>{0.826357722f, 0.288152397f}, std::array<float,2>{0.512663364f, 0.539000094f}, std::array<float,2>{0.317096531f, 0.0172174871f}, std::array<float,2>{0.127768964f, 0.747599304f}, std::array<float,2>{0.898749471f, 0.190652117f}, std::array<float,2>{0.687363565f, 0.773694217f}, std::array<float,2>{0.492814541f, 0.477757007f}, std::array<float,2>{0.36183241f, 0.969335318f}, std::array<float,2>{0.547197878f, 0.319851488f}, std::array<float,2>{0.844423771f, 0.580146432f}, std::array<float,2>{0.0225908551f, 0.122664005f}, std::array<float,2>{0.400197238f, 0.515070796f}, std::array<float,2>{0.733493447f, 0.0527051836f}, std::array<float,2>{0.974280834f, 0.885213017f}, std::array<float,2>{0.194791645f, 0.280522764f}, std::array<float,2>{0.112134814f, 0.861664772f}, std::array<float,2>{0.765723646f, 0.435429305f}, std::array<float,2>{0.61258316f, 0.682404459f}, std::array<float,2>{0.271181703f, 0.173663497f}, std::array<float,2>{0.0422810018f, 0.60711062f}, std::array<float,2>{0.814811289f, 0.0773067474f}, std::array<float,2>{0.50773567f, 0.938803315f}, std::array<float,2>{0.323646486f, 0.350439787f}, std::array<float,2>{0.460267901f, 0.78993082f}, std::array<float,2>{0.632922828f, 0.467390835f}, std::array<float,2>{0.927922428f, 0.717092335f}, std::array<float,2>{0.186368495f, 0.232485548f}, std::array<float,2>{0.283616573f, 0.639951766f}, std::array<float,2>{0.587302923f, 0.127491236f}, std::array<float,2>{0.795811892f, 0.821045458f}, std::array<float,2>{0.0927291885f, 0.396532804f}, std::array<float,2>{0.240559518f, 0.918841541f}, std::array<float,2>{0.965384781f, 0.3089706f}, std::array<float,2>{0.688138843f, 0.554288685f}, std::array<float,2>{0.417847544f, 0.00739444839f}, std::array<float,2>{0.0716739744f, 0.665548086f}, std::array<float,2>{0.797374129f, 0.160168603f}, std::array<float,2>{0.572101653f, 0.855547488f}, std::array<float,2>{0.303671688f, 0.419176221f}, std::array<float,2>{0.430137843f, 0.899079561f}, std::array<float,2>{0.714615285f, 0.265286207f}, std::array<float,2>{0.942483783f, 0.521480501f}, std::array<float,2>{0.225076109f, 0.0404130742f}, std::array<float,2>{0.334997326f, 0.566795707f}, std::array<float,2>{0.5247401f, 0.101144411f}, std::array<float,2>{0.840433776f, 0.985522747f}, std::array<float,2>{0.0542593822f, 0.335129619f}, std::array<float,2>{0.166687623f, 0.756471038f}, std::array<float,2>{0.912340581f, 0.489604771f}, std::array<float,2>{0.651253998f, 0.733571529f}, std::array<float,2>{0.437624007f, 0.206306458f}, std::array<float,2>{0.212635696f, 0.534490645f}, std::array<float,2>{0.991393983f, 0.0205918271f}, std::array<float,2>{0.734450102f, 0.933936357f}, std::array<float,2>{0.383269131f, 0.28470844f}, std::array<float,2>{0.261556327f, 0.838310361f}, std::array<float,2>{0.608418226f, 0.381858259f}, std::array<float,2>{0.764666915f, 0.653761506f}, std::array<float,2>{0.0999171957f, 0.153210774f}, std::array<float,2>{0.481950372f, 0.690689027f}, std::array<float,2>{0.671408892f, 0.247159481f}, std::array<float,2>{0.87903595f, 0.797051907f}, std::array<float,2>{0.151353225f, 0.44466418f}, std::array<float,2>{0.0091867689f, 0.954652071f}, std::array<float,2>{0.87231189f, 0.359532595f}, std::array<float,2>{0.542274773f, 0.611065209f}, std::array<float,2>{0.353104651f, 0.0862869322f}, std::array<float,2>{0.227747828f, 0.647309601f}, std::array<float,2>{0.949600577f, 0.14805676f}, std::array<float,2>{0.708525062f, 0.831501245f}, std::array<float,2>{0.424355447f, 0.387521923f}, std::array<float,2>{0.308394402f, 0.927261293f}, std::array<float,2>{0.567192316f, 0.295156956f}, std::array<float,2>{0.804873824f, 0.539267838f}, std::array<float,2>{0.065538533f, 0.028000772f}, std::array<float,2>{0.453123003f, 0.624377728f}, std::array<float,2>{0.644490361f, 0.0856493488f}, std::array<float,2>{0.914557576f, 0.966339529f}, std::array<float,2>{0.16040045f, 0.372975051f}, std::array<float,2>{0.0580480322f, 0.80872792f}, std::array<float,2>{0.83322823f, 0.445700467f}, std::array<float,2>{0.516055584f, 0.698769152f}, std::array<float,2>{0.339167118f, 0.238157436f}, std::array<float,2>{0.104025885f, 0.530345142f}, std::array<float,2>{0.751623333f, 0.0335250348f}, std::array<float,2>{0.600390196f, 0.898035944f}, std::array<float,2>{0.255980164f, 0.252867281f}, std::array<float,2>{0.382626981f, 0.847362936f}, std::array<float,2>{0.746460617f, 0.41087693f}, std::array<float,2>{0.994351447f, 0.66120106f}, std::array<float,2>{0.208562747f, 0.167300969f}, std::array<float,2>{0.344882429f, 0.720855534f}, std::array<float,2>{0.532488644f, 0.214200199f}, std::array<float,2>{0.859905243f, 0.758669734f}, std::array<float,2>{0.00332827936f, 0.492862523f}, std::array<float,2>{0.146007627f, 0.993337154f}, std::array<float,2>{0.889780343f, 0.341458142f}, std::array<float,2>{0.657715321f, 0.575850487f}, std::array<float,2>{0.474109083f, 0.107902601f}, std::array<float,2>{0.0282645673f, 0.706910491f}, std::array<float,2>{0.854019403f, 0.225902304f}, std::array<float,2>{0.558734953f, 0.783300757f}, std::array<float,2>{0.372989863f, 0.455080509f}, std::array<float,2>{0.486537635f, 0.951546252f}, std::array<float,2>{0.677619338f, 0.356291264f}, std::array<float,2>{0.894219339f, 0.596040845f}, std::array<float,2>{0.134073496f, 0.0687133446f}, std::array<float,2>{0.280560404f, 0.554965913f}, std::array<float,2>{0.620823205f, 0.0136893997f}, std::array<float,2>{0.777084589f, 0.909145594f}, std::array<float,2>{0.11744304f, 0.296990037f}, std::array<float,2>{0.198894069f, 0.812987566f}, std::array<float,2>{0.978420317f, 0.403550506f}, std::array<float,2>{0.725544631f, 0.631096661f}, std::array<float,2>{0.394311339f, 0.137843803f}, std::array<float,2>{0.173778892f, 0.591945589f}, std::array<float,2>{0.936736405f, 0.110162817f}, std::array<float,2>{0.631331623f, 0.982838035f}, std::array<float,2>{0.465758592f, 0.32163769f}, std::array<float,2>{0.312956423f, 0.766284704f}, std::array<float,2>{0.507915676f, 0.469652623f}, std::array<float,2>{0.822019935f, 0.739503145f}, std::array<float,2>{0.0354373604f, 0.202146783f}, std::array<float,2>{0.411066234f, 0.672951698f}, std::array<float,2>{0.699332356f, 0.181777731f}, std::array<float,2>{0.954729974f, 0.870900512f}, std::array<float,2>{0.246017441f, 0.428154171f}, std::array<float,2>{0.0858858675f, 0.876808345f}, std::array<float,2>{0.783632576f, 0.273409665f}, std::array<float,2>{0.580958307f, 0.501941442f}, std::array<float,2>{0.294065505f, 0.0570494831f}, std::array<float,2>{0.235895425f, 0.726432025f}, std::array<float,2>{0.962949157f, 0.218057215f}, std::array<float,2>{0.692609727f, 0.764886379f}, std::array<float,2>{0.418981344f, 0.496420503f}, std::array<float,2>{0.287193209f, 0.996341109f}, std::array<float,2>{0.591448009f, 0.336553156f}, std::array<float,2>{0.790542543f, 0.572504163f}, std::array<float,2>{0.0896082297f, 0.1040892f}, std::array<float,2>{0.456248075f, 0.524804235f}, std::array<float,2>{0.639709592f, 0.0364625268f}, std::array<float,2>{0.92202425f, 0.89141798f}, std::array<float,2>{0.180210158f, 0.254278809f}, std::array<float,2>{0.0455685109f, 0.84823823f}, std::array<float,2>{0.8188622f, 0.406403124f}, std::array<float,2>{0.502275646f, 0.656476259f}, std::array<float,2>{0.326122642f, 0.171704322f}, std::array<float,2>{0.114777468f, 0.617827475f}, std::array<float,2>{0.771228731f, 0.0799713433f}, std::array<float,2>{0.615645468f, 0.961018026f}, std::array<float,2>{0.267568111f, 0.368908823f}, std::array<float,2>{0.404444307f, 0.804750383f}, std::array<float,2>{0.729027987f, 0.451658607f}, std::array<float,2>{0.972167492f, 0.701939881f}, std::array<float,2>{0.187968865f, 0.240668029f}, std::array<float,2>{0.365721464f, 0.644026458f}, std::array<float,2>{0.553044379f, 0.144475549f}, std::array<float,2>{0.849215567f, 0.833780825f}, std::array<float,2>{0.0162805319f, 0.385311991f}, std::array<float,2>{0.132252425f, 0.923253119f}, std::array<float,2>{0.905557096f, 0.292247951f}, std::array<float,2>{0.680945516f, 0.546588063f}, std::array<float,2>{0.498066306f, 0.0236819498f}, std::array<float,2>{0.0153587479f, 0.67651546f}, std::array<float,2>{0.86961174f, 0.185308024f}, std::array<float,2>{0.543720961f, 0.87180692f}, std::array<float,2>{0.357337922f, 0.423006117f}, std::array<float,2>{0.478964895f, 0.879811823f}, std::array<float,2>{0.664740384f, 0.266699284f}, std::array<float,2>{0.875247121f, 0.506797612f}, std::array<float,2>{0.152932823f, 0.0592989586f}, std::array<float,2>{0.265553802f, 0.587111413f}, std::array<float,2>{0.602190614f, 0.114178315f}, std::array<float,2>{0.760434866f, 0.978854358f}, std::array<float,2>{0.096989885f, 0.327949315f}, std::array<float,2>{0.217834949f, 0.769730866f}, std::array<float,2>{0.986862361f, 0.47361511f}, std::array<float,2>{0.74053365f, 0.737862945f}, std::array<float,2>{0.388724566f, 0.195546225f}, std::array<float,2>{0.169597253f, 0.559742987f}, std::array<float,2>{0.909130931f, 0.0085621085f}, std::array<float,2>{0.653802395f, 0.912015915f}, std::array<float,2>{0.442783982f, 0.303065121f}, std::array<float,2>{0.331094205f, 0.817362189f}, std::array<float,2>{0.529378593f, 0.400618076f}, std::array<float,2>{0.839108586f, 0.626271725f}, std::array<float,2>{0.0507397763f, 0.134117976f}, std::array<float,2>{0.436939716f, 0.709730983f}, std::array<float,2>{0.717847049f, 0.221848741f}, std::array<float,2>{0.939969361f, 0.78850919f}, std::array<float,2>{0.218794286f, 0.45911029f}, std::array<float,2>{0.0765392482f, 0.947992623f}, std::array<float,2>{0.804677188f, 0.35205552f}, std::array<float,2>{0.57447499f, 0.598065078f}, std::array<float,2>{0.299691975f, 0.0652908906f}, std::array<float,2>{0.143624082f, 0.633475363f}, std::array<float,2>{0.885139227f, 0.129912242f}, std::array<float,2>{0.662998617f, 0.82787168f}, std::array<float,2>{0.468961388f, 0.393000156f}, std::array<float,2>{0.348157853f, 0.915073335f}, std::array<float,2>{0.535706699f, 0.307706922f}, std::array<float,2>{0.864794374f, 0.547950387f}, std::array<float,2>{0.00636618864f, 0.000542969618f}, std::array<float,2>{0.377147973f, 0.602234662f}, std::array<float,2>{0.744260728f, 0.0728886575f}, std::array<float,2>{0.997071624f, 0.942379951f}, std::array<float,2>{0.206577405f, 0.344687402f}, std::array<float,2>{0.107618824f, 0.79617244f}, std::array<float,2>{0.756555498f, 0.461412072f}, std::array<float,2>{0.597110927f, 0.712718189f}, std::array<float,2>{0.250364155f, 0.227164745f}, std::array<float,2>{0.0621676035f, 0.508326054f}, std::array<float,2>{0.828709841f, 0.0473369509f}, std::array<float,2>{0.522504985f, 0.889014363f}, std::array<float,2>{0.342492104f, 0.273781717f}, std::array<float,2>{0.447920501f, 0.864115894f}, std::array<float,2>{0.645055711f, 0.432264656f}, std::array<float,2>{0.919773638f, 0.685743392f}, std::array<float,2>{0.158332333f, 0.177877426f}, std::array<float,2>{0.309144467f, 0.74321115f}, std::array<float,2>{0.565391719f, 0.194147751f}, std::array<float,2>{0.811293721f, 0.778330684f}, std::array<float,2>{0.0700846091f, 0.483308196f}, std::array<float,2>{0.232727483f, 0.972857475f}, std::array<float,2>{0.948416114f, 0.316374511f}, std::array<float,2>{0.703943908f, 0.584831417f}, std::array<float,2>{0.42735666f, 0.117320769f}, std::array<float,2>{0.0804104134f, 0.691972911f}, std::array<float,2>{0.786715746f, 0.242517173f}, std::array<float,2>{0.585524857f, 0.80142349f}, std::array<float,2>{0.291429996f, 0.438549161f}, std::array<float,2>{0.408358693f, 0.959719539f}, std::array<float,2>{0.698306561f, 0.365384132f}, std::array<float,2>{0.960694909f, 0.615549684f}, std::array<float,2>{0.246154577f, 0.0920532942f}, std::array<float,2>{0.318578333f, 0.536319673f}, std::array<float,2>{0.51441431f, 0.0186293628f}, std::array<float,2>{0.824793816f, 0.932454765f}, std::array<float,2>{0.0321181789f, 0.286964417f}, std::array<float,2>{0.176280245f, 0.843315959f}, std::array<float,2>{0.930819452f, 0.377637208f}, std::array<float,2>{0.628591061f, 0.650328159f}, std::array<float,2>{0.461879343f, 0.151113883f}, std::array<float,2>{0.199503303f, 0.564839184f}, std::array<float,2>{0.982756138f, 0.0958808139f}, std::array<float,2>{0.721248984f, 0.99215591f}, std::array<float,2>{0.395132124f, 0.330595523f}, std::array<float,2>{0.275658518f, 0.75025475f}, std::array<float,2>{0.622523069f, 0.488075227f}, std::array<float,2>{0.77745533f, 0.727547586f}, std::array<float,2>{0.123183385f, 0.209178433f}, std::array<float,2>{0.488514394f, 0.670482516f}, std::array<float,2>{0.673528492f, 0.157257408f}, std::array<float,2>{0.897862554f, 0.854021192f}, std::array<float,2>{0.140323848f, 0.416599065f}, std::array<float,2>{0.0248082317f, 0.90380913f}, std::array<float,2>{0.858601749f, 0.258234292f}, std::array<float,2>{0.55552882f, 0.515756071f}, std::array<float,2>{0.370880544f, 0.0439626947f}, std::array<float,2>{0.183852449f, 0.715114713f}, std::array<float,2>{0.927732766f, 0.232059702f}, std::array<float,2>{0.6364097f, 0.792190909f}, std::array<float,2>{0.45777005f, 0.466369301f}, std::array<float,2>{0.320492327f, 0.940836251f}, std::array<float,2>{0.504423261f, 0.34936589f}, std::array<float,2>{0.812635958f, 0.607921362f}, std::array<float,2>{0.0391646065f, 0.0753383785f}, std::array<float,2>{0.415564775f, 0.552671492f}, std::array<float,2>{0.690331519f, 0.00525757298f}, std::array<float,2>{0.967066765f, 0.920687556f}, std::array<float,2>{0.238837034f, 0.311790645f}, std::array<float,2>{0.0906629935f, 0.822623014f}, std::array<float,2>{0.793915868f, 0.395485073f}, std::array<float,2>{0.589045942f, 0.638175428f}, std::array<float,2>{0.282663256f, 0.125824824f}, std::array<float,2>{0.0212958306f, 0.5786466f}, std::array<float,2>{0.846760571f, 0.12364725f}, std::array<float,2>{0.548970699f, 0.97227478f}, std::array<float,2>{0.361190826f, 0.317690551f}, std::array<float,2>{0.494184315f, 0.777118087f}, std::array<float,2>{0.685335696f, 0.480383217f}, std::array<float,2>{0.901145101f, 0.749053955f}, std::array<float,2>{0.126419291f, 0.188249484f}, std::array<float,2>{0.272011608f, 0.680324435f}, std::array<float,2>{0.609718204f, 0.174892321f}, std::array<float,2>{0.768360615f, 0.860146582f}, std::array<float,2>{0.111170933f, 0.436612487f}, std::array<float,2>{0.192102715f, 0.884010077f}, std::array<float,2>{0.974861443f, 0.277406037f}, std::array<float,2>{0.732323766f, 0.51334554f}, std::array<float,2>{0.400509208f, 0.0539913848f}, std::array<float,2>{0.0982577428f, 0.654629529f}, std::array<float,2>{0.763114333f, 0.155822352f}, std::array<float,2>{0.605887055f, 0.837791502f}, std::array<float,2>{0.258424878f, 0.380323887f}, std::array<float,2>{0.386183232f, 0.937046885f}, std::array<float,2>{0.736753702f, 0.281622559f}, std::array<float,2>{0.989160299f, 0.532491207f}, std::array<float,2>{0.213637084f, 0.0221019574f}, std::array<float,2>{0.354475647f, 0.611755133f}, std::array<float,2>{0.539821565f, 0.0881703496f}, std::array<float,2>{0.873944163f, 0.955802381f}, std::array<float,2>{0.011178025f, 0.363211393f}, std::array<float,2>{0.149309903f, 0.800402939f}, std::array<float,2>{0.881785035f, 0.443199128f}, std::array<float,2>{0.668575883f, 0.688761771f}, std::array<float,2>{0.483271569f, 0.24868834f}, std::array<float,2>{0.223951533f, 0.521537662f}, std::array<float,2>{0.944583178f, 0.0424548499f}, std::array<float,2>{0.711243629f, 0.901540458f}, std::array<float,2>{0.431903034f, 0.262870848f}, std::array<float,2>{0.301623642f, 0.859221399f}, std::array<float,2>{0.572369695f, 0.421406031f}, std::array<float,2>{0.800658107f, 0.66638279f}, std::array<float,2>{0.0728123114f, 0.16237016f}, std::array<float,2>{0.439695269f, 0.731388032f}, std::array<float,2>{0.650045216f, 0.203407541f}, std::array<float,2>{0.911925197f, 0.754466236f}, std::array<float,2>{0.164921626f, 0.49032557f}, std::array<float,2>{0.0515851229f, 0.986620128f}, std::array<float,2>{0.842702746f, 0.333559185f}, std::array<float,2>{0.525528729f, 0.569558084f}, std::array<float,2>{0.333930939f, 0.098346509f}, std::array<float,2>{0.210826337f, 0.662368f}, std::array<float,2>{0.994009972f, 0.164973751f}, std::array<float,2>{0.748399973f, 0.845426202f}, std::array<float,2>{0.379443139f, 0.412122101f}, std::array<float,2>{0.254470587f, 0.895508468f}, std::array<float,2>{0.598766804f, 0.251244664f}, std::array<float,2>{0.753823638f, 0.527778924f}, std::array<float,2>{0.103105202f, 0.0319552906f}, std::array<float,2>{0.476388097f, 0.577719688f}, std::array<float,2>{0.658425927f, 0.10654211f}, std::array<float,2>{0.887924314f, 0.99557817f}, std::array<float,2>{0.148049131f, 0.343411386f}, std::array<float,2>{0.00108126318f, 0.759778917f}, std::array<float,2>{0.862937987f, 0.494982064f}, std::array<float,2>{0.535056472f, 0.719449043f}, std::array<float,2>{0.34732011f, 0.212507173f}, std::array<float,2>{0.0631444976f, 0.541559935f}, std::array<float,2>{0.806958258f, 0.0298693553f}, std::array<float,2>{0.56838125f, 0.928128779f}, std::array<float,2>{0.305211484f, 0.293496221f}, std::array<float,2>{0.422557861f, 0.829526126f}, std::array<float,2>{0.710369349f, 0.390538275f}, std::array<float,2>{0.951857746f, 0.645748258f}, std::array<float,2>{0.22993736f, 0.144727409f}, std::array<float,2>{0.33682552f, 0.69572401f}, std::array<float,2>{0.519364774f, 0.235875472f}, std::array<float,2>{0.834692895f, 0.811228454f}, std::array<float,2>{0.0564023443f, 0.447699726f}, std::array<float,2>{0.16303046f, 0.967083454f}, std::array<float,2>{0.917278588f, 0.374085128f}, std::array<float,2>{0.641236663f, 0.6222803f}, std::array<float,2>{0.450673133f, 0.0838599876f}, std::array<float,2>{0.0372025967f, 0.740632772f}, std::array<float,2>{0.82341814f, 0.200492606f}, std::array<float,2>{0.511012375f, 0.769478381f}, std::array<float,2>{0.316302121f, 0.471637994f}, std::array<float,2>{0.468388855f, 0.981286347f}, std::array<float,2>{0.630144536f, 0.322980434f}, std::array<float,2>{0.935265303f, 0.590843081f}, std::array<float,2>{0.174130455f, 0.112427816f}, std::array<float,2>{0.296007752f, 0.503026843f}, std::array<float,2>{0.579289556f, 0.0561322011f}, std::array<float,2>{0.783136964f, 0.877433538f}, std::array<float,2>{0.0823350847f, 0.270662785f}, std::array<float,2>{0.242426813f, 0.868554294f}, std::array<float,2>{0.955911636f, 0.426405281f}, std::array<float,2>{0.702033997f, 0.67547518f}, std::array<float,2>{0.412596196f, 0.180807933f}, std::array<float,2>{0.136285305f, 0.594847083f}, std::array<float,2>{0.891699851f, 0.0668748841f}, std::array<float,2>{0.678162813f, 0.951084971f}, std::array<float,2>{0.485621721f, 0.358685017f}, std::array<float,2>{0.373552948f, 0.782237589f}, std::array<float,2>{0.561390162f, 0.45402348f}, std::array<float,2>{0.852279603f, 0.703890085f}, std::array<float,2>{0.0295184255f, 0.224538162f}, std::array<float,2>{0.391367763f, 0.629855514f}, std::array<float,2>{0.723392546f, 0.140409425f}, std::array<float,2>{0.979751229f, 0.816031277f}, std::array<float,2>{0.195937097f, 0.405934751f}, std::array<float,2>{0.12061315f, 0.90770942f}, std::array<float,2>{0.774127364f, 0.299843609f}, std::array<float,2>{0.618871331f, 0.557968974f}, std::array<float,2>{0.278717041f, 0.0133044496f}}
49.007813
53
0.734731
st-ario
a6b7cfc432faae582fa25bf2fae88f1bc236ce4f
1,541
cpp
C++
source/ListFileRecursively_For_Compare.cpp
Linux-pt/escan-backup
bfaed321201e512974e70c305beba53892428efc
[ "Unlicense" ]
null
null
null
source/ListFileRecursively_For_Compare.cpp
Linux-pt/escan-backup
bfaed321201e512974e70c305beba53892428efc
[ "Unlicense" ]
null
null
null
source/ListFileRecursively_For_Compare.cpp
Linux-pt/escan-backup
bfaed321201e512974e70c305beba53892428efc
[ "Unlicense" ]
null
null
null
#include<stdio.h> #include<string.h> #include<string> #include<iostream> #include<stdlib.h> #include<unistd.h> #include<signal.h> #include"Compare_File_Present_In_Backup.h" #include<dirent.h> #include<sqlite3.h> #include"CalculateSha1sum.h" #include"ListFileRecursively_For_Compare.h" #include"HandleSigint.h" using namespace std; /*for every file it will call Compare_File_Present_In_Backup this function*/ /*Compare_File_Present_In_Backup*/ /*CalculateSha1sum*/ extern sqlite3 *db; extern int flag; void ListFileRecursively_For_Compare(char *basePath) { signal(SIGINT, HandleSigint); signal(SIGTERM, HandleSigint); //WriteLogForlibmwshare(2,"ListFileRecursively_For_Compare started" ); char path[1024]=""; struct dirent *dp; DIR *dir = opendir(basePath); //char sha1[1024]=""; if (!dir) { return; } while ((dp = readdir(dir)) != NULL && !flag) { if (strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) { strcpy(path, basePath); strcat(path, "/"); strcat(path, dp->d_name); printf("%s\n",dp->d_name); if((dp->d_type==DT_SOCK) || (dp->d_type==DT_BLK) || (dp->d_type==DT_CHR) || (dp->d_type==DT_FIFO) || (dp->d_type==DT_LNK) || (dp->d_type==DT_UNKNOWN)) { continue; } if(dp->d_type==DT_REG) { char sha1[1024]=""; strcpy(sha1,CalculateSha1sum(path).c_str()); Compare_File_Present_In_Backup(dp->d_name,path,sha1,basePath); } ListFileRecursively_For_Compare(path); } } //WriteLogForlibmwshare(2,"ListFileRecursively_For_Compare ended" ); closedir(dir); }
24.854839
153
0.693056
Linux-pt
a6bd5cba82e46dbedbfb5c03305447c672894f8c
248
hpp
C++
src/Meta/AuxiliaryTypes/check.hpp
NagiSenbon/Algorithm
e8044820a2cdd6a26d58097fd84512f3231d8dd6
[ "Apache-2.0" ]
2
2019-10-07T01:48:53.000Z
2019-10-13T08:24:22.000Z
src/Meta/AuxiliaryTypes/check.hpp
NagiSenbon/Algorithm
e8044820a2cdd6a26d58097fd84512f3231d8dd6
[ "Apache-2.0" ]
null
null
null
src/Meta/AuxiliaryTypes/check.hpp
NagiSenbon/Algorithm
e8044820a2cdd6a26d58097fd84512f3231d8dd6
[ "Apache-2.0" ]
null
null
null
#pragma once #include "../../Headers.hpp" __ALG__MAT__BEGIN__ template <std::size_t D, std::size_t B> struct same_size_check; template <std::size_t D> struct same_size_check<D, D> { }; template <auto... T> struct false_type; __ALG__MAT__END__
13.777778
39
0.733871
NagiSenbon
a6c22243e61255bbf774e0eb06a0a7f7bb1b5d8c
4,028
cpp
C++
lib/smack/SmackWarnings.cpp
Guoanshisb/smack
6fee210b1cb272cb9f596ea53e08935c159ec2f2
[ "MIT" ]
2
2021-10-08T00:50:26.000Z
2021-12-17T07:18:15.000Z
lib/smack/SmackWarnings.cpp
Guoanshisb/smack
6fee210b1cb272cb9f596ea53e08935c159ec2f2
[ "MIT" ]
1
2021-09-29T07:21:20.000Z
2021-09-29T07:21:20.000Z
lib/smack/SmackWarnings.cpp
Guoanshisb/smack
6fee210b1cb272cb9f596ea53e08935c159ec2f2
[ "MIT" ]
1
2021-10-12T09:02:40.000Z
2021-10-12T09:02:40.000Z
#include "llvm/IR/DebugInfoMetadata.h" #include "llvm/IR/DebugLoc.h" #include "llvm/Support/raw_ostream.h" #include "smack/SmackOptions.h" #include "smack/SmackWarnings.h" #include <algorithm> #include <set> namespace smack { using namespace llvm; std::string buildDebugInfo(const Instruction *i) { std::stringstream ss; if (i && i->getMetadata("dbg")) { const DebugLoc DL = i->getDebugLoc(); auto *scope = cast<DIScope>(DL.getScope()); ss << scope->getFilename().str() << ":" << DL.getLine() << ":" << DL.getCol() << ": "; } return ss.str(); } bool SmackWarnings::isSufficientWarningLevel(WarningLevel level) { return SmackOptions::WarningLevel >= level; } SmackWarnings::UnsetFlagsT SmackWarnings::getUnsetFlags(RequiredFlagsT requiredFlags) { UnsetFlagsT ret; std::copy_if(requiredFlags.begin(), requiredFlags.end(), std::inserter(ret, ret.begin()), [](FlagT *flag) { return !*flag; }); return ret; } bool SmackWarnings::isSatisfied(RequiredFlagsT requiredFlags, FlagRelation rel) { auto unsetFlags = getUnsetFlags(requiredFlags); return rel == FlagRelation::And ? unsetFlags.empty() : unsetFlags.size() < requiredFlags.size(); } std::string SmackWarnings::getFlagStr(UnsetFlagsT flags) { std::string ret = "{ "; for (auto f : flags) { if (f->ArgStr.str() == "bit-precise") ret += ("--integer-encoding=bit-vector "); else ret += ("--" + f->ArgStr.str() + " "); } return ret + "}"; } void SmackWarnings::warnIfUnsound(std::string name, RequiredFlagsT requiredFlags, Block *currBlock, const Instruction *i, bool ignore, FlagRelation rel) { if (!isSatisfied(requiredFlags, rel)) warnUnsound(name, getUnsetFlags(requiredFlags), currBlock, i, ignore); } void SmackWarnings::warnUnsound(std::string unmodeledOpName, Block *currBlock, const Instruction *i, bool ignore, FlagRelation rel) { warnUnsound("unmodeled operation " + unmodeledOpName, UnsetFlagsT(), currBlock, i, ignore, rel); } void SmackWarnings::warnUnsound(std::string name, UnsetFlagsT unsetFlags, Block *currBlock, const Instruction *i, bool ignore, FlagRelation rel) { if (!isSufficientWarningLevel(WarningLevel::Unsound)) return; std::string beginning = std::string("llvm2bpl: ") + buildDebugInfo(i); std::string end = (ignore ? "unsoundly ignoring " : "over-approximating ") + name + ";"; if (currBlock) currBlock->addStmt(Stmt::comment(beginning + "warning: " + end)); std::string hint = ""; if (!unsetFlags.empty()) hint = (" try adding " + ((rel == FlagRelation::And ? "all the " : "any ") + ("flag(s) in: " + getFlagStr(unsetFlags)))); errs() << beginning; (SmackOptions::ColoredWarnings ? errs().changeColor(raw_ostream::MAGENTA) : errs()) << "warning: "; (SmackOptions::ColoredWarnings ? errs().resetColor() : errs()) << end << hint << "\n"; } void SmackWarnings::warnIfUnsound(std::string name, FlagT &requiredFlag, Block *currBlock, const Instruction *i, FlagRelation rel) { warnIfUnsound(name, {&requiredFlag}, currBlock, i, false, rel); } void SmackWarnings::warnIfUnsound(std::string name, FlagT &requiredFlag1, FlagT &requiredFlag2, Block *currBlock, const Instruction *i, FlagRelation rel) { warnIfUnsound(name, {&requiredFlag1, &requiredFlag2}, currBlock, i, false, rel); } void SmackWarnings::warnInfo(std::string info) { if (!isSufficientWarningLevel(WarningLevel::Info)) return; errs() << "warning: " << info << "\n"; } } // namespace smack
35.646018
80
0.59434
Guoanshisb
a6c3afb8b0d9b79b258b3b169d1743872bc4af57
1,647
hpp
C++
Crisp/Animation/Animator.hpp
FallenShard/Crisp
d4cf22c0f9af73a6c4ba2b7d67696f1a188fd423
[ "MIT" ]
6
2017-09-14T03:26:49.000Z
2021-09-18T05:40:59.000Z
Crisp/Animation/Animator.hpp
FallenShard/Crisp
d4cf22c0f9af73a6c4ba2b7d67696f1a188fd423
[ "MIT" ]
null
null
null
Crisp/Animation/Animator.hpp
FallenShard/Crisp
d4cf22c0f9af73a6c4ba2b7d67696f1a188fd423
[ "MIT" ]
null
null
null
#pragma once #include "Animation/Animation.hpp" #include <memory> #include <vector> #include <unordered_map> #include <unordered_set> namespace crisp { class Animator { public: Animator(); ~Animator() = default; Animator(const Animator& animator) = delete; Animator(Animator&& animator) = default; Animator& operator=(const Animator& animator) = delete; Animator& operator=(Animator&& animator) = default; void update(double dt); void add(std::shared_ptr<Animation> animation); void add(std::shared_ptr<Animation> animation, void* targetObject); void remove(std::shared_ptr<Animation> animation); void clearAllAnimations(); void clearObjectAnimations(void* targetObject); private: // The list of animations that are currently actively updated std::vector<std::shared_ptr<Animation>> m_activeAnimations; // The list of animations that will enter the list of active animations // The list is separate to allow addition of animations inside an animation handler // This avoids invalidation of the m_activeAnimations container iterator std::vector<std::shared_ptr<Animation>> m_pendingAnimations; // The set of animations slated to be removed from active animations list std::unordered_set<std::shared_ptr<Animation>> m_removedAnimations; // Ties the lifetime of a group of animations to a particular object pointer std::unordered_map<void*, std::vector<std::shared_ptr<Animation>>> m_animationLifetimes; bool m_clearAllAnimations; }; }
34.3125
96
0.690346
FallenShard
a6c482f53f26f26847571a3e58cfab955df67f44
2,258
cpp
C++
libv8/ruby/1.9.1/gems/therubyracer-0.9.4/ext/v8/v8_callbacks.cpp
tcmaker/ConOnRails
97656120dbc9a5bf773538e021b768d0515ae333
[ "Apache-2.0" ]
1
2021-02-07T21:33:42.000Z
2021-02-07T21:33:42.000Z
libv8/ruby/1.9.1/gems/therubyracer-0.9.4/ext/v8/v8_callbacks.cpp
tcmaker/ConOnRails
97656120dbc9a5bf773538e021b768d0515ae333
[ "Apache-2.0" ]
null
null
null
libv8/ruby/1.9.1/gems/therubyracer-0.9.4/ext/v8/v8_callbacks.cpp
tcmaker/ConOnRails
97656120dbc9a5bf773538e021b768d0515ae333
[ "Apache-2.0" ]
null
null
null
#include "v8_callbacks.h" #include "rr.h" using namespace v8; namespace { VALUE ArgumentsClass; VALUE AccessorInfoClass; VALUE _Data(VALUE self) { return rb_iv_get(self, "data"); } namespace Accessor { AccessorInfo *info(VALUE value) { AccessorInfo* i = 0; Data_Get_Struct(value, class AccessorInfo, i); return i; } VALUE This(VALUE self) { return rr_v82rb(info(self)->This()); } VALUE Holder(VALUE self) { return rr_v82rb(info(self)->Holder()); } } namespace Args { Arguments* args(VALUE value) { Arguments *arguments = 0; Data_Get_Struct(value, class Arguments, arguments); return arguments; } VALUE This(VALUE self) { return rr_v82rb(args(self)->This()); } VALUE Holder(VALUE self) { return rr_v82rb(args(self)->Holder()); } VALUE Length(VALUE self) { return rr_v82rb(args(self)->Length()); } VALUE Get(VALUE self, VALUE index) { int i = NUM2INT(index); return rr_v82rb((*args(self))[i]); } VALUE Callee(VALUE self) { return rr_v82rb(args(self)->Callee()); } VALUE IsConstructCall(VALUE self) { return rr_v82rb(args(self)->IsConstructCall()); } } } void rr_init_v8_callbacks() { AccessorInfoClass = rr_define_class("AccessorInfo"); rr_define_method(AccessorInfoClass, "This", Accessor::This, 0); rr_define_method(AccessorInfoClass, "Holder", Accessor::Holder, 0); rr_define_method(AccessorInfoClass, "Data", _Data, 0); ArgumentsClass = rr_define_class("Arguments"); rr_define_method(ArgumentsClass, "This", Args::This, 0); rr_define_method(ArgumentsClass, "Holder", Args::Holder, 0); rr_define_method(ArgumentsClass, "Data", _Data, 0); rr_define_method(ArgumentsClass, "Length", Args::Length, 0); rr_define_method(ArgumentsClass, "Callee", Args::Callee, 0); rr_define_method(ArgumentsClass, "IsConstructCall", Args::IsConstructCall, 0); rr_define_method(ArgumentsClass, "[]", Args::Get, 1); } VALUE rr_v82rb(const AccessorInfo& info) { return Data_Wrap_Struct(AccessorInfoClass, 0, 0, (void*)&info); } VALUE rr_v82rb(const Arguments& arguments) { return Data_Wrap_Struct(ArgumentsClass, 0, 0, (void*)&arguments); }
27.536585
80
0.670948
tcmaker
a6c4da6eb438be1445b8c3a428b6148ec1d4d42e
3,405
cpp
C++
External/xlLib/Projects/UnitTest/Common/Containers/xlSetTest.cpp
Streamlet/RCVersion
f34d01d84bdb58c6a989c88e3cb1d75d04aefd21
[ "MIT" ]
5
2015-10-13T15:04:09.000Z
2021-12-30T00:07:05.000Z
External/xlLib/Projects/UnitTest/Common/Containers/xlSetTest.cpp
Streamlet/RCVersion
f34d01d84bdb58c6a989c88e3cb1d75d04aefd21
[ "MIT" ]
null
null
null
External/xlLib/Projects/UnitTest/Common/Containers/xlSetTest.cpp
Streamlet/RCVersion
f34d01d84bdb58c6a989c88e3cb1d75d04aefd21
[ "MIT" ]
1
2016-06-22T12:32:51.000Z
2016-06-22T12:32:51.000Z
//------------------------------------------------------------------------------ // // Copyright (C) Streamlet. All rights reserved. // // File Name: xlSetTest.cpp // Author: Streamlet // Create Time: 2011-04-30 // Description: // //------------------------------------------------------------------------------ #include "../../../../Include/xl/Common/Containers/xlSet.h" #include "../../../../Include/xl/AppHelper/xlUnitTest.h" namespace { using namespace xl; XL_TEST_CASE() { Set<int> a; XL_TEST_ASSERT(a.Size() == 0); } XL_TEST_CASE() { Set<int> a; XL_TEST_ASSERT(a.Size() == 0); Set<int> b(a); XL_TEST_ASSERT(b.Size() == 0); a.Insert(1); a.Insert(2); Set<int> c(a); XL_TEST_ASSERT(c.Size() == 2); XL_TEST_ASSERT(*c.Begin() == 1); XL_TEST_ASSERT(*c.ReverseBegin() == 2); } XL_TEST_CASE() { Set<int> a; XL_TEST_ASSERT(a.Size() == 0); Set<int> b; b = a; XL_TEST_ASSERT(b.Size() == 0); a.Insert(1); a.Insert(2); Set<int> c; c = a; XL_TEST_ASSERT(c.Size() == 2); XL_TEST_ASSERT(*a.Begin() == 1); XL_TEST_ASSERT(*++a.Begin() == 2); } XL_TEST_CASE() { Set<int> a; XL_TEST_ASSERT(a.Size() == 0); Set<int> b; b = a; XL_TEST_ASSERT(b == a); XL_TEST_ASSERT(!(b != a)); a.Insert(1); a.Insert(2); XL_TEST_ASSERT(b != a); XL_TEST_ASSERT(!(b == a)); Set<int> c(a); XL_TEST_ASSERT(c == a); XL_TEST_ASSERT(!(c != a)); b.Insert(1); b.Insert(2); XL_TEST_ASSERT(b == a); XL_TEST_ASSERT(!(b != a)); XL_TEST_ASSERT(b == c); XL_TEST_ASSERT(!(b != c)); } XL_TEST_CASE() { Set<int> a; XL_TEST_ASSERT(a.Size() == 0); XL_TEST_ASSERT(a.Empty() == true); a.Insert(10); XL_TEST_ASSERT(a.Size() == 1); XL_TEST_ASSERT(a.Empty() == false); a.Insert(20); a.Insert(30); a.Insert(40); a.Insert(50); XL_TEST_ASSERT(a.Size() == 5); XL_TEST_ASSERT(a.Empty() == false); } XL_TEST_CASE() { Set<int> a; a.Insert(2); a.Insert(6); a.Insert(4); a.Insert(3); a.Insert(5); a.Insert(1); Set<int>::Iterator it = a.Begin(); XL_TEST_ASSERT(*it == 1); ++it; XL_TEST_ASSERT(*it == 2); ++it; XL_TEST_ASSERT(*it == 3); ++it; XL_TEST_ASSERT(*it == 4); ++it; XL_TEST_ASSERT(*it == 5); ++it; XL_TEST_ASSERT(*it == 6); ++it; XL_TEST_ASSERT(it == a.End()); } XL_TEST_CASE() { Set<int> a; a.Insert(2); a.Insert(6); a.Insert(4); a.Insert(3); a.Insert(5); a.Insert(1); Set<int>::Iterator it = a.Find(5); XL_TEST_ASSERT(*it == 5); Set<int>::Iterator it2 = it; ++it2; XL_TEST_ASSERT(*it2 == 6); ++it2; XL_TEST_ASSERT(it2 == a.End()); } }
20.889571
81
0.408811
Streamlet
a6c5f99c3e9c524b163d245bd93e4ddfd6778a2c
1,352
cpp
C++
libs/renderer/src/renderer/state/ffp/misc/parameters.cpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
2
2016-01-27T13:18:14.000Z
2018-05-11T01:11:32.000Z
libs/renderer/src/renderer/state/ffp/misc/parameters.cpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
null
null
null
libs/renderer/src/renderer/state/ffp/misc/parameters.cpp
cpreh/spacegameengine
313a1c34160b42a5135f8223ffaa3a31bc075a01
[ "BSL-1.0" ]
3
2018-05-11T01:11:34.000Z
2021-04-24T19:47:45.000Z
// Copyright Carl Philipp Reh 2006 - 2019. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <sge/renderer/state/ffp/misc/enable_point_sprites.hpp> #include <sge/renderer/state/ffp/misc/local_viewer.hpp> #include <sge/renderer/state/ffp/misc/normalize_normals.hpp> #include <sge/renderer/state/ffp/misc/parameters.hpp> sge::renderer::state::ffp::misc::parameters::parameters( sge::renderer::state::ffp::misc::enable_point_sprites const _enable_point_sprites, sge::renderer::state::ffp::misc::local_viewer const _local_viewer, sge::renderer::state::ffp::misc::normalize_normals const _normalize_normals) : enable_point_sprites_(_enable_point_sprites), local_viewer_(_local_viewer), normalize_normals_(_normalize_normals) { } sge::renderer::state::ffp::misc::enable_point_sprites sge::renderer::state::ffp::misc::parameters::enable_point_sprites() const { return enable_point_sprites_; } sge::renderer::state::ffp::misc::local_viewer sge::renderer::state::ffp::misc::parameters::local_viewer() const { return local_viewer_; } sge::renderer::state::ffp::misc::normalize_normals sge::renderer::state::ffp::misc::parameters::normalize_normals() const { return normalize_normals_; }
35.578947
86
0.756657
cpreh
a6c61ab0eae05cbe0124dc12803f06f296b892c4
914
cpp
C++
book_2e_code/chapter4_tutorials/src/c4_example1.cpp
gtraines/robot1-ros
cb26c4c99223c4b09f92ef3f48a4c0dd649091f4
[ "BSD-3-Clause" ]
4
2021-08-23T00:46:40.000Z
2021-08-23T05:57:43.000Z
book_2e_code/chapter4_tutorials/src/c4_example1.cpp
gtraines/robot1-ros
cb26c4c99223c4b09f92ef3f48a4c0dd649091f4
[ "BSD-3-Clause" ]
null
null
null
book_2e_code/chapter4_tutorials/src/c4_example1.cpp
gtraines/robot1-ros
cb26c4c99223c4b09f92ef3f48a4c0dd649091f4
[ "BSD-3-Clause" ]
2
2021-04-22T23:39:29.000Z
2021-08-23T00:47:02.000Z
#include<ros/ros.h> #include<geometry_msgs/Twist.h> #include<sensor_msgs/Joy.h> #include<iostream> using namespace std; class TeleopJoy{ public: TeleopJoy(); private: void callBack(const sensor_msgs::Joy::ConstPtr& joy); ros::NodeHandle n; ros::Publisher pub; ros::Subscriber sub; int i_velLinear, i_velAngular; }; TeleopJoy::TeleopJoy() { n.param("axis_linear",i_velLinear,i_velLinear); n.param("axis_angular",i_velAngular,i_velAngular); pub = n.advertise<geometry_msgs::Twist>("/turtle1/cmd_vel",1); sub = n.subscribe<sensor_msgs::Joy>("joy", 10, &TeleopJoy::callBack, this); } void TeleopJoy::callBack(const sensor_msgs::Joy::ConstPtr& joy) { geometry_msgs::Twist vel; vel.angular.z = joy->axes[i_velAngular]; vel.linear.x = joy->axes[i_velLinear]; pub.publish(vel); } int main(int argc, char** argv) { ros::init(argc, argv, "teleopJoy"); TeleopJoy teleop_turtle; ros::spin(); }
22.292683
76
0.721007
gtraines
a6cb8a676ed34194a0da709b53eb3f3b558c463e
4,562
cpp
C++
DPMI.cpp
fringpfe/BBSETUP
eb9d96e7223797e5c4170301f0120baace25424c
[ "MIT" ]
null
null
null
DPMI.cpp
fringpfe/BBSETUP
eb9d96e7223797e5c4170301f0120baace25424c
[ "MIT" ]
null
null
null
DPMI.cpp
fringpfe/BBSETUP
eb9d96e7223797e5c4170301f0120baace25424c
[ "MIT" ]
null
null
null
/** * * Copyright (C) 2021 Fabian Ringpfeil * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ /***************************************************************************************************************** * Functions handling the DOS Protected Mode Interface (DPMI) - in particular the VESA BIOS Extension (VBE). *****************************************************************************************************************/ #include "DPMI.h" #include "GUI.h" #include <i86.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #define DPMI_real_segment(P) ((((unsigned int) (P)) >> 4) & 0xFFFF) #define DPMI_real_offset(P) (((unsigned int) (P)) & 0xF) VbeInfoBlock *DPMI_VbeInfo; ModeInfoBlock *ModeInfo; RMREGS rmregs; void* DPMI_Alloc(int size) { union REGS inregs; /* Allocate DOS Memory Block: Allocates a block of memory from the DOS memory pool, i.e. memory below the 1 MB boundary that is controlled by DOS. */ inregs.w.ax = 0x100; inregs.w.bx = size; int386(0x31, &inregs, &inregs); if (inregs.w.cflag) { GUI_ErrorHandler(1049); } return (void*)(inregs.w.ax << 4); } bool DPMI_CompareVideoModeNumber(short video_mode, short* vbe_info) { short *i; for ( i = vbe_info; ; ++i ) { if ( *i == video_mode ) { return 1; } if (*i == -1) { break; } } return 0; } bool DPMI_IsVesaAvailable(void) { union REGS inregs; struct SREGS segregs; if(!DPMI_VbeInfo) { DPMI_VbeInfo = (VbeInfoBlock *)DPMI_Alloc(sizeof(VbeInfoBlock)); } printf("DPMI_IsVesaAvailable: Check if VESA is available.\n"); /* VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION: * Determine whether VESA BIOS extensions are present and the capabilities supported by the display adapter. */ memset(&rmregs, 0, 50u); memset(&segregs, 0, sizeof(SREGS)); /* Workaround to prevent segment violation. */ rmregs.eax = 0x4f00; rmregs.es = DPMI_real_segment(DPMI_VbeInfo); rmregs.edi = DPMI_real_offset(DPMI_VbeInfo); inregs.w.ax = 0x300; inregs.w.bx = 0x10; inregs.w.cx = 0; segregs.es = FP_SEG(&rmregs); inregs.x.edi = FP_OFF(&rmregs); int386x(0x31,&inregs,&inregs,&segregs); if(rmregs.eax != 0x4f) { return 0; } return (memcmp(DPMI_VbeInfo, "VESA", 4u) == 0); } bool DPMI_IsVideoModeSupported(short video_mode, short* vbe_info) { union REGS inregs; struct SREGS sregs; if ( !DPMI_CompareVideoModeNumber(video_mode, (short *)vbe_info) ) { return 0; } if ( !ModeInfo ) { ModeInfo = (ModeInfoBlock *)DPMI_Alloc(sizeof(ModeInfoBlock)); } /* VESA SuperVGA BIOS - GET SuperVGA MODE INFORMATION: Determine the attributes of the specified video mode. */ memset(&rmregs, 0, sizeof(rmregs)); memset(&sregs, 0, sizeof(sregs)); rmregs.eax = 0x4f01; rmregs.ecx = video_mode; rmregs.es = DPMI_real_segment(ModeInfo); rmregs.edi = DPMI_real_offset(ModeInfo); inregs.w.ax = 0x300; inregs.w.bx = 0x10; inregs.w.cx = 0; sregs.es = FP_SEG(&rmregs); inregs.x.edi = FP_OFF(&rmregs); int386x(0x31,&inregs,&inregs,&sregs); if(rmregs.eax != 0x4f) { return 0; } return (ModeInfo->ModeAttributes & 3) != 2; }
29.816993
154
0.603463
fringpfe
a6d2ca41a9848773de508407966b96f6846fd538
1,145
cpp
C++
src/common.cpp
baldinialberto/awiGame
88937014bcbacdac6766fad8696384fa84f91582
[ "Unlicense" ]
null
null
null
src/common.cpp
baldinialberto/awiGame
88937014bcbacdac6766fad8696384fa84f91582
[ "Unlicense" ]
null
null
null
src/common.cpp
baldinialberto/awiGame
88937014bcbacdac6766fad8696384fa84f91582
[ "Unlicense" ]
null
null
null
#include "../include/common.hpp" me::fIt::fIt(const char *path, const char *flags) : _file{path, flags[0] == 'r' ? std::ios_base::in : std::ios_base::out} { } me::fIt::~fIt() { if (_file.is_open()) _file.close(); } bool me::fIt::opened() const { return _file.is_open(); } const me::fIt &me::fIt::load(const char *path, const char *flags) { _file.open(path, flags[0] == 'r' ? std::ios_base::in : std::ios_base::out); return *this; } int me::fIt::write(const char *data, size_t size) { if (data == nullptr || size == 0) return 1; _file.write(data, size); return _file.eof() | _file.fail() | _file.bad(); } int me::fIt::read(char *dest, size_t size) { if (dest == nullptr || size == 0) return 1; _file.read(dest, size); return _file.eof() | _file.fail() | _file.bad(); } string me::filePath(const char *pFilename, fm::pokekit_type pType) { //string currFilePath{std::__fs::filesystem::current_path()}; string currFilePath{"/Users/albertobaldini/source/repos/awigame/"}; currFilePath.append(fm::pokekit_relPaths[pType]).append(pFilename); return currFilePath; }
25.444444
79
0.625328
baldinialberto
a6d58d9b0214e41a42dbaa83a564295859ca3b57
7,865
cpp
C++
SCProjects/MetaBot/Source/AIloop.cpp
andertavares/OpprimoBot
da75bc0bf65b2b12d7184ffef88b2dbfa0d6110b
[ "MIT" ]
null
null
null
SCProjects/MetaBot/Source/AIloop.cpp
andertavares/OpprimoBot
da75bc0bf65b2b12d7184ffef88b2dbfa0d6110b
[ "MIT" ]
null
null
null
SCProjects/MetaBot/Source/AIloop.cpp
andertavares/OpprimoBot
da75bc0bf65b2b12d7184ffef88b2dbfa0d6110b
[ "MIT" ]
null
null
null
#include <BWTA.h> #include "AIloop.h" #include "Managers/BuildingPlacer.h" #include "Utils/Profiler.h" #include "Managers/Upgrader.h" #include "Pathfinding/NavigationAgent.h" #include "Managers/AgentManager.h" #include "Influencemap/MapManager.h" #include "Managers/ExplorationManager.h" #include "Managers/Constructor.h" #include "Managers\TechManager.h" #include "Commander/StrategySelector.h" AIloop::AIloop() { debugUnit = false; debugPF = false; debugBP = false; debugSQ = -1; debug = true; for (auto &u : Broodwar->self()->getUnits()) { AgentManager::getInstance()->addAgent(u); } } AIloop::~AIloop() { } void AIloop::toggleDebug() { debug = !debug; } void AIloop::toggleUnitDebug() { debugUnit = !debugUnit; } void AIloop::togglePFDebug() { debugPF = !debugPF; } void AIloop::toggleBPDebug() { debugBP = !debugBP; } void AIloop::setDebugSQ(int squadID) { debugSQ = squadID; } void AIloop::computeActions() { Profiler::getInstance()->start("OnFrame_MapManager"); MapManager::getInstance()->update(); Profiler::getInstance()->end("OnFrame_MapManager"); Profiler::getInstance()->start("OnFrame_Constructor"); Constructor::getInstance()->computeActions(); Profiler::getInstance()->end("OnFrame_Constructor"); Profiler::getInstance()->start("OnFrame_Commander"); Commander::getInstance()->computeActions(); Profiler::getInstance()->end("OnFrame_Commander"); Profiler::getInstance()->start("OnFrame_ExplorationManager"); ExplorationManager::getInstance()->computeActions(); Profiler::getInstance()->end("OnFrame_ExplorationManager"); Profiler::getInstance()->start("OnFrame_AgentManager"); AgentManager::getInstance()->computeActions(); Profiler::getInstance()->end("OnFrame_AgentManager"); Profiler::getInstance()->start("OnFrame_TechManager"); TechManager::getInstance()->computeActions(); Profiler::getInstance()->end("OnFrame_TechManager"); } void AIloop::addUnit(Unit unit) { AgentManager::getInstance()->addAgent(unit); //Remove from buildorder if this is a building if (unit->getType().isBuilding()) { Constructor::getInstance()->unlock(unit->getType()); } } void AIloop::morphUnit(Unit unit) { AgentManager::getInstance()->morphDrone(unit); Constructor::getInstance()->unlock(unit->getType()); } void AIloop::unitDestroyed(Unit unit) { if (unit->getPlayer()->getID() == Broodwar->self()->getID()) { //Remove bunker squads if the destroyed unit //is a bunker if (unit->getType().getID() == UnitTypes::Terran_Bunker.getID()) { Commander::getInstance()->removeBunkerSquad(unit->getID()); } AgentManager::getInstance()->removeAgent(unit); if (unit->getType().isBuilding()) { Constructor::getInstance()->buildingDestroyed(unit); } AgentManager::getInstance()->cleanup(); } if (unit->getPlayer()->getID() != Broodwar->self()->getID() && !unit->getPlayer()->isNeutral()) { //Update spotted buildings ExplorationManager::getInstance()->unitDestroyed(unit); } } void AIloop::show_debug() { if (debug) { //Show timer stringstream ss; ss << "\x0FTime: "; ss << Broodwar->elapsedTime() / 60; ss << ":"; int sec = Broodwar->elapsedTime() % 60; if (sec < 10) ss << "0"; ss << sec; Broodwar->drawTextScreen(110,5, ss.str().c_str()); // //Show pathfinder version stringstream st; st << "\x0FPathfinder: "; if (NavigationAgent::pathfinding_version == 0) { st << "Built-in"; } if (NavigationAgent::pathfinding_version == 1) { st << "Hybrid Boids"; } if (NavigationAgent::pathfinding_version == 2) { st << "Hybrid PF"; } Broodwar->drawTextScreen(500,310, st.str().c_str()); // StrategySelector::getInstance()->printInfo(); if (debugBP) { BuildingPlacer::getInstance()->debug(); } drawTerrainData(); Commander::getInstance()->debug_showGoal(); Agentset agents = AgentManager::getInstance()->getAgents(); for (auto &a : agents) { if (a->isBuilding()) a->debug_showGoal(); } //Show goal info for selected units if (Broodwar->getSelectedUnits().size() > 0) { for (auto &u : Broodwar->getSelectedUnits()) { int unitID = (u)->getID(); BaseAgent* agent = AgentManager::getInstance()->getAgent(unitID); if (agent != NULL && agent->isAlive()) { agent->debug_showGoal(); } } } if (debugBP) { //If we have any unit selected, use that to show PFs. if (Broodwar->getSelectedUnits().size() > 0) { for (auto &u : Broodwar->getSelectedUnits()) { int unitID = u->getID(); BaseAgent* agent = AgentManager::getInstance()->getAgent(unitID); if (agent != NULL) { NavigationAgent::getInstance()->displayPF(agent); } break; } } } if (debugUnit) { //If we have any unit selected, show unit info. if (Broodwar->getSelectedUnits().size() > 0) { for (auto &u : Broodwar->getSelectedUnits()) { int unitID = u->getID(); BaseAgent* agent = AgentManager::getInstance()->getAgent(unitID); if (agent != NULL) { agent->printInfo(); break; } } } } if (debugSQ >= 0) { Squad* squad = Commander::getInstance()->getSquad(debugSQ); if (squad != NULL) { squad->printInfo(); } } Upgrader::getInstance()->printInfo(); Commander::getInstance()->printInfo(); } } void AIloop::drawTerrainData() { //we will iterate through all the base locations, and draw their outlines. for(BaseLocation* base : getBaseLocations()) { TilePosition p = base->getTilePosition(); Position c = base->getPosition(); //Draw a progress bar at each resource for (auto &u : Broodwar->getStaticMinerals()) { if (u->getResources() > 0) { int total = u->getInitialResources(); int done = u->getResources(); int w = 60; int h = 64; //Start Position s = Position(u->getPosition().x - w/2 + 2, u->getPosition().y - 4); //End Position e = Position(s.x + w, s.y + 8); //Progress int prg = (int)((double)done / (double)total * w); Position p = Position(s.x + prg, s.y + 8); Broodwar->drawBoxMap(s.x, s.y, e.x, e.y, Colors::Orange,false); Broodwar->drawBoxMap(s.x, s.y, p.x, p.y, Colors::Orange,true); } } } if (debugBP) { //we will iterate through all the regions and draw the polygon outline of it in white. for(BWTA::Region* r : BWTA::getRegions()) { BWTA::Polygon p = r->getPolygon(); for(int j = 0; j < (int)p.size(); j++) { Position point1=p[j]; Position point2=p[(j+1) % p.size()]; Broodwar->drawLineMap(point1.x, point1.y, point2.x, point2.y, Colors::Orange); } } //we will visualize the chokepoints with yellow lines for(BWTA::Region* r : BWTA::getRegions()) { for(BWTA::Chokepoint* c : r->getChokepoints()) { Position point1 = c->getSides().first; Position point2 = c->getSides().second; Broodwar->drawLineMap(point1.x, point1.y, point2.x, point2.y, Colors::Yellow); } } } //locate zerg eggs and draw progress bars if (Constructor::isZerg()) { for (auto &u : Broodwar->getAllUnits()) { if (u->getType().getID() == UnitTypes::Zerg_Egg.getID() || u->getType().getID() == UnitTypes::Zerg_Lurker_Egg.getID() || u->getType().getID() == UnitTypes::Zerg_Cocoon.getID()) { int total = u->getBuildType().buildTime(); int done = total - u->getRemainingBuildTime(); int w = u->getType().tileWidth() * 32; int h = u->getType().tileHeight() * 32; //Start Position s = Position(u->getPosition().x - w/2, u->getPosition().y - 4); //End Position e = Position(s.x + w, s.y + 8); //Progress int prg = (int)((double)done / (double)total * w); Position p = Position(s.x + prg, s.y + 8); Broodwar->drawBoxMap(s.x, s.y, e.x, e.y, Colors::Blue,false); Broodwar->drawBoxMap(s.x, s.y, p.x, p.y, Colors::Blue,true); } } } }
23.761329
179
0.640305
andertavares
a6d798c6fb715eba650afabe3cac2f422078818c
497
cpp
C++
StudyBookCXXPrimer/chapters16/p16.61/main.cpp
MDGSF/CppPractice
96d7f05031ebd5f4616c3ccee2a5ab3f51b986d2
[ "MIT" ]
null
null
null
StudyBookCXXPrimer/chapters16/p16.61/main.cpp
MDGSF/CppPractice
96d7f05031ebd5f4616c3ccee2a5ab3f51b986d2
[ "MIT" ]
null
null
null
StudyBookCXXPrimer/chapters16/p16.61/main.cpp
MDGSF/CppPractice
96d7f05031ebd5f4616c3ccee2a5ab3f51b986d2
[ "MIT" ]
null
null
null
#include <iostream> #include <memory> // 声明 template <typename T, typename... Args> std::shared_ptr<T> my_make_shared(Args&&...); // 定义 template <typename T, typename... Args> inline std::shared_ptr<T> my_make_shared(Args&&... args) { std::shared_ptr<T> ret( new T(std::forward<Args>(args)...) ); return ret; } int main() { auto p = my_make_shared<int>(42); std::cout << *p << std::endl; auto p2 = my_make_shared<std::string>(10, 'c'); std::cout << *p2 << std::endl; return 0; }
20.708333
63
0.629779
MDGSF
a6deafbd898d888a78c7b9599213462e460f7cae
9,141
cpp
C++
shmem.cpp
shawwn/node-shared-memory
dcf624444d441d5d60bc023ced745d269f090656
[ "MIT" ]
null
null
null
shmem.cpp
shawwn/node-shared-memory
dcf624444d441d5d60bc023ced745d269f090656
[ "MIT" ]
null
null
null
shmem.cpp
shawwn/node-shared-memory
dcf624444d441d5d60bc023ced745d269f090656
[ "MIT" ]
null
null
null
#define _LARGEFILE64_SOURCE #define _USE_FILE_OFFSET64 #define _USE_LARGEFILE64 #include "shmem.h" #include "util.h" #include "zmalloc.h" #include <string.h> #include <stdio.h> #include <errno.h> #include <stdarg.h> struct shmem { char* name; int64_t size; int flags; /* platform-specific. */ #if _MSC_VER #else int fd; #endif void* mapped; }; /* forward declarations. */ static bool startup( shmem* s ); static void shutdown( shmem* s ); static void handleError( shmem* s, const char* fmt, ... ); static void handleInfo( shmem* s, const char* fmt, ... ); static void handleVerbose( shmem* s, const char* fmt, ... ); static void platformUnlink( const char* name ); static bool platformStartup( shmem* s ); static void platformShutdown( shmem* s ); /*----------------------------------------------------------------------------- * Public API definitions. *----------------------------------------------------------------------------*/ void shmemUnlink( const char* formatName, ... ) { va_list ap; va_start( ap, formatName ); { char* fullname = vstrformat( formatName, ap ); handleInfo( NULL, "shmemUnlink('%s')", fullname ); platformUnlink( fullname ); strfree( fullname ); } va_end( ap ); } shmem* shmemOpen( int64_t size, int flags, const char* formatName, ... ) { shmem* s = (shmem*)zcalloc( sizeof( shmem ) ); { va_list ap; va_start( ap, formatName ); s->name = vstrformat( formatName, ap ); va_end( ap ); } s->size = size; s->flags = flags; if ( !startup( s ) ) { shmemClose( s ); return NULL; } #if 0 handleInfo( s, "opened(size=%u, flags=%d)", (unsigned int)s->size, s->flags ); #endif return s; } void shmemClose( shmem* s ) { if ( !s ) return; #if 0 handleInfo( s, "close()" ); #endif shutdown( s ); strfree( s->name ); zfree( s ); } int64_t shmemGetSize( shmem* s ) { if ( !s ) return 0; return s->size; } void* shmemGetPtr( shmem* s ) { if ( !s ) return NULL; return s->mapped; } /*----------------------------------------------------------------------------- * File-local function definitions. *----------------------------------------------------------------------------*/ static bool startup( shmem* s ) { /* validate inputs. */ { /* too short? */ if ( strlen( s->name ) <= 0 ) { handleError( s, "name too short." ); return false; } /* check for slashes in the name. */ if ( strpbrk( s->name, "/\\" ) ) { handleError( s, "name may not contain slashes." ); return false; } } /* validate flags. */ { bool mustCreate = (s->flags & SHMEM_MUST_CREATE); bool mustNotCreate = (s->flags & SHMEM_MUST_NOT_CREATE); //handleInfo( s, "mustCreate=%d mustNotCreate=%d\n", mustCreate, mustNotCreate ); if ( mustCreate || mustNotCreate ) { if ( mustCreate == mustNotCreate ) { handleError( s, "must specify either SHMEM_MUST_CREATE or SHMEM_MUST_NOT_CREATE, not both" ); return false; } } } return platformStartup( s ); } static void shutdown( shmem* s ) { platformShutdown( s ); } static int VERBOSE = 0; static void handleError( shmem* s, const char* fmt, ... ) { va_list ap; va_start( ap, fmt ); if ( s ) fprintf( stderr, "shmem('%s') error: ", s->name ); else fprintf( stderr, "shmem error: " ); vfprintf( stderr, fmt, ap ); fprintf( stderr, "\n" ); va_end( ap ); } static void handleInfo( shmem* s, const char* fmt, ... ) { if (!VERBOSE) return; va_list ap; va_start( ap, fmt ); if ( s ) fprintf( stdout, "shmem('%s') info: ", s->name ); else fprintf( stdout, "shmem info: " ); vfprintf( stdout, fmt, ap ); fprintf( stdout, "\n" ); va_end( ap ); } /*----------------------------------------------------------------------------- * Platform-specific function definitions. *----------------------------------------------------------------------------*/ #if _MSC_VER # include <windows.h> #else # include <sys/mman.h> # include <sys/types.h> # include <sys/stat.h> # include <unistd.h> # include <fcntl.h> # include <limits.h> # include <stdint.h> /* extern int ftruncate64( int fd, off_t length ); */ #define ftruncate64 ftruncate #endif #if _MSC_VER #error "TODO" #else static void platformUnlink( const char* name ) { char* fullname = strformat( "/%s", name ); shm_unlink( fullname ); strfree( fullname ); } static bool platformStartup( shmem* s ) { bool mustCreate = (s->flags & SHMEM_MUST_CREATE); bool mustNotCreate = (s->flags & SHMEM_MUST_NOT_CREATE); int shmFlags; int shmMode; int protFlags; /* build the flags. */ { shmFlags = 0; if ( mustCreate ) { shmFlags = ( O_RDWR | O_CREAT | O_EXCL ); } else if ( mustNotCreate ) { shmFlags = ( O_RDWR ); } else { shmFlags = ( O_RDWR | O_CREAT ); } } /* build the mode. */ { shmMode = ( S_IRUSR | S_IWUSR ); } /* build the protection flags. */ { protFlags = ( PROT_READ | PROT_WRITE ); } /* open the shared memory segment. */ { char* fullname = strformat( "/%s", s->name ); s->fd = shm_open( fullname, shmFlags, shmMode ); strfree( fullname ); if ( s->fd < 0 ) { handleError( s, "shm_open() error: %s", strerror(errno) ); return false; } } /* get info for the shared memory. */ { struct stat64 info; int ret; ret = fstat64( s->fd, &info ); if ( ret < 0 ) { handleError( s, "fstat64() error: %s", strerror(errno) ); return false; } /* handleInfo(s, "(before) info.st_blksize=%lld, s->size=%lld, info.st_size=%lld\n", info.st_blksize, s->size, info.st_size); */ /* // if memory has already been mapped, and we're not requesting */ /* // more than that, use it. */ /* if ( info.st_blksize > s->size ) { */ /* s->size = info.st_blksize; */ /* } */ // if we're requesting more than the available storage, trim // the size. /* if ( s->size > info.st_size ) { */ /* s->size = info.st_size; */ /* } */ // if we don't care how much to allocate, use whatever's available. /* if ( s->size < 0 ) { */ /* s->size = info.st_size; */ /* } */ /* resize the shared memory. */ if ( info.st_size <= 0 ) { int ret; // EDIT: Can't resize on OSX; realloc for now. // https://stackoverflow.com/questions/25502229/ftruncate-not-working-on-posix-shared-memory-in-mac-os-x if ( s->size > 0 ) { int unlinked = 0; again: char* fullname = strformat( "/%s", s->name ); s->fd = shm_open( fullname, shmFlags, shmMode ); strfree( fullname ); ret = ftruncate64( s->fd, s->size ); if ( ret < 0 ) { handleError( s, "ftruncate64(%d, %d) error: %s", s->fd, s->size, strerror(errno) ); if (unlinked) { return false; } else { unlinked = 1; goto again; } } } } } { struct stat64 info; int ret; ret = fstat64( s->fd, &info ); if ( ret < 0 ) { handleError( s, "fstat64() error: %s", strerror(errno) ); return false; } handleInfo(s, "(after) info.st_blksize=%lld, s->size=%lld, info.st_size=%lld\n", info.st_blksize, s->size, info.st_size); /* map the shared memory. */ if ( s->size > 0 ) { handleInfo( s, "mmap( NULL, %d, %d, MAP_SHARED, fd=%d )\n", s->size, protFlags, s->fd ); s->mapped = mmap( NULL, s->size, protFlags, MAP_SHARED, s->fd, 0 ); if ( s->mapped == MAP_FAILED ) { handleError( s, "mmap( NULL, %d, %d, MAP_SHARED, fd=%d ) error: %s", s->size, protFlags, s->fd, strerror(errno) ); s->fd = -1; return false; } } else { handleError( s, "s->size was zero" ); s->fd = -1; return false; } } return true; } static void platformShutdown( shmem* s ) { /* unmap the memory. */ if ( s->mapped ) { munmap( s->mapped, s->size ); s->mapped = NULL; } /* close the shared memory segment. */ if ( s->fd >= 0 ) { close( s->fd ); s->fd = -1; } } #endif /* !_MSC_VER */
24.18254
130
0.480363
shawwn
a6dee0dbf1fac1d4e4a8c8bd64759b178250ccbb
1,824
cpp
C++
source/tests.cpp
MarianFriedrich/3_programmiersprachen-blatt
0bd4087b29fa628a7e9ff0a0f489402b08685bd1
[ "MIT" ]
null
null
null
source/tests.cpp
MarianFriedrich/3_programmiersprachen-blatt
0bd4087b29fa628a7e9ff0a0f489402b08685bd1
[ "MIT" ]
null
null
null
source/tests.cpp
MarianFriedrich/3_programmiersprachen-blatt
0bd4087b29fa628a7e9ff0a0f489402b08685bd1
[ "MIT" ]
null
null
null
#define CATCH_CONFIG_RUNNER #include <catch.hpp> #include <list> #include <cstdlib> #include "circle.hpp" // Circle Operatoren TEST_CASE("describe_circle_operator_same","[circle_operator_same]") { Circle test1{{0,0},5,{0.0,0.0,0.0}}; Circle test2{{0,0},5,{0.0,0.0,0.0}}; REQUIRE(test1 == test2); } TEST_CASE("describe_circle_operator_smaller","[circle_operator_smaller]") { Circle test1{{0,0},5,{0.0,0.0,0.0}}; Circle test2{{0,0},10,{0.0,0.0,0.0}}; REQUIRE(test1 < test2); } TEST_CASE("describe_circle_operator_bigger","[circle_operator_bigger]") { Circle test1{{0,0},10,{0.0,0.0,0.0}}; Circle test2{{0,0},5,{0.0,0.0,0.0}}; REQUIRE(test1 > test2); } // Circle sortieren in Liste TEST_CASE("describe_circle_sort","[circle_sort]") { std::list <Circle> liste; for(unsigned int i = 0; i < 100; ++i){ liste.push_back(Circle{{0.0,0.0},(std::rand() % 100 + 1.0f),{0.0,0.0,0.0}}); } liste.sort(); REQUIRE(std::is_sorted(liste.begin(), liste.end())); } // Sort with lamda TEST_CASE("describe_lamda_sort","[lambda_sort]") { std::vector <Circle> vec; for(unsigned int i = 0; i < 100; ++i){ vec.push_back(Circle{{0.0,0.0},(std::rand() % 100 + 1.0f),{0.0,0.0,0.0}}); } auto comp = [](const Circle& c1,const Circle& c2) -> bool{return c1 < c2;}; std::sort(vec.begin(),vec.end(),comp); REQUIRE(std::is_sorted(vec.begin(), vec.end())); } // Elementweises aufaddieren TEST_CASE("describe_addieren","[addieren]") { std::vector<int> v1{1,2,3,4,5,6,7,8,9}; std::vector<int> v2{9,8,7,6,5,4,3,2,1}; std::vector<int> v3(9); //cpp-reference(td::plus) std::transform (v1.begin(), v1.end(), v2.begin(), v3.begin(), std::plus<int>()); //cpp-reference(std::all_of) REQUIRE(std::all_of(v3.begin(), v3.end(), [](int i){return i==10;})); } int main(int argc, char *argv[]) { return Catch::Session().run(argc, argv); }
28.061538
81
0.64693
MarianFriedrich
a6e168ffa3f2e4d0af9106ebf3f99089d0e2af7f
5,215
hxx
C++
Projects/7.SmartBuilding/smartbuilding_server/inc/inl/thread.hxx
NatanMeirov/ExperisAcademyBootcamp
6608ef5571e6dc4eb1f481695da3476ecd4f7547
[ "MIT" ]
null
null
null
Projects/7.SmartBuilding/smartbuilding_server/inc/inl/thread.hxx
NatanMeirov/ExperisAcademyBootcamp
6608ef5571e6dc4eb1f481695da3476ecd4f7547
[ "MIT" ]
null
null
null
Projects/7.SmartBuilding/smartbuilding_server/inc/inl/thread.hxx
NatanMeirov/ExperisAcademyBootcamp
6608ef5571e6dc4eb1f481695da3476ecd4f7547
[ "MIT" ]
null
null
null
#ifndef NM_THREAD_HXX #define NM_THREAD_HXX #include <cstddef> // size_t #include <memory> // std:shared_ptr #include <exception> // std::current_exception #include <pthread.h> #include <cxxabi.h> // abi::__forced_unwind #include "icallable.hpp" namespace advcpp { template <typename DestructionPolicy> void* Thread<DestructionPolicy>::Task(void* a_this) { Thread<DestructionPolicy>* self = static_cast<Thread<DestructionPolicy>*>(a_this); std::shared_ptr<ICallable> task = self->m_task; // task: ++ref_count std::shared_ptr<SyncHandler> syncHandler = self->m_syncHandler; // syncHandler: ++ref_count (now even if the thread destroys - the SyncHandler would not be destroyed) self->m_barrier.Wait(); // The Thread's c'tor can done by now (we already saved the shared_ptrs' ref count, and it should be atleast 1 [both]) // Exception safety: try { (*task)(); } catch(const abi::__forced_unwind& ex) { syncHandler->Signal(); // Post throw; // MUST rethrow the stack unwinding handler exception - to handle the destruction of the thread's stack variables on a cancelation } catch(...) { syncHandler->SetException(std::current_exception()); } syncHandler->Signal(); // Post return nullptr; } template <typename DestructionPolicy> Thread<DestructionPolicy>::Thread(std::shared_ptr<ICallable> a_task, DestructionPolicy a_destructionPolicy) : m_task(a_task) , m_destructionPolicy(a_destructionPolicy) , m_barrier(Thread::BARRIER_COUNT) , m_syncHandler(new SyncHandler()) , m_threadID() , m_isAvailableThread(true) , m_hasCanceledThread(false) , m_hasStartedOperation(false) { int statusCode = pthread_create(&m_threadID, nullptr, Thread::Task, this); if(statusCode < 0) { throw std::runtime_error("Failed while tried to create a thread"); } m_barrier.Wait(); // To handle the race condition (the Thread Object will not be destructed that way, and will still be alive even if it should be destructed before the execution of Task) } template <typename DestructionPolicy> Thread<DestructionPolicy>::~Thread() { m_destructionPolicy(*this); } template <typename DestructionPolicy> void Thread<DestructionPolicy>::Join() { if(m_isAvailableThread.Check() && !m_hasCanceledThread.Check()) { if(m_hasStartedOperation.SetIf(false, true)) { int statusCode = CallJoin(); if(statusCode != 0) { throw std::runtime_error("Failed while tried to join a thread"); } m_isAvailableThread.False(); m_hasStartedOperation.SetIf(true, false); } } else { throw std::runtime_error("Thread had been detached/joined/canceled already"); } } template <typename DestructionPolicy> void Thread<DestructionPolicy>::Detach() { if(m_isAvailableThread.Check() && !m_hasCanceledThread.Check()) { if(m_hasStartedOperation.SetIf(false, true)) { int statusCode = CallDetach(); if(statusCode != 0) { throw std::runtime_error("Failed while tried to detach a thread"); } m_isAvailableThread.False(); m_hasStartedOperation.SetIf(true, false); } } else { throw std::runtime_error("Thread had been detached/joined/canceled already"); } } template <typename DestructionPolicy> void Thread<DestructionPolicy>::Cancel(bool a_ensureCompleteCancelation) { int statusCode = CallCancel(); if(statusCode != 0) { throw std::runtime_error("Failed while tried to cancel a thread (maybe the thread had finished already)"); } m_hasCanceledThread.True(); if(a_ensureCompleteCancelation) { CallJoin(); // pthread_join after cancel would provide a PTHREAD_CANCELED } } template <typename DestructionPolicy> bool Thread<DestructionPolicy>::HasDone() { return m_syncHandler->Check(); } template <typename DestructionPolicy> int Thread<DestructionPolicy>::CallJoin() { return pthread_join(m_threadID, nullptr); } template <typename DestructionPolicy> int Thread<DestructionPolicy>::CallDetach() { return pthread_detach(m_threadID); } template <typename DestructionPolicy> int Thread<DestructionPolicy>::CallCancel() { return pthread_cancel(m_threadID); } template <typename DestructionPolicy> int Thread<DestructionPolicy>::ConditionalJoin() { return (m_isAvailableThread.Check()) ? CallJoin() : 0; } template <typename DestructionPolicy> int Thread<DestructionPolicy>::ConditionalDetach() { return (m_isAvailableThread.Check()) ? CallDetach() : 0; } template <typename DestructionPolicy> int Thread<DestructionPolicy>::ConditionalCancel(bool a_ensureCompleteCancelation) { if(!m_hasCanceledThread.Check()) { return (a_ensureCompleteCancelation) ? CompleteCancel() : CallCancel(); } return 0; } template <typename DestructionPolicy> int Thread<DestructionPolicy>::CompleteCancel() { int cancelStatus = CallCancel(); int joinStatus = CallJoin(); return cancelStatus && joinStatus; } } // advcpp #endif // NM_THREAD_HXX
25.072115
191
0.691659
NatanMeirov
a6e2a2806d8ee5c1a94caab136a98daab2f282e4
883
cpp
C++
src/tests/test-datetime.cpp
cshnick/liteSql_custom_generator
31f81ab13b689616672ab45805c3ffdfab3a1057
[ "BSD-3-Clause" ]
11
2017-04-19T03:01:13.000Z
2020-08-03T05:21:31.000Z
src/tests/test-datetime.cpp
cshnick/liteSql_custom_generator
31f81ab13b689616672ab45805c3ffdfab3a1057
[ "BSD-3-Clause" ]
14
2016-05-24T00:20:42.000Z
2019-02-11T18:36:36.000Z
src/tests/test-datetime.cpp
cshnick/liteSql_custom_generator
31f81ab13b689616672ab45805c3ffdfab3a1057
[ "BSD-3-Clause" ]
4
2017-04-03T08:03:11.000Z
2019-08-20T04:48:50.000Z
/* LiteSQL - test-datetime * * The list of contributors at http://litesql.sf.net/ * * See LICENSE for copyright information. */ #include <assert.h> #include "litesql/datetime.hpp" /* Datetime unit tester TC1: test for equality on load/ save (see ticket #13) */ using namespace litesql; int main(int argc, char *argv[]) { // TC1 for DateTime DateTime dt; std::string dtstring = dt.asString(); DateTime dt2 = convert<const string&, DateTime>(dtstring); assert(dt.timeStamp() == dt2.timeStamp()); // TC1 for Date Date d; std::string dstring = d.asString(); Date d2 = convert<const string&, Date>(dstring); assert(d.timeStamp() == d2.timeStamp()); // TC1 for Time Time t; std::string tstring = t.asString(); Time t2 = convert<const string&, Time>(tstring); assert(t.secs() == t2.secs()); return 0; }
19.195652
61
0.629672
cshnick
a6e2d9423376abcc324028e622ac725301c75476
873
cpp
C++
Olympiad Solutions/DMOJ/ioi10p6.cpp
Ashwanigupta9125/code-DS-ALGO
49f6cf7d0c682da669db23619aef3f80697b352b
[ "MIT" ]
36
2019-12-27T08:23:08.000Z
2022-01-24T20:35:47.000Z
Olympiad Solutions/DMOJ/ioi10p6.cpp
Ashwanigupta9125/code-DS-ALGO
49f6cf7d0c682da669db23619aef3f80697b352b
[ "MIT" ]
10
2019-11-13T02:55:18.000Z
2021-10-13T23:28:09.000Z
Olympiad Solutions/DMOJ/ioi10p6.cpp
Ashwanigupta9125/code-DS-ALGO
49f6cf7d0c682da669db23619aef3f80697b352b
[ "MIT" ]
53
2020-08-15T11:08:40.000Z
2021-10-09T15:51:38.000Z
// Ivan Carvalho // Solution to https://dmoj.ca/problem/ioi10p6 #include <cstdio> #include <vector> #include <algorithm> using namespace std; typedef long long ll; const ll MAXN = 1e6 + 10; vector<ll> grafo[MAXN]; ll tam[MAXN],soma,maior[MAXN],n,num[MAXN],resp,vertice,total; void dfs(ll v,ll p){ tam[v] = num[v]; for(ll u : grafo[v]){ if(u != p){ dfs(u,v); tam[v] += tam[u]; maior[v] = max(maior[v],tam[u]); } } maior[v] = max(maior[v],total - tam[v]); } int LocateCentre(int N,int P[],int S[],int D[]){ n = N; for(ll i=0;i<n;i++){ num[i] = P[i]; total += num[i]; } for(ll i=0;i+1<n;i++){ ll u,v; u = S[i]; v = D[i]; grafo[u].push_back(v); grafo[v].push_back(u); } dfs(0,-1); resp = maior[0]; for(ll i=1;i<n;i++){ if(maior[i] < resp){ resp = maior[i]; vertice = i; } } return (int)vertice; } int main(){ return 0; }
17.816327
61
0.562428
Ashwanigupta9125
a6e422508141ebac8748f387c343b07046835c8b
18
cpp
C++
Gear/src/grpch.cpp
GearEngine/GearEngine
fa5ed49ca6289a215799a7b84ece1241eb33bd36
[ "Apache-2.0" ]
3
2020-03-05T06:56:51.000Z
2020-03-12T09:36:20.000Z
Gear/src/grpch.cpp
GearEngine/GearEngine
fa5ed49ca6289a215799a7b84ece1241eb33bd36
[ "Apache-2.0" ]
2
2020-03-05T15:40:28.000Z
2020-03-11T16:04:44.000Z
Gear/src/grpch.cpp
GearEngine/GearEngine
fa5ed49ca6289a215799a7b84ece1241eb33bd36
[ "Apache-2.0" ]
null
null
null
#include "grpch.h"
18
18
0.722222
GearEngine
a6e4335cee2c7c8f2861130b1e96a7ea0097a991
3,025
cpp
C++
Examples/Cpp/source/IMAP/SupportIMAPIdleCommand.cpp
kashifiqb/Aspose.Email-for-C
96684cb6ed9f4e321a00c74ca219440baaef8ba8
[ "MIT" ]
4
2019-12-01T16:19:12.000Z
2022-03-28T18:51:42.000Z
Examples/Cpp/source/IMAP/SupportIMAPIdleCommand.cpp
kashifiqb/Aspose.Email-for-C
96684cb6ed9f4e321a00c74ca219440baaef8ba8
[ "MIT" ]
1
2022-02-15T01:02:15.000Z
2022-02-15T01:02:15.000Z
Examples/Cpp/source/IMAP/SupportIMAPIdleCommand.cpp
kashifiqb/Aspose.Email-for-C
96684cb6ed9f4e321a00c74ca219440baaef8ba8
[ "MIT" ]
5
2017-09-27T14:43:20.000Z
2021-11-16T06:47:11.000Z
/* This project uses Automatic Package Restore feature of NuGet to resolve Aspose.Email for .NET API reference when the project is build. Please check https://Docs.nuget.org/consume/nuget-faq for more information. If you do not wish to use NuGet, you can manually download Aspose.Email for .NET API from https://www.nuget.org/packages/Aspose.Email/, install it and then add its reference to this project. For any issues, questions or suggestions please feel free to contact us using https://forum.aspose.com/c/email */ #include <system/threading/thread.h> #include <system/threading/manual_reset_event.h> #include <system/shared_ptr.h> #include <system/object.h> #include <system/guid.h> #include <system/console.h> #include <system/array.h> #include <MailMessage.h> #include <functional> #include <cstdint> #include <Clients/Smtp/SmtpClient/SmtpClient.h> #include <Clients/Imap/ImapMonitoringEventArgs.h> #include <Clients/Imap/ImapMessageInfo.h> #include <Clients/Imap/ImapClient/ImapClient.h> #include "Examples.h" using namespace Aspose::Email::Clients::Imap; using namespace Aspose::Email::Clients::Smtp; using namespace Aspose::Email; void SupportIMAPIdleCommand() { // ExStart:SupportIMAPIdleCommand // Connect and log in to IMAP System::SharedPtr<ImapClient> client = System::MakeObject<ImapClient>(u"imap.domain.com", u"username", u"password"); System::SharedPtr<System::Threading::ManualResetEvent> manualResetEvent = System::MakeObject<System::Threading::ManualResetEvent>(false); System::SharedPtr<ImapMonitoringEventArgs> eventArgs; // CSPORTCPP: [WARNING] Using local variables. Make sure that local function ptr does not leave the current scope. std::function<void(System::SharedPtr<System::Object> sender, System::SharedPtr<Clients::Imap::ImapMonitoringEventArgs> e)> _local_func_0 = [&eventArgs, &manualResetEvent](System::SharedPtr<System::Object> sender, System::SharedPtr<Clients::Imap::ImapMonitoringEventArgs> e) { eventArgs = e; manualResetEvent->Set(); }; client->StartMonitoring(_local_func_0); System::Threading::Thread::Sleep(2000); System::SharedPtr<SmtpClient> smtpClient = System::MakeObject<SmtpClient>(u"exchange.aspose.com", u"username", u"password"); smtpClient->Send(System::MakeObject<MailMessage>(u"from@aspose.com", u"to@aspose.com", System::String(u"EMAILNET-34875 - ") + System::Guid::NewGuid(), u"EMAILNET-34875 Support for IMAP idle command")); manualResetEvent->WaitOne(10000); manualResetEvent->Reset(); System::Console::WriteLine(eventArgs->get_NewMessages()->get_Length()); System::Console::WriteLine(eventArgs->get_DeletedMessages()->get_Length()); client->StopMonitoring(u"Inbox"); smtpClient->Send(System::MakeObject<MailMessage>(u"from@aspose.com", u"to@aspose.com", System::String(u"EMAILNET-34875 - ") + System::Guid::NewGuid(), u"EMAILNET-34875 Support for IMAP idle command")); manualResetEvent->WaitOne(5000); // ExEnd:SupportIMAPIdleCommand }
50.416667
277
0.749421
kashifiqb
a6e4ba642814a30f44103539de9f6b48663fd03d
3,118
cpp
C++
FireCube/Audio/Sound.cpp
ashleygwinnell/firecube
ea6bec6bab98d922dce76610a739beb5f7f88b61
[ "MIT" ]
1
2020-03-31T20:41:48.000Z
2020-03-31T20:41:48.000Z
FireCube/Audio/Sound.cpp
ashleygwinnell/firecube
ea6bec6bab98d922dce76610a739beb5f7f88b61
[ "MIT" ]
null
null
null
FireCube/Audio/Sound.cpp
ashleygwinnell/firecube
ea6bec6bab98d922dce76610a739beb5f7f88b61
[ "MIT" ]
null
null
null
#include <fstream> #include <SDL.h> #include "Audio/Sound.h" #include "Utils/Logger.h" #include "Utils/Filesystem.h" #include "OggVorbisSoundDecoder.h" #define STB_VORBIS_HEADER_ONLY #include "ThirdParty/STB/stb_vorbis.c" using namespace FireCube; Sound::Sound(Engine *engine) : Resource(engine) { } bool Sound::Load(const std::string &filename) { std::string resolvedFileName = Filesystem::FindResourceByName(filename); if (resolvedFileName.empty()) return false; std::string ext = Filesystem::GetFileExtension(filename); if (ext == "wav") { return LoadWav(resolvedFileName); } else if (ext == "ogg") { return LoadOggVorbis(resolvedFileName); } return false; } bool Sound::LoadWav(const std::string &filename) { needsDecoding = false; SDL_AudioSpec desired, *obtained; Uint32 wavLength; Uint8 *wavBuffer; SDL_zero(desired); desired.freq = 44100; desired.format = AUDIO_S16; desired.channels = 2; // Load the WAV if ((obtained = SDL_LoadWAV(filename.c_str(), &desired, &wavBuffer, &wavLength)) == nullptr) { LOGERROR("Could not open wav file: ", SDL_GetError()); return false; } frequency = obtained->freq; stereo = obtained->channels == 2; sixteenBit = (obtained->format == AUDIO_S16) || (obtained->format == AUDIO_U16); data.resize(wavLength); for (unsigned int i = 0; i < wavLength; ++i) { data[i] = wavBuffer[i]; } end = data.data() + data.size(); SDL_FreeWAV(wavBuffer); return true; } bool Sound::LoadOggVorbis(const std::string &filename) { std::ifstream file(filename, std::ios::binary); file.seekg(0, std::ios_base::end); std::streampos fileSize = file.tellg(); data.resize((unsigned int) fileSize); file.seekg(0, std::ios_base::beg); file.read(data.data(), fileSize); int error; stb_vorbis *decoder = stb_vorbis_open_memory((unsigned char*)data.data(), data.size(), &error, nullptr); if (!decoder) { return false; } stb_vorbis_info info = stb_vorbis_get_info(decoder); frequency = info.sample_rate; stereo = info.channels > 1; stb_vorbis_close(decoder); sixteenBit = true; needsDecoding = true; return true; } unsigned int Sound::GetFrequency() const { return frequency; } void Sound::SetFrequency(unsigned int frequency) { this->frequency = frequency; } bool Sound::IsSixteenBit() const { return sixteenBit; } void Sound::SetSixteenBit(bool sixteenBit) { this->sixteenBit = sixteenBit; } bool Sound::IsStereo() const { return stereo; } void Sound::SetStereo(bool stereo) { this->stereo = stereo; } char *Sound::GetStart() { return data.data(); } char *Sound::GetEnd() { return end; } unsigned int Sound::GetSampleSize() const { unsigned size = 1; if (sixteenBit) size <<= 1; if (stereo) size <<= 1; return size; } void Sound::SetSize(unsigned int size) { data.resize(size); end = data.data() + size; } bool Sound::NeedsDecoding() const { return needsDecoding; } unsigned int Sound::GetSize() const { return data.size(); } SharedPtr<SoundDecoder> Sound::GetSoundDecoder() { if (needsDecoding) { return new OggVorbisSoundDecoder(this); } else { return SharedPtr<SoundDecoder>(); } }
17.91954
105
0.702373
ashleygwinnell
a6ec95078cdd6a6eb6ffdf181bf90086478bbe17
1,146
cpp
C++
src/searchparameters.cpp
nemishkor/harbour-otpusk
225fa040426a654249ba45e33efe3f169911fc14
[ "MIT" ]
null
null
null
src/searchparameters.cpp
nemishkor/harbour-otpusk
225fa040426a654249ba45e33efe3f169911fc14
[ "MIT" ]
null
null
null
src/searchparameters.cpp
nemishkor/harbour-otpusk
225fa040426a654249ba45e33efe3f169911fc14
[ "MIT" ]
null
null
null
#include "searchparameters.h" SearchParameters::SearchParameters(QObject *parent) : QObject(parent) { } int SearchParameters::getLocationId() const { return locationId; } int SearchParameters::getFromCityId() const { return fromCityId; } QString SearchParameters::getStartDate() const { return startDate; } QString SearchParameters::getEndDate() const { return endDate; } int SearchParameters::getLength() const { return length; } int SearchParameters::getAdults() const { return adults; } QStringList SearchParameters::getChildren() const { return children; } void SearchParameters::setLocationId(int value) { locationId = value; } void SearchParameters::setFromCityId(int value) { fromCityId = value; } void SearchParameters::setStartDate(const QString &value) { startDate = value; } void SearchParameters::setEndDate(const QString &value) { endDate = value; } void SearchParameters::setLength(int value) { length = value; } void SearchParameters::setAdults(int value) { adults = value; } void SearchParameters::setChildren(const QStringList &value) { children = value; }
14.883117
69
0.729494
nemishkor
a6f04893187e9082b96f40c22f27ab7029a6b0e5
5,081
hpp
C++
sampml/sampml/random_forest.hpp
YashasSamaga/sampml
dc84110b53b120caeeb4c0234fcfd6ab16793c59
[ "MIT" ]
12
2018-12-01T18:30:32.000Z
2021-12-08T21:53:36.000Z
sampml/sampml/random_forest.hpp
YashasSamaga/sampml
dc84110b53b120caeeb4c0234fcfd6ab16793c59
[ "MIT" ]
2
2019-08-21T17:52:59.000Z
2022-01-17T03:28:11.000Z
sampml/sampml/random_forest.hpp
YashasSamaga/sampml
dc84110b53b120caeeb4c0234fcfd6ab16793c59
[ "MIT" ]
3
2020-09-04T14:53:46.000Z
2022-03-18T17:53:33.000Z
#include <cassert> #include <dlib/random_forest.h> #include <dlib/global_optimization.h> #include "common.hpp" #include "data.hpp" namespace SAMPML_NAMESPACE { namespace trainer { template <class sample_type> class random_forest { public: random_forest() { } template <class SamplesContainer, class LabelsContainer> void set_samples(const SamplesContainer& _samples, const LabelsContainer& _labels) { samples.clear(); samples.insert(samples.end(), _samples.cbegin(), _samples.cend()); labels.clear(); labels.insert(labels.end(), _labels.end(), _labels.size()); } template <class SamplesContainer> void set_samples(const SamplesContainer& positives, const SamplesContainer& negatives) { static_assert(std::is_same<typename SamplesContainer::value_type, sample_type>()); samples.clear(); samples.insert(samples.end(), positives.cbegin(), positives.cend()); samples.insert(samples.end(), negatives.cbegin(), negatives.cend()); labels.clear(); labels.insert(labels.end(), positives.size(), 1.0); labels.insert(labels.end(), negatives.size(), 0.0); } void cross_validate(double min_trees = 10, double max_trees = 1000, double min_frac = 0.9, double max_frac = 1.0, double min_min_per_leaf = 5, double max_min_per_leaf = 50, int folds = 10, int max_function_calls = 50) { if(samples.size() == 0) { throw bad_input("Bad Input: no samples were provided for training"); } assert(labels.size() == samples.size()); dlib::vector_normalizer<sample_type> normalizer; normalizer.train(samples); for(auto& vector : samples) vector = normalizer(vector); dlib::randomize_samples(samples, labels); auto cross_validation_score = [this, folds](int trees, double subsample_frac, int min_sampels_per_leaf) { dlib::random_forest_regression_trainer<dlib::dense_feature_extractor> trainer; trainer.set_num_trees(trees); trainer.set_feature_subsampling_fraction(subsample_frac); trainer.set_min_samples_per_leaf(min_sampels_per_leaf); dlib::matrix<double> result = dlib::cross_validate_regression_trainer(trainer, this->samples, this->labels, folds); std::cout << "trees: " << trees << ", cross validation accuracy: " << result << '\n'; return result(0); }; auto result = dlib::find_min_global(dlib::default_thread_pool(), cross_validation_score, {min_trees, min_frac, min_min_per_leaf}, {max_trees, max_frac, max_min_per_leaf}, dlib::max_function_calls(max_function_calls)); best_num_trees = result.x(0); best_subsample_fraction = result.x(1); best_min_samples_per_leaf = result.x(2); std::cout << result.x << '\n'; } void train () { dlib::random_forest_regression_trainer<feature_extractor_type> trainer; trainer.set_num_trees(best_num_trees); trainer.set_feature_subsampling_fraction(best_subsample_fraction); trainer.set_min_samples_per_leaf(best_min_samples_per_leaf); classifier = trainer.train(samples, labels, oobs); } void serialize(std::string classifier) { dlib::serialize(classifier) << this->classifier; } void deserialize(std::string classifier) { dlib::deserialize(classifier) >> this->classifier; } double test(const sample_type& sample) { return classifier(sample); } protected: std::vector<dlib::matrix<double, 0, 1>> samples; std::vector<double> labels; std::vector<double> oobs; using feature_extractor_type = dlib::dense_feature_extractor; using decision_funct_type = dlib::random_forest_regression_function<feature_extractor_type>; //using normalized_decision_funct_type = dlib::normalized_function<decision_funct_type>; decision_funct_type classifier; double best_num_trees = 100; double best_subsample_fraction = 0.25; double best_min_samples_per_leaf = 5; }; } }
44.570175
135
0.550679
YashasSamaga
a6f57fdc05ee6ccd28ebb735663ca9077fea5bbb
321
cpp
C++
cpp/cpp-introduction/c-tutorial-basic-data-types.cpp
th3c0d3br34ker/hackerrank-solutions
c61e987cbb359fd27e41051c39ffd7f377f0c5f2
[ "MIT" ]
1
2020-08-04T18:31:24.000Z
2020-08-04T18:31:24.000Z
cpp/cpp-introduction/c-tutorial-basic-data-types.cpp
th3c0d3br34ker/hackerrank-solutions
c61e987cbb359fd27e41051c39ffd7f377f0c5f2
[ "MIT" ]
null
null
null
cpp/cpp-introduction/c-tutorial-basic-data-types.cpp
th3c0d3br34ker/hackerrank-solutions
c61e987cbb359fd27e41051c39ffd7f377f0c5f2
[ "MIT" ]
null
null
null
#include <iostream> #include <cstdio> using namespace std; int main() { int a; long b; char c; float d; double e; scanf("%d %ld %c %f %lf", &a, &b, &c, &d, &e); printf("%d\n", a); printf("%ld\n", b); printf("%c\n", c); printf("%f\n", d); printf("%lf", e); return 0; }
13.956522
50
0.464174
th3c0d3br34ker
a6fb7419f48c6292d2989cde3c96e655af968985
24,270
cpp
C++
com/netfx/src/clr/jit/ia64/utils.cpp
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
com/netfx/src/clr/jit/ia64/utils.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
com/netfx/src/clr/jit/ia64/utils.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XX XX Utils.cpp XX XX XX XX Has miscellaneous utility functions XX XX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ #include "jitpch.h" #pragma hdrstop #include "opcode.h" #ifndef NOT_JITC STDAPI CoInitializeEE(DWORD fFlags) { return(ERROR_SUCCESS); } STDAPI_(void) CoUninitializeEE(BOOL fFlags) {} #endif extern signed char opcodeSizes[] = { #define InlineNone_size 0 #define ShortInlineVar_size 1 #define InlineVar_size 2 #define ShortInlineI_size 1 #define InlineI_size 4 #define InlineI8_size 8 #define ShortInlineR_size 4 #define InlineR_size 8 #define ShortInlineBrTarget_size 1 #define InlineBrTarget_size 4 #define InlineMethod_size 4 #define InlineField_size 4 #define InlineType_size 4 #define InlineString_size 4 #define InlineSig_size 4 #define InlineRVA_size 4 #define InlineTok_size 4 #define InlineSwitch_size 0 // for now #define InlinePhi_size 0 // for now #define InlineVarTok_size 0 // remove #define OPDEF(name,string,pop,push,oprType,opcType,l,s1,s2,ctrl) oprType ## _size , #include "opcode.def" #undef OPDEF #undef InlineNone_size #undef ShortInlineVar_size #undef InlineVar_size #undef ShortInlineI_size #undef InlineI_size #undef InlineI8_size #undef ShortInlineR_size #undef InlineR_size #undef ShortInlineBrTarget_size #undef InlineBrTarget_size #undef InlineMethod_size #undef InlineField_size #undef InlineType_size #undef InlineString_size #undef InlineSig_size #undef InlineRVA_size #undef InlineTok_size #undef InlineSwitch_size #undef InlinePhi_size }; #if COUNT_OPCODES || defined(DEBUG) extern const char * opcodeNames[] = { #define OPDEF(name,string,pop,push,oprType,opcType,l,s1,s2,ctrl) string, #include "opcode.def" #undef OPDEF }; #endif #ifdef DUMPER extern BYTE opcodeArgKinds[] = { #define OPDEF(name,string,pop,push,oprType,opcType,l,s1,s2,ctrl) (BYTE) oprType, #include "opcode.def" #undef OPDEF }; #endif BYTE varTypeClassification[] = { #define DEF_TP(tn,nm,jitType,sz,sze,asze,st,al,tf,howUsed) tf, #include "typelist.h" #undef DEF_TP }; /*****************************************************************************/ const char * varTypeName(var_types vt) { static const char * varTypeNames[] = { #define DEF_TP(tn,nm,jitType,sz,sze,asze,st,al,tf,howUsed) nm, #include "typelist.h" #undef DEF_TP }; assert(vt < sizeof(varTypeNames)/sizeof(varTypeNames[0])); return varTypeNames[vt]; } /*****************************************************************************/ #ifndef NOT_JITC /***************************************************************************** * * Skip the mangled type at 'str'. */ const char * genSkipTypeString(const char *str) { AGAIN: switch (*str++) { case '[': if (*str >= '0' && *str <= '9') { assert(!"ISSUE: skip array dimension (is this ever present, anyway?)"); } goto AGAIN; case 'L': while (*str != ';') str++; str++; break; default: break; } return str; } /***************************************************************************** * * Return the TYP_XXX value equivalent of a constant pool type string. */ var_types genVtypOfTypeString(const char *str) { switch (*str) { case 'B': return TYP_BYTE ; case 'C': return TYP_CHAR ; case 'D': return TYP_DOUBLE; case 'F': return TYP_FLOAT ; case 'I': return TYP_INT ; case 'J': return TYP_LONG ; case 'S': return TYP_SHORT ; case 'Z': return TYP_BOOL ; case 'V': return TYP_VOID ; case 'L': return TYP_REF ; case '[': return TYP_ARRAY ; case '(': return TYP_FNC ; default: assert(!"unexpected type code"); return TYP_UNDEF; } } /*****************************************************************************/ #endif //NOT_JITC /*****************************************************************************/ #ifdef DEBUG /***************************************************************************** * * Return the name of the given register. */ const char * getRegName(unsigned reg) { static const char * regNames[] = { #if TGT_x86 #define REGDEF(name, rnum, mask, byte) #name, #include "register.h" #undef REGDEF #endif #if TGT_SH3 #define REGDEF(name, strn, rnum, mask) strn, #include "regSH3.h" #undef REGDEF #endif #if TGT_IA64 #define REGDEF(name, strn) strn, #include "regIA64.h" #undef REGDEF #endif }; assert(reg < sizeof(regNames)/sizeof(regNames[0])); return regNames[reg]; } /***************************************************************************** * * Displays a register set. */ #if!TGT_IA64 void dspRegMask(regMaskTP regMask, size_t minSiz) { const char * sep = ""; printf("["); #define dspRegBit(reg,bit) \ \ if (isNonZeroRegMask(regMask & bit)) \ { \ const char * nam = getRegName(reg); \ printf("%s%s", sep, nam); \ minSiz -= (strlen(sep) + strlen(nam)); \ sep = " "; \ } #if TGT_x86 #define dspOneReg(reg) dspRegBit(REG_##reg, RBM_##reg) dspOneReg(EAX); dspOneReg(EDX); dspOneReg(ECX); dspOneReg(EBX); dspOneReg(EBP); dspOneReg(ESI); dspOneReg(EDI); #else for (unsigned reg = 0; reg < REG_COUNT; reg++) dspRegBit(reg, genRegMask((regNumber)reg)); #endif printf("]"); while ((int)minSiz > 0) { printf(" "); minSiz--; } } #endif unsigned dumpSingleILopcode(const BYTE * codeAddr, IL_OFFSET offs, const char * prefix) { const BYTE * opcodePtr = codeAddr + offs; const BYTE * startOpcodePtr = opcodePtr; if( prefix!=NULL) printf("%s", prefix); OPCODE opcode = OPCODE(getU1LittleEndian(opcodePtr)); opcodePtr += sizeof(__int8); DECODE_OPCODE: /* Get the size of additional parameters */ size_t sz = opcodeSizes [opcode]; unsigned argKind = opcodeArgKinds[opcode]; /* See what kind of an opcode we have, then */ switch (opcode) { case CEE_PREFIX1: opcode = OPCODE(getU1LittleEndian(opcodePtr) + 256); opcodePtr += sizeof(__int8); goto DECODE_OPCODE; default: { printf("%-12s ", opcodeNames[opcode]); __int64 iOp; double dOp; DWORD jOp; switch(argKind) { case InlineNone : break; case ShortInlineVar : iOp = getU1LittleEndian(opcodePtr); goto INT_OP; case ShortInlineI : iOp = getI1LittleEndian(opcodePtr); goto INT_OP; case InlineVar : iOp = getU2LittleEndian(opcodePtr); goto INT_OP; case InlineTok : case InlineMethod : case InlineField : case InlineType : case InlineString : case InlineSig : case InlineI : iOp = getI4LittleEndian(opcodePtr); goto INT_OP; case InlineI8 : iOp = getU4LittleEndian(opcodePtr); iOp |= getU4LittleEndian(opcodePtr) >> 32; goto INT_OP; INT_OP : printf("0x%X", iOp); break; case ShortInlineR : dOp = getR4LittleEndian(opcodePtr); goto FLT_OP; case InlineR : dOp = getR8LittleEndian(opcodePtr); goto FLT_OP; FLT_OP : printf("%f", dOp); break; case ShortInlineBrTarget: jOp = getI1LittleEndian(opcodePtr); goto JMP_OP; case InlineBrTarget: jOp = getI4LittleEndian(opcodePtr); goto JMP_OP; JMP_OP : printf("0x%X (abs=0x%X)", jOp, (opcodePtr - startOpcodePtr) + jOp); break; case InlineSwitch: jOp = getU4LittleEndian(opcodePtr); opcodePtr += 4; opcodePtr += jOp * 4; // Jump over the table break; case InlinePhi: jOp = getU1LittleEndian(opcodePtr); opcodePtr += 1; opcodePtr += jOp * 2; // Jump over the table break; default : assert(!"Bad argKind"); } opcodePtr += sz; break; } } printf("\n"); return opcodePtr - startOpcodePtr; } /*****************************************************************************/ #endif // DEBUG /***************************************************************************** * * Display a variable set (which may be a 32-bit or 64-bit number); only * one or two of these can be used at once. */ #ifdef DEBUG const char * genVS2str(VARSET_TP set) { static char num1[17]; static char num2[17]; static char * nump = num1; char * temp = nump; nump = (nump == num1) ? num2 : num1; #if VARSET_SZ == 32 sprintf(temp, "%08X", set); #else sprintf(temp, "%08X%08X", (int)(set >> 32), (int)set); #endif return temp; } #endif /***************************************************************************** * * Maps a variable index onto a value with the appropriate bit set. */ unsigned short genVarBitToIndex(VARSET_TP bit) { assert (genOneBitOnly(bit)); /* Use a prime bigger than sizeof(VARSET_TP) and which is not of the form 2^n-1. modulo with this will produce a unique hash for all powers of 2 (which is what "bit" is). Entries in hashTable[] which are -1 should never be used. There should be HASH_NUM-8*sizeof(bit)* entries which are -1 . */ const unsigned HASH_NUM = 67; static const char hashTable[HASH_NUM] = { -1, 0, 1, 39, 2, 15, 40, 23, 3, 12, 16, 59, 41, 19, 24, 54, 4, -1, 13, 10, 17, 62, 60, 28, 42, 30, 20, 51, 25, 44, 55, 47, 5, 32, -1, 38, 14, 22, 11, 58, 18, 53, 63, 9, 61, 27, 29, 50, 43, 46, 31, 37, 21, 57, 52, 8, 26, 49, 45, 36, 56, 7, 48, 35, 6, 34, 33 }; assert(HASH_NUM >= 8*sizeof(bit)); assert(!genOneBitOnly(HASH_NUM+1)); assert(sizeof(hashTable) == HASH_NUM); unsigned hash = unsigned(bit % HASH_NUM); unsigned index = hashTable[hash]; assert(index != (char)-1); return index; } /***************************************************************************** * * Given a value that has exactly one bit set, return the position of that * bit, in other words return the logarithm in base 2 of the given value. */ unsigned genLog2(unsigned value) { unsigned power; static BYTE powers[16] = { 0, // 0 1, // 1 2, // 2 0, // 3 3, // 4 0, // 5 0, // 6 0, // 7 4, // 8 0, // 9 0, // 10 0, // 11 0, // 12 0, // 13 0, // 14 0, // 15 }; #if 0 int i,m; for (i = 1, m = 1; i <= VARSET_SZ; i++, m <<=1 ) { if (genLog2(m) != i) printf("Error: log(%u) returns %u instead of %u\n", m, genLog2(m), i); } #endif assert(value && genOneBitOnly(value)); power = 0; if ((value & 0xFFFF) == 0) { value >>= 16; power += 16; } if ((value & 0xFF00) != 0) { value >>= 8; power += 8; } if ((value & 0x000F) != 0) return power + powers[value]; else return power + powers[value >> 4] + 4; } /***************************************************************************** * * getEERegistryDWORD - finds a value entry of type DWORD in the EE registry key. * Return the value if entry exists, else return default value. * * valueName - Value to look up * defaultVal - name says it all */ static const TCHAR szJITsubKey[] = TEXT(FRAMEWORK_REGISTRY_KEY); /*****************************************************************************/ DWORD getEERegistryDWORD(const TCHAR *valueName, DWORD defaultVal) { HKEY hkeySubKey; DWORD dwValue; LONG lResult; TCHAR envName[64]; TCHAR valBuff[32]; if(strlen(valueName) > 64 - 1 - 8) return(0); strcpy(envName, "COMPlus_"); strcpy(&envName[8], valueName); lResult = GetEnvironmentVariableA(envName, valBuff, 32); if (lResult != 0) { TCHAR* endPtr; DWORD rtn = strtol(valBuff, &endPtr, 16); // treat it has hex if (endPtr != valBuff) // success return(rtn); } assert(valueName != NULL); // Open key. lResult = RegOpenKeyEx(HKEY_CURRENT_USER, szJITsubKey, 0, KEY_QUERY_VALUE, &hkeySubKey); if (lResult == ERROR_SUCCESS) { DWORD dwType; DWORD dwcbValueLen = sizeof(DWORD); // Determine value length. lResult = RegQueryValueEx(hkeySubKey, valueName, NULL, &dwType, (PBYTE)&dwValue, &dwcbValueLen); if (lResult == ERROR_SUCCESS) { if (dwType == REG_DWORD && dwcbValueLen == sizeof(DWORD)) defaultVal = dwValue; } RegCloseKey(hkeySubKey); } if (lResult != ERROR_SUCCESS) { lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szJITsubKey, 0, KEY_QUERY_VALUE, &hkeySubKey); if (lResult == ERROR_SUCCESS) { DWORD dwType; DWORD dwcbValueLen = sizeof(DWORD); // Determine value length. lResult = RegQueryValueEx(hkeySubKey, valueName, NULL, &dwType, (PBYTE)&dwValue, &dwcbValueLen); if (lResult == ERROR_SUCCESS) { if (dwType == REG_DWORD && dwcbValueLen == sizeof(DWORD)) defaultVal = dwValue; } RegCloseKey(hkeySubKey); } } return defaultVal; } /*****************************************************************************/ bool getEERegistryString(const TCHAR * valueName, TCHAR * buf, /* OUT */ unsigned bufSize) { HKEY hkeySubKey; LONG lResult; assert(valueName != NULL); TCHAR envName[64]; if(strlen(valueName) > 64 - 1 - 8) return(0); strcpy(envName, "COMPlus_"); strcpy(&envName[8], valueName); lResult = GetEnvironmentVariableA(envName, buf, bufSize); if (lResult != 0 && *buf != 0) return(true); // Open key. lResult = RegOpenKeyEx(HKEY_CURRENT_USER, szJITsubKey, 0, KEY_QUERY_VALUE, &hkeySubKey); if (lResult != ERROR_SUCCESS) return false; DWORD dwType, dwcbValueLen = bufSize; // Determine value length. lResult = RegQueryValueEx(hkeySubKey, valueName, NULL, &dwType, (PBYTE)buf, &dwcbValueLen); bool result = false; if ((lResult == ERROR_SUCCESS) && (dwType == REG_SZ)) { assert(dwcbValueLen < bufSize); result = true; } else if (bufSize) { buf[0] = '\0'; } RegCloseKey(hkeySubKey); return result; } /***************************************************************************** * Parses the registry value which should be of the forms : * class:method, *:method, class:*, *:*, method, * * Returns true if the value is present, and the format is good */ bool getEERegistryMethod(const TCHAR * valueName, TCHAR * methodBuf /*OUT*/ , size_t methodBufSize, TCHAR * classBuf /*OUT*/ , size_t classBufSize) { /* In case we bail, set these to empty strings */ methodBuf[0] = classBuf[0] = '\0'; /* Read the value from the registry */ TCHAR value[200]; if (getEERegistryString(valueName, value, sizeof(value)) == false) return false; /* Divide it using ":" as a separator */ char * str1, * str2, * str3; str1 = strtok (value, ":"); str2 = strtok (NULL, ":"); str3 = strtok (NULL, ":"); /* If we dont have a single substring, or more than 2 substrings, ignore */ if (!str1 || str3) return false; if (str2 == NULL) { /* We have yyyy. Use this as *:yyyy */ strcpy(classBuf, "*" ); strcpy(methodBuf, str1); } else { /* We have xxx:yyyyy. So className=xxx and methodName=yyyy */ strcpy (classBuf, str1); strcpy (methodBuf, str2); } return true; } /***************************************************************************** * curClass_inc_package/curMethod is the fully qualified name of a method. * regMethod and regClass are read in getEERegistryMethod() * * Return true if curClass/curMethod fits the regular-expression defined by * regClass+regMethod. */ bool cmpEERegistryMethod(const TCHAR * regMethod, const TCHAR * regClass, const TCHAR * curMethod, const TCHAR * curClass) { assert(regMethod && regClass && curMethod && curClass); assert(!regMethod[0] == !regClass[0]); // Both empty, or both non-empty /* There may not have been a registry value, then return false */ if (!regMethod[0]) return false; /* See if we have atleast a method name match */ if (strcmp(regMethod, "*") != 0 && strcmp(regMethod, curMethod) != 0) return false; /* Now the class can be 1) "*", 2) an exact match, or 3) a match excluding the package - to succeed */ // 1) if (strcmp(regClass, "*") == 0) return true; // 2) if (strcmp(regClass, curClass) == 0) return true; /* 3) The class name in the registry may not include the package, so try to match curClass excluding the package part to "regClass" */ const TCHAR * curNameLeft = curClass; // chops off the package names for (const TCHAR * curClassIter = curClass; *curClassIter != '\0'; curClassIter++) { // @Todo: this file doens't include utilcode or anything else required // to make the nsutilpriv.h work. Check with jit team to see if they // care if it is added. if (*curClassIter == '.' /*NAMESPACE_SEPARATOR_CHAR*/) curNameLeft = curClassIter + 1; } if (strcmp(regClass, curNameLeft) == 0) return true; // Neither 1) nor 2) nor 3) means failure return false; } /*****************************************************************************/ #if defined(DEBUG) || !defined(NOT_JITC) histo::histo(unsigned * sizeTab, unsigned sizeCnt) { if (!sizeCnt) { do { sizeCnt++; } while(sizeTab[sizeCnt]); } histoSizCnt = sizeCnt; histoSizTab = sizeTab; histoCounts = new unsigned[sizeCnt+1]; histoClr(); } histo::~histo() { delete [] histoCounts; } void histo::histoClr() { memset(histoCounts, 0, (histoSizCnt+1)*sizeof(*histoCounts)); } void histo::histoDsp() { unsigned i; unsigned c; unsigned t; for (i = t = 0; i <= histoSizCnt; i++) t += histoCounts[i]; for (i = c = 0; i <= histoSizCnt; i++) { if (i == histoSizCnt) { if (!histoCounts[i]) break; printf(" > %6u", histoSizTab[i-1]); } else { if (i == 0) { printf(" <= "); } else printf("%6u .. ", histoSizTab[i-1]+1); printf("%6u", histoSizTab[i]); } c += histoCounts[i]; printf(" ===> %6u count (%3u%% of total)\n", histoCounts[i], (int)(100.0*c/t)); } } void histo::histoRec(unsigned siz, unsigned cnt) { unsigned i; unsigned * t; for (i = 0, t = histoSizTab; i < histoSizCnt; i++ , t++) { if (*t >= siz) break; } histoCounts[i] += cnt; } #endif // defined(DEBUG) || !defined(NOT_JITC) #ifdef NOT_JITC bool IsNameInProfile(const TCHAR * methodName, const TCHAR * className, const TCHAR * regKeyName) { TCHAR fileName[100]; TCHAR methBuf[1000]; /* Get the file containing the list of methods to exclude */ if (!getEERegistryString(regKeyName, fileName, sizeof(fileName))) return false; /* Get the list of methods for the given class */ if (GetPrivateProfileSection(className, methBuf, sizeof(methBuf), fileName)) { char * p = methBuf; while (*p) { /* Check for wild card or method name */ if (!strcmp(p, "*")) return true; if (!strcmp(p, methodName)) return true; /* Advance to next token */ while (*p) *p++; /* skip zero */ *p++; } } return false; } #endif //NOT_JITC
27.147651
99
0.46885
npocmaka
a6fcf23a162cf5c2b01314d375102f526ba1796a
1,127
cpp
C++
CodeAssist/CodeAssistLib/complete/Proposal/DefaultCompletionProposal.cpp
kuafuwang/JCDT
2b009ea887b4816303fed9e6e1dc104a90c67d16
[ "MIT" ]
1
2021-04-17T01:55:27.000Z
2021-04-17T01:55:27.000Z
CodeAssist/CodeAssistLib/complete/Proposal/DefaultCompletionProposal.cpp
kuafuwang/JCDT
2b009ea887b4816303fed9e6e1dc104a90c67d16
[ "MIT" ]
null
null
null
CodeAssist/CodeAssistLib/complete/Proposal/DefaultCompletionProposal.cpp
kuafuwang/JCDT
2b009ea887b4816303fed9e6e1dc104a90c67d16
[ "MIT" ]
1
2022-02-18T12:02:00.000Z
2022-02-18T12:02:00.000Z
#include "DefaultCompletionProposal.h" namespace Jikes { // Open namespace Jikes block namespace CodeAssist { const wstring& DefaultCompletionProposal::GetDisplayString() { if (fDisplayString.empty()) { if (otheTag == NORMAL) { fDisplayString = L"default:"; } else if(WITH_BREAK == otheTag) { fDisplayString = L"default: break;"; } else { fDisplayString = L"default : return [cursor];"; } } return fDisplayString; } const wstring& DefaultCompletionProposal::GetReplacementString() { if (fReplacementString.empty()) { if (otheTag == NORMAL) { fReplacementString = L"default:"; cursorLenth = fReplacementString.size()+1; } else if (WITH_BREAK == otheTag) { fReplacementString = L"default: break;"; cursorLenth = fReplacementString.size() + 1; } else { fReplacementString = L"default : return ;"; cursorLenth = fReplacementString.size() - 1; } } return fReplacementString; } } // Close namespace Jikes block } // Close namespace CodeAssist block
20.125
66
0.621118
kuafuwang
a6fd4b0c75385f0cde9941adcae2168cdf874e04
1,225
cpp
C++
source/tools/editor/dropzonebrush.cpp
mechasource/mechcommander2
b2c7cecf001cec1f535aa8d29c31bdc30d9aa983
[ "BSD-2-Clause" ]
38
2015-04-10T13:31:03.000Z
2021-09-03T22:34:05.000Z
source/tools/editor/dropzonebrush.cpp
mechasource/mechcommander2
b2c7cecf001cec1f535aa8d29c31bdc30d9aa983
[ "BSD-2-Clause" ]
1
2020-07-09T09:48:44.000Z
2020-07-12T12:41:43.000Z
source/tools/editor/dropzonebrush.cpp
mechasource/mechcommander2
b2c7cecf001cec1f535aa8d29c31bdc30d9aa983
[ "BSD-2-Clause" ]
12
2015-06-29T08:06:57.000Z
2021-10-13T13:11:41.000Z
/*************************************************************************************************\ dropZoneBrush.cpp : Implementation of the dropZoneBrush component. //---------------------------------------------------------------------------// // Copyright (C) Microsoft Corporation. All rights reserved. // //===========================================================================// \*************************************************************************************************/ // #define DROPZONEBRUSH_CPP #include "stdinc.h" //#include "editorobjectmgr.h" #include "dropZoneBrush.h" DropZoneBrush::DropZoneBrush(int32_t align, bool bVtol) { alignment = align; bVTol = bVtol; } bool DropZoneBrush::paint(Stuff::Vector3D& worldPos, int32_t screenX, int32_t screenY) { EditorObject* pInfo = EditorObjectMgr::instance()->addDropZone(worldPos, alignment, bVTol); if (pInfo && pAction) { pAction->addBuildingInfo(*pInfo); return true; } return false; } bool DropZoneBrush::canPaint( Stuff::Vector3D& worldPos, int32_t screenX, int32_t screenY, int32_t flags) { return EditorObjectMgr::instance()->canAddDropZone(worldPos, alignment, bVTol); } // end of file ( dropZoneBrush.cpp )
31.410256
99
0.520816
mechasource
4708133bb2dd9ae9152e118d1320adef4ae581e0
29,038
cc
C++
multibody/parsing/test/detail_urdf_geometry_test.cc
RobotLocomotion/drake-python3.7
ae397a4c6985262d23e9675b9bf3927c08d027f5
[ "BSD-3-Clause" ]
2
2021-02-25T02:01:02.000Z
2021-03-17T04:52:04.000Z
multibody/parsing/test/detail_urdf_geometry_test.cc
RobotLocomotion/drake-python3.7
ae397a4c6985262d23e9675b9bf3927c08d027f5
[ "BSD-3-Clause" ]
null
null
null
multibody/parsing/test/detail_urdf_geometry_test.cc
RobotLocomotion/drake-python3.7
ae397a4c6985262d23e9675b9bf3927c08d027f5
[ "BSD-3-Clause" ]
1
2021-06-13T12:05:39.000Z
2021-06-13T12:05:39.000Z
#include "drake/multibody/parsing/detail_urdf_geometry.h" #include <memory> #include <vector> #include <gtest/gtest.h> #include "drake/common/filesystem.h" #include "drake/common/find_resource.h" #include "drake/common/test_utilities/eigen_matrix_compare.h" #include "drake/common/test_utilities/expect_no_throw.h" #include "drake/common/test_utilities/expect_throws_message.h" #include "drake/geometry/geometry_roles.h" #include "drake/geometry/proximity_properties.h" #include "drake/math/rigid_transform.h" #include "drake/multibody/parsing/detail_common.h" #include "drake/multibody/parsing/detail_path_utils.h" #include "drake/multibody/parsing/package_map.h" namespace drake { namespace multibody { namespace internal { std::ostream& operator<<(std::ostream& out, const UrdfMaterial& m) { if (m.rgba.has_value()) { out << "RGBA: " << m.rgba->transpose(); } else { out << "RGBA: None"; } out << ", "; if (m.diffuse_map.has_value()) { out << "Diffuse map: " << *m.diffuse_map; } else { out << "Diffuse map: None"; } return out; } bool operator==(const UrdfMaterial& m1, const UrdfMaterial& m2) { return m1.rgba == m2.rgba && m1.diffuse_map == m2.diffuse_map; } namespace { using std::make_unique; using std::unique_ptr; using Eigen::Vector4d; using tinyxml2::XMLDocument; using tinyxml2::XMLElement; using math::RigidTransformd; using geometry::GeometryInstance; using geometry::IllustrationProperties; using geometry::ProximityProperties; // Confirms the logic for reconciling named references to materials. GTEST_TEST(DetailUrdfGeometryTest, AddMaterialToMaterialMap) { MaterialMap materials; // The material with no data except the default rgba value. const Vector4d black_color{0, 0, 0, 0}; const Vector4d full_color{0.3, 0.6, 0.9, 0.99}; const Vector4d rgba_color{0.25, 0.5, 0.75, 1.0}; const UrdfMaterial default_mat{black_color, {}}; const UrdfMaterial empty_mat{{}, {}}; const UrdfMaterial rgba_mat{rgba_color, {}}; const UrdfMaterial diffuse_mat{{}, "arbitrary_diffuse"}; const UrdfMaterial full_mat{full_color, "full"}; const std::string empty_mat_name{"empty"}; const std::string rgba_mat_name{"just_rgba"}; const std::string diffuse_mat_name{"just_diffuse"}; const std::string full_mat_name{"full"}; const bool abort_if_name_clash{true}; // ---- Simple addition of new materials and redundant addition of identical // material. // Case: Adding a unique material with no data - gets default rgba. { const UrdfMaterial result1 = AddMaterialToMaterialMap( empty_mat_name, empty_mat, abort_if_name_clash, &materials); EXPECT_EQ(result1, default_mat); const UrdfMaterial result2 = AddMaterialToMaterialMap( empty_mat_name, empty_mat, !abort_if_name_clash, &materials); EXPECT_EQ(result2, default_mat); } // Case: Adding a unique material with only rgba. { const UrdfMaterial result1 = AddMaterialToMaterialMap( rgba_mat_name, rgba_mat, abort_if_name_clash, &materials); EXPECT_EQ(result1, rgba_mat); const UrdfMaterial result2 = AddMaterialToMaterialMap( rgba_mat_name, rgba_mat, !abort_if_name_clash, &materials); EXPECT_EQ(result2, rgba_mat); } // Case: Adding a redundant material whose rgba values are different, but // within tolerance. { const Vector4d rgba_color2 = rgba_color + Vector4d::Constant(1e-11); const UrdfMaterial result = AddMaterialToMaterialMap(rgba_mat_name, UrdfMaterial{rgba_color2, {}}, !abort_if_name_clash, &materials); EXPECT_EQ(result, rgba_mat); // Deviation between colors too big. const Vector4d rgba_color3 = rgba_color + Vector4d::Constant(5e-11); DRAKE_EXPECT_THROWS_MESSAGE( AddMaterialToMaterialMap(rgba_mat_name, UrdfMaterial{rgba_color3, {}}, !abort_if_name_clash, &materials), std::runtime_error, "Material '.+' was previously defined[^]+"); } // Case: Adding a unique material with only diffuse map - get default rgba. { const UrdfMaterial expected{black_color, diffuse_mat.diffuse_map}; const UrdfMaterial result1 = AddMaterialToMaterialMap( diffuse_mat_name, diffuse_mat, abort_if_name_clash, &materials); EXPECT_EQ(result1, expected); const UrdfMaterial result2 = AddMaterialToMaterialMap( diffuse_mat_name, diffuse_mat, !abort_if_name_clash, &materials); EXPECT_EQ(result2, expected); } // Case: adding a unique material with both diffuse map and rgba. { const UrdfMaterial result1 = AddMaterialToMaterialMap( full_mat_name, full_mat, abort_if_name_clash, &materials); EXPECT_EQ(result1, full_mat); const UrdfMaterial result2 = AddMaterialToMaterialMap( full_mat_name, full_mat, !abort_if_name_clash, &materials); EXPECT_EQ(result2, full_mat); } // ---- Name matches to cached value, but new material is nullopt. // Note: There is no case where cached has *only* diffuse map because any // material missing rgba is assigned default black before being stored in the // cache. // Case: Cache only has rgba defined; input material is empty. { const UrdfMaterial result = AddMaterialToMaterialMap( rgba_mat_name, empty_mat, !abort_if_name_clash, &materials); EXPECT_EQ(result, rgba_mat); } // Case: Cache only has diffuse map and rgba defined; input material is empty. { const UrdfMaterial result = AddMaterialToMaterialMap( full_mat_name, empty_mat, !abort_if_name_clash, &materials); EXPECT_EQ(result, full_mat); } // ---- Name clashes. // Case: Adding an identical material is/isn't an error based on name clash // parameter. { ASSERT_NE(materials.find(empty_mat_name), materials.end()); // Redundant adding is not an error. const UrdfMaterial result = AddMaterialToMaterialMap( empty_mat_name, empty_mat, !abort_if_name_clash, &materials); EXPECT_EQ(result, default_mat); // Redundant adding with name clash *is* an error. DRAKE_EXPECT_THROWS_MESSAGE( AddMaterialToMaterialMap(empty_mat_name, empty_mat, abort_if_name_clash, &materials), std::runtime_error, "Material '.+' was previously defined[^]+"); } // ---- Failure modes. // The failure mode where cached rgba is nullopt and new material is *not* is // not possible because any material missing rgba is assigned default black // before being stored in the cache. // Case: rgba doesn't match. DRAKE_EXPECT_THROWS_MESSAGE( AddMaterialToMaterialMap(rgba_mat_name, UrdfMaterial{Vector4d{0.1, 0.1, 0.1, 0.1}, {}}, !abort_if_name_clash, &materials), std::runtime_error, "Material '.+' was previously defined[^]+"); // Case: Cached diffuse_map is nullopt, input is not. DRAKE_EXPECT_THROWS_MESSAGE( AddMaterialToMaterialMap(rgba_mat_name, UrdfMaterial{{}, "bad_name"}, !abort_if_name_clash, &materials), std::runtime_error, "Material '.+' was previously defined[^]+"); // Case: Cached and input have non-matching values. DRAKE_EXPECT_THROWS_MESSAGE( AddMaterialToMaterialMap(full_mat_name, UrdfMaterial{full_color, "bad_name"}, !abort_if_name_clash, &materials), std::runtime_error, "Material '.+' was previously defined[^]+"); } // Creates a special XML DOM consisting of *only* a collision object. XML text // can be provided as an input and it will be injected as a child of the // <collision> tag. unique_ptr<XMLDocument> MakeCollisionDocFromString( const std::string& collision_spec) { const std::string urdf_harness = R"""( <?xml version="1.0"?> <collision> <geometry> <box size=".1 .2 .3"/> </geometry>{} </collision>)"""; const std::string urdf = fmt::format(urdf_harness, collision_spec); auto doc = make_unique<XMLDocument>(); doc->Parse(urdf.c_str()); return doc; } class UrdfGeometryTests : public testing::Test { public: // Loads a URDF file and parses the minimal amount of it which // urdf_geometry.cc handles. void ParseUrdfGeometry(const std::string& file_name) { const std::string full_path = GetFullPath(file_name); xml_doc_.LoadFile(full_path.c_str()); ASSERT_FALSE(xml_doc_.ErrorID()) << xml_doc_.ErrorName(); size_t found = full_path.find_last_of("/\\"); if (found != std::string::npos) { root_dir_ = full_path.substr(0, found); } // TODO(sam.creasey) Add support for using an existing package map. package_map_.PopulateUpstreamToDrake(full_path); const XMLElement* node = xml_doc_.FirstChildElement("robot"); ASSERT_TRUE(node); for (const XMLElement* material_node = node->FirstChildElement("material"); material_node; material_node = material_node->NextSiblingElement("material")) { ParseMaterial(material_node, true, package_map_, root_dir_, &materials_); } // Parses geometry out of the model's link elements. for (const XMLElement* link_node = node->FirstChildElement("link"); link_node; link_node = link_node->NextSiblingElement("link")) { const char* attr = node->Attribute("name"); ASSERT_TRUE(attr); const std::string body_name = attr; for (const XMLElement* visual_node = link_node->FirstChildElement("visual"); visual_node; visual_node = visual_node->NextSiblingElement("visual")) { geometry::GeometryInstance geometry_instance = internal::ParseVisual(body_name, package_map_, root_dir_, visual_node, &materials_); visual_instances_.push_back(geometry_instance); } for (const XMLElement* collision_node = link_node->FirstChildElement("collision"); collision_node; collision_node = collision_node->NextSiblingElement("collision")) { geometry::GeometryInstance geometry_instance = internal::ParseCollision(body_name, package_map_, root_dir_, collision_node); collision_instances_.push_back(geometry_instance); } } } protected: XMLDocument xml_doc_; std::string root_dir_{"."}; multibody::PackageMap package_map_; MaterialMap materials_; std::vector<GeometryInstance> visual_instances_; std::vector<GeometryInstance> collision_instances_; }; // This test dives into more detail for some things than other tests. We // assume if parsing certain things works here that it will keep working. TEST_F(UrdfGeometryTests, TestParseMaterial1) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; const std::string file_no_conflict_1 = FindResourceOrThrow( resource_dir + "non_conflicting_materials_1.urdf"); DRAKE_EXPECT_NO_THROW(ParseUrdfGeometry(file_no_conflict_1)); ASSERT_EQ(materials_.size(), 5); const Vector4d brown(0.93333333333, 0.79607843137, 0.67843137254, 1); EXPECT_TRUE(materials_.at("brown").rgba.has_value()); EXPECT_FALSE(materials_.at("brown").diffuse_map.has_value()); EXPECT_TRUE(CompareMatrices(*(materials_.at("brown").rgba), brown, 1e-10)); const Vector4d red(0.93333333333, 0.2, 0.2, 1); EXPECT_TRUE(materials_.at("red").rgba.has_value()); EXPECT_FALSE(materials_.at("red").diffuse_map.has_value()); EXPECT_TRUE(CompareMatrices(*(materials_.at("red").rgba), red, 1e-10)); const Vector4d green(0, 1, 0, 1); EXPECT_TRUE(materials_.at("green").rgba.has_value()); EXPECT_FALSE(materials_.at("green").diffuse_map.has_value()); EXPECT_TRUE(CompareMatrices(*(materials_.at("green").rgba), green, 1e-10)); const Vector4d black(0, 0, 0, 0); EXPECT_TRUE(materials_.at("textured").rgba.has_value()); EXPECT_TRUE(materials_.at("textured").diffuse_map.has_value()); const std::string& file_name1 = *(materials_.at("textured").diffuse_map); EXPECT_EQ("empty.png", file_name1.substr(file_name1.size() - 9)); EXPECT_TRUE(CompareMatrices(*(materials_.at("textured").rgba), black, 1e-10)); EXPECT_TRUE(materials_.at("texture_and_color").rgba.has_value()); EXPECT_TRUE(materials_.at("texture_and_color").diffuse_map.has_value()); const std::string& file_name2 = *(materials_.at("texture_and_color").diffuse_map); EXPECT_EQ("empty.png", file_name2.substr(file_name2.size() - 9)); EXPECT_TRUE( CompareMatrices(*(materials_.at("texture_and_color").rgba), green)); ASSERT_EQ(visual_instances_.size(), 4); const auto& visual = visual_instances_[0]; const std::string name_base = "non_conflicting_materials_1"; EXPECT_EQ(visual.name().substr(0, name_base.size()), name_base); EXPECT_TRUE(CompareMatrices( visual.pose().GetAsMatrix34(), RigidTransformd().GetAsMatrix34())); const geometry::IllustrationProperties* properties = visual.illustration_properties(); ASSERT_NE(properties, nullptr); EXPECT_TRUE(properties->HasProperty("phong", "diffuse")); EXPECT_TRUE( CompareMatrices(properties->GetProperty<Vector4d>("phong", "diffuse"), *(materials_.at("green").rgba))); const geometry::Box* box = dynamic_cast<const geometry::Box*>(&visual.shape()); ASSERT_TRUE(box); EXPECT_TRUE(CompareMatrices(box->size(), Eigen::Vector3d(0.2, 0.2, 0.2))); const auto& capsule_visual = visual_instances_[1]; const geometry::Capsule* capsule = dynamic_cast<const geometry::Capsule*>(&capsule_visual.shape()); ASSERT_TRUE(capsule); EXPECT_EQ(capsule->radius(), 0.2); EXPECT_EQ(capsule->length(), 0.5); const auto& sphere_visual = visual_instances_[2]; const geometry::Sphere* sphere = dynamic_cast<const geometry::Sphere*>(&sphere_visual.shape()); ASSERT_TRUE(sphere); EXPECT_EQ(sphere->radius(), 0.25); } TEST_F(UrdfGeometryTests, TestParseMaterial2) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; const std::string file_no_conflict_2 = FindResourceOrThrow( resource_dir + "non_conflicting_materials_2.urdf"); DRAKE_EXPECT_NO_THROW(ParseUrdfGeometry(file_no_conflict_2)); EXPECT_EQ(materials_.size(), 1); const Vector4d brown{0.93333333333, 0.79607843137, 0.67843137254, 1}; EXPECT_TRUE(materials_.at("brown").rgba.has_value()); EXPECT_TRUE(CompareMatrices(*(materials_.at("brown").rgba), brown, 1e-14)); ASSERT_EQ(visual_instances_.size(), 3); const auto& visual = visual_instances_[0]; EXPECT_TRUE( visual.illustration_properties()->HasProperty("phong", "diffuse")); EXPECT_TRUE( CompareMatrices(visual.illustration_properties()->GetProperty<Vector4d>( "phong", "diffuse"), brown, 1e-14)); const RigidTransformd expected_pose(Eigen::Vector3d(0, 0, 0.3)); EXPECT_TRUE(CompareMatrices( visual.pose().GetAsMatrix34(), expected_pose.GetAsMatrix34())); const geometry::Cylinder* cylinder = dynamic_cast<const geometry::Cylinder*>(&visual.shape()); ASSERT_TRUE(cylinder); EXPECT_EQ(cylinder->radius(), 0.1); EXPECT_EQ(cylinder->length(), 0.6); const auto& mesh_visual = visual_instances_[1]; // Mesh has a "default" material. const geometry::Mesh* mesh = dynamic_cast<const geometry::Mesh*>(&mesh_visual.shape()); ASSERT_TRUE(mesh); const std::string& mesh_filename = mesh->filename(); std::string obj_name = "tri_cube.obj"; EXPECT_EQ(mesh_filename.rfind(obj_name), mesh_filename.size() - obj_name.size()); const auto& sphere_visual = visual_instances_[2]; EXPECT_TRUE( sphere_visual.illustration_properties()->HasProperty("phong", "diffuse")); EXPECT_TRUE(CompareMatrices( sphere_visual.illustration_properties()->GetProperty<Vector4d>("phong", "diffuse"), brown, 1e-14)); ASSERT_EQ(collision_instances_.size(), 1); const auto& collision = collision_instances_.front(); const geometry::Sphere* sphere = dynamic_cast<const geometry::Sphere*>(&collision.shape()); ASSERT_TRUE(sphere); EXPECT_EQ(sphere->radius(), 0.2); } TEST_F(UrdfGeometryTests, TestParseMaterial3) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; const std::string file_no_conflict_3 = FindResourceOrThrow( resource_dir + "non_conflicting_materials_3.urdf"); DRAKE_EXPECT_NO_THROW(ParseUrdfGeometry(file_no_conflict_3)); } TEST_F(UrdfGeometryTests, TestParseMaterialDuplicateButSame) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; // This URDF defines the same color multiple times in different links. const std::string file_same_color_diff_links = FindResourceOrThrow( resource_dir + "duplicate_but_same_materials_with_texture.urdf"); DRAKE_EXPECT_NO_THROW(ParseUrdfGeometry(file_same_color_diff_links)); ASSERT_GE(visual_instances_.size(), 1); math::RollPitchYaw<double> expected_rpy(0, 1.57, 0); Eigen::Vector3d expected_xyz(0.01429, 0, 0); math::RigidTransform<double> expected_pose( math::RotationMatrix<double>(expected_rpy), expected_xyz); const auto& visual = visual_instances_.front(); math::RigidTransform<double> actual_pose(visual.pose()); EXPECT_TRUE(actual_pose.IsNearlyEqualTo(expected_pose, 1e-10)); } TEST_F(UrdfGeometryTests, TestDuplicateMaterials) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; const std::string file_duplicate = FindResourceOrThrow( resource_dir + "duplicate_materials.urdf"); EXPECT_THROW(ParseUrdfGeometry(file_duplicate), std::runtime_error); } TEST_F(UrdfGeometryTests, TestConflictingMaterials) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; const std::string file_conflict = FindResourceOrThrow( resource_dir + "conflicting_materials.urdf"); EXPECT_THROW(ParseUrdfGeometry(file_conflict), std::runtime_error); } TEST_F(UrdfGeometryTests, TestWrongElementType) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; const std::string file_no_conflict_1 = FindResourceOrThrow( resource_dir + "non_conflicting_materials_1.urdf"); DRAKE_EXPECT_NO_THROW(ParseUrdfGeometry(file_no_conflict_1)); const XMLElement* node = xml_doc_.FirstChildElement("robot"); ASSERT_TRUE(node); DRAKE_EXPECT_THROWS_MESSAGE(internal::ParseMaterial(node, false, package_map_, root_dir_, &materials_), std::runtime_error, "Expected material element, got <robot>"); const XMLElement* material_node = node->FirstChildElement("material"); ASSERT_TRUE(material_node); DRAKE_EXPECT_THROWS_MESSAGE( internal::ParseVisual("fake_name", package_map_, root_dir_, material_node, &materials_), std::runtime_error, "In link fake_name expected visual element, got material"); DRAKE_EXPECT_THROWS_MESSAGE( internal::ParseCollision("fake_name", package_map_, root_dir_, material_node), std::runtime_error, "In link 'fake_name' expected collision element, got material"); } TEST_F(UrdfGeometryTests, TestParseConvexMesh) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; const std::string convex_and_nonconvex_test = FindResourceOrThrow(resource_dir + "convex_and_nonconvex_test.urdf"); DRAKE_EXPECT_NO_THROW(ParseUrdfGeometry(convex_and_nonconvex_test)); ASSERT_EQ(collision_instances_.size(), 2); { const auto& instance = collision_instances_[0]; const geometry::Convex* convex = dynamic_cast<const geometry::Convex*>(&instance.shape()); ASSERT_TRUE(convex); } { const auto& instance = collision_instances_[1]; const geometry::Mesh* mesh = dynamic_cast<const geometry::Mesh*>(&instance.shape()); ASSERT_TRUE(mesh); } } // Verify we can parse drake collision properties from a <collision> element. TEST_F(UrdfGeometryTests, CollisionProperties) { // Verifies that the property exists with the given double-typed value. auto verify_single_property = [](const ProximityProperties& properties, const char* group, const char* property, double value) { ASSERT_TRUE(properties.HasProperty(group, property)) << fmt::format(" for property: ('{}', '{}')", group, property); EXPECT_EQ(properties.GetProperty<double>(group, property), value); }; // Verifies that the properties has friction and it matches the given values. auto verify_friction = [](const ProximityProperties& properties, const CoulombFriction<double>& expected_friction) { ASSERT_TRUE(properties.HasProperty("material", "coulomb_friction")); const auto& friction = properties.GetProperty<CoulombFriction<double>>( "material", "coulomb_friction"); EXPECT_EQ(friction.static_friction(), expected_friction.static_friction()); EXPECT_EQ(friction.dynamic_friction(), expected_friction.dynamic_friction()); }; const PackageMap package_map; // An empty package map. const std::string root_dir("."); // Arbitrary, un-used root directory. // This parser uses the ParseProximityProperties found in detail_common // (which already has exhaustive tests). So, we'll put in a smoke test to // confirm that all of the basic tags get parsed and focus on the logic that // is unique to `ParseCollision()`. { unique_ptr<XMLDocument> doc = MakeCollisionDocFromString(R"""( <drake:proximity_properties> <drake:mesh_resolution_hint value="2.5"/> <drake:elastic_modulus value="3.5" /> <drake:hunt_crossley_dissipation value="3.5" /> <drake:mu_dynamic value="3.25" /> <drake:mu_static value="3.5" /> </drake:proximity_properties>)"""); const XMLElement* collision_node = doc->FirstChildElement("collision"); ASSERT_NE(collision_node, nullptr); GeometryInstance instance = ParseCollision("link_name", package_map, root_dir, collision_node); ASSERT_NE(instance.proximity_properties(), nullptr); const ProximityProperties& properties = *instance.proximity_properties(); verify_single_property(properties, geometry::internal::kHydroGroup, geometry::internal::kRezHint, 2.5); verify_single_property(properties, geometry::internal::kMaterialGroup, geometry::internal::kElastic, 3.5); verify_single_property(properties, geometry::internal::kMaterialGroup, geometry::internal::kHcDissipation, 3.5); verify_friction(properties, {3.5, 3.25}); } // Case: specifies rigid hydroelastic. { unique_ptr<XMLDocument> doc = MakeCollisionDocFromString(R"""( <drake:proximity_properties> <drake:rigid_hydroelastic/> </drake:proximity_properties>)"""); const XMLElement* collision_node = doc->FirstChildElement("collision"); ASSERT_NE(collision_node, nullptr); GeometryInstance instance = ParseCollision("link_name", package_map, root_dir, collision_node); ASSERT_NE(instance.proximity_properties(), nullptr); const ProximityProperties& properties = *instance.proximity_properties(); ASSERT_TRUE(properties.HasProperty(geometry::internal::kHydroGroup, geometry::internal::kComplianceType)); EXPECT_EQ(properties.GetProperty<geometry::internal::HydroelasticType>( geometry::internal::kHydroGroup, geometry::internal::kComplianceType), geometry::internal::HydroelasticType::kRigid); } // Case: specifies soft hydroelastic. { unique_ptr<XMLDocument> doc = MakeCollisionDocFromString(R"""( <drake:proximity_properties> <drake:soft_hydroelastic/> </drake:proximity_properties>)"""); const XMLElement* collision_node = doc->FirstChildElement("collision"); ASSERT_NE(collision_node, nullptr); GeometryInstance instance = ParseCollision("link_name", package_map, root_dir, collision_node); ASSERT_NE(instance.proximity_properties(), nullptr); const ProximityProperties& properties = *instance.proximity_properties(); ASSERT_TRUE(properties.HasProperty(geometry::internal::kHydroGroup, geometry::internal::kComplianceType)); EXPECT_EQ(properties.GetProperty<geometry::internal::HydroelasticType>( geometry::internal::kHydroGroup, geometry::internal::kComplianceType), geometry::internal::HydroelasticType::kSoft); } // Case: specifies both -- should be an error. { unique_ptr<XMLDocument> doc = MakeCollisionDocFromString(R"""( <drake:proximity_properties> <drake:soft_hydroelastic/> <drake:rigid_hydroelastic/> </drake:proximity_properties>)"""); const XMLElement* collision_node = doc->FirstChildElement("collision"); ASSERT_NE(collision_node, nullptr); DRAKE_EXPECT_THROWS_MESSAGE( ParseCollision("link_name", package_map, root_dir, collision_node), std::runtime_error, "Collision geometry has defined mutually-exclusive tags .*rigid.* and " ".*soft.*"); } // TODO(SeanCurtis-TRI): This is the *old* interface; the new // drake::proximity_properties should supplant it. Deprecate and remove this. // Case: has no drake:proximity_properties coefficients, only drake_compliance // coeffs. { unique_ptr<XMLDocument> doc = MakeCollisionDocFromString(R"""( <drake_compliance> <static_friction>3.5</static_friction> <dynamic_friction>2.5</dynamic_friction> </drake_compliance>)"""); const XMLElement* collision_node = doc->FirstChildElement("collision"); ASSERT_NE(collision_node, nullptr); GeometryInstance instance = ParseCollision("link_name", package_map, root_dir, collision_node); ASSERT_NE(instance.proximity_properties(), nullptr); const ProximityProperties& properties = *instance.proximity_properties(); verify_friction(properties, {3.5, 2.5}); } // Case: has both drake_compliance and drake:proximity_properties; // drake:proximity_properties wins. unique_ptr<XMLDocument> doc = MakeCollisionDocFromString(R"""( <drake_compliance> <static_friction>3.5</static_friction> <dynamic_friction>2.5</dynamic_friction> </drake_compliance> <drake:proximity_properties> <drake:mu_dynamic value="4.5" /> </drake:proximity_properties>)"""); const XMLElement* collision_node = doc->FirstChildElement("collision"); ASSERT_NE(collision_node, nullptr); GeometryInstance instance = ParseCollision("link_name", package_map, root_dir, collision_node); ASSERT_NE(instance.proximity_properties(), nullptr); const ProximityProperties& properties = *instance.proximity_properties(); verify_friction(properties, {4.5, 4.5}); } // Confirms that the <drake:accepting_renderer> tag gets properly parsed. TEST_F(UrdfGeometryTests, AcceptingRenderers) { const std::string resource_dir{ "drake/multibody/parsing/test/urdf_parser_test/"}; const std::string file_no_conflict_1 = FindResourceOrThrow( resource_dir + "accepting_renderer.urdf"); // TODO(SeanCurtis-TRI): Test for the <drake:accepting_renderer> tag without // name attribute when we can test using an in-memory XML. DRAKE_EXPECT_NO_THROW(ParseUrdfGeometry(file_no_conflict_1)); ASSERT_EQ(visual_instances_.size(), 3); const std::string group = "renderer"; const std::string property = "accepting"; for (const auto& instance : visual_instances_) { // TODO(SeanCurtis-TRI): When perception properties are uniquely parsed // from the file, change this to PerceptionProperties. EXPECT_NE(instance.illustration_properties(), nullptr); const IllustrationProperties& props = *instance.illustration_properties(); if (instance.name() == "all_renderers") { EXPECT_FALSE(props.HasProperty(group, property)); } else if (instance.name() == "single_renderer") { EXPECT_TRUE(props.HasProperty(group, property)); const auto& names = props.GetProperty<std::set<std::string>>(group, property); EXPECT_EQ(names.size(), 1); EXPECT_EQ(names.count("renderer1"), 1); } else if (instance.name() == "multi_renderer") { EXPECT_TRUE(props.HasProperty(group, property)); const auto& names = props.GetProperty<std::set<std::string>>(group, property); EXPECT_EQ(names.size(), 2); EXPECT_EQ(names.count("renderer1"), 1); EXPECT_EQ(names.count("renderer2"), 1); } else { GTEST_FAIL() << "Encountered visual geometry not expected: " << instance.name(); } } } } // namespace } // namespace internal } // namespace multibody } // namespace drake
40.274619
80
0.704732
RobotLocomotion
470837c3c5ee105a07e9ac189bc4bd4305c05c14
995
cpp
C++
cpp/TimeLimitedAssert.cpp
som-dev/ShowMeCode
c17ecf7d69738942fe7134e8d963d1862b78a757
[ "MIT" ]
1
2018-08-12T04:48:55.000Z
2018-08-12T04:48:55.000Z
cpp/TimeLimitedAssert.cpp
som-dev/ShowMeCode
c17ecf7d69738942fe7134e8d963d1862b78a757
[ "MIT" ]
null
null
null
cpp/TimeLimitedAssert.cpp
som-dev/ShowMeCode
c17ecf7d69738942fe7134e8d963d1862b78a757
[ "MIT" ]
null
null
null
/// @file /// @brief #include "TimeLimitedAssert.hpp" #include <iostream> #include <thread> #include <chrono> /// @brief simply sleep for the provided time and set the flag to true void RunThread(bool& flag, size_t sleepSeconds) { std::this_thread::sleep_for(std::chrono::seconds(sleepSeconds)); flag = true; } /// @brief Test the time limited assert void TimeLimitedAssert() { auto start = std::chrono::system_clock::now(); bool flag = false; std::thread t1(RunThread, std::ref(flag), 2); std::cout << "Starting first assert" << std::endl; TIME_LIMITED_ASSERT(flag, 5); auto end = std::chrono::system_clock::now(); std::cout << "Assert took " << std::chrono::duration_cast<std::chrono::seconds>(end - start).count() << " seconds" << std::endl; if (t1.joinable()) t1.join(); flag = false; std::cout << "Starting second assert" << std::endl; TIME_LIMITED_ASSERT(flag, 5); // this will fail in debug mode }
28.428571
86
0.636181
som-dev