hexsha
stringlengths
40
40
size
int64
22
2.4M
ext
stringclasses
5 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
260
max_stars_repo_name
stringlengths
5
109
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
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
3
260
max_issues_repo_name
stringlengths
5
109
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
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
3
260
max_forks_repo_name
stringlengths
5
109
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
22
2.4M
avg_line_length
float64
5
169k
max_line_length
int64
5
786k
alphanum_fraction
float64
0.06
0.95
matches
listlengths
1
11
be67e50de9c1b14b7082bcda8fc41beb51651746
42,835
c
C
src/x-window-selector.c
Hanaasagi/x-window-selector
4642aba550e46998696fdbef3441237be0df6739
[ "Apache-2.0" ]
1
2021-12-17T16:44:29.000Z
2021-12-17T16:44:29.000Z
src/x-window-selector.c
Hanaasagi/x-window-selector
4642aba550e46998696fdbef3441237be0df6739
[ "Apache-2.0" ]
null
null
null
src/x-window-selector.c
Hanaasagi/x-window-selector
4642aba550e46998696fdbef3441237be0df6739
[ "Apache-2.0" ]
null
null
null
/* 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 <argp.h> #include <errno.h> #include <ft2build.h> #include <inttypes.h> #include <math.h> #include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sysexits.h> #include <time.h> #include <unistd.h> #include <xcb/render.h> #include <xcb/xcb.h> #include <xcb/xcb_ewmh.h> #include <xcb/xcb_icccm.h> #include <xcb/xcb_keysyms.h> #include <xcb/xcb_renderutil.h> #include FT_FREETYPE_H #include "helper.h" /** * Part of a keysym lookup, used to translate between keysyms and characters. * * character: the ASCII character * keysym: the Xorg keysym to interpret the character as */ typedef struct keysyms_lookup_t { char character; xcb_keysym_t keysym; } keysyms_lookup_t; /** * A recursive structure holding data about windows, used to track the windows * we care about. Exactly one of `window` (paired with `overlay_*`) and * `children` is non-NULL. * * ?overlay_window: the window we created over the top of the tracked window * ?overlay_font_gc: for drawing the text on `overlay_window` * ?overlay_bg_gc: for drawing the background on `overlay_window` * ?overlay_rect: the on-screen area covered by `overlay_window` * ?window: the pre-existing tracked window * character: the character that must be typed to select `window`, or to * descend into `children` ?children: the continuation of the structure * children_size: size of `children` (0 if `children` is NULL) */ typedef struct window_setup_t { xcb_window_t* overlay_window; xcb_gcontext_t* overlay_font_gc; xcb_gcontext_t* overlay_bg_gc; xcb_rectangle_t* overlay_rect; xcb_window_t* window; char character; struct window_setup_t* children; int children_size; } window_setup_t; /** * Data generated from initial user input to the program. * * ksl: keys available for use * blacklist: windows which should be ignored * whitelist: windows which should be included * format: FORMAT_DEC or FORMAT_HEX */ typedef struct xcw_input_t { keysyms_lookup_t* ksl; int ksl_size; xcb_window_t* blacklist; int blacklist_size; xcb_window_t* whitelist; int whitelist_size; short format; int font_size; char* font_path; } xcw_input_t; /** * Collection of data needed throughout the runtime of the program. * * xcon: the connection to the X server * xroot: the root window * ewmh: the state for `xcb_ewmh` * ksymbols: cached key symbols * overlay_font: font used to render text on overlays * input: data generated from initial user input to the program * wsetups: array of setup structures */ typedef struct xcw_state_t { xcb_connection_t* xcon; xcb_window_t xroot; xcb_ewmh_connection_t ewmh; xcb_key_symbols_t* ksymbols; xcb_font_t overlay_font; xcw_input_t* input; window_setup_t* wsetups; int wsetups_size; } xcw_state_t; // -- constants /** * Text colour for overlay windows. */ int FG_COLOUR = 0xffffffff; /** * Name of the font used to render text on overlay windows. */ char* OVERLAY_FONT_NAME = "fixed"; /** * Background colour for overlay windows. */ int BG_COLOUR = 0xff333333; /** * Window class set on overlay windows. */ char* OVERLAY_WINDOW_CLASS = "overlay\0xorg-choose-window"; /** * Number of windows requested from _NET_CLIENT_LIST. */ int MAX_WINDOWS = 1024; /** * Printed version string (used internally by `argp`). */ const char* argp_program_version = "xorg-choose-window 0.2.0-next"; /* * Output format options. */ short FORMAT_DEC = 0; short FORMAT_HEX = 1; /** * Keysyms with an obvious 1-character representation. Only these characters * may be used as input. */ keysyms_lookup_t ALL_KEYSYMS_LOOKUP[] = { { '0', 0x0030 }, { '1', 0x0031 }, { '2', 0x0032 }, { '3', 0x0033 }, { '4', 0x0034 }, { '5', 0x0035 }, { '6', 0x0036 }, { '7', 0x0037 }, { '8', 0x0038 }, { '9', 0x0039 }, { 'a', 0x0061 }, { 'b', 0x0062 }, { 'c', 0x0063 }, { 'd', 0x0064 }, { 'e', 0x0065 }, { 'f', 0x0066 }, { 'g', 0x0067 }, { 'h', 0x0068 }, { 'i', 0x0069 }, { 'j', 0x006a }, { 'k', 0x006b }, { 'l', 0x006c }, { 'm', 0x006d }, { 'n', 0x006e }, { 'o', 0x006f }, { 'p', 0x0070 }, { 'q', 0x0071 }, { 'r', 0x0072 }, { 's', 0x0073 }, { 't', 0x0074 }, { 'u', 0x0075 }, { 'v', 0x0076 }, { 'w', 0x0077 }, { 'x', 0x0078 }, { 'y', 0x0079 }, { 'z', 0x007a } }; /** * Size of `ALL_KEYSYMS_LOOKUP`. */ int ALL_KEYSYMS_LOOKUP_SIZE = (sizeof(ALL_KEYSYMS_LOOKUP) / sizeof(*ALL_KEYSYMS_LOOKUP)); // -- utilities /** * Compute the smaller of two numbers. */ int min(int a, int b) { return a < b ? a : b; } /** * Compute the larger of two numbers. */ int max(int a, int b) { return a < b ? b : a; } /** * Print an error message to stderr and exit the process with the given status. * * code: exit code * fmt, ...: arguments as taken by `*printf` */ void xcw_fail(int code, char* fmt, ...) { va_list args; fprintf(stderr, "error: "); va_start(args, fmt); vfprintf(stderr, fmt, args); va_end(args); exit(code); } /** * Print an error message to stderr and exit the process with a failure status. * * fmt, ...: arguments as taken by `*printf` */ void xcw_die(char* fmt, ...) { va_list args; va_start(args, fmt); xcw_fail(EX_SOFTWARE, fmt, args); va_end(args); } /** * Print a warning message to stderr. Takes arguments like `*printf`. */ void xcw_warn(char* fmt, ...) { va_list args; fprintf(stderr, "warning: "); va_start(args, fmt); vfprintf(stderr, fmt, args); va_end(args); } /** * Exit the process with a status indicating a window was chosen. */ void xcw_exit_match() { exit(0); } /** * Exit the process with a status indicating no window was chosen. */ void xcw_exit_no_match() { exit(0); } /** * Print the chosen window to stdout and exit the process. */ void choose_window(xcw_input_t* input, xcb_window_t window) { if (input->format == FORMAT_DEC) printf("%d\n", window); else if (input->format == FORMAT_HEX) printf("0x%x\n", window); xcw_exit_match(); } // -- xorg utilities /** * Perform the check for a checked, reply-less xcb request. * * cookie: corresponding to the request * msg: to print in case of error */ void xorg_check_request(xcb_connection_t* xcon, xcb_void_cookie_t cookie, char* msg) { xcb_generic_error_t* error = xcb_request_check(xcon, cookie); if (error) xcw_die("%s (%d)\n", msg, error->error_code); } /** * Move and resize a window. * * x, y: new absolute screen location */ void xorg_window_move_resize( xcb_connection_t* xcon, xcb_window_t window, int x, int y, int w, int h) { int mask = (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT); uint32_t values[] = { x, y, w, h }; xcb_configure_window(xcon, window, mask, values); } /** * Determine whether a window has a property defined. * * prop: property ID */ int xorg_window_has_property( xcb_connection_t* xcon, xcb_window_t window, xcb_atom_t prop) { xcb_list_properties_cookie_t lpc = xcb_list_properties(xcon, window); xcb_list_properties_reply_t* lpr; if (!(lpr = xcb_list_properties_reply(xcon, lpc, NULL))) { xcw_die("list_properties"); } xcb_atom_t* props = xcb_list_properties_atoms(lpr); int result = 0; for (int i = 0; i < xcb_list_properties_atoms_length(lpr); i++) { if (props[i] == prop) { result = 1; break; } } free(lpr); return result; } /** * Construct a 2-byte character string from a 1-byte character string. */ xcb_char2b_t* xorg_str_to_2b(char* text, int text_size) { xcb_char2b_t* text2b = malloc(text_size * sizeof(xcb_char2b_t)); xcb_char2b_t c = { 0, 0 }; for (int i = 0; i < text_size; i++) { c.byte2 = text[i]; text2b[i] = c; } return text2b; } static void load_glyph( xcb_connection_t* c, xcb_render_glyphset_t gs, FT_Face face, int charcode) { uint32_t gid; xcb_render_glyphinfo_t ginfo; FT_Select_Charmap(face, ft_encoding_unicode); int glyph_index = FT_Get_Char_Index(face, charcode); if (glyph_index == 0) { // TODO use fallback font // http://www.unicode.org/policies/lastresortfont_eula.html printf("character %d not found\n", charcode); } FT_Load_Glyph(face, glyph_index, FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT); FT_Bitmap* bitmap = &face->glyph->bitmap; ginfo.x = -face->glyph->bitmap_left; ginfo.y = face->glyph->bitmap_top; ginfo.width = bitmap->width; ginfo.height = bitmap->rows; ginfo.x_off = face->glyph->advance.x / 64; ginfo.y_off = face->glyph->advance.y / 64; // glyph_id = charcode; gid = charcode; int stride = (ginfo.width + 3) & ~3; uint8_t tmpbitmap[stride * ginfo.height]; int y; for (y = 0; y < ginfo.height; y++) memcpy( tmpbitmap + y * stride, bitmap->buffer + y * ginfo.width, ginfo.width); xcb_render_add_glyphs_checked( c, gs, 1, &gid, &ginfo, stride * ginfo.height, tmpbitmap); xcb_flush(c); } static xcb_render_picture_t create_pen(xcb_connection_t* c, int red, int green, int blue, int alpha) { xcb_render_color_t color = { .red = red, .green = green, .blue = blue, .alpha = alpha }; xcb_render_pictforminfo_t* fmt; const xcb_render_query_pict_formats_reply_t* fmt_rep = xcb_render_util_query_formats(c); // alpha can only be used with a picture containing a pixmap fmt = xcb_render_util_find_standard_format(fmt_rep, XCB_PICT_STANDARD_ARGB_32); xcb_drawable_t root = xcb_setup_roots_iterator(xcb_get_setup(c)).data->root; xcb_pixmap_t pm = xcb_generate_id(c); xcb_create_pixmap(c, 32, pm, root, 1, 1); uint32_t values[1]; values[0] = XCB_RENDER_REPEAT_NORMAL; xcb_render_picture_t picture = xcb_generate_id(c); xcb_render_create_picture( c, picture, pm, fmt->id, XCB_RENDER_CP_REPEAT, values); xcb_rectangle_t rect = { .x = 0, .y = 0, .width = 1, .height = 1 }; xcb_render_fill_rectangles( c, XCB_RENDER_PICT_OP_OVER, picture, color, 1, &rect); xcb_free_pixmap(c, pm); return picture; } static xcb_render_glyphset_t load_glyphset( xcb_connection_t* c, char* filename, int size, struct utf_holder holder) { static int ft_lib_initialized = 0; static FT_Library library; int n; xcb_render_pictforminfo_t* fmt_a8; const xcb_render_query_pict_formats_reply_t* fmt_rep = xcb_render_util_query_formats(c); fmt_a8 = xcb_render_util_find_standard_format(fmt_rep, XCB_PICT_STANDARD_A_8); xcb_render_glyphset_t gs = xcb_generate_id(c); xcb_render_create_glyph_set(c, gs, fmt_a8->id); if (!ft_lib_initialized) FT_Init_FreeType(&library); // TODO: leave that aside from now and do a simple loading FT_Face face; FT_New_Face(library, filename, 0, &face); FT_Set_Char_Size(face, 0, size * 64, 90, 90); for (n = 0; n < holder.length; n++) load_glyph(c, gs, face, holder.str[n]); FT_Done_Face(face); return gs; } /** * Render text centred on a window. * * win_rect: rectangle covering window with ID `win` * gc: graphics context for rendering the text * text: text to render */ void xorg_draw_text_centred( xcb_connection_t* xcon, xcb_window_t win, xcb_rectangle_t* win_rect, xcb_gcontext_t gc, char* text, int font_size, char* font_path) { int size = min(strlen(text), 255); // check expected rendered size xcb_char2b_t* text_2b = xorg_str_to_2b(text, size); xcb_query_text_extents_cookie_t qtec = (xcb_query_text_extents(xcon, gc, size, text_2b)); free(text_2b); xcb_query_text_extents_reply_t* qter; if (!(qter = xcb_query_text_extents_reply(xcon, qtec, NULL))) { xcw_die("query_text_extents\n"); } int x = (win_rect->width - qter->overall_width) / 2; int y = (win_rect->height - qter->font_ascent - qter->font_descent) / 2; xcb_screen_t* screen; screen = xcb_setup_roots_iterator(xcb_get_setup(xcon)).data; xcb_pixmap_t pmap = xcb_generate_id(xcon); xcb_create_pixmap( xcon, screen->root_depth, pmap, screen->root, // doesn't matter win_rect->width, win_rect->height); xcb_render_pictforminfo_t* fmt; const xcb_render_query_pict_formats_reply_t* fmt_rep = xcb_render_util_query_formats(xcon); fmt = xcb_render_util_find_standard_format(fmt_rep, XCB_PICT_STANDARD_RGB_24); uint32_t values[2]; xcb_void_cookie_t cookie; xcb_render_picture_t picture = xcb_generate_id(xcon); values[0] = XCB_RENDER_POLY_MODE_IMPRECISE; values[1] = XCB_RENDER_POLY_EDGE_SMOOTH; cookie = xcb_render_create_picture_checked( xcon, picture, // pid pmap, // drawable fmt->id, // format XCB_RENDER_CP_POLY_MODE | XCB_RENDER_CP_POLY_EDGE, values); // make it smooth /*xcb_render_picture_t fg_pen = create_pen(xcon, 0xff0f, 0, 0xff00, 0xf000);*/ xcb_render_picture_t fg_pen = create_pen(xcon, 0x0f00, 0xff00, 0x0f00, 0xf000); char* temp = malloc(strlen(text)); strcpy(temp, text); struct utf_holder holder; holder = char_to_uint32(temp); /*int font_size = max(x, y) / 100 * 30;*/ xcb_render_glyphset_t font = load_glyphset(xcon, font_path, font_size, holder); xcb_render_util_composite_text_stream_t* ts = xcb_render_util_composite_text_stream(font, holder.length, 0); // draw the text (in holder) at certain positions xcb_render_util_glyphs_32( ts, x, // dx y, // dy holder.length, // holder.str); xcb_render_util_composite_text( xcon, // connection XCB_RENDER_PICT_OP_OVER, // op fg_pen, // src picture, // dst 0, // fmt 0, // src x 0, // src y ts); // txt stream xcb_copy_area( xcon, /* xcb_connection_t */ pmap, /* The Drawable we want to paste */ win, /* The Drawable on which we copy the previous Drawable */ gc, /* A Graphic Context */ 0, /* Top left x coordinate of the region to copy */ 0, /* Top left y coordinate of the region to copy */ 0, /* Top left x coordinate of the region where to copy */ 0, /* Top left y coordinate of the region where to copy */ win_rect->width, /* Width of the region to copy */ win_rect->height /* Height of the region to copy */ ); /*xcb_image_text_8(xcon, size, win, gc, x, y + qter->font_ascent, text);*/ } /** * Determine whether a window is 'normal' and visible according to the base * Xorg specification. */ int xorg_window_normal(xcb_connection_t* xcon, xcb_window_t window) { xcb_get_window_attributes_cookie_t gwac = (xcb_get_window_attributes(xcon, window)); xcb_get_window_attributes_reply_t* gwar; if (!(gwar = xcb_get_window_attributes_reply(xcon, gwac, NULL))) { xcw_die("get_window_attributes\n"); } return ( gwar->map_state == XCB_MAP_STATE_VIEWABLE && gwar->override_redirect == 0); } /** * Determine whether a window is a persistent application window according * EWMH. */ int ewmh_window_normal(xcw_state_t* state, xcb_window_t window) { xcb_get_property_cookie_t gpc = (xcb_get_property( state->xcon, 0, window, state->ewmh._NET_WM_WINDOW_TYPE, XCB_ATOM_ATOM, 0, 1)); xcb_get_property_reply_t* gpr; if (!(gpr = xcb_get_property_reply(state->xcon, gpc, NULL))) { xcw_die("get_property _NET_WM_WINDOW_TYPE\n"); } uint32_t* window_type = (uint32_t*)xcb_get_property_value(gpr); int prop_len = xcb_get_property_value_length(gpr); free(gpr); // if reply length is 0, window type isn't defined, so treat it as normal return ( prop_len == 0 || window_type[0] == state->ewmh._NET_WM_WINDOW_TYPE_TOOLBAR || window_type[0] == state->ewmh._NET_WM_WINDOW_TYPE_MENU || window_type[0] == state->ewmh._NET_WM_WINDOW_TYPE_UTILITY || window_type[0] == state->ewmh._NET_WM_WINDOW_TYPE_SPLASH || window_type[0] == state->ewmh._NET_WM_WINDOW_TYPE_DIALOG || window_type[0] == state->ewmh._NET_WM_WINDOW_TYPE_NORMAL); } /** * Get all windows from the X server. * * windows (output): window IDs * windows_size (output): size of `windows` */ void xorg_get_windows(xcw_state_t* state, xcb_window_t** windows, int* windows_size) { xcb_query_tree_cookie_t qtc = xcb_query_tree(state->xcon, state->xroot); xcb_query_tree_reply_t* qtr; if (!(qtr = xcb_query_tree_reply(state->xcon, qtc, NULL))) { xcw_die("query_tree\n"); } xcb_window_t* referenced_windows = xcb_query_tree_children(qtr); int size = xcb_query_tree_children_length(qtr); // copy for easier usage *windows = calloc(size, sizeof(xcb_window_t)); for (int i = 0; i < size; i++) (*windows)[i] = referenced_windows[i]; free(qtr); *windows_size = size; } /** * Get windows managed by the window manager. * * is_defined (output): whether the window manager defines the windows it * tracks; if 0, `windows` and `windows_size` will not be set * windows (output): window IDs * windows_size (output): size of `windows` */ void xorg_get_managed_windows( xcw_state_t* state, int* is_defined, xcb_window_t** windows, int* windows_size) { *is_defined = xorg_window_has_property( state->xcon, state->xroot, state->ewmh._NET_CLIENT_LIST); if (*is_defined) { xcb_get_property_cookie_t gpc = (xcb_get_property( state->xcon, 0, state->xroot, state->ewmh._NET_CLIENT_LIST, XCB_ATOM_WINDOW, 0, MAX_WINDOWS)); xcb_get_property_reply_t* gpr; if (!(gpr = xcb_get_property_reply(state->xcon, gpc, NULL))) { xcw_die("get_property _NET_CLIENT_LIST\n"); } xcb_window_t* referenced_windows = ((xcb_window_t*)xcb_get_property_value(gpr)); // each window ID is 4 bytes int size = xcb_get_property_value_length(gpr) / 4; // copy for easier usage *windows = calloc(size, sizeof(xcb_window_t)); for (int i = 0; i < size; i++) (*windows)[i] = referenced_windows[i]; free(gpr); *windows_size = size; } } /** * Determine whether a window is managed by the window manager. * * managed_windows: windows that are managed by the window manager */ int xorg_window_managed( xcb_window_t window, xcb_window_t* managed_windows, int managed_windows_size) { int found = 0; for (int i = 0; i < managed_windows_size; i++) { if (managed_windows[i] == window) { found = 1; break; } } return found; } /** * Determine whether a window is in the list of windows. */ int xorg_contains_window( xcb_window_t* windows, int windows_size, xcb_window_t window) { int found = 0; for (int i = 0; i < windows_size; i++) { if (windows[i] == window) { found = 1; break; } } return found; } /** * Initialise the connection to the X server. * * state (output): pointer to program state; `input` and `wsetups` are not * initialised */ void initialise_xorg(xcw_state_t** state) { int default_screen; // unused xcb_screen_t* screen; xcb_connection_t* xcon = xcb_connect(NULL, &default_screen); if (xcb_connection_has_error(xcon)) xcw_die("connect\n"); screen = xcb_setup_roots_iterator(xcb_get_setup(xcon)).data; if (screen == NULL) xcw_die("no screens\n"); xcb_window_t xroot = screen->root; xcb_ewmh_connection_t ewmh; xcb_intern_atom_cookie_t* ewmhc = xcb_ewmh_init_atoms(xcon, &ewmh); if (!xcb_ewmh_init_atoms_replies(&ewmh, ewmhc, NULL)) { xcw_die("ewmh init\n"); } xcb_key_symbols_t* ksymbols; ksymbols = xcb_key_symbols_alloc(xcon); if (ksymbols == NULL) xcw_die("key_symbols_alloc\n"); xcb_font_t overlay_font = xcb_generate_id(xcon); xcb_void_cookie_t ofc = xcb_open_font_checked( xcon, overlay_font, strlen(OVERLAY_FONT_NAME), OVERLAY_FONT_NAME); xorg_check_request(xcon, ofc, "open_font"); *state = malloc(sizeof(xcw_state_t)); xcw_state_t local_state = { xcon, xroot, ewmh, ksymbols, overlay_font, NULL, NULL, 0 }; **state = local_state; } // -- input handling /** * Find an item in a keysym lookup given its character. * * ksl: keysym lookup to search * c: character to search for * * returns: found item, NULL if no matching items were found */ keysyms_lookup_t* keysyms_lookup_find_char(keysyms_lookup_t* ksl, int ksl_size, char c) { for (int i = 0; i < ksl_size; i++) { if (ksl[i].character == c) { return &(ksl[i]); } } return NULL; } /** * Find an item in a keysym lookup given its keysym. * * ksl: keysym lookup to search * ksym: keysym to search for * * returns: found item, NULL if no matching items were found */ keysyms_lookup_t* keysyms_lookup_find_keysym( keysyms_lookup_t* ksl, int ksl_size, xcb_keysym_t ksym) { for (int i = 0; i < ksl_size; i++) { if (ksl[i].keysym == ksym) { return &(ksl[i]); } } return NULL; } /** * Acquire a Xorg keyboard grab on the root window. */ void initialise_input(xcw_state_t* state) { // wait a little for other programs to release the keyboard // since this program is likely to be launched from a hotkey daemon struct timespec ts = { 0, 1000000 }; // 1ms int status; for (int s = 0; s < 1000; s++) { // up to 1s total xcb_grab_keyboard_cookie_t gkc = xcb_grab_keyboard( state->xcon, 0, state->xroot, XCB_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); xcb_grab_keyboard_reply_t* gkr; if ((gkr = xcb_grab_keyboard_reply(state->xcon, gkc, NULL))) { status = gkr->status; free(gkr); if (status == XCB_GRAB_STATUS_ALREADY_GRABBED) { nanosleep(&ts, NULL); continue; } else if (status == XCB_GRAB_STATUS_SUCCESS) { break; } else { xcw_die("grab_keyboard: %d\n", status); } } else { xcw_die("grab_keyboard\n"); } } if (status == XCB_GRAB_STATUS_ALREADY_GRABBED) { xcw_die("grab_keyboard: already grabbed\n"); } } // -- overlay windows /** * Create an overlay window. * * x, y: absolute screen location * w, h: window size */ xcb_window_t* overlay_create(xcw_state_t* state, int x, int y, int w, int h) { xcb_window_t* win = malloc(sizeof(xcb_window_t)); *win = xcb_generate_id(state->xcon); uint32_t mask = (XCB_CW_BACK_PIXEL | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK); uint32_t values[] = { BG_COLOUR, 1, 1, XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS }; xcb_void_cookie_t cwc = xcb_create_window_checked( state->xcon, XCB_COPY_FROM_PARENT, *win, state->xroot, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_COPY_FROM_PARENT, mask, values); xorg_check_request(state->xcon, cwc, "create_window"); xcb_icccm_set_wm_class( state->xcon, *win, sizeof(OVERLAY_WINDOW_CLASS), OVERLAY_WINDOW_CLASS); xorg_window_move_resize(state->xcon, *win, x, y, w, h); xcb_void_cookie_t mwc = xcb_map_window_checked(state->xcon, *win); xorg_check_request(state->xcon, mwc, "map_window"); return win; } /** * Create a graphics context for drawing the background of an overlay window. * * win: the overlay window */ xcb_gcontext_t* overlay_get_bg_gc(xcb_connection_t* xcon, xcb_window_t win) { xcb_gcontext_t* gc = malloc(sizeof(xcb_gcontext_t)); *gc = xcb_generate_id(xcon); uint32_t mask = XCB_GC_FOREGROUND; uint32_t value_list[] = { BG_COLOUR }; xcb_void_cookie_t cgc = (xcb_create_gc_checked(xcon, *gc, win, mask, value_list)); xorg_check_request(xcon, cgc, "create_gc"); return gc; } /** * Create a graphics context for drawing the text of an overlay window. * * win: the overlay window */ xcb_gcontext_t* overlay_get_font_gc(xcw_state_t* state, xcb_window_t win) { xcb_gcontext_t* gc = malloc(sizeof(xcb_gcontext_t)); *gc = xcb_generate_id(state->xcon); uint32_t mask = XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_FONT; uint32_t value_list[] = { FG_COLOUR, BG_COLOUR, state->overlay_font }; xcb_void_cookie_t cgc = (xcb_create_gc_checked(state->xcon, *gc, win, mask, value_list)); xorg_check_request(state->xcon, cgc, "create_gc"); return gc; } /** * Set the text on an overlay window. `xcb_flush` should be called after * calling this function. * * wsetup: containing the overlay window (if there is no overlay window, this * function does nothing) * text: text to render (null-terminated, must be at most 255 characters) */ void overlay_set_text(xcw_state_t* state, window_setup_t* wsetup, char* text) { if (wsetup->overlay_window == NULL) return; xcb_window_t win = *(wsetup->overlay_window); if (wsetup->overlay_bg_gc == NULL) { wsetup->overlay_bg_gc = overlay_get_bg_gc(state->xcon, win); } if (wsetup->overlay_font_gc == NULL) { wsetup->overlay_font_gc = overlay_get_font_gc(state, win); } xcb_poly_fill_rectangle( state->xcon, win, *(wsetup->overlay_bg_gc), 1, wsetup->overlay_rect); xorg_draw_text_centred( state->xcon, win, wsetup->overlay_rect, *(wsetup->overlay_font_gc), text, state->input->font_size, state->input->font_path); } /** * See `overlays_set_text`. `xcb_flush` should be called after calling * this * function. * * wsetups: array of setup structures containing overlay windows to render text * on (recursively) * text: prefix to text rendered to every overlay window (null-terminated) */ void _overlays_set_text( xcw_state_t* state, window_setup_t* wsetups, int wsetups_size, char* text) { int text_size = strlen(text); // there's no way we're every going to reach 255 characters with the // current setup; this is just in case extra static text gets added if (text_size + 1 > 255) { xcw_warn("refusing to render text longer than 255 characters\n"); } else for (int i = 0; i < wsetups_size; i++) { window_setup_t* wsetup = &(wsetups[i]); // next level down is 1 character longer, plus 1 for null char* new_text = calloc(text_size + 2, sizeof(char)); strcpy(new_text, text); new_text[text_size] = wsetup->character; new_text[text_size + 1] = '\0'; overlay_set_text(state, wsetup, new_text); if (wsetup->children != NULL) { _overlays_set_text( state, wsetup->children, wsetup->children_size, new_text); } free(new_text); } } /** * Update text on all overlay windows. */ void overlays_set_text(xcw_state_t* state) { char* text = ""; _overlays_set_text(state, state->wsetups, state->wsetups_size, text); xcb_flush(state->xcon); } // -- wsetup utilities /** * Create a bottom-level `wsetup_t`. * * window: the window to track * character: bottom-level character in the window label */ window_setup_t initialise_window_setup(xcw_state_t* state, xcb_window_t window, char character) { // an xcb_window_t is an xcb_drawable_t xcb_get_geometry_cookie_t ggc = xcb_get_geometry(state->xcon, window); xcb_get_geometry_reply_t* ggr; if (!(ggr = xcb_get_geometry_reply(state->xcon, ggc, NULL))) { xcw_die("get_geometry\n"); } xcb_rectangle_t rect = { 0, 0, ggr->width, ggr->height }; xcb_rectangle_t* rectp = malloc(sizeof(xcb_rectangle_t)); *rectp = rect; // guaranteed that ksl_size <= windows_size xcb_window_t* overlay_window = overlay_create( state, ggr->border_width + ggr->x, ggr->border_width + ggr->y, rect.width, rect.height); xcb_window_t* window_p = malloc(sizeof(xcb_window_t)); *window_p = window; window_setup_t wsetup = { overlay_window, NULL, NULL, rectp, window_p, character, NULL, 0 }; return wsetup; } /** * See `initialise_window_tracking`. * * remain_depth: number of nested levels remaining (we choose a character in * the string to type at every level; if 0, we choose the last character) */ void _initialise_window_tracking( xcw_state_t* state, int remain_depth, xcb_window_t* windows, int windows_size, window_setup_t** wsetups, int* wsetups_size) { if (remain_depth == 0) { *wsetups = calloc(windows_size, sizeof(window_setup_t)); *wsetups_size = windows_size; for (int i = 0; i < windows_size; i++) { // guaranteed that ksl_size <= windows_size (*wsetups)[i] = initialise_window_setup( state, windows[i], state->input->ksl[i].character); } } else { // base number of windows 'used up' per iteration int p = windows_size / state->input->ksl_size; // number of iterations to use one extra window int r = windows_size % state->input->ksl_size; // required number of iterations to use all windows int n = p > 0 ? state->input->ksl_size : r; *wsetups = calloc(n, sizeof(window_setup_t)); *wsetups_size = n; xcb_window_t* remain_windows = windows; for (int i = 0; i < n; i++) { window_setup_t* children = NULL; int children_size; int children_windows_size = i < r ? p + 1 : p; if (children_windows_size == 1) { (*wsetups)[i] = initialise_window_setup( state, *remain_windows, state->input->ksl[i].character); } else { _initialise_window_tracking( state, remain_depth - 1, remain_windows, children_windows_size, &children, &children_size); window_setup_t wsetup = { NULL, NULL, NULL, NULL, NULL, state->input->ksl[i].character, children, children_size }; (*wsetups)[i] = wsetup; } remain_windows += children_windows_size; } } } /** * Construct data for tracked windows in a nested structure matching the * characters that need to be typed to choose them. * * state: the result is stored in here * windows: tracked windows */ void initialise_window_tracking( xcw_state_t* state, xcb_window_t* windows, int windows_size) { _initialise_window_tracking( state, // the length of each tracking string (int)(log(max(windows_size - 1, 1)) / log(state->input->ksl_size)), windows, windows_size, &(state->wsetups), &(state->wsetups_size)); } /** * See `wsetup_debug_print`. * * depth: current depth in the structure, starting at 0, used for indentation */ void _wsetup_debug_print(window_setup_t* wsetup, int depth) { printf("[wsetup] "); for (int i = 0; i < depth; i++) printf(" "); printf("%c", wsetup->character); if (wsetup->window == NULL) printf("\n"); else printf(" %x\n", *(wsetup->window)); if (wsetup->children != NULL) { for (int i = 0; i < wsetup->children_size; i++) { _wsetup_debug_print(&(wsetup->children[i]), depth + 1); } } } /** * Print a setup structure to stdout. */ void wsetup_debug_print(window_setup_t* wsetup) { _wsetup_debug_print(wsetup, 0); } /** * Destroy all overlay windows in a setup structure and free the structure's * used memory. */ void wsetup_free(xcb_connection_t* xcon, window_setup_t* wsetup) { xcb_window_t* w = wsetup->overlay_window; if (w != NULL) { xcb_destroy_window_checked(xcon, *w); free(wsetup->overlay_rect); } if (wsetup->overlay_bg_gc != NULL) { xcb_free_gc(xcon, *(wsetup->overlay_bg_gc)); free(wsetup->overlay_bg_gc); } if (wsetup->overlay_font_gc != NULL) { xcb_free_gc(xcon, *(wsetup->overlay_font_gc)); free(wsetup->overlay_font_gc); } if (wsetup->children != NULL) { for (int i = 0; i < wsetup->children_size; i++) { window_setup_t* child = &(wsetup->children[i]); wsetup_free(xcon, child); } free(wsetup->children); } xcb_flush(xcon); } /** * Choose the window in a setup structure or replace the current array of setup * structures with its children. Updates text rendered on overlay windows. * Exits the process if a window is chosen. */ void wsetup_choose(xcw_state_t* state, window_setup_t* wsetup) { if (wsetup->window != NULL && wsetup->children_size == 0) { choose_window(state->input, *(wsetup->window)); } else { state->wsetups = wsetup->children; state->wsetups_size = wsetup->children_size; overlays_set_text(state); } } /** * Reduce a setup structure by choosing an item. Frees removed parts of the * structure. * * index: array index in `wsetups` to choose */ void wsetups_descend_by_index(xcw_state_t* state, int index) { // state changes during iteration window_setup_t* wsetups = state->wsetups; int wsetups_size = state->wsetups_size; for (int i = 0; i < wsetups_size; i++) { if (i == index) wsetup_choose(state, &(wsetups[i])); else wsetup_free(state->xcon, &(wsetups[i])); } } /** * Reduce a setup structure by choosing a character, then reduce recursively * like `wsetups_descend_by_index`. Exits the process if the character doesn't * correspond to any options. Frees removed parts of the structure. * * c: character to choose */ void wsetups_descend_by_char(xcw_state_t* state, char c) { int index = -1; for (int i = 0; i < state->wsetups_size; i++) { if (state->wsetups[i].character == c) { index = i; break; } } if (index == -1) xcw_exit_no_match(); else wsetups_descend_by_index(state, index); } // -- program /** * Get the windows to track. * * windows (output): window IDs * windows_size (output): size of `windows` */ void initialise_tracked_windows( xcw_state_t* state, xcb_window_t** windows, int* windows_size) { xcb_window_t* all_windows; int all_windows_size; xorg_get_windows(state, &all_windows, &all_windows_size); int managed_windows_defined; xcb_window_t* managed_windows; int managed_windows_size; xorg_get_managed_windows( state, &managed_windows_defined, &managed_windows, &managed_windows_size); *windows = calloc(all_windows_size, sizeof(xcb_window_t)); int size = 0; for (int i = 0; i < all_windows_size; i++) { if ( // ignore if not managed by the window manager !(managed_windows_defined && !xorg_window_managed( all_windows[i], managed_windows, managed_windows_size)) && // only include if whitelisted (state->input->whitelist_size == 0 || xorg_contains_window( state->input->whitelist, state->input->whitelist_size, all_windows[i])) && // ignore if blacklisted !xorg_contains_window( state->input->blacklist, state->input->blacklist_size, all_windows[i]) && xorg_window_normal(state->xcon, all_windows[i]) && ewmh_window_normal(state, all_windows[i])) { (*windows)[size] = all_windows[i]; size += 1; } } *windows = realloc(*windows, size * sizeof(xcb_window_t)); *windows_size = size; if (managed_windows_defined) free(managed_windows); free(all_windows); } /** * Make adjustments to tracking windows based on a keypress event. Exits the * process if this chooses a window. */ void handle_keypress(xcw_state_t* state, xcb_key_press_event_t* kp) { xcb_keysym_t ksym = xcb_key_press_lookup_keysym(state->ksymbols, kp, 0); keysyms_lookup_t* ksl_item = (keysyms_lookup_find_keysym( state->input->ksl, state->input->ksl_size, ksym)); if (ksl_item == NULL) { xcw_exit_no_match(); } else { wsetups_descend_by_char(state, ksl_item->character); } } /** * Parse the `CHARACTERS` argument. May call `argp_error`. * * char_pool: value passed for the argument * input: result is placed in here */ void parse_arg_characters( char* char_pool, struct argp_state* state, xcw_input_t* input) { // we won't put more than `char_pool` items in `ksl` int pool_size = strlen(char_pool); input->ksl = calloc(pool_size, sizeof(keysyms_lookup_t)); int size = 0; // check validity of characters, compile lookup for (int i = 0; i < pool_size; i++) { char c = char_pool[i]; keysyms_lookup_t* ksl_item = keysyms_lookup_find_char(ALL_KEYSYMS_LOOKUP, ALL_KEYSYMS_LOOKUP_SIZE, c); if (ksl_item == NULL) { argp_error(state, "CHARACTERS argument: unknown character: %c", c); } // don't allow duplicates in lookup if (keysyms_lookup_find_char(input->ksl, size, c) == NULL) { input->ksl[size] = *ksl_item; size += 1; } } if (size < 2) { argp_error(state, "CHARACTERS argument: expected at least two characters"); } input->ksl = realloc(input->ksl, sizeof(keysyms_lookup_t) * size); input->ksl_size = size; } /** * Parse the `--blacklist` or `--whitelist` option. May call `argp_error`. * * window_id: value passed to the option * windows: result is added to this list, and its size updated */ void parse_arg_window_list( char* window_id, struct argp_state* state, xcb_window_t** windows, int* windows_size) { errno = 0; long int window = strtol(window_id, NULL, 0); // Xorg window IDs are 32-bit unsigned if (errno != 0 || window <= 0 || window > 0xffffffff) { argp_error(state, "invalid value for window ID: %s", window_id); } *windows = realloc(*windows, sizeof(xcb_window_t) * (*windows_size + 1)); (*windows)[*windows_size] = window; *windows_size += 1; } /** * Parse the `--format` option. May call `argp_error`. * * format: value passed to the option * input: result is placed in here */ void parse_arg_format(char* format, struct argp_state* state, xcw_input_t* input) { if (strcmp(format, "decimal") == 0) { input->format = FORMAT_DEC; } else if (strcmp(format, "hexadecimal") == 0) { input->format = FORMAT_HEX; } else { argp_error(state, "invalid value for output format: %s", format); } } /** * Parse the `--font-size` option. May call `argp_error`. * * font_size: value passed to the option * input: result is placed in here */ void parse_arg_font_size( char* font_size, struct argp_state* state, xcw_input_t* input) { input->font_size = atoi(font_size); } /** * Parse the `--font-path` option. May call `argp_error`. * * font_path: value passed to the option * input: result is placed in here */ void parse_arg_font_path( char* font_path, struct argp_state* state, xcw_input_t* input) { input->font_path = font_path; } /** * Argument parsing function for use with `argp`. * * state: `input` is `xcw_input_t*`, which points to an allocated instance that * gets populated by calls to this function */ error_t parse_arg(int key, char* value, struct argp_state* state) { xcw_input_t* input = (xcw_input_t*)(state->input); if (key == 'b') { parse_arg_window_list( value, state, &(input->blacklist), &(input->blacklist_size)); return 0; } else if (key == 'w') { parse_arg_window_list( value, state, &(input->whitelist), &(input->whitelist_size)); return 0; } else if (key == 'f') { parse_arg_format(value, state, input); return 0; } else if (key == 's') { parse_arg_font_size(value, state, input); return 0; } else if (key == 't') { parse_arg_font_path(value, state, input); return 0; } else if (key == ARGP_KEY_ARG) { if (state->arg_num == 0) { parse_arg_characters(value, state, input); return 0; } else { return ARGP_ERR_UNKNOWN; } } else { return ARGP_ERR_UNKNOWN; } } /** * Parse command-line arguments. * * argc, argv: as passed to `main` */ xcw_input_t* parse_args(int argc, char** argv) { struct argp_option options[] = { { "blacklist", 'b', "WINDOWID", 0, "IDs of windows to ignore (specify this option multiple times)" }, { "whitelist", 'w', "WINDOWID", 0, "IDs of windows to include (include all if none specified) \ (specify this option multiple times)" }, { "format", 'f', "FORMAT", 0, "Output format: 'decimal' or 'hexadecimal'" }, { "font-size", 's', "FONT-SIZE", 0, "size of text font that will be displayed in your window" }, { "font-path", 't', "FONT-PATH", 0, "which font you want to use, please give the font(ttf) absolute path" }, { 0 } }; struct argp parser = { options, parse_arg, "CHARACTERS", "\n\ Running the program draws a string of characters over each visible window. \ Typing one of those strings causes the program to print the corresponding \ window ID to standard output and exit. If any non-matching keys are pressed, \ the program exits without printing anything.\n\ \n\ CHARACTERS defines the characters available for use in the displayed strings; \ eg. 'asdfjkl' is a good choice for a QWERTY keyboard layout. Allowed \ characters are the numbers 0-9 and the letters a-z.\n\ \n\ The program exits with status 0 on success, 64 on invalid arguments, and 70 if \ an unexpected error occurs.", NULL, NULL, NULL }; xcw_input_t input = { NULL, 0, NULL, 0 }; xcw_input_t* inputp = malloc(sizeof(xcw_input_t)); *inputp = input; argp_parse(&parser, argc, argv, 0, NULL, inputp); if (inputp->ksl == NULL) { xcw_fail(EX_USAGE, "missing CHARACTERS argument\n"); } return inputp; } int main(int argc, char** argv) { xcw_input_t* input = parse_args(argc, argv); xcw_state_t* state; initialise_xorg(&state); state->input = input; initialise_input(state); xcb_window_t* windows; int windows_size; initialise_tracked_windows(state, &windows, &windows_size); initialise_window_tracking(state, windows, windows_size); free(windows); if (state->wsetups_size == 0) { xcw_exit_no_match(); } else if (state->wsetups_size == 1) { wsetup_choose(state, &(state->wsetups[0])); } else { overlays_set_text(state); } xcb_generic_event_t* event; while (1) if ((event = xcb_poll_for_event(state->xcon))) { switch (event->response_type & ~0x80) { case 0: { xcb_generic_error_t* evterr = (xcb_generic_error_t*)event; xcw_die("event loop error: %d\n", evterr->error_code); break; } case XCB_EXPOSE: { overlays_set_text(state); break; } case XCB_KEY_PRESS: { handle_keypress(state, (xcb_key_press_event_t*)event); break; } } free(event); } return 0; }
26.556107
80
0.667935
[ "render" ]
be75407936d721ff336f7c45994781ccd65ab7aa
6,375
c
C
intern/openmesheffect/plugins/mfx_identity_plugin.c
hammeron-art/OpenMeshEffectForBlender
cde6162790200e6b99ba5b973f5e6c82e1e8b534
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
intern/openmesheffect/plugins/mfx_identity_plugin.c
hammeron-art/OpenMeshEffectForBlender
cde6162790200e6b99ba5b973f5e6c82e1e8b534
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
intern/openmesheffect/plugins/mfx_identity_plugin.c
hammeron-art/OpenMeshEffectForBlender
cde6162790200e6b99ba5b973f5e6c82e1e8b534
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
/* * Copyright 2019 Elie Michel * * 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 <stdbool.h> #include <string.h> #include "ofxCore.h" #include "ofxMeshEffect.h" typedef struct PluginRuntime { OfxHost *host; OfxPropertySuiteV1 *propertySuite; OfxParameterSuiteV1 *parameterSuite; OfxMeshEffectSuiteV1 *meshEffectSuite; } PluginRuntime; PluginRuntime gRuntime; static OfxStatus describe(PluginRuntime *runtime, OfxMeshEffectHandle descriptor) { bool missing_suite = NULL == runtime->propertySuite || NULL == runtime->parameterSuite || NULL == runtime->meshEffectSuite; if (missing_suite) { return kOfxStatErrMissingHostFeature; } OfxMeshEffectSuiteV1 *meshEffectSuite = runtime->meshEffectSuite; OfxPropertySuiteV1 *propertySuite = runtime->propertySuite; OfxPropertySetHandle inputProperties; meshEffectSuite->inputDefine(descriptor, kOfxMeshMainInput, &inputProperties); propertySuite->propSetString(inputProperties, kOfxPropLabel, 0, "Main Input"); OfxPropertySetHandle outputProperties; meshEffectSuite->inputDefine(descriptor, kOfxMeshMainOutput, &outputProperties); propertySuite->propSetString(outputProperties, kOfxPropLabel, 0, "Main Output"); return kOfxStatOK; } static OfxStatus cook(PluginRuntime *runtime, OfxMeshEffectHandle instance) { OfxMeshEffectSuiteV1 *meshEffectSuite = runtime->meshEffectSuite; OfxPropertySuiteV1 *propertySuite = runtime->propertySuite; OfxTime time = 0; // Get input/output OfxMeshInputHandle input, output; meshEffectSuite->inputGetHandle(instance, kOfxMeshMainInput, &input, NULL); meshEffectSuite->inputGetHandle(instance, kOfxMeshMainOutput, &output, NULL); // Get meshes OfxPropertySetHandle input_mesh, output_mesh; meshEffectSuite->inputGetMesh(input, time, &input_mesh); meshEffectSuite->inputGetMesh(output, time, &output_mesh); // Get input mesh data int input_point_count = 0, input_vertex_count = 0, input_face_count = 0; float *input_points; int *input_vertices, *input_faces; propertySuite->propGetInt(input_mesh, kOfxMeshPropPointCount, 0, &input_point_count); propertySuite->propGetInt(input_mesh, kOfxMeshPropVertexCount, 0, &input_vertex_count); propertySuite->propGetInt(input_mesh, kOfxMeshPropFaceCount, 0, &input_face_count); propertySuite->propGetPointer(input_mesh, kOfxMeshPropPointData, 0, (void**)&input_points); propertySuite->propGetPointer(input_mesh, kOfxMeshPropVertexData, 0, (void**)&input_vertices); propertySuite->propGetPointer(input_mesh, kOfxMeshPropFaceData, 0, (void**)&input_faces); // Allocate output mesh int output_point_count = input_point_count; int output_vertex_count = input_vertex_count; int output_face_count = input_face_count; meshEffectSuite->meshAlloc(output_mesh, output_point_count, output_vertex_count, output_face_count); // Get output mesh data float *output_points; int *output_vertices, *output_faces; propertySuite->propGetPointer(output_mesh, kOfxMeshPropPointData, 0, (void**)&output_points); propertySuite->propGetPointer(output_mesh, kOfxMeshPropVertexData, 0, (void**)&output_vertices); propertySuite->propGetPointer(output_mesh, kOfxMeshPropFaceData, 0, (void**)&output_faces); // Fill in output data memcpy(output_points, input_points, 3 * input_point_count * sizeof(float)); memcpy(output_vertices, input_vertices, input_vertex_count * sizeof(int)); memcpy(output_faces, input_faces, input_face_count * sizeof(int)); // Release meshes meshEffectSuite->inputReleaseMesh(input_mesh); meshEffectSuite->inputReleaseMesh(output_mesh); return kOfxStatOK; } static OfxStatus mainEntry(const char *action, const void *handle, OfxPropertySetHandle inArgs, OfxPropertySetHandle outArgs) { (void)inArgs; (void)outArgs; if (0 == strcmp(action, kOfxActionLoad)) { return kOfxStatOK; } if (0 == strcmp(action, kOfxActionUnload)) { return kOfxStatOK; } if (0 == strcmp(action, kOfxActionDescribe)) { return describe(&gRuntime, (OfxMeshEffectHandle)handle); } if (0 == strcmp(action, kOfxActionCreateInstance)) { return kOfxStatOK; } if (0 == strcmp(action, kOfxActionDestroyInstance)) { return kOfxStatOK; } if (0 == strcmp(action, kOfxMeshEffectActionCook)) { return cook(&gRuntime, (OfxMeshEffectHandle)handle); } return kOfxStatReplyDefault; } static void setHost(OfxHost *host) { gRuntime.host = host; if (NULL != host) { gRuntime.propertySuite = host->fetchSuite(host->host, kOfxPropertySuite, 1); gRuntime.parameterSuite = host->fetchSuite(host->host, kOfxParameterSuite, 1); gRuntime.meshEffectSuite = host->fetchSuite(host->host, kOfxMeshEffectSuite, 1); } } OfxExport int OfxGetNumberOfPlugins(void) { return 1; } OfxExport OfxPlugin *OfxGetPlugin(int nth) { (void)nth; static OfxPlugin plugin = { /* pluginApi */ kOfxMeshEffectPluginApi, /* apiVersion */ kOfxMeshEffectPluginApiVersion, /* pluginIdentifier */ "MirrorPlugin", /* pluginVersionMajor */ 1, /* pluginVersionMinor */ 0, /* setHost */ setHost, /* mainEntry */ mainEntry }; return &plugin; }
37.721893
86
0.672784
[ "mesh" ]
be7a153e69c088ff4cc67c9c618fc4c9e447020d
8,441
h
C
lib/badapt/badapt_activator.h
johsteffens/beth
d1812bde925f8622b3016ac6822f099b860af03d
[ "Apache-2.0" ]
3
2019-08-12T12:44:08.000Z
2020-08-05T16:41:50.000Z
lib/badapt/badapt_activator.h
johsteffens/beth
d1812bde925f8622b3016ac6822f099b860af03d
[ "Apache-2.0" ]
null
null
null
lib/badapt/badapt_activator.h
johsteffens/beth
d1812bde925f8622b3016ac6822f099b860af03d
[ "Apache-2.0" ]
null
null
null
/** Author and Copyright 2019 Johannes Bernhard Steffens * * 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. */ #ifndef BADAPT_ACTIVATOR_H #define BADAPT_ACTIVATOR_H #include "bmath_std.h" #include "badapt.xo.h" /**********************************************************************************************************************/ /// activation function XOILA_DEFINE_GROUP( badapt_activation, bcore_inst ) #ifdef XOILA_SECTION feature strict 'pa' f3_t fx( c @* o, f3_t x ); // y = f( x ) feature strict 'pa' f3_t dy( c @* o, f3_t y ); // dy = d( y ) (derivative applied on y) // ======= (trivial activations) ============ stamp :zero_s = aware : { func : .fx = { return 0.0; }; func : .dy = { return 0.0; }; }; stamp :one_s = aware : { func : .fx = { return 1.0; }; func : .dy = { return 0.0; }; }; stamp :linear_s = aware : { func : .fx = { return x; }; func : .dy = { return 1.0; }; }; // ======= (logistic function) ============ stamp :sigm_s = aware : { func : .fx = { return ( x > -700 ) ? ( 1.0 / ( 1.0 + exp( -x ) ) ) : 0; }; func : .dy = { return y * ( 1.0 - y ); }; }; stamp :sigm_hard_s = aware : { func : .fx = { return ( x < -2.0 ) ? 0.0 : ( x > 2.0 ) ? 1.0 : 0.25 * ( x + 2.0 ); }; func : .dy = { return ( y < 0.0 ) ? 0.0 : ( y > 1.0 ) ? 0.0 : 0.25; }; }; stamp :sigm_leaky_s = aware : { func : .fx = { return ( x < -2.0 ) ? 0.01 * ( x + 2.0 ) : ( x > 2.0 ) ? 1.0 + 0.01 * ( x - 2.0 ) : 0.25 * ( x + 2.0 ); }; func : .dy = { return ( y < 0.0 ) ? 0.01 : ( y > 1.0 ) ? 0.01 : 0.25; }; }; // ======= (tanh) ========================= stamp :tanh_s = aware : { func : .fx = { return ( x < 350 ) ? ( 1.0 - ( 2.0 / ( exp( 2.0 * x ) + 1.0 ) ) ) : 1.0; }; func : .dy = { return 1.0 - f3_sqr( y ); }; }; stamp :tanh_hard_s = aware : { func : .fx = { return ( x < -1.0 ) ? -1.0 : ( x > 1.0 ) ? 1.0 : x; }; func : .dy = { return ( y < -1.0 ) ? 0.0 : ( y > 1.0 ) ? 0.0 : 1.0; }; }; stamp :tanh_leaky_s = aware : { func : .fx = { return ( x < -1.0 ) ? -1.0 + 0.01 * ( x + 1.0 ) : ( x > 1.0 ) ? 1.0 + 0.01 * ( x - 1.0 ) : x; }; func : .dy = { return ( y < -1.0 ) ? 0.01 : ( y > 1.0 ) ? 0.01 : 1.0; }; }; // ======= (softplus function) ============ stamp :softplus_s = aware : { func : .fx = { return ( x < 700 ) ? log( 1.0 + exp( x ) ) : x; }; func : .dy = { f3_t u = exp( y ); return ( u - 1.0 ) / u; }; }; stamp :relu_s = aware : { func : .fx = { return x > 0 ? x : 0; }; func : .dy = { return y > 0 ? 1 : 0; }; }; stamp :leaky_relu_s = aware : { func : .fx = { return x > 0 ? x : x * 0.01; }; func : .dy = { return y > 0 ? 1 : 0.01; }; }; #endif // XOILA_SECTION /**********************************************************************************************************************/ /// activator: (adaptive) activation applied to a vector XOILA_DEFINE_GROUP( badapt_activator, bcore_inst ) #ifdef XOILA_SECTION /// activation function feature c badapt_activation* get_activation( c @* o ) = { return NULL; }; feature void set_activation( m @* o, c badapt_activation* activation ) = {}; /// fast concurrent inference feature strict void infer( c @* o, c bmath_vf3_s* in, m bmath_vf3_s* out ); /// fast concurrent gradient backpropagation (no changing of state) /// grad_in and grad_out may refer to the same object feature strict void bgrad( c @* o, m bmath_vf3_s* grad_in, c bmath_vf3_s* grad_out, c bmath_vf3_s* out ); // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// Activator without bias. stamp :plain_s = aware : { aware badapt_activation => activation; func : .infer = { assert( in->size == out->size ); const badapt_activation_spect_s* activation_p = badapt_activation_spect_s_get_aware( o->activation ); for( sz_t i = 0; i < out->size; i++ ) { out->data[ i ] = badapt_activation_p_fx( activation_p, o->activation, in->data[ i ] ); } }; func : .bgrad = { assert( grad_in->size == grad_out->size ); assert( grad_in->size == out->size ); const badapt_activation_spect_s* activation_p = badapt_activation_spect_s_get_aware( o->activation ); for( sz_t i = 0; i < out->size; i++ ) { grad_in->data[ i ] = badapt_activation_p_dy( activation_p, o->activation, out->data[ i ] ) * grad_out->data[ i ]; } }; func : .set_activation = { badapt_activation_a_replicate( o.activation.2, activation ); }; func : .get_activation = { return o->activation; }; }; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// softmax activator. stamp :softmax_s = aware : { func : .infer = { f3_t max = bmath_vf3_s_max( in ); f3_t sum = 0; for( sz_t i = 0; i < out->size; i++ ) { f3_t v = exp( in->data[ i ] - max ); sum += v; out->data[ i ] = v; } bmath_vf3_s_mul_f3( out, 1.0 / sum, out ); }; func : .bgrad = { f3_t dpd = bmath_vf3_s_f3_mul_vec( grad_out, out ); for( sz_t i = 0; i < grad_in->size; i++ ) { grad_in->data[ i ] = out->data[ i ] * ( grad_out->data[ i ] - dpd ); } }; }; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// specifies which activator is used for which layer; negative layer number means relative to last layer + 1 stamp badapt_layer_activator_s = aware bcore_inst { sz_t layer; aware badapt_activator => activator; }; stamp badapt_arr_layer_activator_s = aware x_array { badapt_layer_activator_s [] arr; wrap x_array.push_d; }; stamp badapt_arr_activator_s = aware x_array { aware badapt_activator => [] arr; wrap x_array.set_size; }; #endif // XOILA_SECTION /**********************************************************************************************************************/ badapt_activator* badapt_activator_create_from_types( tp_t tp_activator, tp_t tp_activation ); badapt_activator* badapt_activator_create_from_names( sc_t sc_activator, sc_t sc_activation ); badapt_layer_activator_s* badapt_layer_activator_s_create_from_types( sz_t layer, tp_t tp_activator, tp_t tp_activation ); void badapt_arr_layer_activator_s_push_from_types( badapt_arr_layer_activator_s* o, sz_t layer, tp_t tp_activator, tp_t tp_activation ); void badapt_arr_layer_activator_s_push_from_names( badapt_arr_layer_activator_s* o, sz_t layer, sc_t activator, sc_t tp_activation ); //sc: only specifying part (e.g. "plain", "tanh") const badapt_activator* badapt_arr_layer_activator_s_get_activator( const badapt_arr_layer_activator_s* o, sz_t index, sz_t layers ); // returns activator for given layer /// constructs array from layer-activators void badapt_arr_activator_s_setup_from_arr_layer_activator( badapt_arr_activator_s* o, const badapt_arr_layer_activator_s* arr, sz_t layers ); badapt_activator_plain_s* badapt_activator_plain_s_create_activation( const badapt_activation* activation ); /**********************************************************************************************************************/ vd_t badapt_activator_signal_handler( const bcore_signal_s* o ); #endif // BADAPT_ACTIVATOR_H
39.443925
183
0.504206
[ "object", "vector" ]
be8674e1cdcd96f57e0b80451ba0a244d0de442d
4,272
h
C
Sources/Elastos/Frameworks/Droid/Base/Core/inc/elastos/droid/telecom/VideoCallImpl.h
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
7
2017-07-13T10:34:54.000Z
2021-04-16T05:40:35.000Z
Sources/Elastos/Frameworks/Droid/Base/Core/inc/elastos/droid/telecom/VideoCallImpl.h
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
null
null
null
Sources/Elastos/Frameworks/Droid/Base/Core/inc/elastos/droid/telecom/VideoCallImpl.h
jingcao80/Elastos
d0f39852356bdaf3a1234743b86364493a0441bc
[ "Apache-2.0" ]
9
2017-07-13T12:33:20.000Z
2021-06-19T02:46:48.000Z
//========================================================================= // Copyright (C) 2012 The Elastos 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. //========================================================================= #ifndef __ELASTOS_DROID_TELECOM_VIDEOCALLIMPL_H__ #define __ELASTOS_DROID_TELECOM_VIDEOCALLIMPL_H__ #include "Elastos.Droid.Telecom.h" #include "elastos/droid/os/Handler.h" #include <elastos/core/Object.h> using Elastos::Droid::Os::Handler; using Elastos::Droid::Os::IMessage; using Elastos::Droid::Os::IHandler; using Elastos::Droid::Os::ILooper; using Elastos::Droid::Internal::Telecom::IIVideoProvider; using Elastos::Droid::View::ISurface; using Elastos::Core::Object; namespace Elastos { namespace Droid { namespace Telecom { /** * Implementation of a Video Call, which allows InCallUi to communicate commands to the underlying * {@link Connection.VideoProvider}, and direct callbacks from the * {@link Connection.VideoProvider} to the appropriate {@link VideoCall.Listener}. * * {@hide} */ class VideoCallImpl : public Object , public IInCallServiceVideoCall , public IVideoCallImpl { public: class ProxyDeathRecipient : public Object , public IProxyDeathRecipient { public: CAR_INTERFACE_DECL() ProxyDeathRecipient( /* [in] */ VideoCallImpl* host); CARAPI ProxyDied(); public: VideoCallImpl* mHost; }; class MyHandler : public Handler { public: TO_STRING_IMPL("VideoCallImpl::MyHandler") MyHandler( /* [in] */ ILooper* loop, /* [in] */ VideoCallImpl* host); CARAPI HandleMessage( /* [in] */ IMessage* msg); public: VideoCallImpl* mHost; }; public: CAR_INTERFACE_DECL() VideoCallImpl(); /** {@hide} */ CARAPI constructor( /* [in] */ IIVideoProvider* videoProvider); /** {@inheritDoc} */ CARAPI SetVideoCallListener( /* [in] */ IVideoCallListener* videoCallListener); /** {@inheritDoc} */ CARAPI SetCamera( /* [in] */ const String& cameraId); /** {@inheritDoc} */ CARAPI SetPreviewSurface( /* [in] */ ISurface* surface); /** {@inheritDoc} */ CARAPI SetDisplaySurface( /* [in] */ ISurface* surface); /** {@inheritDoc} */ CARAPI SetDeviceOrientation( /* [in] */ Int32 rotation); /** {@inheritDoc} */ CARAPI SetZoom( /* [in] */ Float value); /** {@inheritDoc} */ CARAPI SendSessionModifyRequest( /* [in] */ IVideoProfile* requestProfile); /** {@inheritDoc} */ CARAPI SendSessionModifyResponse( /* [in] */ IVideoProfile* responseProfile); /** {@inheritDoc} */ CARAPI RequestCameraCapabilities(); /** {@inheritDoc} */ CARAPI RequestCallDataUsage(); /** {@inheritDoc} */ CARAPI SetPauseImage( /* [in] */ const String& uri); public: static const Int32 MSG_RECEIVE_SESSION_MODIFY_REQUEST; static const Int32 MSG_RECEIVE_SESSION_MODIFY_RESPONSE; static const Int32 MSG_HANDLE_CALL_SESSION_EVENT; static const Int32 MSG_CHANGE_PEER_DIMENSIONS; static const Int32 MSG_CHANGE_CALL_DATA_USAGE; static const Int32 MSG_CHANGE_CAMERA_CAPABILITIES; AutoPtr<IIVideoProvider> mVideoProvider; AutoPtr<IVideoCallListenerBinder> mBinder; AutoPtr<IVideoCallListener> mVideoCallListener; AutoPtr<IProxyDeathRecipient> mDeathRecipient; /** Default handler used to consolidate binder method calls onto a single thread. */ AutoPtr<IHandler> mHandler; }; } // namespace Telecom } // namespace Droid } // namespace Elastos #endif //__ELASTOS_DROID_TELECOM_VIDEOCALLIMPL_H__
27.56129
98
0.64911
[ "object" ]
be8d35ef494f5a60b686788feb70a8b4100a7ddf
7,822
h
C
src/library/rangetree.h
wunderfeyd/tippse
588faf919fbd5902b4ca8eef595c6c3675e9ca4d
[ "CC0-1.0" ]
7
2017-06-25T06:38:47.000Z
2020-12-06T00:05:39.000Z
src/library/rangetree.h
wunderfeyd/tippse
588faf919fbd5902b4ca8eef595c6c3675e9ca4d
[ "CC0-1.0" ]
25
2017-09-23T16:41:04.000Z
2020-12-17T13:22:55.000Z
src/library/rangetree.h
wunderfeyd/tippse
588faf919fbd5902b4ca8eef595c6c3675e9ca4d
[ "CC0-1.0" ]
7
2017-06-25T07:10:29.000Z
2019-04-10T05:38:19.000Z
#ifndef TIPPSE_RANGETREE_H #define TIPPSE_RANGETREE_H #include <stdlib.h> #include <stdio.h> #include <string.h> #include "types.h" // 1EiB page size for file load #define TREE_BLOCK_LENGTH_MAX 1024ull*1024ull*1024ull*1024ull*1024ull // 1GiB page size for direct memory access operations #define TREE_BLOCK_LENGTH_MID 1024*1024*1024 // 4kiB page size for file render split #define TREE_BLOCK_LENGTH_MIN 4096 #define TIPPSE_INSERTER_LEAF 1 #define TIPPSE_INSERTER_FILE 2 #define TIPPSE_INSERTER_MARK 4 #define TIPPSE_INSERTER_HIGHLIGHT 8 #define TIPPSE_INSERTER_NOFUSE 16 #define TIPPSE_INSERTER_HIGHLIGHT_COLOR_SHIFT 16 #define TIPPSE_RANGETREE_CAPS_DEALLOCATE_USER_DATA 1 #define TIPPSE_RANGETREE_CAPS_USER 2 #include "list.h" struct fragment; struct range_tree_node; struct range_tree_callback { void (*fragment_reference)(struct range_tree_callback* base, struct fragment* fragment); void (*fragment_dereference)(struct range_tree_callback* base, struct fragment* fragment); void (*node_combine)(struct range_tree_callback* base, struct range_tree_node* node, struct range_tree* tree); void (*node_invalidate)(struct range_tree_callback* base, struct range_tree_node* node, struct range_tree* tree); void (*node_destroy)(struct range_tree_callback* base, struct range_tree_node* node, struct range_tree* tree); }; struct range_tree_node { struct range_tree_node* parent; // parent node struct range_tree_node* side[2]; // binary split (left and right side) struct range_tree_node* next; // Next element in overlay list for the leaf nodes struct range_tree_node* prev; // Previous element in overlay list for the leaf nodes file_offset_t length; // Length of node int depth; // Current depth level int inserter; // Combined flags to modify interaction rules // TODO: shrink structure dynamically depending on type of tree int64_t fuse_id; // Only fuse neighbor nodes with the same fuse identification struct fragment* buffer; // Buffer to file content file_offset_t offset; // Relative start offset to the beginning of the file content buffer void* user_data; // User defined data struct visual_info* visuals; // Cached visual information by view_uid int view_uid; // Unique view identifier for caching }; struct range_tree { struct range_tree_node* root; struct range_tree_callback* callback; int caps; }; struct range_tree* range_tree_create(struct range_tree_callback* callback, int caps); void range_tree_create_inplace(struct range_tree* base, struct range_tree_callback* callback, int caps); void range_tree_destroy(struct range_tree* base); void range_tree_destroy_inplace(struct range_tree* base); struct range_tree_node* range_tree_invoke(struct range_tree* base); void range_tree_revoke(struct range_tree* base, struct range_tree_node* node); void range_tree_fuse(struct range_tree* base, struct range_tree_node* first, struct range_tree_node* last); void range_tree_cache_invalidate(struct range_tree* base, struct file_cache* cache); void range_tree_insert(struct range_tree* base, file_offset_t offset, struct fragment* buffer, file_offset_t buffer_offset, file_offset_t buffer_length, int inserter, int64_t fuse_id, void* user_data); void range_tree_insert_split(struct range_tree* base, file_offset_t offset, const uint8_t* text, size_t length, int inserter); void range_tree_delete(struct range_tree* base, file_offset_t offset, file_offset_t length, int inserter); struct range_tree* range_tree_copy(struct range_tree* base, file_offset_t offset, file_offset_t length, struct range_tree_callback* callback); void range_tree_paste(struct range_tree* base, struct range_tree_node* copy, file_offset_t offset); uint8_t* range_tree_raw(struct range_tree* base, file_offset_t start, file_offset_t end); void range_tree_split(struct range_tree* base, struct range_tree_node** node, file_offset_t split, int invalidate); void range_tree_mark(struct range_tree* base, file_offset_t offset, file_offset_t length, int inserter); void range_tree_empty(struct range_tree* base); void range_tree_static(struct range_tree* base, file_offset_t length, int inserter); void range_tree_resize(struct range_tree* base, file_offset_t length, int inserter); void range_tree_expand(struct range_tree* base, file_offset_t offset, file_offset_t length); void range_tree_reduce(struct range_tree* base, file_offset_t offset, file_offset_t length); struct range_tree_node* range_tree_marked_next(struct range_tree* base, file_offset_t offset, file_offset_t* low, file_offset_t* high, int skip_first); struct range_tree_node* range_tree_marked_prev(struct range_tree* base, file_offset_t offset, file_offset_t* low, file_offset_t* high, int skip_first); void range_tree_node_print(const struct range_tree_node* node, int depth, int side); void range_tree_node_check(const struct range_tree_node* node); void range_tree_node_print_root(const struct range_tree_node* node, int depth, int side); void range_tree_node_update_calc(struct range_tree_node* node, struct range_tree* tree); void range_tree_node_update_calc_all(struct range_tree_node* node, struct range_tree* tree); void range_tree_node_destroy(struct range_tree_node* node, struct range_tree* tree); struct range_tree_node* range_tree_node_create(struct range_tree_node* parent, struct range_tree* tree, struct range_tree_node* side0, struct range_tree_node* side1, struct fragment* buffer, file_offset_t offset, file_offset_t length, int inserter, int64_t fuse_id, void* user_data); struct range_tree_node* range_tree_node_first(struct range_tree_node* node); struct range_tree_node* range_tree_node_last(struct range_tree_node* node); TIPPSE_INLINE struct range_tree_node* range_tree_node_next(const struct range_tree_node* node) {return node?node->next:NULL;} TIPPSE_INLINE struct range_tree_node* range_tree_node_prev(const struct range_tree_node* node) {return node?node->prev:NULL;} TIPPSE_INLINE file_offset_t range_tree_node_length(const struct range_tree_node* node) {return node?node->length:0;} void range_tree_node_exchange(struct range_tree_node* node, struct range_tree_node* old, struct range_tree_node* update); struct range_tree_node* range_tree_node_rotate(struct range_tree_node* node, struct range_tree* tree, int side); struct range_tree_node* range_tree_node_balance(struct range_tree_node* node, struct range_tree* tree); void range_tree_node_update(struct range_tree_node* node, struct range_tree* tree); file_offset_t range_tree_node_offset(const struct range_tree_node* node); struct range_tree_node* range_tree_node_find_offset(struct range_tree_node* node, file_offset_t offset, file_offset_t* diff); void range_tree_node_invalidate(struct range_tree_node* node, struct range_tree* tree); void range_tree_node_cache_invalidate(struct range_tree_node* node, struct range_tree* tree, struct file_cache* cache); void range_tree_node_copy_insert(struct range_tree_node* root_from, file_offset_t offset_from, struct range_tree* tree_to, file_offset_t offset_to, file_offset_t length); int range_tree_node_marked(const struct range_tree_node* node, file_offset_t offset, file_offset_t length, int inserter); struct range_tree_node* range_tree_node_invert_mark(struct range_tree_node* node, struct range_tree* tree, int inserter); TIPPSE_INLINE file_offset_t range_tree_length(const struct range_tree* base) {return range_tree_node_length(base->root);} TIPPSE_INLINE struct range_tree_node* range_tree_first(struct range_tree* base) {return range_tree_node_first(base->root);} TIPPSE_INLINE struct range_tree_node* range_tree_last(struct range_tree* base) {return range_tree_node_last(base->root);} #endif /* #ifndef TIPPSE_RANGETREE_H */
64.114754
283
0.812963
[ "render" ]
be97e6e6207d9f005eb8877561a94ca5a276d553
10,200
c
C
DCS216 Operating System/FAT12 simulation/implementation/dir.c
Lan-Jing/Courses
540db9499b8725ca5b82a2c4e7a3da09f73c0efa
[ "MIT" ]
1
2021-12-17T23:09:00.000Z
2021-12-17T23:09:00.000Z
DCS216 Operating System/FAT12 simulation/implementation/dir.c
Lan-Jing/Courses
540db9499b8725ca5b82a2c4e7a3da09f73c0efa
[ "MIT" ]
null
null
null
DCS216 Operating System/FAT12 simulation/implementation/dir.c
Lan-Jing/Courses
540db9499b8725ca5b82a2c4e7a3da09f73c0efa
[ "MIT" ]
1
2021-08-03T23:42:06.000Z
2021-08-03T23:42:06.000Z
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <time.h> #include "..\headers\fileSys.h" char forbiddedList[16] = {'"', '*', '+', ',', '.', '/', ':', ';', '<', '=' ,'>', '?', '[', '\\', ']', '|'}; /*--------------------------------------------------------*/ void display_fileName(char *fileName, int dir) { for(int i = 0;i < 11;i++) { printf("%c", fileName[i]); if(i == 7) printf("%c", dir ? ' ' : '.'); // not extension name for dir; } } int attr_check(char attr, int loc) { return attr & (1 << loc); } void attr_set(char *attr, int loc) { *attr |= (1 << loc); } void display_entryInfo(struct entry *item) { if(attr_check(item->DIR_Attr, 1)) return ; // file not visible; display_fileName(item->DIR_Name, attr_check(item->DIR_Attr, 4)); if(attr_check(item->DIR_Attr, 4)) { printf(" <DIR> "); // a sub-directory; printf(" "); } else { printf(" "); // a file; if(item->DIR_FileSize >= 1000) { printf("%3d,", item->DIR_FileSize / 1000); } else { printf(" "); } printf("%3d", item->DIR_FileSize % 1000); } // display its size (if it's a file); printf(" %4d ", item->DIR_FstClus); file_getDate(item->DIR_WrtDate); // display date of last change; file_getTime(item->DIR_WrtTime); // display time of last change; } void display_dirInfo(char *sector, int cnt) { struct entry curEntry; for(int i = 0;i < cnt;i++) { memcpy(&curEntry, sector + i * sizeof(curEntry), sizeof(curEntry)); if(!curEntry.DIR_Name[0]) break; // root ends; if(curEntry.DIR_Name[0] == 0xE5) continue; // deleted entry; display_entryInfo(&curEntry); } } void display_fileContent(int startSec, int offset, int ifRoot) { system("cls"); struct entry targetFile; memcpy(&targetFile, image + FAT12_get_secAdd(startSec, offset, ifRoot), entrySize); int nowSec, bytesLeft; char *fileSec = (char *)malloc(mbr.BPB_BytsPerSec); for(nowSec = targetFile.DIR_FstClus, bytesLeft = targetFile.DIR_FileSize; nowSec != 0xFFF; nowSec = FAT12_get_next(nowSec, 0)) { memcpy(fileSec, image + FAT12_get_secAdd(nowSec, 0, 0), mbr.BPB_BytsPerSec); for(int i = 0;i < Min(mbr.BPB_BytsPerSec, bytesLeft);i++) printf("%c", fileSec[i]); bytesLeft -= bytesLeft > mbr.BPB_BytsPerSec ? mbr.BPB_BytsPerSec : bytesLeft; } free(fileSec); printf("\n"); } int file_writeFile(int mode, struct entry *fileEntry, char *data, int dataSize) { // overwrite if mode == 1 int nowSec, offset; if(mode) { // clear existing data; for(nowSec = fileEntry->DIR_FstClus;nowSec != 0xFFF;nowSec = FAT12_get_next(nowSec, 0)) file_freeSec(nowSec); nowSec = fileEntry->DIR_FstClus, offset = 0; } else { // go to the first available location; for(nowSec = fileEntry->DIR_FstClus; FAT12_get_next(nowSec, 0) != 0xFFF; // stop before end of the file; nowSec = FAT12_get_next(nowSec, 0)); // bytes in the last sector; offset = fileEntry->DIR_FileSize % mbr.BPB_BytsPerSec; // a full sector; if(fileEntry->DIR_FileSize && !offset) { FAT12_push_back_new_sector(nowSec); nowSec = FAT12_get_next(nowSec, 0); } } // change file attributes; fileEntry->DIR_FileSize = mode ? dataSize : fileEntry->DIR_FileSize + dataSize; file_setDateAndTime(&fileEntry->DIR_WrtDate, &fileEntry->DIR_WrtTime); attr_set(&fileEntry->DIR_Attr, 5); // fill the following data; for(int i = 0;i < dataSize;i++, offset++) { if(offset == mbr.BPB_BytsPerSec) { // push back a new sector; if(FAT12_get_next(nowSec, 0) == 0xFFF) FAT12_push_back_new_sector(nowSec); nowSec = FAT12_get_next(nowSec, 0), offset = 0; } *(image + FAT12_get_secAdd(nowSec, 0, 0) + offset) = data[i]; } } void file_loadFile(struct entry *file, char *data) { int nowSec, bytesLeft, i = 0; for(nowSec = file->DIR_FstClus, bytesLeft = file->DIR_FileSize; nowSec != 0xFFF; nowSec = FAT12_get_next(nowSec, 0), i++) { memcpy(data + i * mbr.BPB_BytsPerSec, image + FAT12_get_secAdd(nowSec, 0, 0), Min(bytesLeft, mbr.BPB_BytsPerSec)); bytesLeft -= bytesLeft > mbr.BPB_BytsPerSec ? mbr.BPB_BytsPerSec : bytesLeft; } } void file_freeSec(int FAT12Index) { char *ptr = image + FAT12_get_secAdd(FAT12Index, 0, 0); memset(ptr, 0, mbr.BPB_BytsPerSec); } void file_loadEntry(struct entry *enp, int nowSec, int offset, int ifRoot) { enp->DIR_Name[0] = 0; if(ifRoot ? nowSec >= 33 : nowSec == 0xFFF) return ; // check if the location is valid; int nowAdd = FAT12_get_secAdd(nowSec, offset, ifRoot); memcpy(enp, image + nowAdd, sizeof(*enp)); // load a file entry; } void file_moveEntry(int *sec, int *offset, int ifRoot) { if(*offset == mbr.BPB_BytsPerSec / entrySize - 1) { *sec = FAT12_get_next(*sec, ifRoot); *offset = 0; } else *offset = *offset + 1; } void file_setDateAndTime(unsigned short *DIR_WrtDate, unsigned short *DIR_WrtTime) { time_t rawTime; time(&rawTime); struct tm *timeInfo = localtime(&rawTime); *DIR_WrtDate = timeInfo->tm_mday + (timeInfo->tm_mon + 1 << 5) + ((timeInfo->tm_year - 80) << 9); *DIR_WrtTime = (timeInfo->tm_hour << 11) + (timeInfo->tm_min << 5); } void file_getDate(unsigned short DIR_WrtDate) { int year = (DIR_WrtDate >> 9) + 1980, month = ((DIR_WrtDate % (1 << 9)) >> 5), date = DIR_WrtDate % (1 << 5); printf(" %02u-%02u-%u ", month, date, year); } void file_getTime(unsigned short DIR_WrtTime) { int hour = DIR_WrtTime >> 11, mins = (DIR_WrtTime % (1 << 11)) >> 5; printf("%02u:%02u%c\n", hour % 12, mins, hour > 12 ? 'p' : 'a'); } int file_checkName(char *fileName, int emptyAllowed) { int file = 0, l = strlen(fileName), i; if(l == 0) return emptyAllowed; if(l > 12) return 0; // length restriction; if(fileName[0] == ' ') return 0; // space not allowed in the first char; if(fileName[0] == '.') { if(l == 1 || fileName[1] == '.') return 1; else return 0; } for(i = 0;i < l;i++) { if(fileName[i] == '.') { if(!file) file = i; else return 0; // only one dot is allowed; } if(fileName[i] < 0x20) return 0; for(int j = 0;j < fbListSize;j++) { if(fileName[i] == '.' && file) continue; // skip the dot for seperation; if(fileName[i] == forbiddedList[j]) return 0; } } if(!file) { return l > 8 ? 0 : 2; } else { return (file > 8 || (l - file - 1) > 3) ? 0 : 1; } } void file_setName(char *nameSec, char *newName) { for(int i = 0;i < 11;i++) nameSec[i] = ' '; int l = strlen(newName), i, j; for(i = 0;i < l && newName[i] != '.';i++) nameSec[i] = newName[i]; for(i++, j = 0;i < l;i++, j++) nameSec[8+j] = newName[i]; } int file_strcmp(char *target, char *source, int dir) { int l = strlen(source), i, j; if(dir) { // if target is a dir, only match its prefix; for(i = 0;i < l;i++) if(target[i] != source[i]) return 0; if(i < 8 && target[i] != ' ') return 0; // to ensure that two compared string hold the same length; return 1; } else { // if target is a file, match name and extension both; for(i = 0;i < l && source[i] != '.';i++) if(target[i] != source[i]) return 0; if(target[i] != ' ' || source[i] != '.') return 0; i++; for(j = 0;j < 3 && i+j < l;j++) if(target[8+j] != source[i+j]) return 0; if(i+j < l && target[8+j] != ' ') return 0; // same as above; return 2; } } void file_createFile(struct entry *curEntry, char *fileName, int dir, int FATp) { if(curEntry->DIR_Name[0] == 0xE5) // a deleted file, free space first; FAT12_free_FAT_list(curEntry->DIR_FstClus); // allocate the first empty cluster for the new file; curEntry->DIR_FstClus = FAT12_firstAvailableFATp; FAT12_set_next(curEntry->DIR_FstClus, 0xFFF); file_freeSec(curEntry->DIR_FstClus); FAT12_get_next_available_FATp(); file_setName(curEntry->DIR_Name, fileName); // set name; file_setDateAndTime(&curEntry->DIR_WrtDate, &curEntry->DIR_WrtTime); // set time; curEntry->DIR_FileSize = 0; // set file size; attr_set(&curEntry->DIR_Attr, 5); // Achieve Flag; if(dir) { attr_set(&curEntry->DIR_Attr, 4); // a directory; struct entry *linkEntry; linkEntry = (struct entry *)(image + FAT12_get_secAdd(curEntry->DIR_FstClus, 0, 0)); memcpy(linkEntry, curEntry, entrySize); memset(linkEntry->DIR_Name, ' ', 11); linkEntry->DIR_Name[0] = '.'; linkEntry = (struct entry *)(image + FAT12_get_secAdd(curEntry->DIR_FstClus, 1, 0)); memcpy(linkEntry, curEntry, entrySize); memset(linkEntry->DIR_Name, ' ', 11); linkEntry->DIR_Name[0] = linkEntry->DIR_Name[1] = '.'; linkEntry->DIR_FstClus = FATp; } // create the default "." and ".." files, only change their names and firstClus value; } struct dirNode dir_count_file(int FATp, int ifRoot) { struct dirNode dirRes; dirRes.fileCount = dirRes.memUsed = dirRes.totCount = 0; struct entry curEntry; curEntry.DIR_Name[0] = 0; int nowSec = FATp, offset = 0; while(file_loadEntry(&curEntry, nowSec, offset, ifRoot), curEntry.DIR_Name[0]) { if(curEntry.DIR_Name[0] != '.' && curEntry.DIR_Name[0] != 0xE5) { if(!attr_check(curEntry.DIR_Attr, 4)) dirRes.fileCount += 1, dirRes.memUsed += curEntry.DIR_FileSize; dirRes.totCount++; } file_moveEntry(&nowSec, &offset, ifRoot); } return dirRes; }
34.931507
122
0.571078
[ "3d" ]
beb1e8510fb99935de94d709edf1d5d58124c5c6
555
h
C
include/render/individual_to_bulk_settings.h
rgreenblatt/path
2057618ee3a6067c230c1c1c40856d2c9f5006b0
[ "MIT" ]
1
2020-03-15T19:26:37.000Z
2020-03-15T19:26:37.000Z
include/render/individual_to_bulk_settings.h
rgreenblatt/path
2057618ee3a6067c230c1c1c40856d2c9f5006b0
[ "MIT" ]
null
null
null
include/render/individual_to_bulk_settings.h
rgreenblatt/path
2057618ee3a6067c230c1c1c40856d2c9f5006b0
[ "MIT" ]
null
null
null
#pragma once #include "intersectable_scene/to_bulk.h" #include "render/individually_intersectable_settings.h" namespace render { struct IndividualToBulkSettings { intersectable_scene::ToBulkSettings to_bulk_settings; IndividuallyIntersectableSettings individual_settings; using CompileTime = IndividuallyIntersectableSettings::CompileTime; constexpr CompileTime compile_time() const { return individual_settings.compile_time(); } SETTING_BODY(IndividualToBulkSettings, to_bulk_settings, individual_settings); }; } // namespace render
27.75
80
0.827027
[ "render" ]
beb50db64dd87156def33fc9debe2ee334773185
3,025
h
C
client/rpc_controller.h
dzeromsk/goma
350f67319eb985013515b533f03f2f95570c37d3
[ "BSD-3-Clause" ]
4
2018-12-26T10:54:24.000Z
2022-03-31T21:19:47.000Z
client/rpc_controller.h
dzeromsk/goma
350f67319eb985013515b533f03f2f95570c37d3
[ "BSD-3-Clause" ]
null
null
null
client/rpc_controller.h
dzeromsk/goma
350f67319eb985013515b533f03f2f95570c37d3
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2019 The Goma Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef DEVTOOLS_GOMA_CLIENT_RPC_CONTROLLER_H_ #define DEVTOOLS_GOMA_CLIENT_RPC_CONTROLLER_H_ #include <memory> #include <utility> #include <vector> #include "basictypes.h" #include "lockhelper.h" #include "threadpool_http_server.h" namespace devtools_goma { class ExecReq; class ExecResp; class OneshotClosure; class WorkerThreadManager; #ifdef _WIN32 class MultiExecReq; class MultiExecResp; class MultiRpcController; #endif class RpcController { public: explicit RpcController( ThreadpoolHttpServer::HttpServerRequest* http_server_request); ~RpcController(); #ifdef _WIN32 // Used as sub-RPC of MultiRpcController. // In this case, you can't call ParseRequest/SendReply. void AttachMultiRpcController(MultiRpcController* multi_rpc); #endif bool ParseRequest(ExecReq* req); void SendReply(const ExecResp& resp); // Notifies callback when original request is closed. // Can be called from any thread. // callback will be called on the thread where this method is called. void NotifyWhenClosed(OneshotClosure* callback); int server_port() const { return server_port_; } size_t gomacc_req_size() const { return gomacc_req_size_; } private: friend class CompileService; ThreadpoolHttpServer::HttpServerRequest* http_server_request_; int server_port_; #ifdef _WIN32 MultiRpcController* multi_rpc_; #endif size_t gomacc_req_size_; DISALLOW_COPY_AND_ASSIGN(RpcController); }; #ifdef _WIN32 // RpcController for MultiExec. class MultiRpcController { public: MultiRpcController( WorkerThreadManager* wm, ThreadpoolHttpServer::HttpServerRequest* http_server_request); ~MultiRpcController(); // Parses request as MultiExecReq. // Also sets up RpcController and ExecResp for each ExecReq // in the MultiExecReq. bool ParseRequest(MultiExecReq* req); RpcController* rpc(int i) const; ExecResp* mutable_resp(int i) const; // Called when i-th ExecReq in the MultiExecReq has been done, // rpc(i) will be invalidated. // Returns true if all resp done. bool ExecDone(int i); void SendReply(); // Notifies callback when original request is closed. // Can be called from any thread. // callback will be called on the thread where this method is called. void NotifyWhenClosed(OneshotClosure* callback); private: void RequestClosed(); WorkerThreadManager* wm_; WorkerThread::ThreadId caller_thread_id_; ThreadpoolHttpServer::HttpServerRequest* http_server_request_; mutable Lock mu_; std::vector<RpcController*> rpcs_; std::unique_ptr<MultiExecResp> resp_; OneshotClosure* closed_callback_; std::vector<std::pair<WorkerThread::ThreadId, OneshotClosure*>> closed_callbacks_; size_t gomacc_req_size_; DISALLOW_COPY_AND_ASSIGN(MultiRpcController); }; #endif } // namespace devtools_goma #endif // DEVTOOLS_GOMA_CLIENT_RPC_CONTROLLER_H_
26.077586
73
0.770909
[ "vector" ]
beb6a742fb62a4684113d22bf713ff47c3b26d45
452
h
C
src/Constants.h
durielz/node-mbed-dtls
9f66de01d6ab4ca26c832aee787cd9f8adb3f5e2
[ "Apache-2.0" ]
null
null
null
src/Constants.h
durielz/node-mbed-dtls
9f66de01d6ab4ca26c832aee787cd9f8adb3f5e2
[ "Apache-2.0" ]
1
2021-08-31T18:34:36.000Z
2021-08-31T18:34:36.000Z
src/Constants.h
k4connect/node-mbed-dtls
ce1d8f935bf66a2aa7b5c97120a005660d302f42
[ "Apache-2.0" ]
null
null
null
#ifndef __CONSTANTS_H__ #define __CONSTANTS_H__ #include <napi.h> #include <cstring> #define ERROR_BUF_LEN 160 // max len of an error string is 133 #define ERROR_IS_KNOWN(str) ( memcmp( (str), "UNKNOWN ERROR CODE", 18 ) != 0 ) #define EXPORT_CONST(exp,co) (exp).Set(#co, co) class Constants { public: static Napi::Object Initialize(Napi::Env env, Napi::Object exports); static Napi::Value MbedtlsError(const Napi::CallbackInfo& info); }; #endif
23.789474
78
0.730088
[ "object" ]
db45dc5b7dda568fbbf991ee301356fbdadf36f5
58,884
c
C
freebsd5/sys/kern/subr_bus.c
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
91
2015-01-05T15:18:31.000Z
2022-03-11T16:43:28.000Z
freebsd5/sys/kern/subr_bus.c
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
1
2016-02-25T15:57:55.000Z
2016-02-25T16:01:02.000Z
freebsd5/sys/kern/subr_bus.c
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
21
2015-02-07T08:23:07.000Z
2021-12-14T06:01:49.000Z
/*- * Copyright (c) 1997,1998 Doug Rabson * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. * * $FreeBSD: src/sys/kern/subr_bus.c,v 1.117.2.1 2003/01/07 05:24:03 imp Exp $ */ #include "opt_bus.h" #include <sys/param.h> #include <sys/conf.h> #include <sys/filio.h> #include <sys/lock.h> #include <sys/kernel.h> #include <sys/kobj.h> #include <sys/malloc.h> #include <sys/module.h> #include <sys/mutex.h> #include <sys/poll.h> #include <sys/proc.h> #include <sys/condvar.h> #include <sys/queue.h> #include <machine/bus.h> #include <sys/rman.h> #include <sys/selinfo.h> #include <sys/signalvar.h> #include <sys/sysctl.h> #include <sys/systm.h> #include <sys/uio.h> #include <sys/bus.h> #include <machine/stdarg.h> #include <vm/uma.h> SYSCTL_NODE(_hw, OID_AUTO, bus, CTLFLAG_RW, NULL, NULL); /* * Used to attach drivers to devclasses. */ typedef struct driverlink *driverlink_t; struct driverlink { driver_t *driver; TAILQ_ENTRY(driverlink) link; /* list of drivers in devclass */ }; /* * Forward declarations */ typedef TAILQ_HEAD(devclass_list, devclass) devclass_list_t; typedef TAILQ_HEAD(driver_list, driverlink) driver_list_t; typedef TAILQ_HEAD(device_list, device) device_list_t; struct devclass { TAILQ_ENTRY(devclass) link; driver_list_t drivers; /* bus devclasses store drivers for bus */ char *name; device_t *devices; /* array of devices indexed by unit */ int maxunit; /* size of devices array */ }; /* * Implementation of device. */ struct device { /* * A device is a kernel object. The first field must be the * current ops table for the object. */ KOBJ_FIELDS; /* * Device hierarchy. */ TAILQ_ENTRY(device) link; /* list of devices in parent */ TAILQ_ENTRY(device) devlink; /* global device list membership */ device_t parent; device_list_t children; /* list of subordinate devices */ /* * Details of this device. */ driver_t *driver; devclass_t devclass; /* device class which we are in */ int unit; char* nameunit; /* name+unit e.g. foodev0 */ char* desc; /* driver specific description */ int busy; /* count of calls to device_busy() */ device_state_t state; u_int32_t devflags; /* api level flags for device_get_flags() */ u_short flags; #define DF_ENABLED 1 /* device should be probed/attached */ #define DF_FIXEDCLASS 2 /* devclass specified at create time */ #define DF_WILDCARD 4 /* unit was originally wildcard */ #define DF_DESCMALLOCED 8 /* description was malloced */ #define DF_QUIET 16 /* don't print verbose attach message */ #define DF_DONENOMATCH 32 /* don't execute DEVICE_NOMATCH again */ #define DF_EXTERNALSOFTC 64 /* softc not allocated by us */ u_char order; /* order from device_add_child_ordered() */ u_char pad; void *ivars; void *softc; }; struct device_op_desc { unsigned int offset; /* offset in driver ops */ struct method* method; /* internal method implementation */ devop_t deflt; /* default implementation */ const char* name; /* unique name (for registration) */ }; static MALLOC_DEFINE(M_BUS, "bus", "Bus data structures"); #ifdef BUS_DEBUG static int bus_debug = 1; TUNABLE_INT("bus.debug", &bus_debug); SYSCTL_INT(_debug, OID_AUTO, bus_debug, CTLFLAG_RW, &bus_debug, 0, "Debug bus code"); #define PDEBUG(a) if (bus_debug) {printf("%s:%d: ", __func__, __LINE__), printf a; printf("\n");} #define DEVICENAME(d) ((d)? device_get_name(d): "no device") #define DRIVERNAME(d) ((d)? d->name : "no driver") #define DEVCLANAME(d) ((d)? d->name : "no devclass") /* Produce the indenting, indent*2 spaces plus a '.' ahead of that to * prevent syslog from deleting initial spaces */ #define indentprintf(p) do { int iJ; printf("."); for (iJ=0; iJ<indent; iJ++) printf(" "); printf p ; } while (0) static void print_device_short(device_t dev, int indent); static void print_device(device_t dev, int indent); void print_device_tree_short(device_t dev, int indent); void print_device_tree(device_t dev, int indent); static void print_driver_short(driver_t *driver, int indent); static void print_driver(driver_t *driver, int indent); static void print_driver_list(driver_list_t drivers, int indent); static void print_devclass_short(devclass_t dc, int indent); static void print_devclass(devclass_t dc, int indent); void print_devclass_list_short(void); void print_devclass_list(void); #else /* Make the compiler ignore the function calls */ #define PDEBUG(a) /* nop */ #define DEVICENAME(d) /* nop */ #define DRIVERNAME(d) /* nop */ #define DEVCLANAME(d) /* nop */ #define print_device_short(d,i) /* nop */ #define print_device(d,i) /* nop */ #define print_device_tree_short(d,i) /* nop */ #define print_device_tree(d,i) /* nop */ #define print_driver_short(d,i) /* nop */ #define print_driver(d,i) /* nop */ #define print_driver_list(d,i) /* nop */ #define print_devclass_short(d,i) /* nop */ #define print_devclass(d,i) /* nop */ #define print_devclass_list_short() /* nop */ #define print_devclass_list() /* nop */ #endif /* * /dev/devctl implementation */ /* * This design allows only one reader for /dev/devctl. This is not desirable * in the long run, but will get a lot of hair out of this implementation. * Maybe we should make this device a clonable device. * * Also note: we specifically do not attach a device to the device_t tree * to avoid potential chicken and egg problems. One could argue that all * of this belongs to the root node. One could also further argue that the * sysctl interface that we have not might more properly be an ioctl * interface, but at this stage of the game, I'm not inclined to rock that * boat. * * I'm also not sure that the SIGIO support is done correctly or not, as * I copied it from a driver that had SIGIO support that likely hasn't been * tested since 3.4 or 2.2.8! */ static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS); static int devctl_disable = 0; TUNABLE_INT("hw.bus.devctl_disable", &devctl_disable); SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_devctl_disable, "I", "devctl disable"); static d_open_t devopen; static d_close_t devclose; static d_read_t devread; static d_ioctl_t devioctl; static d_poll_t devpoll; #define CDEV_MAJOR 173 static struct cdevsw dev_cdevsw = { /* open */ devopen, /* close */ devclose, /* read */ devread, /* write */ nowrite, /* ioctl */ devioctl, /* poll */ devpoll, /* mmap */ nommap, /* strategy */ nostrategy, /* name */ "devctl", /* maj */ CDEV_MAJOR, /* dump */ nodump, /* psize */ nopsize, /* flags */ 0, }; struct dev_event_info { char *dei_data; TAILQ_ENTRY(dev_event_info) dei_link; }; TAILQ_HEAD(devq, dev_event_info); struct dev_softc { int inuse; int nonblock; struct mtx mtx; struct cv cv; struct selinfo sel; struct devq devq; d_thread_t *async_td; } devsoftc; dev_t devctl_dev; static void devinit(void) { devctl_dev = make_dev(&dev_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "devctl"); mtx_init(&devsoftc.mtx, "dev mtx", "devd", MTX_DEF); cv_init(&devsoftc.cv, "dev cv"); TAILQ_INIT(&devsoftc.devq); } static int devopen(dev_t dev, int oflags, int devtype, d_thread_t *td) { if (devsoftc.inuse) return (EBUSY); /* move to init */ devsoftc.inuse = 1; devsoftc.nonblock = 0; devsoftc.async_td = NULL; return (0); } static int devclose(dev_t dev, int fflag, int devtype, d_thread_t *td) { devsoftc.inuse = 0; mtx_lock(&devsoftc.mtx); cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); return (0); } /* * The read channel for this device is used to report changes to * userland in realtime. We are required to free the data as well as * the n1 object because we allocate them separately. Also note that * we return one record at a time. If you try to read this device a * character at a time, you will loose the rest of the data. Listening * programs are expected to cope. */ static int devread(dev_t dev, struct uio *uio, int ioflag) { struct dev_event_info *n1; int rv; mtx_lock(&devsoftc.mtx); while (TAILQ_EMPTY(&devsoftc.devq)) { if (devsoftc.nonblock) { mtx_unlock(&devsoftc.mtx); return (EAGAIN); } rv = cv_wait_sig(&devsoftc.cv, &devsoftc.mtx); if (rv) { /* * Need to translate ERESTART to EINTR here? -- jake */ mtx_unlock(&devsoftc.mtx); return (rv); } } n1 = TAILQ_FIRST(&devsoftc.devq); TAILQ_REMOVE(&devsoftc.devq, n1, dei_link); mtx_unlock(&devsoftc.mtx); rv = uiomove(n1->dei_data, strlen(n1->dei_data), uio); free(n1->dei_data, M_BUS); free(n1, M_BUS); return (rv); } static int devioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td) { switch (cmd) { case FIONBIO: if (*(int*)data) devsoftc.nonblock = 1; else devsoftc.nonblock = 0; return (0); case FIOASYNC: if (*(int*)data) devsoftc.async_td = td; else devsoftc.async_td = NULL; return (0); /* (un)Support for other fcntl() calls. */ case FIOCLEX: case FIONCLEX: case FIONREAD: case FIOSETOWN: case FIOGETOWN: default: break; } return (ENOTTY); } static int devpoll(dev_t dev, int events, d_thread_t *td) { int revents = 0; if (events & (POLLIN | POLLRDNORM)) revents |= events & (POLLIN | POLLRDNORM); if (events & (POLLOUT | POLLWRNORM)) revents |= events & (POLLOUT | POLLWRNORM); mtx_lock(&devsoftc.mtx); if (events & POLLRDBAND) if (!TAILQ_EMPTY(&devsoftc.devq)) revents |= POLLRDBAND; mtx_unlock(&devsoftc.mtx); if (revents == 0) selrecord(td, &devsoftc.sel); return (revents); } /* * Common routine that tries to make sending messages as easy as possible. * We allocate memory for the data, copy strings into that, but do not * free it unless there's an error. The dequeue part of the driver should * free the data. We do not send any data if there is no listeners on the * /dev/devctl device. We assume that on startup, any program that wishes * to do things based on devices that have attached before it starts will * query the tree to find out its current state. This decision may * be revisited if there are difficulties determining if one should do an * action or not (eg, are all actions that the listening program idempotent * or not). This may also open up races as well (say if the listener * dies just before a device goes away, and is run again just after, no * detach action would happen). The flip side would be that we'd need to * limit the size of the queue because otherwise if no listener is running * then we'd have unbounded growth. Most systems have less than 100 (maybe * even less than 50) devices, so maybe a limit of 200 or 300 wouldn't be * too horrible. XXX */ static void devaddq(const char *type, const char *what, device_t dev) { struct dev_event_info *n1 = NULL; char *data = NULL; char *loc; const char *parstr; if (devctl_disable) return; n1 = malloc(sizeof(*n1), M_BUS, M_NOWAIT); if (n1 == NULL) goto bad; data = malloc(1024, M_BUS, M_NOWAIT); if (data == NULL) goto bad; loc = malloc(1024, M_BUS, M_NOWAIT); if (loc == NULL) goto bad; *loc = '\0'; bus_child_location_str(dev, loc, 1024); if (device_get_parent(dev) == NULL) parstr = "."; /* Or '/' ? */ else parstr = device_get_nameunit(device_get_parent(dev)); snprintf(data, 1024, "%s%s at %s on %s\n", type, what, loc, parstr); free(loc, M_BUS); n1->dei_data = data; mtx_lock(&devsoftc.mtx); TAILQ_INSERT_TAIL(&devsoftc.devq, n1, dei_link); cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); if (devsoftc.async_td) psignal(devsoftc.async_td->td_proc, SIGIO); return; bad:; free(data, M_BUS); free(n1, M_BUS); return; } /* * A device was added to the tree. We are called just after it successfully * attaches (that is, probe and attach success for this device). No call * is made if a device is merely parented into the tree. See devnomatch * if probe fails. If attach fails, no notification is sent (but maybe * we should have a different message for this). */ static void devadded(device_t dev) { devaddq("+", device_get_nameunit(dev), dev); } /* * A device was removed from the tree. We are called just before this * happens. */ static void devremoved(device_t dev) { devaddq("-", device_get_nameunit(dev), dev); } /* * Called when there's no match for this device. This is only called * the first time that no match happens, so we don't keep getitng this * message. Should that prove to be undesirable, we can change it. * This is called when all drivers that can attach to a given bus * decline to accept this device. Other errrors may not be detected. */ static void devnomatch(device_t dev) { char *pnp = NULL; pnp = malloc(1024, M_BUS, M_NOWAIT); if (pnp == NULL) return; *pnp = '\0'; bus_child_pnpinfo_str(dev, pnp, 1024); devaddq("?", pnp, dev); free(pnp, M_BUS); return; } static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS) { struct dev_event_info *n1; int dis, error; dis = devctl_disable; error = sysctl_handle_int(oidp, &dis, 0, req); if (error || !req->newptr) return (error); mtx_lock(&devsoftc.mtx); devctl_disable = dis; if (dis) { while (!TAILQ_EMPTY(&devsoftc.devq)) { n1 = TAILQ_FIRST(&devsoftc.devq); TAILQ_REMOVE(&devsoftc.devq, n1, dei_link); free(n1->dei_data, M_BUS); free(n1, M_BUS); } } mtx_unlock(&devsoftc.mtx); return (0); } /* End of /dev/devctl code */ TAILQ_HEAD(,device) bus_data_devices; static int bus_data_generation = 1; kobj_method_t null_methods[] = { { 0, 0 } }; DEFINE_CLASS(null, null_methods, 0); /* * Devclass implementation */ static devclass_list_t devclasses = TAILQ_HEAD_INITIALIZER(devclasses); static devclass_t devclass_find_internal(const char *classname, int create) { devclass_t dc; PDEBUG(("looking for %s", classname)); if (!classname) return (NULL); TAILQ_FOREACH(dc, &devclasses, link) { if (!strcmp(dc->name, classname)) return (dc); } PDEBUG(("%s not found%s", classname, (create? ", creating": ""))); if (create) { dc = malloc(sizeof(struct devclass) + strlen(classname) + 1, M_BUS, M_NOWAIT|M_ZERO); if (!dc) return (NULL); dc->name = (char*) (dc + 1); strcpy(dc->name, classname); TAILQ_INIT(&dc->drivers); TAILQ_INSERT_TAIL(&devclasses, dc, link); bus_data_generation_update(); } return (dc); } devclass_t devclass_create(const char *classname) { return (devclass_find_internal(classname, TRUE)); } devclass_t devclass_find(const char *classname) { return (devclass_find_internal(classname, FALSE)); } int devclass_add_driver(devclass_t dc, driver_t *driver) { driverlink_t dl; int i; PDEBUG(("%s", DRIVERNAME(driver))); dl = malloc(sizeof *dl, M_BUS, M_NOWAIT|M_ZERO); if (!dl) return (ENOMEM); /* * Compile the driver's methods. Also increase the reference count * so that the class doesn't get freed when the last instance * goes. This means we can safely use static methods and avoids a * double-free in devclass_delete_driver. */ kobj_class_compile((kobj_class_t) driver); /* * Make sure the devclass which the driver is implementing exists. */ devclass_find_internal(driver->name, TRUE); dl->driver = driver; TAILQ_INSERT_TAIL(&dc->drivers, dl, link); driver->refs++; /* * Call BUS_DRIVER_ADDED for any existing busses in this class. */ for (i = 0; i < dc->maxunit; i++) if (dc->devices[i]) BUS_DRIVER_ADDED(dc->devices[i], driver); bus_data_generation_update(); return (0); } int devclass_delete_driver(devclass_t busclass, driver_t *driver) { devclass_t dc = devclass_find(driver->name); driverlink_t dl; device_t dev; int i; int error; PDEBUG(("%s from devclass %s", driver->name, DEVCLANAME(busclass))); if (!dc) return (0); /* * Find the link structure in the bus' list of drivers. */ TAILQ_FOREACH(dl, &busclass->drivers, link) { if (dl->driver == driver) break; } if (!dl) { PDEBUG(("%s not found in %s list", driver->name, busclass->name)); return (ENOENT); } /* * Disassociate from any devices. We iterate through all the * devices in the devclass of the driver and detach any which are * using the driver and which have a parent in the devclass which * we are deleting from. * * Note that since a driver can be in multiple devclasses, we * should not detach devices which are not children of devices in * the affected devclass. */ for (i = 0; i < dc->maxunit; i++) { if (dc->devices[i]) { dev = dc->devices[i]; if (dev->driver == driver && dev->parent && dev->parent->devclass == busclass) { if ((error = device_detach(dev)) != 0) return (error); device_set_driver(dev, NULL); } } } TAILQ_REMOVE(&busclass->drivers, dl, link); free(dl, M_BUS); driver->refs--; if (driver->refs == 0) kobj_class_free((kobj_class_t) driver); bus_data_generation_update(); return (0); } static driverlink_t devclass_find_driver_internal(devclass_t dc, const char *classname) { driverlink_t dl; PDEBUG(("%s in devclass %s", classname, DEVCLANAME(dc))); TAILQ_FOREACH(dl, &dc->drivers, link) { if (!strcmp(dl->driver->name, classname)) return (dl); } PDEBUG(("not found")); return (NULL); } driver_t * devclass_find_driver(devclass_t dc, const char *classname) { driverlink_t dl; dl = devclass_find_driver_internal(dc, classname); if (dl) return (dl->driver); return (NULL); } const char * devclass_get_name(devclass_t dc) { return (dc->name); } device_t devclass_get_device(devclass_t dc, int unit) { if (dc == NULL || unit < 0 || unit >= dc->maxunit) return (NULL); return (dc->devices[unit]); } void * devclass_get_softc(devclass_t dc, int unit) { device_t dev; dev = devclass_get_device(dc, unit); if (!dev) return (NULL); return (device_get_softc(dev)); } int devclass_get_devices(devclass_t dc, device_t **devlistp, int *devcountp) { int i; int count; device_t *list; count = 0; for (i = 0; i < dc->maxunit; i++) if (dc->devices[i]) count++; list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); if (!list) return (ENOMEM); count = 0; for (i = 0; i < dc->maxunit; i++) { if (dc->devices[i]) { list[count] = dc->devices[i]; count++; } } *devlistp = list; *devcountp = count; return (0); } int devclass_get_maxunit(devclass_t dc) { return (dc->maxunit); } int devclass_find_free_unit(devclass_t dc, int unit) { if (dc == NULL) return (unit); while (unit < dc->maxunit && dc->devices[unit] != NULL) unit++; return (unit); } static int devclass_alloc_unit(devclass_t dc, int *unitp) { int unit = *unitp; PDEBUG(("unit %d in devclass %s", unit, DEVCLANAME(dc))); /* If we were given a wired unit number, check for existing device */ /* XXX imp XXX */ if (unit != -1) { if (unit >= 0 && unit < dc->maxunit && dc->devices[unit] != NULL) { if (bootverbose) printf("%s: %s%d already exists; skipping it\n", dc->name, dc->name, *unitp); return (EEXIST); } } else { /* Unwired device, find the next available slot for it */ unit = 0; while (unit < dc->maxunit && dc->devices[unit] != NULL) unit++; } /* * We've selected a unit beyond the length of the table, so let's * extend the table to make room for all units up to and including * this one. */ if (unit >= dc->maxunit) { device_t *newlist; int newsize; newsize = roundup((unit + 1), MINALLOCSIZE / sizeof(device_t)); newlist = malloc(sizeof(device_t) * newsize, M_BUS, M_NOWAIT); if (!newlist) return (ENOMEM); bcopy(dc->devices, newlist, sizeof(device_t) * dc->maxunit); bzero(newlist + dc->maxunit, sizeof(device_t) * (newsize - dc->maxunit)); if (dc->devices) free(dc->devices, M_BUS); dc->devices = newlist; dc->maxunit = newsize; } PDEBUG(("now: unit %d in devclass %s", unit, DEVCLANAME(dc))); *unitp = unit; return (0); } static int devclass_add_device(devclass_t dc, device_t dev) { int buflen, error; PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc))); buflen = snprintf(NULL, 0, "%s%d$", dc->name, dev->unit); if (buflen < 0) return (ENOMEM); dev->nameunit = malloc(buflen, M_BUS, M_NOWAIT|M_ZERO); if (!dev->nameunit) return (ENOMEM); if ((error = devclass_alloc_unit(dc, &dev->unit)) != 0) { free(dev->nameunit, M_BUS); dev->nameunit = NULL; return (error); } dc->devices[dev->unit] = dev; dev->devclass = dc; snprintf(dev->nameunit, buflen, "%s%d", dc->name, dev->unit); return (0); } static int devclass_delete_device(devclass_t dc, device_t dev) { if (!dc || !dev) return (0); PDEBUG(("%s in devclass %s", DEVICENAME(dev), DEVCLANAME(dc))); if (dev->devclass != dc || dc->devices[dev->unit] != dev) panic("devclass_delete_device: inconsistent device class"); dc->devices[dev->unit] = NULL; if (dev->flags & DF_WILDCARD) dev->unit = -1; dev->devclass = NULL; free(dev->nameunit, M_BUS); dev->nameunit = NULL; return (0); } static device_t make_device(device_t parent, const char *name, int unit) { device_t dev; devclass_t dc; PDEBUG(("%s at %s as unit %d", name, DEVICENAME(parent), unit)); if (name) { dc = devclass_find_internal(name, TRUE); if (!dc) { printf("make_device: can't find device class %s\n", name); return (NULL); } } else { dc = NULL; } dev = malloc(sizeof(struct device), M_BUS, M_NOWAIT|M_ZERO); if (!dev) return (NULL); dev->parent = parent; TAILQ_INIT(&dev->children); kobj_init((kobj_t) dev, &null_class); dev->driver = NULL; dev->devclass = NULL; dev->unit = unit; dev->nameunit = NULL; dev->desc = NULL; dev->busy = 0; dev->devflags = 0; dev->flags = DF_ENABLED; dev->order = 0; if (unit == -1) dev->flags |= DF_WILDCARD; if (name) { dev->flags |= DF_FIXEDCLASS; if (devclass_add_device(dc, dev)) { kobj_delete((kobj_t) dev, M_BUS); return (NULL); } } dev->ivars = NULL; dev->softc = NULL; dev->state = DS_NOTPRESENT; TAILQ_INSERT_TAIL(&bus_data_devices, dev, devlink); bus_data_generation_update(); return (dev); } static int device_print_child(device_t dev, device_t child) { int retval = 0; if (device_is_alive(child)) retval += BUS_PRINT_CHILD(dev, child); else retval += device_printf(child, " not found\n"); return (retval); } device_t device_add_child(device_t dev, const char *name, int unit) { return (device_add_child_ordered(dev, 0, name, unit)); } device_t device_add_child_ordered(device_t dev, int order, const char *name, int unit) { device_t child; device_t place; PDEBUG(("%s at %s with order %d as unit %d", name, DEVICENAME(dev), order, unit)); child = make_device(dev, name, unit); if (child == NULL) return (child); child->order = order; TAILQ_FOREACH(place, &dev->children, link) { if (place->order > order) break; } if (place) { /* * The device 'place' is the first device whose order is * greater than the new child. */ TAILQ_INSERT_BEFORE(place, child, link); } else { /* * The new child's order is greater or equal to the order of * any existing device. Add the child to the tail of the list. */ TAILQ_INSERT_TAIL(&dev->children, child, link); } bus_data_generation_update(); return (child); } int device_delete_child(device_t dev, device_t child) { int error; device_t grandchild; PDEBUG(("%s from %s", DEVICENAME(child), DEVICENAME(dev))); /* remove children first */ while ( (grandchild = TAILQ_FIRST(&child->children)) ) { error = device_delete_child(child, grandchild); if (error) return (error); } if ((error = device_detach(child)) != 0) return (error); if (child->devclass) devclass_delete_device(child->devclass, child); TAILQ_REMOVE(&dev->children, child, link); TAILQ_REMOVE(&bus_data_devices, child, devlink); device_set_desc(child, NULL); free(child, M_BUS); bus_data_generation_update(); return (0); } /* * Find only devices attached to this bus. */ device_t device_find_child(device_t dev, const char *classname, int unit) { devclass_t dc; device_t child; dc = devclass_find(classname); if (!dc) return (NULL); child = devclass_get_device(dc, unit); if (child && child->parent == dev) return (child); return (NULL); } static driverlink_t first_matching_driver(devclass_t dc, device_t dev) { if (dev->devclass) return (devclass_find_driver_internal(dc, dev->devclass->name)); return (TAILQ_FIRST(&dc->drivers)); } static driverlink_t next_matching_driver(devclass_t dc, device_t dev, driverlink_t last) { if (dev->devclass) { driverlink_t dl; for (dl = TAILQ_NEXT(last, link); dl; dl = TAILQ_NEXT(dl, link)) if (!strcmp(dev->devclass->name, dl->driver->name)) return (dl); return (NULL); } return (TAILQ_NEXT(last, link)); } static int device_probe_child(device_t dev, device_t child) { devclass_t dc; driverlink_t best = 0; driverlink_t dl; int result, pri = 0; int hasclass = (child->devclass != 0); dc = dev->devclass; if (!dc) panic("device_probe_child: parent device has no devclass"); if (child->state == DS_ALIVE) return (0); for (dl = first_matching_driver(dc, child); dl; dl = next_matching_driver(dc, child, dl)) { PDEBUG(("Trying %s", DRIVERNAME(dl->driver))); device_set_driver(child, dl->driver); if (!hasclass) device_set_devclass(child, dl->driver->name); result = DEVICE_PROBE(child); if (!hasclass) device_set_devclass(child, 0); /* * If the driver returns SUCCESS, there can be no higher match * for this device. */ if (result == 0) { best = dl; pri = 0; break; } /* * The driver returned an error so it certainly doesn't match. */ if (result > 0) { device_set_driver(child, 0); continue; } /* * A priority lower than SUCCESS, remember the best matching * driver. Initialise the value of pri for the first match. */ if (best == 0 || result > pri) { best = dl; pri = result; continue; } } /* * If we found a driver, change state and initialise the devclass. */ if (best) { if (!child->devclass) device_set_devclass(child, best->driver->name); device_set_driver(child, best->driver); if (pri < 0) { /* * A bit bogus. Call the probe method again to make * sure that we have the right description. */ DEVICE_PROBE(child); } child->state = DS_ALIVE; bus_data_generation_update(); return (0); } return (ENXIO); } device_t device_get_parent(device_t dev) { return (dev->parent); } int device_get_children(device_t dev, device_t **devlistp, int *devcountp) { int count; device_t child; device_t *list; count = 0; TAILQ_FOREACH(child, &dev->children, link) { count++; } list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO); if (!list) return (ENOMEM); count = 0; TAILQ_FOREACH(child, &dev->children, link) { list[count] = child; count++; } *devlistp = list; *devcountp = count; return (0); } driver_t * device_get_driver(device_t dev) { return (dev->driver); } devclass_t device_get_devclass(device_t dev) { return (dev->devclass); } const char * device_get_name(device_t dev) { if (dev->devclass) return (devclass_get_name(dev->devclass)); return (NULL); } const char * device_get_nameunit(device_t dev) { return (dev->nameunit); } int device_get_unit(device_t dev) { return (dev->unit); } const char * device_get_desc(device_t dev) { return (dev->desc); } u_int32_t device_get_flags(device_t dev) { return (dev->devflags); } int device_print_prettyname(device_t dev) { const char *name = device_get_name(dev); if (name == 0) return (printf("unknown: ")); return (printf("%s%d: ", name, device_get_unit(dev))); } int device_printf(device_t dev, const char * fmt, ...) { va_list ap; int retval; retval = device_print_prettyname(dev); va_start(ap, fmt); retval += vprintf(fmt, ap); va_end(ap); return (retval); } static void device_set_desc_internal(device_t dev, const char* desc, int copy) { if (dev->desc && (dev->flags & DF_DESCMALLOCED)) { free(dev->desc, M_BUS); dev->flags &= ~DF_DESCMALLOCED; dev->desc = NULL; } if (copy && desc) { dev->desc = malloc(strlen(desc) + 1, M_BUS, M_NOWAIT); if (dev->desc) { strcpy(dev->desc, desc); dev->flags |= DF_DESCMALLOCED; } } else { /* Avoid a -Wcast-qual warning */ dev->desc = (char *)(uintptr_t) desc; } bus_data_generation_update(); } void device_set_desc(device_t dev, const char* desc) { device_set_desc_internal(dev, desc, FALSE); } void device_set_desc_copy(device_t dev, const char* desc) { device_set_desc_internal(dev, desc, TRUE); } void device_set_flags(device_t dev, u_int32_t flags) { dev->devflags = flags; } void * device_get_softc(device_t dev) { return (dev->softc); } void device_set_softc(device_t dev, void *softc) { if (dev->softc && !(dev->flags & DF_EXTERNALSOFTC)) free(dev->softc, M_BUS); dev->softc = softc; if (dev->softc) dev->flags |= DF_EXTERNALSOFTC; else dev->flags &= ~DF_EXTERNALSOFTC; } void * device_get_ivars(device_t dev) { KASSERT(dev != NULL, ("device_get_ivars(NULL, ...)")); return (dev->ivars); } void device_set_ivars(device_t dev, void * ivars) { KASSERT(dev != NULL, ("device_set_ivars(NULL, ...)")); dev->ivars = ivars; } device_state_t device_get_state(device_t dev) { return (dev->state); } void device_enable(device_t dev) { dev->flags |= DF_ENABLED; } void device_disable(device_t dev) { dev->flags &= ~DF_ENABLED; } void device_busy(device_t dev) { if (dev->state < DS_ATTACHED) panic("device_busy: called for unattached device"); if (dev->busy == 0 && dev->parent) device_busy(dev->parent); dev->busy++; dev->state = DS_BUSY; } void device_unbusy(device_t dev) { if (dev->state != DS_BUSY) panic("device_unbusy: called for non-busy device"); dev->busy--; if (dev->busy == 0) { if (dev->parent) device_unbusy(dev->parent); dev->state = DS_ATTACHED; } } void device_quiet(device_t dev) { dev->flags |= DF_QUIET; } void device_verbose(device_t dev) { dev->flags &= ~DF_QUIET; } int device_is_quiet(device_t dev) { return ((dev->flags & DF_QUIET) != 0); } int device_is_enabled(device_t dev) { return ((dev->flags & DF_ENABLED) != 0); } int device_is_alive(device_t dev) { return (dev->state >= DS_ALIVE); } int device_set_devclass(device_t dev, const char *classname) { devclass_t dc; int error; if (!classname) { if (dev->devclass) devclass_delete_device(dev->devclass, dev); return (0); } if (dev->devclass) { printf("device_set_devclass: device class already set\n"); return (EINVAL); } dc = devclass_find_internal(classname, TRUE); if (!dc) return (ENOMEM); error = devclass_add_device(dc, dev); bus_data_generation_update(); return (error); } int device_set_driver(device_t dev, driver_t *driver) { if (dev->state >= DS_ATTACHED) return (EBUSY); if (dev->driver == driver) return (0); if (dev->softc && !(dev->flags & DF_EXTERNALSOFTC)) { free(dev->softc, M_BUS); dev->softc = NULL; } kobj_delete((kobj_t) dev, 0); dev->driver = driver; if (driver) { kobj_init((kobj_t) dev, (kobj_class_t) driver); if (!(dev->flags & DF_EXTERNALSOFTC) && driver->size > 0) { dev->softc = malloc(driver->size, M_BUS, M_NOWAIT | M_ZERO); if (!dev->softc) { kobj_init((kobj_t) dev, &null_class); dev->driver = NULL; return (ENOMEM); } } } else { kobj_init((kobj_t) dev, &null_class); } bus_data_generation_update(); return (0); } int device_probe_and_attach(device_t dev) { device_t bus = dev->parent; int error = 0; int hasclass = (dev->devclass != 0); if (dev->state >= DS_ALIVE) return (0); if (dev->flags & DF_ENABLED) { error = device_probe_child(bus, dev); if (!error) { if (!device_is_quiet(dev)) device_print_child(bus, dev); error = DEVICE_ATTACH(dev); if (!error) { dev->state = DS_ATTACHED; devadded(dev); } else { printf("device_probe_and_attach: %s%d attach returned %d\n", dev->driver->name, dev->unit, error); /* Unset the class; set in device_probe_child */ if (!hasclass) device_set_devclass(dev, 0); device_set_driver(dev, NULL); dev->state = DS_NOTPRESENT; } } else { if (!(dev->flags & DF_DONENOMATCH)) { BUS_PROBE_NOMATCH(bus, dev); devnomatch(dev); dev->flags |= DF_DONENOMATCH; } } } else { if (bootverbose) { device_print_prettyname(dev); printf("not probed (disabled)\n"); } } return (error); } int device_detach(device_t dev) { int error; PDEBUG(("%s", DEVICENAME(dev))); if (dev->state == DS_BUSY) return (EBUSY); if (dev->state != DS_ATTACHED) return (0); if ((error = DEVICE_DETACH(dev)) != 0) return (error); devremoved(dev); device_printf(dev, "detached\n"); if (dev->parent) BUS_CHILD_DETACHED(dev->parent, dev); if (!(dev->flags & DF_FIXEDCLASS)) devclass_delete_device(dev->devclass, dev); dev->state = DS_NOTPRESENT; device_set_driver(dev, NULL); return (0); } int device_shutdown(device_t dev) { if (dev->state < DS_ATTACHED) return (0); return (DEVICE_SHUTDOWN(dev)); } int device_set_unit(device_t dev, int unit) { devclass_t dc; int err; dc = device_get_devclass(dev); if (unit < dc->maxunit && dc->devices[unit]) return (EBUSY); err = devclass_delete_device(dc, dev); if (err) return (err); dev->unit = unit; err = devclass_add_device(dc, dev); if (err) return (err); bus_data_generation_update(); return (0); } /*======================================*/ /* * Some useful method implementations to make life easier for bus drivers. */ void resource_list_init(struct resource_list *rl) { SLIST_INIT(rl); } void resource_list_free(struct resource_list *rl) { struct resource_list_entry *rle; while ((rle = SLIST_FIRST(rl)) != NULL) { if (rle->res) panic("resource_list_free: resource entry is busy"); SLIST_REMOVE_HEAD(rl, link); free(rle, M_BUS); } } int resource_list_add_next(struct resource_list *rl, int type, u_long start, u_long end, u_long count) { int rid; rid = 0; while (resource_list_find(rl, type, rid) != NULL) rid++; resource_list_add(rl, type, rid, start, end, count); return (rid); } void resource_list_add(struct resource_list *rl, int type, int rid, u_long start, u_long end, u_long count) { struct resource_list_entry *rle; rle = resource_list_find(rl, type, rid); if (!rle) { rle = malloc(sizeof(struct resource_list_entry), M_BUS, M_NOWAIT); if (!rle) panic("resource_list_add: can't record entry"); SLIST_INSERT_HEAD(rl, rle, link); rle->type = type; rle->rid = rid; rle->res = NULL; } if (rle->res) panic("resource_list_add: resource entry is busy"); rle->start = start; rle->end = end; rle->count = count; } struct resource_list_entry * resource_list_find(struct resource_list *rl, int type, int rid) { struct resource_list_entry *rle; SLIST_FOREACH(rle, rl, link) { if (rle->type == type && rle->rid == rid) return (rle); } return (NULL); } void resource_list_delete(struct resource_list *rl, int type, int rid) { struct resource_list_entry *rle = resource_list_find(rl, type, rid); if (rle) { if (rle->res != NULL) panic("resource_list_delete: resource has not been released"); SLIST_REMOVE(rl, rle, resource_list_entry, link); free(rle, M_BUS); } } struct resource * resource_list_alloc(struct resource_list *rl, device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { struct resource_list_entry *rle = 0; int passthrough = (device_get_parent(child) != bus); int isdefault = (start == 0UL && end == ~0UL); if (passthrough) { return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, start, end, count, flags)); } rle = resource_list_find(rl, type, *rid); if (!rle) return (NULL); /* no resource of that type/rid */ if (rle->res) panic("resource_list_alloc: resource entry is busy"); if (isdefault) { start = rle->start; count = ulmax(count, rle->count); end = ulmax(rle->end, start + count - 1); } rle->res = BUS_ALLOC_RESOURCE(device_get_parent(bus), child, type, rid, start, end, count, flags); /* * Record the new range. */ if (rle->res) { rle->start = rman_get_start(rle->res); rle->end = rman_get_end(rle->res); rle->count = count; } return (rle->res); } int resource_list_release(struct resource_list *rl, device_t bus, device_t child, int type, int rid, struct resource *res) { struct resource_list_entry *rle = 0; int passthrough = (device_get_parent(child) != bus); int error; if (passthrough) { return (BUS_RELEASE_RESOURCE(device_get_parent(bus), child, type, rid, res)); } rle = resource_list_find(rl, type, rid); if (!rle) panic("resource_list_release: can't find resource"); if (!rle->res) panic("resource_list_release: resource entry is not busy"); error = BUS_RELEASE_RESOURCE(device_get_parent(bus), child, type, rid, res); if (error) return (error); rle->res = NULL; return (0); } int resource_list_print_type(struct resource_list *rl, const char *name, int type, const char *format) { struct resource_list_entry *rle; int printed, retval; printed = 0; retval = 0; /* Yes, this is kinda cheating */ SLIST_FOREACH(rle, rl, link) { if (rle->type == type) { if (printed == 0) retval += printf(" %s ", name); else retval += printf(","); printed++; retval += printf(format, rle->start); if (rle->count > 1) { retval += printf("-"); retval += printf(format, rle->start + rle->count - 1); } } } return (retval); } /* * Call DEVICE_IDENTIFY for each driver. */ int bus_generic_probe(device_t dev) { devclass_t dc = dev->devclass; driverlink_t dl; TAILQ_FOREACH(dl, &dc->drivers, link) { DEVICE_IDENTIFY(dl->driver, dev); } return (0); } int bus_generic_attach(device_t dev) { device_t child; TAILQ_FOREACH(child, &dev->children, link) { device_probe_and_attach(child); } return (0); } int bus_generic_detach(device_t dev) { device_t child; int error; if (dev->state != DS_ATTACHED) return (EBUSY); TAILQ_FOREACH(child, &dev->children, link) { if ((error = device_detach(child)) != 0) return (error); } return (0); } int bus_generic_shutdown(device_t dev) { device_t child; TAILQ_FOREACH(child, &dev->children, link) { device_shutdown(child); } return (0); } int bus_generic_suspend(device_t dev) { int error; device_t child, child2; TAILQ_FOREACH(child, &dev->children, link) { error = DEVICE_SUSPEND(child); if (error) { for (child2 = TAILQ_FIRST(&dev->children); child2 && child2 != child; child2 = TAILQ_NEXT(child2, link)) DEVICE_RESUME(child2); return (error); } } return (0); } int bus_generic_resume(device_t dev) { device_t child; TAILQ_FOREACH(child, &dev->children, link) { DEVICE_RESUME(child); /* if resume fails, there's nothing we can usefully do... */ } return (0); } int bus_print_child_header (device_t dev, device_t child) { int retval = 0; if (device_get_desc(child)) { retval += device_printf(child, "<%s>", device_get_desc(child)); } else { retval += printf("%s", device_get_nameunit(child)); } return (retval); } int bus_print_child_footer (device_t dev, device_t child) { return (printf(" on %s\n", device_get_nameunit(dev))); } int bus_generic_print_child(device_t dev, device_t child) { int retval = 0; retval += bus_print_child_header(dev, child); retval += bus_print_child_footer(dev, child); return (retval); } int bus_generic_read_ivar(device_t dev, device_t child, int index, uintptr_t * result) { return (ENOENT); } int bus_generic_write_ivar(device_t dev, device_t child, int index, uintptr_t value) { return (ENOENT); } struct resource_list * bus_generic_get_resource_list (device_t dev, device_t child) { return (NULL); } void bus_generic_driver_added(device_t dev, driver_t *driver) { device_t child; DEVICE_IDENTIFY(driver, dev); TAILQ_FOREACH(child, &dev->children, link) { if (child->state == DS_NOTPRESENT) device_probe_and_attach(child); } } int bus_generic_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_intr_t *intr, void *arg, void **cookiep) { /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_SETUP_INTR(dev->parent, child, irq, flags, intr, arg, cookiep)); return (EINVAL); } int bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie) { /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_TEARDOWN_INTR(dev->parent, child, irq, cookie)); return (EINVAL); } struct resource * bus_generic_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_ALLOC_RESOURCE(dev->parent, child, type, rid, start, end, count, flags)); return (NULL); } int bus_generic_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_RELEASE_RESOURCE(dev->parent, child, type, rid, r)); return (EINVAL); } int bus_generic_activate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_ACTIVATE_RESOURCE(dev->parent, child, type, rid, r)); return (EINVAL); } int bus_generic_deactivate_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_DEACTIVATE_RESOURCE(dev->parent, child, type, rid, r)); return (EINVAL); } int bus_generic_rl_get_resource (device_t dev, device_t child, int type, int rid, u_long *startp, u_long *countp) { struct resource_list * rl = NULL; struct resource_list_entry * rle = NULL; rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return (EINVAL); rle = resource_list_find(rl, type, rid); if (!rle) return (ENOENT); if (startp) *startp = rle->start; if (countp) *countp = rle->count; return (0); } int bus_generic_rl_set_resource (device_t dev, device_t child, int type, int rid, u_long start, u_long count) { struct resource_list * rl = NULL; rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return (EINVAL); resource_list_add(rl, type, rid, start, (start + count - 1), count); return (0); } void bus_generic_rl_delete_resource (device_t dev, device_t child, int type, int rid) { struct resource_list * rl = NULL; rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return; resource_list_delete(rl, type, rid); return; } int bus_generic_rl_release_resource (device_t dev, device_t child, int type, int rid, struct resource *r) { struct resource_list * rl = NULL; rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return (EINVAL); return (resource_list_release(rl, dev, child, type, rid, r)); } struct resource * bus_generic_rl_alloc_resource (device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { struct resource_list * rl = NULL; rl = BUS_GET_RESOURCE_LIST(dev, child); if (!rl) return (NULL); return (resource_list_alloc(rl, dev, child, type, rid, start, end, count, flags)); } int bus_generic_child_present(device_t bus, device_t child) { return (BUS_CHILD_PRESENT(device_get_parent(bus), bus)); } /* * Some convenience functions to make it easier for drivers to use the * resource-management functions. All these really do is hide the * indirection through the parent's method table, making for slightly * less-wordy code. In the future, it might make sense for this code * to maintain some sort of a list of resources allocated by each device. */ struct resource * bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { if (dev->parent == 0) return (0); return (BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end, count, flags)); } int bus_activate_resource(device_t dev, int type, int rid, struct resource *r) { if (dev->parent == 0) return (EINVAL); return (BUS_ACTIVATE_RESOURCE(dev->parent, dev, type, rid, r)); } int bus_deactivate_resource(device_t dev, int type, int rid, struct resource *r) { if (dev->parent == 0) return (EINVAL); return (BUS_DEACTIVATE_RESOURCE(dev->parent, dev, type, rid, r)); } int bus_release_resource(device_t dev, int type, int rid, struct resource *r) { if (dev->parent == 0) return (EINVAL); return (BUS_RELEASE_RESOURCE(dev->parent, dev, type, rid, r)); } int bus_setup_intr(device_t dev, struct resource *r, int flags, driver_intr_t handler, void *arg, void **cookiep) { if (dev->parent == 0) return (EINVAL); return (BUS_SETUP_INTR(dev->parent, dev, r, flags, handler, arg, cookiep)); } int bus_teardown_intr(device_t dev, struct resource *r, void *cookie) { if (dev->parent == 0) return (EINVAL); return (BUS_TEARDOWN_INTR(dev->parent, dev, r, cookie)); } int bus_set_resource(device_t dev, int type, int rid, u_long start, u_long count) { return (BUS_SET_RESOURCE(device_get_parent(dev), dev, type, rid, start, count)); } int bus_get_resource(device_t dev, int type, int rid, u_long *startp, u_long *countp) { return (BUS_GET_RESOURCE(device_get_parent(dev), dev, type, rid, startp, countp)); } u_long bus_get_resource_start(device_t dev, int type, int rid) { u_long start, count; int error; error = BUS_GET_RESOURCE(device_get_parent(dev), dev, type, rid, &start, &count); if (error) return (0); return (start); } u_long bus_get_resource_count(device_t dev, int type, int rid) { u_long start, count; int error; error = BUS_GET_RESOURCE(device_get_parent(dev), dev, type, rid, &start, &count); if (error) return (0); return (count); } void bus_delete_resource(device_t dev, int type, int rid) { BUS_DELETE_RESOURCE(device_get_parent(dev), dev, type, rid); } int bus_child_present(device_t child) { return (BUS_CHILD_PRESENT(device_get_parent(child), child)); } int bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen) { device_t parent; parent = device_get_parent(child); if (parent == NULL) { *buf = '\0'; return (0); } return (BUS_CHILD_PNPINFO_STR(parent, child, buf, buflen)); } int bus_child_location_str(device_t child, char *buf, size_t buflen) { device_t parent; parent = device_get_parent(child); if (parent == NULL) { *buf = '\0'; return (0); } return (BUS_CHILD_LOCATION_STR(parent, child, buf, buflen)); } static int root_print_child(device_t dev, device_t child) { int retval = 0; retval += bus_print_child_header(dev, child); retval += printf("\n"); return (retval); } static int root_setup_intr(device_t dev, device_t child, driver_intr_t *intr, void *arg, void **cookiep) { /* * If an interrupt mapping gets to here something bad has happened. */ panic("root_setup_intr"); } /* * If we get here, assume that the device is permanant and really is * present in the system. Removable bus drivers are expected to intercept * this call long before it gets here. We return -1 so that drivers that * really care can check vs -1 or some ERRNO returned higher in the food * chain. */ static int root_child_present(device_t dev, device_t child) { return (-1); } static kobj_method_t root_methods[] = { /* Device interface */ KOBJMETHOD(device_shutdown, bus_generic_shutdown), KOBJMETHOD(device_suspend, bus_generic_suspend), KOBJMETHOD(device_resume, bus_generic_resume), /* Bus interface */ KOBJMETHOD(bus_print_child, root_print_child), KOBJMETHOD(bus_read_ivar, bus_generic_read_ivar), KOBJMETHOD(bus_write_ivar, bus_generic_write_ivar), KOBJMETHOD(bus_setup_intr, root_setup_intr), KOBJMETHOD(bus_child_present, root_child_present), { 0, 0 } }; static driver_t root_driver = { "root", root_methods, 1, /* no softc */ }; device_t root_bus; devclass_t root_devclass; static int root_bus_module_handler(module_t mod, int what, void* arg) { switch (what) { case MOD_LOAD: TAILQ_INIT(&bus_data_devices); kobj_class_compile((kobj_class_t) &root_driver); root_bus = make_device(NULL, "root", 0); root_bus->desc = "System root bus"; kobj_init((kobj_t) root_bus, (kobj_class_t) &root_driver); root_bus->driver = &root_driver; root_bus->state = DS_ATTACHED; root_devclass = devclass_find_internal("root", FALSE); devinit(); return (0); case MOD_SHUTDOWN: device_shutdown(root_bus); return (0); } return (0); } static moduledata_t root_bus_mod = { "rootbus", root_bus_module_handler, 0 }; DECLARE_MODULE(rootbus, root_bus_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); void root_bus_configure(void) { device_t dev; PDEBUG((".")); TAILQ_FOREACH(dev, &root_bus->children, link) { device_probe_and_attach(dev); } } int driver_module_handler(module_t mod, int what, void *arg) { int error, i; struct driver_module_data *dmd; devclass_t bus_devclass; dmd = (struct driver_module_data *)arg; bus_devclass = devclass_find_internal(dmd->dmd_busname, TRUE); error = 0; switch (what) { case MOD_LOAD: if (dmd->dmd_chainevh) error = dmd->dmd_chainevh(mod,what,dmd->dmd_chainarg); for (i = 0; !error && i < dmd->dmd_ndrivers; i++) { PDEBUG(("Loading module: driver %s on bus %s", DRIVERNAME(dmd->dmd_drivers[i]), dmd->dmd_busname)); error = devclass_add_driver(bus_devclass, dmd->dmd_drivers[i]); } if (error) break; /* * The drivers loaded in this way are assumed to all * implement the same devclass. */ *dmd->dmd_devclass = devclass_find_internal(dmd->dmd_drivers[0]->name, TRUE); break; case MOD_UNLOAD: for (i = 0; !error && i < dmd->dmd_ndrivers; i++) { PDEBUG(("Unloading module: driver %s from bus %s", DRIVERNAME(dmd->dmd_drivers[i]), dmd->dmd_busname)); error = devclass_delete_driver(bus_devclass, dmd->dmd_drivers[i]); } if (!error && dmd->dmd_chainevh) error = dmd->dmd_chainevh(mod,what,dmd->dmd_chainarg); break; } return (error); } #ifdef BUS_DEBUG /* the _short versions avoid iteration by not calling anything that prints * more than oneliners. I love oneliners. */ static void print_device_short(device_t dev, int indent) { if (!dev) return; indentprintf(("device %d: <%s> %sparent,%schildren,%s%s%s%s,%sivars,%ssoftc,busy=%d\n", dev->unit, dev->desc, (dev->parent? "":"no "), (TAILQ_EMPTY(&dev->children)? "no ":""), (dev->flags&DF_ENABLED? "enabled,":"disabled,"), (dev->flags&DF_FIXEDCLASS? "fixed,":""), (dev->flags&DF_WILDCARD? "wildcard,":""), (dev->flags&DF_DESCMALLOCED? "descmalloced,":""), (dev->ivars? "":"no "), (dev->softc? "":"no "), dev->busy)); } static void print_device(device_t dev, int indent) { if (!dev) return; print_device_short(dev, indent); indentprintf(("Parent:\n")); print_device_short(dev->parent, indent+1); indentprintf(("Driver:\n")); print_driver_short(dev->driver, indent+1); indentprintf(("Devclass:\n")); print_devclass_short(dev->devclass, indent+1); } void print_device_tree_short(device_t dev, int indent) /* print the device and all its children (indented) */ { device_t child; if (!dev) return; print_device_short(dev, indent); TAILQ_FOREACH(child, &dev->children, link) { print_device_tree_short(child, indent+1); } } void print_device_tree(device_t dev, int indent) /* print the device and all its children (indented) */ { device_t child; if (!dev) return; print_device(dev, indent); TAILQ_FOREACH(child, &dev->children, link) { print_device_tree(child, indent+1); } } static void print_driver_short(driver_t *driver, int indent) { if (!driver) return; indentprintf(("driver %s: softc size = %zd\n", driver->name, driver->size)); } static void print_driver(driver_t *driver, int indent) { if (!driver) return; print_driver_short(driver, indent); } static void print_driver_list(driver_list_t drivers, int indent) { driverlink_t driver; TAILQ_FOREACH(driver, &drivers, link) { print_driver(driver->driver, indent); } } static void print_devclass_short(devclass_t dc, int indent) { if ( !dc ) return; indentprintf(("devclass %s: max units = %d\n", dc->name, dc->maxunit)); } static void print_devclass(devclass_t dc, int indent) { int i; if ( !dc ) return; print_devclass_short(dc, indent); indentprintf(("Drivers:\n")); print_driver_list(dc->drivers, indent+1); indentprintf(("Devices:\n")); for (i = 0; i < dc->maxunit; i++) if (dc->devices[i]) print_device(dc->devices[i], indent+1); } void print_devclass_list_short(void) { devclass_t dc; printf("Short listing of devclasses, drivers & devices:\n"); TAILQ_FOREACH(dc, &devclasses, link) { print_devclass_short(dc, 0); } } void print_devclass_list(void) { devclass_t dc; printf("Full listing of devclasses, drivers & devices:\n"); TAILQ_FOREACH(dc, &devclasses, link) { print_devclass(dc, 0); } } #endif /* * User-space access to the device tree. * * We implement a small set of nodes: * * hw.bus Single integer read method to obtain the * current generation count. * hw.bus.devices Reads the entire device tree in flat space. * hw.bus.rman Resource manager interface * * We might like to add the ability to scan devclasses and/or drivers to * determine what else is currently loaded/available. */ static int sysctl_bus(SYSCTL_HANDLER_ARGS) { struct u_businfo ubus; ubus.ub_version = BUS_USER_VERSION; ubus.ub_generation = bus_data_generation; return (SYSCTL_OUT(req, &ubus, sizeof(ubus))); } SYSCTL_NODE(_hw_bus, OID_AUTO, info, CTLFLAG_RW, sysctl_bus, "bus-related data"); static int sysctl_devices(SYSCTL_HANDLER_ARGS) { int *name = (int *)arg1; u_int namelen = arg2; int index; struct device *dev; struct u_device udev; /* XXX this is a bit big */ int error; if (namelen != 2) return (EINVAL); if (bus_data_generation_check(name[0])) return (EINVAL); index = name[1]; /* * Scan the list of devices, looking for the requested index. */ TAILQ_FOREACH(dev, &bus_data_devices, devlink) { if (index-- == 0) break; } if (dev == NULL) return (ENOENT); /* * Populate the return array. */ udev.dv_handle = (uintptr_t)dev; udev.dv_parent = (uintptr_t)dev->parent; if (dev->nameunit == NULL) udev.dv_name[0] = '\0'; else strlcpy(udev.dv_name, dev->nameunit, sizeof(udev.dv_name)); if (dev->desc == NULL) udev.dv_desc[0] = '\0'; else strlcpy(udev.dv_desc, dev->desc, sizeof(udev.dv_desc)); if (dev->driver == NULL || dev->driver->name == NULL) udev.dv_drivername[0] = '\0'; else strlcpy(udev.dv_drivername, dev->driver->name, sizeof(udev.dv_drivername)); udev.dv_pnpinfo[0] = '\0'; udev.dv_location[0] = '\0'; bus_child_pnpinfo_str(dev, udev.dv_pnpinfo, sizeof(udev.dv_pnpinfo)); bus_child_location_str(dev, udev.dv_location, sizeof(udev.dv_location)); udev.dv_devflags = dev->devflags; udev.dv_flags = dev->flags; udev.dv_state = dev->state; error = SYSCTL_OUT(req, &udev, sizeof(udev)); return (error); } SYSCTL_NODE(_hw_bus, OID_AUTO, devices, CTLFLAG_RD, sysctl_devices, "system device tree"); /* * Sysctl interface for scanning the resource lists. * * We take two input parameters; the index into the list of resource * managers, and the resource offset into the list. */ static int sysctl_rman(SYSCTL_HANDLER_ARGS) { int *name = (int *)arg1; u_int namelen = arg2; int rman_idx, res_idx; struct rman *rm; struct resource *res; struct u_rman urm; struct u_resource ures; int error; if (namelen != 3) return (EINVAL); if (bus_data_generation_check(name[0])) return (EINVAL); rman_idx = name[1]; res_idx = name[2]; /* * Find the indexed resource manager */ TAILQ_FOREACH(rm, &rman_head, rm_link) { if (rman_idx-- == 0) break; } if (rm == NULL) return (ENOENT); /* * If the resource index is -1, we want details on the * resource manager. */ if (res_idx == -1) { urm.rm_handle = (uintptr_t)rm; strlcpy(urm.rm_descr, rm->rm_descr, RM_TEXTLEN); urm.rm_start = rm->rm_start; urm.rm_size = rm->rm_end - rm->rm_start + 1; urm.rm_type = rm->rm_type; error = SYSCTL_OUT(req, &urm, sizeof(urm)); return (error); } /* * Find the indexed resource and return it. */ TAILQ_FOREACH(res, &rm->rm_list, r_link) { if (res_idx-- == 0) { ures.r_handle = (uintptr_t)res; ures.r_parent = (uintptr_t)res->r_rm; ures.r_device = (uintptr_t)res->r_dev; if (res->r_dev != NULL) { if (device_get_name(res->r_dev) != NULL) { snprintf(ures.r_devname, RM_TEXTLEN, "%s%d", device_get_name(res->r_dev), device_get_unit(res->r_dev)); } else { strlcpy(ures.r_devname, "nomatch", RM_TEXTLEN); } } else { ures.r_devname[0] = '\0'; } ures.r_start = res->r_start; ures.r_size = res->r_end - res->r_start + 1; ures.r_flags = res->r_flags; error = SYSCTL_OUT(req, &ures, sizeof(ures)); return (error); } } return (ENOENT); } SYSCTL_NODE(_hw_bus, OID_AUTO, rman, CTLFLAG_RD, sysctl_rman, "kernel resource manager"); int bus_data_generation_check(int generation) { if (generation != bus_data_generation) return (1); /* XXX generate optimised lists here? */ return (0); } void bus_data_generation_update(void) { bus_data_generation++; }
22.170181
114
0.686044
[ "object" ]
db4da4a1634e3021c66adcdc60bbf15c648fd0b9
7,998
h
C
DataFormats/Scalers/interface/ScalersRaw.h
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
3
2018-08-24T19:10:26.000Z
2019-02-19T11:45:32.000Z
DataFormats/Scalers/interface/ScalersRaw.h
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
3
2018-08-23T13:40:24.000Z
2019-12-05T21:16:03.000Z
DataFormats/Scalers/interface/ScalersRaw.h
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
5
2018-08-21T16:37:52.000Z
2020-01-09T13:33:17.000Z
/* * File: DataFormats/Scalers/interface/ScalersRaw.h (W.Badgett) * * Description of the raw data from the Scalers FED * */ #ifndef SCALERSRAW_H #define SCALERSRAW_H #include <ostream> #include <vector> /*! \file ScalersRaw.h * \Header file for Raw Data Level 1 Global Trigger Scalers and Lumi Scalers * * \author: William Badgett * */ #pragma pack(push) #pragma pack(4) /// \class ScalersRaw.h /// \brief Raw Data Level 1 Global Trigger Scalers and Lumi Scalers class ScalersRaw { public: enum { N_L1_TRIGGERS_v1 = 128, N_L1_TEST_TRIGGERS_v1 = 64, N_LUMI_OCC_v1 = 2, N_BX_v2 = 4, N_BX_v6 = 8, N_SPARE_v5 = 3, I_SPARE_PILEUP_v7 = 0, I_SPARE_PILEUPRMS_v7 = 1, I_SPARE_BUNCHLUMI_v8 = 2, I_SPARE_SPARE_v8 = 3, SCALERS_FED_ID = 735 }; }; struct TriggerScalersRaw_v1 { unsigned int collectionTimeSpecial_sec; unsigned int collectionTimeSpecial_nsec; unsigned int ORBIT_NUMBER; /* ORBITNR */ unsigned int LUMINOSITY_SEGMENT; unsigned short BC_ERRORS; unsigned int collectionTimeSummary_sec; unsigned int collectionTimeSummary_nsec; unsigned int TRIGGER_NR; /* TRIGNR_ */ unsigned int EVENT_NR; /* EVNR */ unsigned int FINOR_DISTRIBUTED; /* PHYS_L1A ?? */ unsigned int CAL_TRIGGER; /* CAL_L1A_ */ unsigned int RANDOM_TRIGGER; /* RNDM_L1A_ */ unsigned int TEST_TRIGGER; /* TECHTRIG_ */ unsigned int FINOR_GENERATED; /* FINOR_ ?? */ unsigned int FINOR_IN_INVALID_BC; /* LOST_BC_ ?? */ unsigned long long DEADTIME; /* DEADT_ */ unsigned long long LOST_FINOR; /* LOST_TRIG_ ?? */ unsigned long long DEADTIMEA; /* DEADT_A */ unsigned long long LOST_FINORA; /* LOST_TRIG_A ?? */ unsigned long long PRIV_DEADTIMEA; /* DEADT_PRIV_A */ unsigned long long PTCSTATUS_DEADTIMEA; /* DEADT_PSTATUS_A */ unsigned long long THROTTLE_DEADTIMEA; /* DEADT_THROTTLE_A */ unsigned long long CALIBRATION_DEADTIMEA; /* DEADT_CALIBR_A */ unsigned long long TIMESLOT_DEADTIMEA; /* */ unsigned int NR_OF_RESETS; /* NR_RESETS_ */ unsigned int collectionTimeDetails_sec; unsigned int collectionTimeDetails_nsec; unsigned int ALGO_RATE[ScalersRaw::N_L1_TRIGGERS_v1]; unsigned int TEST_RATE[ScalersRaw::N_L1_TEST_TRIGGERS_v1]; }; struct TriggerScalersRaw_v3 { unsigned int collectionTime_sec; unsigned int collectionTime_nsec; unsigned int lumiSegmentNr; unsigned int lumiSegmentOrbits; unsigned int orbitNr; unsigned int gtResets; unsigned int bunchCrossingErrors; unsigned long long gtTriggers; unsigned long long gtEvents; float gtTriggersRate; float gtEventsRate; int prescaleIndexAlgo; int prescaleIndexTech; unsigned int collectionTimeLumiSeg_sec; unsigned int collectionTimeLumiSeg_nsec; unsigned int lumiSegmentNrLumiSeg; unsigned long long triggersPhysicsGeneratedFDL; unsigned long long triggersPhysicsLost; unsigned long long triggersPhysicsLostBeamActive; unsigned long long triggersPhysicsLostBeamInactive; unsigned long long l1AsPhysics; unsigned long long l1AsRandom; unsigned long long l1AsTest; unsigned long long l1AsCalibration; unsigned long long deadtime; unsigned long long deadtimeBeamActive; unsigned long long deadtimeBeamActiveTriggerRules; unsigned long long deadtimeBeamActiveCalibration; unsigned long long deadtimeBeamActivePrivateOrbit; unsigned long long deadtimeBeamActivePartitionController; unsigned long long deadtimeBeamActiveTimeSlot; unsigned int gtAlgoCounts[ScalersRaw::N_L1_TRIGGERS_v1]; unsigned int gtTechCounts[ScalersRaw::N_L1_TEST_TRIGGERS_v1]; }; struct LumiScalersRaw_v1 { unsigned int collectionTime_sec; unsigned int collectionTime_nsec; float DeadtimeNormalization; float Normalization; float LumiFill; float LumiRun; float LiveLumiFill; float LiveLumiRun; float InstantLumi; float InstantLumiErr; unsigned char InstantLumiQlty; float LumiETFill; float LumiETRun; float LiveLumiETFill; float LiveLumiETRun; float InstantETLumi; float InstantETLumiErr; unsigned char InstantETLumiQlty; float LumiOccFill[ScalersRaw::N_LUMI_OCC_v1]; float LumiOccRun[ScalersRaw::N_LUMI_OCC_v1]; float LiveLumiOccFill[ScalersRaw::N_LUMI_OCC_v1]; float LiveLumiOccRun[ScalersRaw::N_LUMI_OCC_v1]; float InstantOccLumi[ScalersRaw::N_LUMI_OCC_v1]; float InstantOccLumiErr[ScalersRaw::N_LUMI_OCC_v1]; unsigned char InstantOccLumiQlty[ScalersRaw::N_LUMI_OCC_v1]; float lumiNoise[ScalersRaw::N_LUMI_OCC_v1]; unsigned int sectionNumber; unsigned int startOrbit; unsigned int numOrbits; }; struct BeamSpotOnlineRaw_v4 { unsigned int collectionTime_sec; unsigned int collectionTime_nsec; float x; float y; float z; float dxdz; float dydz; float err_x; float err_y; float err_z; float err_dxdz; float err_dydz; float width_x; float width_y; float sigma_z; float err_width_x; float err_width_y; float err_sigma_z; }; struct DcsStatusRaw_v4 { unsigned int collectionTime_sec; unsigned int collectionTime_nsec; unsigned int ready; float magnetCurrent; float magnetTemperature; }; struct ScalersEventRecordRaw_v1 { unsigned long long header; int version; struct TriggerScalersRaw_v1 trig; struct LumiScalersRaw_v1 lumi; unsigned int filler; unsigned long long trailer; }; struct ScalersEventRecordRaw_v2 { unsigned long long header; int version; struct TriggerScalersRaw_v1 trig; struct LumiScalersRaw_v1 lumi; unsigned int filler; unsigned long long bx[ScalersRaw::N_BX_v2]; unsigned long long trailer; }; struct ScalersEventRecordRaw_v3 { unsigned long long header; int version; struct TriggerScalersRaw_v3 trig; struct LumiScalersRaw_v1 lumi; unsigned int filler; unsigned long long bx[ScalersRaw::N_BX_v2]; unsigned long long trailer; }; struct ScalersEventRecordRaw_v4 { unsigned long long header; int version; struct TriggerScalersRaw_v3 trig; struct LumiScalersRaw_v1 lumi; struct BeamSpotOnlineRaw_v4 beamSpotOnline; struct DcsStatusRaw_v4 dcsStatus; unsigned long long bx[ScalersRaw::N_BX_v2]; unsigned long long trailer; }; struct ScalersEventRecordRaw_v5 { unsigned long long header; int version; struct TriggerScalersRaw_v3 trig; struct LumiScalersRaw_v1 lumi; struct BeamSpotOnlineRaw_v4 beamSpotOnline; struct DcsStatusRaw_v4 dcsStatus; unsigned int lastOrbitCounter0; unsigned int lastTestEnable; unsigned int lastResync; unsigned int lastStart; unsigned int lastEventCounter0; unsigned int lastHardReset; unsigned long long spare[ScalersRaw::N_SPARE_v5]; unsigned long long bx[ScalersRaw::N_BX_v2]; unsigned long long trailer; }; struct ScalersEventRecordRaw_v6 { unsigned long long header; int version; struct TriggerScalersRaw_v3 trig; struct LumiScalersRaw_v1 lumi; struct BeamSpotOnlineRaw_v4 beamSpotOnline; struct DcsStatusRaw_v4 dcsStatus; unsigned int lastOrbitCounter0; unsigned int lastTestEnable; unsigned int lastResync; unsigned int lastStart; unsigned int lastEventCounter0; unsigned int lastHardReset; unsigned long long spare[ScalersRaw::N_SPARE_v5]; unsigned long long bx[ScalersRaw::N_BX_v6]; unsigned long long trailer; }; #pragma pack(pop) #endif
29.189781
76
0.697799
[ "vector" ]
db564bd82189cd43746f1f1f15118b79f8ed5d8a
945
h
C
src/Grid.h
tljakzl/fem_itmo
97311bb4e1192934942b3966fef41d7841e5723a
[ "MIT" ]
null
null
null
src/Grid.h
tljakzl/fem_itmo
97311bb4e1192934942b3966fef41d7841e5723a
[ "MIT" ]
null
null
null
src/Grid.h
tljakzl/fem_itmo
97311bb4e1192934942b3966fef41d7841e5723a
[ "MIT" ]
null
null
null
#pragma once #include <vector> #include <map> #include <algorithm> #include "Node.h" #include "FE.h" #include "DMat.h" class Grid { public: std::vector<Node*> allNodes; std::vector<FE*> finiteElements; /// <summary> /// Передаем координаты сетки, привязку и гу создается сетка, создаются КЭ /// </summary> /// <param name="points">Массив координат узлов (геометрически предсортированный)</param> /// <param name="rectangles">Привязка КЭ к номеру узла</param> Grid(std::vector<Point> points, std::map<int, std::vector<int>> rectangles, std::map<int, int> bcond1, std::map<int, int> rp, std::map<int, int> lambda, std::map<int, int> gamma, std::map<std::pair<int, int>, int> bcond2, std::map<std::pair<int, int>, int> bcond3); ~Grid(); std::vector<Point> scaffoldFEPoints(std::vector<Point> points); void calculateLocalMatrices(); DMat<double> buildGlobalMatrix(); std::vector<double> buildGlobalRP(); };
24.868421
90
0.68254
[ "vector" ]
db57bed5174b93fc0cab3728ebcfc5580107494c
4,287
h
C
src/ofxBvh.h
kylemcdonald/ofxBvh
fcd87e5bb99f7a9733cd514b0891ffee266379fa
[ "MIT" ]
14
2018-02-17T13:26:48.000Z
2020-12-18T00:38:57.000Z
src/ofxBvh.h
kylemcdonald/ofxBvh
fcd87e5bb99f7a9733cd514b0891ffee266379fa
[ "MIT" ]
15
2018-03-07T00:48:08.000Z
2020-07-07T22:46:54.000Z
src/ofxBvh.h
kylemcdonald/ofxBvh
fcd87e5bb99f7a9733cd514b0891ffee266379fa
[ "MIT" ]
4
2018-02-17T14:21:14.000Z
2022-02-17T11:20:37.000Z
#pragma once #include "ofVectorMath.h" #include <map> class ofxBvhJoint { friend class ofxBvh; private: int channels = 0; std::string rotationOrder; ofxBvhJoint* parent = nullptr; std::vector<std::shared_ptr<ofxBvhJoint>> children; void dumpHierarchy(std::ostream& output, std::string tabs=""); void drawHierarchy(bool drawNames=false); void updateRaw(std::vector<double>::const_iterator& frame); // splits frame into raw void updateMatrix(glm::mat4 global=glm::mat4()); // converts raw to localMat and globalMat void readRaw(std::vector<double>::iterator& frame); // joins raw into frame void readMatrix(); // converts localMat to raw void readOffsets(std::vector<double>::iterator& frame); // read offsets into frame public: std::string name; glm::vec3 offset; glm::mat4 localMat, globalMat; std::vector<double> raw; inline glm::vec3 getPosition() const { return globalMat[3]; } inline glm::vec3 getPositionLocal() const { return localMat[3]; } inline glm::quat getRotation() const { return globalMat; } inline glm::quat getRotationLocal() const { return localMat; } void setPositionRaw(const glm::vec3& position); void setRotationRaw(const glm::quat& rotation); void setRotationRaw(const glm::vec3& rotation); glm::vec3 getPositionRaw() const; glm::vec3 getRotationRaw() const; inline ofxBvhJoint* getParent() const { return parent; } inline const std::vector<std::shared_ptr<ofxBvhJoint>>& getChildren() const { return children; } inline bool isSite() const { return children.empty(); } inline bool isRoot() const { return !parent; } }; class ofxBvh { protected: std::shared_ptr<ofxBvhJoint> root; std::vector<ofxBvhJoint*> joints; std::map<std::string, ofxBvhJoint*> jointMap; double frameTime = 0; std::vector<std::vector<double>> motion; unsigned int channels = 0; float playRate = 1; float startTime = 0; unsigned int startFrame = 0; unsigned int frameNumber = 0; bool playing = false; bool loop = true; bool frameNew = false; static void dumpMotion(std::ostream& output, float frameTime, const std::vector<std::vector<double>>& motion); bool checkReady() const; public: ofxBvh() {} ofxBvh(std::string filename); void save(std::string filename) const; inline void update() { updatePlayTime(); updateJointsRaw(); updateJointsMatrix(); } void updatePlayTime(); // update the frameNumber from the current time void updateJointsRaw(); // write motion data into all joints raw data void updateJointsMatrix(); // write joints raw data into joints matrices inline void read() { readJointsMatrix(); readJointsRaw(); } void readJointsMatrix(); // read all joint matrices into joints raw data void readJointsRaw(); // read joints raw data into motion data bool isFrameNew() const; bool ready() const; void draw(bool drawNames=false) const; std::string info() const; const std::vector<ofxBvhJoint*>& getJoints() const; ofxBvhJoint* getJoint(const std::string& name); void play(); void stop(); void setRate(float playRate); float getRate() const; void togglePlaying(); bool isPlaying() const; void setLoop(bool loop); bool isLoop() const; float getDuration() const; // in seconds unsigned int getNumFrames() const; // total frame count float getFrameDuration() const; // in seconds float getFrameRate() const; // in frames per second unsigned int getFrame() const; float getTime() const; // current time in seconds float getPosition() const; // current position 0-1 void setFrame(unsigned int frameNumber); void setTime(float seconds); // set time in seconds void setPosition(float ratio); // set position 0-1 // cropping will cause playback to stop void clearFrames(); void addFrame(); void cropToFrame(unsigned int beginFrameNumber, unsigned int endFrameNumber=0); void cropToTime(float beginSeconds, float endSeconds=0); void cropToPosition(float beginRatio, float endRatio=0); void padBegin(unsigned int frames); void padEnd(unsigned int frames); };
36.02521
114
0.681596
[ "vector" ]
db5a022a970770fa51008cfbe9d56c83f930a019
15,336
c
C
ensmean.c
fmidev/fmippn-run-and-distribution
b1aa0ee3dc59b6f10d5072cd5784c2d751219c58
[ "MIT" ]
null
null
null
ensmean.c
fmidev/fmippn-run-and-distribution
b1aa0ee3dc59b6f10d5072cd5784c2d751219c58
[ "MIT" ]
null
null
null
ensmean.c
fmidev/fmippn-run-and-distribution
b1aa0ee3dc59b6f10d5072cd5784c2d751219c58
[ "MIT" ]
null
null
null
# define _BSD_SOURCE #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> #include <string.h> #include <unistd.h> #include <limits.h> #include <sys/types.h> #include <stdint.h> #include <ctype.h> #include <hdf5.h> #include <hdf5_hl.h> #define DEFSETS 1000 #define UNIT_DBZ 0 #define UNIT_RATE 1 double ZR_A=223.0, ZR_B=1.53; int get_variable_string(hid_t h5,char *datasetname, char *attrname, char *str); uint8_t RfromdBZN(uint8_t dBZN); uint8_t dBZNfromRi(uint16_t Ri, double gain, double offset); int main(int argc, char *argv[]) { /* HDF5 variables */ hid_t INH5,OUTH5,whatg,whereg,howg,datasetg,datag,datawhatg,attr; hid_t setwhatg,setwhereg,sethowg,dataset,plist,space,datatype,memtype,filetype; hsize_t dims[2],chunkdims[2]={100,100}; size_t typesize,arrsize,databytes; int unit=UNIT_DBZ; double RdBZN[256],K=1.0; double xscale,yscale,*sumdata,fval,RATE,meanR; /* double LL_lon,LL_lat,UL_lon,UL_lat,UR_lon,UR_lat,LR_lon,LR_lat; */ double gain=1.0,offset=0.0,fnodata=65535.0,undetect=0.0,goffset; uint8_t dBZNRi[65536],*countdata; long long int longtime; long xsize,ysize,N,Ri; uint16_t *membdata,*meandata,meanRi,nodata=65535,val; long dBZNi; uint8_t *dBZdata,dBZN, DBZ_DATA=0, RATE_DATA=0; char projdef[200]; char timestamp[15]={0}; char HDFoutfile[300]; char unitstr[20]; herr_t ret,status; int i,FIRST=1,len; H5T_class_t class_id; char datagname[100]; char pgmname[100]; char datasetname[100],validtimestr[50]={0}; int membI=0,leadtI=0,leadtimes=DEFSETS,members=DEFSETS; FILE *PGMF; /* char membstr[5]={0},leadtstr[5]={0}; */ setbuf(stdout,NULL); H5Eset_auto(H5E_DEFAULT,NULL,NULL); INH5=H5Fopen(argv[1], H5F_ACC_RDONLY, H5P_DEFAULT); datatype=H5T_STD_U16LE; H5LTget_attribute_double(INH5,"/meta/configuration","ZR_A",&ZR_A); H5LTget_attribute_double(INH5,"/meta/configuration","ZR_B",&ZR_B); /* printf("%d\n",RitodBZN(1,1.0)); */ /* R from dBZN LUT */ { double R=0.0,B,rcW; int N; B = 0.05/ZR_B; rcW = -(3.2 + log10(ZR_A))/ZR_B; RdBZN[0]=0; RdBZN[255]=-1e-6; for(N=1;N<255;N++) RdBZN[N]=pow(10.0,B*(double)N + rcW); } for(leadtI=0;;leadtI++) { printf("Lead=%02d\nMembers: ",leadtI); for(membI=0;membI<members;membI++) { sprintf(datasetname,"/member-%02d/leadtime-%02d",membI,leadtI); if(FIRST) { H5LTget_dataset_info(INH5, datasetname, dims, &class_id, &typesize ); /* printf("%ld %ld\n",xsize,ysize); */ xsize=(long)dims[1]; ysize=(long)dims[0]; arrsize=xsize*ysize; databytes=arrsize*typesize; meandata=malloc(databytes); memset(meandata,255,databytes); dBZdata=malloc(arrsize); countdata=malloc(arrsize); membdata=malloc(databytes); sumdata=malloc(arrsize*sizeof(double)); H5LTget_attribute_double(INH5,datasetname,"gain",&gain); H5LTget_attribute_double(INH5,datasetname,"nodata",&fnodata); H5LTget_attribute_double(INH5,datasetname,"offset",&offset); goffset=gain/offset; len=get_variable_string(INH5,"meta","nowcast_units",unitstr); /* printf("varstr: %d %s\n",len,unitstr); */ if(strstr(unitstr,"dBZ")) DBZ_DATA=1; if(strstr(unitstr,"rrate")) RATE_DATA=1; nodata=(uint16_t)(fnodata+1e-9); for(Ri=0;Ri<=65535;Ri++) dBZNRi[Ri]=dBZNfromRi(Ri,gain,offset); /* printf("FIRST %d gain %f, offset %f, DBZ_DATA %d RATE_DATA %d\n",FIRST,gain,offset,DBZ_DATA,RATE_DATA); */ FIRST=0; } ret=H5LTget_attribute_info(INH5, datasetname, "Valid for", dims, &class_id, &typesize); if(ret<0) { if(!leadtI) members=membI; else leadtimes=leadtI; break; } else { if(class_id == H5T_INTEGER) { ret=H5LTget_attribute_long_long(INH5, datasetname, "Valid for", &longtime); /* dateint=longtime/1000000; timeint=longtime%1000000; */ sprintf(timestamp,"%lld",longtime/100); } if(!membI) { memset(sumdata,0,arrsize*sizeof(double)); memset(countdata,0,arrsize); } H5LTread_dataset(INH5,datasetname,datatype,membdata); memset(dBZdata,255,arrsize); for(N=0;N<arrsize;N++) { val=membdata[N]; if(val==nodata) continue; fval=(double)val; if(RATE_DATA) { RATE = fval*gain+offset; dBZN=dBZNRi[val]; } if(DBZ_DATA) { dBZNi=2*(fval*gain + offset)+64; dBZN=(uint8_t)dBZNi; if(dBZNi>=255) dBZN=255; if(dBZNi<0) dBZN=0; } dBZdata[N]=dBZN; if(DBZ_DATA) RATE = RdBZN[dBZN]; sumdata[N] += RATE; countdata[N]++; } printf("%02d ",membI); if(!membI) { sprintf(pgmname,"membR_%s_%02d.pgm",timestamp,membI); PGMF=fopen(pgmname,"w"); fprintf(PGMF,"P5\n%ld %ld\n65535\n",xsize,ysize); swab(membdata,membdata,databytes); fwrite(membdata,1,databytes,PGMF); fclose(PGMF); sprintf(pgmname,"memb0_dBZ_%s.pgm",timestamp); PGMF=fopen(pgmname,"w"); fprintf(PGMF,"P5\n%ld %ld\n255\n",xsize,ysize); fwrite(dBZdata,1,arrsize,PGMF); fclose(PGMF); } } } printf("\nMean lead=%02d %s %s\n",leadtI,validtimestr,timestamp); /* Get deterministic */ sprintf(datasetname,"/deterministic/leadtime-%02d",leadtI); ret=H5LTget_attribute_info(INH5, datasetname, "Valid for", dims, &class_id, &typesize); if(ret >= 0) { H5LTread_dataset(INH5,datasetname,datatype,membdata); memset(dBZdata,255,arrsize); for(N=0;N<arrsize;N++) { if(membdata[N]==nodata) continue; if(RATE_DATA) dBZdata[N]=dBZNRi[membdata[N]]; else dBZdata[N]=(uint8_t)(2*((double)membdata[N]*gain+offset)+64); } printf("Deterministic lead=%02d %s %s\n",leadtI,validtimestr,timestamp); sprintf(pgmname,"determdBZ_%s.pgm",timestamp); PGMF=fopen(pgmname,"w"); fprintf(PGMF,"P5\n%ld %ld\n255\n",xsize,ysize); fwrite(dBZdata,1,arrsize,PGMF); fclose(PGMF); } /* Get unperturbed */ sprintf(datasetname,"/unperturbed/leadtime-%02d",leadtI); ret=H5LTget_attribute_info(INH5, datasetname, "Valid for", dims, &class_id, &typesize); if(ret >= 0) { H5LTread_dataset(INH5,datasetname,datatype,membdata); memset(dBZdata,255,arrsize); for(N=0;N<arrsize;N++) { if(membdata[N]==nodata) continue; if(RATE_DATA) dBZdata[N]=dBZNRi[membdata[N]]; else dBZdata[N]=(uint8_t)(2*((double)membdata[N]*gain+offset)+64); } printf("Unperturbed lead=%02d %s %s\n",leadtI,validtimestr,timestamp); sprintf(pgmname,"unpertdBZ_%s.pgm",timestamp); PGMF=fopen(pgmname,"w"); fprintf(PGMF,"P5\n%ld %ld\n255\n",xsize,ysize); fwrite(dBZdata,1,arrsize,PGMF); fclose(PGMF); } if(leadtimes<DEFSETS) break; for(N=0;N<arrsize;N++) { meanR = sumdata[N]/(double)countdata[N]; if(meanR<655.36 && meanR>=0.0) meanRi = (uint16_t)(meanR*100); meandata[N]=meanRi; dBZN = dBZNRi[meanRi]; dBZdata[N]=dBZN; } swab(meandata,meandata,databytes); sprintf(pgmname,"meanR_%s.pgm",timestamp); PGMF=fopen(pgmname,"w"); fprintf(PGMF,"P5\n%ld %ld\n65535\n",xsize,ysize); fwrite(meandata,1,databytes,PGMF); fclose(PGMF); sprintf(pgmname,"meandBZ_%s.pgm",timestamp); PGMF=fopen(pgmname,"w"); fprintf(PGMF,"P5\n%ld %ld\n255\n",xsize,ysize); fwrite(dBZdata,1,arrsize,PGMF); fclose(PGMF); } free(membdata); free(meandata); free(sumdata); free(dBZdata); H5Fclose(INH5); return(0); } /*==================================================================================================*/ uint8_t dBZNfromRi(uint16_t Ri, double gain, double offset) { double R,dBZ; int16_t dBZI; if(!Ri) dBZI=0; else { if(Ri==65535) dBZI=255; else { R=gain*(double)Ri+offset; R=0.01*(double)Ri; dBZ=10.0*log10(ZR_A*pow(R,ZR_B)); if(dBZ > -32.0) dBZI=(int)(2.0*dBZ)+64; else dBZI=0; if(dBZI > 254) dBZI=254; } } /* printf("%d=%d ",R,dBZI); */ return((uint8_t)dBZI); } double dBZNtoR(uint8_t dBZN) { double R=0.0,B,rcW; if(dBZN) { B = 0.05/ZR_B; rcW = -(3.2 + log10(ZR_A))/ZR_B; R=pow(10.0,B*dBZN + rcW); } return(R); } /*--------------------------------------------------------------------------------------------------*/ int get_variable_string(hid_t h5,char *datasetname, char *attrname, char *str) { hid_t dataset,attr,memtype,space; hvl_t rdata; /* Pointer to vlen structures */ char *ptr; int ndims,i,len; hsize_t dims[1] = {1}; herr_t status; memset(str,0,strlen(str)); dataset=H5Dopen(h5,datasetname,H5P_DEFAULT); if(dataset<0) dataset=H5Gopen(h5,datasetname,H5P_DEFAULT); if(dataset<0) return(-1); attr = H5Aopen(dataset, attrname, H5P_DEFAULT); space = H5Aget_space(attr); memtype = H5Tvlen_create(H5T_NATIVE_CHAR); status = H5Aread(attr, memtype, &rdata); if(status<0) return(-1); ptr = rdata.p; len = rdata.len; for (i=0; i<len; i++) str[i]=ptr[i]; status = H5Dvlen_reclaim (memtype, space, H5P_DEFAULT, &rdata); status = H5Aclose (attr); status = H5Dclose (dataset); status = H5Sclose (space); status = H5Tclose (memtype); return(len); } # if 0 H5LTget_attribute_long(INH5,"where","xsize",&xsize); H5LTget_attribute_long(INH5,"where","ysize",&ysize); H5LTget_attribute_double(INH5,"where","xscale",&xscale); H5LTget_attribute_double(INH5,"where","yscale",&yscale); H5LTget_attribute_double(INH5,"where","LL_lon",&LL_lon); H5LTget_attribute_double(INH5,"where","LL_lat",&LL_lat); H5LTget_attribute_double(INH5,"where","UL_lon",&UL_lon); H5LTget_attribute_double(INH5,"where","UL_lat",&UL_lat); H5LTget_attribute_double(INH5,"where","UR_lon",&UR_lon); H5LTget_attribute_double(INH5,"where","UR_lat",&UR_lat); H5LTget_attribute_double(INH5,"where","LR_lon",&LR_lon); H5LTget_attribute_double(INH5,"where","LR_lat",&LR_lat); H5LTget_attribute_string(INH5,"where","projdef",projdef); H5Fclose(INH5); } arrsize=xsize*ysize; membsize=arrsize*sizeof(int); dims[0]=(hsize_t)xsize; dims[1]=(hsize_t)ysize; datatype= H5T_STD_U8LE; sprintf(HDFoutfile,"%s/%s_%03d-%03d_PACC.h5",outdir,obstime,Accmins[p],Interval[p]); OUTH5 = H5Fcreate(HDFoutfile,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); H5LTset_attribute_string(OUTH5,"/","Conventions","ODIM_H5/V2_1"); dataspace=H5Screate_simple(2, dims, NULL); plist = H5Pcreate(H5P_DATASET_CREATE); H5Pset_chunk(plist, 2, chunkdims); H5Pset_deflate( plist, 6); whatg=H5Gcreate2(OUTH5,"what",H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); whereg=H5Gcreate2(OUTH5,"where",H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); howg=H5Gcreate2(OUTH5,"how",H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); H5LTset_attribute_string(OUTH5,"what","date",datadate); H5LTset_attribute_string(OUTH5,"what","time",datatime); H5LTset_attribute_string(OUTH5,"what","object","COMP"); H5LTset_attribute_string(OUTH5,"what","source","ORG:EFKL"); H5LTset_attribute_string(OUTH5,"what","version","H5rad 2.1"); H5LTset_attribute_double(OUTH5,"where","LL_lon",&LL_lon,1); H5LTset_attribute_double(OUTH5,"where","LL_lat",&LL_lat,1); H5LTset_attribute_double(OUTH5,"where","UL_lon",&UL_lon,1); H5LTset_attribute_double(OUTH5,"where","UL_lat",&UL_lat,1); H5LTset_attribute_double(OUTH5,"where","UR_lon",&UR_lon,1); H5LTset_attribute_double(OUTH5,"where","UR_lat",&UR_lat,1); H5LTset_attribute_double(OUTH5,"where","LR_lon",&LR_lon,1); H5LTset_attribute_double(OUTH5,"where","LR_lat",&LR_lat,1); H5LTset_attribute_long(OUTH5,"where","xsize",&xsize,1); H5LTset_attribute_long(OUTH5,"where","ysize",&ysize,1); H5LTset_attribute_double(OUTH5,"where","xscale",&xscale,1); H5LTset_attribute_double(OUTH5,"where","yscale",&yscale,1); H5LTset_attribute_string(OUTH5,"where","projdef",projdef); for(f=0;f<Fields[p];f++) { /* Define dataset start and end times */ for(i=0;i<2;i++) { Forinds[i]=AccInds[i][p][f]; formins=Forinds[i]*5; secs=bsecs+formins*60; date_from_sec(fortime,secs); sprintf(fielddate[i],"%.8s",fortime); sprintf(fieldtime[i],"%.4s00",fortime+8); } /* HDF5 dataset attributes */ sprintf(datasetname,"dataset%d",f+1); printf("dataset%d\n",f+1); datasetg=H5Gcreate2(OUTH5,datasetname,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); setwhatg=H5Gcreate2(datasetg,"what",H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); H5LTset_attribute_string(datasetg,"what","product","COMP"); H5LTset_attribute_string(datasetg,"what","quantity","PROB"); H5LTset_attribute_double(datasetg,"what","gain",&gain,1); H5LTset_attribute_double(datasetg,"what","offset",&offset,1); H5LTset_attribute_double(datasetg,"what","nodata",&nodata,1); H5LTset_attribute_double(datasetg,"what","undetect",&undetect,1); H5LTset_attribute_string(datasetg,"what","startdate",fielddate[0]); H5LTset_attribute_string(datasetg,"what","starttime",fieldtime[0]); H5LTset_attribute_string(datasetg,"what","enddate",fielddate[1]); H5LTset_attribute_string(datasetg,"what","endtime",fieldtime[1]); /* Looping thru thresholds and writing data to dataset f for each threshold */ for(thri=1;thri<=Thresholds[p];thri++) { sprintf(datagname,"data%ld",thri); printf("\tdata%ld\n",thri); datag=H5Gcreate2(datasetg,datagname,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); datawhatg=H5Gcreate2(datag,"what",H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); H5LTset_attribute_long(datag,"what","threshold_id",&thri,1); H5LTset_attribute_double(datag,"what","threshold_value",&f_acclims[p][thri],1); /* create new empty dataset and attributes to destination file */ dataset = H5Dcreate2(datag,"data", datatype, dataspace, H5P_DEFAULT, plist, H5P_DEFAULT); H5LTset_attribute_string( datag, "data", "CLASS", "IMAGE"); H5LTset_attribute_string( datag, "data", "IMAGE_VERSION", "1.2"); H5Dwrite(dataset, datatype, H5S_ALL, dataspace, H5P_DEFAULT,&out_fracarr[thri][0]); H5Dclose(dataset); H5Gclose(datawhatg); H5Gclose(datag); } H5Gclose(setwhatg); H5Gclose(datasetg); } H5Gclose(whatg); H5Gclose(whereg); H5Gclose(howg); } H5Fclose(OUTH5); # endif
32.8394
125
0.615936
[ "object" ]
db6c289516e398a0c50e3eb4ad2eea64dfd9c66d
340
h
C
HiClass_SDK/Classes/Mine/Cell/HICMyWorkSpaceCell.h
jia-hisense/HiClasss_SDK
24e10c8fc46d66c332c132f3026d67dba56e9bd3
[ "MIT" ]
null
null
null
HiClass_SDK/Classes/Mine/Cell/HICMyWorkSpaceCell.h
jia-hisense/HiClasss_SDK
24e10c8fc46d66c332c132f3026d67dba56e9bd3
[ "MIT" ]
null
null
null
HiClass_SDK/Classes/Mine/Cell/HICMyWorkSpaceCell.h
jia-hisense/HiClasss_SDK
24e10c8fc46d66c332c132f3026d67dba56e9bd3
[ "MIT" ]
null
null
null
// // HICMyWorkSpaceCell.h // HiClass // // Created by 铁柱, on 2021/1/7. // Copyright © 2021 haoqian. All rights reserved. // #import <UIKit/UIKit.h> #import "HICMyspaceModel.h" NS_ASSUME_NONNULL_BEGIN @interface HICMyWorkSpaceCell : UICollectionViewCell @property (nonatomic,strong)HICMyspaceModel *model; @end NS_ASSUME_NONNULL_END
18.888889
52
0.758824
[ "model" ]
db70c8d29cdf8ec0b29c35eb3dba491517769619
2,650
h
C
PFP/global.h
foolish3/DDCM
b3c52e19600faefc8ec853f0d2bd18f2293e2897
[ "MIT" ]
4
2018-10-29T04:59:03.000Z
2020-05-04T03:26:32.000Z
PFP/global.h
foolish3/DDCM
b3c52e19600faefc8ec853f0d2bd18f2293e2897
[ "MIT" ]
null
null
null
PFP/global.h
foolish3/DDCM
b3c52e19600faefc8ec853f0d2bd18f2293e2897
[ "MIT" ]
null
null
null
struct DATA{ // market share, prices, unobserved shocks double **ms, // [n_period][n_product+1]: market share **xi, // [n_period][n_product]: unobserved demand shock *delta; // [n_obs]: mean utility vector }; struct PAR{ // demand and price-equation parameters double *theta1, // [n_theta1]: linear parameters *theta2; // [n_theta2]: nonlinear parameters }; struct HIST{ int reset, *accept; // history of acceptance double *paramIn, // input parameter vector ***paramSeed, **param, **expDelta, ***valuefun; }; struct INCV{ double varPsi, // variance of psi (error in autoregression of inclusive values) *lambda, // [2]: coefficient vector of autoregression of inclusive values *wGrid, // [n_grid]: discretized grid points *w, // [n_obs]: inclusive values *y, *wy, *wlambda, // supplemental variables to compute least squares estiamtes **w_lag, **w_lag_t, **ww, **ww_inv; // of lambda & varPsi }; struct RND{ // random simulation of consumer draws double **nu; // [n_person]: simulation draws for unobserved consumer heterogeneity }; struct VAR{ // collection of variables commonly used double tol_blp, tol_bellman, *util, **num, ***expMu0, // [n_person][n_period][n_product]: theta2*nu*X ***expMu1, // [n_person][n_period][n_product]: theta2*nu*X ***expMuIn, // [n_person][n_period][n_product]: theta2*nu*X ***expMuOut, *mu_mkl, *expMu_mkl, *value0, // [n_period]: option value of no purchase option **X, // [n_obs][2]: covariates **Z, // [n_obs][n_inst]: instruments **Z_t, // [n_inst][n_obs]: tranposed Z **invPHI, // [n_inst][n_inst]: inverse of PHI = Z_t' Z **XZPHIZXZ, *Xtheta1, *delta, *e, // [n_obs]: residual of least squares regression of delta wrt X *Ze, *PHIZe, *weight, // [n_grid]: transition probability for value function computation **weightMat; }; struct FXP{ double *expDeltaIn, *expDeltaOut, **valuefunIn, **valuefunOut; }; struct PRED{ double **ms, // [n_period][n_product]: predicted market share *survivalRate; // [n_period]: participation rate of consumers }; struct POST{ // posterior means & std. deviations double *mean, // posterior means of theta1 & theta2 *stderr, // posterior standard deviations **theta; }; struct DIAG{ // diagnostic variables int exit, Jmax, nIterPrev, n_burnin, maxReject, numReject, numRejectTotal, cumulAccept; unsigned long long int lipschitzIter, blpIter, bellmanIter; double tic, toc, lipschitz; };
22.268908
82
0.638868
[ "vector" ]
db9ea065064c1df2fede507e40aaf69e9d42258a
913
h
C
editor/src/ui/IconRegistry.h
GasimGasimzada/liquid-engine
0d6c8b6b6ec508dc63b970dc23698caf1578147a
[ "MIT" ]
null
null
null
editor/src/ui/IconRegistry.h
GasimGasimzada/liquid-engine
0d6c8b6b6ec508dc63b970dc23698caf1578147a
[ "MIT" ]
null
null
null
editor/src/ui/IconRegistry.h
GasimGasimzada/liquid-engine
0d6c8b6b6ec508dc63b970dc23698caf1578147a
[ "MIT" ]
null
null
null
#pragma once namespace liquidator { enum class EditorIcon { Unknown, Directory, CreateDirectory, Material, Texture, Mesh, SkinnedMesh, Skeleton, Animation, Prefab, Script, Sun, Camera, Direction, Play, Stop }; /** * @brief Icon registry * * Provides a way to select and render * icons */ class IconRegistry { public: /** * @brief Load icons from path * * @param registry Resource registry * @param iconsPath Path to icons */ void loadIcons(liquid::rhi::ResourceRegistry &registry, const std::filesystem::path &iconsPath); /** * @brief Get icon * * @param icon Icon enum * @return Texture handle for the icon */ inline liquid::rhi::TextureHandle getIcon(EditorIcon icon) { return mIconMap.at(icon); } private: std::unordered_map<EditorIcon, liquid::rhi::TextureHandle> mIconMap; }; } // namespace liquidator
16.303571
70
0.657174
[ "mesh", "render" ]
67ab6383827f91c0ad4c4e4e12c04178ab300c2f
6,789
h
C
kratos/processes/construct_system_matrix_elemental_process.h
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
778
2017-01-27T16:29:17.000Z
2022-03-30T03:01:51.000Z
kratos/processes/construct_system_matrix_elemental_process.h
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
6,634
2017-01-15T22:56:13.000Z
2022-03-31T15:03:36.000Z
kratos/processes/construct_system_matrix_elemental_process.h
lkusch/Kratos
e8072d8e24ab6f312765185b19d439f01ab7b27b
[ "BSD-4-Clause" ]
224
2017-02-07T14:12:49.000Z
2022-03-06T23:09:34.000Z
// | / | // ' / __| _` | __| _ \ __| // . \ | ( | | ( |\__ ` // _|\_\_| \__,_|\__|\___/ ____/ // Multi-Physics // // License: BSD License // Kratos default license: kratos/license.txt // // Main authors: Riccardo Rossi // #if !defined(KRATOS_CONSTRUCT_SYSTEM_MATRIX_ELEMENTAL_PROCESS_H_INCLUDED ) #define KRATOS_CONSTRUCT_SYSTEM_MATRIX_ELEMENTAL_PROCESS_H_INCLUDED // System includes #include <string> #include <iostream> // External includes // Project includes #include "includes/define.h" #include "processes/process.h" #include "containers/pointer_vector_set.h" namespace Kratos { ///@name Kratos Globals ///@{ ///@} ///@name Type Definitions ///@{ ///@} ///@name Enum's ///@{ ///@} ///@name Functions ///@{ ///@} ///@name Kratos Classes ///@{ /// Short class definition. /** Detail class definition. */ template<class TSystemSpaceType, class TDirichletSpaceType = TSystemSpaceType> class ConstructSystemMatrixElementalProcess : public Process { public: ///@name Type Definitions ///@{ /// Pointer definition of ConstructSystemMatrixElementalProcess KRATOS_CLASS_POINTER_DEFINITION(ConstructSystemMatrixElementalProcess); typedef typename TSystemSpaceType::MatrixType SystemMatrixType; typedef typename TDirichletSpaceType::MatrixType DirichletMatrixType; typedef Element ElementType; typedef PointerVectorSet<ElementType, IndexedObject> ElementsContainerType; ///@} ///@name Life Cycle ///@{ /// Constructor. ConstructSystemMatrixElementalProcess(ElementsContainerType & rElements, SystemMatrixType& rSystemMatrix, DirichletMatrixType& rDirichletMatrix) : mElements(rElements), mSystemMatrix(rSystemMatrix), mDirichletMatrix(rDirichletMatrix) {} /// Destructor. virtual ~ConstructSystemMatrixElementalProcess() {} ///@} ///@name Operators ///@{ ///@} ///@name Operations ///@{ virtual void Execute() { std::size_t equation_size = TSystemSpaceType::Size1(mSystemMatrix); std::vector<std::vector<std::size_t> > indices(equation_size); std::vector<std::vector<std::size_t> > dirichlet_indices(TSystemSpaceType::Size1(mDirichletMatrix)); ProcessInfo process_info; for(ElementsContainerType::iterator i_element = mElements.begin() ; i_element != mElements.end() ; i_element++) { Element::EquationIdVectorType ids(3,0); i_element->EquationIdVector(ids, process_info); for(std::size_t i = 0 ; i < 3 ; i++) if(ids[i] < equation_size) for(std::size_t j = 0 ; j < 3 ; j++) if(ids[j] < equation_size) indices[ids[i]].push_back(ids[j]); else dirichlet_indices[ids[i]].push_back(ids[j]- equation_size); } for(std::size_t i = 0 ; i < indices.size() ; i++) { std::vector<std::size_t>& row_indices = indices[i]; std::vector<std::size_t>& dirichlet_row_indices = dirichlet_indices[i]; std::sort(row_indices.begin(), row_indices.end()); std::unique(row_indices.begin(), row_indices.end()); std::sort(dirichlet_row_indices.begin(), dirichlet_row_indices.end()); std::unique(dirichlet_row_indices.begin(), dirichlet_row_indices.end()); for(std::size_t j = 0 ; j < row_indices.size() ; j++) mSystemMatrix()(i,row_indices[j]) = 0.00; for(std::size_t j = 0 ; j < dirichlet_row_indices.size() ; j++) mDirichletMatrix()(i,dirichlet_row_indices[j]) = 0.00; } for(std::size_t i = 0 ; i < indices.size() ; i++) // To make put at least one element per each row. Pooyan. mDirichletMatrix()(i,0) = 0.00; } ///@} ///@name Access ///@{ ///@} ///@name Inquiry ///@{ ///@} ///@name Input and output ///@{ /// Turn back information as a string. virtual std::string Info() const { return "ConstructSystemMatrixElementalProcess"; } /// Print information about this object. virtual void PrintInfo(std::ostream& rOStream) const { rOStream << "ConstructSystemMatrixElementalProcess"; } /// Print object's data. virtual void PrintData(std::ostream& rOStream) const { rOStream << " System matrix non zeros : " << mSystemMatrix().non_zeros() << std::endl; rOStream << " Dirichlet matrix non zeros : " << mDirichletMatrix().non_zeros() << std::endl; } ///@} ///@name Friends ///@{ ///@} protected: ///@name Protected static Member Variables ///@{ ///@} ///@name Protected member Variables ///@{ ElementsContainerType& mElements; SystemMatrixType& mSystemMatrix; DirichletMatrixType& mDirichletMatrix; ///@} ///@name Protected Operators ///@{ ///@} ///@name Protected Operations ///@{ ///@} ///@name Protected Access ///@{ ///@} ///@name Protected Inquiry ///@{ ///@} ///@name Protected LifeCycle ///@{ ///@} private: ///@name Static Member Variables ///@{ ///@} ///@name Member Variables ///@{ ///@} ///@name Private Operators ///@{ ///@} ///@name Private Operations ///@{ ///@} ///@name Private Access ///@{ ///@} ///@name Private Inquiry ///@{ ///@} ///@name Un accessible methods ///@{ /// Assignment operator. ConstructSystemMatrixElementalProcess& operator=(ConstructSystemMatrixElementalProcess const& rOther); /// Copy constructor. ConstructSystemMatrixElementalProcess(ConstructSystemMatrixElementalProcess const& rOther); ///@} }; // Class ConstructSystemMatrixElementalProcess ///@} ///@name Type Definitions ///@{ ///@} ///@name Input and output ///@{ /// input stream function template<class TSystemSpaceType, class TDirichletSpaceType> inline std::istream& operator >> (std::istream& rIStream, ConstructSystemMatrixElementalProcess<TSystemSpaceType, TDirichletSpaceType>& rThis); /// output stream function template<class TSystemSpaceType, class TDirichletSpaceType> inline std::ostream& operator << (std::ostream& rOStream, const ConstructSystemMatrixElementalProcess<TSystemSpaceType, TDirichletSpaceType>& rThis) { rThis.PrintInfo(rOStream); rOStream << std::endl; rThis.PrintData(rOStream); return rOStream; } ///@} } // namespace Kratos. #endif // KRATOS_CONSTRUCT_SYSTEM_MATRIX_ELEMENTAL_PROCESS_H_INCLUDED defined
22.705686
148
0.605096
[ "object", "vector" ]
67affc5779161a5f306c16dd3a90631b81829274
20,529
c
C
inetcore/outlookexpress/wabw/wabapi/contable.c
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
inetcore/outlookexpress/wabw/wabapi/contable.c
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
inetcore/outlookexpress/wabw/wabapi/contable.c
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/* * CONTABLE.C * * Contents table implementation. * */ #include "_apipch.h" STDMETHODIMP CONTVUE_SetColumns( LPVUE lpvue, LPSPropTagArray lpptaCols, ULONG ulFlags ); // CONTVUE (table view class) // Implementes in-memory IMAPITable class on top of TADs // This is a copy of vtblVUE with FindRow overridden with the LDAP FindRow. VUE_Vtbl vtblCONTVUE = { VTABLE_FILL (VUE_QueryInterface_METHOD FAR *) UNKOBJ_QueryInterface, (VUE_AddRef_METHOD FAR *) UNKOBJ_AddRef, VUE_Release, (VUE_GetLastError_METHOD FAR *) UNKOBJ_GetLastError, VUE_Advise, VUE_Unadvise, VUE_GetStatus, (VUE_SetColumns_METHOD FAR *) CONTVUE_SetColumns, VUE_QueryColumns, VUE_GetRowCount, VUE_SeekRow, VUE_SeekRowApprox, VUE_QueryPosition, VUE_FindRow, VUE_Restrict, VUE_CreateBookmark, VUE_FreeBookmark, VUE_SortTable, VUE_QuerySortOrder, VUE_QueryRows, VUE_Abort, VUE_ExpandRow, VUE_CollapseRow, VUE_WaitForCompletion, VUE_GetCollapseState, VUE_SetCollapseState }; // // Private functions // /*************************************************************************** Name : GetEntryProps Purpose : Open the entry, get it's props, release the entry Parameters: lpContainer -> AB Container object cbEntryID = size of entryid lpEntryID -> entry id to open lpPropertyStore -> property store structure lpSPropTagArray -> prop tags to get lpAllocMoreHere = buffer to allocate more onto (or NULL for allocbuffer) ulFlags - 0 or MAPI_UNICODE lpulcProps -> return count of props here lppSPropValue -> return props here Returns : HRESULT Comment : ***************************************************************************/ HRESULT GetEntryProps( LPABCONT lpContainer, ULONG cbEntryID, LPENTRYID lpEntryID, LPSPropTagArray lpSPropTagArray, LPVOID lpAllocMoreHere, // allocate more on here ULONG ulFlags, LPULONG lpulcProps, // return count here LPSPropValue * lppSPropValue) { // return props here HRESULT hResult = hrSuccess; SCODE sc; ULONG ulObjType; LPMAPIPROP lpObject = NULL; LPSPropValue lpSPropValue = NULL; ULONG cb; if (HR_FAILED(hResult = lpContainer->lpVtbl->OpenEntry(lpContainer, cbEntryID, lpEntryID, NULL, 0, // read only is fine &ulObjType, (LPUNKNOWN *)&lpObject))) { DebugTrace(TEXT("GetEntryProps OpenEntry failed %x\n"), GetScode(hResult)); return(hResult); } if (HR_FAILED(hResult = lpObject->lpVtbl->GetProps(lpObject, lpSPropTagArray, ulFlags, lpulcProps, &lpSPropValue))) { DebugTrace(TEXT("GetEntryProps GetProps failed %x\n"), GetScode(hResult)); goto exit; } // Allocate more for our return buffer if (FAILED(sc = ScCountProps(*lpulcProps, lpSPropValue, &cb))) { hResult = ResultFromScode(sc); goto exit; } if (FAILED(sc = MAPIAllocateMore(cb, lpAllocMoreHere, lppSPropValue))) { hResult = ResultFromScode(sc); goto exit; } if (FAILED(sc = ScCopyProps(*lpulcProps, lpSPropValue, *lppSPropValue, NULL))) { hResult = ResultFromScode(sc); goto exit; } exit: FreeBufferAndNull(&lpSPropValue); UlRelease(lpObject); return(hResult); } /*************************************************************************** Name : FillTableDataFromPropertyStore Purpose : Fill in a TableData object from the property store Parameters: lpIAB lppta -> prop tags to get lpTableData Returns : HRESULT Comment : ***************************************************************************/ HRESULT FillTableDataFromPropertyStore(LPIAB lpIAB, LPSPropTagArray lppta, LPTABLEDATA lpTableData) { HRESULT hResult = S_OK; SCODE sc; LPSRowSet lpSRowSet = NULL; LPSPropValue lpSPropValue = NULL; LPTSTR lpTemp = NULL; ULONG i, j, k; LPCONTENTLIST * lppContentList = NULL; LPCONTENTLIST lpContentList = NULL; ULONG ulContainers = 1; SPropertyRestriction PropRes = {0}; ULONG nLen = 0; ULONG ulInvalidPropCount = 0; ULONG ulcPropCount; ULONG iToAdd; ULONG iPR_ENTRYID = (ULONG)-1; ULONG iPR_RECORD_KEY = (ULONG)-1; ULONG iPR_INSTANCE_KEY = (ULONG)-1; LPSPropTagArray lpptaNew = NULL; LPSPropTagArray lpptaRead; BOOL bUnicodeData = ((LPTAD)lpTableData)->bMAPIUnicodeTable; // Make certain that we have required properties: // PR_ENTRYID // PR_RECORD_KEY // PR_INSTANCE_KEY // walk through pta looking for required props iToAdd = 3; for (i = 0; i < lppta->cValues; i++) { switch (lppta->aulPropTag[i]) { case PR_ENTRYID: iPR_ENTRYID = i; iToAdd--; break; case PR_RECORD_KEY: iPR_RECORD_KEY = i; iToAdd--; break; case PR_INSTANCE_KEY: iPR_INSTANCE_KEY = i; iToAdd--; break; } } if (iToAdd) { if (lpptaNew = LocalAlloc(LPTR, sizeof(SPropTagArray) + (lppta->cValues + iToAdd) * sizeof(DWORD))) { // Copy the caller's pta into our new one lpptaNew->cValues = lppta->cValues; CopyMemory(lpptaNew->aulPropTag, lppta->aulPropTag, lppta->cValues * sizeof(DWORD)); // Add them on at the end. if (iPR_ENTRYID == (ULONG)-1) { iPR_ENTRYID = lpptaNew->cValues++; lpptaNew->aulPropTag[iPR_ENTRYID] = PR_NULL; } if (iPR_RECORD_KEY == (ULONG)-1) { iPR_RECORD_KEY = lpptaNew->cValues++; lpptaNew->aulPropTag[iPR_RECORD_KEY] = PR_NULL; } if (iPR_INSTANCE_KEY == (ULONG)-1) { iPR_INSTANCE_KEY = lpptaNew->cValues++; lpptaNew->aulPropTag[iPR_INSTANCE_KEY] = PR_NULL; } lpptaRead = lpptaNew; } else { hResult = ResultFromScode(MAPI_E_NOT_ENOUGH_MEMORY); goto exit; } } else { lpptaRead = lppta; } Assert(iPR_ENTRYID != (ULONG)-1); Assert(iPR_RECORD_KEY!= (ULONG)-1); Assert(iPR_INSTANCE_KEY != (ULONG)-1); // // Set filter criteria if none exists - we'll default to DisplayName // PropRes.ulPropTag = PR_DISPLAY_NAME; PropRes.relop = RELOP_EQ; PropRes.lpProp = NULL; { // The way we want GetContentsTable to behave is: // // If no profilesAPI enabled and no override, then GetContentsTable works as before and returns // full set of contents for the current WAB [This is for the PAB container only] // In cases where old clients dont know how to invoke the new API, the UI will have new stuff // but the API should have the old stuff meaning that a GetContentsTable on the PAB // container should return full WAB contents. To make sure that the GetContentsTable on the // PAB container doesn't contain full contents, caller can force this by passing in // WAB_ENABLE_PROFILES into the call to GetContentsTable... // // If profilesAPI are enabled, then GetContentsTable only returns the contents of // the specified folder/container // unless the folder has a NULL entryid in which case we want to get ALL WAB contents // so we can pump them into the "All Contacts" ui item .. // // If ProfilesAPI and WAB_PROFILE_CONTENTS are specified and it's the PAB container // then we need to return all the contents pertaining to the current profile // // // SBinary sbEID = {0}; LPSBinary lpsbEID = ((LPTAD)lpTableData)->pbinContEID; BOOL bProfileContents = FALSE; // Is this a 'new' WAB showing folders and stuff ? if(bIsWABSessionProfileAware(lpIAB)) { // If this WAB is identity aware or we were asked to // restrict the contents to a single container, then try to // get the entryid for that container if( bAreWABAPIProfileAware(lpIAB) || ((LPTAD)lpTableData)->bContainerContentsOnly) { if(!lpsbEID) lpsbEID = &sbEID; } // if we earlier, during GetContentsTable specified that we // want the full contents for the current profile (which means // iterating through all the folders in this profile), we should // look into this .. if(((LPTAD)lpTableData)->bAllProfileContents) { ulContainers = lpIAB->cwabci; bProfileContents = TRUE; } } // Allocate a temporary list in which we will get each containers contents // seperately - later we will collate all these seperate content-lists // together lppContentList = LocalAlloc(LMEM_ZEROINIT, sizeof(LPCONTENTLIST)*ulContainers); if(!lppContentList) { hResult = MAPI_E_NOT_ENOUGH_MEMORY; goto exit; } // // Get the content list // if(!bProfileContents) { // if we don't care about profile and profile folders, // just get the bunch'o'contents from the store if (HR_FAILED(hResult = ReadPropArray(lpIAB->lpPropertyStore->hPropertyStore, lpsbEID, &PropRes, AB_MATCH_PROP_ONLY | (bUnicodeData?AB_UNICODE:0), lpptaRead->cValues, (LPULONG)lpptaRead->aulPropTag, &(lppContentList[0])))) { DebugTraceResult( TEXT("NewContentsTable:ReadPropArray"), hResult); goto exit; } } else { // We need to collate together all the contents of all the containers for this profile // // The first item is the Virtual PAB "Shared Contacts" folder .. we want the contents of this // item as part of this ContentsTable by default. This item has a special entryid of 0, NULL so we // can diffrentiate it from the rest of the pack.. // for(i=0;i<ulContainers;i++) { hResult = ReadPropArray(lpIAB->lpPropertyStore->hPropertyStore, lpIAB->rgwabci[i].lpEntryID ? lpIAB->rgwabci[i].lpEntryID : &sbEID, &PropRes, AB_MATCH_PROP_ONLY | (bUnicodeData?AB_UNICODE:0), lpptaRead->cValues, (LPULONG)lpptaRead->aulPropTag, &(lppContentList[i])); // ignore MAPI_E_NOT_FOUND errors here ... if(HR_FAILED(hResult)) { if(hResult == MAPI_E_NOT_FOUND) hResult = S_OK; else { DebugTraceResult( TEXT("NewContentsTable:ReadPropArray"), hResult); goto exit; } } } } } for(k=0;k<ulContainers;k++) { lpContentList = lppContentList[k]; if(lpContentList) { // Now we need to move the information from the index to // the SRowSet. In the process, we need to create a few computed // properties: // PR_DISPLAY_TYPE ? // PR_INSTANCE_KEY // PR_RECORD_KEY // Allocate the SRowSet if (FAILED(sc = MAPIAllocateBuffer(sizeof(SRowSet) + lpContentList->cEntries * sizeof(SRow), &lpSRowSet))) { DebugTrace(TEXT("Allocation of SRowSet failed\n")); hResult = ResultFromScode(sc); goto exit; } lpSRowSet->cRows = lpContentList->cEntries; for (i = 0; i < lpContentList->cEntries; i++) { // // We look at each of the returned entries - if they dont have a prop // we set that prop to " " // (Assuming these are all string props) // lpSPropValue = lpContentList->aEntries[i].rgPropVals; ulcPropCount = lpContentList->aEntries[i].cValues; // DebugProperties(lpSPropValue, ulcPropCount, "Raw"); for (j = 0; j < ulcPropCount; j++) { // Get rid of error valued properties if (PROP_ERROR(lpSPropValue[j])) { lpSPropValue[j].ulPropTag = PR_NULL; } } // Make certain we have proper indicies. // For now, we will equate PR_INSTANCE_KEY and PR_RECORD_KEY to PR_ENTRYID. if(lpSPropValue[iPR_INSTANCE_KEY].ulPropTag != PR_INSTANCE_KEY) { lpSPropValue[iPR_INSTANCE_KEY].ulPropTag = PR_INSTANCE_KEY; SetSBinary( &lpSPropValue[iPR_INSTANCE_KEY].Value.bin, lpSPropValue[iPR_ENTRYID].Value.bin.cb, lpSPropValue[iPR_ENTRYID].Value.bin.lpb); } if(lpSPropValue[iPR_RECORD_KEY].ulPropTag != PR_RECORD_KEY) { lpSPropValue[iPR_RECORD_KEY].ulPropTag = PR_RECORD_KEY; SetSBinary( &lpSPropValue[iPR_RECORD_KEY].Value.bin, lpSPropValue[iPR_ENTRYID].Value.bin.cb, lpSPropValue[iPR_ENTRYID].Value.bin.lpb); } // Put it in the RowSet lpSRowSet->aRow[i].cValues = ulcPropCount; // number of properties lpSRowSet->aRow[i].lpProps = lpSPropValue; // LPSPropValue } //for i hResult = lpTableData->lpVtbl->HrModifyRows(lpTableData,0,lpSRowSet); FreeBufferAndNull(&lpSRowSet); } // for k } exit: for(i=0;i<ulContainers;i++) { lpContentList = lppContentList[i]; if (lpContentList) { FreePcontentlist(lpIAB->lpPropertyStore->hPropertyStore, lpContentList); } } if(lppContentList) LocalFree(lppContentList); if(lpptaNew) LocalFree(lpptaNew); return(hResult); } /*************************************************************************** Name : NewContentsTable Purpose : Creates a new contents table Parameters: lpABContainer - container being opened lpIAB - AdrBook object ulFlags - WAB_NO_CONTENTTABLE_DATA lpInteface ? lppTble - returned table Returns : HRESULT Comment : ***************************************************************************/ HRESULT NewContentsTable(LPABCONT lpABContainer, LPIAB lpIAB, ULONG ulFlags, LPCIID lpInterface, LPMAPITABLE * lppTable) { LPTABLEDATA lpTableData = NULL; HRESULT hResult = hrSuccess; SCODE sc; #ifndef DONT_ADDREF_PROPSTORE if ((FAILED(sc = OpenAddRefPropertyStore(NULL, lpIAB->lpPropertyStore)))) { hResult = ResultFromScode(sc); goto exitNotAddRefed; } #endif if (FAILED(sc = CreateTableData( NULL, // LPCIID (ALLOCATEBUFFER FAR *) MAPIAllocateBuffer, (ALLOCATEMORE FAR *) MAPIAllocateMore, MAPIFreeBuffer, NULL, // lpvReserved, TBLTYPE_DYNAMIC, // ulTableType, PR_RECORD_KEY, // ulPropTagIndexCol, (LPSPropTagArray)&ITableColumns, // LPSPropTagArray lpptaCols, lpIAB, // lpvDataSource 0, // cbDataSource ((LPCONTAINER)lpABContainer)->pmbinOlk, ulFlags, &lpTableData))) { // LPTABLEATA FAR * lplptad DebugTrace(TEXT("CreateTable failed %x\n"), sc); hResult = ResultFromScode(sc); goto exit; } if (lpTableData) { if(!(ulFlags & WAB_CONTENTTABLE_NODATA)) { // Fill in the data from the property store if (hResult = FillTableDataFromPropertyStore(lpIAB, (LPSPropTagArray)&ITableColumns, lpTableData)) { DebugTraceResult( TEXT("NewContentsTable:FillTableFromPropertyStore"), hResult); goto exit; } } } if (hResult = lpTableData->lpVtbl->HrGetView(lpTableData, NULL, // LPSSortOrderSet lpsos, ContentsViewGone, // CALLERRELEASE FAR * lpfReleaseCallback, 0, // ULONG ulReleaseData, lppTable)) { // LPMAPITABLE FAR * lplpmt) goto exit; } // Replace the vtable with our new one that overrides SetColumns (*lppTable)->lpVtbl = (IMAPITableVtbl FAR *)&vtblCONTVUE; exit: #ifndef DONT_ADDREF_PROPSTORE ReleasePropertyStore(lpIAB->lpPropertyStore); exitNotAddRefed: #endif // Cleanup table if failure if (HR_FAILED(hResult)) { if (lpTableData) { UlRelease(lpTableData); } } return(hResult); } /* * This is a callback function, invoked by itable.dll when its * caller does the last release on a view of the contents table. We * use it to know when to release the underlying table data. */ void STDAPICALLTYPE ContentsViewGone(ULONG ulContext, LPTABLEDATA lptad, LPMAPITABLE lpVue) { #ifdef OLD_STUFF LPISPAM pispam = (LPISPAM)ulContext; if (FBadUnknown((LPUNKNOWN) pispam) || IsBadWritePtr(pispam, sizeof(ISPAM)) || pispam->cRefTad == 0 || FBadUnknown(pispam->ptad)) { DebugTrace(TEXT("ContentsViewGone: contents table was apparently already released\n")); return; } if (pispam->ptad != lptad) { TrapSz( TEXT("ContentsViewGone: TAD mismatch on VUE release!")); } else if (--(pispam->cRefTad) == 0) { pispam->ptad = NULL; UlRelease(lptad); } #endif // OLD_STUFF UlRelease(lptad); return; IF_WIN32(UNREFERENCED_PARAMETER(ulContext);) IF_WIN32(UNREFERENCED_PARAMETER(lpVue);) } /*============================================================================ - CONTVUE::SetColumns() - * Replaces the current column set with a copy of the specified column set * and frees the old column set. */ STDMETHODIMP CONTVUE_SetColumns( LPVUE lpvue, LPSPropTagArray lpptaCols, ULONG ulFlags ) { HRESULT hResult = hrSuccess; #if !defined(NO_VALIDATION) VALIDATE_OBJ(lpvue,CONTVUE_,SetColumns,lpVtbl); // Validate_IMAPITable_SetColumns( lpvue, lpptaCols, ulFlags ); // Commented by YST #endif Assert(lpvue->lptadParent->lpvDataSource); // Re-read the table data if (lpvue->lptadParent && (hResult = FillTableDataFromPropertyStore( (LPIAB)lpvue->lptadParent->lpvDataSource, lpptaCols, (LPTABLEDATA)lpvue->lptadParent))) { DebugTraceResult( TEXT("CONTVUE_SetColumns:FillTableFromPropertyStore"), hResult); return(hResult); } return(VUE_SetColumns(lpvue, lpptaCols, ulFlags)); }
33.11129
112
0.543085
[ "object" ]
67b198426be911bd65160ba01fda88f22747e62e
1,108
h
C
dpd_test/src/DPDTest/nrc.h
susanalainez/ADPD_LimeSDR-QPCIe_USB3
1701f81d30e57dc81f3b017f1031139783dd67f7
[ "Apache-2.0" ]
null
null
null
dpd_test/src/DPDTest/nrc.h
susanalainez/ADPD_LimeSDR-QPCIe_USB3
1701f81d30e57dc81f3b017f1031139783dd67f7
[ "Apache-2.0" ]
null
null
null
dpd_test/src/DPDTest/nrc.h
susanalainez/ADPD_LimeSDR-QPCIe_USB3
1701f81d30e57dc81f3b017f1031139783dd67f7
[ "Apache-2.0" ]
1
2020-08-03T08:25:06.000Z
2020-08-03T08:25:06.000Z
/* -------------------------------------------------------------------------------------------- FILE: nrc.h DESCRIPTION: Namespace which collects all Numerical Receipes in C functions. CONTENT: AUTHOR: Lime Microsystems LTD LONGDENE HOUSE HEDGEHOG LANE HASLEMERE GU27 2PH DATE: Apr 28, 2005 REVISIONS: -------------------------------------------------------------------------------------------- */ #include <stdio.h> #include <stdlib.h> #include <math.h> #define TINY 1.0e-20 namespace nrc { double *vector(int, int); void free_vector(double *, int , int ); double **matrix(int, int, int, int); void free_matrix(double **, int , int , int , int ); int *ivector(int, int); void free_ivector(int *, int , int ); void nrerror(char *); // LU decomposition and backsubstitution int ludcmp(double **, int, int *, double *); void lubksb(double **, int, int *, double *); // Gradient descent used to solve linear equations void lgrad(double **, double *, double *, int, double); // Gaus-Seidel to solve linear equations void gauss_seidel(double **, double *, double *, int); }
27.7
98
0.565884
[ "vector" ]
67b4aa32a3878fda3dc57af5d2e4a2f1064a6cf3
414
h
C
Easing/Plot.h
DiegoSLTS/EasingFunctions
38951f19a3069c9ac20aee482dfe1f8c0953408d
[ "MIT" ]
null
null
null
Easing/Plot.h
DiegoSLTS/EasingFunctions
38951f19a3069c9ac20aee482dfe1f8c0953408d
[ "MIT" ]
null
null
null
Easing/Plot.h
DiegoSLTS/EasingFunctions
38951f19a3069c9ac20aee482dfe1f8c0953408d
[ "MIT" ]
null
null
null
#pragma once #include <vector> #include <SDL.h> class EasingEquation; class Plot { public: Plot(EasingEquation* easing); virtual ~Plot(); void Draw(SDL_Renderer* renderer); void SetEasing(EasingEquation* easing); void Recalculate(); private: static const int POINTS_COUNT = 100; EasingEquation* easing; double points[POINTS_COUNT]; int x; int y; int width; int height; SDL_Texture* textTarget; };
15.923077
40
0.736715
[ "vector" ]
67d0edb10aa5df7c6b5da799fd40cf666a2ea450
1,405
h
C
algorithms/hard/0727. Minimum Window Subsequence.h
MultivacX/letcode2020
f86289f8718237303918a7705ae31625a12b68f6
[ "MIT" ]
null
null
null
algorithms/hard/0727. Minimum Window Subsequence.h
MultivacX/letcode2020
f86289f8718237303918a7705ae31625a12b68f6
[ "MIT" ]
null
null
null
algorithms/hard/0727. Minimum Window Subsequence.h
MultivacX/letcode2020
f86289f8718237303918a7705ae31625a12b68f6
[ "MIT" ]
null
null
null
// 727. Minimum Window Subsequence // https://leetcode.com/problems/minimum-window-subsequence/ // Runtime: 84 ms, faster than 65.14% of C++ online submissions for Minimum Window Subsequence. // Memory Usage: 11.7 MB, less than 58.97% of C++ online submissions for Minimum Window Subsequence. class Solution { public: string minWindow(string S, string T) { const int M = S.length(); const int N = T.length(); vector<vector<int>> counter(26); for (char c : T) if (counter[c - 'a'].empty()) counter[c - 'a'].push_back(-1); for (int i = 0; i < M; ++i) if (!counter[S[i] - 'a'].empty()) counter[S[i] - 'a'].push_back(i); int idx = -1; int len = INT_MAX; for (int i = 0; i < M; ++i) { if (S[i] != T[0]) continue; int k = i; for (int j = 1; j < N; ++j) { const auto& v = counter[T[j] - 'a']; auto it = upper_bound(begin(v), end(v), k); if (it == end(v)) { k = -1; break; } k = *it; } if (k != -1 && len > k - i + 1) { idx = i; len = k - i + 1; } } return idx != -1 ? S.substr(idx, len) : ""; } };
31.931818
100
0.418505
[ "vector" ]
67d27966fc9a03f877cff5cd8c3f95c655592a7c
9,164
h
C
benchmark/core/utils/argument_parser.h
lmaas/sigmod2012contest
636ae037c135c5461ab4674a3cb6e23287eaac1f
[ "MIT" ]
1
2015-11-27T06:13:22.000Z
2015-11-27T06:13:22.000Z
benchmark/core/utils/argument_parser.h
lmaas/sigmod2012contest
636ae037c135c5461ab4674a3cb6e23287eaac1f
[ "MIT" ]
null
null
null
benchmark/core/utils/argument_parser.h
lmaas/sigmod2012contest
636ae037c135c5461ab4674a3cb6e23287eaac1f
[ "MIT" ]
null
null
null
// // Copyright (c) 2012 TU Dresden - Database Technology Group // // 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. // // Author: Lukas M. Maas <[email protected]> // // A simple command line parser. // // Defines the ArgumentParser class that helps writing user-friendly commandline // interfaces. // It is inspired by Python's argparse module // (http://docs.python.org/library/argparse.html). #ifndef BENCHMARK_CORE_UTILS_ARGUMENT_PARSER_H_ #define BENCHMARK_CORE_UTILS_ARGUMENT_PARSER_H_ #include <list> #include <map> #include <string> #include <stdio.h> #include <vector> #include <common/macros.h> class Argument; class Value; // A class defining a simple command line argument parser. // // Usage: // // int main(int argc, char** argv){ // ArgumentParser parser; // parser.add_argument("-t","--test").nargs(1).metavar("<value>").help("A sample argument including a value"); // // parser.parse_args(argc,argv); // // if(parser.is_set("-t")){ // int value = parser.get_value("-t").toInt(); // // do something with the value... // } // } class ArgumentParser{ public: // Constructor for ArgumentParser ArgumentParser(); // Destructor for ArgumentParser ~ArgumentParser(); // Setter functions ArgumentParser& description(std::string description){ description_=description; return *this;}; ArgumentParser& prolog(std::string prolog){ prolog_=prolog; return *this;}; ArgumentParser& epilog(std::string epilog){ epilog_=epilog; return *this;}; ArgumentParser& add_help(bool add_help){ add_help_=add_help; return *this;}; ArgumentParser& prog(std::string prog){ prog_=prog;return *this;}; ArgumentParser& usage(std::string usage){ usage_=usage;return *this;}; ArgumentParser& indent(std::string indent){ indent_=indent; return *this;}; ArgumentParser& padding(unsigned int padding){ padding_=padding; return *this;} // Getter functions const std::string& description() const {return description_;}; const std::string& prolog() const {return prolog_;}; const std::string& epilog() const {return epilog_;}; bool add_help() const {return add_help_;}; const std::string& prog() const {return prog_;}; const std::string& usage() const {return usage_;}; const std::string& indent() const {return indent_;}; unsigned int padding() const {return padding_;}; // Add an argument Argument& add_argument(std::string name); Argument& add_argument(std::string name, std::string alternative_name); Argument& add_argument(std::list<std::string> names); // Parse the parameters bool parse_args(int argc, const char** argv); // Print the help to the standard output void print_help(); // Print the usage string to the standard output void print_usage(); // Returns if all required arguments have been set. // If it is called before parse_args() it will return false. bool valid(){return valid_;}; // Returns if the argument given by its name has been set. // If it is called before parse_args() it will return false. bool is_set(std::string name); // Returns the value of an argument (given by its name). // If the given argument contains more than one value, index can be used // to specify which value will be returned. Value* get_value(std::string name, unsigned int index = 0); // Generates a string describing the usage of the program std::string usage_string(); // Generates a string describing the given argument std::string option_string(std::string argument); // Generates the help string std::string help_string(); // Returns a pointer to the argument, specified by its name - or null. Argument* get_argument(std::string name); private: // List of arguments std::map<std::string, Argument*> arguments_; // A map containg all alternative names to a specified argument std::map<std::string,std::list<std::string> > alternative_args_; // An ordered list of all argument names std::list<std::string> arg_list_; // String that is used to indent content inside the help string std::string indent_; // The width that the argument string will be padded to (in the option string) unsigned int padding_; // Text to display between usage string and argument help std::string prolog_; // Text to display before the argument help. std::string description_; // Text to display after the argument help. std::string epilog_; // Whether to add a help option (-h and --help) option (default value is true) bool add_help_; // The name of the program (default is argv[0]) std::string prog_; // The string describing the program usage (default will be generated automatically) std::string usage_; bool valid_; DISALLOW_COPY_AND_ASSIGN(ArgumentParser); }; // Defines a command line argument including its values. // // Sample usage: // Argument argument("--help"); // argument.nargs(0).help("Displays this message") class Argument{ public: // Constructor for Argument Argument(); // Destructor for Argument ~Argument(); // Setter functions Argument& nargs(unsigned int nargs){nargs_=nargs;return *this;}; Argument& default_value(std::string default_value){default_value_=default_value;return *this;}; Argument& choices(std::list<std::string> choices){choices_=choices; return *this; }; Argument& required(bool required){ required_=required; return *this; }; Argument& help(std::string help){ help_=help; return *this; }; Argument& metavar(std::string metavar){ metavar_=metavar; return *this; }; Argument& set(bool set){ set_=set; return *this; }; Argument& add_value(std::string value); // Getter functions unsigned int nargs() const { return nargs_; }; const std::string& default_value() const { return default_value_; }; std::list<std::string> choices() const{ return choices_; }; bool required() const { return required_; }; const std::string& help() const { return help_; }; const std::string& metavar() const {return metavar_; }; bool set() const { return set_; }; Value* value(unsigned int index = 0); private: // The name of this argument std::string name_; // The number of arguments that will be consumed. (Default value is 0.) unsigned int nargs_; // The default value that will be returned if the argument is absent from // the command line. std::string default_value_; // A list of the allowed values for the argument. std::list<std::string> choices_; // Wheather or not the argument is required. (Default value is false.) bool required_; // A brief description of what the argument does. std::string help_; // A name for the arguments in usage and help messages. std::string metavar_; // Whether or not the argument is set. bool set_; // The values of this argument. std::vector<Value*> values_; DISALLOW_COPY_AND_ASSIGN(Argument); }; // Defines a value of a command line argument. // // This class can be used to securely convert a string into other data types // like int or bool. // // Sample usage: // Value value(0); // int int_value = value.toInt(); // bool bool_value = value.toBool(); class Value{ public: // Constructor for Value explicit Value(std::string value); // Destructor for Value ~Value(); // Set the value Value& set(std::string value){ value_=value; return *this;}; // Return the value as a string const std::string& get(){ return value_; }; // Return the value as int int toInt(); // Return the value as bool bool toBool(); // Return the value as float float toFloat(); // Return the value as double double toDouble(); // Stream operators friend std::ostream& operator<<(std::ostream &stream, const Value& value); friend std::istream& operator>>(std::istream &stream, Value& value); private: // The value as a string std::string value_; DISALLOW_COPY_AND_ASSIGN(Value); }; #endif // BENCHMARK_CORE_UTILS_ARGUMENT_PARSER_H_
32.496454
114
0.698167
[ "vector" ]
67d52c5b0acd1c5ee46858319c81405f442f1d19
3,227
h
C
src/sman_old/sman/direct/KV_int_-_MM_DIRECT_-_DENSEKEY.h
zhangce/elementary
c334c0e64765a54f7991aeecfc2d4e28128820c0
[ "Apache-2.0" ]
8
2015-01-05T16:52:43.000Z
2019-05-29T15:05:06.000Z
src/sman_old/sman/direct/KV_int_-_MM_DIRECT_-_DENSEKEY.h
zhangce/elementary
c334c0e64765a54f7991aeecfc2d4e28128820c0
[ "Apache-2.0" ]
null
null
null
src/sman_old/sman/direct/KV_int_-_MM_DIRECT_-_DENSEKEY.h
zhangce/elementary
c334c0e64765a54f7991aeecfc2d4e28128820c0
[ "Apache-2.0" ]
2
2015-09-29T05:33:52.000Z
2020-12-16T15:31:15.000Z
// // KV_int_-_MM_DIRECT_-_NOHINT.h // sman // // Created by Ce Zhang on 8/18/12. // Copyright (c) 2012 HazyResearch. All rights reserved. // #ifndef sman_KV_int___MM_DIRECT___NOHINT_h #define sman_KV_int___MM_DIRECT___NOHINT_h #include "../KV.h" #include "../dstruct/SlottedPage.h" #include <vector> namespace mia{ namespace sm{ /** * \brief Key value store for dense int key and arbitrary value type in main memory. **/ template<class VALUE, KV_Replacement REPLACEMENT> class KV<int, VALUE, MM, DIRECT, REPLACEMENT, DENSE_KEY>{ private: std::vector<VALUE> mm_vec; friend class Iterator; public: class Iterator{ public: KV<int, VALUE, MM, DIRECT, REPLACEMENT, DENSE_KEY> * pkv; int next_idx; Iterator(KV<int, VALUE, MM, DIRECT, REPLACEMENT, DENSE_KEY> * _pkv){ next_idx = 0; pkv = _pkv; } bool hasNext(){ if(next_idx < pkv->mm_vec.size()){ return true; }else{ return false; } } int next(int & key, VALUE & value){ if(next_idx < pkv->mm_vec.size()){ key = next_idx; value = pkv->mm_vec[key]; next_idx++; }else{ return NEXT_ERROR_NO_NEXT; } return SUCCESS; } }; KV(){ std::cout << "Use Specialization KV_int_-_MM_DIRECT_-_DENSEKEY ." << std::endl; } Iterator get_iterator(){ return Iterator(this); } KV_Status get(int const & key, VALUE & value){ if(key >= mm_vec.size()){ return GET_ERROR_KEY_NOT_FOUND; }else{ value = mm_vec[key]; } return SUCCESS; } KV_Status set(int const & key, VALUE const & value){ if(key >= mm_vec.size()){ return SET_ERROR_KEY_NOT_FOUND; }else{ mm_vec[key] = value; } return SUCCESS; } KV_Status load(int const & key, VALUE const & value){ if(key >= mm_vec.size()){ VALUE v; for(int i=mm_vec.size(); i<=key; i++){ mm_vec.push_back(v); } } mm_vec[key] = value; return SUCCESS; } }; } } #endif
27.117647
95
0.37775
[ "vector" ]
67d60846bf6487c1e0a1da4ca4928a4dfbd29260
1,751
h
C
navigation_layer/odom_dvl_imu/include/dvl_data.h
shubhamkorde/AnahitaPlus
0fc99ad774640c8dc8572ffb58d10fa18bb1a4b1
[ "BSD-3-Clause" ]
5
2018-10-22T20:04:24.000Z
2022-01-04T09:24:46.000Z
navigation_layer/odom_dvl_imu/include/dvl_data.h
shubhamkorde/AnahitaPlus
0fc99ad774640c8dc8572ffb58d10fa18bb1a4b1
[ "BSD-3-Clause" ]
19
2018-10-03T12:14:35.000Z
2019-07-07T09:33:14.000Z
navigation_layer/odom_dvl_imu/include/dvl_data.h
shubhamkorde/AnahitaPlus
0fc99ad774640c8dc8572ffb58d10fa18bb1a4b1
[ "BSD-3-Clause" ]
15
2018-09-09T12:35:15.000Z
2020-01-03T09:28:19.000Z
#ifndef DVL_DATA_H #define DVL_DATA_H #include <geometry_msgs/TwistWithCovarianceStamped.h> #include <std_msgs/Float32.h> #include <eigen3/Eigen/Geometry> #include "navigation_device.h" #include <geometry_msgs/TwistWithCovarianceStamped.h> namespace navigation{ class DvlData: public NavigationDevice { typedef void (DvlData::*IntegrationMethodT) (const double &); public: const double BAR_TO_METER_OF_WATER = 10.1972; enum IntegrationMethodType { StdMethod = 0, RKMethod, DefaultMethod }; DvlData(IntegrationMethodType integrationMethodType = RKMethod); ~DvlData(); void DvlTwistCallback(geometry_msgs::TwistWithCovarianceStamped msg); void DvlPressureCallback(std_msgs::Float32 msg); std::vector<double> x_vel; std::vector<double> y_vel; std::vector<double> z_vel; int x_count = 0; int y_count = 0; int z_count = 0; int vel_count = 0; Eigen::Vector3d GetPositionXYZ(); Eigen::Vector3d GetVelocityXYZ(); double GetPositionZFromPressure(); std_msgs::Float32 GetPressure(); private: void StdIntegrationMethod(const double &dt_sec); void RKIntegrationMethod(const double &dt_sec); double Average(std::vector<double> array); bool inRange (double x, double avg, double thres); ros::Time last_timestamp_; Eigen::Vector3d positionIncrement_; Eigen::MatrixXd historyPositionIncrement_; geometry_msgs::TwistWithCovarianceStamped dvl_twist_; std_msgs::Float32 dvl_pressure_; IntegrationMethodT integrationMethod_; }; } #endif // DVLDATA_H
27.359375
77
0.662479
[ "geometry", "vector" ]
db001cc0b69c905faeafe02305d66b580326c6f9
3,991
h
C
RandomizedRedundantDCTDenoising/RedundantDXTDenoise.h
catree/RandomizedRedundantDCTDenoising
0a42da0e3ee9056ccd21344f6792c2ca5fa41f1f
[ "BSD-3-Clause" ]
62
2015-09-13T14:05:29.000Z
2022-03-18T05:51:00.000Z
RandomizedRedundantDCTDenoising/RedundantDXTDenoise.h
mcanthony/RandomizedRedundantDCTDenoising
0a42da0e3ee9056ccd21344f6792c2ca5fa41f1f
[ "BSD-3-Clause" ]
2
2016-06-17T05:38:18.000Z
2017-09-21T03:25:48.000Z
RandomizedRedundantDCTDenoising/RedundantDXTDenoise.h
mcanthony/RandomizedRedundantDCTDenoising
0a42da0e3ee9056ccd21344f6792c2ca5fa41f1f
[ "BSD-3-Clause" ]
24
2015-09-13T01:53:56.000Z
2022-02-23T10:24:10.000Z
#pragma once #include <iostream> #include <deque> #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/highgui.hpp> #define CV_VERSION_NUMBER CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) CVAUX_STR(CV_SUBMINOR_VERSION) #ifdef _DEBUG #pragma comment(lib, "opencv_core"CV_VERSION_NUMBER"d.lib") #pragma comment(lib, "opencv_highgui"CV_VERSION_NUMBER"d.lib") #pragma comment(lib, "opencv_imgcodecs"CV_VERSION_NUMBER"d.lib") #pragma comment(lib, "opencv_imgproc"CV_VERSION_NUMBER"d.lib") #else #pragma comment(lib, "opencv_core"CV_VERSION_NUMBER".lib") #pragma comment(lib, "opencv_highgui"CV_VERSION_NUMBER".lib") #pragma comment(lib, "opencv_imgcodecs"CV_VERSION_NUMBER".lib") #pragma comment(lib, "opencv_imgproc"CV_VERSION_NUMBER".lib") #endif double YPSNR(cv::InputArray src1, cv::InputArray src2); void addNoise(cv::InputArray src, cv::OutputArray dest, double sigma, double solt_papper_ratio = 0.0); void cvtColorBGR2DCT3PLANE_32f(const cv::Mat& src, cv::Mat& dest); void cvtColorPLANEDCT32BGR_32f(const cv::Mat& src, cv::Mat& dest); enum { TIME_AUTO = 0, TIME_NSEC, TIME_MSEC, TIME_SEC, TIME_MIN, TIME_HOUR, TIME_DAY }; class CalcTime { int64 pre; std::string mes; int timeMode; double cTime; bool _isShow; int autoMode; int autoTimeMode(); std::vector<std::string> lap_mes; public: void start(); void setMode(int mode); void setMessage(std::string src); void restart(); double getTime(); void show(); void show(std::string message); void lap(std::string message); void init(std::string message, int mode, bool isShow); CalcTime(std::string message, int mode = TIME_AUTO, bool isShow = true); CalcTime(); ~CalcTime(); }; void cvtColorBGR2PLANE(const cv::Mat& src, cv::Mat& dest); void cvtColorPLANE2BGR(const cv::Mat& src, cv::Mat& dest); class RedundantDXTDenoise { public: enum BASIS { DCT = 0, DHT = 1, DWT = 2//under construction }; bool isSSE; void init(cv::Size size_, int color_, cv::Size patch_size_); RedundantDXTDenoise(cv::Size size, int color, cv::Size patch_size_ = cv::Size(8, 8)); RedundantDXTDenoise(); virtual void operator()(cv::Mat& src, cv::Mat& dest, float sigma, cv::Size psize = cv::Size(8, 8), BASIS transform_basis = BASIS::DCT); protected: float getThreshold(float sigmaNoise); BASIS basis; cv::Size patch_size; cv::Size size; cv::Mat buff; cv::Mat sum; cv::Mat im; int channel; virtual void body(float *src, float* dest, float Th); void div(float* inplace0, float* inplace1, float* inplace2, float* w0, float* w1, float* w2, const int size1); void div(float* inplace0, float* inplace1, float* inplace2, const int patch_area, const int size1); void div(float* inplace0, float* w0, const int size1); void div(float* inplace0, const int patch_area, const int size1); }; class RRDXTDenoise : public RedundantDXTDenoise { public: enum SAMPLING { FULL = 0, LATTICE, POISSONDISK, }; RRDXTDenoise(); RRDXTDenoise(cv::Size size, int color, cv::Size patch_size_ = cv::Size(8, 8)); void generateSamplingMaps(cv::Size imageSize, cv::Size patch_size, int number_of_LUT, int d, SAMPLING sampleType = SAMPLING::POISSONDISK); virtual void operator()(cv::Mat& src_, cv::Mat& dest, float sigma, cv::Size psize = cv::Size(8, 8), BASIS transform_basis = BASIS::DCT); void colorredundunt(cv::Mat& src_, cv::Mat& dest, float sigma, cv::Size psize = cv::Size(8, 8), BASIS transform_basis = BASIS::DCT); cv::RNG rng; protected: void div(float* inplace0, float* inplace1, float* inplace2, float* count, const int size1); void div(float* inplace0, float* inplace1, float* inplace2, float* inplace3, float* count, const int size1); virtual void body(float *src, float* dest, float Th); void getSamplingFromLUT(cv::Mat& samplingMap); void setSamplingMap(cv::Mat& samplingMap, SAMPLING samplingType, int d); std::vector<cv::Mat> samplingMapLUTs; cv::Mat samplingMap; std::vector<cv::Point> sampleLUT;//not used };
27.715278
139
0.731646
[ "vector" ]
db110acc0e1285fafd916ab5715958553fdeb28c
3,358
h
C
scripts/Encode scripts/string_manip_stl.h
adelq/Genomic-Interactive-Visualization-Engine
81458ac4dfa2d9b7a5496e6eae3d2b44f36aa5c0
[ "Apache-2.0" ]
131
2017-08-21T20:03:27.000Z
2022-03-05T13:22:05.000Z
scripts/Encode scripts/string_manip_stl.h
adelq/Genomic-Interactive-Visualization-Engine
81458ac4dfa2d9b7a5496e6eae3d2b44f36aa5c0
[ "Apache-2.0" ]
33
2017-10-11T12:24:36.000Z
2022-01-24T10:11:57.000Z
scripts/Encode scripts/string_manip_stl.h
adelq/Genomic-Interactive-Visualization-Engine
81458ac4dfa2d9b7a5496e6eae3d2b44f36aa5c0
[ "Apache-2.0" ]
38
2017-08-22T19:14:15.000Z
2021-07-22T22:09:49.000Z
#ifndef _STRING_MANIPULATION_STL #define _STRING_MANIPULATION_STL #include <string> #include <vector> std::string toLower(const std::string &main); std::string toUpper(const std::string &main); // This function is case sensitive, get the sub std::string before strBefore from main // bInc indicates whether strBefore itself is included in the result // bRtnAll indicates whether the return std::string is full std::string or "" if strBefore is not found in main std::string getBefore(const std::string &main, const std::string &strBefore, const bool bInc = false, const bool bRtnAll = true); // If case need to be insensitive, then call this function std::string getBeforeIS(const std::string &main, const std::string &strBefore, const bool bInc = false, const bool bRtnAll = true); // get the substd::string after strAfter, case sensitive // bInc indicates whether strAfter itself is included in the result // bRtnAll indicates whether the return std::string is full std::string or "" if strAfter is not found in main std::string getAfter(const std::string &main, const std::string &strAfter, const bool bInc = false, const bool bRtnAll = false); // case insensitive version of getAfter std::string getAfterIS(const std::string &main, const std::string &strAfter, const bool bInc = false, const bool bRtnAll = false); // get sub-std::string between strStart and strEnd // bIncStart means whether strStart is included, similar for bIncEnd // bNegStart means whether strStart can be neglected (in case of not found), similar for bNegEnd std::string getBetween(const std::string &main, const std::string &strStart, const std::string &strEnd, bool bIncStart = false, bool bIncEnd = false, bool bNegStart = false, bool bNegEnd = true); // case insensitive version of getBetween std::string getBetweenIS(const std::string &main, const std::string &strStart, const std::string &strEnd, bool bIncStart = false, bool bIncEnd = false, bool bNegStart = false, bool bNegEnd = true); // so far token delimiters has been not characters, so no IS version is built yet, but may be built in case they are needed std::string getToken(const std::string &main, int i, const std::string &token = "\t"); // get token with de-quotation, notice the sequence of parameters std::string getToken(const std::string &main, const std::string &token, int i, const std::string &quote = "\""); // there may be case insensitive version of getToken, but not needed so far std::string getTokenIS(const std::string &main, int i, const std::string &token = "\t"); std::string getTokenIS(const std::string &main, const std::string &token, int i, const std::string &quote = "\""); // count the number of tokens // for similar reason, no IS version is realized so far long countTokens(const std::string &main, const std::string &token = "\t"); // count the number of tokens, with quotations removed long countTokens(const std::string &main, const std::string &token, const std::string &quote); std::string trimString(const std::string &main, const std::string &token = " "); // trim the string // split main by tokens std::vector<std::string> splitTokens(const std::string &main, const std::string &token = "\t", const std::string &quote = "\"", const bool bRemoveEndEmpty = false); bool containsWholeWord(const std::string &main, const std::string &word); #endif
54.16129
164
0.740917
[ "vector" ]
db1c9699a86cfe7d0f0f8e068ca3f202e6657414
5,857
h
C
src/operator/trackers/kf_tracker.h
ccanel/saf
5bc296e352419ae3688eb51dded72154f732127e
[ "Apache-2.0" ]
28
2018-09-06T19:18:27.000Z
2022-02-10T05:56:08.000Z
src/operator/trackers/kf_tracker.h
ccanel/saf
5bc296e352419ae3688eb51dded72154f732127e
[ "Apache-2.0" ]
13
2018-09-13T13:41:53.000Z
2021-05-12T01:18:36.000Z
src/operator/trackers/kf_tracker.h
ccanel/saf
5bc296e352419ae3688eb51dded72154f732127e
[ "Apache-2.0" ]
14
2018-09-06T14:33:37.000Z
2021-05-22T20:07:45.000Z
// Copyright 2018 The SAF Authors. 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. // Kalman filter tracker operator #ifndef SAF_OPERATOR_TRACKERS_KF_TRACKER_H_ #define SAF_OPERATOR_TRACKERS_KF_TRACKER_H_ #include <dlib/filtering.h> #include <dlib/matrix.h> #include <dlib/rand.h> #include <boost/optional.hpp> #include <cstdlib> #include <ctime> #include <sstream> #include <string> #include "operator/trackers/object_tracker.h" using dlib::identity_matrix; using dlib::kalman_filter; using dlib::matrix; class KFTracker : public BaseTracker { public: KFTracker(const std::string& id, const std::string& tag) : BaseTracker(id, tag), initialised_(false) {} virtual ~KFTracker() {} virtual void Initialize(const cv::Mat& gray_image, cv::Rect bb) { (void)(gray_image); matrix<double, 6, 6> R; R = 50, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 50; matrix<double, 8, 8> A; A = 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1; matrix<double, 6, 8> H; H = 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1; kf.set_measurement_noise(R); matrix<double> pn = 0.01 * identity_matrix<double, 8>(); kf.set_process_noise(pn); kf.set_observation_model(H); kf.set_transition_model(A); matrix<double, 8, 1> x; bb_ = bb; feat_.resize(124, 0.0); cv::Point cpt = GetCenterPoint(bb_); x = cpt.x, cpt.y, 0, 0, bb_.x, bb_.y, (bb_.x + bb_.width), (bb_.y + bb_.height); // This is the initial bbox center kf.set_state(x); last_calibration_time_ = std::chrono::system_clock::now(); initialised_ = true; } virtual bool IsInitialized() { return initialised_; } virtual void Track(const cv::Mat& gray_image) { (void)(gray_image); kf.update(); // on every frame xb = kf.get_predicted_next_state(); cv::Point predict_pt = cv::Point(xb(0, 0), xb(1, 0)); bb_ = GetRect(predict_pt, xb(6, 0) - xb(4, 0), xb(7, 0) - xb(5, 0)); } virtual cv::Rect GetBB() { return bb_; } virtual std::vector<double> GetBBFeature() { return feat_; } virtual bool TrackGetPossibleBB(const cv::Mat& gray_image, std::vector<Rect>& untracked_bboxes, std::vector<std::string>& untracked_tags, cv::Rect& rt) { (void)(gray_image); rt = GetBB(); boost::optional<cv::Rect> best_rect; double min_dist = std::numeric_limits<double>::max(); size_t min_i; for (size_t i = 0; i < untracked_bboxes.size(); ++i) { cv::Rect ru(untracked_bboxes[i].px, untracked_bboxes[i].py, untracked_bboxes[i].width, untracked_bboxes[i].height); auto pu = GetCenterPoint(ru); auto pt = GetCenterPoint(rt); auto dist = GetDistance(pu, pt); if (dist < min_dist) { min_dist = dist; min_i = i; } } if (min_dist < 50) { cv::Rect r_tmp(untracked_bboxes[min_i].px, untracked_bboxes[min_i].py, untracked_bboxes[min_i].width, untracked_bboxes[min_i].height); best_rect = r_tmp; untracked_bboxes.erase(untracked_bboxes.begin() + min_i); untracked_tags.erase(untracked_tags.begin() + min_i); } auto now = std::chrono::system_clock::now(); if (best_rect) { cv::Point cpt = GetCenterPoint(*best_rect); matrix<double, 6, 1> z; z = cpt.x, cpt.y, best_rect->x, best_rect->y, (best_rect->x + best_rect->width), (best_rect->y + best_rect->height); kf.update(z); matrix<double, 8, 1> x; x = kf.get_current_state(); cv::Point curr_pt(x(0, 0), x(1, 0)); // use current width height rt = GetRect(curr_pt, x(6, 0) - x(4, 0), x(7, 0) - x(5, 0)); bb_ = rt; last_calibration_time_ = now; } else { kf.update(); xb = kf.get_predicted_next_state(); cv::Point predict_pt = cv::Point(xb(0, 0), xb(1, 0)); rt = GetRect(predict_pt, xb(6, 0) - xb(4, 0), xb(7, 0) - xb(5, 0)); bb_ = rt; } std::chrono::duration<double> diff = now - last_calibration_time_; return diff.count() < 1; } private: cv::Point GetCenterPoint(const cv::Rect& rect) { cv::Point cpt; cpt.x = rect.x + cvRound(rect.width / 2.0); cpt.y = rect.y + cvRound(rect.height / 2.0); return cpt; } cv::Rect GetRect(const cv::Point& pt, int width, int height) { int xmin = pt.x - cvRound(width / 2.0); int ymin = pt.y - cvRound(height / 2.0); return cv::Rect(xmin, ymin, width, height); } double GetDistance(cv::Point pointO, cv::Point pointA) { double distance; distance = std::pow((pointO.x - pointA.x), 2) + std::pow((pointO.y - pointA.y), 2); distance = std::sqrt(distance); return distance; } kalman_filter<8, 6> kf; bool initialised_; matrix<double, 8, 1> xb; cv::Rect bb_; std::vector<double> feat_; std::chrono::time_point<std::chrono::system_clock> last_calibration_time_; }; #endif // SAF_OPERATOR_TRACKERS_KF_TRACKER_H_
33.090395
80
0.603039
[ "vector" ]
db2320749c3577a3b2f7c02ff980552ea87a838c
671
h
C
cocos2dx_playground/Classes/step_typetype_game_StageViewNode.h
R2Road/cocos2dx_playground
6e6f349b5c9fc702558fe8720ba9253a8ba00164
[ "Apache-2.0" ]
9
2020-06-11T17:09:44.000Z
2021-12-25T00:34:33.000Z
cocos2dx_playground/Classes/step_typetype_game_StageViewNode.h
R2Road/cocos2dx_playground
6e6f349b5c9fc702558fe8720ba9253a8ba00164
[ "Apache-2.0" ]
9
2019-12-21T15:01:01.000Z
2020-12-05T15:42:43.000Z
cocos2dx_playground/Classes/step_typetype_game_StageViewNode.h
R2Road/cocos2dx_playground
6e6f349b5c9fc702558fe8720ba9253a8ba00164
[ "Apache-2.0" ]
1
2020-09-07T01:32:16.000Z
2020-09-07T01:32:16.000Z
#pragma once #include <vector> #include "2d/CCNode.h" namespace step_typetype { namespace game { class LetterViewNode; class Stage; class StageViewNode : public cocos2d::Node { public: struct Config { bool bShowPivot = false; }; private: using ContainerT = std::vector<LetterViewNode*>; StageViewNode( const std::size_t max_length ); public: static StageViewNode* create( const std::size_t max_length, const Config config ); private: bool init( const Config config ); public: void Reset( const Stage& stage ); void RequestLetterDie( const std::size_t target_pos ); private: ContainerT mLetters; }; } }
15.97619
85
0.685544
[ "vector" ]
db2632c1988f550626b5040a15ee20a8c3ba3957
7,241
h
C
osdrv/ezcfg/ezcfg-0.1/libezcfg/api/include/ezcfg-api.h
zetalabs/hi3520d
27374d155c4bcc1904d377dd3328f4d47b2cbc3d
[ "Apache-2.0" ]
2
2016-05-14T07:18:30.000Z
2021-03-24T20:45:32.000Z
osdrv/ezcfg/ezcfg-0.1/libezcfg/api/include/ezcfg-api.h
zetalabs/hi3520d
27374d155c4bcc1904d377dd3328f4d47b2cbc3d
[ "Apache-2.0" ]
null
null
null
osdrv/ezcfg/ezcfg-0.1/libezcfg/api/include/ezcfg-api.h
zetalabs/hi3520d
27374d155c4bcc1904d377dd3328f4d47b2cbc3d
[ "Apache-2.0" ]
1
2020-07-10T03:53:10.000Z
2020-07-10T03:53:10.000Z
#ifndef _EZCFG_API_H_ #define _EZCFG_API_H_ /* common function interface */ struct ezcfg; bool ezcfg_api_common_initialized(void); char *ezcfg_api_common_get_config_file(void); int ezcfg_api_common_set_config_file(const char *path); char *ezcfg_api_common_get_config_file_content(void); struct ezcfg *ezcfg_api_common_new(char *path); void ezcfg_api_common_del(struct ezcfg *ezcfg); char *ezcfg_api_common_get_root_path(struct ezcfg *ezcfg); char *ezcfg_api_common_get_sem_ezcfg_path(struct ezcfg *ezcfg); char *ezcfg_api_common_get_shm_ezcfg_path(struct ezcfg *ezcfg); int ezcfg_api_common_get_shm_ezcfg_size(struct ezcfg *ezcfg, size_t *psize); int ezcfg_api_common_increase_shm_ezcfg_nvram_queue_num(struct ezcfg *ezcfg); int ezcfg_api_common_decrease_shm_ezcfg_nvram_queue_num(struct ezcfg *ezcfg); int ezcfg_api_common_increase_shm_ezcfg_rc_queue_num(struct ezcfg *ezcfg); int ezcfg_api_common_decrease_shm_ezcfg_rc_queue_num(struct ezcfg *ezcfg); #if (HAVE_EZBOX_SERVICE_EZCTP == 1) char *ezcfg_api_common_get_shm_ezctp_path(struct ezcfg *ezcfg); int ezcfg_api_common_get_shm_ezctp_size(struct ezcfg *ezcfg, size_t *psize); #endif /* common utilities */ int ezcfg_api_util_get_conf_string(const char *path, const char *section, const int idx, const char *keyword, char *buf, size_t len); /* Agent interface */ int ezcfg_api_agent_start(char *init_conf); int ezcfg_api_agent_stop(char *init_conf); int ezcfg_api_agent_reload(char *init_conf); int ezcfg_api_agent_set_debug(char *init_conf, bool flag); #if 0 /* Master thread interface */ struct ezcfg_master; struct ezcfg_master *ezcfg_api_master_start(const char *name, int threads_max); int ezcfg_api_master_stop(struct ezcfg_master *master); int ezcfg_api_master_reload(struct ezcfg_master *master); /* CTRL interface */ int ezcfg_api_ctrl_exec(char *const argv[], char *output, size_t len); /* IPC interface */ int ezcfg_api_ipc_get_ezcfg_shm_id(int *shm_id); /* function argument interface */ struct ezcfg_arg_nvram_socket; struct ezcfg_arg_nvram_socket *ezcfg_api_arg_nvram_socket_new(void); int ezcfg_api_arg_nvram_socket_del(struct ezcfg_arg_nvram_socket *ap); int ezcfg_api_arg_nvram_socket_get_domain(struct ezcfg_arg_nvram_socket *ap, char **pp); int ezcfg_api_arg_nvram_socket_set_domain(struct ezcfg_arg_nvram_socket *ap, const char *domain); int ezcfg_api_arg_nvram_socket_get_type(struct ezcfg_arg_nvram_socket *ap, char **pp); int ezcfg_api_arg_nvram_socket_set_type(struct ezcfg_arg_nvram_socket *ap, const char *type); int ezcfg_api_arg_nvram_socket_get_protocol(struct ezcfg_arg_nvram_socket *ap, char **pp); int ezcfg_api_arg_nvram_socket_set_protocol(struct ezcfg_arg_nvram_socket *ap, const char *protocol); int ezcfg_api_arg_nvram_socket_get_address(struct ezcfg_arg_nvram_socket *ap, char **pp); int ezcfg_api_arg_nvram_socket_set_address(struct ezcfg_arg_nvram_socket *ap, const char *address); struct ezcfg_arg_nvram_ssl; struct ezcfg_arg_nvram_ssl *ezcfg_api_arg_nvram_ssl_new(void); int ezcfg_api_arg_nvram_ssl_del(struct ezcfg_arg_nvram_ssl *ap); int ezcfg_api_arg_nvram_ssl_get_role(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_role(struct ezcfg_arg_nvram_ssl *ap, const char *role); int ezcfg_api_arg_nvram_ssl_get_method(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_method(struct ezcfg_arg_nvram_ssl *ap, const char *method); int ezcfg_api_arg_nvram_ssl_get_socket_enable(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_socket_enable(struct ezcfg_arg_nvram_ssl *ap, const char *socket_enable); int ezcfg_api_arg_nvram_ssl_get_socket_domain(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_socket_domain(struct ezcfg_arg_nvram_ssl *ap, const char *socket_domain); int ezcfg_api_arg_nvram_ssl_get_socket_type(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_socket_type(struct ezcfg_arg_nvram_ssl *ap, const char *socket_type); int ezcfg_api_arg_nvram_ssl_get_socket_protocol(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_socket_protocol(struct ezcfg_arg_nvram_ssl *ap, const char *socket_protocol); int ezcfg_api_arg_nvram_ssl_get_socket_address(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_socket_address(struct ezcfg_arg_nvram_ssl *ap, const char *socket_address); int ezcfg_api_arg_nvram_ssl_get_certificate_file(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_certificate_file(struct ezcfg_arg_nvram_ssl *ap, const char *file); int ezcfg_api_arg_nvram_ssl_get_certificate_chain_file(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_certificate_chain_file(struct ezcfg_arg_nvram_ssl *ap, const char *file); int ezcfg_api_arg_nvram_ssl_get_private_key_file(struct ezcfg_arg_nvram_ssl *ap, char **pp); int ezcfg_api_arg_nvram_ssl_set_private_key_file(struct ezcfg_arg_nvram_ssl *ap, const char *file); /* NVRAM interface */ int ezcfg_api_nvram_get(const char *name, char *value, size_t len); int ezcfg_api_nvram_set(const char *name, const char *value); int ezcfg_api_nvram_unset(const char *name); int ezcfg_api_nvram_set_multi(char *list, const int num); int ezcfg_api_nvram_list(char *list, size_t len); int ezcfg_api_nvram_info(char *list, size_t len); int ezcfg_api_nvram_commit(void); void ezcfg_api_nvram_set_debug(bool enable_debug); int ezcfg_api_nvram_insert_socket(struct ezcfg_arg_nvram_socket *ap); int ezcfg_api_nvram_remove_socket(struct ezcfg_arg_nvram_socket *ap); int ezcfg_api_nvram_insert_ssl(struct ezcfg_arg_nvram_ssl *ap); int ezcfg_api_nvram_remove_ssl(struct ezcfg_arg_nvram_ssl *ap); #endif int ezcfg_api_nvram_change(char *init_conf, char *ns, char *nv_json, char **presult); #if 0 /* ezctp interface */ #if (HAVE_EZBOX_SERVICE_EZCTP == 1) bool ezcfg_api_ezctp_require_semaphore(char *sem_ezcfg_path); bool ezcfg_api_ezctp_release_semaphore(char *sem_ezcfg_path); bool ezcfg_api_ezctp_insert_market_data(void *shm_ezcfg_addr, const void *data, size_t n, size_t size); bool ezcfg_api_ezctp_remove_market_data(void *shm_ezcfg_addr, void **pdata, size_t *n, size_t *psize); bool ezcfg_api_ezctp_save_market_data(void *shm_ezcfg_addr, FILE *fp, size_t size, int flag); #endif /* rc interface */ int ezcfg_api_rc_require_semaphore(char *sem_ezcfg_path); int ezcfg_api_rc_release_semaphore(char *sem_ezcfg_path); /* UUID interface */ int ezcfg_api_uuid1_string(char *str, int len); int ezcfg_api_uuid3_string(char *str, int len); int ezcfg_api_uuid4_string(char *str, int len); int ezcfg_api_uuid5_string(char *str, int len); /* UPnP interface */ int ezcfg_api_upnp_set_task_file(const char *path); int ezcfg_api_upnp_get_task_file(char *path, int len); bool ezcfg_api_upnp_lock_task_file(char *sem_ezcfg_path); bool ezcfg_api_upnp_unlock_task_file(char *sem_ezcfg_path); /* u-boot-env interface */ int ezcfg_api_ubootenv_get(char *name, char *value, size_t len); int ezcfg_api_ubootenv_set(char *name, char *value); int ezcfg_api_ubootenv_list(char *list, size_t len); int ezcfg_api_ubootenv_check(void); size_t ezcfg_api_ubootenv_size(void); /* firmware interface */ int ezcfg_api_firmware_upgrade(char *name, char *model); #endif #endif
51.35461
109
0.836487
[ "model" ]
db2abe934ae8cbadfc906fab0b0ddd5a35b3955a
515
h
C
ABFramework/Multi/Categories/NSArray+ABFramework.h
alexblunck/ABFramework
c1852f6ed6157101945bb4740bb44c93baded93d
[ "MIT" ]
7
2015-07-03T07:20:51.000Z
2021-09-23T09:49:09.000Z
ABFramework/Multi/Categories/NSArray+ABFramework.h
alexblunck/ABFramework
c1852f6ed6157101945bb4740bb44c93baded93d
[ "MIT" ]
null
null
null
ABFramework/Multi/Categories/NSArray+ABFramework.h
alexblunck/ABFramework
c1852f6ed6157101945bb4740bb44c93baded93d
[ "MIT" ]
5
2015-07-03T11:27:21.000Z
2021-12-14T01:34:05.000Z
// // NSArray+ABFramework.h // ABFramework // // Created by Alexander Blunck on 4/17/13. // Copyright (c) 2013 Ablfx. All rights reserved. // #import <Foundation/Foundation.h> @interface NSArray (ABFramework) //Conversion -(NSString*) jsonString; //Safe Access -(id) safeObjectAtIndex:(NSInteger)index; -(id) safeObjectAtIndex:(NSInteger)index verbose:(BOOL)verbose; //Be careful with this one //Add -(NSArray*) arrayByAddingObject:(id)object; //Remove -(NSArray*) arrayByRemovingObject:(id)object; @end
19.074074
90
0.728155
[ "object" ]
db3f58e0f581eb355020d58a5dddc499b0547774
5,011
h
C
src/main/cpp/veri_aggregate_api.h
lbnlcomputerarch/vte
91eff306201e05e6d61a6e855168edf7379fe166
[ "BSD-3-Clause-LBNL" ]
2
2020-04-10T10:35:01.000Z
2020-05-12T17:14:11.000Z
src/main/cpp/veri_aggregate_api.h
lbnlcomputerarch/vte
91eff306201e05e6d61a6e855168edf7379fe166
[ "BSD-3-Clause-LBNL" ]
null
null
null
src/main/cpp/veri_aggregate_api.h
lbnlcomputerarch/vte
91eff306201e05e6d61a6e855168edf7379fe166
[ "BSD-3-Clause-LBNL" ]
1
2021-04-12T18:41:50.000Z
2021-04-12T18:41:50.000Z
// written by Albert Chen #ifndef __VERILATOR_AGGREGATE_API__ #define __VERILATOR_AGGREGATE_API__ #include "veri_api.h" #include "testbench.h" #include <vector> #include <map> #include <string> #include <list> static const char bundle_field_delim = '.'; static const char idx_field_delim = '_'; class VerilatorBundle : public VerilatorDataWrapper { protected: std::map<std::string, VerilatorDataWrapper *> elements; std::list<VerilatorDataWrapper *> order; VerilatorDataWrapper *first_wire; public: virtual VerilatorDataWrapper &operator[](std::string name) { if (elements.find(name) == elements.end()) { std::cout << "tried to access nonexistent bundle element: " << name << std::endl; assert(false); } return *elements.at(name); } Bits get_value() override { return first_wire->get_value(); } void put_value(Bits &bits) override { return first_wire->put_value(bits); } size_t get_width() override { return first_wire->get_width(); } std::string get_name() override { return first_wire->get_name(); } template<class Module> friend std::map<std::string, Bits> Testbench<Module>::peek(VerilatorBundle&); }; template<class Data> class VerilatorVec : public VerilatorDataWrapper { private: std::vector<Data> elements; public: template<class ...Data1> explicit VerilatorVec(Data1... data): elements{data...} { } virtual Data &operator[](size_t idx) { return elements.at(idx); } Bits get_value() override { return elements.at(0).get_value(); } void put_value(Bits &bits) override { return elements.at(0).put_value(bits); } size_t get_width() override { return elements.at(0).get_width(); } std::string get_name() override { return elements.at(0).get_name(); } size_t get_num_elements() { return elements.size(); } template<class Module> template<class Data1> friend std::vector<Bits> Testbench<Module>::peek(VerilatorVec<Data1> &vec); template<class Module> friend void Testbench<Module>::poke(VerilatorBundle &bundle, std::map<std::string, Bits> &values); }; template<class Module> std::map<std::string, Bits> Testbench<Module>::peek(VerilatorBundle &bundle) { std::map<std::string, Bits> values; for (std::pair<std::string, VerilatorDataWrapper *> p : bundle.elements) values[p.first] = p.second->get_value(); return values; } template<class Module> template<class Data> std::vector<Bits> Testbench<Module>::peek(VerilatorVec<Data> &vec) { std::vector<Bits> values; for (Data &p : vec.elements) values.push_back(p.get_value()); return values; } template<class Module> void Testbench<Module>::poke(VerilatorBundle &bundle, std::map<std::string, Bits> &values) { for (const std::pair<const std::string, Bits> &p : values) { std::stringstream ss(p.first); std::string sub_key; std::vector<std::string> sub_keys; while (std::getline(ss, sub_key, bundle_field_delim)) sub_keys.push_back(sub_key); VerilatorDataWrapper *sub_bundle = &bundle; for (const std::string &key : sub_keys) { size_t idx_delim_pos = key.rfind(idx_field_delim); const std::string &idx_string = key.substr(idx_delim_pos + 1); if (idx_delim_pos != std::string::npos && idx_string.find_first_not_of("0123456789") == std::string::npos) { sub_bundle = &((*(VerilatorBundle *) sub_bundle)[key.substr(0, idx_delim_pos)]); sub_bundle = &((*(VerilatorVec<VerilatorDataWrapper> *) sub_bundle)[std::stoi(idx_string)]); } else sub_bundle = &((*(VerilatorBundle *) sub_bundle)[key]); } poke(*sub_bundle, p.second); } } template<class Module> void Testbench<Module>::expect(VerilatorBundle &bundle, std::map<std::string, Bits> &values) { for (const std::pair<const std::string, Bits> &p : values) { std::stringstream ss(p.first); std::string sub_key; std::vector<std::string> sub_keys; while (std::getline(ss, sub_key, bundle_field_delim)) sub_keys.push_back(sub_key); VerilatorDataWrapper *sub_bundle = &bundle; for (const std::string &key : sub_keys) { size_t idx_delim_pos = key.rfind(idx_field_delim); const std::string &idx_string = key.substr(idx_delim_pos + 1); if (idx_delim_pos != std::string::npos && idx_string.find_first_not_of("0123456789") == std::string::npos) { sub_bundle = &((*(VerilatorBundle *) sub_bundle)[key.substr(0, idx_delim_pos)]); sub_bundle = &((*(VerilatorVec<VerilatorDataWrapper> *) sub_bundle)[std::stoi(idx_string)]); } else sub_bundle = &((*(VerilatorBundle *) sub_bundle)[key]); } expect(*sub_bundle, p.second); } } #endif
31.31875
120
0.638396
[ "vector" ]
db40b389fb79aea58f872b050e590f2ed71c9b4b
347
h
C
tests/code.h
zettsu-t/nbinomPlot
cba3608d2a149cd56522a7b934d21b8c03daa875
[ "MIT" ]
null
null
null
tests/code.h
zettsu-t/nbinomPlot
cba3608d2a149cd56522a7b934d21b8c03daa875
[ "MIT" ]
null
null
null
tests/code.h
zettsu-t/nbinomPlot
cba3608d2a149cd56522a7b934d21b8c03daa875
[ "MIT" ]
null
null
null
#include <vector> using NumberType = double; using NumberVector = std::vector<NumberType>; using NumberVectorArg = const std::vector<NumberType>&; extern NumberVector get_nbinom_pdf(NumberVectorArg size, NumberVectorArg prob, NumberVectorArg xs); /* Local Variables: mode: c++ coding: utf-8-unix tab-width: nil c-file-style: "stroustrup" End: */
23.133333
99
0.772334
[ "vector" ]
db437a4955314a97b57e14e4a4ec90a372ce72a5
194
h
C
Matrices - Tutorial/LibMatrix.h
erickwatson/Maths-for-Games
c80e227c43927f674043b9ca4e469b9d2737ff56
[ "MIT" ]
null
null
null
Matrices - Tutorial/LibMatrix.h
erickwatson/Maths-for-Games
c80e227c43927f674043b9ca4e469b9d2737ff56
[ "MIT" ]
null
null
null
Matrices - Tutorial/LibMatrix.h
erickwatson/Maths-for-Games
c80e227c43927f674043b9ca4e469b9d2737ff56
[ "MIT" ]
null
null
null
#pragma once #include <vector> class Matrix2 { public: Matrix2(); ~Matrix2(); }; class Matrix3 { public: /*Vector3 xAxis; Vector3 yAxis; Vector3 zAxis;*/ }; class Matrix4 { public: };
8.434783
17
0.654639
[ "vector" ]
71b603bf7e3e621bc9bf87e7ecac0de7ea9cf236
4,597
h
C
src/base/consumer.h
lawarner/aft
fd2b6b97bedd2be3ccb1739b890aeea6aa2f9603
[ "Apache-2.0" ]
null
null
null
src/base/consumer.h
lawarner/aft
fd2b6b97bedd2be3ccb1739b890aeea6aa2f9603
[ "Apache-2.0" ]
null
null
null
src/base/consumer.h
lawarner/aft
fd2b6b97bedd2be3ccb1739b890aeea6aa2f9603
[ "Apache-2.0" ]
null
null
null
#pragma once /* * Copyright © 2015-2017 Andy Warner * * 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 <vector> #include "base/result.h" #include "base/producttype.h" namespace aft { namespace base { // Forward reference class Blob; class Result; class ReaderContract; class TObject; /** * Interface that the consumer calls when it needs data. */ class WriterContract { public: /** Returns the type of product this writer has ready to write. */ virtual ProductType hasData() = 0; // Note: Using references requires class to have proper copy semantics. /** Get a TOjbect by copying. * @param object Reference to object that receives the data. * @return true if data was written. */ virtual bool getData(TObject& object) = 0; /** Get a Result by copying. * @param result Reference to result that receives the data. * @return true if data was written. */ virtual bool getData(Result& result) = 0; /** Get a Blob by copying. * @param blob Reference to blob that receives the data. * @return true if data was written. */ virtual bool getData(Blob& blob) = 0; }; /** * Interface that classes must implement that consume data. */ class ConsumerContract { public: /** Indicated if this consumer is ready to consume data. * @return true if write can be called on this consumer without blocking. */ virtual bool canAcceptData() = 0; /** Write a TObject to this consumer. * @return true if the object was consumed. */ virtual Result write(const TObject& object) = 0; /** Write a Result to this consumer. * @return true if the result was consumed. */ virtual Result write(const Result& result) = 0; /** Write a Blob to this consumer. * @return true if the blob was consumed. */ virtual Result write(const Blob& blob) = 0; /** Write multiple TObject's to this consumer. * @return The number of objects that were consumed. Returns -1 if an error occurred. */ virtual int write(const std::vector<TObject>& objects) = 0; /** Write multiple Result's to this consumer. * @return The number of results that were consumed. Returns -1 if an error occurred. */ virtual int write(const std::vector<Result>& results) = 0; /** Write multiple Blob's to this consumer. * @return The number of blobs that were consumed. Returns -1 if an error occurred. */ virtual int write(const std::vector<Blob>& blobs) = 0; /** Register as a data writer for this consumer. */ virtual bool registerWriteCallback(const WriterContract* writer) = 0; /** Unregister as a data writer for this consumer. */ virtual bool unregisterWriteCallback(const WriterContract* writer) = 0; }; /** * Base implementation of the ConsumerContract interface. */ class BaseConsumer : public ConsumerContract { public: BaseConsumer(ReaderContract* readerDelegate = 0); virtual ~BaseConsumer(); /** Returns true if write can be called on this consumer without blocking */ virtual bool canAcceptData() override; virtual Result write(const TObject& object) override; virtual Result write(const Result& result) override; virtual Result write(const Blob& blob) override; /** Returns the number of objects written. */ virtual int write(const std::vector<TObject>& objects) override; virtual int write(const std::vector<Result>& results) override; virtual int write(const std::vector<Blob>& blobs) override; /** Register as a data writer for this consumer. */ virtual bool registerWriteCallback(const WriterContract* writer) override; /** Unregister as a data writer for this consumer. */ virtual bool unregisterWriteCallback(const WriterContract* writer) override; /** Start loop reading from writers and writing to the reader delegate. */ virtual void flowData(); protected: ReaderContract* readerDelegate_; std::vector<WriterContract*> writers_; }; } // namespace base } // namespace aft
33.801471
91
0.689798
[ "object", "vector" ]
71baf12ed0474079e6f615e50b13807b21696cdf
9,184
h
C
plugins/eeui/WeexSDK/ios/weex_core/Source/include/JavaScriptCore/heap/HeapUtil.h
bonniesl/yktapp
3f96b7aad945e9aa110f0643d9a57e28d0645ab6
[ "MIT" ]
null
null
null
plugins/eeui/WeexSDK/ios/weex_core/Source/include/JavaScriptCore/heap/HeapUtil.h
bonniesl/yktapp
3f96b7aad945e9aa110f0643d9a57e28d0645ab6
[ "MIT" ]
null
null
null
plugins/eeui/WeexSDK/ios/weex_core/Source/include/JavaScriptCore/heap/HeapUtil.h
bonniesl/yktapp
3f96b7aad945e9aa110f0643d9a57e28d0645ab6
[ "MIT" ]
null
null
null
/* * Copyright (C) 2016 Apple Inc. 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. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 namespace JSC { // Are you tired of waiting for all of WebKit to build because you changed the implementation of a // function in HeapInlines.h? Does it bother you that you're waiting on rebuilding the JS DOM // bindings even though your change is in a function called from only 2 .cpp files? Then HeapUtil.h // is for you! Everything in this class should be a static method that takes a Heap& if needed. // This is a friend of Heap, so you can access all of Heap's privates. // // This ends up being an issue because Heap exposes a lot of methods that ought to be inline for // performance or that must be inline because they are templates. This class ought to contain // methods that are used for the implementation of the collector, or for unusual clients that need // to reach deep into the collector for some reason. Don't put things in here that would cause you // to have to include it from more than a handful of places, since that would defeat the purpose. // This class isn't here to look pretty. It's to let us hack the GC more easily! class HeapUtil { public: // This function must be run after stopAllocation() is called and // before liveness data is cleared to be accurate. template<typename Func> static void findGCObjectPointersForMarking( Heap& heap, HeapVersion markingVersion, TinyBloomFilter filter, void* passedPointer, const Func& func) { const HashSet<MarkedBlock*>& set = heap.objectSpace().blocks().set(); ASSERT(heap.objectSpace().isMarking()); static const bool isMarking = true; char* pointer = static_cast<char*>(passedPointer); // It could point to a large allocation. if (heap.objectSpace().largeAllocationsForThisCollectionSize()) { if (heap.objectSpace().largeAllocationsForThisCollectionBegin()[0]->aboveLowerBound(pointer) && heap.objectSpace().largeAllocationsForThisCollectionEnd()[-1]->belowUpperBound(pointer)) { LargeAllocation** result = approximateBinarySearch<LargeAllocation*>( heap.objectSpace().largeAllocationsForThisCollectionBegin(), heap.objectSpace().largeAllocationsForThisCollectionSize(), LargeAllocation::fromCell(pointer), [] (LargeAllocation** ptr) -> LargeAllocation* { return *ptr; }); if (result) { if (result > heap.objectSpace().largeAllocationsForThisCollectionBegin() && result[-1]->contains(pointer)) func(result[-1]->cell()); if (result[0]->contains(pointer)) func(result[0]->cell()); if (result + 1 < heap.objectSpace().largeAllocationsForThisCollectionEnd() && result[1]->contains(pointer)) func(result[1]->cell()); } } } MarkedBlock* candidate = MarkedBlock::blockFor(pointer); // It's possible for a butterfly pointer to point past the end of a butterfly. Check this now. if (pointer <= bitwise_cast<char*>(candidate) + sizeof(IndexingHeader)) { // We may be interested in the last cell of the previous MarkedBlock. char* previousPointer = pointer - sizeof(IndexingHeader) - 1; MarkedBlock* previousCandidate = MarkedBlock::blockFor(previousPointer); if (!filter.ruleOut(bitwise_cast<Bits>(previousCandidate)) && set.contains(previousCandidate) && previousCandidate->handle().cellKind() == HeapCell::Auxiliary) { previousPointer = static_cast<char*>(previousCandidate->handle().cellAlign(previousPointer)); if (previousCandidate->handle().isLiveCell(markingVersion, isMarking, previousPointer)) func(previousPointer); } } if (filter.ruleOut(bitwise_cast<Bits>(candidate))) { ASSERT(!candidate || !set.contains(candidate)); return; } if (!set.contains(candidate)) return; auto tryPointer = [&] (void* pointer) { if (candidate->handle().isLiveCell(markingVersion, isMarking, pointer)) func(pointer); }; if (candidate->handle().cellKind() == HeapCell::JSCell) { if (!MarkedBlock::isAtomAligned(pointer)) return; tryPointer(pointer); return; } // A butterfly could point into the middle of an object. char* alignedPointer = static_cast<char*>(candidate->handle().cellAlign(pointer)); tryPointer(alignedPointer); // Also, a butterfly could point at the end of an object plus sizeof(IndexingHeader). In that // case, this is pointing to the object to the right of the one we should be marking. if (candidate->atomNumber(alignedPointer) > MarkedBlock::firstAtom() && pointer <= alignedPointer + sizeof(IndexingHeader)) tryPointer(alignedPointer - candidate->cellSize()); } static bool isPointerGCObjectJSCell( Heap& heap, TinyBloomFilter filter, const void* pointer) { // It could point to a large allocation. const Vector<LargeAllocation*>& largeAllocations = heap.objectSpace().largeAllocations(); if (!largeAllocations.isEmpty()) { if (largeAllocations[0]->aboveLowerBound(pointer) && largeAllocations.last()->belowUpperBound(pointer)) { LargeAllocation*const* result = approximateBinarySearch<LargeAllocation*const>( largeAllocations.begin(), largeAllocations.size(), LargeAllocation::fromCell(pointer), [] (LargeAllocation*const* ptr) -> LargeAllocation* { return *ptr; }); if (result) { if (result > largeAllocations.begin() && result[-1]->cell() == pointer && result[-1]->attributes().cellKind == HeapCell::JSCell) return true; if (result[0]->cell() == pointer && result[0]->attributes().cellKind == HeapCell::JSCell) return true; if (result + 1 < largeAllocations.end() && result[1]->cell() == pointer && result[1]->attributes().cellKind == HeapCell::JSCell) return true; } } } const HashSet<MarkedBlock*>& set = heap.objectSpace().blocks().set(); MarkedBlock* candidate = MarkedBlock::blockFor(pointer); if (filter.ruleOut(bitwise_cast<Bits>(candidate))) { ASSERT(!candidate || !set.contains(candidate)); return false; } if (!MarkedBlock::isAtomAligned(pointer)) return false; if (!set.contains(candidate)) return false; if (candidate->handle().cellKind() != HeapCell::JSCell) return false; if (!candidate->handle().isLiveCell(pointer)) return false; return true; } static bool isValueGCObject( Heap& heap, TinyBloomFilter filter, JSValue value) { if (!value.isCell()) return false; return isPointerGCObjectJSCell(heap, filter, static_cast<void*>(value.asCell())); } }; } // namespace JSC
48.336842
110
0.606598
[ "object", "vector" ]
71c87ae7ca04e884492d5253dd268b17f7a0ce22
4,673
h
C
CommonTools/ParticleFlow/interface/IsolatedPFCandidateSelectorDefinition.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
CommonTools/ParticleFlow/interface/IsolatedPFCandidateSelectorDefinition.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
CommonTools/ParticleFlow/interface/IsolatedPFCandidateSelectorDefinition.h
ckamtsikis/cmssw
ea19fe642bb7537cbf58451dcf73aa5fd1b66250
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
#ifndef CommonTools_ParticleFlow_IsolatedPFCandidateSelectorDefinition #define CommonTools_ParticleFlow_IsolatedPFCandidateSelectorDefinition #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "CommonTools/ParticleFlow/interface/PFCandidateSelectorDefinition.h" #include "DataFormats/Common/interface/ValueMap.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Utilities/interface/transform.h" namespace pf2pat { class IsolatedPFCandidateSelectorDefinition : public PFCandidateSelectorDefinition { public: typedef edm::ValueMap<double> IsoMap; IsolatedPFCandidateSelectorDefinition(const edm::ParameterSet& cfg, edm::ConsumesCollector&& iC) : isolationValueMapChargedTokens_( edm::vector_transform(cfg.getParameter<std::vector<edm::InputTag> >("isolationValueMapsCharged"), [&](edm::InputTag const& tag) { return iC.consumes<IsoMap>(tag); })), isolationValueMapNeutralTokens_( edm::vector_transform(cfg.getParameter<std::vector<edm::InputTag> >("isolationValueMapsNeutral"), [&](edm::InputTag const& tag) { return iC.consumes<IsoMap>(tag); })), doDeltaBetaCorrection_(cfg.getParameter<bool>("doDeltaBetaCorrection")), deltaBetaIsolationValueMapToken_( iC.mayConsume<IsoMap>(cfg.getParameter<edm::InputTag>("deltaBetaIsolationValueMap"))), deltaBetaFactor_(cfg.getParameter<double>("deltaBetaFactor")), isRelative_(cfg.getParameter<bool>("isRelative")), isolationCut_(cfg.getParameter<double>("isolationCut")) {} void select(const HandleToCollection& hc, const edm::Event& e, const edm::EventSetup& s) { selected_.clear(); // read all charged isolation value maps std::vector<edm::Handle<IsoMap> > isoMapsCharged(isolationValueMapChargedTokens_.size()); for (unsigned iMap = 0; iMap < isolationValueMapChargedTokens_.size(); ++iMap) { e.getByToken(isolationValueMapChargedTokens_[iMap], isoMapsCharged[iMap]); } // read all neutral isolation value maps std::vector<edm::Handle<IsoMap> > isoMapsNeutral(isolationValueMapNeutralTokens_.size()); for (unsigned iMap = 0; iMap < isolationValueMapNeutralTokens_.size(); ++iMap) { e.getByToken(isolationValueMapNeutralTokens_[iMap], isoMapsNeutral[iMap]); } edm::Handle<IsoMap> dBetaH; if (doDeltaBetaCorrection_) { e.getByToken(deltaBetaIsolationValueMapToken_, dBetaH); } unsigned key = 0; for (collection::const_iterator pfc = hc->begin(); pfc != hc->end(); ++pfc, ++key) { reco::PFCandidateRef candidate(hc, key); bool passed = true; double isoSumCharged = 0.0; double isoSumNeutral = 0.0; for (unsigned iMap = 0; iMap < isoMapsCharged.size(); ++iMap) { const IsoMap& isoMap = *(isoMapsCharged[iMap]); double val = isoMap[candidate]; isoSumCharged += val; } for (unsigned iMap = 0; iMap < isoMapsNeutral.size(); ++iMap) { const IsoMap& isoMap = *(isoMapsNeutral[iMap]); double val = isoMap[candidate]; isoSumNeutral += val; } if (doDeltaBetaCorrection_) { const IsoMap& isoMap = *dBetaH; double dBetaVal = isoMap[candidate]; double dBetaCorIsoSumNeutral = isoSumNeutral + deltaBetaFactor_ * dBetaVal; isoSumNeutral = dBetaCorIsoSumNeutral > 0 ? dBetaCorIsoSumNeutral : 0; //follow muon POG definition in 2012 } double isoSum = isoSumCharged + isoSumNeutral; if (isRelative_) { isoSum /= candidate->pt(); } if (isoSum > isolationCut_) { passed = false; } if (passed) { // passed all cuts, selected selected_.push_back(reco::PFCandidate(*pfc)); reco::PFCandidatePtr ptrToMother(hc, key); selected_.back().setSourceCandidatePtr(ptrToMother); } } } private: std::vector<edm::EDGetTokenT<IsoMap> > isolationValueMapChargedTokens_; std::vector<edm::EDGetTokenT<IsoMap> > isolationValueMapNeutralTokens_; bool doDeltaBetaCorrection_; edm::EDGetTokenT<IsoMap> deltaBetaIsolationValueMapToken_; double deltaBetaFactor_; bool isRelative_; double isolationCut_; }; } // namespace pf2pat #endif
41.353982
118
0.679007
[ "vector", "transform" ]
71d0133bb235ec4702db8d7bb6797e18c5625e2e
74,384
h
C
src/Microsoft.DotNet.Wpf/src/WpfGfx/core/geometry/strokefigure.h
txlos/wpf
4004b4e8c8d5c0d5e9de0f1be1fd929c3dee6fa1
[ "MIT" ]
5,937
2018-12-04T16:32:50.000Z
2022-03-31T09:48:37.000Z
src/Microsoft.DotNet.Wpf/src/WpfGfx/core/geometry/strokefigure.h
txlos/wpf
4004b4e8c8d5c0d5e9de0f1be1fd929c3dee6fa1
[ "MIT" ]
4,151
2018-12-04T16:38:19.000Z
2022-03-31T18:41:14.000Z
src/Microsoft.DotNet.Wpf/src/WpfGfx/core/geometry/strokefigure.h
txlos/wpf
4004b4e8c8d5c0d5e9de0f1be1fd929c3dee6fa1
[ "MIT" ]
1,084
2018-12-04T16:24:21.000Z
2022-03-30T13:52:03.000Z
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. //+----------------------------------------------------------------------------- // // // $TAG ENGR // $Module: win_mil_graphics_geometry // $Keywords: // // $Description: // Classes used for stroking a figure // // $ENDTAG // //------------------------------------------------------------------------------ //+----------------------------------------------------------------------------- // // WIDENING DESIGN // // CPen represents the elliptical pen tip. It is instantiated from the // nominal pen and is hooked up with a sink upon construction. It generates // offset points for a given direction and sends them to the sink. CSimplePen // is currently the only derived class of CPen. Additional classes may be // derived in the future for compound lines or for variable width. // // Like CPen, the dash generator supports CPenInterface. The CWiden // instantiates one, hook it to the widener as the widening target, and hook a // CPen for it to call with its flattened segments. // // The pen is defined with a "nominal" circle and possibly a transformation // matrix that maps it to an ellipse. Intuitively, the widened path is the // locus of points defined by the ellipse as it traces out the original path // (the "spine"). This definition is augmented to account for features such // as caps, joins (rounded, mitered or beveled), dashes and gaps. // // In practice, the widened path is constructed from a finite number of // instances of the ellipse, with straight line segments connecting them. // Curved segments on the spine are approximated by polygonal paths augmented // with tangency information for that purpose. // // A vector from the origin to a point on the pen's nominal circle is called // "radius vector". For every spine segment, we compute the radius vector // whose image (under the pen's matrix) is in the direction of that segment. // This vector is used to find the tip of a triangular or round cap on a // segment. The radius vector perpendicular to it is used to find the "offset // points", which are points on the theoretical widened outline. Between them // we draw straight lines, but this is only an approximation of the widened // path. When the widened path is very curved and wide, this is a poor // approximation, and the outline would look jagged. To prevent that, we apply // a (cheap) test to the radius vector of the a new point on a curve and // previous one radius vector. When this test fails, we switch to a different // model, approximating the path with straight segments and rounded corners. // This is an analytical version of the Hobby algorithm. It is not cheap - // that's why reserve it to extreme cases. // //------------------------------------------------------------------------------ // // A pen is considered empty if one of its dimensions is less than tolerance / // 128. Since we are dealing with radii = 1/2 dimensions, we'll approximate // tolerance/256 with tolerance * 0.004. // // I'm not really sure where the 128 comes from. We // should revisit this. // #define EMPTY_PEN_FACTOR 0.004 // // The following is a lower bound on the length of a dash sequence. We are in // device space, so anything smaller than ~1/8 is invisible with antialiasing. // Moreover, the rasterizer becomes quadratic when the number of edges per // sample is > 1. // #define MIN_DASH_ARRAY_LENGTH .1f // // We are implicitly assuming that we are working with a left handed coordinate // system (which is the most common case, with x pointing right and y pointing // down). That's the case with GpPointR.TurnRight(), and say that the path is // turning right when the determinant is positive. The algorithms do not // depend on this assumption. The only effect of a right hand coordinate system // is on the orientation of the resulting path outline: It will go clockwise in // a left handed system and counterclockwise in a right handed one. // enum _RAIL_SIDE { RAIL_LEFT=0, RAIL_RIGHT=1 }; typedef __range(0,1) _RAIL_SIDE RAIL_SIDE; enum _RAIL_TERMINAL { RAIL_START=0, RAIL_END=1 }; typedef __range(0,1) _RAIL_TERMINAL RAIL_TERMINAL; MIL_FORCEINLINE RAIL_SIDE TERMINAL2SIDE(RAIL_TERMINAL x) { return static_cast<RAIL_SIDE>(x); } MIL_FORCEINLINE RAIL_SIDE OPPOSITE_SIDE(RAIL_SIDE x) { return static_cast<RAIL_SIDE>(1-x); } //+----------------------------------------------------------------------------- // // Class: // CMatrix22 // // Synopsis: // Implements a 2x2 matrix class // //------------------------------------------------------------------------------ class CMatrix22 { public: CMatrix22() { Reset(); } CMatrix22( __in_ecount(1) const CMatrix22 &other // In The matrix to copy ); CMatrix22( __in_ecount(1) const CMILMatrix &oMatrix // In: The CMILMatrix to copy from ) : m_rM11(oMatrix.GetM11()), m_rM12(oMatrix.GetM12()), m_rM21(oMatrix.GetM21()), m_rM22(oMatrix.GetM22()) { } ~CMatrix22() {} void Reset(); void CMatrix22::Set( GpReal rM11, // In: The value to set for M11 GpReal rM12, // In: The value to set for M12 GpReal rM21, // In: The value to set for M21 GpReal rM22 // In: The value to set for M22 ); void Prepend( __in_ecount_opt(1) const CMILMatrix *pMatrix ); bool Finalize( GpReal rEmptyThresholdSquared, // Lower bound for |determinant(this)| __out_ecount(1) CMatrix22 &oInverse // The inverse of this matrix ); bool IsIsotropic( __out_ecount(1) GpReal &rSqMax ) const; // Apply the transformation to a vector void Transform( __inout_ecount(1) GpPointR &P ) const; void TransformColumn( __inout_ecount(1) GpPointR &P ) const; void PreFlipX(); HRESULT Invert(); // Return InvalidParameter if not invertable HRESULT GetInverseQuadratic( __out_ecount(1) GpReal &rCxx, // Out: Coefficient of x*x __out_ecount(1) GpReal &rCxy, // Out: Coefficient of x*y __out_ecount(1) GpReal &rCyy // Out: Coefficient of y*y ); protected: // 4 matrix entries GpReal m_rM11; GpReal m_rM12; GpReal m_rM21; GpReal m_rM22; }; //+----------------------------------------------------------------------------- // // Class: // CPenInterface // // Synopsis: // CPenInterface is an abstract class representing a pen or a dasher. It // extends the CFlatteningSink interface. // //------------------------------------------------------------------------------ class CPenInterface : public CFlatteningSink { public: virtual HRESULT StartFigure( __in_ecount(1) const GpPointR &pt, // In: Figure's first point __in_ecount(1) const GpPointR &vec, // In: First segment's (non-zero) direction vector bool fClosed, // In: =true if we're starting a closed figure MilPenCap::Enum eCapType // In: The start cap type )=0; virtual HRESULT DoCorner( __in_ecount(1) const GpPointR &ptCenter, // Corner center point __in_ecount(1) const GpPointR &vecIn, // Vector in the direction coming in __in_ecount(1) const GpPointR &vecOut, // Vector in the direction going out MilLineJoin::Enum eLineJoin, // Corner type bool fSkipped, // =true if this corner straddles a degenerate segment bool fRound, // Enforce rounded corner if true bool fClosing // This is the last corner in a closed figure if true )=0; virtual HRESULT EndStrokeOpen( bool fStarted, // = true if the widening has started __in_ecount(1) const GpPointR &ptEnd, // Figure's endpoint __in_ecount(1) const GpPointR &vecEnd, // Direction vector there MilPenCap::Enum eEndCap, // The type of the end cap MilPenCap::Enum eStartCap=MilPenCap::Flat // The type of start cap (optional) )=0; virtual HRESULT EndStrokeClosed( __in_ecount(1) const GpPointR &ptEnd, // Figure's endpoint __in_ecount(1) const GpPointR &vecEnd // Direction vector there )=0; virtual HRESULT AcceptCurvePoint( __in_ecount(1) const GpPointR &point, // In: The point __in_ecount(1) const GpPointR &vec, // In: The tangent there bool fLast = false // In: Is this the last point on the curve? (optional) )=0; virtual HRESULT AcceptLinePoint( __in_ecount(1) const GpPointR &point // In: The point )=0; // // CFlatteningSink override // // Here is the reason for using different names for the same thing. // CPenInterface distinguishes between points on a line segment and points // on a curve. On line segment the direction is known, and there is no // need for a tangent. On the other hand, ALL the points sent to // CFlatteningSink are on a curve, whether they come with or without // tangents. GetPointOnTangent is called if fWithTangent=true. // CPenInterface happens to need tangents for points that come from a // curve, so the call from the flattener is routed as a point from a curve. // There should be no cost for this routing. // virtual HRESULT AcceptPointAndTangent( __in_ecount(1) const GpPointR &pt, // The point __in_ecount(1) const GpPointR &vec, // The tangent there bool fLast // Is this the last point on the curve? ) { RRETURN(AcceptCurvePoint(pt, vec, fLast)); } virtual bool Aborted()=0; }; //+----------------------------------------------------------------------------- // // Class: // CSegment // // Synopsis: // This class abstracts the concepts of line and cubic curve. A segment // is a parametric mapping C(t) from the interval [0,1] to the plane. For // a line the mapping is C(t) = P + t*V, where P is a point and V is a // vector. For a cubic curve the mapping is C(t) = C0 + C1*t + C[2]*t^2 + // C[3]*t^3. where C[i] are 2D coefficients. // //------------------------------------------------------------------------------ class CSegment { public: CSegment() {} virtual ~CSegment() {} virtual HRESULT Widen( __out_ecount(1) GpPointR &ptEnd, // End point __out_ecount(1) GpPointR &vecEnd // End direction vector )=0; virtual HRESULT GetFirstTangent( __out_ecount(1) GpPointR &vecTangent // Out: Nonzero direction vector ) const=0; // No data }; // End of definition of the class CSegment MtExtern(CLineSegment); //+----------------------------------------------------------------------------- // // Class: // CLineSegment // // Synopsis: // Representation of a line segment. // //------------------------------------------------------------------------------ class CLineSegment : public CSegment { public: CLineSegment() { m_rFuzz = MIN_TOLERANCE * SQ_LENGTH_FUZZ; m_pTarget = NULL; } CLineSegment( GpReal rTolerance // Widening tolerance ) { m_pTarget = NULL; m_rFuzz = rTolerance * SQ_LENGTH_FUZZ; } virtual ~CLineSegment() {} DECLARE_METERHEAP_ALLOC(ProcessHeap, Mt(CLineSegment)); void SetTarget( __in_ecount_opt(1) CPenInterface *pTarget ) { m_pTarget = pTarget; } void Set( double rStart, // Start parameter double rEnd, // End parameter __inout_ecount(1) GpPointR &ptFirst, // First point, transformed, possibly modified here __in_ecount(1) const MilPoint2F &ptLast, // Last point (raw) __in_ecount_opt(1) const CMILMatrix *pMatrix // Transformation matrix (NULL OK) ); virtual HRESULT Widen( __out_ecount(1) GpPointR &ptEnd, // End point __out_ecount(1) GpPointR &vecEnd // End direction vector ); virtual HRESULT GetFirstTangent( __out_ecount(1) GpPointR &vecTangent // Nonzero direction vector ) const; // Data protected: GpPointR m_ptEnd; // End point GpPointR m_vecDirection; // Direction vector GpReal m_rFuzz; // Zero length fuzz CPenInterface *m_pTarget; // The widening target }; // End of definition of the class CLineSegment //+----------------------------------------------------------------------------- // // Class: // CCubicSegment // // Synopsis: // Representation of a cubic Bezier segment. // //------------------------------------------------------------------------------ class CCubicSegment : public CSegment { public: CCubicSegment() : m_oBezier(NULL, MIN_TOLERANCE) { } CCubicSegment( GpReal rTolerance // Widening tolerance ) : m_oBezier(NULL, rTolerance) { } virtual ~CCubicSegment() {} void SetTarget( __in_ecount_opt(1) CPenInterface *pTarget ) { m_oBezier.SetTarget(pTarget); } void Set( double rStart, // Start parameter double rEnd, // End parameter __inout_ecount(1) GpPointR &ptFirst, // First point, transformed, possibly modified here __in_ecount(3) const MilPoint2F *ppt, // The rest of the points (raw) __in_ecount_opt(1) const CMILMatrix *pMatrix // Transformation matrix (NULL OK) ); virtual HRESULT Widen( __out_ecount(1) GpPointR &ptEnd, // End point __out_ecount(1) GpPointR &vecEnd // End direction vector ); virtual HRESULT GetFirstTangent( __out_ecount(1) GpPointR &vecTangent // Tangent vector there ) const { return m_oBezier.GetFirstTangent(vecTangent); } // Data protected: CMILBezierFlattener m_oBezier; }; // End of definition of the class CCubicSegment //+----------------------------------------------------------------------------- // // Class: // CPen // // Synopsis: // Implements an (undashed) pen. // //------------------------------------------------------------------------------ class CPen : public CPenInterface { // Construction/destruction public: CPen(); virtual ~CPen() {} bool Set( __in_ecount(1) const CPenGeometry &geom, // In: The pen's geometry information __in_ecount_opt(1) const CMILMatrix *pMatrix, // In: W to D transformation matrix (NULL OK) GpReal rTolerance, // In: Ignored here __in_ecount_opt(1) const MilRectF *prcViewableInflated // In: Viewable region (inflated by stroke properties) (NULL okay) ); void Copy( __in_ecount(1) const CPen &pen // A pen to copy basic properties from ); HRESULT UpdateOffset( __in_ecount(1) const GpPointR &vecDirection // In: A nonzero direction vector ); GpReal GetRadius() const { return m_rRadius; } void GetSqWidth( __in_ecount(1) const GpPointR &vec, // In: Direction vector __out_ecount(1) GpReal &rNum, // In: The result's numerator __out_ecount(1) GpReal &rDenom // In: The result's denominator ) const; HRESULT ComputeRadiusVector( // Return InvalidParameter if vecDirection=0 __in_ecount(1) const GpPointR &vecDirection, // In: A not necessarily unit vector __out_ecount(1) GpPointR &vecRad // Out: Radius vector on the pen circle ) const; void SetRadiusVector( __in_ecount(1) const GpPointR &vecRad // In: A Given radius vector ); virtual HRESULT AcceptCurvePoint( __in_ecount(1) const GpPointR &point, // In: The point __in_ecount(1) const GpPointR &vec, // In: The tangent there bool fLast = false // In: Is this the last point on the curve? ); virtual HRESULT RoundTo( __in_ecount(1) const GpPointR &vecRad, // In: Radius vector of the outgoing segment __in_ecount(1) const GpPointR &ptCenter, // In: Corner center point __in_ecount(1) const GpPointR &vecIn, // In: Vector in the direction coming in __in_ecount(1) const GpPointR &vecOut // In: Vector in the direction going out )=0; protected: bool SetPenShape( __in_ecount(1) const CPenGeometry &geom, // The pen's geometry information __in_ecount_opt(1) const CMILMatrix *pMatrix, // Render transform (NULL OK) GpReal rTolerance // Approximation tolerance ); static GpReal ComputeRefinementThreshold( GpReal rMaxRadiusBound, // Bound on the maximum radius of the pen GpReal rTolerance // Approximation tolerance ); void GetOffsetVector( __in_ecount(1) const GpPointR &vecRad, // In: A radius vector __out_ecount(1) GpPointR &vecOffset // Out: The corresponding offset vector ) const; GpPointR GetPenVector( __in_ecount(1) const GpPointR &vecRad // In: A radius vector ) const; bool GetTurningInfo( __in_ecount(1) const GpPointR &vecIn, // In: Vector in the direction comin in __in_ecount(1) const GpPointR &vecOut, // In: Vector in the direction going out __out_ecount(1) GpReal &rDet, // Out: The determinant of the vectors __out_ecount(1) GpReal &rDot, // Out: The dot product of the vectors __out_ecount(1) RAIL_SIDE &side, // The outer side of the turn __out_ecount(1) bool &f180Degrees // Out: =true if this is a 180 degrees turn ) const; virtual HRESULT ProcessCurvePoint( __in_ecount(1) const GpPointR &point, // In: Point to draw to __in_ecount(1) const GpPointR &vecSeg // In: Direction of segment )=0; protected: // Nominal pen data MilLineJoin::Enum m_eLineJoin; // Line join style (TO DO: Do we need this?) // Derived data - fixed CMatrix22 m_oMatrix; // Pen's transformation matrix CMatrix22 m_oInverse; // Inverse of m_oMatrix CMatrix22 m_oWToDMatrix; // The world to device matrix (ignoring translation) GpReal m_rRadius; // Radius in pen coordinate space GpReal m_rRadSquared; // The above squared GpReal m_rNominalMiterLimit; // Nominal API miter limit GpReal m_rMiterLimit; // Miter limit multiplied by radius GpReal m_rMiterLimitSquared; // The above squared GpReal m_rRefinementThreshold; // Stroke outline refinement threshold bool m_fCircular; // =true if the pen is circular bool m_fViewableSpecified; // =true m_rcViewableInflated should be used. CMilRectF m_rcViewableInflated; // The clip rect (if any), inflated to account for // stroke width, miter-limit, dash/line caps. // Working variable data GpPointR m_vecRad; // Current radius vector GpPointR m_vecOffset; // Current offset vector GpPointR m_ptPrev; // Previous point GpPointR m_vecPrev; // Previous tangent vector }; MtExtern(CSimplePen); //+----------------------------------------------------------------------------- // // Class: // CSimplePen // // Synopsis: // Implements an (undashed, simple) pen. // // Notes: // The alternative is a (speced, but not implemented) complex pen, which // would allow multiple "prongs" on the pen (like a rake). // // Some of the methods should be pushed up to the base class CPen. // //------------------------------------------------------------------------------ class CSimplePen : public CPen { public: CSimplePen() : m_pSink(NULL) { } bool Initialize( __in_ecount(1) const CPenGeometry &geom, // In: The pen's geometry information __in_ecount(1) const CMILMatrix *pMatrix, // In: W to D transformation matrix (NULL OK) GpReal rTolerance, // In: Ignored here __in_ecount_opt(1) const MilRectF *prcViewableInflated, // In: The viewableregion __inout_ecount(1) CWideningSink *pSink // In/out: The recipient of the results ) { m_pSink = pSink; return Set(geom, pMatrix, rTolerance, prcViewableInflated); } // Constructor for stroking line shapes virtual ~CSimplePen() {} void SetFrom( __in_ecount(1) const CPen &pen, // A pen to inherit some properties from __in_ecount(1) CWideningSink *pSink // The recipient of the results ) { Copy(pen); m_pSink = pSink; } // CPenInterface override HRESULT StartFigure( __in_ecount(1) const GpPointR &pt, // In: Figure's firts point __in_ecount(1) const GpPointR &vec, // In: First segment's (non-zero) direction vector bool fClosed, // In: =true if we're starting a closed figure MilPenCap::Enum eCapType // In: The start cap type ); virtual HRESULT DoCorner( __in_ecount(1) const GpPointR &ptCenter, // Corner center point __in_ecount(1) const GpPointR &vecIn, // Vector in the direction comin in __in_ecount(1) const GpPointR &vecOut, // Vector in the direction going out MilLineJoin::Enum eLineJoin, // Corner type bool fSkipped, // =true if this corner straddles a degenerate segment bool fRound, // Enforce rounded corner if true bool fClosing // This is the last corner in a closed figure if true ); virtual HRESULT EndStrokeOpen( bool fStarted, // = true if the widening has started __in_ecount(1) const GpPointR &ptEnd, // Figure's endpoint __in_ecount(1) const GpPointR &vecEnd, // Direction vector there MilPenCap::Enum eEndCap, // The type of the end cap MilPenCap::Enum eStartCap=MilPenCap::Flat // The type of start cap (optional) ); virtual HRESULT EndStrokeClosed( __in_ecount(1) const GpPointR &ptEnd, // Figure's endpoint __in_ecount(1) const GpPointR &vecEnd // Direction vector there ); HRESULT AcceptLinePoint( __in_ecount(1) const GpPointR &point // In: Point to stop the pen at ); virtual HRESULT RoundTo( __in_ecount(1) const GpPointR &vecRad, // In: Radius vector of the outgoing segment __in_ecount(1) const GpPointR &ptCenter, // In: Corner center point __in_ecount(1) const GpPointR &vecIn, // In: Vector in the direction comin in __in_ecount(1) const GpPointR &vecOut // In: Vector in the direction going out ); virtual bool Aborted(); protected: // CPen overrides HRESULT ProcessCurvePoint( __in_ecount(1) const GpPointR &point, // In: Point to draw to __in_ecount(1) const GpPointR &vecSeg // In: Direction of segment we're coming along ); // Private methods HRESULT DoInnerCorner( RAIL_SIDE side, // In: The side of the inner corner __in_ecount(1) const GpPointR &ptCenter, // In: The corner's center const GpPointR *ptOffset // In: The offset points of the new segment ); HRESULT DoBaseCap( RAIL_TERMINAL whichEnd, // In: START or END __in_ecount(1) const GpPointR &ptCenter, // In: Cap's center __in_ecount(1) const GpPointR &vec, // In: Vector pointing out along the segment MilPenCap::Enum type // In: The type of cap ); HRESULT DoSquareCap( RAIL_TERMINAL whichEnd, // START or END __in_ecount(1) const GpPointR &ptCenter // Cap's center ); HRESULT DoRoundCap( RAIL_TERMINAL whichEnd, // In: START or END __in_ecount(1) const GpPointR &ptCenter // In: Cap's center ); bool GetMiterPoint( __in_ecount(1) const GpPointR &vecRad, // In: Radius vector for the outgoing segment GpReal rDet, // In: The determinant of vecIn and vecOut __in_ecount(1) const GpPointR &ptIn, // In: Offset point of the incoming segment __in_ecount(1) const GpPointR &vecIn, // In: Vector in the direction comin in __in_ecount(1) const GpPointR &ptNext, // In: Offset point of the outgoing segment __in_ecount(1) const GpPointR &vecOut, // In: Vector in the direction going out __out_ecount(1) GpReal &rDot, // Out: The dot product of the 2 radius vectors __out_ecount(1) GpPointR &ptMiter // Out: The outer miter point, if within limit ); HRESULT DoLimitedMiter( __in_ecount(1) const GpPointR &ptIn, // In: Outer offset of incoming segment __in_ecount(1) const GpPointR &ptNext, // In: Outer offset of outgoing segment GpReal rDot, // In: -(m_vecRad * vecRadNext) __in_ecount(1) const GpPointR &vecRadNext, // In: Radius vector of outgoing segment RAIL_SIDE side // In: Turn's outer side, RAIL_LEFT or RAIL_RIGHT ); HRESULT Do180DegreesMiter(); HRESULT BevelCorner( RAIL_SIDE side, // In: The side of the outer corner __in_ecount(1) const GpPointR &ptNext // In: The bevel's endpoint ); HRESULT RoundCorner( __in_ecount(1) const GpPointR &ptCenter, // In: Corner point on the spine __in_ecount(1) const GpPointR &ptIn, // In: Outer offset points of incoming segment __in_ecount(1) const GpPointR &ptNext, // In: Outer offset points of outgoing segment __in_ecount(1) const GpPointR &vecRad, // In: New value of m_vecRad RAIL_SIDE side // In: Side to be rounded, RAIL_LEFT or RAIL_RIGHT ); HRESULT SetCurrentPoints( __in_ecount(1) const GpPointR &ptLeft, // In: Left point __in_ecount(1) const GpPointR &ptRight // In: Right point ); HRESULT MiterTo( RAIL_SIDE side, // Which side to set the point __in_ecount(1) const GpPointR &ptMiter, // Miter corner __in_ecount(1) const GpPointR &ptNextStart, // The starting point of the next segment's offset bool fExtended // Extend all the way to ptNextStart if true ); // Data protected: CWideningSink *m_pSink; // The sink that accepts the results GpPointR m_ptCurrent[2]; // The current left & right points }; //+----------------------------------------------------------------------------- // // Class: // CDasher // // Synopsis: // Adapter to a CPen that provides dashing functionality. // // Notes: // // DASHED LINES DESIGN // // There are several widening scenarios. The following crude diagrams // depict the flow of information: // // Simple pen without dashes: CWidener --> CSimplePen --> CWideningSink // // Simple pen with dashes: CWidener --> CDasher --> CSimplePen --> // CWideningSink // // Glossary An EDGE is a smooth piece of the figure between corners or // start and end. The edge is a sequence of SEGMENTS. If the edge is a // straight line then it comprises one segment. If it is a curve then the // segments are the result of its flattening. // // CDasher accumulates segments with the information needed for widening // and accumulated length. At every corner (between edges) and at the // figure end, the Dasher flushes the segments buffer and sends the dashes // to the pen to draw. // // The buffer must contain all the information needed for the pen at flush // time, so we record points, tangents, and a flag indicating whether the // segment came from a line segment (rather than from curve flattening) // // If the figure is closed then the first dash may have to be the second // half of the last dash. So if it starts on a dash, we'll start it with // a flat cap. After the last dash we'll do the corner (between figure // end and start) and exit with a flat cap, that will abut with the flat // cap of the first dash. If there is no end dash then we'll append a // 0-length segment with the right cap. // // Some of the functionality of CDasher is delegated to its class members // CSegments, capturing the data and behavior of the segments buffer, and // CDashSequence, encapsulating the dash sequence. // // We dash one edge at a time. We try to dash it in a synchronized mode, // i.e. always ending at the same point (=DashOffset) in the dash // sequence. For that we tweak the sequence length. But if the edge is // substantially shorter than one full instance then we dash in // unsynchronized mode. For the canned dash styles the offset is set to // half the first dash. // //------------------------------------------------------------------------------ class CDasher : public CPenInterface { // Disallow instantiation without a pen private: CDasher() : m_pPen(NULL) { } public: CDasher( __in_ecount(1) CPen *pPen // In: The internal widening pen ); virtual ~CDasher() { } HRESULT Initialize( __in_ecount(1) const CPlainPen &pen, // In: The pen we stroke with __in_ecount_opt(1) CMILMatrix const *pMatrix, // In: Render transform (NULL OK) __in_ecount_opt(1) const MilRectF *prcViewableInflated // In: The viewable region, inflated by the stroke properties (NULL // OK) ); // CPenInterface override virtual HRESULT StartFigure( __in_ecount(1) const GpPointR &pt, // In: Figure's firts point __in_ecount(1) const GpPointR &vec, // In: First segment's (non-zero) direction vector bool fClosed, // In: =true if we're starting a closed figure MilPenCap::Enum eCapType // In: The start cap type ); virtual HRESULT AcceptLinePoint( __in_ecount(1) const GpPointR &point // In: Point to draw to ); virtual HRESULT AcceptCurvePoint( __in_ecount(1) const GpPointR &point, // In: The point __in_ecount(1) const GpPointR &vec, // In: The tangent there bool fLast // In: Is this the last point on the curve? ); virtual HRESULT DoCorner( __in_ecount(1) const GpPointR &ptCenter, // Corner center point __in_ecount(1) const GpPointR &vecIn, // Vector in the direction comin in __in_ecount(1) const GpPointR &vecOut, // Vector in the direction going out MilLineJoin::Enum eLineJoin, // Corner type bool fSkipped, // =true if this corner straddles a degenerate segment bool fRound, // Enforce rounded corner if true bool fClosing // This is the last corner in a closed figure if true ); virtual HRESULT EndStrokeOpen( bool fStarted, // = true if the widening has started __in_ecount(1) const GpPointR &ptEnd, // Figure's endpoint __in_ecount(1) const GpPointR &vecEnd, // Direction vector there MilPenCap::Enum eEndCap, // The type of the end cap MilPenCap::Enum eStartCap=MilPenCap::Flat // The type of start cap (optional) ); virtual HRESULT EndStrokeClosed( __in_ecount(1) const GpPointR &ptEnd, // Figure's endpoint __in_ecount(1) const GpPointR &vecEnd // Direction vector there ); virtual bool Aborted() { return m_pPen->Aborted(); } protected: // Private methods HRESULT StartANewDash( GpReal rLoc, // In: The location GpReal rWorldSpaceLength, // In: The dash's length in world-space bool fAtVertex // In: =true if we're at a segment start or end ); HRESULT ExtendCurrentDash( GpReal rLoc, // In: The location bool fAtVertex // In: =true if we're at a segment start or end ); HRESULT TerminateCurrentDash( GpReal rLoc, // In: The location bool fAtVertex // In: =true if we're at a segment start or end ); HRESULT Flush( bool fLastEdge // =true if this is the figure's last edge ); HRESULT DoDashOrGapEndAtEdgeEnd( bool fLastEdge, // =true if this is the figure's last edge bool fIsOnDash // =true if we are on a dash ); //+----------------------------------------------------------------------------- // // Struct: // CDasher::CSegData // // Synopsis: // Stores information about a given segment. // //------------------------------------------------------------------------------ class CSegData { public: CSegData() : m_rLocation(0), m_fIsALine(false) { } CSegData( bool fIsALine, // In: =true if this is a line segment __in_ecount(1) const GpPointR &ptEnd, // In: Segment endpoint __in_ecount(1) const GpPointR &vecTangent, // In: The tangent vector there __in_ecount(1) const GpPointR &vecSeg, // In: The segment direction unit vector GpReal rLocation, // In: Accummulated length so far GpReal rDashScaleFactor, // In: Amount by which dashes will be scaled along this segment bool fBezierEnd // In: True if this is the last segment on a Bezier ); // Really a data structure, not a class, so data is left public GpPointR m_ptEnd; // The segment endpoint GpPointR m_vecTangent; // Tangent vector there GpPointR m_vecSeg; // The segment direction unit vector GpReal m_rLocation; // Accummulated length to this point GpReal m_rDashScaleFactor;// Amount by which dashes will // be scaled along this segment bool m_fIsALine; // =true if this is a line segment bool m_fBezierEnd; // =true if this the last segment in a Bezier }; //+----------------------------------------------------------------------------- // // Class: // CDasher::CSegments // // Synopsis: // Stores the yet-to-be processed segments. // //------------------------------------------------------------------------------ class CSegments { public: CSegments() : m_uCurrentSegment(1), m_rCxx(1), m_rCxy(0), m_rCyy(1) {} HRESULT Initialize( __in_ecount_opt(1) const CMILMatrix *pMatrix // In: Transformation matrix (NULL OK) ); HRESULT StartWith( __in_ecount(1) const GpPointR &ptStart, // In: Starting point __in_ecount(1) const GpPointR &vecTangent // In: The tangent vector there ); HRESULT Add( __in_ecount(1) const GpPointR &ptEnd, // In: Segment endpoint __in_ecount_opt(1) const GpPointR *pTangent=NULL, // Optional: Tangent vector there bool fBezierEnd=false // Optional: true if this is the last segment on a Bezier ); GpReal GetLength() const { return m_rgSegments.Last().m_rLocation; } bool IsAtALine() const { return m_rgSegments[m_uCurrentSegment].m_fIsALine; } bool IsAtBezierEnd() const { return m_rgSegments[m_uCurrentSegment].m_fBezierEnd; } bool IsLast() const { return m_rgSegments.GetCount() - 1 == m_uCurrentSegment; } bool IsEmpty() const { // The first entry is just the starting point. return m_rgSegments.GetCount() < 2; } GpReal GetCurrentEnd() const { return m_rgSegments[m_uCurrentSegment].m_rLocation; } GpReal GetCurrentDashScaleFactor() const { return m_rgSegments[m_uCurrentSegment].m_rDashScaleFactor; } GpPointR GetCurrentDirection() const { return m_rgSegments[m_uCurrentSegment].m_vecTangent; } bool Increment() { m_uCurrentSegment++; return m_uCurrentSegment >= m_rgSegments.GetCount(); } void Reset(); void ProbeAt( GpReal rLoc, // In: The location (lengthwise) to probe at __out_ecount(1) GpPointR &pt, // Out: Point there __out_ecount(1) GpPointR &vecTangent, // Out: Tangent vector at segment end bool fAtSegEnd // In: At segment end if true ) const; protected: // Data UINT m_uCurrentSegment; // Current segment index DynArrayIA<CSegData, 16> m_rgSegments; // Segments buffer // The first entry is the first segment's start // Coefficients of the pre-transform length quadratic form GpReal m_rCxx; // Coefficient of x*x GpReal m_rCxy; // Coefficient of x*y GpReal m_rCyy; // Coefficient of y*y }; //+----------------------------------------------------------------------------- // // Class: // CDasher::CDashSequence // // Synopsis: // Stores the sequence of dashes to apply to the stroke. // // Notes: // All APIs take arguments in edge space (edge space records how far we // have travelled along an edge). Internally, all our computations are // done in dash space (how far along in the dash array we are). Note that // dash space is calculated modulo the length of the dash array, so in // order to convert from dash space to edge space we have to keep track of // how many times we've iterated over the dash array // (m_uCurrentIteration). // //------------------------------------------------------------------------------ class CDashSequence { public: // Constructor CDashSequence(); HRESULT Initialize( __in_ecount(1) const CPlainPen &pen // In: The nominal pen ); bool IsOnDash() const { return 0 != (m_uCurrentDash & 1); } GpReal GetStep() const { return m_rgDashes[m_uCurrentDash] - m_rCurrentLoc; } GpReal GetNextEndpoint() const { return DashToEdgeSpace(m_rgDashes[m_uCurrentDash]); } void PrepareForNewEdge() { // Should be checked at ::Set, otherwise flushing an edge may result // in an infinite loop. Assert(2 * m_rLength >= MIN_DASH_ARRAY_LENGTH); m_uCurrentIteration = 0; m_rEdgeSpace0 = m_rCurrentLoc; } void Reset(); void AdvanceTo( GpReal rEdgeSpaceLoc // New location (in edge space) ) { m_rCurrentLoc = EdgeToDashSpace(rEdgeSpaceLoc); // // Future Consideration: Ideally, we should be able to assert // that m_rCurrentLoc <= m_rgDashes[m_uCurrentDash], but this isn't // necessarily true, since floating point error can cause this // class and CDasher::Flush to get out of sync (in particular, // m_rInverseFactor is computed using only single precision). This // is no biggie, though, since this just means that the dash will // be a little longer than it should be. Still, it'd be nice to // clean up this inconsistency. // } void Increment(); GpReal GetLengthOfNextDash() const { UINT iStart; if (m_uCurrentDash == m_rgDashes.GetCount() - 1) { iStart = 0; } else { iStart = m_uCurrentDash; } return m_rgDashes[iStart+1] - m_rgDashes[iStart]; } protected: GpReal DashToEdgeSpace(GpReal rDashSpaceLoc) const { // // If the dash array has very long dashes, it's easy to get NaNs, // even though the behavior may be well-defined. To guard against // this, we special case the m_uCurrentIteration == 0 case. // if (m_uCurrentIteration == 0) { return rDashSpaceLoc - m_rEdgeSpace0; } else { return rDashSpaceLoc - m_rEdgeSpace0 + m_uCurrentIteration * m_rLength; } } GpReal EdgeToDashSpace(GpReal rEdgeSpaceLoc) const { // // If the dash array has very long dashes, it's easy to get NaNs, // even though the behavior may be well-defined. To guard against // this, we special case the m_uCurrentIteration == 0 case. // if (m_uCurrentIteration == 0) { return rEdgeSpaceLoc + m_rEdgeSpace0; } else { return rEdgeSpaceLoc - m_uCurrentIteration * m_rLength + m_rEdgeSpace0; } } protected: // Data UINT m_uCurrentDash; // Current dash/space end index UINT m_uCurrentIteration; // Number of times we've wrapped around since // the last call to PrepareForNewEdge() GpReal m_rCurrentLoc; // Current location in the dash sequence // (in dash coordinates) GpReal m_rEdgeSpace0; // The value of m_rCurrentLoc at the time // of the last PrepareForNewEdge() GpReal m_rLength; // Sequence's total length UINT m_uStartDash; // The dash/space where the dash sequence starts DynArrayIA<GpReal, 16> m_rgDashes; // Dash/space ends array }; // Data CSegments m_oSegments; // Segments buffer CDashSequence m_oDashes; // The dash sequence CPen *m_pPen; // The widening pen CMilRectF m_rcViewableInflated; // The viewable bounds (if any), inflated to account for // stroke width, miter-limit, dash/line caps. bool m_fViewableSpecified; // =true m_rcViewableInflated should be used. MilPenCap::Enum m_eDashCap; // Dash cap bool m_fIsPenDown; // =true when we're on a dash bool m_fIsFirstCapPending; // =true if the first cap is yet to be set bool m_fIgnoreDash; // =true Dash creation instructions should be ignored. }; //+----------------------------------------------------------------------------- // // Class: // CWidener // // Synopsis: // Generates a figure that approximates the stroke of a pen along a // figure. // //------------------------------------------------------------------------------ class CWidener { public: CWidener( GpReal rTolerance = MIN_TOLERANCE // In: Approximation tolerance ); HRESULT Initialize( __in_ecount(1) const CPlainPen &pen, // The stroking pen __in_ecount(1) CWideningSink *pSink, // The widening sink __in_ecount_opt(1) const CMILMatrix *pMatrix, // Render transform (NULL OK) __in_ecount_opt(1) const CMILSurfaceRect *prcViewable, // The viewable region (NULL OK) __out_ecount(1) bool &fEmpty // The pen is empty if true ); bool SetSegmentForWidening( __in_ecount(1) const IFigureData &oFigure, // The figure __inout_ecount(1) GpPointR &ptFirst, // First point, transformed, possibly modified here __in_ecount_opt(1) const CMILMatrix *pMatrix // Transformation matrix (NULL OK) ) const; HRESULT Widen( __in_ecount(1) const IFigureData &oFigure, // The figure __in_ecount_opt(1) CStartMarker *pStartMarker, // Start shape marker (NULL OK) __in_ecount_opt(1) CEndMarker *pEndMarker // End shape marker (NULL OK) ) const; HRESULT WidenClosedFigure( __in_ecount(1) const IFigureData &oFigure // The figure ) const; HRESULT WidenOpenFigure( __in_ecount(1) const IFigureData &oFigure, // The figure __in_ecount_opt(1) CStartMarker *pStartMarker, // Start shape marker (NULL OK) __in_ecount_opt(1) CEndMarker *pEndMarker // End shape marker (NULL OK) ) const; HRESULT DoGap( __in_ecount(1) const IFigureData &oFigure // The figure ) const; HRESULT DoSegment( __in_ecount(1) const IFigureData &oFigure // The figure ) const; HRESULT SetForLineShape( __in_ecount(1) const CWidener &other, // The widener used for of the path to which the line shape is attached __in_ecount(1) const CLineShape &shape, // The line shape we're attaching __in_ecount(1) CWideningSink *pSink, // The widening sink __out_ecount(1) bool &fEmpty // =true if the pen is empty ); HRESULT WidenLineShape( __in_ecount(1) const CShape &shape, // The widened shape __in_ecount_opt(1) const CMILMatrix *pMatrix // The positioning matrix ); __out_ecount(1) const CPen &GetPen() const { return m_pen; } void SetTarget( __in_ecount_opt(1) CPenInterface *pTarget ) { m_pTarget = pTarget; m_oLine.SetTarget(m_pTarget); m_oCubic.SetTarget(m_pTarget); } protected: HRESULT GetViewableInflated( __in_ecount(1) const CMILSurfaceRect *prcViewable, // The viewable region __in_ecount(1) const CPlainPen &pen, // The stroking pen __in_ecount_opt(1) const CMILMatrix *pMatrix, // Transformation matrix (NULL OK) __out_ecount(1) CMilRectF *prcViewableInflated // The viewable region, inflated by the stroke properties ) { HRESULT hr = S_OK; float pad; IFC(pen.GetExtents(OUT pad)); { CMilPoint2F padVector(pad, pad); if (pMatrix) { pMatrix->TransformAsVectors(&padVector, &padVector, 1 /* one vector */); padVector.X = fabs(padVector.X); padVector.Y = fabs(padVector.Y); } prcViewableInflated->left = static_cast<FLOAT>(prcViewable->left) - padVector.X; prcViewableInflated->right = static_cast<FLOAT>(prcViewable->right) + padVector.X; prcViewableInflated->top = static_cast<FLOAT>(prcViewable->top) - padVector.Y; prcViewableInflated->bottom = static_cast<FLOAT>(prcViewable->bottom) + padVector.Y; } Cleanup: RRETURN(hr); } // Data protected: // // Fixed data members, set for the life of the widener, which is one call // of CShapeBase::WidenToSink // const CMILMatrix *m_pMatrix; // Transformation matrix GpReal m_rTolerance; // Approximation tolerance // // The caps seem to duplicate the pen's start/end cap settings, but the // widener's target may be dasher. In that case, the pen's caps will vary // between original start/end cap and dash cap. So here we keep track of // the original cap types // MilPenCap::Enum m_eStartCap; // Start cap style MilPenCap::Enum m_eEndCap; // End cap style MilPenCap::Enum m_eDashCap; // Dash cap style MilLineJoin::Enum m_eLineJoin; // Line join style CSimplePen m_pen; // Widening pen CDasher m_dasher; CPenInterface *m_pTarget; // Pen or Dasher // // Working variables // Fixed for the duration of a figure // mutable GpPointR m_vecStart; // Figure's start direction vector mutable GpPointR m_ptStart; // Figure's first point mutable GpReal m_rStartTrim; // Trim parameter at figure start mutable GpReal m_rEndTrim; // Trim parameter at figure end // // Changing between segments // mutable GpPointR m_vecIn; // Corner incoming direction vector mutable GpPointR m_vecOut; // Corner outgoing direction vector mutable GpPointR m_pt; // Current point mutable bool m_fShouldPenBeDown; // =true when we should be drawing mutable bool m_fIsPenDown; // =true when we are actually drawing mutable bool m_fClosed; // =true if widened as a closed figure mutable bool m_fSkipped; // =true if recent degenerate segment was skipped mutable bool m_fSkippedFirst;// =true if first degenerate segment was skipped mutable MilPenCap::Enum m_eCap; // Current start-cap style (may be dash style by gaps) mutable bool m_fNeedToRecordStart; // =true if we need to record the first point and vector mutable bool m_fSmoothJoin; // =true if the join is known to be smooth // // The data of the current segment, set for widening // mutable CLineSegment m_oLine; // Line segment data mutable CCubicSegment m_oCubic; // Cubic curve data mutable CSegment *m_pSegment; // The current choice between the above }; MtExtern(CRail); //+----------------------------------------------------------------------------- // // Class: // CRail // // Synopsis: // Stores edges belonging to one of the two "rails" (inner or outer) // belonging to the outline of the stroke. // //------------------------------------------------------------------------------ class CRail : public CFigureData { public: // Constructor/destructor CRail() {} virtual ~CRail(){} DECLARE_METERHEAP_ALLOC(ProcessHeap, Mt(CRail)); // Methods HRESULT ExtendTo( __in_ecount(1) const GpPointR &ptTo, // The target point __in_ecount(1) const GpPointR &vec, // The direction vector to test against __in_ecount(1) const GpPointR &pt1, // First point to draw to in case of gap __in_ecount(1) const GpPointR &pt2, // Second point to draw to in case of gap __in_ecount(1) const GpPointR &pt3, // Third point to draw to in case of gap __inout_ecount(1) CShape &shape // Shape we are widening to ); HRESULT SetCurrentPoint( __in_ecount(1) const GpPointR &P // In: The point to set to ); HRESULT ReverseJoin( __in_ecount(1) const CRail &other // In: The rail to concatinate ); }; //+----------------------------------------------------------------------------- // // Class: // CShapeWideningSink // // Synopsis: // CWideningSink abstracts the recipient of the results of path widening. // The various implementations support generating the outline path, // computing bounds and hit testing // //------------------------------------------------------------------------------ class CWideningSink { public: CWideningSink() {} virtual ~CWideningSink() {} virtual HRESULT StartWith( __in_ecount(2) const GpPointR *ptOffset // Left and right offset points )=0; virtual HRESULT QuadTo( __in_ecount(2) const GpPointR *ptOffset // In: Left & right offset points )=0; virtual HRESULT QuadTo( __in_ecount(2) const GpPointR *ptOffset, // Left & right offset points thereof __in_ecount(1) const GpPointR &vecSeg, // Segment direction we're coming from __in_ecount(1) const GpPointR &ptSpine, // The corresponding point on the stroke's spine __in_ecount(1) const GpPointR &ptSpinePrev // The previous point on the stroke's spine )=0; virtual HRESULT CurveWedge( RAIL_SIDE side, // Which side to add to __in_ecount(1) const GpPointR &ptBez_1, // First control point __in_ecount(1) const GpPointR &ptBez_2, // Second control point __in_ecount(1) const GpPointR &ptBez_3 // Last point )=0; virtual HRESULT BezierCap( __in_ecount(1) const GpPointR &ptStart, // The cap's first point, __in_ecount(1) const GpPointR &pt0_1, // First arc's first control point __in_ecount(1) const GpPointR &pt0_2, // First arc's second control point __in_ecount(1) const GpPointR &ptMid, // The point separating the 2 arcs __in_ecount(1) const GpPointR &pt1_1, // Second arc's first control point __in_ecount(1) const GpPointR &pt1_2, // Second arc's second control point __in_ecount(1) const GpPointR &ptEnd // The cap's last point )=0; virtual HRESULT SetCurrentPoints( __in_ecount(2) const GpPointR *P // In: Array of 2 points )=0; virtual HRESULT DoInnerCorner( RAIL_SIDE side, // In: The side of the inner corner __in_ecount(1) const GpPointR &ptCenter, // In: The corner's center __in_ecount(2) const GpPointR *ptOffset // In: The offset points of new segment )=0; virtual HRESULT CapTriangle( __in_ecount(1) const GpPointR &ptStart, // Triangle base start point __in_ecount(1) const GpPointR &ptApex, // Triangle's apex __in_ecount(1) const GpPointR &ptEnd // Triangle base end point )=0; virtual HRESULT CapFlat( __in_ecount(1) const GpPointR *, // Ignored RAIL_SIDE // Ignored ) { // Do nothing stub, OK to call return S_OK; } virtual HRESULT PolylineWedge( RAIL_SIDE side, // Which side to add to - RAIL_RIGHT or RAIL_LEFT UINT count, // Number of points __in_ecount(count) const GpPointR *pPoints // The polyline vertices )=0; virtual HRESULT AddFigure() { // Do nothing stub, OK to call return S_OK; } virtual HRESULT SwitchSides()=0; virtual HRESULT AddFill( __in_ecount(1) const CShape &oShape, // The shape to be filled __in_ecount(1) const CMILMatrix &matrix // Transformation )=0; virtual bool Aborted() { // Most sinks never abort return false; } // No data }; //+----------------------------------------------------------------------------- // // Class: // CShapeWideningSink // // Synopsis: // A sink for the widener that populates a new CShape. It maintains two // rails, one for each side of the widened outline. The right rail // accumulates the results. // //------------------------------------------------------------------------------ class CShapeWideningSink : public CWideningSink { public: CShapeWideningSink( __in_ecount(1) CShape &oShape // The shape receiving the results ); virtual ~CShapeWideningSink(); // CwideningSink overrides virtual HRESULT StartWith( __in_ecount(2) const GpPointR *ptOffset // Left and right offset points ); virtual HRESULT QuadTo( __in_ecount(2) const GpPointR *ptOffset // In: Left & right offset points ); virtual HRESULT QuadTo( __in_ecount(2) const GpPointR *ptOffset, // Left & right offset points thereof __in_ecount(1) const GpPointR &vecSeg, // Segment direction we're coming from __in_ecount(1) const GpPointR &ptSpine, // The corresponding point on the stroke's spine __in_ecount(1) const GpPointR &ptSpinePrev // The previous point on the stroke's spine ); virtual HRESULT CurveWedge( RAIL_SIDE side, // Which side to add to __in_ecount(1) const GpPointR &ptBez_1, // First control point __in_ecount(1) const GpPointR &ptBez_2, // Second control point __in_ecount(1) const GpPointR &ptBez_3 // Last point ); virtual HRESULT BezierCap( __in_ecount(1) const GpPointR &, // Ignored here __in_ecount(1) const GpPointR &pt0_1, // First arc's first control point __in_ecount(1) const GpPointR &pt0_2, // First arc's second control point __in_ecount(1) const GpPointR &ptMid, // The point separating the 2 arcs __in_ecount(1) const GpPointR &pt1_1, // Second arc's first control point __in_ecount(1) const GpPointR &pt1_2, // Second arc's second control point __in_ecount(1) const GpPointR &ptEnd // The cap's last point ); virtual HRESULT SetCurrentPoints( __in_ecount(2) const GpPointR *P // In: Array of 2 points ); virtual HRESULT DoInnerCorner( RAIL_SIDE side, // In: The side of the inner corner __in_ecount(1) const GpPointR &ptCenter, // In: The corner's center __in_ecount(2) const GpPointR *ptOffset // In: The offset points of new segment ); virtual HRESULT CapTriangle( __in_ecount(1) const GpPointR &ptStart, // Triangle base start point __in_ecount(1) const GpPointR &ptApex, // Triangle's apex __in_ecount(1) const GpPointR &ptEnd // Triangle base end point ); virtual HRESULT CapFlat( __in_ecount(2) const GpPointR *ppt, // In: The base points RAIL_SIDE side // In: Which side the cap endpoint is ); virtual HRESULT SwitchSides(); virtual HRESULT PolylineWedge( RAIL_SIDE side, // Which side to add to - RAIL_RIGHT or RAIL_LEFT UINT count, // Number of points __in_ecount(count) const GpPointR *pPoints // The polyline vertices ); virtual HRESULT AddFill( __in_ecount(1) const CShape &oShape, // The shape to be filled __in_ecount(1) const CMILMatrix &matrix // Transformation ); virtual const GpPointR GetCurrentPoint( RAIL_SIDE side // In: Left or right ) { return m_pRail[side]->GetEndPoint(); } virtual HRESULT AddFigure(); // Data protected: CRail *m_pRail[2]; // The left & right rails bool m_fFitCurves; // Fit widened Bezier with curves if true GpReal m_rTolerance; // Approximation tolerance CShape &m_oShape; // Accumulates the final result }; //+----------------------------------------------------------------------------- // // Class: // CStrokeBoundsSink // // Synopsis: // Helper class for computing the exact bounds of a widened stroke. // //------------------------------------------------------------------------------ class CStrokeBoundsSink : public CWideningSink { public: CStrokeBoundsSink() { } ~CStrokeBoundsSink() {} // // The following methods override CWideningSink methods. They get // called back when the path is widened with points on the boundary of // the widened path. // virtual HRESULT StartWith( __in_ecount(2) const GpPointR *ptOffset // Left and right offset points ) { m_oBounds.UpdateWithPoint(ptOffset[RAIL_RIGHT]); m_ptCurrent[RAIL_LEFT] = ptOffset[RAIL_RIGHT]; // Starting the cap m_ptCurrent[RAIL_RIGHT] = ptOffset[RAIL_RIGHT]; // Starting the right rail return S_OK; } virtual HRESULT QuadTo( __in_ecount(2) const GpPointR *ptOffset // In: Left & right offset points ) { UpdateWith2Points(ptOffset); return S_OK; } virtual HRESULT QuadTo( __in_ecount(2) const GpPointR *ptOffset, // Left & right offset points thereof __in_ecount(1) const GpPointR &, // Ignored here __in_ecount(1) const GpPointR &, // Ignored here __in_ecount(1) const GpPointR & // Ignored here ) { UpdateWith2Points(ptOffset); return S_OK; } virtual HRESULT CurveWedge( RAIL_SIDE side, // Which side to add to __in_ecount(1) const GpPointR &ptBez_1, // First control point __in_ecount(1) const GpPointR &ptBez_2, // Second control point __in_ecount(1) const GpPointR &ptBez_3 // Last point ) { m_oBounds.UpdateWithBezier(m_ptCurrent[side], ptBez_1, ptBez_2, ptBez_3); m_ptCurrent[side] = ptBez_3; return S_OK; } virtual HRESULT BezierCap( __in_ecount(1) const GpPointR &ptStart, // The cap's start point __in_ecount(1) const GpPointR &pt0_1, // First arc's first control point __in_ecount(1) const GpPointR &pt0_2, // First arc's second control point __in_ecount(1) const GpPointR &ptMid, // The point separating the 2 arcs __in_ecount(1) const GpPointR &pt1_1, // Second arc's first control point __in_ecount(1) const GpPointR &pt1_2, // Second arc's second control point __in_ecount(1) const GpPointR &ptEnd // The cap's last point ) { m_oBounds.UpdateWithBezier(m_ptCurrent[RAIL_LEFT], pt0_1, pt0_2, ptMid); m_oBounds.UpdateWithBezier(ptMid, pt1_1, pt1_2, ptEnd); m_ptCurrent[RAIL_LEFT] = ptEnd; return S_OK; } virtual HRESULT SetCurrentPoints( __in_ecount(2) const GpPointR *P // In: Array of 2 points ) { UpdateWith2Points(P); return S_OK; } virtual HRESULT DoInnerCorner( RAIL_SIDE side, // The side of the inner corner __in_ecount(1) const GpPointR &, // Ignored const GpPointR *ptOffset // The offset points of the new segment ) { m_ptCurrent[side] = ptOffset[side]; return S_OK; } virtual HRESULT CapFlat( __in_ecount(2) const GpPointR *pPt, // The base points RAIL_SIDE side // Which side the cap endpoint is ) { m_oBounds.UpdateWithPoint(pPt[side]); m_ptCurrent[RAIL_LEFT] = pPt[side]; return S_OK; } virtual HRESULT CapTriangle( __in_ecount(1) const GpPointR &ptStart, // Trainagle base start point __in_ecount(1) const GpPointR &ptApex, // Triangle's apex __in_ecount(1) const GpPointR &ptEnd // Trainagle base end point ) { m_oBounds.UpdateWithPoint(ptApex); m_oBounds.UpdateWithPoint(ptEnd); m_ptCurrent[RAIL_LEFT] = ptEnd; return S_OK; } virtual HRESULT PolylineWedge( RAIL_SIDE side, // Which side to add to - RAIL_RIGHT or RAIL_LEFT UINT count, // Number of points __in_ecount(count) const GpPointR *pPoints // The polyline vertices ) { for (UINT i = 0; i < count; i++) { m_oBounds.UpdateWithPoint(pPoints[i]); } if (count > 0) { m_ptCurrent[side] = pPoints[count-1]; } return S_OK; } virtual HRESULT AddFill( __in_ecount(1) const CShape &oShape, // The shape to be filled __in_ecount(1) const CMILMatrix &matrix // Transformation ) { RRETURN(oShape.UpdateBounds(m_oBounds, true /* fill only */, &matrix)); } virtual HRESULT SwitchSides() { GpPointR ptTemp(m_ptCurrent[RAIL_LEFT]); m_ptCurrent[RAIL_LEFT] = m_ptCurrent[RAIL_RIGHT]; m_ptCurrent[RAIL_RIGHT] = ptTemp; return S_OK; } // Other methods HRESULT SetRect( __out_ecount(1) CMilRectF &rect // Out: The bounds as a RectF ) { RRETURN(m_oBounds.SetRect(OUT rect)); } BOOL NotUpdated() const { return m_oBounds.NotUpdated(); } // Private methods protected: void UpdateWith2Points( __in_ecount(1) const GpPointR *P // In: Array of 2 points ) { m_oBounds.UpdateWithPoint(P[RAIL_LEFT]); m_oBounds.UpdateWithPoint(P[RAIL_RIGHT]); m_ptCurrent[RAIL_LEFT] = P[RAIL_LEFT]; m_ptCurrent[RAIL_RIGHT] = P[RAIL_RIGHT]; } // Data protected: CBounds m_oBounds; // The bounds computed here GpPointR m_ptCurrent[2]; // The current widening points // // The current widening points are kept and updated because the method // CBounds::UpdateWithBezier requires the first point of the Bezier // segment. // }; //+----------------------------------------------------------------------------- // // Class: // CHitTestSink // // Synopsis: // This class tests the widening information, for containing a given point // // Notes: // Hit testing with this class is faster then constructing and testing the // widened path for 2 reasons: // * Widening into this sink does not involve any memory allocation. // * The widening is aborted when a hit is detected. // // The widened geometry for this purpose is divided to small closed // regions: // * A quadrangle for every line segment // * A triangle, quadrangle or half ellipse for every cap. // * A wedge with a polygonal or curved top for every corner. // // There are 2 ways the widening may be aborted: // * The embedded hit-tester aborts when it determines that the hit // point is near the boundary of one of these regions. // * This class determines that the point lies inside one of these // regions by looking at the winding number computed by the embedded // hit-tester. // // CHitTestSink reports a hit by returning true from its Aborted() method. // This is monitored only once per (line or curve) segment. // // CHitTestSink hit tests the widened shape without actually constructing // it. // //------------------------------------------------------------------------------ class CHitTestSink : public CWideningSink { public: CHitTestSink( __inout_ecount(1) CHitTest &tester // A hit tester ) : m_refTester(tester) { m_fHitInside = m_fHitNear = false; } virtual ~CHitTestSink() { } // CWideningSink overrides virtual HRESULT StartWith( __in_ecount(2) const GpPointR *ptOffset // Left and right offset points ); virtual HRESULT QuadTo( __in_ecount(2) const GpPointR *ptOffset // Left & right offset points ); virtual HRESULT QuadTo( __in_ecount(2) const GpPointR *ptOffset, // Left & right offset points thereof __in_ecount(1) const GpPointR &, // Ignored here __in_ecount(1) const GpPointR &, // Ignored here __in_ecount(1) const GpPointR & // Ignored here ) { // CShapeWideningSink as 2 versions of QuadTo (see implementation for // details). For this sink they are the same. return QuadTo(ptOffset); } virtual HRESULT CurveWedge( RAIL_SIDE side, // Which side to add to - RAIL_LEFT or RAIL_RIGHT __in_ecount(1) const GpPointR &ptBez_1, // First control point __in_ecount(1) const GpPointR &ptBez_2, // Second control point __in_ecount(1) const GpPointR &ptBez_3 // Last point ); virtual HRESULT BezierCap( __in_ecount(1) const GpPointR &ptStart, // The cap's first point __in_ecount(1) const GpPointR &pt0_1, // First arc's first control point __in_ecount(1) const GpPointR &pt0_2, // First arc's second control point __in_ecount(1) const GpPointR &ptMid, // The point separating the 2 arcs __in_ecount(1) const GpPointR &pt1_1, // Second arc's first control point __in_ecount(1) const GpPointR &pt1_2, // Second arc's second control point __in_ecount(1) const GpPointR &ptEnd // The cap's last point ); virtual HRESULT SetCurrentPoints( __in_ecount(2) const GpPointR *P // Array of 2 points ); virtual HRESULT DoInnerCorner( RAIL_SIDE side, // The side of the inner corner __in_ecount(1) const GpPointR &ptCenter, // The corner's center __in_ecount(2) const GpPointR *ptOffset // The offset points of new segment ); virtual HRESULT CapTriangle( __in_ecount(1) const GpPointR &ptStart, // Triangle base start point __in_ecount(1) const GpPointR &ptApex, // Triangle's apex __in_ecount(1) const GpPointR &ptEnd // Triangle base end point ); virtual HRESULT CapFlat( __in_ecount(2) const GpPointR *ppt, // The base points RAIL_SIDE side // Which side the cap endpoint is ); virtual HRESULT SwitchSides(); virtual HRESULT PolylineWedge( RAIL_SIDE side, // Which side to add to - RAIL_RIGHT or RAIL_LEFT UINT count, // Number of points __in_ecount(count) const GpPointR *pPoints // The polyline vertices ); virtual HRESULT AddFill( __in_ecount(1) const CShape &oShape, // The shape to be filled __in_ecount(1) const CMILMatrix &matrix // Transformation ); virtual const GpPointR GetCurrentPoint( RAIL_SIDE side // Left or right ) const { return m_ptCurrent[side]; } virtual bool Aborted() const { return m_fHitNear || m_fHitInside; } // Other methods bool WasHit() const { return m_fHitNear || m_fHitInside; } bool WasHitNear() const { return m_fHitNear; } // Data protected: GpPointR m_ptCurrent[2]; // The latest widening points bool m_fHitInside; // True the hit point is inside the widened path bool m_fHitNear; // True if a hit near the boundary was detected CHitTest &m_refTester; // A hit tester };
31.801625
101
0.56207
[ "geometry", "render", "shape", "vector", "model", "transform" ]
71e09d1b108b7220b05f18672adcbae63905e619
7,923
c
C
ext/yices/src/model/generalization.c
maelvls/ocamlyices2
554893d467a4bf3e9b0b630833b417348b15e771
[ "0BSD" ]
2
2017-04-05T13:53:54.000Z
2018-11-23T00:16:01.000Z
ext/yices/src/model/generalization.c
maelvls/ocamlyices2
554893d467a4bf3e9b0b630833b417348b15e771
[ "0BSD" ]
5
2017-04-07T14:29:10.000Z
2021-01-08T18:01:46.000Z
ext/yices/src/model/generalization.c
maelvls/ocamlyices2
554893d467a4bf3e9b0b630833b417348b15e771
[ "0BSD" ]
1
2017-04-05T16:58:14.000Z
2017-04-05T16:58:14.000Z
/* * The Yices SMT Solver. Copyright 2014 SRI International. * * This program may only be used subject to the noncommercial end user * license agreement which is downloadable along with this program. */ /* * MODEL GENERALIZATION * * Given a model mdl for a formula F(x, y), this module computes * the generalization of mdl for the variables 'x'. The result * is a formula G(x) such that * 1) G(x) is true in mdl * 2) G(x) implies (EXISTS y: F(x, y)) * * If any variable in y is an arithmetic variable then G(x) is * computed using model-based projection. Otherwise, G(x) is * obtained by substitution: we replace every variable y_i * by its value in the model. * * NOTE: we could use model-based projection in both cases, but * experiments with the exists/forall solver seem to show that * substitution works better for Boolean and bitvector variables. */ #include <assert.h> #include "model/generalization.h" #include "model/model_queries.h" #include "model/projection.h" #include "model/val_to_term.h" #include "terms/term_substitution.h" /* * Split the array of variables v into discrete and real variables * - n = number of variables in v * - all variables of type REAL are added to vector reals * - all other variables are added to discretes */ static void split_elim_array(term_table_t *terms, uint32_t n, const term_t v[], ivector_t *reals, ivector_t *discretes) { uint32_t i; term_t t; for (i=0; i<n; i++) { t = v[i]; if (is_real_term(terms, t)) { ivector_push(reals, t); } else { ivector_push(discretes, t); } } } /* * Conversion of error codes to GEN.. codes * - eval_errors are in the range [-7 ... -2] * MDL_EVAL_FAILED = -7 and MDL_EVAL_INTERNAL_ERROR = -2 * they are kept unchanged * - conversion errors are in the range [-6 .. -2] * CONVERT_FAILED = -6 and CONVERT_INTERNAL_ERROR = -2 * we renumber them to [-13 .. -9] * - implicant construction errors are in the range [-8 ... -2] * MDL_EVAL_FORMULA_FALSE = -8 and MDL_EVAL_INTERNAL_ERROR = -2 * - projection errors are in the range -1 to -5 * we renumber to [-18 .. -14] */ static inline int32_t gen_eval_error(int32_t error) { assert(MDL_EVAL_FAILED <= error && error <= MDL_EVAL_INTERNAL_ERROR); return error; } static inline int32_t gen_convert_error(int32_t error) { assert(CONVERT_FAILED <= error && error <= CONVERT_INTERNAL_ERROR); return error + (GEN_CONV_INTERNAL_ERROR - CONVERT_INTERNAL_ERROR); } static inline int32_t gen_implicant_error(int32_t error) { assert(MDL_EVAL_FORMULA_FALSE <= error && error <= MDL_EVAL_INTERNAL_ERROR); return error; } static inline int32_t gen_projection_error(proj_flag_t error) { assert(PROJ_ERROR_NON_LINEAR <= error && error <= PROJ_ERROR_BAD_ARITH_LITERAL); return error + (GEN_PROJ_ERROR_NON_LINEAR - PROJ_ERROR_NON_LINEAR); } /* * Generalization by substitution: core procedure * - mdl = model * - mngr = relevant term manager * - elim[0 ... nelim -1] = variables to eliminate * - on entry to the function, v must contain the formulas to project * - the result is returned in place (in vector v) * * - returned code: 0 if no error, an error code otherwise * - error codes are listed in generalization.h */ static int32_t gen_model_by_subst(model_t *mdl, term_manager_t *mngr, uint32_t nelims, const term_t elim[], ivector_t *v) { term_subst_t subst; ivector_t aux; term_table_t *terms; int32_t code; uint32_t k, n; term_t t; // get the value of elim[i] in aux.data[i] init_ivector(&aux, nelims); code = evaluate_term_array(mdl, nelims, elim, aux.data); if (code < 0) { // error in evaluator code = gen_eval_error(code); assert(GEN_EVAL_FAILED <= code && code <= GEN_EVAL_INTERNAL_ERROR); goto done; } // convert every aux.data[i] to a constant term terms = term_manager_get_terms(mngr); k = convert_value_array(terms, model_get_vtbl(mdl), nelims, aux.data); if (k < nelims) { // aux.data[k] couldn't be converted to a term // the error code is in aux.data[k] code = gen_convert_error(aux.data[k]); assert(GEN_CONV_FAILED <= code && code <= GEN_CONV_INTERNAL_ERROR); goto done; } // build the substitution: elim[i] := aux.data[i] // then apply it to every term in vector v code = 0; init_term_subst(&subst, mngr, nelims, elim, aux.data); n = v->size; for (k=0; k<n; k++) { t = apply_term_subst(&subst, v->data[k]); v->data[k] = t; if (t < 0) { code = GEN_PROJ_ERROR_IN_SUBST; break; } } delete_term_subst(&subst); done: delete_ivector(&aux); return code; } /* * Generalization by projection: core procedure * - compute an implicant then project the implicant * - mdl = model * - mngr = relevant term manager * - elim[0 ... nelims-1] = variables to eliminate * - on entry to the function, v must contain the formulas to project * the result is returned in place (in vector v) * * Return code: 0 if no error, an error code otherwise */ static int32_t gen_model_by_proj(model_t *mdl, term_manager_t *mngr, uint32_t nelims, const term_t elim[], ivector_t *v) { ivector_t implicant; int32_t code; proj_flag_t pflag; init_ivector(&implicant, 10); code = get_implicant(mdl, mngr, LIT_COLLECTOR_ALL_OPTIONS, v->size, v->data, &implicant); if (code < 0) { // implicant construction failed code = gen_implicant_error(code); goto done; } ivector_reset(v); // reset v to collect the projection result code = 0; pflag = project_literals(mdl, mngr, implicant.size, implicant.data, nelims, elim, v); if (pflag != PROJ_NO_ERROR) { code = gen_projection_error(pflag); } done: delete_ivector(&implicant); return code; } /* * Generalization by substitution * - mdl = model * - mngr = relevant term manager * - f[0 ... n-1] = formula true in the model * - elim[0 ... nelim -1] = variables to eliminate * - v = result vector * * - returned code: 0 if no error, an error code otherwise * - error codes are listed in generalization.h */ int32_t gen_model_by_substitution(model_t *mdl, term_manager_t *mngr, uint32_t n, const term_t f[], uint32_t nelims, const term_t elim[], ivector_t *v) { ivector_copy(v, f, n); assert(v->size == n); return gen_model_by_subst(mdl, mngr, nelims, elim, v); } /* * Generalize by projection: * - compute an implicant then project the implicant * - mdl = model * - mngr = relevant term manager * - f[0 ... n-1] = formulas true in mdl * - elim[0 ... nelims-1] = variables to eliminate * - v = result vector * * - returned code: 0 if no error, an error code otherwise * - error codes are listed in generalization.h */ int32_t gen_model_by_projection(model_t *mdl, term_manager_t *mngr, uint32_t n, const term_t f[], uint32_t nelims, const term_t elim[], ivector_t *v) { ivector_copy(v, f, n); assert(v->size == n); return gen_model_by_proj(mdl, mngr, nelims, elim, v); } /* * Generalize mdl: two passes: * - 1) eliminate the discrete variables by substitution * - 2) use projection to eliminate the real variables */ int32_t generalize_model(model_t *mdl, term_manager_t *mngr, uint32_t n, const term_t f[], uint32_t nelims, const term_t elim[], ivector_t *v) { term_table_t *terms; ivector_t discretes; ivector_t reals; int32_t code; // if n == 0, there's nothing to do code =0; if (n > 0) { terms = term_manager_get_terms(mngr); init_ivector(&reals, 10); init_ivector(&discretes, 10); split_elim_array(terms, nelims, elim, &reals, &discretes); ivector_copy(v, f, n); if (discretes.size > 0) { code = gen_model_by_subst(mdl, mngr, discretes.size, discretes.data, v); } if (code == 0 && reals.size > 0) { code = gen_model_by_proj(mdl, mngr, reals.size, reals.data, v); } delete_ivector(&reals); delete_ivector(&discretes); } return code; }
29.344444
123
0.684211
[ "vector", "model" ]
71e13bf37e949fb1c1bb0ec1b7b54fd3ae70e980
4,749
h
C
include/hs.h
nmpassthf/TSCUI
e20ec7ce23903403a12e93d2fc89d27ac9477b64
[ "MIT" ]
1
2021-08-22T12:39:51.000Z
2021-08-22T12:39:51.000Z
include/hs.h
nmpassthf/TSCUI
e20ec7ce23903403a12e93d2fc89d27ac9477b64
[ "MIT" ]
null
null
null
include/hs.h
nmpassthf/TSCUI
e20ec7ce23903403a12e93d2fc89d27ac9477b64
[ "MIT" ]
null
null
null
#define __NMP_THF_HEAD_H__ 3 // Modified in 21/05/03 #pragma once #pragma execution_character_set("utf-8") // C #ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <cwchar> #include <cwctype> #if __cplusplus >= 201103L || _MSVC_LANG >= 201103L // #include <ccomplex> #include <cfenv> #include <cinttypes> // #include <cstdalign> // #include <cstdbool> #include <cstdint> // #include <ctgmath> #include <cuchar> #endif // C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L || _MSVC_LANG >= 201103L #include <array> #include <atomic> #include <chrono> #include <codecvt> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <type_traits> #include <typeindex> #include <unordered_map> #include <unordered_set> #endif #if __cplusplus >= 201402L || _MSVC_LANG >= 201402L #include <shared_mutex> #endif #if __cplusplus >= 201703L || _MSVC_LANG >= 201703L #include <any> #include <charconv> // #include <execution> #include <filesystem> #include <memory_resource> #include <optional> #include <string_view> #include <variant> #endif #if __cplusplus > 201703L || _HAS_CXX20 #include <bit> // #include <compare> // #include <span> // #include <syncstream> #include <version> #endif #include <stdlib.h> #define _INITIALIZER(f) \ static void f(void); \ \ struct __INITIALIZER_##f##_TYPE { \ __INITIALIZER_##f##_TYPE(void) { f(); } \ }; \ static __INITIALIZER_##f##_TYPE __INITIALIZER##f##__CLASS; \ void f(void) #define _DESTROYER(f) \ static void f(void); \ \ struct __DESTROYER_##f##_TYPE { \ __DESTROYER_##f##_TYPE(void) { atexit(f); } \ }; \ static __DESTROYER_##f##_TYPE __DESTROYER##f##__CLASS; \ void f(void) #define INITIALIZER(FUNC_NAME) _INITIALIZER(FUNC_NAME) #define DESTROYER(FUNC_NAME) _DESTROYER(FUNC_NAME) // UNICODE #ifndef _UNICODE #define _UNICODE #endif #ifndef UNICODE #define UNICODE #endif #ifndef NMP_THF_UNICODE #define NMP_THF_UNICODE 1 #endif #include <fcntl.h> #include <io.h> #include <windows.h> INITIALIZER(SCOPTCP) { SetConsoleOutputCP(65001); } namespace NMP_THF { #ifdef NMP_THF_UNICODE #define WMAIN int wmain(int _argc, wchar_t *_argv[], wchar_t *_envp[]) #define SETMODE_SETCHARSETU16 \ _setmode(_fileno(stdin), _O_U16TEXT); \ _setmode(_fileno(stdout), _O_U16TEXT); // _setmode(_fileno(stderr), _O_U16TEXT); #define U8INIT \ INITIALIZER(_U8INIT_FUNC) { \ system("@cls"); \ system("chcp 65001>nul"); \ SetConsoleCP(CP_UTF8); \ } #define UNIMAIN U8INIT int main(int argc, char *argv[]) #define QAPP(name) QApplication name(argc, argv) // #define wout std::wcout // #define werr std::wcerr // #define win std::wcin using wchar = wchar_t; using cwchar = const wchar_t; using wstr = std::wstring; using cwstr = const std::wstring; #define cauto const auto // check no use unU16 out // #define cout #define _ERROR_ // #define cerr #define _ERROR_ // #define cin #define _ERROR_ // #define fstream #define _ERROR_ // #define ifstream #define _ERROR_ // #define ofstream #define _ERROR_ // #define istream #define _ERROR_ // #define ostream #define _ERROR_ // #define iostream #define _ERROR_ #ifdef _ERROR_ #error "NO UN_U16 IO" #endif } #endif
23.165854
70
0.636976
[ "vector" ]
71e47836d5e07a3afae337a54626801b9f8943bc
1,304
h
C
SDL/Game14/PhysWorld.h
blAs1N/C-programming
3ab83a00dab6e3d9cfe97c514115308ad2333387
[ "MIT" ]
4
2018-06-17T11:47:16.000Z
2018-10-01T14:01:55.000Z
SDL/Game14/PhysWorld.h
blAs1N/TIL
3ab83a00dab6e3d9cfe97c514115308ad2333387
[ "MIT" ]
null
null
null
SDL/Game14/PhysWorld.h
blAs1N/TIL
3ab83a00dab6e3d9cfe97c514115308ad2333387
[ "MIT" ]
null
null
null
#pragma once #include <vector> #include <algorithm> #include "Math.h" #include "Collision.h" #include "BoxComponent.h" class PhysWorld { public: PhysWorld(class Game* inGame); struct CollisionInfo { CollisionInfo() = default; Vector3 point; Vector3 normal; BoxComponent* box; class Actor* actor; }; bool SegmentCast(const LineSegment& l, CollisionInfo& outColl); template <class Func> void TestPairwise(Func&& f); template <class Func> void TestSweepAndPrune(Func&& f); void AddBox(BoxComponent* box); void RemoveBox(BoxComponent* box); private: Game* game; std::vector<BoxComponent*> boxes; }; template <class Func> void PhysWorld::TestPairwise(Func&& f) { for (const auto a : boxes) { for (const auto b : boxes) { if (Intersect(a->GetWorldBox(), b->GetWorldBox())) f(a->GetOwner(), b->GetOwner()); } } } template <class Func> void PhysWorld::TestSweepAndPrune(Func&& f) { std::sort(boxes.begin(), boxes.end(), [](const auto lhs, const auto rhs) { return lhs->GetWorldBox().min.x < rhs->GetWorldBox().min.x; }); for (const auto a : boxes) { const auto max = a->GetWorldBox().max.x; for (const auto b : boxes) { if (b->GetWorldBox().min.x > max && Intersect(a->GetWorldBox(), b->GetWorldBox())) f(a->GetOwner(), b->GetOwner()); } } }
20.698413
75
0.667178
[ "vector" ]
71e8a95dd9b8eb7be8f70dad83de215c5dbe0f34
12,140
c
C
Library/Il2cppBuildCache/Android/arm64-v8a/il2cppOutput/System.Core_CodeGen.c
AndreyDioXHub/Hill-Climb-Demo
70950d218cbf8f1a566c562291870d468d7865d3
[ "MIT" ]
null
null
null
Library/Il2cppBuildCache/Android/arm64-v8a/il2cppOutput/System.Core_CodeGen.c
AndreyDioXHub/Hill-Climb-Demo
70950d218cbf8f1a566c562291870d468d7865d3
[ "MIT" ]
null
null
null
Library/Il2cppBuildCache/Android/arm64-v8a/il2cppOutput/System.Core_CodeGen.c
AndreyDioXHub/Hill-Climb-Demo
70950d218cbf8f1a566c562291870d468d7865d3
[ "MIT" ]
null
null
null
#include "pch-c.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include "codegen/il2cpp-codegen-metadata.h" // 0x00000001 System.Exception System.Linq.Error::ArgumentNull(System.String) extern void Error_ArgumentNull_m0EDA0D46D72CA692518E3E2EB75B48044D8FD41E (void); // 0x00000002 System.Exception System.Linq.Error::MoreThanOneMatch() extern void Error_MoreThanOneMatch_m4C4756AF34A76EF12F3B2B6D8C78DE547F0FBCF8 (void); // 0x00000003 System.Exception System.Linq.Error::NoElements() extern void Error_NoElements_mB89E91246572F009281D79730950808F17C3F353 (void); // 0x00000004 System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable::Where(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) // 0x00000005 System.Func`2<TSource,System.Boolean> System.Linq.Enumerable::CombinePredicates(System.Func`2<TSource,System.Boolean>,System.Func`2<TSource,System.Boolean>) // 0x00000006 TSource System.Linq.Enumerable::First(System.Collections.Generic.IEnumerable`1<TSource>) // 0x00000007 TSource System.Linq.Enumerable::SingleOrDefault(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) // 0x00000008 System.Boolean System.Linq.Enumerable::Any(System.Collections.Generic.IEnumerable`1<TSource>) // 0x00000009 System.Boolean System.Linq.Enumerable::Any(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) // 0x0000000A System.Int32 System.Linq.Enumerable::Count(System.Collections.Generic.IEnumerable`1<TSource>) // 0x0000000B System.Void System.Linq.Enumerable/Iterator`1::.ctor() // 0x0000000C TSource System.Linq.Enumerable/Iterator`1::get_Current() // 0x0000000D System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/Iterator`1::Clone() // 0x0000000E System.Void System.Linq.Enumerable/Iterator`1::Dispose() // 0x0000000F System.Collections.Generic.IEnumerator`1<TSource> System.Linq.Enumerable/Iterator`1::GetEnumerator() // 0x00000010 System.Boolean System.Linq.Enumerable/Iterator`1::MoveNext() // 0x00000011 System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/Iterator`1::Where(System.Func`2<TSource,System.Boolean>) // 0x00000012 System.Object System.Linq.Enumerable/Iterator`1::System.Collections.IEnumerator.get_Current() // 0x00000013 System.Collections.IEnumerator System.Linq.Enumerable/Iterator`1::System.Collections.IEnumerable.GetEnumerator() // 0x00000014 System.Void System.Linq.Enumerable/Iterator`1::System.Collections.IEnumerator.Reset() // 0x00000015 System.Void System.Linq.Enumerable/WhereEnumerableIterator`1::.ctor(System.Collections.Generic.IEnumerable`1<TSource>,System.Func`2<TSource,System.Boolean>) // 0x00000016 System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/WhereEnumerableIterator`1::Clone() // 0x00000017 System.Void System.Linq.Enumerable/WhereEnumerableIterator`1::Dispose() // 0x00000018 System.Boolean System.Linq.Enumerable/WhereEnumerableIterator`1::MoveNext() // 0x00000019 System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/WhereEnumerableIterator`1::Where(System.Func`2<TSource,System.Boolean>) // 0x0000001A System.Void System.Linq.Enumerable/WhereArrayIterator`1::.ctor(TSource[],System.Func`2<TSource,System.Boolean>) // 0x0000001B System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/WhereArrayIterator`1::Clone() // 0x0000001C System.Boolean System.Linq.Enumerable/WhereArrayIterator`1::MoveNext() // 0x0000001D System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/WhereArrayIterator`1::Where(System.Func`2<TSource,System.Boolean>) // 0x0000001E System.Void System.Linq.Enumerable/WhereListIterator`1::.ctor(System.Collections.Generic.List`1<TSource>,System.Func`2<TSource,System.Boolean>) // 0x0000001F System.Linq.Enumerable/Iterator`1<TSource> System.Linq.Enumerable/WhereListIterator`1::Clone() // 0x00000020 System.Boolean System.Linq.Enumerable/WhereListIterator`1::MoveNext() // 0x00000021 System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/WhereListIterator`1::Where(System.Func`2<TSource,System.Boolean>) // 0x00000022 System.Void System.Linq.Enumerable/<>c__DisplayClass6_0`1::.ctor() // 0x00000023 System.Boolean System.Linq.Enumerable/<>c__DisplayClass6_0`1::<CombinePredicates>b__0(TSource) // 0x00000024 System.Void System.Collections.Generic.HashSet`1::.ctor() // 0x00000025 System.Void System.Collections.Generic.HashSet`1::.ctor(System.Collections.Generic.IEqualityComparer`1<T>) // 0x00000026 System.Void System.Collections.Generic.HashSet`1::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) // 0x00000027 System.Void System.Collections.Generic.HashSet`1::System.Collections.Generic.ICollection<T>.Add(T) // 0x00000028 System.Void System.Collections.Generic.HashSet`1::Clear() // 0x00000029 System.Boolean System.Collections.Generic.HashSet`1::Contains(T) // 0x0000002A System.Void System.Collections.Generic.HashSet`1::CopyTo(T[],System.Int32) // 0x0000002B System.Boolean System.Collections.Generic.HashSet`1::Remove(T) // 0x0000002C System.Int32 System.Collections.Generic.HashSet`1::get_Count() // 0x0000002D System.Boolean System.Collections.Generic.HashSet`1::System.Collections.Generic.ICollection<T>.get_IsReadOnly() // 0x0000002E System.Collections.Generic.HashSet`1/Enumerator<T> System.Collections.Generic.HashSet`1::GetEnumerator() // 0x0000002F System.Collections.Generic.IEnumerator`1<T> System.Collections.Generic.HashSet`1::System.Collections.Generic.IEnumerable<T>.GetEnumerator() // 0x00000030 System.Collections.IEnumerator System.Collections.Generic.HashSet`1::System.Collections.IEnumerable.GetEnumerator() // 0x00000031 System.Void System.Collections.Generic.HashSet`1::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) // 0x00000032 System.Void System.Collections.Generic.HashSet`1::OnDeserialization(System.Object) // 0x00000033 System.Boolean System.Collections.Generic.HashSet`1::Add(T) // 0x00000034 System.Void System.Collections.Generic.HashSet`1::CopyTo(T[]) // 0x00000035 System.Void System.Collections.Generic.HashSet`1::CopyTo(T[],System.Int32,System.Int32) // 0x00000036 System.Void System.Collections.Generic.HashSet`1::Initialize(System.Int32) // 0x00000037 System.Void System.Collections.Generic.HashSet`1::IncreaseCapacity() // 0x00000038 System.Void System.Collections.Generic.HashSet`1::SetCapacity(System.Int32) // 0x00000039 System.Boolean System.Collections.Generic.HashSet`1::AddIfNotPresent(T) // 0x0000003A System.Int32 System.Collections.Generic.HashSet`1::InternalGetHashCode(T) // 0x0000003B System.Void System.Collections.Generic.HashSet`1/Enumerator::.ctor(System.Collections.Generic.HashSet`1<T>) // 0x0000003C System.Void System.Collections.Generic.HashSet`1/Enumerator::Dispose() // 0x0000003D System.Boolean System.Collections.Generic.HashSet`1/Enumerator::MoveNext() // 0x0000003E T System.Collections.Generic.HashSet`1/Enumerator::get_Current() // 0x0000003F System.Object System.Collections.Generic.HashSet`1/Enumerator::System.Collections.IEnumerator.get_Current() // 0x00000040 System.Void System.Collections.Generic.HashSet`1/Enumerator::System.Collections.IEnumerator.Reset() static Il2CppMethodPointer s_methodPointers[64] = { Error_ArgumentNull_m0EDA0D46D72CA692518E3E2EB75B48044D8FD41E, Error_MoreThanOneMatch_m4C4756AF34A76EF12F3B2B6D8C78DE547F0FBCF8, Error_NoElements_mB89E91246572F009281D79730950808F17C3F353, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; static const int32_t s_InvokerIndices[64] = { 1851, 1929, 1929, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; static const Il2CppTokenRangePair s_rgctxIndices[14] = { { 0x02000004, { 28, 4 } }, { 0x02000005, { 32, 9 } }, { 0x02000006, { 41, 7 } }, { 0x02000007, { 48, 10 } }, { 0x02000008, { 58, 1 } }, { 0x02000009, { 59, 21 } }, { 0x0200000B, { 80, 2 } }, { 0x06000004, { 0, 10 } }, { 0x06000005, { 10, 5 } }, { 0x06000006, { 15, 4 } }, { 0x06000007, { 19, 3 } }, { 0x06000008, { 22, 1 } }, { 0x06000009, { 23, 3 } }, { 0x0600000A, { 26, 2 } }, }; static const Il2CppRGCTXDefinition s_rgctxValues[82] = { { (Il2CppRGCTXDataType)2, 932 }, { (Il2CppRGCTXDataType)3, 2677 }, { (Il2CppRGCTXDataType)2, 1554 }, { (Il2CppRGCTXDataType)2, 1282 }, { (Il2CppRGCTXDataType)3, 4630 }, { (Il2CppRGCTXDataType)2, 977 }, { (Il2CppRGCTXDataType)2, 1286 }, { (Il2CppRGCTXDataType)3, 4643 }, { (Il2CppRGCTXDataType)2, 1284 }, { (Il2CppRGCTXDataType)3, 4636 }, { (Il2CppRGCTXDataType)2, 367 }, { (Il2CppRGCTXDataType)3, 14 }, { (Il2CppRGCTXDataType)3, 15 }, { (Il2CppRGCTXDataType)2, 627 }, { (Il2CppRGCTXDataType)3, 1948 }, { (Il2CppRGCTXDataType)2, 884 }, { (Il2CppRGCTXDataType)2, 667 }, { (Il2CppRGCTXDataType)2, 733 }, { (Il2CppRGCTXDataType)2, 769 }, { (Il2CppRGCTXDataType)2, 734 }, { (Il2CppRGCTXDataType)2, 770 }, { (Il2CppRGCTXDataType)3, 1949 }, { (Il2CppRGCTXDataType)2, 729 }, { (Il2CppRGCTXDataType)2, 730 }, { (Il2CppRGCTXDataType)2, 768 }, { (Il2CppRGCTXDataType)3, 1947 }, { (Il2CppRGCTXDataType)2, 666 }, { (Il2CppRGCTXDataType)2, 732 }, { (Il2CppRGCTXDataType)3, 2678 }, { (Il2CppRGCTXDataType)3, 2680 }, { (Il2CppRGCTXDataType)2, 267 }, { (Il2CppRGCTXDataType)3, 2679 }, { (Il2CppRGCTXDataType)3, 2688 }, { (Il2CppRGCTXDataType)2, 935 }, { (Il2CppRGCTXDataType)2, 1285 }, { (Il2CppRGCTXDataType)3, 4637 }, { (Il2CppRGCTXDataType)3, 2689 }, { (Il2CppRGCTXDataType)2, 749 }, { (Il2CppRGCTXDataType)2, 784 }, { (Il2CppRGCTXDataType)3, 1953 }, { (Il2CppRGCTXDataType)3, 5639 }, { (Il2CppRGCTXDataType)3, 2681 }, { (Il2CppRGCTXDataType)2, 934 }, { (Il2CppRGCTXDataType)2, 1283 }, { (Il2CppRGCTXDataType)3, 4631 }, { (Il2CppRGCTXDataType)3, 1952 }, { (Il2CppRGCTXDataType)3, 2682 }, { (Il2CppRGCTXDataType)3, 5638 }, { (Il2CppRGCTXDataType)3, 2695 }, { (Il2CppRGCTXDataType)2, 936 }, { (Il2CppRGCTXDataType)2, 1287 }, { (Il2CppRGCTXDataType)3, 4644 }, { (Il2CppRGCTXDataType)3, 2887 }, { (Il2CppRGCTXDataType)3, 1403 }, { (Il2CppRGCTXDataType)3, 1954 }, { (Il2CppRGCTXDataType)3, 1402 }, { (Il2CppRGCTXDataType)3, 2696 }, { (Il2CppRGCTXDataType)3, 5640 }, { (Il2CppRGCTXDataType)3, 1951 }, { (Il2CppRGCTXDataType)3, 1680 }, { (Il2CppRGCTXDataType)2, 562 }, { (Il2CppRGCTXDataType)3, 2098 }, { (Il2CppRGCTXDataType)3, 2099 }, { (Il2CppRGCTXDataType)3, 2104 }, { (Il2CppRGCTXDataType)2, 812 }, { (Il2CppRGCTXDataType)3, 2101 }, { (Il2CppRGCTXDataType)3, 5823 }, { (Il2CppRGCTXDataType)2, 545 }, { (Il2CppRGCTXDataType)3, 1398 }, { (Il2CppRGCTXDataType)1, 719 }, { (Il2CppRGCTXDataType)2, 1570 }, { (Il2CppRGCTXDataType)3, 2100 }, { (Il2CppRGCTXDataType)1, 1570 }, { (Il2CppRGCTXDataType)1, 812 }, { (Il2CppRGCTXDataType)2, 1607 }, { (Il2CppRGCTXDataType)2, 1570 }, { (Il2CppRGCTXDataType)3, 2105 }, { (Il2CppRGCTXDataType)3, 2103 }, { (Il2CppRGCTXDataType)3, 2102 }, { (Il2CppRGCTXDataType)2, 190 }, { (Il2CppRGCTXDataType)3, 1404 }, { (Il2CppRGCTXDataType)2, 273 }, }; extern const CustomAttributesCacheGenerator g_System_Core_AttributeGenerators[]; IL2CPP_EXTERN_C const Il2CppCodeGenModule g_System_Core_CodeGenModule; const Il2CppCodeGenModule g_System_Core_CodeGenModule = { "System.Core.dll", 64, s_methodPointers, 0, NULL, s_InvokerIndices, 0, NULL, 14, s_rgctxIndices, 82, s_rgctxValues, NULL, g_System_Core_AttributeGenerators, NULL, // module initializer, NULL, NULL, NULL, };
35.601173
182
0.75313
[ "object" ]
71ecf650aae80528df1f18c31823ce43ac19b98f
25,382
c
C
src/compiler/link.c
gooofy/aqb
0adcebd1bcbece0be0fc56a92ac9fae169a6dade
[ "MIT" ]
51
2020-09-07T08:44:29.000Z
2022-03-30T02:07:19.000Z
src/compiler/link.c
gooofy/aqb
0adcebd1bcbece0be0fc56a92ac9fae169a6dade
[ "MIT" ]
17
2021-09-27T07:24:01.000Z
2022-03-23T19:33:59.000Z
src/compiler/link.c
gooofy/aqb
0adcebd1bcbece0be0fc56a92ac9fae169a6dade
[ "MIT" ]
7
2021-09-09T15:35:24.000Z
2022-03-09T17:37:35.000Z
#include <stdlib.h> #include <string.h> #include "link.h" #include "logger.h" #include "compiler.h" /* * Amiga Hunk file format related definitions */ #define HUNK_TYPE_UNIT 0x03E7 #define HUNK_TYPE_NAME 0x03E8 #define HUNK_TYPE_CODE 0x03E9 #define HUNK_TYPE_DATA 0x03EA #define HUNK_TYPE_BSS 0x03EB #define HUNK_TYPE_RELOC32 0x03EC #define HUNK_TYPE_EXT 0x03EF #define HUNK_TYPE_SYMBOL 0x03F0 #define HUNK_TYPE_END 0x03F2 #define HUNK_TYPE_HEADER 0x03F3 #define EXT_TYPE_DEF 1 #define EXT_TYPE_ABS 2 #define EXT_TYPE_REF32 129 #define EXT_TYPE_COMMON 130 #define EXT_TYPE_ABSREF16 138 #define MAX_BUF 1024 #define MAX_NUM_HUNKS 16 #define ENABLE_SYMBOL_HUNK static uint8_t g_buf[MAX_BUF]; // scratch buffer static char g_name[MAX_BUF]; // current hunk name static AS_segment g_hunk_table[MAX_NUM_HUNKS]; // used during hunk object loading static int g_hunk_id_cnt; static AS_segment g_hunk_cur; // last code/data/bss hunk read static FILE *g_fObjFile=NULL; // object file being written static FILE *g_fLoadFile=NULL; // load file being written static void link_fail (string msg) { LOG_printf (LOG_ERROR, "*** linker error: %s\n", msg); //assert(FALSE); if (g_fLoadFile) { fclose (g_fLoadFile); g_fLoadFile = NULL; } if (g_fObjFile) { fclose (g_fObjFile); g_fObjFile = NULL; } CO_exit(127); } #if LOG_LEVEL == LOG_DEBUG //static void hexdump (uint8_t *mem, uint32_t offset, uint32_t num_bytes) //{ // LOG_printf (LOG_DEBUG, "HEX: 0x%08x ", offset); // uint32_t cnt=0; // uint32_t num_longs = num_bytes >> 2; // while (cnt<num_longs) // { // uint32_t w = *( (uint32_t *) (mem+offset+cnt*4) ); // LOG_printf (LOG_DEBUG, " 0x%08x", ENDIAN_SWAP_32(w)); // cnt++; // } // LOG_printf (LOG_DEBUG, "\n"); //} #endif LI_segmentList LI_SegmentList(void) { LI_segmentList sl = U_poolAlloc (UP_link, sizeof(*sl)); sl->first = NULL; sl->last = NULL; return sl; } void LI_segmentListAppend (LI_segmentList sl, AS_segment seg) { LI_segmentListNode node = U_poolAlloc (UP_link, sizeof(*node)); node->seg = seg; node->next = NULL; if (sl->first) sl->last = sl->last->next = node; else sl->first = sl->last = node; } static bool fread_u4(FILE *f, uint32_t *u) { if (fread (u, 4, 1, f) != 1) return FALSE; *u = ENDIAN_SWAP_32 (*u); return TRUE; } static bool load_hunk_unit(FILE *f) { for (int i=0; i<MAX_NUM_HUNKS; i++) g_hunk_table[i] = NULL; g_hunk_id_cnt = 0; g_hunk_cur = NULL; uint32_t name_len; if (!fread_u4 (f, &name_len)) { LOG_printf (LOG_ERROR, "link: read error #1.\n"); return FALSE; } name_len *=4; if (name_len>=MAX_BUF) { LOG_printf (LOG_ERROR, "link: unit name too long.\n"); return FALSE; } if (fread (g_buf, name_len, 1, f) != 1) { LOG_printf (LOG_ERROR, "link: read error #2.\n"); return FALSE; } g_buf[name_len] = 0; LOG_printf (LOG_DEBUG, "link: unit name: %s\n", g_buf); return TRUE; } static bool load_hunk_name(string sourcefn, FILE *f) { uint32_t name_len; if (!fread_u4 (f, &name_len)) { LOG_printf (LOG_ERROR, "link: read error #3.\n"); return FALSE; } name_len *=4; if (name_len>=MAX_BUF) { LOG_printf (LOG_ERROR, "link: hunk name too long.\n"); return FALSE; } if (fread (g_name, name_len, 1, f) != 1) { LOG_printf (LOG_ERROR, "link: read error #4.\n"); return FALSE; } g_name[name_len] = 0; LOG_printf (LOG_DEBUG, "link: %s: hunk name: %s\n", sourcefn, g_name); return TRUE; } static AS_segment getOrCreateSegment (string sourcefn, string name, int id, AS_segKind kind, size_t min_size) { if (id >= MAX_NUM_HUNKS) { LOG_printf (LOG_ERROR, "link: hunk table overflow\n"); return FALSE; } AS_segment seg = g_hunk_table[id]; if (!seg) { seg = AS_Segment(sourcefn, name, kind, min_size); g_hunk_table[id] = seg; return seg; } if (kind != AS_unknownSeg) { if (seg->kind == AS_unknownSeg) seg->kind = kind; if (kind != seg->kind) assert(FALSE); } if (!seg->name && name) seg->name = name; AS_ensureSegmentSize (seg, min_size); return seg; } static bool load_hunk_code(string sourcefn, FILE *f) { uint32_t code_len; if (!fread_u4 (f, &code_len)) { LOG_printf (LOG_ERROR, "link: read error #5.\n"); return FALSE; } code_len *=4; LOG_printf (LOG_DEBUG, "link: %s: code hunk size: %d bytes.\n", sourcefn, code_len); g_hunk_cur = getOrCreateSegment (sourcefn, String(UP_link, g_name), g_hunk_id_cnt++, AS_codeSeg, code_len); strcpy (g_name, "unnamed"); if (code_len>0) { if (fread (g_hunk_cur->mem, code_len, 1, f) != 1) { LOG_printf (LOG_ERROR, "link: read error #6.\n"); return FALSE; } } g_hunk_cur->mem_pos = code_len; return TRUE; } static bool load_hunk_data(string sourcefn, FILE *f) { uint32_t data_len; if (!fread_u4 (f, &data_len)) { LOG_printf (LOG_ERROR, "link: read error #7.\n"); return FALSE; } data_len *=4; LOG_printf (LOG_DEBUG, "link: %s: data hunk size: %d bytes.\n", sourcefn, data_len); g_hunk_cur = getOrCreateSegment (sourcefn, String(UP_link, g_name), g_hunk_id_cnt++, AS_dataSeg, data_len); strcpy (g_name, "unnamed"); if (fread (g_hunk_cur->mem, data_len, 1, f) != 1) { LOG_printf (LOG_ERROR, "link: read error #8.\n"); return FALSE; } //hexdump (g_hunk_cur->mem, 0, data_len); g_hunk_cur->mem_pos = data_len; return TRUE; } static bool load_hunk_bss(string sourcefn, FILE *f) { uint32_t bss_len; if (!fread_u4 (f, &bss_len)) { LOG_printf (LOG_ERROR, "link: read error #9.\n"); return FALSE; } bss_len *=4; LOG_printf (LOG_DEBUG, "link: %s: bss hunk size: %d bytes.\n", sourcefn, bss_len); g_hunk_cur = getOrCreateSegment (sourcefn, String(UP_link, g_name), g_hunk_id_cnt++, AS_bssSeg, 0); strcpy (g_name, "unnamed"); g_hunk_cur->mem_size = bss_len; g_hunk_cur->mem_pos = bss_len; return TRUE; } static bool load_hunk_reloc32(string sourcefn, FILE *f) { uint32_t num_offs, hunk_id; while (TRUE) { if (!fread_u4 (f, &num_offs)) { LOG_printf (LOG_ERROR, "link: read error #10.\n"); return FALSE; } if (!num_offs) return TRUE; // finished if (!fread_u4 (f, &hunk_id)) { LOG_printf (LOG_ERROR, "link: read error #11.\n"); return FALSE; } LOG_printf (LOG_DEBUG, "link: %s: reloc32: %d offsets in hunk #%d.\n", sourcefn, num_offs, hunk_id); AS_segment seg = getOrCreateSegment (sourcefn, NULL, hunk_id, AS_unknownSeg, /*min_size=*/0); for (uint32_t i=0; i<num_offs; i++) { uint32_t off; if (!fread_u4 (f, &off)) { LOG_printf (LOG_ERROR, "link: read error #12.\n"); return FALSE; } AS_segmentAddReloc32 (g_hunk_cur, seg, off); } } return TRUE; } static bool load_hunk_ext(string sourcefn, FILE *f) { if (!g_hunk_cur) { LOG_printf (LOG_ERROR, "link: ext hunk detected when so segment is defined yet.\n"); assert(FALSE); return FALSE; } while (TRUE) { uint32_t c; if (!fread_u4 (f, &c)) { LOG_printf (LOG_ERROR, "link: read error #13.\n"); return FALSE; } if (!c) return TRUE; uint32_t ext_type = c >>24; uint32_t name_len = c & 0x00FFFFFF; name_len *=4; if (name_len>=MAX_BUF) { LOG_printf (LOG_ERROR, "link: hunk name too long.\n"); return FALSE; } if (fread (g_buf, name_len, 1, f) != 1) { LOG_printf (LOG_ERROR, "link: read error #14.\n"); return FALSE; } g_buf[name_len] = 0; LOG_printf (LOG_DEBUG, "link: %s: hunk_ext: ext_type=%d, name_len=%d, name=%s\n", sourcefn, ext_type, name_len, g_buf); S_symbol sym = S_Symbol ((string) g_buf, /*case_sensitive=*/FALSE); switch (ext_type) { case EXT_TYPE_REF32: { uint32_t num_refs; if (!fread_u4 (f, &num_refs)) { LOG_printf (LOG_ERROR, "link: read error #15.\n"); return FALSE; } for (uint32_t i=0; i<num_refs; i++) { uint32_t offset; if (!fread_u4 (f, &offset)) { LOG_printf (LOG_ERROR, "link: read error #16.\n"); return FALSE; } AS_segmentAddRef (g_hunk_cur, sym, offset, Temp_w_L, /*common_size=*/0); } break; } case EXT_TYPE_COMMON: { uint32_t common_size; if (!fread_u4 (f, &common_size)) { LOG_printf (LOG_ERROR, "link: read error #17.\n"); return FALSE; } uint32_t num_refs; if (!fread_u4 (f, &num_refs)) { LOG_printf (LOG_ERROR, "link: read error #18.\n"); return FALSE; } for (uint32_t i=0; i<num_refs; i++) { uint32_t offset; if (!fread_u4 (f, &offset)) { LOG_printf (LOG_ERROR, "link: read error #19.\n"); return FALSE; } AS_segmentAddRef (g_hunk_cur, sym, offset, Temp_w_L, /*common_size=*/common_size); } break; } case EXT_TYPE_DEF: { uint32_t offset; if (!fread_u4 (f, &offset)) { LOG_printf (LOG_ERROR, "link: read error #20.\n"); return FALSE; } AS_segmentAddDef (g_hunk_cur, sym, offset); LOG_printf (LOG_DEBUG, "link: %s: -> ext_def, offset=0x%08x\n", sourcefn, offset); break; } case EXT_TYPE_ABS: { uint32_t v; if (!fread_u4 (f, &v)) { LOG_printf (LOG_ERROR, "link: read error #21.\n"); return FALSE; } // FIXME AS_segmentAddDef (g_hunk_cur, sym, v); LOG_printf (LOG_DEBUG, "link: %s: -> ext_abs, v=0x%08x\n", sourcefn, v); break; } case EXT_TYPE_ABSREF16: { uint32_t num_refs; if (!fread_u4 (f, &num_refs)) { LOG_printf (LOG_ERROR, "link: read error #22.\n"); return FALSE; } for (uint32_t i=0; i<num_refs; i++) { uint32_t v; if (!fread_u4 (f, &v)) { LOG_printf (LOG_ERROR, "link: read error #23.\n"); return FALSE; } // FIXME AS_segmentAddRef (g_hunk_cur, sym, v, Temp_w_L, /*common_size=*/0); LOG_printf (LOG_DEBUG, "link: %s: -> ext_absref16, v=0x%08x\n", sourcefn, v); } break; } default: LOG_printf (LOG_ERROR, "link: FIXME: ext type %d not implemented yet.\n", ext_type); assert(FALSE); } } return TRUE; } bool LI_segmentListReadObjectFile (LI_segmentList sl, string sourcefn, FILE *f) { uint32_t ht; if (!fread_u4 (f, &ht)) { LOG_printf (LOG_ERROR, "link: read error #24.\n"); return FALSE; } LOG_printf (LOG_DEBUG, "link: %s: hunk type: %08x\n", sourcefn, ht); if (ht != HUNK_TYPE_UNIT) { LOG_printf (LOG_ERROR, "link: %s: this is not an object file, header mismatch: found 0x%08x, expected %08x\n", sourcefn, ht, HUNK_TYPE_UNIT); } if (!load_hunk_unit(f)) return FALSE; strcpy (g_name, "unnamed"); while (TRUE) { if (!fread_u4 (f, &ht)) break; LOG_printf (LOG_DEBUG, "link: %s: hunk type: %08x\n", sourcefn, ht); switch (ht) { case HUNK_TYPE_UNIT: if (!load_hunk_unit(f)) return FALSE; break; case HUNK_TYPE_NAME: if (!load_hunk_name(sourcefn, f)) return FALSE; break; case HUNK_TYPE_CODE: if (!load_hunk_code(sourcefn, f)) return FALSE; break; case HUNK_TYPE_DATA: if (!load_hunk_data(sourcefn, f)) return FALSE; break; case HUNK_TYPE_BSS: if (!load_hunk_bss(sourcefn, f)) return FALSE; break; case HUNK_TYPE_RELOC32: if (!load_hunk_reloc32(sourcefn, f)) return FALSE; break; case HUNK_TYPE_EXT: if (!load_hunk_ext(sourcefn, f)) return FALSE; break; case HUNK_TYPE_END: if (!g_hunk_cur) { LOG_printf (LOG_ERROR, "link: hunk_end detected when no hunk was defined.\n"); return FALSE; } LI_segmentListAppend (sl, g_hunk_cur); g_hunk_cur = NULL; break; default: LOG_printf (LOG_ERROR, "link: unknown hunk type 0x%08x.\n", ht); assert(FALSE); return FALSE; } } return TRUE; } typedef struct symInfo_ *symInfo; struct symInfo_ { AS_segment seg; uint32_t offset; }; bool LI_link (LI_segmentList sl) { TAB_table symTable = TAB_empty(UP_link); // S_symbol -> symInfo // pass 1: collect all symbol definitions from all segments, // assign unique hunk_ids uint32_t hunk_id = 0; for (LI_segmentListNode node = sl->first; node; node=node->next) { for (AS_segmentDef def = node->seg->defs; def; def=def->next) { LOG_printf (LOG_DEBUG, "link: pass1: found definition for symbol %-20s (%p): offset=0x%08x at hunk #%02d (%s)\n", S_name (def->sym), def->sym, def->offset, node->seg->hunk_id, node->seg->sourcefn); symInfo si = (symInfo) TAB_look (symTable, def->sym); if (si) { char msg[256]; snprintf(msg, 256, "symbol %s defined more than once!", S_name(def->sym)); link_fail (msg); } si = U_poolAlloc (UP_link, sizeof(*si)); si->seg = node->seg; si->offset = def->offset; TAB_enter (symTable, def->sym, si); } node->seg->hunk_id = hunk_id++; } // pass 2: resolve external references AS_segment commonSeg = NULL; for (LI_segmentListNode node = sl->first; node; node=node->next) { if (!node->seg->refs) continue; TAB_iter i = TAB_Iter (node->seg->refs); S_symbol sym; AS_segmentRef sr; while (TAB_next (i, (void **)&sym, (void**) &sr)) { symInfo si = TAB_look (symTable, sym); if (!si) { if (!sr->common_size) { LOG_printf (LOG_ERROR, "link: *** ERROR: unresolved symbol %s (%p)\n\n", S_name(sym), sym); return FALSE; } if (!commonSeg) { commonSeg = AS_Segment ("common", "common", AS_dataSeg, 0); commonSeg->hunk_id = hunk_id++; LI_segmentListAppend (sl, commonSeg); } si = U_poolAlloc (UP_link, sizeof(*si)); si->seg = commonSeg; si->offset = commonSeg->mem_pos; LOG_printf (LOG_DEBUG, "link: symbol %s allocated in common segment at offset 0x%08x, common_size=%zd\n", S_name(sym), si->offset, sr->common_size); TAB_enter (symTable, sym, si); AS_assembleDataFill (commonSeg, sr->common_size); } assert (sr->w == Temp_w_L); // FIXME while (sr) { LOG_printf (LOG_DEBUG, "link: pass2: adding reloc32 for symbol %-20s in hunk #%02d at offset 0x%08x -> hunk #%02d, offset 0x%08x\n", S_name (sym), node->seg->hunk_id, sr->offset, si->seg->hunk_id, si->offset); uint32_t *p = (uint32_t *) (node->seg->mem+sr->offset); *p = ENDIAN_SWAP_32(si->offset); AS_segmentAddReloc32 (node->seg, si->seg, sr->offset); #if LOG_LEVEL == LOG_DEBUG //hexdump (node->seg->mem, sr->offset-4, 16); #endif sr = sr->next; } } } return TRUE; } static void fwrite_u4(FILE *f, uint32_t u) { u = ENDIAN_SWAP_32 (u); if (fwrite (&u, 4, 1, f) != 1) link_fail ("write error"); } static void write_hunk_unit (string name, FILE *f) { fwrite_u4 (f, HUNK_TYPE_UNIT); uint32_t l = strlen(name); uint32_t n = roundUp(l, 4) / 4; LOG_printf (LOG_DEBUG, "link: write hunk unit %s, n=%d\n", name, n); fwrite_u4 (f, n); if (fwrite (name, n*4, 1, f) != 1) link_fail ("write error"); } static void write_hunk_header (LI_segmentList sl, FILE *f) { fwrite_u4 (f, HUNK_TYPE_HEADER); fwrite_u4 (f, 0); // no hunk names uint32_t hunkCnt = 0; for (LI_segmentListNode n = sl->first; n; n=n->next) hunkCnt++; fwrite_u4 (f, hunkCnt); fwrite_u4 (f, 0); fwrite_u4 (f, hunkCnt-1); for (LI_segmentListNode n = sl->first; n; n=n->next) { uint32_t nw = roundUp(n->seg->mem_pos, 4) / 4; fwrite_u4 (f, nw); } } static void write_hunk_name (AS_segment seg, FILE *f) { fwrite_u4 (f, HUNK_TYPE_NAME); uint32_t l = strlen(seg->name); uint32_t n = roundUp(l, 4) / 4; LOG_printf (LOG_DEBUG, "link: write hunk name %s, n=%d\n", seg->name, n); fwrite_u4 (f, n); if (fwrite (seg->name, n*4, 1, f) != 1) link_fail ("write error"); } static void write_hunk_code (AS_segment seg, FILE *f) { fwrite_u4 (f, HUNK_TYPE_CODE); uint32_t n = roundUp(seg->mem_pos, 4) / 4; LOG_printf (LOG_DEBUG, "link: code section, size=%zd bytes\n", seg->mem_pos); fwrite_u4 (f, n); if (n>0) { if (fwrite (seg->mem, n*4, 1, f) != 1) link_fail ("write error"); } } static void write_hunk_data (AS_segment seg, FILE *f) { fwrite_u4 (f, HUNK_TYPE_DATA); uint32_t n = roundUp(seg->mem_pos, 4) / 4; LOG_printf (LOG_DEBUG, "link: data section, size=%zd bytes\n", seg->mem_pos); fwrite_u4 (f, n); if (n>0) { if (fwrite (seg->mem, n*4, 1, f) != 1) link_fail ("write error"); } } static void write_hunk_bss (AS_segment seg, FILE *f) { fwrite_u4 (f, HUNK_TYPE_BSS); uint32_t n = roundUp(seg->mem_pos, 4) / 4; fwrite_u4 (f, n); } static void write_hunk_reloc32 (AS_segment seg, FILE *f) { if (!seg->relocs) return; fwrite_u4 (f, HUNK_TYPE_RELOC32); TAB_iter segIter = TAB_Iter (seg->relocs); AS_segment seg_to; AS_segmentReloc32 relocs; while (TAB_next (segIter, (void **)&seg_to, (void **)&relocs)) { uint32_t cnt = 0; for (AS_segmentReloc32 r = relocs; r; r=r->next) cnt++; fwrite_u4 (f, cnt); fwrite_u4 (f, seg_to->hunk_id); uint32_t i = 0; for (AS_segmentReloc32 r = relocs; r; r=r->next) { fwrite_u4 (f, r->offset); i++; } } fwrite_u4 (f, 0); // end marker } #ifdef ENABLE_SYMBOL_HUNK static void write_hunk_symbol (AS_segment seg, FILE *f) { if (!seg->defs) return; fwrite_u4 (f, HUNK_TYPE_SYMBOL); for (AS_segmentDef def = seg->defs; def; def=def->next) { string name = S_name (def->sym); uint32_t l = strlen(name); uint32_t n = roundUp(l,4)/4; fwrite_u4 (f, n); if (fwrite (name, n*4, 1, f) != 1) link_fail ("write error"); fwrite_u4 (f, def->offset); } fwrite_u4 (f, 0); } #endif static void write_hunk_ext (AS_segment seg, FILE *f) { if (!seg->defs && !seg->refs) return; fwrite_u4 (f, HUNK_TYPE_EXT); if (seg->refs) { TAB_iter i = TAB_Iter(seg->refs); S_symbol sym; AS_segmentRef ref; while (TAB_next(i, (void **) &sym, (void **)&ref)) { string name = S_name (sym); uint32_t l = strlen(name); uint32_t n = roundUp(l,4)/4; uint32_t c = (EXT_TYPE_REF32<<24) | n; fwrite_u4 (f, c); if (n>0) { if (fwrite (name, n*4, 1, f) != 1) link_fail ("write error"); } uint32_t cnt=0; for (AS_segmentRef r=ref; r; r=r->next) cnt++; fwrite_u4 (f, cnt); for (AS_segmentRef r=ref; r; r=r->next) fwrite_u4 (f, r->offset); } } for (AS_segmentDef def = seg->defs; def; def=def->next) { string name = S_name (def->sym); uint32_t l = strlen(name); uint32_t n = roundUp(l,4)/4; uint32_t c = (EXT_TYPE_DEF<<24) | n; fwrite_u4 (f, c); if (n>0) { if (fwrite (name, n*4, 1, f) != 1) link_fail ("write error"); } fwrite_u4 (f, def->offset); } fwrite_u4 (f, 0); } static void write_hunk_end (FILE *f) { fwrite_u4 (f, HUNK_TYPE_END); } void LI_segmentWriteObjectFile (AS_object obj, string objfn) { g_fObjFile = fopen(objfn, "w"); if (!g_fObjFile) { LOG_printf (LOG_ERROR, "*** ERROR: failed to open %s for writing.\n\n", objfn); exit(128); } write_hunk_unit (objfn, g_fObjFile); write_hunk_name (obj->codeSeg, g_fObjFile); write_hunk_code (obj->codeSeg, g_fObjFile); write_hunk_reloc32 (obj->codeSeg, g_fObjFile); write_hunk_ext (obj->codeSeg, g_fObjFile); write_hunk_end (g_fObjFile); write_hunk_name (obj->dataSeg, g_fObjFile); write_hunk_data (obj->dataSeg, g_fObjFile); write_hunk_reloc32 (obj->dataSeg, g_fObjFile); write_hunk_ext (obj->dataSeg, g_fObjFile); write_hunk_end (g_fObjFile); fclose (g_fObjFile); g_fObjFile = NULL; LOG_printf (LOG_INFO, "link: created load file: %s\n", objfn); } void LI_segmentListWriteLoadFile (LI_segmentList sl, string loadfn) { g_fLoadFile = fopen(loadfn, "w"); if (!g_fLoadFile) { LOG_printf (LOG_ERROR, "*** ERROR: failed to open %s for writing.\n\n", loadfn); exit(128); } write_hunk_header (sl, g_fLoadFile); for (LI_segmentListNode n = sl->first; n; n=n->next) { switch (n->seg->kind) { case AS_codeSeg: //write_hunk_name (n->seg, g_fLoadFile); write_hunk_code (n->seg, g_fLoadFile); write_hunk_reloc32 (n->seg, g_fLoadFile); #ifdef ENABLE_SYMBOL_HUNK write_hunk_symbol (n->seg, g_fLoadFile); #endif write_hunk_end (g_fLoadFile); break; case AS_dataSeg: //write_hunk_name (n->seg, g_fLoadFile); write_hunk_data (n->seg, g_fLoadFile); write_hunk_reloc32 (n->seg, g_fLoadFile); #ifdef ENABLE_SYMBOL_HUNK write_hunk_symbol (n->seg, g_fLoadFile); #endif write_hunk_end (g_fLoadFile); break; case AS_bssSeg: //write_hunk_name (n->seg, g_fLoadFile); write_hunk_bss (n->seg, g_fLoadFile); write_hunk_reloc32 (n->seg, g_fLoadFile); #ifdef ENABLE_SYMBOL_HUNK write_hunk_symbol (n->seg, g_fLoadFile); #endif write_hunk_end (g_fLoadFile); break; default: LOG_printf (LOG_ERROR, "***error: unknown segment kind %d !\n", n->seg->kind); fflush (g_fLoadFile); assert(FALSE); } } fclose (g_fLoadFile); g_fLoadFile = NULL; LOG_printf (LOG_INFO, "link: created load file: %s\n", loadfn); }
28.108527
209
0.526003
[ "object" ]
71ef168937913a887a00ec5fd4d4eef6316c36d0
4,948
h
C
DrunkenIronman/Util.h
mbikovitsky/drunken-ironman
3fb688968ec0802235bcdf2b6b697a0154ae2d98
[ "MIT" ]
7
2017-05-26T15:03:08.000Z
2019-09-27T17:18:21.000Z
DrunkenIronman/Util.h
mbikovitsky/drunken-ironman
3fb688968ec0802235bcdf2b6b697a0154ae2d98
[ "MIT" ]
1
2016-09-29T12:53:06.000Z
2021-08-21T18:37:53.000Z
DrunkenIronman/Util.h
mbikovitsky/drunken-ironman
3fb688968ec0802235bcdf2b6b697a0154ae2d98
[ "MIT" ]
2
2016-08-22T19:51:08.000Z
2018-04-20T14:28:37.000Z
/** * @file Util.h * @author biko * @date 2016-07-30 * * Miscellaneous user-mode utilities. */ #pragma once /** Headers *************************************************************/ #include <Windows.h> #include <Common.h> /** Macros **************************************************************/ /** * Closes a kernel handle and resets it to NULL. */ #define CLOSE_HANDLE(hObject) CLOSE((hObject), CloseHandle) /** * Closes a kernel handle and resets it to INVALID_HANDLE_VALUE. */ #define CLOSE_FILE_HANDLE(hFile) CLOSE_TO_VALUE((hFile), CloseHandle, INVALID_HANDLE_VALUE) /** * Releases an object that implements IUnknown. */ #define RELEASE(piObject) \ if (NULL != (piObject)) \ { \ (piObject)->lpVtbl->Release(piObject); \ (piObject) = NULL; \ } /** * Allocates memory from the process heap. */ #define HEAPALLOC(cbSize) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (cbSize)) /** * Frees memory allocated from the process heap, * then resets the pointer to NULL. */ #define HEAPFREE(pvMemory) CLOSE((pvMemory), util_HeapFree) /** Functions ***********************************************************/ /** * Frees memory allocated from the process heap. * * @param[in] pvMemory Memory to free. */ STATIC FORCEINLINE VOID util_HeapFree( _In_ PVOID pvMemory ) { if (NULL != pvMemory) { (VOID)HeapFree(GetProcessHeap(), 0, pvMemory); } } /** * Reads a resource from a loaded image. * * @param[in] hModule Image to read the resource from. * @param[in] pszResourceName The resource name. * This is the same as the lpName parameter * in the FindResourceEx function. * @param[in] pszResourceType The resource type. * This is the same as the lpType parameter * in the FindResourceEx function. * @param[in] eLanguage Language of the resource to retrieve. * This is the same as the wLanguage parameter * in the FindResourceEx function. * @param[out] ppvResource Will receive a copy of the resource's data. * @param[out] pcbResource Will receive the size of the resource. * * @returns HRESULT * * @see FindResourceEx */ HRESULT UTIL_ReadResource( _In_ HMODULE hModule, _In_ PCWSTR pszResourceName, _In_ PCWSTR pszResourceType, _In_ WORD eLanguage, _Outptr_result_bytebuffer_(*pcbResource) PVOID * ppvResource, _Out_ PDWORD pcbResource ); /** * Retrieves a registry value. Strings are always terminated. * * @param[in] hKey Registry key to retrieve the value from. * @param[in] pwszSubkey Optional subkey. * @param[in] pwszValue Value to retrieve. If NULL, the default value is returned. * @param[out] ppvData Will receive the value's data. * @param[out] pcbData Will receive the data size. * @param[out] peType Will receive the data's type. * * @returns HRESULT * * @remark Empty values are treated the same way as nonexistent values. * @remark Strings are always returned as Unicode. * @remark Free the returned data to the process heap. */ HRESULT UTIL_RegGetValue( _In_ HKEY hKey, _In_opt_ PCWSTR pwszSubkey, _In_opt_ PCWSTR pwszValue, _Outptr_result_bytebuffer_(*pcbData) PVOID * ppvData, _Out_ PDWORD pcbData, _Out_ PDWORD peType ); /** * Expands environment variables in a string. * * @param[in] pwszSource String to process. * @param[out] ppwszExpanded Will receive the expanded string. * * @returns HRESULT * * @remark Free the returned string to the process heap. */ HRESULT UTIL_ExpandEnvironmentStrings( _In_ PCWSTR pwszSource, _Outptr_ PWSTR * ppwszExpanded ); /** * Writes a buffer into a temporary file. * * @param[in] pvBuffer Buffer to write. * @param[in] cbBuffer Size of the buffer, in bytes. * @param[in] ppwzTempPath Will receive the path of the created file. * * @returns HRESULT * * @remark Free the returned path to the process heap. */ HRESULT UTIL_WriteToTemporaryFile( _In_reads_bytes_(cbBuffer) PVOID pvBuffer, _In_ DWORD cbBuffer, _Outptr_ PWSTR * ppwzTempPath ); /** * Converts a Unicode string to an ANSI string. * * @param[in] pwszSource String to convert. * @param[out] ppszDestination Will receive the converted string. * * @returns HRESULT * * @remark Free the returned string to the process heap. */ HRESULT UTIL_DuplicateStringUnicodeToAnsi( _In_ PCWSTR pwszSource, _Outptr_ PSTR * ppszDestination ); /** * @brief Reads a whole file into memory. * * @param[in] pwszFilename Name of the file to read. * @param[out] ppvFileContents Will receive the file data. * @param[out] pcbFileContents Will receive the size of the returned buffer, in bytes. * * @return HRESULT * * @remark Free the returned buffer to the process heap. */ HRESULT UTIL_ReadFile( _In_ PCWSTR pwszFilename, _Outptr_result_bytebuffer_(*pcbFileContents) PVOID * ppvFileContents, _Out_ PSIZE_T pcbFileContents );
25.637306
91
0.672999
[ "object" ]
71f125020d5101f649debb150d8e7b5c02a7302c
4,422
h
C
src/Util/RLGlue/EnvServer.h
cameron-upright/LifeSim
cc0cf3fed5fea28198b9e4a76ff8562c3e00d9e1
[ "MIT" ]
null
null
null
src/Util/RLGlue/EnvServer.h
cameron-upright/LifeSim
cc0cf3fed5fea28198b9e4a76ff8562c3e00d9e1
[ "MIT" ]
null
null
null
src/Util/RLGlue/EnvServer.h
cameron-upright/LifeSim
cc0cf3fed5fea28198b9e4a76ff8562c3e00d9e1
[ "MIT" ]
null
null
null
#ifndef RL_GLUE_ENV_SERVER_H #define RL_GLUE_ENV_SERVER_H #include "RLGlue++.h" namespace RLGlue { class EnvServerConnection : public boost::enable_shared_from_this<EnvServerConnection> { public: typedef boost::shared_ptr<EnvServerConnection> pointer; static pointer create(boost::asio::io_service& io_service, Env &env) { return pointer(new EnvServerConnection(io_service, env)); } boost::asio::ip::tcp::socket& socket() { return socket_; } void start() { readCommand(); } private: EnvServerConnection(boost::asio::io_service& io_service, Env &env) : env_(env), socket_(io_service) {} void readCommand() { headerReadBuffer_.resize(1); boost::asio::async_read(socket_, boost::asio::buffer(headerReadBuffer_), boost::bind(&EnvServerConnection::handleReadCommand, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } // TODO : Refactor to an asyncReadCommand function void handleReadCommand(const boost::system::error_code& error, size_t num_bytes) { if (error) return; bodyReadBuffer_.resize(headerReadBuffer_[0]); boost::asio::async_read(socket_, boost::asio::buffer(bodyReadBuffer_), boost::bind(&EnvServerConnection::handleReadCommandBody, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } void handleReadCommandBody(const boost::system::error_code& error, size_t num_bytes) { if (error) return; std::string cmdBodyStr(bodyReadBuffer_.begin(), bodyReadBuffer_.end()); RLGlue::EnvironmentCommand cmd; cmd.ParseFromString(cmdBodyStr); switch (cmd.type()) { case RLGlue::EnvironmentCommand_Type_ENV_INIT: // Init and then wait for the next command env_.init(); readCommand(); break; case RLGlue::EnvironmentCommand_Type_ENV_START: { // TODO : Fix this std::shared_ptr<::google::protobuf::Message> stateDesc(new StateDesc(env_.start())); // Start a new episode, and send the start state back asyncWriteMessage(socket_, stateDesc, boost::bind(&EnvServerConnection::handleWriteResponse, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); break; } case RLGlue::EnvironmentCommand_Type_ENV_STEP: { // Get the action const ActionDesc &action = cmd.stepcommand().action(); // TODO : Fix this std::shared_ptr<::google::protobuf::Message> rewardStateTerminal(new RewardStateTerminal(env_.step(action))); // Step the environment, and send the resulting RewardStateTerminal message asyncWriteMessage(socket_, rewardStateTerminal, boost::bind(&EnvServerConnection::handleWriteResponse, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); break; } case RLGlue::EnvironmentCommand_Type_ENV_CLEANUP: // Cleanup the env, and then do nothing (ending the ASIO run loop) env_.cleanup(); break; default: break; } } void handleWriteResponse(const boost::system::error_code& error, size_t num_bytes) { if (error) return; readCommand(); } Env &env_; boost::asio::ip::tcp::socket socket_; std::vector<size_t> headerReadBuffer_; std::vector<char> bodyReadBuffer_; }; class EnvServer { public: EnvServer(boost::asio::io_service& io_service, Env &env) : acceptor_(io_service, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), 1337)), env_(env) { start_accept(); } private: void start_accept() { RLGlue::EnvServerConnection::pointer new_connection = RLGlue::EnvServerConnection::create(acceptor_.get_io_service(), env_); acceptor_.async_accept(new_connection->socket(), boost::bind(&EnvServer::handle_accept, this, new_connection, boost::asio::placeholders::error)); } void handle_accept(RLGlue::EnvServerConnection::pointer new_connection, const boost::system::error_code& error) { if (!error) new_connection->start(); } boost::asio::ip::tcp::acceptor acceptor_; Env &env_; }; } #endif // RL_GLUE_ENV_SERVER_H
23.03125
114
0.670737
[ "vector" ]
71f6f5aacfa661b669d18c827f0d0fa07796307e
3,424
h
C
3rdparty/webkit/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h
mchiasson/PhaserNative
f867454602c395484bf730a7c43b9c586c102ac2
[ "MIT" ]
1
2021-05-27T07:29:31.000Z
2021-05-27T07:29:31.000Z
WebKit2-7604.1.38.0.7/WebKit2-7604.1.38.0.7/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h
mlcldh/appleWebKit2
39cc42a4710c9319c8da269621844493ab2ccdd6
[ "MIT" ]
9
2020-04-18T18:47:18.000Z
2020-04-18T18:52:41.000Z
Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h
ijsf/DeniseEmbeddableWebKit
57dfc6783d60f8f59b7129874e60f84d8c8556c9
[ "BSD-3-Clause" ]
1
2019-01-25T13:55:25.000Z
2019-01-25T13:55:25.000Z
/* * This file is part of the WebKit open source project. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #if !defined(__WEBKITDOM_H_INSIDE__) && !defined(BUILDING_WEBKIT) #error "Only <webkitdom/webkitdom.h> can be included directly." #endif #ifndef WebKitDOMMediaList_h #define WebKitDOMMediaList_h #include <glib-object.h> #include <webkitdom/WebKitDOMObject.h> #include <webkitdom/webkitdomdefines.h> G_BEGIN_DECLS #define WEBKIT_DOM_TYPE_MEDIA_LIST (webkit_dom_media_list_get_type()) #define WEBKIT_DOM_MEDIA_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_MEDIA_LIST, WebKitDOMMediaList)) #define WEBKIT_DOM_MEDIA_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_DOM_TYPE_MEDIA_LIST, WebKitDOMMediaListClass) #define WEBKIT_DOM_IS_MEDIA_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_DOM_TYPE_MEDIA_LIST)) #define WEBKIT_DOM_IS_MEDIA_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_DOM_TYPE_MEDIA_LIST)) #define WEBKIT_DOM_MEDIA_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_DOM_TYPE_MEDIA_LIST, WebKitDOMMediaListClass)) struct _WebKitDOMMediaList { WebKitDOMObject parent_instance; }; struct _WebKitDOMMediaListClass { WebKitDOMObjectClass parent_class; }; WEBKIT_API GType webkit_dom_media_list_get_type(void); /** * webkit_dom_media_list_item: * @self: A #WebKitDOMMediaList * @index: A #gulong * * Returns: A #gchar **/ WEBKIT_API gchar* webkit_dom_media_list_item(WebKitDOMMediaList* self, gulong index); /** * webkit_dom_media_list_delete_medium: * @self: A #WebKitDOMMediaList * @oldMedium: A #gchar * @error: #GError * **/ WEBKIT_API void webkit_dom_media_list_delete_medium(WebKitDOMMediaList* self, const gchar* oldMedium, GError** error); /** * webkit_dom_media_list_append_medium: * @self: A #WebKitDOMMediaList * @newMedium: A #gchar * @error: #GError * **/ WEBKIT_API void webkit_dom_media_list_append_medium(WebKitDOMMediaList* self, const gchar* newMedium, GError** error); /** * webkit_dom_media_list_get_media_text: * @self: A #WebKitDOMMediaList * * Returns: A #gchar **/ WEBKIT_API gchar* webkit_dom_media_list_get_media_text(WebKitDOMMediaList* self); /** * webkit_dom_media_list_set_media_text: * @self: A #WebKitDOMMediaList * @value: A #gchar * @error: #GError * **/ WEBKIT_API void webkit_dom_media_list_set_media_text(WebKitDOMMediaList* self, const gchar* value, GError** error); /** * webkit_dom_media_list_get_length: * @self: A #WebKitDOMMediaList * * Returns: A #gulong **/ WEBKIT_API gulong webkit_dom_media_list_get_length(WebKitDOMMediaList* self); G_END_DECLS #endif /* WebKitDOMMediaList_h */
30.571429
134
0.772196
[ "object" ]
71f75ac0f2736abcfa86e34a76fea4167a1ac052
5,995
h
C
include/struct_mapping/object_map_like.h
cmachaca/struct_mapping
12e37346afa3cefe880f9efd0dd1475a67ad67f8
[ "MIT" ]
57
2020-06-12T23:32:57.000Z
2022-03-19T03:19:07.000Z
include/struct_mapping/object_map_like.h
cmachaca/struct_mapping
12e37346afa3cefe880f9efd0dd1475a67ad67f8
[ "MIT" ]
10
2020-07-24T18:06:56.000Z
2022-03-31T14:36:06.000Z
include/struct_mapping/object_map_like.h
cmachaca/struct_mapping
12e37346afa3cefe880f9efd0dd1475a67ad67f8
[ "MIT" ]
13
2020-07-15T16:24:19.000Z
2022-02-16T08:11:56.000Z
#pragma once #include "iterate_over.h" #include "member_string.h" #include "object.h" #include "options/option_not_empty.h" #include "utility.h" #include <limits> #include <string> #include <type_traits> #include <utility> namespace struct_mapping::detail { template<typename T> class Object<T, false, true> { public: using Iterator = typename T::iterator; template<typename V> using ValueType = typename V::mapped_type; public: static void check_not_empty(T& o, const std::string& name) { NotEmpty<>::check_result(o, name); } static void init(T&) {} static void iterate_over(T& o, const std::string& name) { IterateOver::start_struct(name); for (auto& [n, v] : o) { if constexpr (std::is_same_v<ValueType<T>, bool>) { IterateOver::set<bool>(n, v); } else if constexpr (std::is_integral_v<ValueType<T>>) { IterateOver::set<long long>(n, v); } else if constexpr (std::is_floating_point_v<ValueType<T>>) { IterateOver::set<double>(n, v); } else if constexpr (std::is_same_v<ValueType<T>, std::string>) { IterateOver::set<std::string>(n, v); } else if constexpr (std::is_enum_v<ValueType<T>>) { IterateOver::set<std::string>(n, MemberString<ValueType<T>>::to_string()(v)); } else { if (IsMemberStringExist<ValueType<T>>::value) { IterateOver::set<std::string>(n, MemberString<ValueType<T>>::to_string()(v)); } else { Object<ValueType<T>>::iterate_over(v, n); } } } IterateOver::end_struct(); } static bool release(T&) { if (!used) { return true; } else { if constexpr (is_complex_v<ValueType<T>>) { if (Object<ValueType<T>>::release(get_last_inserted())) { used = false; } } } return false; } static void reset() { used = false; } static void set_bool(T& o, const std::string& name, bool value) { if (!used) { if constexpr (std::is_same_v<ValueType<T>, bool>) { insert(o, name, value); } else { throw StructMappingException( "bad type (bool) '" + (value ? std::string("true") : std::string("false")) + "' at name '" + name + "' in map_like"); } } else { if constexpr (is_complex_v<ValueType<T>>) { Object<ValueType<T>>::set_bool(get_last_inserted(), name, value); } } } static void set_floating_point(T& o, const std::string& name, double value) { if (!used) { if constexpr (std::is_floating_point_v<ValueType<T>>) { if (!detail::in_limits<ValueType<T>>(value)) { throw StructMappingException( "bad value '" + std::to_string(value) + "' at name '" + name + "' in map_like is out of limits of type [" + std::to_string(std::numeric_limits<ValueType<T>>::lowest()) + " : " + std::to_string(std::numeric_limits<ValueType<T>>::max()) + "]"); } insert(o, name, static_cast<ValueType<T>>(value)); } else { throw StructMappingException( "bad type (floating point) '" + std::to_string(value) + "' at name '" + name + "' in map_like"); } } else { if constexpr (is_complex_v<ValueType<T>>) { Object<ValueType<T>>::set_floating_point(get_last_inserted(), name, value); } } } static void set_integral(T& o, const std::string& name, long long value) { if (!used) { if constexpr (detail::is_integer_or_floating_point_v<ValueType<T>>) { if (!detail::in_limits<ValueType<T>>(value)) { throw StructMappingException( "bad value '" + std::to_string(value) + "' at name '" + name + "' in map_like is out of limits of type [" + std::to_string(std::numeric_limits<ValueType<T>>::lowest()) + " : " + std::to_string(std::numeric_limits<ValueType<T>>::max()) + "]"); } insert(o, name, static_cast<ValueType<T>>(value)); } else { throw StructMappingException( "bad type (integer) '" + std::to_string(value) + "' at name '" + name + "' in map_like"); } } else { if constexpr (is_complex_v<ValueType<T>>) { Object<ValueType<T>>::set_integral(get_last_inserted(), name, value); } } } static void set_string(T& o, const std::string& name, const std::string& value) { if (!used) { if constexpr (std::is_same_v<ValueType<T>, std::string>) { insert(o, name, value); } else if constexpr (std::is_enum_v<ValueType<T>>) { insert(o, name, MemberString<ValueType<T>>::from_string()(value)); } else { if (is_complex_v<ValueType<T>>&& IsMemberStringExist<ValueType<T>>::value) { insert(o, name, MemberString<ValueType<T>>::from_string()(value)); } else { throw StructMappingException("bad type (string) '" + value + "' at name '" + name + "' in map_like"); } } } else { if constexpr (is_complex_v<ValueType<T>>) { Object<ValueType<T>>::set_string(get_last_inserted(), name, value); } } } static void use(T& o, const std::string& name) { if constexpr (is_complex_v<ValueType<T>>) { if (!used) { used = true; last_inserted = insert(o, name, ValueType<T>{}); Object<ValueType<T>>::init(get_last_inserted()); } else { Object<ValueType<T>>::use(get_last_inserted(), name); } } } private: static auto& get_last_inserted() { return last_inserted->second; } template<typename V> static Iterator insert(T& o, const std::string& name, const V& value) { if constexpr ( std::is_same_v< decltype(std::declval<T>().insert(typename T::value_type())), std::pair<Iterator, bool>>) { return o.insert(std::make_pair(name, value)).first; } if constexpr (std::is_same_v<decltype(std::declval<T>().insert(typename T::value_type())), Iterator>) { return o.insert(std::make_pair(name, value)); } } private: static inline Iterator last_inserted; static inline bool used = false; }; } // struct_mapping::detail
21.410714
106
0.607173
[ "object" ]
9c0b1b76183dcdbc791fe36ee69350dd55a24f94
755
h
C
aws-cpp-sdk-quicksight/include/aws/quicksight/model/IngestionRequestType.h
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2022-02-10T08:06:54.000Z
2022-02-10T08:06:54.000Z
aws-cpp-sdk-quicksight/include/aws/quicksight/model/IngestionRequestType.h
Neusoft-Technology-Solutions/aws-sdk-cpp
88c041828b0dbee18a297c3cfe98c5ecd0706d0b
[ "Apache-2.0" ]
1
2021-10-14T16:57:00.000Z
2021-10-18T10:47:24.000Z
aws-cpp-sdk-quicksight/include/aws/quicksight/model/IngestionRequestType.h
ravindra-wagh/aws-sdk-cpp
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
[ "Apache-2.0" ]
1
2021-11-09T11:58:03.000Z
2021-11-09T11:58:03.000Z
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/quicksight/QuickSight_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace QuickSight { namespace Model { enum class IngestionRequestType { NOT_SET, INITIAL_INGESTION, EDIT, INCREMENTAL_REFRESH, FULL_REFRESH }; namespace IngestionRequestTypeMapper { AWS_QUICKSIGHT_API IngestionRequestType GetIngestionRequestTypeForName(const Aws::String& name); AWS_QUICKSIGHT_API Aws::String GetNameForIngestionRequestType(IngestionRequestType value); } // namespace IngestionRequestTypeMapper } // namespace Model } // namespace QuickSight } // namespace Aws
22.205882
96
0.774834
[ "model" ]
9c198cc10adaae92d20b5a09cb7b27026c08eaa3
2,695
h
C
StandardTetrisMSVC2005/StandardTetrisMSVC2005/source/CPF.StandardTetris.STStrategyManager.h
TetrisAI/StandardTetris
b5cbe25541ceb45517472fe7feabea0c81fd55b0
[ "MIT" ]
7
2016-11-28T13:42:44.000Z
2021-08-05T02:34:11.000Z
StandardTetrisMSVC2005/StandardTetrisMSVC2005/source/CPF.StandardTetris.STStrategyManager.h
PowerOlive/StandardTetris
b5cbe25541ceb45517472fe7feabea0c81fd55b0
[ "MIT" ]
null
null
null
StandardTetrisMSVC2005/StandardTetrisMSVC2005/source/CPF.StandardTetris.STStrategyManager.h
PowerOlive/StandardTetris
b5cbe25541ceb45517472fe7feabea0c81fd55b0
[ "MIT" ]
8
2015-07-31T02:53:14.000Z
2020-04-12T04:36:23.000Z
// All contents of this file written by Colin Fahey ( http://colinfahey.com ) // 2007 June 4 ; Visit web site to check for any updates to this file. #ifndef STStrategyManagerHeader #define STStrategyManagerHeader #include "CPF.StandardTetris.STBoard.h" #include "CPF.StandardTetris.STPiece.h" #include "CPF.StandardTetris.STStrategy.h" // Disable unimportant "symbol too long" error for debug builds of STL string #pragma warning( disable : 4786 ) #include <string> #include <vector> using namespace std; namespace CPF { namespace StandardTetris { class STStrategyManager { private: static vector<STStrategy *> mListpSTStrategy; private: static string mCurrentStrategyName; public: static void AddStrategy( STStrategy * pStrategy ); public: static void Initialize(); // The following methods to set and get the current strategy // by name intentionally avoid validating the name with the // list of strategies. Only when the strategy is used do we // attempt to fix a specified choice. This is to make sure // that loading and saving is not affected by whether or not // required strategies are inserted in to the list. public: static void SetCurrentStrategyByName ( string strategyName ); public: static string GetCurrentStrategyName ( ); public: static STStrategy * GetCurrentStrategy( ); public: static void SelectNextStrategy ( ); // WARNING: When you get the "best" rotation and translation // from the following function, you must wait until the piece has // its origin at least as low as row 0 (zero) instead of its initial // row -1 (negative one) if any rotations (1,2,3) are required. // Perform all rotations, and then perform translations. This // avoids the problem of getting the piece jammed on the sides // of the board where rotation is impossible. *** // Also, the following strategy does not take advantage of the // possibility of using free-fall and future movements to // slide under overhangs and fill them in. public: static void GetBestMoveOncePerPiece ( STBoard & currentBoard, STPiece & currentPiece, int nextPieceFlag, // 0 == no next piece available or known int nextPieceShape, // 0 == no piece available or known int & bestRotationDelta, // 0 or {0,1,2,3} int & bestTranslationDelta // 0 or {...,-2,-1,0,1,2,...} ); public: static void GetBestMovePath ( STBoard & currentBoard, STPiece & currentPiece, int nextPieceFlag, // 0 == no next piece available or known int nextPieceShape, // 0 == no piece available or known char path[] ); }; } } #endif
24.5
77
0.700186
[ "vector" ]
9c2f8f76d1b6aa87a347c6add85349577deeaf5a
1,031
h
C
System/Library/PrivateFrameworks/iWorkImport.framework/Frameworks/TSCharts.framework/TSCH3DTextureAtlasTexture.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
1
2020-11-04T15:43:01.000Z
2020-11-04T15:43:01.000Z
System/Library/PrivateFrameworks/iWorkImport.framework/Frameworks/TSCharts.framework/TSCH3DTextureAtlasTexture.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/iWorkImport.framework/Frameworks/TSCharts.framework/TSCH3DTextureAtlasTexture.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
/* * This header is generated by classdump-dyld 1.0 * on Sunday, September 27, 2020 at 12:31:23 PM Mountain Standard Time * Operating System: Version 14.0 (Build 18A373) * Image Source: /System/Library/PrivateFrameworks/iWorkImport.framework/Frameworks/TSCharts.framework/TSCharts * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ #import <TSCharts/TSCharts-Structs.h> @class NSMutableArray, TSCH3DTextureAtlasTextureResource; @interface TSCH3DTextureAtlasTexture : NSObject { tvec2<int> mSize; float mSamples; NSMutableArray* mLabels; vector<glm::detail::tvec2<int>, std::__1::allocator<glm::detail::tvec2<int> > >* mPositions; long long mCurrentxpos; long long mCurrentypos; long long mCurrentheight; TSCH3DTextureAtlasTextureResource* mResource; } @property (nonatomic,readonly) tvec2<int> size; -(id)resource; -(void)dealloc; -(tvec2<int>)addLabel:(id)arg1 ; -(id)initWithSize:(tvec2<int>)arg1 ; -(tvec2<int>)size; -(void)p_invalidateResource; -(id)getTextureDataBuffer; @end
28.638889
110
0.770126
[ "vector" ]
9c358b71f4c99bea5eb0362e0dbe2baa1235975c
2,084
h
C
mFanWall/mFWImageProvider.h
iBuildApp/ios_module_FanWall
311dcbd73292e63d51c42f6d68ba837fc9d55d0c
[ "Apache-2.0" ]
null
null
null
mFanWall/mFWImageProvider.h
iBuildApp/ios_module_FanWall
311dcbd73292e63d51c42f6d68ba837fc9d55d0c
[ "Apache-2.0" ]
null
null
null
mFanWall/mFWImageProvider.h
iBuildApp/ios_module_FanWall
311dcbd73292e63d51c42f6d68ba837fc9d55d0c
[ "Apache-2.0" ]
null
null
null
/**************************************************************************** * * * Copyright (C) 2014-2015 iBuildApp, Inc. ( http://ibuildapp.com ) * * * * This file is part of iBuildApp. * * * * This Source Code Form is subject to the terms of the iBuildApp License. * * You can obtain one at http://ibuildapp.com/license/ * * * ****************************************************************************/ #import <Foundation/Foundation.h> #import "mFWImageConsumer.h" /** * Presents image picking dialog and provide an image either from photo gallery, * or by taking it with camera (if available). */ @interface mFWImageProvider : NSObject <UIActionSheetDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate> /** * Object conforming to mFWImageConsumer protocol. * * @see mFWImageConsumer */ @property(nonatomic, unsafe_unretained) id<mFWImageConsumer> imageConsumer; /** * View controller to present dialog with picking options on. */ @property(nonatomic, unsafe_unretained) UIViewController *presentingController; /** * Initializes image provider with consumer and presenter. * * @see mFWImageConsumer * @see presentingController */ - (instancetype) initWithImageConsumer:(id<mFWImageConsumer>)consumer andDialogPresenter:(UIViewController *)presenter; /** * Presents dialog with image picking options: camera or gallery. */ - (void) displayDialog; /** * Force imageProvider to provide an image from Gallery. */ - (void) provideAnImageFromGallery; /** * Force imageProvider to provide an image with Camera. */ - (void) provideAnImageWithCamera; @end
34.733333
80
0.521593
[ "object" ]
9c4157aab079189f7fc48094c18ed92a1e39f210
2,207
h
C
ieee-1516/src/c++/dlc/RTI/VariableLengthData.h
zhj149/OpenHLA
1fed36211e54d5dc09cc30b92a1714d5a124b82d
[ "Apache-2.0" ]
null
null
null
ieee-1516/src/c++/dlc/RTI/VariableLengthData.h
zhj149/OpenHLA
1fed36211e54d5dc09cc30b92a1714d5a124b82d
[ "Apache-2.0" ]
null
null
null
ieee-1516/src/c++/dlc/RTI/VariableLengthData.h
zhj149/OpenHLA
1fed36211e54d5dc09cc30b92a1714d5a124b82d
[ "Apache-2.0" ]
3
2021-07-08T15:13:06.000Z
2021-11-01T13:13:15.000Z
/** * IEEE 1516.1 High Level Architecture Interface Specification C++ API * * File: RTI/VariableLengthData.h */ #ifndef RTI_VariableLengthData_h #define RTI_VariableLengthData_h #include <RTI/SpecificConfig.h> // A class to hold an arbitrary array of bytes for encoded values, // attribute values, parameter values, etc. The class provides // several ways of setting data, allowing tradeoffs between // efficiency and memory management reponsibility. namespace rti1516 { // Forward declaration for the RTI-internal class // used to implement VariableLengthData class VariableLengthDataImplementation; class RTI_EXPORT VariableLengthData { public: VariableLengthData(); // Caller is free to delete inData after the call VariableLengthData(void* const inData, unsigned long inSize); // Caller is free to delete rhs after the call VariableLengthData(VariableLengthData const& rhs); ~VariableLengthData(); // This pointer should not be expected to be valid past the // lifetime of this object, or past the next time this object // is given new data void const* data() const; unsigned long size() const; // Caller is free to delete inData after the call void setData(void const* inData, unsigned long inSize); // Caller is responsible for ensuring that the data that is // pointed to is valid for the lifetime of this object, or past // the next time this object is given new data. void setDataPointer(void* inData, unsigned long inSize); // Caller gives up ownership of inData to this object. // This object assumes the responsibility of deleting inData // when it is no longer needed. void takeDataPointer(void* inData, unsigned long inSize); // Caller is free to delete rhs after the call VariableLengthData& operator=(VariableLengthData const& rhs); private: // Friend declaration for an RTI-internal class that // can access the implementation of a VariableLengthValue friend class VariableLengthDataFriend; VariableLengthDataImplementation* _impl; }; } #endif // RTI_VariableLengthData_h
31.985507
71
0.714092
[ "object" ]
33fa1b9fb4683502b7569b334d61d6569361c83b
5,641
h
C
src/include/self_driving/forecasting/forecaster.h
ScottLiao920/noisepage
4ffb238529645efcaae99255f84d002f8d7fdf7d
[ "MIT" ]
971
2020-09-13T10:24:02.000Z
2022-03-31T07:02:51.000Z
src/include/self_driving/forecasting/forecaster.h
ScottLiao920/noisepage
4ffb238529645efcaae99255f84d002f8d7fdf7d
[ "MIT" ]
1,019
2018-07-20T23:11:10.000Z
2020-09-10T06:41:42.000Z
src/include/self_driving/forecasting/forecaster.h
ScottLiao920/noisepage
4ffb238529645efcaae99255f84d002f8d7fdf7d
[ "MIT" ]
318
2018-07-23T16:48:16.000Z
2020-09-07T09:46:31.000Z
#pragma once #include <memory> #include <string> #include <unordered_map> #include <utility> #include <vector> #include "execution/exec_defs.h" #include "metrics/query_trace_metric.h" #include "self_driving/forecasting/workload_forecast.h" namespace noisepage { namespace metrics { class MetricsThread; } namespace modelserver { class ModelServerManager; } namespace settings { class SettingsManager; } namespace task { class TaskManager; } } // namespace noisepage namespace noisepage::selfdriving { /** * Class that handles the training and inference of workload forecasts */ class Forecaster { public: /** The default timeout for training forecasting models. */ static constexpr std::chrono::seconds TRAIN_FUTURE_TIMEOUT{300}; /** The default timeout for executing internal queries. */ static constexpr std::chrono::seconds INTERNAL_QUERY_FUTURE_TIMEOUT{2}; /** Describes how the workload forecast should be initialized */ enum class WorkloadForecastInitMode : uint8_t { /** * Construct the workload forecast solely from data stored in internal tables. * Passes data read from internal tables to perform inference */ INTERNAL_TABLES_WITH_INFERENCE, /** * Construct the workload forecast by inferencing data located on disk. * The inference result is not stored to internal tables in this mode. */ DISK_WITH_INFERENCE, /** * Construct the workload forecast directly from data on disk. * No inference is performed in this case. */ DISK_ONLY }; /** * Constructor for Forecaster * @param forecast_model_save_path forecast model save path * @param metrics_thread metrics thread for metrics manager * @param model_server_manager model server manager * @param settings_manager settings manager * @param task_manager task manager to submit internal jobs to * @param workload_forecast_interval Interval used in the Forecaster * @param sequence_length Length of a planning sequence * @param horizon_length Length of the planning horizon */ explicit Forecaster(std::string forecast_model_save_path, common::ManagedPointer<metrics::MetricsThread> metrics_thread, common::ManagedPointer<modelserver::ModelServerManager> model_server_manager, common::ManagedPointer<settings::SettingsManager> settings_manager, common::ManagedPointer<task::TaskManager> task_manager, uint64_t workload_forecast_interval, uint64_t sequence_length, uint64_t horizon_length) : forecast_model_save_path_(std::move(forecast_model_save_path)), metrics_thread_(metrics_thread), model_server_manager_(model_server_manager), settings_manager_(settings_manager), task_manager_(task_manager), workload_forecast_interval_(workload_forecast_interval), sequence_length_(sequence_length), horizon_length_(horizon_length) {} /** * Loads workload forecast information * @param mode Mode to initialize forecast information */ std::unique_ptr<selfdriving::WorkloadForecast> LoadWorkloadForecast(WorkloadForecastInitMode mode); /** * Performs training of the forecasting model */ void PerformTraining(); private: /** * Rerieve segment information * TODO(wz2): Addressing clustering based on this data will be left for the future. * * @param bounds (inclusive) bounds of the time range * @param success [out] indicator of whether query succeeded or not * @return segment information */ std::unordered_map<int64_t, std::vector<double>> GetSegmentInformation(std::pair<uint64_t, uint64_t> bounds, bool *success); /** * Retrieve workload metadata * @param bounds (inclusive) bounds of the time range to pull data * @param out_metadata Query Metadata from metrics * @param out_params Query parameters fro mmetrics * @return pair where first is metadata and second is flag of success */ std::pair<selfdriving::WorkloadMetadata, bool> RetrieveWorkloadMetadata( std::pair<uint64_t, uint64_t> bounds, const std::unordered_map<execution::query_id_t, metrics::QueryTraceMetadata::QueryMetadata> &out_metadata, const std::unordered_map<execution::query_id_t, std::vector<std::string>> &out_params); /** * Record the workload forecast to the internal tables * @param timestamp Timestamp to record forecast at * @param prediction Forecast model prediction * @param metadata Metadata about the queries */ void RecordWorkloadForecastPrediction(uint64_t timestamp, const selfdriving::WorkloadForecastPrediction &prediction, const WorkloadMetadata &metadata); /** * Computes the valid range of data to be pulling from the internal tables. * @param now Current timestamp of the planning/training * @param train Whether data is for training or inference * @return inclusive start and end bounds of data to query */ std::pair<uint64_t, uint64_t> ComputeTimestampDataRange(uint64_t now, bool train); std::string forecast_model_save_path_; common::ManagedPointer<metrics::MetricsThread> metrics_thread_; common::ManagedPointer<modelserver::ModelServerManager> model_server_manager_; common::ManagedPointer<settings::SettingsManager> settings_manager_; common::ManagedPointer<task::TaskManager> task_manager_; uint64_t workload_forecast_interval_; uint64_t sequence_length_; uint64_t horizon_length_; }; } // namespace noisepage::selfdriving
36.62987
118
0.729835
[ "vector", "model" ]
d51592cc5130c1886d29e4919760d771dc181590
2,377
h
C
build/linux-build/Sources/include/hxinc/zpp_nape/space/ZPP_SweepData.h
HedgehogFog/TimeOfDeath
b78abacf940e1a88c8b987d99764ebb6876c5dc6
[ "MIT" ]
null
null
null
build/linux-build/Sources/include/hxinc/zpp_nape/space/ZPP_SweepData.h
HedgehogFog/TimeOfDeath
b78abacf940e1a88c8b987d99764ebb6876c5dc6
[ "MIT" ]
null
null
null
build/linux-build/Sources/include/hxinc/zpp_nape/space/ZPP_SweepData.h
HedgehogFog/TimeOfDeath
b78abacf940e1a88c8b987d99764ebb6876c5dc6
[ "MIT" ]
null
null
null
// Generated by Haxe 4.0.0-preview.5 #ifndef INCLUDED_zpp_nape_space_ZPP_SweepData #define INCLUDED_zpp_nape_space_ZPP_SweepData #ifndef HXCPP_H #include <hxcpp.h> #endif HX_DECLARE_CLASS2(zpp_nape,geom,ZPP_AABB) HX_DECLARE_CLASS2(zpp_nape,phys,ZPP_Interactor) HX_DECLARE_CLASS2(zpp_nape,shape,ZPP_Shape) HX_DECLARE_CLASS2(zpp_nape,space,ZPP_SweepData) namespace zpp_nape{ namespace space{ class HXCPP_CLASS_ATTRIBUTES ZPP_SweepData_obj : public hx::Object { public: typedef hx::Object super; typedef ZPP_SweepData_obj OBJ_; ZPP_SweepData_obj(); public: enum { _hx_ClassId = 0x0ab31aa4 }; void __construct(); inline void *operator new(size_t inSize, bool inContainer=true,const char *inName="zpp_nape.space.ZPP_SweepData") { return hx::Object::operator new(inSize,inContainer,inName); } inline void *operator new(size_t inSize, int extra) { return hx::Object::operator new(inSize+extra,true,"zpp_nape.space.ZPP_SweepData"); } static hx::ObjectPtr< ZPP_SweepData_obj > __new(); static hx::ObjectPtr< ZPP_SweepData_obj > __alloc(hx::Ctx *_hx_ctx); static void * _hx_vtable; static Dynamic __CreateEmpty(); static Dynamic __Create(hx::DynamicArray inArgs); //~ZPP_SweepData_obj(); HX_DO_RTTI_ALL; hx::Val __Field(const ::String &inString, hx::PropertyAccess inCallProp); static bool __GetStatic(const ::String &inString, Dynamic &outValue, hx::PropertyAccess inCallProp); hx::Val __SetField(const ::String &inString,const hx::Val &inValue, hx::PropertyAccess inCallProp); static bool __SetStatic(const ::String &inString, Dynamic &ioValue, hx::PropertyAccess inCallProp); void __GetFields(Array< ::String> &outFields); static void __register(); void __Mark(HX_MARK_PARAMS); void __Visit(HX_VISIT_PARAMS); bool _hx_isInstanceOf(int inClassId); ::String __ToString() const { return HX_("ZPP_SweepData",31,3f,7b,21); } static void __boot(); static ::zpp_nape::space::ZPP_SweepData zpp_pool; ::zpp_nape::space::ZPP_SweepData next; ::zpp_nape::space::ZPP_SweepData prev; ::zpp_nape::shape::ZPP_Shape shape; ::zpp_nape::geom::ZPP_AABB aabb; void free(); ::Dynamic free_dyn(); void alloc(); ::Dynamic alloc_dyn(); bool gt( ::zpp_nape::space::ZPP_SweepData x); ::Dynamic gt_dyn(); }; } // end namespace zpp_nape } // end namespace space #endif /* INCLUDED_zpp_nape_space_ZPP_SweepData */
32.561644
115
0.753891
[ "object", "shape" ]
d516802abed58157eba179b06833f3a2adf51e4c
536
h
C
MogKit/Objective-C/NSObject+MogKit.h
mhallendal/MogKit
88d2565c687b9aee09ed1e9c81aa55c7dea45ba8
[ "MIT" ]
6
2015-02-20T18:54:27.000Z
2015-10-30T19:49:57.000Z
MogKit/Objective-C/NSObject+MogKit.h
mhallendal/MogKit
88d2565c687b9aee09ed1e9c81aa55c7dea45ba8
[ "MIT" ]
15
2015-02-21T08:22:13.000Z
2016-09-29T14:15:05.000Z
MogKit/Objective-C/NSObject+MogKit.h
hallski/MogKit
88d2565c687b9aee09ed1e9c81aa55c7dea45ba8
[ "MIT" ]
3
2015-02-21T07:34:43.000Z
2017-03-20T04:41:31.000Z
// // MogKit // // Copyright (c) 2015 Mikael Hallendal. All rights reserved. // #import <Foundation/Foundation.h> #import <MogKit/MogTransformation.h> @interface NSObject (MogKit) /** * Applies `transformation` to the object and collects the result in `reducer`. * * @param transformation the transformation to apply to the object. * @param reducer the reducer to use for collecting the result. * * @return the transformed value. */ - (id)mog_transform:(MOGTransformation)transformation reducer:(MOGReducer *)reducer; @end
21.44
84
0.735075
[ "object" ]
d51addbc79f25639e748e3747324e014c344db45
2,519
h
C
include/Rotation.h
MatthiasMichael/Geometry
d2308a39a8a2c693dbe4bc10260a352358ea291d
[ "MIT" ]
null
null
null
include/Rotation.h
MatthiasMichael/Geometry
d2308a39a8a2c693dbe4bc10260a352358ea291d
[ "MIT" ]
null
null
null
include/Rotation.h
MatthiasMichael/Geometry
d2308a39a8a2c693dbe4bc10260a352358ea291d
[ "MIT" ]
null
null
null
#pragma once #include "GeometryUtils.h" #include "CoordinateSystem.h" #include "CoordinateTransform.h" template <typename CoordinateSystem> class Rotation { public: using ScalarType = typename CoordinateSystem::TScalar; using NamedVector = typename CoordinateSystem::NamedVector; using NamedTransform = typename CoordinateSystem::NamedAffineTransform; using Degrees = typename NamedScalarTypes<ScalarType>::Degrees; using Radians = typename NamedScalarTypes<ScalarType>::Radians; Rotation(); Rotation(Degrees yaw, Degrees pitch, Degrees roll); template <typename SourceCoordinateSystem> explicit Rotation(const Rotation<SourceCoordinateSystem> & sourceRotation); NamedVector apply(const NamedVector & v); NamedTransform transform; Degrees yaw; Degrees pitch; Degrees roll; }; template <typename CoordinateSystem> Rotation<CoordinateSystem>::Rotation() : Rotation(Degrees(0), Degrees(0), Degrees(0)) { // empty } template <typename CoordinateSystem> Rotation<CoordinateSystem>::Rotation(Degrees yaw, Degrees pitch, Degrees roll) : transform(), yaw(yaw), pitch(pitch), roll(roll) { using Matrix = typename GeometricTypes<ScalarType, 3>::Matrix; const Radians angle_rotZ = deg2rad<ScalarType>(yaw); const Radians angle_rotY = deg2rad<ScalarType>(pitch); const Radians angle_rotX = deg2rad<ScalarType>(roll); const float cZ = cos(angle_rotZ.get()); const float cY = cos(angle_rotY.get()); const float cX = cos(angle_rotX.get()); const float sZ = sin(angle_rotZ.get()); const float sY = sin(angle_rotY.get()); const float sX = sin(angle_rotX.get()); Matrix mat_rotZ; Matrix mat_rotX; Matrix mat_rotY; mat_rotZ << cZ , -sZ , 0 , sZ , cZ , 0 , 0 , 0 , 1; mat_rotY << cY , 0 , -sY , 0 , 1 , 0 , sY , 0 , cY; mat_rotX << 1 , 0 , 0 , 0 , cX , sX , 0 , -sX , cX; Matrix mat_rot = mat_rotZ * mat_rotY * mat_rotX; transform = make_named<NamedTransform>(mat_rot); } template <typename CoordinateSystem> template <typename SourceCoordinateSystem> Rotation<CoordinateSystem>::Rotation(const Rotation<SourceCoordinateSystem> & sourceRotation) : transform(CoordinateTransform<SourceCoordinateSystem, CoordinateSystem>::sourceToTarget(sourceRotation.transform)), yaw(sourceRotation.yaw), pitch(sourceRotation.pitch), roll(sourceRotation.roll) { // empty } template <typename CoordinateSystem> typename Rotation<CoordinateSystem>::NamedVector Rotation<CoordinateSystem>::apply(const NamedVector & v) { return NamedVector(transform.get() * v.get()); }
23.764151
116
0.745931
[ "transform" ]
d51f88f1e8db3bce4356440cbef8485ddcbb54d9
1,916
h
C
scene_builders/plank_structure_builder.h
ppearson/ImaginePartial
9871b052f2edeb023e2845578ad69c25c5baf7d2
[ "Apache-2.0" ]
1
2018-07-10T13:36:38.000Z
2018-07-10T13:36:38.000Z
scene_builders/plank_structure_builder.h
ppearson/ImaginePartial
9871b052f2edeb023e2845578ad69c25c5baf7d2
[ "Apache-2.0" ]
null
null
null
scene_builders/plank_structure_builder.h
ppearson/ImaginePartial
9871b052f2edeb023e2845578ad69c25c5baf7d2
[ "Apache-2.0" ]
null
null
null
/* Imagine Copyright 2015-2016 Peter Pearson. 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. --------- */ #ifndef PLANKSTRUCTUREBUILDER_H #define PLANKSTRUCTUREBUILDER_H #include "scene_builder.h" #include <vector> namespace Imagine { class Vector; class StandardGeometryInstance; class Material; class PlankStructureBuilder : public SceneBuilder { public: PlankStructureBuilder(); enum StructureType { eSimpleTower1, eSquareBuilding1 }; virtual unsigned char getSceneBuilderTypeID(); virtual std::string getSceneBuilderDescription(); virtual void buildParameters(Parameters& parameters, unsigned int flags); virtual void createScene(Scene& scene); protected: void createNewPlank(std::vector<Object*>& aPlanks, const Vector& pos, const Vector& rot) const; void createNewPlank(std::vector<Object*>& aPlanks, const Vector& pos) const; void createSimpleTower1(std::vector<Object*>& aPlanks, Scene& scene); void createSquareBuilding(std::vector<Object*>& aPlanks, Scene& scene); protected: unsigned int m_width; unsigned int m_depth; StructureType m_structureType; unsigned int m_layers; bool m_makeGroup; float m_variance; float m_gap; // for mesh sizes only float m_plankLengthScale; float m_plankHeightScale; float m_plankWidthScale; std::vector<StandardGeometryInstance*> m_aSourcePlanks; }; } // namespace Imagine #endif // PLANKSTRUCTUREBUILDER_H
23.365854
96
0.764614
[ "mesh", "object", "vector" ]
d523f49766bb6a56c694ecd992d5183effb0de01
185,984
c
C
tpm/tpm_key.c
adas2/swtpm_1.2
26cf5ecdca207bb7ced644396f489c3f73d3b4a4
[ "BSD-3-Clause" ]
4
2019-03-17T07:18:34.000Z
2020-03-06T15:28:47.000Z
tpm/tpm_key.c
adas2/swtpm_1.2
26cf5ecdca207bb7ced644396f489c3f73d3b4a4
[ "BSD-3-Clause" ]
null
null
null
tpm/tpm_key.c
adas2/swtpm_1.2
26cf5ecdca207bb7ced644396f489c3f73d3b4a4
[ "BSD-3-Clause" ]
2
2019-04-12T02:14:10.000Z
2020-01-14T13:06:44.000Z
/********************************************************************************/ /* */ /* Key Handler */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ /* $Id: tpm_key.c 4716 2013-12-24 20:47:44Z kgoldman $ */ /* */ /* (c) Copyright IBM Corporation 2006, 2010. */ /* */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions are */ /* met: */ /* */ /* Redistributions of source code must retain the above copyright notice, */ /* this list of conditions and the following disclaimer. */ /* */ /* 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. */ /* */ /* Neither the names of the IBM Corporation 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. */ /********************************************************************************/ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "tpm_auth.h" #include "tpm_commands.h" #include "tpm_crypto.h" #include "tpm_cryptoh.h" #include "tpm_debug.h" #include "tpm_digest.h" #include "tpm_error.h" #include "tpm_init.h" #include "tpm_io.h" #include "tpm_load.h" #include "tpm_memory.h" #include "tpm_nonce.h" #include "tpm_nvfile.h" #include "tpm_nvram.h" #include "tpm_owner.h" #include "tpm_pcr.h" #include "tpm_sizedbuffer.h" #include "tpm_store.h" #include "tpm_structures.h" #include "tpm_startup.h" #include "tpm_permanent.h" #include "tpm_process.h" #include "tpm_ver.h" #include "tpm_key.h" /* The default RSA exponent */ unsigned char tpm_default_rsa_exponent[] = {0x01, 0x00, 0x01}; /* local prototypes */ static TPM_RESULT TPM_Key_CheckTag(TPM_KEY12 *tpm_key12); /* TPM_KEY, TPM_KEY12 These functions generally handle either a TPM_KEY or TPM_KEY12. Where structure members differ, the function checks the version or tag and adapts the processing to the structure type. This handling is opaque to the caller. */ /* TPM_Key_Init initializes a key structure. The default is TPM_KEY. Typically, a TPM_Key_Set() or TPM_Key_Load() will adjust to TPM_KEY or TPM_KEY12 */ void TPM_Key_Init(TPM_KEY *tpm_key) { printf(" TPM_Key_Init:\n"); TPM_StructVer_Init(&(tpm_key->ver)); tpm_key->keyUsage = TPM_KEY_UNINITIALIZED; tpm_key->keyFlags = 0; tpm_key->authDataUsage = 0; TPM_KeyParms_Init(&(tpm_key->algorithmParms)); TPM_SizedBuffer_Init(&(tpm_key->pcrInfo)); TPM_SizedBuffer_Init(&(tpm_key->pubKey)); TPM_SizedBuffer_Init(&(tpm_key->encData)); tpm_key->tpm_pcr_info = NULL; tpm_key->tpm_pcr_info_long = NULL; tpm_key->tpm_store_asymkey = NULL; tpm_key->tpm_migrate_asymkey = NULL; return; } /* TPM_Key_InitTag12() alters the tag and fill from TPM_KEY to TPM_KEY12 */ void TPM_Key_InitTag12(TPM_KEY *tpm_key) { printf(" TPM_Key_InitTag12:\n"); ((TPM_KEY12 *)tpm_key)->tag = TPM_TAG_KEY12; ((TPM_KEY12 *)tpm_key)->fill = 0x0000; return; } /* TPM_Key_Set() sets a TPM_KEY structure to the specified values. The tpm_pcr_info digestAtCreation is calculated. It serializes the tpm_pcr_info or tpm_pcr_info_long cache to pcrInfo. One or the other may be specified, but not both. The tag/version is set correctly. If the parent_key is NULL, encData is set to the clear text serialization of the tpm_store_asymkey member. If parent_key is not NULL, encData is not set yet, since further processing may be done before encryption. Must call TPM_Key_Delete() to free */ TPM_RESULT TPM_Key_Set(TPM_KEY *tpm_key, /* output created key */ tpm_state_t *tpm_state, TPM_KEY *parent_key, /* NULL for root keys */ TPM_DIGEST *tpm_pcrs, /* points to the TPM PCR array */ int ver, /* TPM_KEY or TPM_KEY12 */ TPM_KEY_USAGE keyUsage, /* input */ TPM_KEY_FLAGS keyFlags, /* input */ TPM_AUTH_DATA_USAGE authDataUsage, /* input */ TPM_KEY_PARMS *tpm_key_parms, /* input */ TPM_PCR_INFO *tpm_pcr_info, /* must copy */ TPM_PCR_INFO_LONG *tpm_pcr_info_long, /* must copy */ uint32_t keyLength, /* public key length in bytes */ BYTE* publicKey, /* public key byte array */ TPM_STORE_ASYMKEY *tpm_store_asymkey, /* cache TPM_STORE_ASYMKEY */ TPM_MIGRATE_ASYMKEY *tpm_migrate_asymkey) /* cache TPM_MIGRATE_ASYMKEY */ { TPM_RESULT rc = 0; TPM_STORE_BUFFER sbuffer; printf(" TPM_Key_Set:\n"); TPM_Sbuffer_Init(&sbuffer); /* version must be TPM_KEY or TPM_KEY12 */ if (rc == 0) { if ((ver != 1) && (ver != 2)) { printf("TPM_Key_Set: Error (fatal), " "TPM_KEY version %d is not 1 or 2\n", ver); rc = TPM_FAIL; /* should never occur */ } } /* either tpm_pcr_info != NULL for TPM_KEY or tpm_pcr_info_long != NULL for TPM_KEY12, but not both */ if (rc == 0) { if ((ver == 1) && (tpm_pcr_info_long != NULL)) { printf("TPM_Key_Set: Error (fatal), " "TPM_KEY and TPM_PCR_INFO_LONG both specified\n"); rc = TPM_FAIL; /* should never occur */ } } if (rc == 0) { if ((ver == 2) && (tpm_pcr_info != NULL)) { printf("TPM_Key_Set: Error (fatal), " "TPM_KEY12 and TPM_PCR_INFO both specified\n"); rc = TPM_FAIL; /* should never occur */ } } if (rc == 0) { TPM_Key_Init(tpm_key); if (ver == 2) { TPM_Key_InitTag12(tpm_key); /* change tag to TPM_KEY12 */ } tpm_key->keyUsage = keyUsage; tpm_key->keyFlags = keyFlags; tpm_key->authDataUsage = authDataUsage; rc = TPM_KeyParms_Copy(&(tpm_key->algorithmParms), /* freed by caller */ tpm_key_parms); } /* The pcrInfo serialization is deferred, since PCR data is be altered after the initial 'set'. */ if (rc == 0) { /* generate the TPM_PCR_INFO member cache, directly copying from the tpm_pcr_info */ if (tpm_pcr_info != NULL) { /* TPM_KEY */ rc = TPM_PCRInfo_CreateFromInfo(&(tpm_key->tpm_pcr_info), tpm_pcr_info); } /* generate the TPM_PCR_INFO_LONG member cache, directly copying from the tpm_pcr_info_long */ else if (tpm_pcr_info_long != NULL) { /* TPM_KEY12 */ rc = TPM_PCRInfoLong_CreateFromInfoLong(&(tpm_key->tpm_pcr_info_long), tpm_pcr_info_long); } } if (rc == 0) { /* if there are PCR's specified, set the digestAtCreation */ if (tpm_pcr_info != NULL) { rc = TPM_PCRInfo_SetDigestAtCreation(tpm_key->tpm_pcr_info, tpm_pcrs); } /* if there are PCR's specified, set the localityAtCreation, digestAtCreation */ else if (tpm_pcr_info_long != NULL) { /* TPM_KEY12 */ if (rc == 0) { rc = TPM_Locality_Set(&(tpm_key->tpm_pcr_info_long->localityAtCreation), tpm_state->tpm_stany_flags.localityModifier); } if (rc == 0) { rc = TPM_PCRInfoLong_SetDigestAtCreation(tpm_key->tpm_pcr_info_long, tpm_pcrs); } } } /* set TPM_SIZED_BUFFER pubKey */ if (rc == 0) { rc = TPM_SizedBuffer_Set(&(tpm_key->pubKey), keyLength, /* in bytes */ publicKey); } if (rc == 0) { if (tpm_store_asymkey == NULL) { printf("TPM_Key_Set: Error (fatal), No TPM_STORE_ASYMKEY supplied\n"); rc = TPM_FAIL; /* should never occur */ } } /* sanity check, currently no need to set TPM_MIGRATE_ASYMKEY */ if (rc == 0) { if (tpm_migrate_asymkey != NULL) { printf("TPM_Key_Set: Error (fatal), TPM_MIGRATE_ASYMKEY supplied\n"); rc = TPM_FAIL; /* should never occur */ } } if (rc == 0) { /* root key, no parent, just serialize the TPM_STORE_ASYMKEY structure */ if (parent_key == NULL) { if (rc == 0) { rc = TPM_StoreAsymkey_Store(&sbuffer, FALSE, tpm_store_asymkey); /* freed @1 */ } if (rc == 0) { rc = TPM_SizedBuffer_SetFromStore(&(tpm_key->encData), &sbuffer); } } } if (rc == 0) { tpm_key->tpm_store_asymkey = tpm_store_asymkey; /* cache TPM_STORE_ASYMKEY */ tpm_key->tpm_migrate_asymkey = tpm_migrate_asymkey; /* cache TPM_MIGRATE_ASYMKEY */ } /* Generate the TPM_STORE_ASYMKEY -> pubDataDigest. Serializes pcrInfo as a side effect. */ if (rc == 0) { rc = TPM_Key_GeneratePubDataDigest(tpm_key); } TPM_Sbuffer_Delete(&sbuffer); /* @1 */ return rc; } /* TPM_Key_Copy() copies the source TPM_KEY to the destination. The destination should be initialized before the call. */ TPM_RESULT TPM_Key_Copy(TPM_KEY *tpm_key_dest, TPM_KEY *tpm_key_src, TPM_BOOL copyEncData) { TPM_RESULT rc = 0; if (rc == 0) { TPM_StructVer_Copy(&(tpm_key_dest->ver), &(tpm_key_src->ver)); /* works for TPM_KEY12 also */ tpm_key_dest->keyUsage = tpm_key_src->keyUsage; tpm_key_dest->keyFlags = tpm_key_src->keyFlags; tpm_key_dest->authDataUsage = tpm_key_src->authDataUsage; rc = TPM_KeyParms_Copy(&(tpm_key_dest->algorithmParms), &(tpm_key_src->algorithmParms)); } if (rc == 0) { rc = TPM_SizedBuffer_Copy(&(tpm_key_dest->pcrInfo), &(tpm_key_src->pcrInfo)); } /* copy TPM_PCR_INFO cache */ if (rc == 0) { if (tpm_key_src->tpm_pcr_info != NULL) { /* TPM_KEY */ rc = TPM_PCRInfo_CreateFromInfo(&(tpm_key_dest->tpm_pcr_info), tpm_key_src->tpm_pcr_info); } else if (tpm_key_src->tpm_pcr_info_long != NULL) { /* TPM_KEY12 */ rc = TPM_PCRInfoLong_CreateFromInfoLong(&(tpm_key_dest->tpm_pcr_info_long), tpm_key_src->tpm_pcr_info_long); } } /* copy pubKey */ if (rc == 0) { rc = TPM_SizedBuffer_Copy(&(tpm_key_dest->pubKey), &(tpm_key_src->pubKey)); } /* copy encData */ if (rc == 0) { if (copyEncData) { rc = TPM_SizedBuffer_Copy(&(tpm_key_dest->encData), &(tpm_key_src->encData)); } } return rc; } /* TPM_Key_Load() deserialize the structure from a 'stream' 'stream_size' is checked for sufficient data returns 0 or error codes The TPM_PCR_INFO or TPM_PCR_INFO_LONG cache is set from the deserialized pcrInfo stream. After use, call TPM_Key_Delete() to free memory */ TPM_RESULT TPM_Key_Load(TPM_KEY *tpm_key, /* result */ unsigned char **stream, /* pointer to next parameter */ uint32_t *stream_size) /* stream size left */ { TPM_RESULT rc = 0; printf(" TPM_Key_Load:\n"); /* load public data, and create PCR cache */ if (rc == 0) { rc = TPM_Key_LoadPubData(tpm_key, FALSE, stream, stream_size); } /* load encDataSize and encData */ if (rc == 0) { rc = TPM_SizedBuffer_Load(&(tpm_key->encData), stream, stream_size); } return rc; } /* TPM_Key_LoadClear() load a serialized key where the TPM_STORE_ASYMKEY structure is serialized in clear text. The TPM_PCR_INFO or TPM_PCR_INFO_LONG cache is set from the deserialized pcrInfo stream. This function is used to load internal keys (e.g. EK, SRK, owner evict keys) or keys saved as part of a save state. */ TPM_RESULT TPM_Key_LoadClear(TPM_KEY *tpm_key, /* result */ TPM_BOOL isEK, /* key being loaded is EK */ unsigned char **stream, /* pointer to next parameter */ uint32_t *stream_size) /* stream size left */ { TPM_RESULT rc = 0; uint32_t storeAsymkeySize; printf(" TPM_Key_LoadClear:\n"); /* load public data */ if (rc == 0) { rc = TPM_Key_LoadPubData(tpm_key, isEK, stream, stream_size); } /* load TPM_STORE_ASYMKEY size */ if (rc == 0) { rc = TPM_Load32(&storeAsymkeySize, stream, stream_size); } /* The size might be 0 for an uninitialized internal key. That case is not an error. */ if ((rc == 0) && (storeAsymkeySize > 0)) { rc = TPM_Key_LoadStoreAsymKey(tpm_key, isEK, stream, stream_size); } return rc; } /* TPM_Key_LoadPubData() deserializes a TPM_KEY or TPM_KEY12 structure, excluding encData, to 'tpm_key'. The TPM_PCR_INFO or TPM_PCR_INFO_LONG cache is set from the deserialized pcrInfo stream. If the pcrInfo stream is empty, the caches remain NULL. deserialize the structure from a 'stream' 'stream_size' is checked for sufficient data returns 0 or error codes After use, call TPM_Key_Delete() to free memory */ TPM_RESULT TPM_Key_LoadPubData(TPM_KEY *tpm_key, /* result */ TPM_BOOL isEK, /* key being loaded is EK */ unsigned char **stream, /* pointer to next parameter */ uint32_t *stream_size) /* stream size left */ { TPM_RESULT rc = 0; printf(" TPM_Key_LoadPubData:\n"); /* peek at the first byte */ if (rc == 0) { /* TPM_KEY[0] is major (non zero) */ if ((*stream)[0] != 0) { /* load ver */ if (rc == 0) { rc = TPM_StructVer_Load(&(tpm_key->ver), stream, stream_size); } /* check ver immediately to ease debugging */ if (rc == 0) { rc = TPM_StructVer_CheckVer(&(tpm_key->ver)); } } else { /* TPM_KEY12 is tag (zero) */ /* load tag */ if (rc == 0) { rc = TPM_Load16(&(((TPM_KEY12 *)tpm_key)->tag), stream, stream_size); } /* load fill */ if (rc == 0) { rc = TPM_Load16(&(((TPM_KEY12 *)tpm_key)->fill), stream, stream_size); } if (rc == 0) { rc = TPM_Key_CheckTag((TPM_KEY12 *)tpm_key); } } } /* load keyUsage */ if (rc == 0) { rc = TPM_Load16(&(tpm_key->keyUsage), stream, stream_size); } /* load keyFlags */ if (rc == 0) { rc = TPM_KeyFlags_Load(&(tpm_key->keyFlags), stream, stream_size); } /* load authDataUsage */ if (rc == 0) { rc = TPM_Load8(&(tpm_key->authDataUsage), stream, stream_size); } /* load algorithmParms */ if (rc == 0) { rc = TPM_KeyParms_Load(&(tpm_key->algorithmParms), stream, stream_size); } /* load PCRInfo */ if ((rc == 0) && !isEK) { rc = TPM_SizedBuffer_Load(&(tpm_key->pcrInfo), stream, stream_size); } /* set TPM_PCR_INFO tpm_pcr_info cache from PCRInfo stream. If the stream is empty, a NULL is returned. */ if ((rc == 0) && !isEK) { if (((TPM_KEY12 *)tpm_key)->tag != TPM_TAG_KEY12) { /* TPM_KEY */ rc = TPM_PCRInfo_CreateFromBuffer(&(tpm_key->tpm_pcr_info), &(tpm_key->pcrInfo)); } else { /* TPM_KEY12 */ rc = TPM_PCRInfoLong_CreateFromBuffer(&(tpm_key->tpm_pcr_info_long), &(tpm_key->pcrInfo)); } } /* load pubKey */ if (rc == 0) { rc = TPM_SizedBuffer_Load(&(tpm_key->pubKey), stream, stream_size); } return rc; } /* TPM_Key_StorePubData() serializes a TPM_KEY or TPM_KEY12 structure, excluding encData, appending results to 'sbuffer'. As a side effect, it serializes the tpm_pcr_info cache to pcrInfo. */ TPM_RESULT TPM_Key_StorePubData(TPM_STORE_BUFFER *sbuffer, TPM_BOOL isEK, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; printf(" TPM_Key_StorePubData:\n"); if (rc == 0) { /* store ver */ if (((TPM_KEY12 *)tpm_key)->tag != TPM_TAG_KEY12) { /* TPM_KEY */ rc = TPM_StructVer_Store(sbuffer, &(tpm_key->ver)); } else { /* TPM_KEY12 */ /* store tag */ if (rc == 0) { rc = TPM_Sbuffer_Append16(sbuffer, TPM_TAG_KEY12); } /* store fill */ if (rc == 0) { rc = TPM_Sbuffer_Append16(sbuffer, 0x0000); } } } /* store keyUsage */ if (rc == 0) { rc = TPM_Sbuffer_Append16(sbuffer, tpm_key->keyUsage); } /* store keyFlags */ if (rc == 0) { rc = TPM_Sbuffer_Append32(sbuffer, tpm_key->keyFlags); } /* store authDataUsage */ if (rc == 0) { rc = TPM_Sbuffer_Append(sbuffer, &(tpm_key->authDataUsage), sizeof(TPM_AUTH_DATA_USAGE)); } /* store algorithmParms */ if (rc == 0) { rc = TPM_KeyParms_Store(sbuffer, &(tpm_key->algorithmParms)); } /* store pcrInfo */ if ((rc == 0) && !isEK) { /* copy cache to pcrInfo */ if (((TPM_KEY12 *)tpm_key)->tag != TPM_TAG_KEY12) { /* TPM_KEY */ rc = TPM_SizedBuffer_SetStructure(&(tpm_key->pcrInfo), tpm_key->tpm_pcr_info, (TPM_STORE_FUNCTION_T)TPM_PCRInfo_Store); } else { /* TPM_KEY12 */ rc = TPM_SizedBuffer_SetStructure(&(tpm_key->pcrInfo), tpm_key->tpm_pcr_info_long, (TPM_STORE_FUNCTION_T)TPM_PCRInfoLong_Store); } } /* copy pcrInfo to sbuffer */ if ((rc == 0) && !isEK) { rc = TPM_SizedBuffer_Store(sbuffer, &(tpm_key->pcrInfo)); } /* store pubKey */ if (rc == 0) { rc = TPM_SizedBuffer_Store(sbuffer, &(tpm_key->pubKey)); } return rc; } /* TPM_Key_Store() serializes a TPM_KEY structure, appending results to 'sbuffer' As a side effect, it serializes the tpm_pcr_info cache to pcrInfo. */ TPM_RESULT TPM_Key_Store(TPM_STORE_BUFFER *sbuffer, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; printf(" TPM_Key_Store:\n"); /* store the pubData */ if (rc == 0) { rc = TPM_Key_StorePubData(sbuffer, FALSE, tpm_key); } /* store encDataSize and encData */ if (rc == 0) { rc = TPM_SizedBuffer_Store(sbuffer, &(tpm_key->encData)); } return rc; } /* TPM_Key_StoreClear() serializes a TPM_KEY structure, appending results to 'sbuffer' TPM_Key_StoreClear() serializes the tpm_store_asymkey member as cleartext. It is used for keys such as the SRK, which never leave the TPM. It is also used for saving state, where the entire blob is encrypted. As a side effect, it serializes the tpm_pcr_info cache to pcrInfo. */ TPM_RESULT TPM_Key_StoreClear(TPM_STORE_BUFFER *sbuffer, TPM_BOOL isEK, /* key being stored is EK */ TPM_KEY *tpm_key) { TPM_RESULT rc = 0; TPM_STORE_BUFFER asymSbuffer; const unsigned char *asymBuffer; uint32_t asymLength; printf(" TPM_Key_StoreClear:\n"); TPM_Sbuffer_Init(&asymSbuffer); /* freed @1 */ /* store the pubData */ if (rc == 0) { rc = TPM_Key_StorePubData(sbuffer, isEK, tpm_key); } /* store TPM_STORE_ASYMKEY cache as cleartext */ if (rc == 0) { /* if the TPM_STORE_ASYMKEY cache exists */ if (tpm_key->tpm_store_asymkey != NULL) { /* , serialize it */ if (rc == 0) { rc = TPM_StoreAsymkey_Store(&asymSbuffer, isEK, tpm_key->tpm_store_asymkey); } /* get the result */ TPM_Sbuffer_Get(&asymSbuffer, &asymBuffer, &asymLength); /* store the result as a sized buffer */ if (rc == 0) { rc = TPM_Sbuffer_Append32(sbuffer, asymLength); } if (rc == 0) { rc = TPM_Sbuffer_Append(sbuffer, asymBuffer, asymLength); } } /* If there is no TPM_STORE_ASYMKEY cache, mark it empty. This can occur for an internal key that has not been created yet. */ else { rc = TPM_Sbuffer_Append32(sbuffer, 0); } } TPM_Sbuffer_Delete(&asymSbuffer); /* @1 */ return rc; } /* TPM_KEY_StorePubkey() gets (as a stream) the TPM_PUBKEY derived from a TPM_KEY There is no need to actually assemble the structure, since only the serialization of its two members are needed. The stream is returned as a TPM_STORE_BUFFER (that must be initialized and deleted by the caller), and it's components (buffer and size). */ TPM_RESULT TPM_Key_StorePubkey(TPM_STORE_BUFFER *pubkeyStream, /* output */ const unsigned char **pubkeyStreamBuffer, /* output */ uint32_t *pubkeyStreamLength, /* output */ TPM_KEY *tpm_key) /* input */ { TPM_RESULT rc = 0; printf(" TPM_Key_StorePubkey:\n"); /* the first part is a TPM_KEY_PARMS */ if (rc == 0) { rc = TPM_KeyParms_Store(pubkeyStream, &(tpm_key->algorithmParms)); } /* the second part is the TPM_SIZED_BUFFER pubKey */ if (rc == 0) { rc = TPM_SizedBuffer_Store(pubkeyStream, &(tpm_key->pubKey)); } /* retrieve the resulting pubkey stream */ if (rc == 0) { TPM_Sbuffer_Get(pubkeyStream, pubkeyStreamBuffer, pubkeyStreamLength); } return rc; } /* TPM_Key_Delete() No-OP if the parameter is NULL, else: frees memory allocated for the object sets pointers to NULL calls TPM_Key_Init to set members back to default values The TPM_KEY itself is not freed The key is not freed because it might be a local variable rather than a malloc'ed pointer. */ void TPM_Key_Delete(TPM_KEY *tpm_key) { if (tpm_key != NULL) { printf(" TPM_Key_Delete:\n"); TPM_KeyParms_Delete(&(tpm_key->algorithmParms)); /* pcrInfo */ TPM_SizedBuffer_Delete(&(tpm_key->pcrInfo)); /* pcr caches */ TPM_PCRInfo_Delete(tpm_key->tpm_pcr_info); free(tpm_key->tpm_pcr_info); TPM_PCRInfoLong_Delete(tpm_key->tpm_pcr_info_long); free(tpm_key->tpm_pcr_info_long); TPM_SizedBuffer_Delete(&(tpm_key->pubKey)); TPM_SizedBuffer_Delete(&(tpm_key->encData)); TPM_StoreAsymkey_Delete(tpm_key->tpm_store_asymkey); free(tpm_key->tpm_store_asymkey); TPM_MigrateAsymkey_Delete(tpm_key->tpm_migrate_asymkey); free(tpm_key->tpm_migrate_asymkey); TPM_Key_Init(tpm_key); } return; } /* TPM_Key_CheckStruct() verifies that the 'tpm_key' has either a TPM_KEY -> ver of a TPM_KEY12 tag and fill */ TPM_RESULT TPM_Key_CheckStruct(int *ver, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; /* The key can be either a TPM_KEY or TPM_KEY12 */ if (*(unsigned char *)tpm_key == 0x01) { *ver = 1; rc = TPM_StructVer_CheckVer(&(tpm_key->ver)); /* check for TPM_KEY */ if (rc == 0) { /* if found TPM_KEY */ printf(" TPM_Key_CheckStruct: TPM_KEY version %u.%u\n", tpm_key->ver.major, tpm_key->ver.minor); } } else { /* else check for TPM_KEY12 */ *ver = 2; rc = TPM_Key_CheckTag((TPM_KEY12 *)tpm_key); if (rc == 0) { printf(" TPM_Key_CheckStruct: TPM_KEY12\n"); } else { /* not TPM_KEY or TPM_KEY12 */ printf("TPM_Key_CheckStruct: Error checking structure, bytes 0:3 %02x %02x %02x %02x\n", tpm_key->ver.major, tpm_key->ver.minor, tpm_key->ver.revMajor, tpm_key->ver.revMinor); rc = TPM_BAD_KEY_PROPERTY; } } return rc; } /* TPM_Key_CheckTag() checks that the TPM_KEY12 tag is correct */ static TPM_RESULT TPM_Key_CheckTag(TPM_KEY12 *tpm_key12) { TPM_RESULT rc = 0; if (rc == 0) { if (tpm_key12->tag != TPM_TAG_KEY12) { printf("TPM_Key_CheckTag: Error, TPM_KEY12 tag %04x should be TPM_TAG_KEY12\n", tpm_key12->tag); rc = TPM_BAD_KEY_PROPERTY; } } if (rc == 0) { if (tpm_key12->fill != 0x0000) { printf("TPM_Key_CheckTag: Error, TPM_KEY12 fill %04x should be 0x0000\n", tpm_key12->fill); rc = TPM_BAD_KEY_PROPERTY; } } return rc; } /* TPM_Key_CheckProperties() checks that the TPM can generate a key of the type requested in 'tpm_key'. if keyLength is non-zero, checks that the tpm_key specifies the correct key length. If keyLength is 0, any tpm_key key length is accepted. Returns TPM_BAD_KEY_PROPERTY on error. */ TPM_RESULT TPM_Key_CheckProperties(int *ver, TPM_KEY *tpm_key, uint32_t keyLength, /* in bits */ TPM_BOOL FIPS) { TPM_RESULT rc = 0; printf(" TPM_Key_CheckProperties:\n"); /* check the version */ if (rc == 0) { rc = TPM_Key_CheckStruct(ver, tpm_key); } /* if FIPS */ if ((rc == 0) && FIPS) { /* b. If keyInfo -> authDataUsage specifies TPM_AUTH_NEVER return TPM_NOTFIPS */ if (tpm_key->authDataUsage == TPM_AUTH_NEVER) { printf("TPM_Key_CheckProperties: Error, FIPS authDataUsage TPM_AUTH_NEVER\n"); rc = TPM_NOTFIPS; } } /* most of the work is done by TPM_KeyParms_CheckProperties() */ if (rc == 0) { printf(" TPM_Key_CheckProperties: authDataUsage %02x\n", tpm_key->authDataUsage); rc = TPM_KeyParms_CheckProperties(&(tpm_key->algorithmParms), tpm_key->keyUsage, keyLength, /* in bits */ FIPS); } return rc; } /* TPM_Key_LoadStoreAsymKey() deserializes a stream to a TPM_STORE_ASYMKEY structure and stores it in the TPM_KEY cache. Call this function when a key is loaded, either from the host (stream is decrypted encData) or from permanent data or saved state (stream was clear text). */ TPM_RESULT TPM_Key_LoadStoreAsymKey(TPM_KEY *tpm_key, TPM_BOOL isEK, unsigned char **stream, /* decrypted encData (clear text) */ uint32_t *stream_size) { TPM_RESULT rc = 0; /* This function should never be called when the TPM_STORE_ASYMKEY structure has already been loaded. This indicates an internal error. */ printf(" TPM_Key_LoadStoreAsymKey:\n"); if (rc == 0) { if (tpm_key->tpm_store_asymkey != NULL) { printf("TPM_Key_LoadStoreAsymKey: Error (fatal), TPM_STORE_ASYMKEY already loaded\n"); rc = TPM_FAIL; /* should never occur */ } } /* If the stream size is 0, there is an internal error. */ if (rc == 0) { if (*stream_size == 0) { printf("TPM_Key_LoadStoreAsymKey: Error (fatal), stream size is 0\n"); rc = TPM_FAIL; /* should never occur */ } } /* allocate memory for the structure */ if (rc == 0) { rc = TPM_Malloc((unsigned char **)&(tpm_key->tpm_store_asymkey), sizeof(TPM_STORE_ASYMKEY)); } if (rc == 0) { TPM_StoreAsymkey_Init(tpm_key->tpm_store_asymkey); rc = TPM_StoreAsymkey_Load(tpm_key->tpm_store_asymkey, isEK, stream, stream_size, &(tpm_key->algorithmParms), &(tpm_key->pubKey)); TPM_PrintFour(" TPM_Key_LoadStoreAsymKey: usageAuth", tpm_key->tpm_store_asymkey->usageAuth); } return rc; } /* TPM_Key_GetStoreAsymkey() gets the TPM_STORE_ASYMKEY from a TPM_KEY cache. */ TPM_RESULT TPM_Key_GetStoreAsymkey(TPM_STORE_ASYMKEY **tpm_store_asymkey, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; printf(" TPM_Key_GetStoreAsymkey:\n"); if (rc == 0) { /* return the cached structure */ *tpm_store_asymkey = tpm_key->tpm_store_asymkey; if (tpm_key->tpm_store_asymkey == NULL) { printf("TPM_Key_GetStoreAsymkey: Error (fatal), no cache\n"); rc = TPM_FAIL; /* indicate no cache */ } } return rc; } /* TPM_Key_GetMigrateAsymkey() gets the TPM_MIGRATE_ASYMKEY from a TPM_KEY cache. */ TPM_RESULT TPM_Key_GetMigrateAsymkey(TPM_MIGRATE_ASYMKEY **tpm_migrate_asymkey, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; printf(" TPM_Key_GetMigrateAsymkey:\n"); if (rc == 0) { /* return the cached structure */ *tpm_migrate_asymkey = tpm_key->tpm_migrate_asymkey; if (tpm_key->tpm_migrate_asymkey == NULL) { printf("TPM_Key_GetMigrateAsymkey: Error (fatal), no cache\n"); rc = TPM_FAIL; /* indicate no cache */ } } return rc; } /* TPM_Key_GetUsageAuth() gets the usageAuth from the TPM_STORE_ASYMKEY or TPM_MIGRATE_ASYMKEY contained in a TPM_KEY */ TPM_RESULT TPM_Key_GetUsageAuth(TPM_SECRET **usageAuth, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; TPM_STORE_ASYMKEY *tpm_store_asymkey; TPM_MIGRATE_ASYMKEY *tpm_migrate_asymkey; printf(" TPM_Key_GetUsageAuth:\n"); /* check that the TPM_KEY_USAGE indicates a valid key */ if (rc == 0) { if ((tpm_key == NULL) || (tpm_key->keyUsage == TPM_KEY_UNINITIALIZED)) { printf("TPM_Key_GetUsageAuth: Error, key not initialized\n"); rc = TPM_INVALID_KEYUSAGE; } } /* get the TPM_STORE_ASYMKEY object */ if (rc == 0) { rc = TPM_Key_GetStoreAsymkey(&tpm_store_asymkey, tpm_key); /* found a TPM_STORE_ASYMKEY */ if (rc == 0) { *usageAuth = &(tpm_store_asymkey->usageAuth); } /* get the TPM_MIGRATE_ASYMKEY object */ else { rc = TPM_Key_GetMigrateAsymkey(&tpm_migrate_asymkey, tpm_key); /* found a TPM_MIGRATE_ASYMKEY */ if (rc == 0) { *usageAuth = &(tpm_migrate_asymkey->usageAuth); } } } if (rc != 0) { printf("TPM_Key_GetUsageAuth: Error (fatal), " "could not get TPM_STORE_ASYMKEY or TPM_MIGRATE_ASYMKEY\n"); rc = TPM_FAIL; /* should never occur */ } /* get the usageAuth element */ if (rc == 0) { TPM_PrintFour(" TPM_Key_GetUsageAuth: Auth", **usageAuth); } return rc; } /* TPM_Key_GetPublicKey() gets the public key from the TPM_STORE_PUBKEY contained in a TPM_KEY */ TPM_RESULT TPM_Key_GetPublicKey(uint32_t *nbytes, unsigned char **narr, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; printf(" TPM_Key_GetPublicKey:\n"); if (rc == 0) { *nbytes = tpm_key->pubKey.size; *narr = tpm_key->pubKey.buffer; } return rc; } /* TPM_Key_GetPrimeFactorP() gets the prime factor p from the TPM_STORE_ASYMKEY contained in a TPM_KEY */ TPM_RESULT TPM_Key_GetPrimeFactorP(uint32_t *pbytes, unsigned char **parr, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; TPM_STORE_ASYMKEY *tpm_store_asymkey; printf(" TPM_Key_GetPrimeFactorP:\n"); if (rc == 0) { rc = TPM_Key_GetStoreAsymkey(&tpm_store_asymkey, tpm_key); } if (rc == 0) { *pbytes = tpm_store_asymkey->privKey.p_key.size; *parr = tpm_store_asymkey->privKey.p_key.buffer; } return rc; } /* TPM_Key_GetPrivateKey() gets the private key from the TPM_STORE_ASYMKEY contained in a TPM_KEY */ TPM_RESULT TPM_Key_GetPrivateKey(uint32_t *dbytes, unsigned char **darr, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; TPM_STORE_ASYMKEY *tpm_store_asymkey; printf(" TPM_Key_GetPrivateKey:\n"); if (rc == 0) { rc = TPM_Key_GetStoreAsymkey(&tpm_store_asymkey, tpm_key); } if (rc == 0) { *dbytes = tpm_store_asymkey->privKey.d_key.size; *darr = tpm_store_asymkey->privKey.d_key.buffer; } return rc; } /* TPM_Key_GetExponent() gets the exponent key from the TPM_RSA_KEY_PARMS contained in a TPM_KEY */ TPM_RESULT TPM_Key_GetExponent(uint32_t *ebytes, unsigned char **earr, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; printf(" TPM_Key_GetExponent:\n"); if (rc == 0) { rc = TPM_KeyParms_GetExponent(ebytes, earr, &(tpm_key->algorithmParms)); } return rc; } /* TPM_Key_GetPCRUsage() returns 'pcrUsage' TRUE if any bit is set in the pcrSelect bit mask. 'start_pcr' indicates the starting byte index into pcrSelect[] */ TPM_RESULT TPM_Key_GetPCRUsage(TPM_BOOL *pcrUsage, TPM_KEY *tpm_key, size_t start_index) { TPM_RESULT rc = 0; printf(" TPM_Key_GetPCRUsage: Start %lu\n", (unsigned long)start_index); if (((TPM_KEY12 *)tpm_key)->tag != TPM_TAG_KEY12) { /* TPM_KEY */ rc = TPM_PCRInfo_GetPCRUsage(pcrUsage, tpm_key->tpm_pcr_info, start_index); } else { /* TPM_KEY12 */ rc = TPM_PCRInfoLong_GetPCRUsage(pcrUsage, tpm_key->tpm_pcr_info_long, start_index); } return rc; } /* TPM_Key_GetLocalityAtRelease() the localityAtRelease for a TPM_PCR_INFO_LONG. For a TPM_PCR_INFO is returns TPM_LOC_ALL (all localities). */ TPM_RESULT TPM_Key_GetLocalityAtRelease(TPM_LOCALITY_SELECTION *localityAtRelease, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; printf(" TPM_Key_GetLocalityAtRelease:\n"); if (((TPM_KEY12 *)tpm_key)->tag != TPM_TAG_KEY12) { /* TPM_KEY */ /* locality not used for TPM_PCR_INFO */ *localityAtRelease = TPM_LOC_ALL; } /* TPM_KEY12 */ else if (tpm_key->tpm_pcr_info_long == NULL) { /* locality not used if TPM_PCR_INFO_LONG was not specified */ *localityAtRelease = TPM_LOC_ALL; } else { *localityAtRelease = tpm_key->tpm_pcr_info_long->localityAtRelease; } return rc; } /* TPM_Key_GenerateRSA() generates a TPM_KEY using TPM_KEY_PARMS. The tag/version is set correctly. The TPM_STORE_ASYMKEY member cache is set. pcrInfo is set as a serialized tpm_pcr_info or tpm_pcr_info_long. For exported keys, encData is not set yet. It later becomes the encryption of TPM_STORE_ASYMKEY. For internal 'root' keys (endorsement key, srk), encData is stored as clear text. It returns the TPM_KEY object. Call tree: local - sets tpm_store_asymkey->privkey TPM_Key_Set - sets keyUsage, keyFlags, authDataUsage, algorithmParms tpm_pcr_info cache, digestAtCreation, pubKey, TPM_Key_GeneratePubDataDigest - pubDataDigest TPM_Key_Store TPM_Key_StorePubData - serializes tpm_pcr_info cache */ TPM_RESULT TPM_Key_GenerateRSA(TPM_KEY *tpm_key, /* output created key */ tpm_state_t *tpm_state, TPM_KEY *parent_key, /* NULL for root keys */ TPM_DIGEST *tpm_pcrs, /* PCR array from state */ int ver, /* TPM_KEY or TPM_KEY12 */ TPM_KEY_USAGE keyUsage, /* input */ TPM_KEY_FLAGS keyFlags, /* input */ TPM_AUTH_DATA_USAGE authDataUsage, /* input */ TPM_KEY_PARMS *tpm_key_parms, /* input */ TPM_PCR_INFO *tpm_pcr_info, /* input */ TPM_PCR_INFO_LONG *tpm_pcr_info_long) /* input */ { TPM_RESULT rc = 0; TPM_RSA_KEY_PARMS *tpm_rsa_key_parms; unsigned char *earr; /* public exponent */ uint32_t ebytes; /* generated RSA key */ unsigned char *n = NULL; /* public key */ unsigned char *p = NULL; /* prime factor */ unsigned char *q = NULL; /* prime factor */ unsigned char *d = NULL; /* private key */ printf(" TPM_Key_GenerateRSA:\n"); /* extract the TPM_RSA_KEY_PARMS from TPM_KEY_PARMS */ if (rc == 0) { rc = TPM_KeyParms_GetRSAKeyParms(&tpm_rsa_key_parms, tpm_key_parms); } /* get the public exponent, with conversion */ if (rc == 0) { rc = TPM_RSAKeyParms_GetExponent(&ebytes, &earr, tpm_rsa_key_parms); } /* allocate storage for TPM_STORE_ASYMKEY. The structure is not freed. It is cached in the TPM_KEY->TPM_STORE_ASYMKEY member and freed when they are deleted. */ if (rc == 0) { rc = TPM_Malloc((unsigned char **)&(tpm_key->tpm_store_asymkey), sizeof(TPM_STORE_ASYMKEY)); } if (rc == 0) { TPM_StoreAsymkey_Init(tpm_key->tpm_store_asymkey); } /* generate the key pair */ if (rc == 0) { rc = TPM_RSAGenerateKeyPair(&n, /* public key (modulus) freed @3 */ &p, /* private prime factor freed @4 */ &q, /* private prime factor freed @5 */ &d, /* private key (private exponent) freed @6 */ tpm_rsa_key_parms->keyLength, /* key size in bits */ earr, /* public exponent */ ebytes); } /* construct the TPM_STORE_ASYMKEY member */ if (rc == 0) { TPM_PrintFour(" TPM_Key_GenerateRSA: Public key n", n); TPM_PrintAll(" TPM_Key_GenerateRSA: Exponent", earr, ebytes); TPM_PrintFour(" TPM_Key_GenerateRSA: Private prime p", p); TPM_PrintFour(" TPM_Key_GenerateRSA: Private prime q", q); TPM_PrintFour(" TPM_Key_GenerateRSA: Private key d", d); /* add the private primes and key to the TPM_STORE_ASYMKEY object */ rc = TPM_SizedBuffer_Set(&(tpm_key->tpm_store_asymkey->privKey.d_key), tpm_rsa_key_parms->keyLength/CHAR_BIT, d); } if (rc == 0) { rc = TPM_SizedBuffer_Set(&(tpm_key->tpm_store_asymkey->privKey.p_key), tpm_rsa_key_parms->keyLength/(CHAR_BIT * 2), p); } if (rc == 0) { rc = TPM_SizedBuffer_Set(&(tpm_key->tpm_store_asymkey->privKey.q_key), tpm_rsa_key_parms->keyLength/(CHAR_BIT * 2), q); } if (rc == 0) { rc = TPM_Key_Set(tpm_key, tpm_state, parent_key, tpm_pcrs, ver, /* TPM_KEY or TPM_KEY12 */ keyUsage, /* TPM_KEY_USAGE */ keyFlags, /* TPM_KEY_FLAGS */ authDataUsage, /* TPM_AUTH_DATA_USAGE */ tpm_key_parms, /* TPM_KEY_PARMS */ tpm_pcr_info, /* TPM_PCR_INFO */ tpm_pcr_info_long, /* TPM_PCR_INFO_LONG */ tpm_rsa_key_parms->keyLength/CHAR_BIT, /* TPM_STORE_PUBKEY.keyLength */ n, /* TPM_STORE_PUBKEY.key (public key) */ /* FIXME redundant */ tpm_key->tpm_store_asymkey, /* cache the TPM_STORE_ASYMKEY structure */ NULL); /* TPM_MIGRATE_ASYMKEY */ } free(n); /* @3 */ free(p); /* @4 */ free(q); /* @5 */ free(d); /* @6 */ return rc; } /* TPM_Key_GeneratePubkeyDigest() serializes a TPM_PUBKEY derived from the TPM_KEY and calculates its digest. */ TPM_RESULT TPM_Key_GeneratePubkeyDigest(TPM_DIGEST tpm_digest, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; TPM_STORE_BUFFER pubkeyStream; /* from tpm_key */ const unsigned char *pubkeyStreamBuffer; uint32_t pubkeyStreamLength; printf(" TPM_Key_GeneratePubkeyDigest:\n"); TPM_Sbuffer_Init(&pubkeyStream); /* freed @1 */ /* serialize a TPM_PUBKEY derived from the TPM_KEY */ if (rc == 0) { rc = TPM_Key_StorePubkey(&pubkeyStream, /* output */ &pubkeyStreamBuffer, /* output */ &pubkeyStreamLength, /* output */ tpm_key); /* input */ } if (rc == 0) { rc = TPM_SHA1(tpm_digest, pubkeyStreamLength, pubkeyStreamBuffer, 0, NULL); } TPM_Sbuffer_Delete(&pubkeyStream); /* @1 */ return rc; } /* TPM_Key_ComparePubkey() serializes and hashes the TPM_PUBKEY derived from a TPM_KEY and a TPM_PUBKEY and compares the results */ TPM_RESULT TPM_Key_ComparePubkey(TPM_KEY *tpm_key, TPM_PUBKEY *tpm_pubkey) { TPM_RESULT rc = 0; TPM_DIGEST key_digest; TPM_DIGEST pubkey_digest; if (rc == 0) { rc = TPM_Key_GeneratePubkeyDigest(key_digest, tpm_key); } if (rc == 0) { rc = TPM_SHA1_GenerateStructure(pubkey_digest, tpm_pubkey, (TPM_STORE_FUNCTION_T)TPM_Pubkey_Store); } if (rc == 0) { rc = TPM_Digest_Compare(key_digest, pubkey_digest); } return rc; } /* TPM_Key_GeneratePubDataDigest() generates and stores a TPM_STORE_ASYMKEY -> pubDataDigest As a side effect, it serializes the tpm_pcr_info cache to pcrInfo. */ TPM_RESULT TPM_Key_GeneratePubDataDigest(TPM_KEY *tpm_key) { TPM_RESULT rc = 0; TPM_STORE_BUFFER sbuffer; /* TPM_KEY serialization */ TPM_STORE_ASYMKEY *tpm_store_asymkey; printf(" TPM_Key_GeneratePubDataDigest:\n"); TPM_Sbuffer_Init(&sbuffer); /* freed @1 */ /* serialize the TPM_KEY excluding the encData fields */ if (rc == 0) { rc = TPM_Key_StorePubData(&sbuffer, FALSE, tpm_key); } /* get the TPM_STORE_ASYMKEY structure */ if (rc == 0) { rc = TPM_Key_GetStoreAsymkey(&tpm_store_asymkey, tpm_key); } /* hash the serialized buffer to tpm_digest */ if (rc == 0) { rc = TPM_SHA1Sbuffer(tpm_store_asymkey->pubDataDigest, &sbuffer); } TPM_Sbuffer_Delete(&sbuffer); /* @1 */ return rc; } /* TPM_Key_CheckPubDataDigest() generates a TPM_STORE_ASYMKEY -> pubDataDigest and compares it to the stored value. Returns: Error id */ TPM_RESULT TPM_Key_CheckPubDataDigest(TPM_KEY *tpm_key) { TPM_RESULT rc = 0; TPM_STORE_BUFFER sbuffer; /* TPM_KEY serialization */ TPM_STORE_ASYMKEY *tpm_store_asymkey; TPM_DIGEST tpm_digest; /* calculated pubDataDigest */ printf(" TPM_Key_CheckPubDataDigest:\n"); TPM_Sbuffer_Init(&sbuffer); /* freed @1 */ /* serialize the TPM_KEY excluding the encData fields */ if (rc == 0) { rc = TPM_Key_StorePubData(&sbuffer, FALSE, tpm_key); } /* get the TPM_STORE_ASYMKEY structure */ if (rc == 0) { rc = TPM_Key_GetStoreAsymkey(&tpm_store_asymkey, tpm_key); } if (rc == 0) { rc = TPM_SHA1Sbuffer(tpm_digest, &sbuffer); } if (rc == 0) { rc = TPM_Digest_Compare(tpm_store_asymkey->pubDataDigest, tpm_digest); } TPM_Sbuffer_Delete(&sbuffer); /* @1 */ return rc; } /* TPM_Key_GenerateEncData() generates an TPM_KEY -> encData structure member by serializing the cached TPM_KEY -> TPM_STORE_ASYMKEY member and encrypting the result using the parent_key public key. */ TPM_RESULT TPM_Key_GenerateEncData(TPM_KEY *tpm_key, TPM_KEY *parent_key) { TPM_RESULT rc = 0; TPM_STORE_ASYMKEY *tpm_store_asymkey; printf(" TPM_Key_GenerateEncData;\n"); /* get the TPM_STORE_ASYMKEY structure */ if (rc == 0) { rc = TPM_Key_GetStoreAsymkey(&tpm_store_asymkey, tpm_key); } if (rc == 0) { rc = TPM_StoreAsymkey_GenerateEncData(&(tpm_key->encData), tpm_store_asymkey, parent_key); } return rc; } /* TPM_Key_DecryptEncData() decrypts the TPM_KEY -> encData using the parent private key. The result is deserialized and stored in the TPM_KEY -> TPM_STORE_ASYMKEY cache. */ TPM_RESULT TPM_Key_DecryptEncData(TPM_KEY *tpm_key, /* result */ TPM_KEY *parent_key) /* parent for decrypting encData */ { TPM_RESULT rc = 0; unsigned char *decryptData = NULL; /* freed @1 */ uint32_t decryptDataLength = 0; /* actual valid data */ unsigned char *stream; uint32_t stream_size; printf(" TPM_Key_DecryptEncData\n"); /* allocate space for the decrypted data */ if (rc == 0) { rc = TPM_RSAPrivateDecryptMalloc(&decryptData, /* decrypted data */ &decryptDataLength, /* actual size of decrypted data */ tpm_key->encData.buffer, /* encrypted data */ tpm_key->encData.size, /* encrypted data size */ parent_key); } /* load the TPM_STORE_ASYMKEY cache from the 'encData' member stream */ if (rc == 0) { stream = decryptData; stream_size = decryptDataLength; rc = TPM_Key_LoadStoreAsymKey(tpm_key, FALSE, &stream, &stream_size); } free(decryptData); /* @1 */ return rc; } /* TPM_Key_GeneratePCRDigest() generates a digest based on the current PCR state and the PCR's specified with the key. The key can be either TPM_KEY or TPM_KEY12. This function assumes that TPM_Key_GetPCRUsage() has determined that PCR's are in use, so a NULL PCR cache will return an error here. See Part 1 25.1 */ TPM_RESULT TPM_Key_CheckPCRDigest(TPM_KEY *tpm_key, tpm_state_t *tpm_state) { TPM_RESULT rc = 0; printf(" TPM_Key_GeneratePCRDigest:\n"); if (((TPM_KEY12 *)tpm_key)->tag != TPM_TAG_KEY12) { /* TPM_KEY */ /* i. Calculate H1 a TPM_COMPOSITE_HASH of the PCR selected by LK -> pcrInfo -> releasePCRSelection */ /* ii. Compare H1 to LK -> pcrInfo -> digestAtRelease on mismatch return TPM_WRONGPCRVAL */ if (rc == 0) { rc = TPM_PCRInfo_CheckDigest(tpm_key->tpm_pcr_info, tpm_state->tpm_stclear_data.PCRS); /* array of PCR's */ } } else { /* TPM_KEY12 */ /* i. Calculate H1 a TPM_COMPOSITE_HASH of the PCR selected by LK -> pcrInfo -> releasePCRSelection */ /* ii. Compare H1 to LK -> pcrInfo -> digestAtRelease on mismatch return TPM_WRONGPCRVAL */ if (rc == 0) { rc = TPM_PCRInfoLong_CheckDigest(tpm_key->tpm_pcr_info_long, tpm_state->tpm_stclear_data.PCRS, /* array of PCR's */ tpm_state->tpm_stany_flags.localityModifier); } } /* 4. Allow use of the key */ if (rc != 0) { printf("TPM_Key_CheckPCRDigest: Error, wrong digestAtRelease value\n"); rc = TPM_WRONGPCRVAL; } return rc; } /* TPM_Key_CheckRestrictDelegate() checks the restrictDelegate data against the TPM_KEY properties. It determines how the TPM responds to delegated requests to use a certified migration key. Called from TPM_AuthSessions_GetData() if it's a DSAP session using a key entity.. TPM_PERMANENT_DATA -> restrictDelegate is used as follows: 1. If the session type is TPM_PID_DSAP and TPM_KEY -> keyFlags -> migrateAuthority is TRUE a. If TPM_KEY_USAGE is TPM_KEY_SIGNING and restrictDelegate -> TPM_CMK_DELEGATE_SIGNING is TRUE, or TPM_KEY_USAGE is TPM_KEY_STORAGE and restrictDelegate -> TPM_CMK_DELEGATE_STORAGE is TRUE, or TPM_KEY_USAGE is TPM_KEY_BIND and restrictDelegate -> TPM_CMK_DELEGATE_BIND is TRUE, or TPM_KEY_USAGE is TPM_KEY_LEGACY and restrictDelegate -> TPM_CMK_DELEGATE_LEGACY is TRUE, or TPM_KEY_USAGE is TPM_KEY_MIGRATE and restrictDelegate -> TPM_CMK_DELEGATE_MIGRATE is TRUE then the key can be used. b. Else return TPM_INVALID_KEYUSAGE. */ TPM_RESULT TPM_Key_CheckRestrictDelegate(TPM_KEY *tpm_key, TPM_CMK_DELEGATE restrictDelegate) { TPM_RESULT rc = 0; printf("TPM_Key_CheckRestrictDelegate:\n"); if (rc == 0) { if (tpm_key == NULL) { printf("TPM_Key_CheckRestrictDelegate: Error (fatal), key NULL\n"); rc = TPM_FAIL; /* internal error, should never occur */ } } /* if it's a certified migration key */ if (rc == 0) { if (tpm_key->keyFlags & TPM_MIGRATEAUTHORITY) { if (!( ((restrictDelegate & TPM_CMK_DELEGATE_SIGNING) && (tpm_key->keyUsage == TPM_KEY_SIGNING)) || ((restrictDelegate & TPM_CMK_DELEGATE_STORAGE) && (tpm_key->keyUsage == TPM_KEY_STORAGE)) || ((restrictDelegate & TPM_CMK_DELEGATE_BIND) && (tpm_key->keyUsage == TPM_KEY_BIND)) || ((restrictDelegate & TPM_CMK_DELEGATE_LEGACY) && (tpm_key->keyUsage == TPM_KEY_LEGACY)) || ((restrictDelegate & TPM_CMK_DELEGATE_MIGRATE) && (tpm_key->keyUsage == TPM_KEY_MIGRATE)) )) { printf("TPM_Key_CheckRestrictDelegate: Error, " "invalid keyUsage %04hx restrictDelegate %08x\n", tpm_key->keyUsage, restrictDelegate); rc = TPM_INVALID_KEYUSAGE; } } } return rc; } /* TPM_KEY_FLAGS */ /* TPM_KeyFlags_Load() deserializes a TPM_KEY_FLAGS value and checks for a legal value. */ TPM_RESULT TPM_KeyFlags_Load(TPM_KEY_FLAGS *tpm_key_flags, /* result */ unsigned char **stream, /* pointer to next parameter */ uint32_t *stream_size) /* stream size left */ { TPM_RESULT rc = 0; /* load keyFlags */ if (rc == 0) { rc = TPM_Load32(tpm_key_flags, stream, stream_size); } /* check TPM_KEY_FLAGS validity, look for extra bits set */ if (rc == 0) { if (*tpm_key_flags & ~TPM_KEY_FLAGS_MASK) { printf("TPM_KeyFlags_Load: Error, illegal keyFlags value %08x\n", *tpm_key_flags); rc = TPM_BAD_KEY_PROPERTY; } } return rc; } /* TPM_KEY_PARMS */ void TPM_KeyParms_Init(TPM_KEY_PARMS *tpm_key_parms) { printf(" TPM_KeyParms_Init:\n"); tpm_key_parms->algorithmID = 0; tpm_key_parms->encScheme = TPM_ES_NONE; tpm_key_parms->sigScheme = TPM_SS_NONE; TPM_SizedBuffer_Init(&(tpm_key_parms->parms)); tpm_key_parms->tpm_rsa_key_parms = NULL; return; } /* TPM_KeyParms_SetRSA() is a 'Set' version specific to RSA keys */ TPM_RESULT TPM_KeyParms_SetRSA(TPM_KEY_PARMS *tpm_key_parms, TPM_ALGORITHM_ID algorithmID, TPM_ENC_SCHEME encScheme, TPM_SIG_SCHEME sigScheme, uint32_t keyLength, /* in bits */ TPM_SIZED_BUFFER *exponent) { TPM_RESULT rc = 0; printf(" TPM_KeyParms_SetRSA:\n"); /* copy the TPM_KEY_PARMS members */ if (rc == 0) { tpm_key_parms->algorithmID = algorithmID; tpm_key_parms->encScheme = encScheme; tpm_key_parms->sigScheme = sigScheme; /* construct the TPM_RSA_KEY_PARMS cache member object */ rc = TPM_RSAKeyParms_New(&tpm_key_parms->tpm_rsa_key_parms); } if (rc == 0) { /* copy the TPM_RSA_KEY_PARMS members */ tpm_key_parms->tpm_rsa_key_parms->keyLength = keyLength; tpm_key_parms->tpm_rsa_key_parms->numPrimes = 2; rc = TPM_SizedBuffer_Copy(&(tpm_key_parms->tpm_rsa_key_parms->exponent), exponent); } /* serialize the TPM_RSA_KEY_PARMS object back to TPM_KEY_PARMS */ if (rc == 0) { rc = TPM_SizedBuffer_SetStructure(&(tpm_key_parms->parms), tpm_key_parms->tpm_rsa_key_parms, (TPM_STORE_FUNCTION_T)TPM_RSAKeyParms_Store); } return rc; } /* TPM_KeyParms_Copy() copies the source to the destination. If the algorithmID is TPM_ALG_RSA, the tpm_rsa_key_parms cache is allocated and copied. Must be freed by TPM_KeyParms_Delete() after use */ TPM_RESULT TPM_KeyParms_Copy(TPM_KEY_PARMS *tpm_key_parms_dest, TPM_KEY_PARMS *tpm_key_parms_src) { TPM_RESULT rc = 0; printf(" TPM_KeyParms_Copy:\n"); if (rc == 0) { tpm_key_parms_dest->algorithmID = tpm_key_parms_src->algorithmID; tpm_key_parms_dest->encScheme = tpm_key_parms_src->encScheme; tpm_key_parms_dest->sigScheme = tpm_key_parms_src->sigScheme; rc = TPM_SizedBuffer_Copy(&(tpm_key_parms_dest->parms), &(tpm_key_parms_src->parms)); } /* if there is a destination TPM_RSA_KEY_PARMS cache */ if ((rc == 0) && (tpm_key_parms_dest->algorithmID == TPM_ALG_RSA)) { /* construct the TPM_RSA_KEY_PARMS cache member object */ if (rc == 0) { rc = TPM_RSAKeyParms_New(&(tpm_key_parms_dest->tpm_rsa_key_parms)); } /* copy the TPM_RSA_KEY_PARMS member */ if (rc == 0) { rc = TPM_RSAKeyParms_Copy(tpm_key_parms_dest->tpm_rsa_key_parms, tpm_key_parms_src->tpm_rsa_key_parms); } } return rc; } /* TPM_KeyParms_Load deserializes a stream to a TPM_KEY_PARMS structure. Must be freed by TPM_KeyParms_Delete() after use */ TPM_RESULT TPM_KeyParms_Load(TPM_KEY_PARMS *tpm_key_parms, /* result */ unsigned char **stream, /* pointer to next parameter */ uint32_t *stream_size) /* stream size left */ { TPM_RESULT rc = 0; unsigned char *parms_stream; uint32_t parms_stream_size; printf(" TPM_KeyParms_Load:\n"); /* load algorithmID */ if (rc == 0) { rc = TPM_Load32(&(tpm_key_parms->algorithmID), stream, stream_size); } /* load encScheme */ if (rc == 0) { rc = TPM_Load16(&(tpm_key_parms->encScheme), stream, stream_size); } /* load sigScheme */ if (rc == 0) { rc = TPM_Load16(&(tpm_key_parms->sigScheme), stream, stream_size); } /* load parmSize and parms */ if (rc == 0) { rc = TPM_SizedBuffer_Load(&(tpm_key_parms->parms), stream, stream_size); } if (rc == 0) { switch (tpm_key_parms->algorithmID) { /* Allow load of uninitialized structures */ case 0: break; case TPM_ALG_RSA: /* load the TPM_RSA_KEY_PARMS cache if the algorithmID indicates an RSA key */ if (rc == 0) { rc = TPM_RSAKeyParms_New(&(tpm_key_parms->tpm_rsa_key_parms)); } /* deserialize the parms stream, but don't move the pointer */ if (rc == 0) { parms_stream = tpm_key_parms->parms.buffer; parms_stream_size = tpm_key_parms->parms.size; rc = TPM_RSAKeyParms_Load(tpm_key_parms->tpm_rsa_key_parms, &parms_stream, &parms_stream_size); } break; /* NOTE Only handles TPM_RSA_KEY_PARMS, could handle TPM_SYMMETRIC_KEY_PARMS */ case TPM_ALG_AES128: case TPM_ALG_AES192: case TPM_ALG_AES256: default: printf("TPM_KeyParms_Load: Cannot handle algorithmID %08x\n", tpm_key_parms->algorithmID); rc = TPM_BAD_KEY_PROPERTY; break; } } return rc; } TPM_RESULT TPM_KeyParms_GetExponent(uint32_t *ebytes, unsigned char **earr, TPM_KEY_PARMS *tpm_key_parms) { TPM_RESULT rc = 0; TPM_RSA_KEY_PARMS *tpm_rsa_key_parms; printf(" TPM_KeyParms_GetExponent:\n"); if (rc == 0) { rc = TPM_KeyParms_GetRSAKeyParms(&tpm_rsa_key_parms, tpm_key_parms); } if (rc == 0) { rc = TPM_RSAKeyParms_GetExponent(ebytes, earr, tpm_rsa_key_parms); } return rc; } /* TPM_KeyParms_Store serializes a TPM_KEY_PARMS structure, appending results to 'sbuffer' */ TPM_RESULT TPM_KeyParms_Store(TPM_STORE_BUFFER *sbuffer, TPM_KEY_PARMS *tpm_key_parms) { TPM_RESULT rc = 0; printf(" TPM_KeyParms_Store:\n"); /* store algorithmID */ if (rc == 0) { rc = TPM_Sbuffer_Append32(sbuffer, tpm_key_parms->algorithmID); } /* store encScheme */ if (rc == 0) { rc = TPM_Sbuffer_Append16(sbuffer, tpm_key_parms->encScheme); } /* store sigScheme */ if (rc == 0) { rc = TPM_Sbuffer_Append16(sbuffer, tpm_key_parms->sigScheme); } /* copy cache to parms */ if (rc == 0) { switch (tpm_key_parms->algorithmID) { /* Allow store of uninitialized structures */ case 0: break; case TPM_ALG_RSA: rc = TPM_SizedBuffer_SetStructure(&(tpm_key_parms->parms), tpm_key_parms->tpm_rsa_key_parms, (TPM_STORE_FUNCTION_T)TPM_RSAKeyParms_Store); break; /* NOTE Only handles TPM_RSA_KEY_PARMS, could handle TPM_SYMMETRIC_KEY_PARMS */ case TPM_ALG_AES128: case TPM_ALG_AES192: case TPM_ALG_AES256: default: printf("TPM_KeyParms_Store: Cannot handle algorithmID %08x\n", tpm_key_parms->algorithmID); rc = TPM_BAD_KEY_PROPERTY; break; } } /* store parms */ if (rc == 0) { rc = TPM_SizedBuffer_Store(sbuffer, &(tpm_key_parms->parms)); } return rc; } /* TPM_KeyParms_Delete frees any member allocated memory */ void TPM_KeyParms_Delete(TPM_KEY_PARMS *tpm_key_parms) { printf(" TPM_KeyParms_Delete:\n"); if (tpm_key_parms != NULL) { TPM_SizedBuffer_Delete(&(tpm_key_parms->parms)); TPM_RSAKeyParms_Delete(tpm_key_parms->tpm_rsa_key_parms); free(tpm_key_parms->tpm_rsa_key_parms); TPM_KeyParms_Init(tpm_key_parms); } return; } /* TPM_KeyParms_GetRSAKeyParms() gets the TPM_RSA_KEY_PARMS from a TPM_KEY_PARMS cache. Returns an error if the cache is NULL, since the cache should always be set when the TPM_KEY_PARMS indicates an RSA key. */ TPM_RESULT TPM_KeyParms_GetRSAKeyParms(TPM_RSA_KEY_PARMS **tpm_rsa_key_parms, TPM_KEY_PARMS *tpm_key_parms) { TPM_RESULT rc = 0; printf(" TPM_KeyParms_GetRSAKeyParms:\n"); /* algorithmID must be RSA */ if (rc == 0) { if (tpm_key_parms->algorithmID != TPM_ALG_RSA) { printf("TPM_KeyParms_GetRSAKeyParms: Error, incorrect algorithmID %08x\n", tpm_key_parms->algorithmID); rc = TPM_BAD_KEY_PROPERTY; } } /* if the TPM_RSA_KEY_PARMS structure has not been cached, deserialize it */ if (rc == 0) { if (tpm_key_parms->tpm_rsa_key_parms == NULL) { printf("TPM_KeyParms_GetRSAKeyParms: Error (fatal), cache is NULL\n"); /* This should never occur. The cache is loaded when the TPM_KEY_PARMS is loaded. */ rc = TPM_FAIL; } } /* return the cached structure */ if (rc == 0) { *tpm_rsa_key_parms = tpm_key_parms->tpm_rsa_key_parms; } return rc; } /* TPM_KeyParms_CheckProperties() checks that the TPM can generate a key of the type requested in 'tpm_key_parms' if' keyLength' is non-zero, checks that the tpm_key specifies the correct key length. If keyLength is 0, any tpm_key key length is accepted. */ TPM_RESULT TPM_KeyParms_CheckProperties(TPM_KEY_PARMS *tpm_key_parms, TPM_KEY_USAGE tpm_key_usage, uint32_t keyLength, /* in bits */ TPM_BOOL FIPS) { TPM_RESULT rc = 0; TPM_RSA_KEY_PARMS *tpm_rsa_key_parms; /* used if algorithmID indicates RSA */ printf(" TPM_KeyParms_CheckProperties: keyUsage %04hx\n", tpm_key_usage); printf(" TPM_KeyParms_CheckProperties: sigScheme %04hx\n", tpm_key_parms->sigScheme); printf(" TPM_KeyParms_CheckProperties: encScheme %04hx\n", tpm_key_parms->encScheme); if (rc == 0) { /* the code currently only supports RSA */ if (tpm_key_parms->algorithmID != TPM_ALG_RSA) { printf("TPM_KeyParms_CheckProperties: Error, algorithmID not TPM_ALG_RSA\n"); rc = TPM_BAD_KEY_PROPERTY; } } /* get the TPM_RSA_KEY_PARMS structure from the TPM_KEY_PARMS structure */ /* NOTE: for now only support RSA keys */ if (rc == 0) { rc = TPM_KeyParms_GetRSAKeyParms(&tpm_rsa_key_parms, tpm_key_parms); } /* check key length if specified as input parameter */ if ((rc == 0) && (keyLength != 0)) { if (tpm_rsa_key_parms->keyLength != keyLength) { /* in bits */ printf("TPM_KeyParms_CheckProperties: Error, Bad keyLength should be %u, was %u\n", keyLength, tpm_rsa_key_parms->keyLength); rc = TPM_BAD_KEY_PROPERTY; } } if (rc == 0) { if (tpm_rsa_key_parms->keyLength > TPM_RSA_KEY_LENGTH_MAX) { /* in bits */ printf("TPM_KeyParms_CheckProperties: Error, Bad keyLength max %u, was %u\n", TPM_RSA_KEY_LENGTH_MAX, tpm_rsa_key_parms->keyLength); rc = TPM_BAD_KEY_PROPERTY; } } /* kgold - Support only 2 primes */ if (rc == 0) { if (tpm_rsa_key_parms->numPrimes != 2) { printf("TPM_KeyParms_CheckProperties: Error, numPrimes %u should be 2\n", tpm_rsa_key_parms->numPrimes); rc = TPM_BAD_KEY_PROPERTY; } } /* if FIPS */ if ((rc == 0) && FIPS) { /* a. If keyInfo -> keySize is less than 1024 return TPM_NOTFIPS */ if (tpm_rsa_key_parms->keyLength < 1024) { printf("TPM_KeyParms_CheckProperties: Error, Invalid FIPS key length %u\n", tpm_rsa_key_parms->keyLength); rc = TPM_NOTFIPS; } /* c. If keyInfo -> keyUsage specifies TPM_KEY_LEGACY return TPM_NOTFIPS */ else if (tpm_key_usage == TPM_KEY_LEGACY) { printf("TPM_KeyParms_CheckProperties: Error, FIPS authDataUsage TPM_AUTH_NEVER\n"); rc = TPM_NOTFIPS; } } /* From Part 2 5.7.1 Mandatory Key Usage Schemes and TPM_CreateWrapKey, TPM_LoadKey */ if (rc == 0) { switch (tpm_key_usage) { case TPM_KEY_UNINITIALIZED: printf("TPM_KeyParms_CheckProperties: Error, keyUsage TPM_KEY_UNINITIALIZED\n"); rc = TPM_BAD_KEY_PROPERTY; break; case TPM_KEY_SIGNING: if (tpm_key_parms->encScheme != TPM_ES_NONE) { printf("TPM_KeyParms_CheckProperties: Error, " "Signing encScheme %04hx is not TPM_ES_NONE\n", tpm_key_parms->encScheme); rc = TPM_BAD_KEY_PROPERTY; } #ifdef TPM_V12 else if ((tpm_key_parms->sigScheme != TPM_SS_RSASSAPKCS1v15_SHA1) && (tpm_key_parms->sigScheme != TPM_SS_RSASSAPKCS1v15_DER) && (tpm_key_parms->sigScheme != TPM_SS_RSASSAPKCS1v15_INFO)) { #else /* TPM 1.1 */ else if (tpm_key_parms->sigScheme != TPM_SS_RSASSAPKCS1v15_SHA1) { #endif printf("TPM_KeyParms_CheckProperties: Error, " "Signing sigScheme %04hx is not DER, SHA1, INFO\n", tpm_key_parms->sigScheme); rc = TPM_BAD_KEY_PROPERTY; } break; case TPM_KEY_STORAGE: if (tpm_key_parms->encScheme != TPM_ES_RSAESOAEP_SHA1_MGF1) { printf("TPM_KeyParms_CheckProperties: Error, " "Storage encScheme %04hx is not TPM_ES_RSAESOAEP_SHA1_MGF1\n", tpm_key_parms->encScheme); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_key_parms->sigScheme != TPM_SS_NONE) { printf("TPM_KeyParms_CheckProperties: Error, " "Storage sigScheme %04hx is not TPM_SS_NONE\n", tpm_key_parms->sigScheme); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_key_parms->algorithmID != TPM_ALG_RSA) { /*constant condition*/ printf("TPM_KeyParms_CheckProperties: Error, " "Storage algorithmID %08x is not TPM_ALG_RSA\n", tpm_key_parms->algorithmID); rc = TPM_BAD_KEY_PROPERTY; } /* interoperable TPM only supports 2048 */ else if (tpm_rsa_key_parms->keyLength < 2048) { printf("TPM_KeyParms_CheckProperties: Error, " "Storage keyLength %d is less than 2048\n", tpm_rsa_key_parms->keyLength); rc = TPM_BAD_KEY_PROPERTY; } else { rc = TPM_KeyParams_CheckDefaultExponent(&(tpm_rsa_key_parms->exponent)); } break; case TPM_KEY_IDENTITY: if (tpm_key_parms->encScheme != TPM_ES_NONE) { printf("TPM_KeyParms_CheckProperties: Error, " "Identity encScheme %04hx is not TPM_ES_NONE\n", tpm_key_parms->encScheme); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_key_parms->sigScheme != TPM_SS_RSASSAPKCS1v15_SHA1) { printf("TPM_KeyParms_CheckProperties: Error, " "Identity sigScheme %04hx is not %04x\n", tpm_key_parms->sigScheme, TPM_SS_RSASSAPKCS1v15_SHA1); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_key_parms->algorithmID != TPM_ALG_RSA) { /*constant condition*/ printf("TPM_KeyParms_CheckProperties: Error, " "Identity algorithmID %08x is not TPM_ALG_RSA\n", tpm_key_parms->algorithmID); rc = TPM_BAD_KEY_PROPERTY; } /* interoperable TPM only supports 2048 */ else if (tpm_rsa_key_parms->keyLength < 2048) { printf("TPM_KeyParms_CheckProperties: Error, " "Identity keyLength %d is less than 2048\n", tpm_rsa_key_parms->keyLength); rc = TPM_BAD_KEY_PROPERTY; } else { rc = TPM_KeyParams_CheckDefaultExponent(&(tpm_rsa_key_parms->exponent)); } break; case TPM_KEY_AUTHCHANGE: if (tpm_key_parms->encScheme != TPM_ES_RSAESOAEP_SHA1_MGF1) { printf("TPM_KeyParms_CheckProperties: Error, " "Authchange encScheme %04hx is not TPM_ES_RSAESOAEP_SHA1_MGF1\n", tpm_key_parms->encScheme); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_key_parms->sigScheme != TPM_SS_NONE) { printf("TPM_KeyParms_CheckProperties: Error, " "Authchange sigScheme %04hx is not TPM_SS_NONE\n", tpm_key_parms->sigScheme); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_rsa_key_parms->keyLength < 512) { printf("TPM_KeyParms_CheckProperties: Error, " "Authchange keyLength %d is less than 512\n", tpm_rsa_key_parms->keyLength); rc = TPM_BAD_KEY_PROPERTY; } break; case TPM_KEY_BIND: if ((tpm_key_parms->encScheme != TPM_ES_RSAESOAEP_SHA1_MGF1) && (tpm_key_parms->encScheme != TPM_ES_RSAESPKCSv15)) { printf("TPM_KeyParms_CheckProperties: Error, " "Bind encScheme %04hx is not %04x or %04x\n", tpm_key_parms->encScheme, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_ES_RSAESPKCSv15); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_key_parms->sigScheme != TPM_SS_NONE) { printf("TPM_KeyParms_CheckProperties: Error, " "Bind sigScheme %04hx is not TPM_SS_NONE\n", tpm_key_parms->sigScheme); rc = TPM_BAD_KEY_PROPERTY; } break; case TPM_KEY_LEGACY: if ((tpm_key_parms->encScheme != TPM_ES_RSAESOAEP_SHA1_MGF1) && (tpm_key_parms->encScheme != TPM_ES_RSAESPKCSv15)) { printf("TPM_KeyParms_CheckProperties: Error, " "Legacy encScheme %04hx is not %04x or %04x\n", tpm_key_parms->encScheme, TPM_ES_RSAESOAEP_SHA1_MGF1, TPM_ES_RSAESPKCSv15); rc = TPM_BAD_KEY_PROPERTY; } else if ((tpm_key_parms->sigScheme != TPM_SS_RSASSAPKCS1v15_SHA1) && (tpm_key_parms->sigScheme != TPM_SS_RSASSAPKCS1v15_DER)) { printf("TPM_KeyParms_CheckProperties: Error, " "Legacy sigScheme %04hx is not %04x or %04x\n", tpm_key_parms->sigScheme, TPM_SS_RSASSAPKCS1v15_SHA1, TPM_SS_RSASSAPKCS1v15_DER); rc = TPM_BAD_KEY_PROPERTY; } break; case TPM_KEY_MIGRATE: if (tpm_key_parms->encScheme != TPM_ES_RSAESOAEP_SHA1_MGF1) { printf("TPM_KeyParms_CheckProperties: Error, " "Migrate encScheme %04hx is not TPM_ES_RSAESOAEP_SHA1_MGF1\n", tpm_key_parms->encScheme); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_key_parms->sigScheme != TPM_SS_NONE) { printf("TPM_KeyParms_CheckProperties: Error, " "Migrate sigScheme %04hx is not TPM_SS_NONE\n", tpm_key_parms->sigScheme); rc = TPM_BAD_KEY_PROPERTY; } else if (tpm_key_parms->algorithmID != TPM_ALG_RSA) { /*constant condition*/ printf("TPM_KeyParms_CheckProperties: Error, " "Migrate algorithmID %08x is not TPM_ALG_RSA\n", tpm_key_parms->algorithmID); rc = TPM_BAD_KEY_PROPERTY; } /* interoperable TPM only supports 2048 */ else if (tpm_rsa_key_parms->keyLength < 2048) { printf("TPM_KeyParms_CheckProperties: Error, " "Migrate keyLength %d is less than 2048\n", tpm_rsa_key_parms->keyLength); rc = TPM_BAD_KEY_PROPERTY; } else { rc = TPM_KeyParams_CheckDefaultExponent(&(tpm_rsa_key_parms->exponent)); } break; default: printf("TPM_KeyParms_CheckProperties: Error, Unknown keyUsage %04hx\n", tpm_key_usage); rc = TPM_BAD_KEY_PROPERTY; break; } } return rc; } TPM_RESULT TPM_KeyParams_CheckDefaultExponent(TPM_SIZED_BUFFER *exponent) { TPM_RESULT rc = 0; uint32_t i; if ((rc == 0) && (exponent->size != 0)) { /* 0 is the default */ printf(" TPM_KeyParams_CheckDefaultExponent: exponent size %u\n", exponent->size); if (rc == 0) { if (exponent->size < 3) { printf("TPM_KeyParams_CheckDefaultExponent: Error, exponent size is %u\n", exponent->size); rc = TPM_BAD_KEY_PROPERTY; } } if (rc == 0) { for (i = 3 ; i < exponent->size ; i++) { if (exponent->buffer[i] != 0) { printf("TPM_KeyParams_CheckDefaultExponent: Error, exponent[%u] is %02x\n", i, exponent->buffer[i]); rc = TPM_BAD_KEY_PROPERTY; } } } if (rc == 0) { if ((exponent->buffer[0] != tpm_default_rsa_exponent[0]) || (exponent->buffer[1] != tpm_default_rsa_exponent[1]) || (exponent->buffer[2] != tpm_default_rsa_exponent[2])) { printf("TPM_KeyParams_CheckDefaultExponent: Error, exponent is %02x %02x %02x\n", exponent->buffer[2], exponent->buffer[1], exponent->buffer[0]); rc = TPM_BAD_KEY_PROPERTY; } } } return rc; } /* TPM_STORE_ASYMKEY */ void TPM_StoreAsymkey_Init(TPM_STORE_ASYMKEY *tpm_store_asymkey) { printf(" TPM_StoreAsymkey_Init:\n"); tpm_store_asymkey->payload = TPM_PT_ASYM; TPM_Secret_Init(tpm_store_asymkey->usageAuth); TPM_Secret_Init(tpm_store_asymkey->migrationAuth); TPM_Digest_Init(tpm_store_asymkey->pubDataDigest); TPM_StorePrivkey_Init(&(tpm_store_asymkey->privKey)); return; } /* TPM_StoreAsymkey_Load() deserializes the TPM_STORE_ASYMKEY structure. The serialized structure contains the private factor p. Normally, 'tpm_key_parms' and tpm_store_pubkey are not NULL and the private key d is derived from p and the public key n and exponent e. In some cases, a TPM_STORE_ASYMKEY is being manipulated without the rest of the TPM_KEY structure. When 'tpm_key' is NULL, p is left intact, and the resulting structure cannot be used as a private key. */ TPM_RESULT TPM_StoreAsymkey_Load(TPM_STORE_ASYMKEY *tpm_store_asymkey, TPM_BOOL isEK, unsigned char **stream, uint32_t *stream_size, TPM_KEY_PARMS *tpm_key_parms, TPM_SIZED_BUFFER *pubKey) { TPM_RESULT rc = 0; printf(" TPM_StoreAsymkey_Load:\n"); /* load payload */ if ((rc == 0) && !isEK) { rc = TPM_Load8(&(tpm_store_asymkey->payload), stream, stream_size); } /* check payload value to ease debugging */ if ((rc == 0) && !isEK) { if ( /* normal key */ (tpm_store_asymkey->payload != TPM_PT_ASYM) && /* TPM_CMK_CreateKey payload */ (tpm_store_asymkey->payload != TPM_PT_MIGRATE_RESTRICTED) && /* TPM_CMK_ConvertMigration payload */ (tpm_store_asymkey->payload != TPM_PT_MIGRATE_EXTERNAL) ) { printf("TPM_StoreAsymkey_Load: Error, invalid payload %02x\n", tpm_store_asymkey->payload); rc = TPM_INVALID_STRUCTURE; } } /* load usageAuth */ if ((rc == 0) && !isEK) { rc = TPM_Secret_Load(tpm_store_asymkey->usageAuth, stream, stream_size); } /* load migrationAuth */ if ((rc == 0) && !isEK) { rc = TPM_Secret_Load(tpm_store_asymkey->migrationAuth, stream, stream_size); } /* load pubDataDigest */ if (rc == 0) { rc = TPM_Digest_Load(tpm_store_asymkey->pubDataDigest, stream, stream_size); } /* load privKey - actually prime factor p */ if (rc == 0) { rc = TPM_SizedBuffer_Load((&(tpm_store_asymkey->privKey.p_key)), stream, stream_size); } /* convert prime factor p to the private key */ if ((rc == 0) && (tpm_key_parms != NULL) && (pubKey != NULL)) { rc = TPM_StorePrivkey_Convert(tpm_store_asymkey, tpm_key_parms, pubKey); } return rc; } #if 0 static TPM_RESULT TPM_StoreAsymkey_LoadTest(TPM_KEY *tpm_key) { TPM_RESULT rc = 0; int irc; /* actual */ unsigned char *narr; unsigned char *earr; unsigned char *parr; unsigned char *qarr; unsigned char *darr; uint32_t nbytes; uint32_t ebytes; uint32_t pbytes; uint32_t qbytes; uint32_t dbytes; /* computed */ unsigned char *q1arr = NULL; unsigned char *d1arr = NULL; uint32_t q1bytes; uint32_t d1bytes; printf(" TPM_StoreAsymkey_LoadTest:\n"); /* actual data */ if (rc == 0) { narr = tpm_key->pubKey.key; darr = tpm_key->tpm_store_asymkey->privKey.d_key; parr = tpm_key->tpm_store_asymkey->privKey.p_key; qarr = tpm_key->tpm_store_asymkey->privKey.q_key; nbytes = tpm_key->pubKey.keyLength; dbytes = tpm_key->tpm_store_asymkey->privKey.d_keyLength; pbytes = tpm_key->tpm_store_asymkey->privKey.p_keyLength; qbytes = tpm_key->tpm_store_asymkey->privKey.q_keyLength; rc = TPM_Key_GetPublicKey(&nbytes, &narr, tpm_key); } if (rc == 0) { rc = TPM_Key_GetExponent(&ebytes, &earr, tpm_key); } if (rc == 0) { rc = TPM_Key_GetPrimeFactorP(&pbytes, &parr, tpm_key); } /* computed data */ if (rc == 0) { rc = TPM_RSAGetPrivateKey(&q1bytes, &q1arr, /* freed @1 */ &d1bytes, &d1arr, /* freed @2 */ nbytes, narr, ebytes, earr, pbytes, parr); } /* compare q */ if (rc == 0) { if (qbytes != q1bytes) { printf("TPM_StoreAsymkey_LoadTest: Error (fatal), qbytes %u q1bytes %u\n", qbytes, q1bytes); rc = TPM_FAIL; } } if (rc == 0) { irc = memcmp(qarr, q1arr, qbytes); if (irc != 0) { printf("TPM_StoreAsymkey_LoadTest: Error (fatal), qarr mismatch\n"); rc = TPM_FAIL; } } /* compare d */ if (rc == 0) { if (dbytes != d1bytes) { printf("TPM_StoreAsymkey_LoadTest: Error (fatal), dbytes %u d1bytes %u\n", dbytes, d1bytes); rc = TPM_FAIL; } } if (rc == 0) { irc = memcmp(darr, d1arr, dbytes); if (irc != 0) { printf("TPM_StoreAsymkey_LoadTest: Error (fatal), darr mismatch\n"); rc = TPM_FAIL; } } free(q1arr); /* @1 */ free(d1arr); /* @2 */ return rc; } #endif TPM_RESULT TPM_StoreAsymkey_Store(TPM_STORE_BUFFER *sbuffer, TPM_BOOL isEK, const TPM_STORE_ASYMKEY *tpm_store_asymkey) { TPM_RESULT rc = 0; printf(" TPM_StoreAsymkey_Store:\n"); /* store payload */ if ((rc == 0) && !isEK) { rc = TPM_Sbuffer_Append(sbuffer, &(tpm_store_asymkey->payload), sizeof(TPM_PAYLOAD_TYPE)); } /* store usageAuth */ if ((rc == 0) && !isEK) { rc = TPM_Secret_Store(sbuffer, tpm_store_asymkey->usageAuth); } /* store migrationAuth */ if ((rc == 0) && !isEK) { rc = TPM_Secret_Store(sbuffer, tpm_store_asymkey->migrationAuth); } /* store pubDataDigest */ if (rc == 0) { rc = TPM_Digest_Store(sbuffer, tpm_store_asymkey->pubDataDigest); } /* store privKey */ if (rc == 0) { rc = TPM_StorePrivkey_Store(sbuffer, &(tpm_store_asymkey->privKey)); } return rc; } void TPM_StoreAsymkey_Delete(TPM_STORE_ASYMKEY *tpm_store_asymkey) { printf(" TPM_StoreAsymkey_Delete:\n"); if (tpm_store_asymkey != NULL) { TPM_Secret_Delete(tpm_store_asymkey->usageAuth); TPM_Secret_Delete(tpm_store_asymkey->migrationAuth); TPM_StorePrivkey_Delete(&(tpm_store_asymkey->privKey)); TPM_StoreAsymkey_Init(tpm_store_asymkey); } return; } TPM_RESULT TPM_StoreAsymkey_GenerateEncData(TPM_SIZED_BUFFER *encData, TPM_STORE_ASYMKEY *tpm_store_asymkey, TPM_KEY *parent_key) { TPM_RESULT rc = 0; TPM_STORE_BUFFER sbuffer; /* TPM_STORE_ASYMKEY serialization */ printf(" TPM_StoreAsymkey_GenerateEncData;\n"); TPM_Sbuffer_Init(&sbuffer); /* freed @1 */ /* serialize the TPM_STORE_ASYMKEY member */ if (rc == 0) { rc = TPM_StoreAsymkey_Store(&sbuffer, FALSE, tpm_store_asymkey); } if (rc == 0) { rc = TPM_RSAPublicEncryptSbuffer_Key(encData, &sbuffer, parent_key); } TPM_Sbuffer_Delete(&sbuffer); /* @1 */ return rc; } /* TPM_StoreAsymkey_GetPrimeFactorP() gets the prime factor p from the TPM_STORE_ASYMKEY */ TPM_RESULT TPM_StoreAsymkey_GetPrimeFactorP(uint32_t *pbytes, unsigned char **parr, TPM_STORE_ASYMKEY *tpm_store_asymkey) { TPM_RESULT rc = 0; printf(" TPM_StoreAsymkey_GetPrimeFactorP:\n"); if (rc == 0) { *pbytes = tpm_store_asymkey->privKey.p_key.size; *parr = tpm_store_asymkey->privKey.p_key.buffer; TPM_PrintFour(" TPM_StoreAsymkey_GetPrimeFactorP:", *parr); } return rc; } /* TPM_StoreAsymkey_GetO1Size() calculates the destination o1 size for a TPM_STORE_ASYMKEY Used for creating a migration blob, TPM_STORE_ASYMKEY -> TPM_MIGRATE_ASYMKEY. */ void TPM_StoreAsymkey_GetO1Size(uint32_t *o1_size, TPM_STORE_ASYMKEY *tpm_store_asymkey) { *o1_size = tpm_store_asymkey->privKey.p_key.size + /* private key */ sizeof(uint32_t) - /* private key length */ TPM_DIGEST_SIZE + /* - k1 -> k2 TPM_MIGRATE_ASYMKEY -> partPrivKey */ sizeof(uint32_t) + /* TPM_MIGRATE_ASYMKEY -> partPrivKeyLen */ sizeof(TPM_PAYLOAD_TYPE) + /* TPM_MIGRATE_ASYMKEY -> payload */ TPM_SECRET_SIZE + /* TPM_MIGRATE_ASYMKEY -> usageAuth */ TPM_DIGEST_SIZE + /* TPM_MIGRATE_ASYMKEY -> pubDataDigest */ TPM_DIGEST_SIZE + /* OAEP pHash */ TPM_DIGEST_SIZE + /* OAEP seed */ 1; /* OAEP 0x01 byte */ printf(" TPM_StoreAsymkey_GetO1Size: key size %u o1 size %u\n", tpm_store_asymkey->privKey.p_key.size, *o1_size); } /* TPM_StoreAsymkey_CheckO1Size() verifies the destination o1_size against the source k1k2 array length This is a currently just a sanity check on the TPM_StoreAsymkey_GetO1Size() function. */ TPM_RESULT TPM_StoreAsymkey_CheckO1Size(uint32_t o1_size, uint32_t k1k2_length) { TPM_RESULT rc = 0; /* sanity check the TPM_MIGRATE_ASYMKEY size against the requested o1 size */ /* K1 K2 are the length and value of the private key, 4 + 128 bytes for a 2048-bit key */ if (o1_size < (k1k2_length - TPM_DIGEST_SIZE + /* k1 k2, the first 20 bytes are used as the OAEP seed */ sizeof(TPM_PAYLOAD_TYPE) + /* TPM_MIGRATE_ASYMKEY -> payload */ TPM_SECRET_SIZE + /* TPM_MIGRATE_ASYMKEY -> usageAuth */ TPM_DIGEST_SIZE + /* TPM_MIGRATE_ASYMKEY -> pubDataDigest */ sizeof(uint32_t) + /* TPM_MIGRATE_ASYMKEY -> partPrivKeyLen */ TPM_DIGEST_SIZE + /* OAEP pHash */ TPM_DIGEST_SIZE + /* OAEP seed */ 1)) { /* OAEP 0x01 byte */ printf(" TPM_StoreAsymkey_CheckO1Size: Error (fatal) k1k2_length %d too large for o1 %u\n", k1k2_length, o1_size); rc = TPM_FAIL; } return rc; } /* TPM_StoreAsymkey_StoreO1() creates an OAEP encoded TPM_MIGRATE_ASYMKEY from a TPM_STORE_ASYMKEY. It does the common steps of constructing the TPM_MIGRATE_ASYMKEY, serializing it, and OAEP padding. */ TPM_RESULT TPM_StoreAsymkey_StoreO1(BYTE *o1, uint32_t o1_size, TPM_STORE_ASYMKEY *tpm_store_asymkey, TPM_DIGEST pHash, TPM_PAYLOAD_TYPE payload_type, TPM_SECRET usageAuth) { TPM_RESULT rc = 0; TPM_STORE_BUFFER k1k2_sbuffer; /* serialization of TPM_STORE_ASYMKEY -> privKey -> key */ const unsigned char *k1k2; /* serialization results */ uint32_t k1k2_length; TPM_MIGRATE_ASYMKEY tpm_migrate_asymkey; TPM_STORE_BUFFER tpm_migrate_asymkey_sbuffer; /* serialized tpm_migrate_asymkey */ const unsigned char *tpm_migrate_asymkey_buffer; uint32_t tpm_migrate_asymkey_length; printf(" TPM_StoreAsymkey_StoreO1:\n"); TPM_Sbuffer_Init(&k1k2_sbuffer); /* freed @1 */ TPM_MigrateAsymkey_Init(&tpm_migrate_asymkey); /* freed @2 */ TPM_Sbuffer_Init(&tpm_migrate_asymkey_sbuffer); /* freed @3 */ /* NOTE Comments from TPM_CreateMigrationBlob rev 81 */ /* a. Build two byte arrays, K1 and K2: */ /* i. K1 = TPM_STORE_ASYMKEY.privKey[0..19] (TPM_STORE_ASYMKEY.privKey.keyLength + 16 bytes of TPM_STORE_ASYMKEY.privKey.key), sizeof(K1) = 20 */ /* ii. K2 = TPM_STORE_ASYMKEY.privKey[20..131] (position 16-127 of TPM_STORE_ASYMKEY. privKey.key), sizeof(K2) = 112 */ if (rc == 0) { rc = TPM_SizedBuffer_Store(&k1k2_sbuffer, &(tpm_store_asymkey->privKey.p_key)); } if (rc == 0) { TPM_Sbuffer_Get(&k1k2_sbuffer, &k1k2, &k1k2_length); /* sanity check the TPM_STORE_ASYMKEY -> privKey -> key size against the requested o1 size */ rc = TPM_StoreAsymkey_CheckO1Size(o1_size, k1k2_length); } /* b. Build M1 a TPM_MIGRATE_ASYMKEY structure */ /* i. TPM_MIGRATE_ASYMKEY.payload = TPM_PT_MIGRATE */ /* ii. TPM_MIGRATE_ASYMKEY.usageAuth = TPM_STORE_ASYMKEY.usageAuth */ /* iii. TPM_MIGRATE_ASYMKEY.pubDataDigest = TPM_STORE_ASYMKEY. pubDataDigest */ /* iv. TPM_MIGRATE_ASYMKEY.partPrivKeyLen = 112 - 127. */ /* v. TPM_MIGRATE_ASYMKEY.partPrivKey = K2 */ if (rc == 0) { tpm_migrate_asymkey.payload = payload_type; TPM_Secret_Copy(tpm_migrate_asymkey.usageAuth, usageAuth); TPM_Digest_Copy(tpm_migrate_asymkey.pubDataDigest, tpm_store_asymkey->pubDataDigest); TPM_PrintFour(" TPM_StoreAsymkey_StoreO1: k1 -", k1k2); TPM_PrintFour(" TPM_StoreAsymkey_StoreO1: k2 -", k1k2 + TPM_DIGEST_SIZE); rc = TPM_SizedBuffer_Set(&(tpm_migrate_asymkey.partPrivKey), k1k2_length - TPM_DIGEST_SIZE, /* k2 length 112 for 2048 bit key */ k1k2 + TPM_DIGEST_SIZE); /* k2 */ } /* c. Create o1 (which SHALL be 198 bytes for a 2048 bit RSA key) by performing the OAEP encoding of m using OAEP parameters of */ /* i. m = M1 the TPM_MIGRATE_ASYMKEY structure */ /* ii. pHash = d1->migrationAuth */ /* iii. seed = s1 = K1 */ if (rc == 0) { /* serialize TPM_MIGRATE_ASYMKEY m */ rc = TPM_MigrateAsymkey_Store(&tpm_migrate_asymkey_sbuffer, &tpm_migrate_asymkey); } if (rc == 0) { /* get the serialization result */ TPM_Sbuffer_Get(&tpm_migrate_asymkey_sbuffer, &tpm_migrate_asymkey_buffer, &tpm_migrate_asymkey_length); TPM_PrintFour(" TPM_StoreAsymkey_StoreO1: pHash -", pHash); rc = TPM_RSA_padding_add_PKCS1_OAEP(o1, /* output */ o1_size, tpm_migrate_asymkey_buffer, /* message */ tpm_migrate_asymkey_length, pHash, k1k2); /* k1, seed */ TPM_PrintFour(" TPM_StoreAsymkey_StoreO1: o1 -", o1); } TPM_Sbuffer_Delete(&k1k2_sbuffer); /* @1 */ TPM_MigrateAsymkey_Delete(&tpm_migrate_asymkey); /* @2 */ TPM_Sbuffer_Delete(&tpm_migrate_asymkey_sbuffer); /* @3 */ return rc; } /* TPM_StoreAsymkey_LoadO1() extracts TPM_STORE_ASYMKEY from the OAEP encoded TPM_MIGRATE_ASYMKEY. It does the common steps OAEP depadding, deserializing the TPM_MIGRATE_ASYMKEY, and reconstructing the TPM_STORE_ASYMKEY. It sets these, which may or may not be correct at a higher level TPM_STORE_ASYMKEY -> payload = TPM_MIGRATE_ASYMKEY -> payload TPM_STORE_ASYMKEY -> usageAuth = TPM_MIGRATE_ASYMKEY -> usageAuth TPM_STORE_ASYMKEY -> migrationAuth = pHash TPM_STORE_ASYMKEY -> pubDataDigest = TPM_MIGRATE_ASYMKEY -> pubDataDigest TPM_STORE_ASYMKEY -> privKey = seed + TPM_MIGRATE_ASYMKEY -> partPrivKey */ TPM_RESULT TPM_StoreAsymkey_LoadO1(TPM_STORE_ASYMKEY *tpm_store_asymkey, /* output */ BYTE *o1, /* input */ uint32_t o1_size) /* input */ { TPM_RESULT rc = 0; BYTE *tpm_migrate_asymkey_buffer; uint32_t tpm_migrate_asymkey_length; TPM_DIGEST seed; TPM_DIGEST pHash; unsigned char *stream; /* for deserializing structures */ uint32_t stream_size; TPM_MIGRATE_ASYMKEY tpm_migrate_asymkey; TPM_STORE_BUFFER k1k2_sbuffer; const unsigned char *k1k2_buffer; uint32_t k1k2_length; printf(" TPM_StoreAsymkey_LoadO1:\n"); TPM_MigrateAsymkey_Init(&tpm_migrate_asymkey); /* freed @1 */ TPM_Sbuffer_Init(&k1k2_sbuffer); /* freed @2 */ tpm_migrate_asymkey_buffer = NULL; /* freed @3 */ /* allocate memory for TPM_MIGRATE_ASYMKEY after removing OAEP pad from o1 */ if (rc == 0) { rc = TPM_Malloc(&tpm_migrate_asymkey_buffer, o1_size); } if (rc == 0) { TPM_PrintFour(" TPM_StoreAsymkey_LoadO1: o1 -", o1); /* 5. Create m1, seed and pHash by OAEP decoding o1 */ printf(" TPM_StoreAsymkey_LoadO1: Depadding\n"); rc = TPM_RSA_padding_check_PKCS1_OAEP(tpm_migrate_asymkey_buffer, /* out: to */ &tpm_migrate_asymkey_length, /* out: to length */ o1_size, /* to size */ o1, o1_size, /* from, from length */ pHash, seed); TPM_PrintFour(" TPM_StoreAsymkey_LoadO1: tpm_migrate_asymkey_buffer -", tpm_migrate_asymkey_buffer); printf(" TPM_StoreAsymkey_LoadO1: tpm_migrate_asymkey_length %u\n", tpm_migrate_asymkey_length); TPM_PrintFour(" TPM_StoreAsymkey_LoadO1: - pHash", pHash); TPM_PrintFour(" TPM_StoreAsymkey_LoadO1: - seed", seed); } /* deserialize the buffer back to a TPM_MIGRATE_ASYMKEY */ if (rc == 0) { stream = tpm_migrate_asymkey_buffer; stream_size = tpm_migrate_asymkey_length; rc = TPM_MigrateAsymkey_Load(&tpm_migrate_asymkey, &stream, &stream_size); printf(" TPM_StoreAsymkey_LoadO1: partPrivKey length %u\n", tpm_migrate_asymkey.partPrivKey.size); TPM_PrintFour(" TPM_StoreAsymkey_LoadO1: partPrivKey -", tpm_migrate_asymkey.partPrivKey.buffer); } /* create k1k2 by combining seed (k1) and TPM_MIGRATE_ASYMKEY.partPrivKey (k2) field */ if (rc == 0) { rc = TPM_Digest_Store(&k1k2_sbuffer, seed); } if (rc == 0) { rc = TPM_Sbuffer_Append(&k1k2_sbuffer, tpm_migrate_asymkey.partPrivKey.buffer, tpm_migrate_asymkey.partPrivKey.size); } /* assemble the TPM_STORE_ASYMKEY structure */ if (rc == 0) { tpm_store_asymkey->payload = tpm_migrate_asymkey.payload; TPM_Digest_Copy(tpm_store_asymkey->usageAuth, tpm_migrate_asymkey.usageAuth); TPM_Digest_Copy(tpm_store_asymkey->migrationAuth, pHash); TPM_Digest_Copy(tpm_store_asymkey->pubDataDigest, tpm_migrate_asymkey.pubDataDigest); TPM_Sbuffer_Get(&k1k2_sbuffer, &k1k2_buffer, &k1k2_length); printf(" TPM_StoreAsymkey_LoadO1: k1k2 length %u\n", k1k2_length); TPM_PrintFour(" TPM_StoreAsymkey_LoadO1: k1k2", k1k2_buffer); rc = TPM_SizedBuffer_Load(&(tpm_store_asymkey->privKey.p_key), (unsigned char **)&k1k2_buffer, &k1k2_length); } TPM_MigrateAsymkey_Delete(&tpm_migrate_asymkey); /* @1 */ TPM_Sbuffer_Delete(&k1k2_sbuffer); /* @2 */ free(tpm_migrate_asymkey_buffer); /* @3 */ return rc; } /* TPM_MIGRATE_ASYMKEY */ /* TPM_MigrateAsymkey_Init() sets members to default values sets all pointers to NULL and sizes to 0 always succeeds - no return code */ void TPM_MigrateAsymkey_Init(TPM_MIGRATE_ASYMKEY *tpm_migrate_asymkey) { printf(" TPM_MigrateAsymkey_Init:\n"); tpm_migrate_asymkey->payload = TPM_PT_MIGRATE; TPM_Secret_Init(tpm_migrate_asymkey->usageAuth); TPM_Digest_Init(tpm_migrate_asymkey->pubDataDigest); TPM_SizedBuffer_Init(&(tpm_migrate_asymkey->partPrivKey)); return; } /* TPM_MigrateAsymkey_Load() deserialize the structure from a 'stream' 'stream_size' is checked for sufficient data returns 0 or error codes Before use, call TPM_MigrateAsymkey_Init() After use, call TPM_MigrateAsymkey_Delete() to free memory */ TPM_RESULT TPM_MigrateAsymkey_Load(TPM_MIGRATE_ASYMKEY *tpm_migrate_asymkey, unsigned char **stream, uint32_t *stream_size) { TPM_RESULT rc = 0; printf(" TPM_MigrateAsymkey_Load:\n"); /* load payload */ if (rc == 0) { rc = TPM_Load8(&(tpm_migrate_asymkey->payload), stream, stream_size); } /* check payload value to ease debugging */ if (rc == 0) { if ((tpm_migrate_asymkey->payload != TPM_PT_MIGRATE) && (tpm_migrate_asymkey->payload != TPM_PT_MAINT) && (tpm_migrate_asymkey->payload != TPM_PT_CMK_MIGRATE)) { printf("TPM_MigrateAsymkey_Load: Error illegal payload %02x\n", tpm_migrate_asymkey->payload); rc = TPM_INVALID_STRUCTURE; } } /* load usageAuth */ if (rc == 0) { rc = TPM_Secret_Load(tpm_migrate_asymkey->usageAuth, stream, stream_size); } /* load pubDataDigest */ if (rc == 0) { rc = TPM_Digest_Load(tpm_migrate_asymkey->pubDataDigest, stream, stream_size); } /* load partPrivKey */ if (rc == 0) { rc = TPM_SizedBuffer_Load(&(tpm_migrate_asymkey->partPrivKey), stream, stream_size); } return rc; } /* TPM_MigrateAsymkey_Store() serialize the structure to a stream contained in 'sbuffer' returns 0 or error codes */ TPM_RESULT TPM_MigrateAsymkey_Store(TPM_STORE_BUFFER *sbuffer, const TPM_MIGRATE_ASYMKEY *tpm_migrate_asymkey) { TPM_RESULT rc = 0; printf(" TPM_MigrateAsymkey_Store:\n"); /* store payload */ if (rc == 0) { rc = TPM_Sbuffer_Append(sbuffer, &(tpm_migrate_asymkey->payload), sizeof(TPM_PAYLOAD_TYPE)); } /* store usageAuth */ if (rc == 0) { rc = TPM_Secret_Store(sbuffer, tpm_migrate_asymkey->usageAuth); } /* store pubDataDigest */ if (rc == 0) { rc = TPM_Digest_Store(sbuffer, tpm_migrate_asymkey->pubDataDigest); } /* store partPrivKey */ if (rc == 0) { rc = TPM_SizedBuffer_Store(sbuffer, &(tpm_migrate_asymkey->partPrivKey)); } return rc; } /* TPM_MigrateAsymkey_Delete() No-OP if the parameter is NULL, else: frees memory allocated for the object sets pointers to NULL calls TPM_MigrateAsymkey_Init to set members back to default values The object itself is not freed */ void TPM_MigrateAsymkey_Delete(TPM_MIGRATE_ASYMKEY *tpm_migrate_asymkey) { printf(" TPM_MigrateAsymkey_Delete:\n"); if (tpm_migrate_asymkey != NULL) { TPM_Secret_Delete(tpm_migrate_asymkey->usageAuth); TPM_SizedBuffer_Zero(&(tpm_migrate_asymkey->partPrivKey)); TPM_SizedBuffer_Delete(&(tpm_migrate_asymkey->partPrivKey)); TPM_MigrateAsymkey_Init(tpm_migrate_asymkey); } return; } /* TPM_STORE_PRIVKEY */ void TPM_StorePrivkey_Init(TPM_STORE_PRIVKEY *tpm_store_privkey) { printf(" TPM_StorePrivkey_Init:\n"); TPM_SizedBuffer_Init(&(tpm_store_privkey->d_key)); TPM_SizedBuffer_Init(&(tpm_store_privkey->p_key)); TPM_SizedBuffer_Init(&(tpm_store_privkey->q_key)); return; } /* TPM_StorePrivkey_Convert() sets the prime factor q and private key d based on the prime factor p and the public key and exponent. */ TPM_RESULT TPM_StorePrivkey_Convert(TPM_STORE_ASYMKEY *tpm_store_asymkey, /* I/O result */ TPM_KEY_PARMS *tpm_key_parms, /* to get exponent */ TPM_SIZED_BUFFER *pubKey) /* to get public key */ { TPM_RESULT rc = 0; /* computed data */ unsigned char *narr; unsigned char *earr; unsigned char *parr; unsigned char *qarr = NULL; unsigned char *darr = NULL; uint32_t nbytes; uint32_t ebytes; uint32_t pbytes; uint32_t qbytes; uint32_t dbytes; printf(" TPM_StorePrivkey_Convert:\n"); if (rc == 0) { TPM_PrintFour(" TPM_StorePrivkey_Convert: p", tpm_store_asymkey->privKey.p_key.buffer); nbytes = pubKey->size; narr = pubKey->buffer; rc = TPM_KeyParms_GetExponent(&ebytes, &earr, tpm_key_parms); } if (rc == 0) { rc = TPM_StoreAsymkey_GetPrimeFactorP(&pbytes, &parr, tpm_store_asymkey); } if (rc == 0) { rc = TPM_RSAGetPrivateKey(&qbytes, &qarr, /* freed @1 */ &dbytes, &darr, /* freed @2 */ nbytes, narr, ebytes, earr, pbytes, parr); } if (rc == 0) { TPM_PrintFour(" TPM_StorePrivkey_Convert: q", qarr); TPM_PrintFour(" TPM_StorePrivkey_Convert: d", darr); rc = TPM_SizedBuffer_Set((&(tpm_store_asymkey->privKey.q_key)), qbytes, qarr); } if (rc == 0) { rc = TPM_SizedBuffer_Set((&(tpm_store_asymkey->privKey.d_key)), dbytes, darr); } free(qarr); /* @1 */ free(darr); /* @2 */ return rc; } /* TPM_StorePrivkey_Store serializes a TPM_STORE_PRIVKEY structure, appending results to 'sbuffer' Only the prime factor p is stored. The other prime factor q and the private key d are recalculated after a load. */ TPM_RESULT TPM_StorePrivkey_Store(TPM_STORE_BUFFER *sbuffer, const TPM_STORE_PRIVKEY *tpm_store_privkey) { TPM_RESULT rc = 0; printf(" TPM_StorePrivkey_Store:\n"); if (rc == 0) { TPM_PrintFour(" TPM_StorePrivkey_Store: p", tpm_store_privkey->p_key.buffer); rc = TPM_SizedBuffer_Store(sbuffer, &(tpm_store_privkey->p_key)); } return rc; } void TPM_StorePrivkey_Delete(TPM_STORE_PRIVKEY *tpm_store_privkey) { printf(" TPM_StorePrivkey_Delete:\n"); if (tpm_store_privkey != NULL) { TPM_SizedBuffer_Zero(&(tpm_store_privkey->d_key)); TPM_SizedBuffer_Zero(&(tpm_store_privkey->p_key)); TPM_SizedBuffer_Zero(&(tpm_store_privkey->q_key)); TPM_SizedBuffer_Delete(&(tpm_store_privkey->d_key)); TPM_SizedBuffer_Delete(&(tpm_store_privkey->p_key)); TPM_SizedBuffer_Delete(&(tpm_store_privkey->q_key)); TPM_StorePrivkey_Init(tpm_store_privkey); } return; } /* TPM_PUBKEY */ void TPM_Pubkey_Init(TPM_PUBKEY *tpm_pubkey) { printf(" TPM_Pubkey_Init:\n"); TPM_KeyParms_Init(&(tpm_pubkey->algorithmParms)); TPM_SizedBuffer_Init(&(tpm_pubkey->pubKey)); return; } TPM_RESULT TPM_Pubkey_Load(TPM_PUBKEY *tpm_pubkey, /* result */ unsigned char **stream, /* pointer to next parameter */ uint32_t *stream_size) /* stream size left */ { TPM_RESULT rc = 0; printf(" TPM_Pubkey_Load:\n"); /* load algorithmParms */ if (rc == 0) { rc = TPM_KeyParms_Load(&(tpm_pubkey->algorithmParms), stream, stream_size); } /* load pubKey */ if (rc == 0) { rc = TPM_SizedBuffer_Load(&(tpm_pubkey->pubKey), stream, stream_size); } return rc; } /* TPM_Pubkey_Store serializes a TPM_PUBKEY structure, appending results to 'sbuffer' */ TPM_RESULT TPM_Pubkey_Store(TPM_STORE_BUFFER *sbuffer, TPM_PUBKEY *tpm_pubkey) { TPM_RESULT rc = 0; printf(" TPM_Pubkey_Store:\n"); if (rc == 0) { rc = TPM_KeyParms_Store(sbuffer, &(tpm_pubkey->algorithmParms)); } if (rc == 0) { rc = TPM_SizedBuffer_Store(sbuffer, &(tpm_pubkey->pubKey)); } return rc; } void TPM_Pubkey_Delete(TPM_PUBKEY *tpm_pubkey) { printf(" TPM_Pubkey_Delete:\n"); if (tpm_pubkey != NULL) { TPM_KeyParms_Delete(&(tpm_pubkey->algorithmParms)); TPM_SizedBuffer_Delete(&(tpm_pubkey->pubKey)); TPM_Pubkey_Init(tpm_pubkey); } return; } TPM_RESULT TPM_Pubkey_Set(TPM_PUBKEY *tpm_pubkey, TPM_KEY *tpm_key) { TPM_RESULT rc = 0; printf(" TPM_Pubkey_Set:\n"); if (rc == 0) { /* add TPM_KEY_PARMS algorithmParms */ rc = TPM_KeyParms_Copy(&(tpm_pubkey->algorithmParms), &(tpm_key->algorithmParms)); } if (rc == 0) { /* add TPM_SIZED_BUFFER pubKey */ rc = TPM_SizedBuffer_Copy(&(tpm_pubkey->pubKey), &(tpm_key->pubKey)); } return rc; } TPM_RESULT TPM_Pubkey_Copy(TPM_PUBKEY *dest_tpm_pubkey, TPM_PUBKEY *src_tpm_pubkey) { TPM_RESULT rc = 0; printf(" TPM_Pubkey_Copy:\n"); /* copy TPM_KEY_PARMS algorithmParms */ if (rc == 0) { rc = TPM_KeyParms_Copy(&(dest_tpm_pubkey->algorithmParms), &(src_tpm_pubkey->algorithmParms)); } /* copy TPM_SIZED_BUFFER pubKey */ if (rc == 0) { rc = TPM_SizedBuffer_Copy(&(dest_tpm_pubkey->pubKey), &(src_tpm_pubkey->pubKey)); } return rc; } /* TPM_Pubkey_GetExponent() gets the exponent key from the TPM_RSA_KEY_PARMS contained in a TPM_PUBKEY */ TPM_RESULT TPM_Pubkey_GetExponent(uint32_t *ebytes, unsigned char **earr, TPM_PUBKEY *tpm_pubkey) { TPM_RESULT rc = 0; printf(" TPM_Pubkey_GetExponent:\n"); if (rc == 0) { rc = TPM_KeyParms_GetExponent(ebytes, earr, &(tpm_pubkey->algorithmParms)); } return rc; } /* TPM_Pubkey_GetPublicKey() gets the public key from the TPM_PUBKEY */ TPM_RESULT TPM_Pubkey_GetPublicKey(uint32_t *nbytes, unsigned char **narr, TPM_PUBKEY *tpm_pubkey) { TPM_RESULT rc = 0; printf(" TPM_Pubkey_GetPublicKey:\n"); if (rc == 0) { *nbytes = tpm_pubkey->pubKey.size; *narr = tpm_pubkey->pubKey.buffer; } return rc; } /* TPM_RSA_KEY_PARMS */ /* Allocates and loads a TPM_RSA_KEY_PARMS structure Must be delete'd and freed by the caller. */ void TPM_RSAKeyParms_Init(TPM_RSA_KEY_PARMS *tpm_rsa_key_parms) { printf(" TPM_RSAKeyParms_Init:\n"); tpm_rsa_key_parms->keyLength = 0; tpm_rsa_key_parms->numPrimes = 0; TPM_SizedBuffer_Init(&(tpm_rsa_key_parms->exponent)); return; } /* TPM_RSAKeyParms_Load() sets members from stream, and shifts the stream past the bytes consumed. Must call TPM_RSAKeyParms_Delete() to free */ TPM_RESULT TPM_RSAKeyParms_Load(TPM_RSA_KEY_PARMS *tpm_rsa_key_parms, /* result */ unsigned char **stream, /* pointer to next parameter */ uint32_t *stream_size) /* stream size left */ { TPM_RESULT rc = 0; printf(" TPM_RSAKeyParms_Load:\n"); /* load keyLength */ if (rc == 0) { rc = TPM_Load32(&(tpm_rsa_key_parms->keyLength), stream, stream_size); } /* load numPrimes */ if (rc == 0) { rc = TPM_Load32(&(tpm_rsa_key_parms->numPrimes), stream, stream_size); } /* load exponent */ if (rc == 0) { rc = TPM_SizedBuffer_Load(&(tpm_rsa_key_parms->exponent), stream, stream_size); } return rc; } /* TPM_RSAKeyParms_Store serializes a TPM_RSA_KEY_PARMS structure, appending results to 'sbuffer' */ TPM_RESULT TPM_RSAKeyParms_Store(TPM_STORE_BUFFER *sbuffer, const TPM_RSA_KEY_PARMS *tpm_rsa_key_parms) { TPM_RESULT rc = 0; printf(" TPM_RSAKeyParms_Store:\n"); /* store keyLength */ if (rc == 0) { rc = TPM_Sbuffer_Append32(sbuffer, tpm_rsa_key_parms->keyLength); } /* store numPrimes */ if (rc == 0) { rc = TPM_Sbuffer_Append32(sbuffer, tpm_rsa_key_parms->numPrimes); } /* store exponent */ if (rc == 0) { rc = TPM_SizedBuffer_Store(sbuffer, &(tpm_rsa_key_parms->exponent)); } return rc; } /* TPM_RSAKeyParms_Delete frees any member allocated memory If 'tpm_rsa_key_parms' is NULL, this is a no-op. */ void TPM_RSAKeyParms_Delete(TPM_RSA_KEY_PARMS *tpm_rsa_key_parms) { printf(" TPM_RSAKeyParms_Delete:\n"); if (tpm_rsa_key_parms != NULL) { TPM_SizedBuffer_Delete(&(tpm_rsa_key_parms->exponent)); TPM_RSAKeyParms_Init(tpm_rsa_key_parms); } return; } /* TPM_RSAKeyParms_Copy() does a copy of the source to the destination. The destination must be initialized first. */ TPM_RESULT TPM_RSAKeyParms_Copy(TPM_RSA_KEY_PARMS *tpm_rsa_key_parms_dest, TPM_RSA_KEY_PARMS *tpm_rsa_key_parms_src) { TPM_RESULT rc = 0; printf(" TPM_RSAKeyParms_Copy:\n"); if (rc == 0) { tpm_rsa_key_parms_dest->keyLength = tpm_rsa_key_parms_src->keyLength; tpm_rsa_key_parms_dest->numPrimes = tpm_rsa_key_parms_src->numPrimes; rc = TPM_SizedBuffer_Copy(&(tpm_rsa_key_parms_dest->exponent), &(tpm_rsa_key_parms_src->exponent)); } return rc; } /* TPM_RSAKeyParms_New() allocates memory for a TPM_RSA_KEY_PARMS and initializes the structure */ TPM_RESULT TPM_RSAKeyParms_New(TPM_RSA_KEY_PARMS **tpm_rsa_key_parms) { TPM_RESULT rc = 0; printf(" TPM_RSAKeyParms_New:\n"); if (rc == 0) { rc = TPM_Malloc((unsigned char **)tpm_rsa_key_parms, sizeof(TPM_RSA_KEY_PARMS)); } if (rc == 0) { TPM_RSAKeyParms_Init(*tpm_rsa_key_parms); } return rc; } /* TPM_RSAKeyParms_GetExponent() gets the exponent array and size from tpm_rsa_key_parms. If the structure exponent.size is zero, the default RSA exponent is returned. */ TPM_RESULT TPM_RSAKeyParms_GetExponent(uint32_t *ebytes, unsigned char **earr, TPM_RSA_KEY_PARMS *tpm_rsa_key_parms) { TPM_RESULT rc = 0; printf(" TPM_RSAKeyParms_GetExponent:\n"); if (tpm_rsa_key_parms->exponent.size != 0) { *ebytes = tpm_rsa_key_parms->exponent.size; *earr = tpm_rsa_key_parms->exponent.buffer; } else { *ebytes = 3; *earr = tpm_default_rsa_exponent; } return rc; } /* A Key Handle Entry */ /* TPM_KeyHandleEntry_Init() removes an entry from the list. It DOES NOT delete the TPM_KEY object. */ void TPM_KeyHandleEntry_Init(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry) { tpm_key_handle_entry->handle = 0; tpm_key_handle_entry->key = NULL; tpm_key_handle_entry->parentPCRStatus = TRUE; tpm_key_handle_entry->keyControl = 0; return; } /* TPM_KeyHandleEntry_Load() deserialize the structure from a 'stream' 'stream_size' is checked for sufficient data returns 0 or error codes Before use, call TPM_KeyHandleEntry_Init() After use, call TPM_KeyHandleEntry_Delete() to free memory */ TPM_RESULT TPM_KeyHandleEntry_Load(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry, unsigned char **stream, uint32_t *stream_size) { TPM_RESULT rc = 0; printf(" TPM_KeyHandleEntry_Load:\n"); /* load handle */ if (rc == 0) { rc = TPM_Load32(&(tpm_key_handle_entry->handle), stream, stream_size); } /* malloc space for the key member */ if (rc == 0) { rc = TPM_Malloc((unsigned char **)&(tpm_key_handle_entry->key), sizeof(TPM_KEY)); } /* load key */ if (rc == 0) { TPM_Key_Init(tpm_key_handle_entry->key); rc = TPM_Key_LoadClear(tpm_key_handle_entry->key, FALSE, /* not EK */ stream, stream_size); } /* load parentPCRStatus */ if (rc == 0) { rc = TPM_LoadBool(&(tpm_key_handle_entry->parentPCRStatus), stream, stream_size); } /* load keyControl */ if (rc == 0) { rc = TPM_Load32(&(tpm_key_handle_entry->keyControl), stream, stream_size); } return rc; } /* TPM_KeyHandleEntry_Store() serialize the structure to a stream contained in 'sbuffer' returns 0 or error codes */ TPM_RESULT TPM_KeyHandleEntry_Store(TPM_STORE_BUFFER *sbuffer, const TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry) { TPM_RESULT rc = 0; printf(" TPM_KeyHandleEntry_Store:\n"); /* store handle */ if (rc == 0) { rc = TPM_Sbuffer_Append32(sbuffer, tpm_key_handle_entry->handle); } /* store key with private data appended in clear text */ if (rc == 0) { rc = TPM_Key_StoreClear(sbuffer, FALSE, /* not EK */ tpm_key_handle_entry->key); } /* store parentPCRStatus */ if (rc == 0) { rc = TPM_Sbuffer_Append(sbuffer, &(tpm_key_handle_entry->parentPCRStatus), sizeof(TPM_BOOL)); } /* store keyControl */ if (rc == 0) { rc = TPM_Sbuffer_Append32(sbuffer, tpm_key_handle_entry->keyControl); } return rc; } /* TPM_KeyHandleEntry_Delete() deletes an entry from the list, deletes the TPM_KEY object, and free's the TPM_KEY. */ void TPM_KeyHandleEntry_Delete(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry) { if (tpm_key_handle_entry != NULL) { if (tpm_key_handle_entry->handle != 0) { printf(" TPM_KeyHandleEntry_Delete: Deleting %08x\n", tpm_key_handle_entry->handle); TPM_Key_Delete(tpm_key_handle_entry->key); free(tpm_key_handle_entry->key); } TPM_KeyHandleEntry_Init(tpm_key_handle_entry); } return; } /* TPM_KeyHandleEntry_FlushSpecific() flushes a key handle according to the rules of TPM_FlushSpecific() */ TPM_RESULT TPM_KeyHandleEntry_FlushSpecific(tpm_state_t *tpm_state, TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry) { TPM_RESULT rc = 0; TPM_AUTHHANDLE authHandle = 0; /* dummy parameter */ TPM_BOOL continueAuthSession; /* dummy parameter */ printf(" TPM_KeyHandleEntry_FlushSpecific:\n"); if (rc == 0) { /* Internal error, should never happen */ if (tpm_key_handle_entry->key == NULL) { printf("TPM_KeyHandleEntry_FlushSpecific: Error (fatal), key is NULL\n"); rc = TPM_FAIL; } } /* terminate OSAP and DSAP sessions associated with the key */ if (rc == 0) { /* The dummy parameters are not used. The session, if any, associated with this function is handled elsewhere. */ TPM_AuthSessions_TerminateEntity(&continueAuthSession, authHandle, tpm_state->tpm_stclear_data.authSessions, TPM_ET_KEYHANDLE, /* TPM_ENTITY_TYPE */ &(tpm_key_handle_entry->key-> tpm_store_asymkey->pubDataDigest)); /* entityDigest */ printf(" TPM_KeyHandleEntry_FlushSpecific: Flushing key handle %08x\n", tpm_key_handle_entry->handle); /* free the TPM_KEY resources, free the key itself, and remove entry from the key handle entries list */ TPM_KeyHandleEntry_Delete(tpm_key_handle_entry); } return rc; } /* Key Handle Entries */ /* TPM_KeyHandleEntries_Init() initializes the fixed TPM_KEY_HANDLE_ENTRY array. All entries are emptied. The keys are not deleted. */ void TPM_KeyHandleEntries_Init(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries) { size_t i; printf(" TPM_KeyHandleEntries_Init:\n"); for (i = 0 ; i < TPM_KEY_HANDLES ; i++) { TPM_KeyHandleEntry_Init(&(tpm_key_handle_entries[i])); } return; } /* TPM_KeyHandleEntries_Delete() deletes and freed all TPM_KEY's stored in entries, and the entry */ void TPM_KeyHandleEntries_Delete(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries) { size_t i; printf(" TPM_KeyHandleEntries_Delete:\n"); for (i = 0 ; i < TPM_KEY_HANDLES ; i++) { TPM_KeyHandleEntry_Delete(&(tpm_key_handle_entries[i])); } return; } /* TPM_KeyHandleEntries_Load() loads the key handle entries from a stream created by TPM_KeyHandleEntries_Store() The two functions must be kept in sync. */ TPM_RESULT TPM_KeyHandleEntries_Load(tpm_state_t *tpm_state, unsigned char **stream, uint32_t *stream_size) { TPM_RESULT rc = 0; uint32_t keyCount = 0; /* keys to be saved */ size_t i; TPM_KEY_HANDLE_ENTRY tpm_key_handle_entry; /* check format tag */ /* In the future, if multiple formats are supported, this check will be replaced by a 'switch' on the tag */ if (rc == 0) { rc = TPM_CheckTag(TPM_TAG_KEY_HANDLE_ENTRIES_V1, stream, stream_size); } /* get the count of keys in the stream */ if (rc == 0) { rc = TPM_Load32(&keyCount, stream, stream_size); printf(" TPM_KeyHandleEntries_Load: %u keys to be loaded\n", keyCount); } /* sanity check that keyCount not greater than key slots */ if (rc == 0) { if (keyCount > TPM_KEY_HANDLES) { printf("TPM_KeyHandleEntries_Load: Error (fatal)" " key handles in stream %u greater than %d\n", keyCount, TPM_KEY_HANDLES); rc = TPM_FAIL; } } /* for each key handle entry */ for (i = 0 ; (rc == 0) && (i < keyCount) ; i++) { /* deserialize the key handle entry and its key member */ if (rc == 0) { TPM_KeyHandleEntry_Init(&tpm_key_handle_entry); /* freed @2 on error */ rc = TPM_KeyHandleEntry_Load(&tpm_key_handle_entry, stream, stream_size); } if (rc == 0) { printf(" TPM_KeyHandleEntries_Load: Loading key handle %08x\n", tpm_key_handle_entry.handle); /* Add the entry to the list. Keep the handle. If the suggested value could not be accepted, this is a "should never happen" fatal error. It means that the save key handle was saved twice. */ rc = TPM_KeyHandleEntries_AddEntry(&(tpm_key_handle_entry.handle), /* suggested */ TRUE, /* keep handle */ tpm_state->tpm_key_handle_entries, &tpm_key_handle_entry); } /* if there was an error copying the entry to the array, the entry must be delete'd to prevent a memory leak, since a key has been loaded to the entry */ if (rc != 0) { TPM_KeyHandleEntry_Delete(&tpm_key_handle_entry); /* @2 on error */ } } return rc; } /* TPM_KeyHandleEntries_Store() stores the key handle entries to a stream that can be restored through TPM_KeyHandleEntries_Load(). The two functions must be kept in sync. */ TPM_RESULT TPM_KeyHandleEntries_Store(TPM_STORE_BUFFER *sbuffer, tpm_state_t *tpm_state) { TPM_RESULT rc = 0; size_t start; /* iterator though key handle entries */ size_t current; /* iterator though key handle entries */ uint32_t keyCount; /* keys to be saved */ TPM_BOOL save; /* should key be saved */ TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry; if (rc == 0) { rc = TPM_Sbuffer_Append16(sbuffer, TPM_TAG_KEY_HANDLE_ENTRIES_V1); } /* first count up the keys */ if (rc == 0) { start = 0; keyCount = 0; printf(" TPM_KeyHandleEntries_Store: Counting keys to be stored\n"); } while ((rc == 0) && /* returns TPM_RETRY when at the end of the table, terminates loop */ (TPM_KeyHandleEntries_GetNextEntry(&tpm_key_handle_entry, &current, tpm_state->tpm_key_handle_entries, start)) == 0) { TPM_SaveState_IsSaveKey(&save, tpm_key_handle_entry); if (save) { keyCount++; } start = current + 1; } /* store the number of entries to save */ if (rc == 0) { printf(" TPM_KeyHandleEntries_Store: %u keys to be stored\n", keyCount); rc = TPM_Sbuffer_Append32(sbuffer, keyCount); } /* for each key handle entry */ if (rc == 0) { printf(" TPM_KeyHandleEntries_Store: Storing keys\n"); start = 0; } while ((rc == 0) && /* returns TPM_RETRY when at the end of the table, terminates loop */ (TPM_KeyHandleEntries_GetNextEntry(&tpm_key_handle_entry, &current, tpm_state->tpm_key_handle_entries, start)) == 0) { TPM_SaveState_IsSaveKey(&save, tpm_key_handle_entry); if (save) { /* store the key handle entry and its associated key */ rc = TPM_KeyHandleEntry_Store(sbuffer, tpm_key_handle_entry); } start = current + 1; } return rc; } /* TPM_KeyHandleEntries_StoreHandles() stores only the two members which are part of the specification. - the number of loaded keys - a list of key handles A TPM_KEY_HANDLE_LIST structure that enumerates all key handles loaded on the TPM. The list only contains the number of handles that an external manager can operate with and does not include the EK or SRK. This is command is available for backwards compatibility. It is the same as TPM_CAP_HANDLE with a resource type of keys. */ TPM_RESULT TPM_KeyHandleEntries_StoreHandles(TPM_STORE_BUFFER *sbuffer, const TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries) { TPM_RESULT rc = 0; uint16_t i, loadedCount; printf(" TPM_KeyHandleEntries_StoreHandles:\n"); if (rc == 0) { loadedCount = 0; /* count the number of loaded handles */ for (i = 0 ; i < TPM_KEY_HANDLES ; i++) { if (tpm_key_handle_entries[i].key != NULL) { loadedCount++; } } /* store 'loaded' handle count */ rc = TPM_Sbuffer_Append16(sbuffer, loadedCount); } for (i = 0 ; (rc == 0) && (i < TPM_KEY_HANDLES) ; i++) { if (tpm_key_handle_entries[i].key != NULL) { /* if the index is loaded */ rc = TPM_Sbuffer_Append32(sbuffer, tpm_key_handle_entries[i].handle); /* store it */ } } return rc; } /* TPM_KeyHandleEntries_DeleteHandle() removes a handle from the list. The TPM_KEY object must be _Delete'd and possibly free'd separately, because it might not be in the table. */ TPM_RESULT TPM_KeyHandleEntries_DeleteHandle(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries, TPM_KEY_HANDLE tpm_key_handle) { TPM_RESULT rc = 0; TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry; printf(" TPM_KeyHandleEntries_DeleteHandle: %08x\n", tpm_key_handle); /* search for the handle */ if (rc == 0) { rc = TPM_KeyHandleEntries_GetEntry(&tpm_key_handle_entry, tpm_key_handle_entries, tpm_key_handle); if (rc != 0) { printf("TPM_KeyHandleEntries_DeleteHandle: Error, key handle %08x not found\n", tpm_key_handle); } } /* delete the entry */ if (rc == 0) { TPM_KeyHandleEntry_Init(tpm_key_handle_entry); } return rc; } /* TPM_KeyHandleEntries_IsSpace() returns 'isSpace' TRUE if an entry is available, FALSE if not. If TRUE, 'index' holds the first free position. */ void TPM_KeyHandleEntries_IsSpace(TPM_BOOL *isSpace, uint32_t *index, const TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries) { printf(" TPM_KeyHandleEntries_IsSpace:\n"); for (*index = 0, *isSpace = FALSE ; *index < TPM_KEY_HANDLES ; (*index)++) { if (tpm_key_handle_entries[*index].key == NULL) { /* if the index is empty */ printf(" TPM_KeyHandleEntries_IsSpace: Found space at %u\n", *index); *isSpace = TRUE; break; } } return; } /* TPM_KeyHandleEntries_GetSpace() returns the number of unused key handle entries. */ void TPM_KeyHandleEntries_GetSpace(uint32_t *space, const TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries) { uint32_t i; printf(" TPM_KeyHandleEntries_GetSpace:\n"); for (*space = 0 , i = 0 ; i < TPM_KEY_HANDLES ; i++) { if (tpm_key_handle_entries[i].key == NULL) { /* if the index is empty */ (*space)++; } } return; } /* TPM_KeyHandleEntries_IsEvictSpace() returns 'isSpace' TRUE if there are at least 'minSpace' entries that do not have the ownerEvict bit set, FALSE if not. */ void TPM_KeyHandleEntries_IsEvictSpace(TPM_BOOL *isSpace, const TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries, uint32_t minSpace) { uint32_t evictSpace; uint32_t i; for (i = 0, evictSpace = 0 ; i < TPM_KEY_HANDLES ; i++) { if (tpm_key_handle_entries[i].key == NULL) { /* if the index is empty */ evictSpace++; } else { /* is index is used */ if (!(tpm_key_handle_entries[i].keyControl & TPM_KEY_CONTROL_OWNER_EVICT)) { evictSpace++; /* space that can be evicted */ } } } printf(" TPM_KeyHandleEntries_IsEvictSpace: evictable space, minimum %u free %u\n", minSpace, evictSpace); if (evictSpace >= minSpace) { *isSpace = TRUE; } else { *isSpace = FALSE; } return; } /* TPM_KeyHandleEntries_AddKeyEntry() adds a TPM_KEY object to the list. If *tpm_key_handle == 0, a value is assigned. If *tpm_key_handle != 0, that value is used if it it not currently in use. The handle is returned in tpm_key_handle. */ TPM_RESULT TPM_KeyHandleEntries_AddKeyEntry(TPM_KEY_HANDLE *tpm_key_handle, /* i/o */ TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries, /* in */ TPM_KEY *tpm_key, TPM_BOOL parentPCRStatus, TPM_KEY_CONTROL keyControl) { TPM_RESULT rc = 0; TPM_KEY_HANDLE_ENTRY tpm_key_handle_entry; printf(" TPM_KeyHandleEntries_AddKeyEntry:\n"); tpm_key_handle_entry.key = tpm_key; tpm_key_handle_entry.parentPCRStatus = parentPCRStatus; tpm_key_handle_entry.keyControl = keyControl; rc = TPM_KeyHandleEntries_AddEntry(tpm_key_handle, FALSE, /* don't have to keep handle */ tpm_key_handle_entries, &tpm_key_handle_entry); return rc; } /* TPM_KeyHandleEntries_AddEntry() adds (copies) the TPM_KEY_HANDLE_ENTRY object to the list. If *tpm_key_handle == 0: a value is assigned. If *tpm_key_handle != 0: If keepHandle is TRUE, the handle must be used. An error is returned if the handle is already in use. If keepHandle is FALSE, if the handle is already in use, a new value is assigned. The handle is returned in tpm_key_handle. */ TPM_RESULT TPM_KeyHandleEntries_AddEntry(TPM_KEY_HANDLE *tpm_key_handle, /* i/o */ TPM_BOOL keepHandle, /* input */ TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries, /* input */ TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry) /* input */ { TPM_RESULT rc = 0; uint32_t index; TPM_BOOL isSpace; printf(" TPM_KeyHandleEntries_AddEntry: handle %08x, keepHandle %u\n", *tpm_key_handle, keepHandle); /* check for valid TPM_KEY */ if (rc == 0) { if (tpm_key_handle_entry->key == NULL) { /* should never occur */ printf("TPM_KeyHandleEntries_AddEntry: Error (fatal), NULL TPM_KEY\n"); rc = TPM_FAIL; } } /* is there an empty entry, get the location index */ if (rc == 0) { TPM_KeyHandleEntries_IsSpace(&isSpace, &index, tpm_key_handle_entries); if (!isSpace) { printf("TPM_KeyHandleEntries_AddEntry: Error, key handle entries full\n"); rc = TPM_NOSPACE; } } if (rc == 0) { rc = TPM_Handle_GenerateHandle(tpm_key_handle, /* I/O */ tpm_key_handle_entries, /* handle array */ keepHandle, TRUE, /* isKeyHandle */ (TPM_GETENTRY_FUNCTION_T)TPM_KeyHandleEntries_GetEntry); } if (rc == 0) { tpm_key_handle_entries[index].handle = *tpm_key_handle; tpm_key_handle_entries[index].key = tpm_key_handle_entry->key; tpm_key_handle_entries[index].keyControl = tpm_key_handle_entry->keyControl; tpm_key_handle_entries[index].parentPCRStatus = tpm_key_handle_entry->parentPCRStatus; printf(" TPM_KeyHandleEntries_AddEntry: Index %u key handle %08x key pointer %p\n", index, tpm_key_handle_entries[index].handle, tpm_key_handle_entries[index].key); } return rc; } /* TPM_KeyHandleEntries_GetEntry() searches all entries for the entry matching the handle, and returns that entry */ TPM_RESULT TPM_KeyHandleEntries_GetEntry(TPM_KEY_HANDLE_ENTRY **tpm_key_handle_entry, TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries, TPM_KEY_HANDLE tpm_key_handle) { TPM_RESULT rc = 0; size_t i; TPM_BOOL found; printf(" TPM_KeyHandleEntries_GetEntry: Get entry for handle %08x\n", tpm_key_handle); for (i = 0, found = FALSE ; (i < TPM_KEY_HANDLES) && !found ; i++) { /* first test for matching handle. Then check for non-NULL to insure that entry is valid */ if ((tpm_key_handle_entries[i].handle == tpm_key_handle) && tpm_key_handle_entries[i].key != NULL) { /* found */ found = TRUE; *tpm_key_handle_entry = &(tpm_key_handle_entries[i]); } } if (!found) { printf(" TPM_KeyHandleEntries_GetEntry: key handle %08x not found\n", tpm_key_handle); rc = TPM_INVALID_KEYHANDLE; } else { printf(" TPM_KeyHandleEntries_GetEntry: key handle %08x found\n", tpm_key_handle); } return rc; } /* TPM_KeyHandleEntries_GetNextEntry() gets the next valid TPM_KEY_HANDLE_ENTRY at or after the 'start' index. The current position is returned in 'current'. For iteration, the next 'start' should be 'current' + 1. Returns 0 on success. Returns TPM_RETRY when no more valid entries are found. */ TPM_RESULT TPM_KeyHandleEntries_GetNextEntry(TPM_KEY_HANDLE_ENTRY **tpm_key_handle_entry, size_t *current, TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries, size_t start) { TPM_RESULT rc = TPM_RETRY; printf(" TPM_KeyHandleEntries_GetNextEntry: Start %lu\n", (unsigned long)start); for (*current = start ; *current < TPM_KEY_HANDLES ; (*current)++) { if (tpm_key_handle_entries[*current].key != NULL) { *tpm_key_handle_entry = &(tpm_key_handle_entries[*current]); rc = 0; /* found an entry */ break; } } return rc; } /* TPM_KeyHandleEntries_GetKey() gets the TPM_KEY associated with the handle. If the key has PCR usage (size is non-zero and one or more mask bits are set), PCR's have been specified. It computes a PCR digest based on the TPM PCR's and verifies it against the key digestAtRelease. Exceptions: readOnly is TRUE when the caller is indicating that only the public key is being read (e.g. TPM_GetPubKey). In this case, if keyFlags TPM_PCRIGNOREDONREAD is also TRUE, the PCR digest and locality must not be checked. If ignorePCRs is TRUE, the PCR digest is also ignored. A typical case is during OSAP and DSAP session setup. */ TPM_RESULT TPM_KeyHandleEntries_GetKey(TPM_KEY **tpm_key, TPM_BOOL *parentPCRStatus, tpm_state_t *tpm_state, TPM_KEY_HANDLE tpm_key_handle, TPM_BOOL readOnly, TPM_BOOL ignorePCRs, TPM_BOOL allowEK) { TPM_RESULT rc = 0; TPM_BOOL found = FALSE; /* found a special handle key */ TPM_BOOL validatePcrs = TRUE; TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry; printf(" TPM_KeyHandleEntries_GetKey: For handle %08x\n", tpm_key_handle); /* If it's one of the special handles, return the TPM_KEY */ if (rc == 0) { switch (tpm_key_handle) { case TPM_KH_SRK: /* The handle points to the SRK */ if (tpm_state->tpm_permanent_data.ownerInstalled) { *tpm_key = &(tpm_state->tpm_permanent_data.srk); *parentPCRStatus = FALSE; /* storage root key (SRK) has no parent */ found = TRUE; } else { printf(" TPM_KeyHandleEntries_GetKey: Error, SRK handle with no owner\n"); rc = TPM_KEYNOTFOUND; } break; case TPM_KH_EK: /* The handle points to the PUBEK, only usable with TPM_OwnerReadInternalPub */ if (rc == 0) { if (!allowEK) { printf(" TPM_KeyHandleEntries_GetKey: Error, EK handle not allowed\n"); rc = TPM_KEYNOTFOUND; } } if (rc == 0) { if (tpm_state->tpm_permanent_data.endorsementKey.keyUsage == TPM_KEY_UNINITIALIZED) { printf(" TPM_KeyHandleEntries_GetKey: Error, EK handle but no EK\n"); rc = TPM_KEYNOTFOUND; } } if (rc == 0) { *tpm_key = &(tpm_state->tpm_permanent_data.endorsementKey); *parentPCRStatus = FALSE; /* endorsement key (EK) has no parent */ found = TRUE; } break; case TPM_KH_OWNER: /* handle points to the TPM Owner */ case TPM_KH_REVOKE: /* handle points to the RevokeTrust value */ case TPM_KH_TRANSPORT: /* handle points to the EstablishTransport static authorization */ case TPM_KH_OPERATOR: /* handle points to the Operator auth */ case TPM_KH_ADMIN: /* handle points to the delegation administration auth */ printf("TPM_KeyHandleEntries_GetKey: Error, Unsupported key handle %08x\n", tpm_key_handle); rc = TPM_INVALID_RESOURCE; break; default: /* continue searching */ break; } } /* If not one of the special key handles, search for the handle in the list */ if ((rc == 0) && !found) { rc = TPM_KeyHandleEntries_GetEntry(&tpm_key_handle_entry, tpm_state->tpm_key_handle_entries, tpm_key_handle); if (rc != 0) { printf("TPM_KeyHandleEntries_GetKey: Error, key handle %08x not found\n", tpm_key_handle); } } /* Part 1 25.1 Validate Key for use 2. Set LK to the loaded key that is being used */ /* NOTE: For special handle keys, this was already done. Just do here for keys in table */ if ((rc == 0) && !found) { *tpm_key = tpm_key_handle_entry->key; *parentPCRStatus = tpm_key_handle_entry->parentPCRStatus; } /* 3. If LK -> pcrInfoSize is not 0 - if the key specifies PCR's */ /* NOTE Done by TPM_Key_CheckPCRDigest() */ /* a. If LK -> pcrInfo -> releasePCRSelection identifies the use of one or more PCR */ if (rc == 0) { #ifdef TPM_V12 validatePcrs = !ignorePCRs && !(readOnly && ((*tpm_key)->keyFlags & TPM_PCRIGNOREDONREAD)); #else validatePcrs = !ignorePCRs && !readOnly; #endif } if ((rc == 0) && validatePcrs) { if (rc == 0) { rc = TPM_Key_CheckPCRDigest(*tpm_key, tpm_state); } } return rc; } /* TPM_KeyHandleEntries_SetParentPCRStatus() updates the parentPCRStatus member of the TPM_KEY_HANDLE_ENTRY */ TPM_RESULT TPM_KeyHandleEntries_SetParentPCRStatus(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries, TPM_KEY_HANDLE tpm_key_handle, TPM_BOOL parentPCRStatus) { TPM_RESULT rc = 0; TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry; printf(" TPM_KeyHandleEntries_SetParentPCRStatus: Handle %08x\n", tpm_key_handle); /* get the entry for the handle from the table */ if (rc == 0) { rc = TPM_KeyHandleEntries_GetEntry(&tpm_key_handle_entry, tpm_key_handle_entries, tpm_key_handle); if (rc != 0) { printf("TPM_KeyHandleEntries_SetParentPCRStatus: Error, key handle %08x not found\n", tpm_key_handle); } } if (rc == 0) { tpm_key_handle_entry->parentPCRStatus = parentPCRStatus; } return rc; } /* TPM_KeyHandleEntries_OwnerEvictLoad() loads all owner evict keys from the stream into the key handle entries table. */ TPM_RESULT TPM_KeyHandleEntries_OwnerEvictLoad(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries, unsigned char **stream, uint32_t *stream_size) { TPM_RESULT rc = 0; uint16_t keyCount; uint16_t i; /* the uint16_t corresponds to the standard getcap */ TPM_KEY_HANDLE_ENTRY tpm_key_handle_entry; /* each entry as read from the stream */ TPM_TAG ownerEvictVersion; printf(" TPM_KeyHandleEntries_OwnerEvictLoad:\n"); /* get the owner evict version number */ if (rc == 0) { rc = TPM_Load16(&ownerEvictVersion, stream, stream_size); } if (rc == 0) { if (ownerEvictVersion != TPM_TAG_NVSTATE_OE_V1) { printf("TPM_KeyHandleEntries_OwnerEvictLoad: " "Error (fatal) unsupported version tag %04x\n", ownerEvictVersion); rc = TPM_FAIL; } } /* get the count of owner evict keys in the stream */ if (rc == 0) { rc = TPM_Load16(&keyCount, stream, stream_size); } /* sanity check that keyCount not greater than key slots */ if (rc == 0) { if (keyCount > TPM_OWNER_EVICT_KEY_HANDLES) { printf("TPM_KeyHandleEntries_OwnerEvictLoad: Error (fatal)" " key handles in stream %u greater than %d\n", keyCount, TPM_OWNER_EVICT_KEY_HANDLES); rc = TPM_FAIL; } } if (rc == 0) { printf(" TPM_KeyHandleEntries_OwnerEvictLoad: Count %hu\n", keyCount); } for (i = 0 ; (rc == 0) && (i < keyCount) ; i++) { /* Must init each time through. This just resets the structure members. It does not free the key that is in the structure after the first time through. That key has been added (copied) to the key handle entries array. */ printf(" TPM_KeyHandleEntries_OwnerEvictLoad: Loading key %hu\n", i); TPM_KeyHandleEntry_Init(&tpm_key_handle_entry); /* freed @2 on error */ if (rc == 0) { rc = TPM_KeyHandleEntry_Load(&tpm_key_handle_entry, stream, stream_size); } /* add the entry to the list */ if (rc == 0) { rc = TPM_KeyHandleEntries_AddEntry(&(tpm_key_handle_entry.handle), /* suggested */ TRUE, /* keep handle */ tpm_key_handle_entries, &tpm_key_handle_entry); } /* if there was an error copying the entry to the array, the entry must be delete'd to prevent a memory leak, since a key has been loaded to the entry */ if (rc != 0) { TPM_KeyHandleEntry_Delete(&tpm_key_handle_entry); /* @2 on error */ } } return rc; } /* TPM_KeyHandleEntries_OwnerEvictStore() stores all owner evict keys from the key handle entries table to the stream. It is used to serialize to NVRAM. */ TPM_RESULT TPM_KeyHandleEntries_OwnerEvictStore(TPM_STORE_BUFFER *sbuffer, const TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries) { TPM_RESULT rc = 0; uint16_t count; uint16_t i; /* the uint16_t corresponds to the standard getcap */ printf(" TPM_KeyHandleEntries_OwnerEvictStore:\n"); /* append the owner evict version number to the stream */ if (rc == 0) { rc = TPM_Sbuffer_Append16(sbuffer, TPM_TAG_NVSTATE_OE_V1); } /* count the number of owner evict keys */ if (rc == 0) { rc = TPM_KeyHandleEntries_OwnerEvictGetCount(&count, tpm_key_handle_entries); } /* append the count to the stream */ if (rc == 0) { rc = TPM_Sbuffer_Append16(sbuffer, count); } for (i = 0 ; (rc == 0) && (i < TPM_KEY_HANDLES) ; i++) { /* if the slot is occupied */ if (tpm_key_handle_entries[i].key != NULL) { /* if the key is owner evict */ if ((tpm_key_handle_entries[i].keyControl & TPM_KEY_CONTROL_OWNER_EVICT)) { /* store it */ rc = TPM_KeyHandleEntry_Store(sbuffer, &(tpm_key_handle_entries[i])); } } } return rc; } /* TPM_KeyHandleEntries_OwnerEvictGetCount returns the number of owner evict key entries */ TPM_RESULT TPM_KeyHandleEntries_OwnerEvictGetCount(uint16_t *count, const TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries) { TPM_RESULT rc = 0; uint16_t i; /* the uint16_t corresponds to the standard getcap */ printf(" TPM_KeyHandleEntries_OwnerEvictGetCount:\n"); /* count the number of loaded owner evict handles */ if (rc == 0) { for (i = 0 , *count = 0 ; i < TPM_KEY_HANDLES ; i++) { /* if the slot is occupied */ if (tpm_key_handle_entries[i].key != NULL) { /* if the key is owner evict */ if ((tpm_key_handle_entries[i].keyControl & TPM_KEY_CONTROL_OWNER_EVICT)) { (*count)++; /* count it */ } } } printf(" TPM_KeyHandleEntries_OwnerEvictGetCount: Count %hu\n", *count); } /* sanity check */ if (rc == 0) { if (*count > TPM_OWNER_EVICT_KEY_HANDLES) { printf("TPM_KeyHandleEntries_OwnerEvictGetCount: Error (fatal), " "count greater that max %u\n", TPM_OWNER_EVICT_KEY_HANDLES); rc = TPM_FAIL; /* should never occur */ } } return rc; } /* TPM_KeyHandleEntries_OwnerEvictDelete() flushes owner evict keys. It does NOT write to NV. */ void TPM_KeyHandleEntries_OwnerEvictDelete(TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entries) { uint16_t i; /* the uint16_t corresponds to the standard getcap */ for (i = 0 ; i < TPM_KEY_HANDLES ; i++) { /* if the slot is occupied */ if (tpm_key_handle_entries[i].key != NULL) { /* if the key is owner evict */ if ((tpm_key_handle_entries[i].keyControl & TPM_KEY_CONTROL_OWNER_EVICT)) { TPM_KeyHandleEntry_Delete(&(tpm_key_handle_entries[i])); } } } return; } /* Processing Functions */ /* 14.4 TPM_ReadPubek rev 99 Return the endorsement key public portion. This value should have controls placed upon access as it is a privacy sensitive value The readPubek flag is set to FALSE by TPM_TakeOwnership and set to TRUE by TPM_OwnerClear, thus mirroring if a TPM Owner is present. */ TPM_RESULT TPM_Process_ReadPubek(tpm_state_t *tpm_state, TPM_STORE_BUFFER *response, TPM_TAG tag, uint32_t paramSize, /* of remaining parameters*/ TPM_COMMAND_CODE ordinal, unsigned char *command, TPM_TRANSPORT_INTERNAL *transportInternal) { TPM_RESULT rcf = 0; /* fatal error precluding response */ TPM_RESULT returnCode = TPM_SUCCESS; /* command return code */ /* input parameters */ TPM_NONCE antiReplay; /* processing */ const unsigned char *pubEndorsementKeyStreamBuffer; uint32_t pubEndorsementKeyStreamLength; /* processing parameters */ unsigned char * inParamStart; /* starting point of inParam's */ unsigned char * inParamEnd; /* ending point of inParam's */ TPM_DIGEST inParamDigest; TPM_BOOL auditStatus; /* audit the ordinal */ TPM_BOOL transportEncrypt; /* wrapped in encrypted transport session */ /* output parameters */ uint32_t outParamStart; /* starting point of outParam's */ uint32_t outParamEnd; /* ending point of outParam's */ TPM_DIGEST outParamDigest; TPM_STORE_BUFFER pubEndorsementKeyStream; TPM_DIGEST checksum; printf("TPM_Process_ReadPubek: Ordinal Entry\n"); TPM_Sbuffer_Init(&pubEndorsementKeyStream); /* freed @1 */ /* get inputs */ /* save the starting point of inParam's for authorization and auditing */ inParamStart = command; /* get antiReplay parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Nonce_Load(antiReplay, &command, &paramSize); } if (returnCode == TPM_SUCCESS) { TPM_PrintFour(" TPM_Process_ReadPubek: antiReplay", antiReplay); } /* save the ending point of inParam's for authorization and auditing */ inParamEnd = command; /* digest the input parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetInParamDigest(inParamDigest, /* output */ &auditStatus, /* output */ &transportEncrypt, /* output */ tpm_state, tag, ordinal, inParamStart, inParamEnd, transportInternal); } /* check state */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckState(tpm_state, tag, TPM_CHECK_ALLOW_NO_OWNER); } /* check tag */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckRequestTag0(tag); } if (returnCode == TPM_SUCCESS) { if (paramSize != 0) { printf("TPM_Process_ReadPubek: Error, command has %u extra bytes\n", paramSize); returnCode = TPM_BAD_PARAM_SIZE; } } /* Processing */ /* 1. If TPM_PERMANENT_FLAGS -> readPubek is FALSE return TPM_DISABLED_CMD. */ if (returnCode == TPM_SUCCESS) { printf(" TPM_Process_ReadPubek: readPubek %02x\n", tpm_state->tpm_permanent_flags.readPubek); if (!tpm_state->tpm_permanent_flags.readPubek) { printf("TPM_Process_ReadPubek: Error, readPubek is FALSE\n"); returnCode = TPM_DISABLED_CMD; } } /* 2. If no EK is present the TPM MUST return TPM_NO_ENDORSEMENT */ if (returnCode == TPM_SUCCESS) { if (tpm_state->tpm_permanent_data.endorsementKey.keyUsage == TPM_KEY_UNINITIALIZED) { printf("TPM_Process_ReadPubek: Error, no EK is present\n"); returnCode = TPM_NO_ENDORSEMENT; } } /* 3. Create checksum by performing SHA-1 on the concatenation of (pubEndorsementKey || antiReplay). */ if (returnCode == TPM_SUCCESS) { /* serialize the TPM_PUBKEY components of the EK */ returnCode = TPM_Key_StorePubkey(&pubEndorsementKeyStream, /* output */ &pubEndorsementKeyStreamBuffer, /* output */ &pubEndorsementKeyStreamLength, /* output */ &(tpm_state->tpm_permanent_data.endorsementKey)); /* input */ } if (returnCode == TPM_SUCCESS) { printf(" TPM_Process_ReadPubek: pubEndorsementKey length %u\n", pubEndorsementKeyStreamLength); /* create the checksum */ returnCode = TPM_SHA1(checksum, #if 0 /* The old Atmel chip and the LTC test code assume this, but it is incorrect */ tpm_state->tpm_permanent_data.endorsementKey.pubKey.keyLength, tpm_state->tpm_permanent_data.endorsementKey.pubKey.key, #else /* this meets the TPM 1.2 standard */ pubEndorsementKeyStreamLength, pubEndorsementKeyStreamBuffer, #endif sizeof(TPM_NONCE), antiReplay, 0, NULL); } /* response */ /* standard response: tag, (dummy) paramSize, returnCode. Failure is fatal. */ if (rcf == 0) { printf("TPM_Process_ReadPubek: Ordinal returnCode %08x %u\n", returnCode, returnCode); rcf = TPM_Sbuffer_StoreInitialResponse(response, tag, returnCode); } /* success response, append the rest of the parameters. */ if (rcf == 0) { /* 4. Export the PUBEK and checksum. */ if (returnCode == TPM_SUCCESS) { /* checkpoint the beginning of the outParam's */ outParamStart = response->buffer_current - response->buffer; /* append pubEndorsementKey */ returnCode = TPM_Sbuffer_Append(response, pubEndorsementKeyStreamBuffer, pubEndorsementKeyStreamLength); } /* append checksum */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Digest_Store(response, checksum); /* checkpoint the end of the outParam's */ outParamEnd = response->buffer_current - response->buffer; } /* digest the above the line output parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetOutParamDigest(outParamDigest, /* output */ auditStatus, /* input audit status */ transportEncrypt, tag, returnCode, ordinal, /* command ordinal */ response->buffer + outParamStart, /* start */ outParamEnd - outParamStart); /* length */ } /* audit if required */ if ((returnCode == TPM_SUCCESS) && auditStatus) { returnCode = TPM_ProcessAudit(tpm_state, transportEncrypt, inParamDigest, outParamDigest, ordinal); } /* adjust the initial response */ rcf = TPM_Sbuffer_StoreFinalResponse(response, returnCode, tpm_state); } /* cleanup */ TPM_Sbuffer_Delete(&pubEndorsementKeyStream); /* @1 */ return rcf; } /* 14.2 TPM_CreateRevocableEK rev 98 This command creates the TPM endorsement key. It returns a failure code if an endorsement key already exists. The TPM vendor may have a separate mechanism to create the EK and "squirt" the value into the TPM. */ TPM_RESULT TPM_Process_CreateRevocableEK(tpm_state_t *tpm_state, TPM_STORE_BUFFER *response, TPM_TAG tag, uint32_t paramSize, TPM_COMMAND_CODE ordinal, unsigned char *command, TPM_TRANSPORT_INTERNAL *transportInternal) { TPM_RESULT rcf = 0; /* fatal error precluding response */ TPM_RESULT returnCode = TPM_SUCCESS; /* command return code */ /* input parameters */ TPM_NONCE antiReplay; /* Arbitrary data */ TPM_KEY_PARMS keyInfo; /* Information about key to be created, this includes all algorithm parameters */ TPM_BOOL generateReset = FALSE; /* If TRUE use TPM RNG to generate EKreset. If FALSE use the passed value inputEKreset */ TPM_NONCE inputEKreset; /* The authorization value to be used with TPM_RevokeTrust if generateReset==FALSE, else the parameter is present but unused */ /* processing parameters */ unsigned char * inParamStart; /* starting point of inParam's */ unsigned char * inParamEnd; /* ending point of inParam's */ TPM_DIGEST inParamDigest; TPM_BOOL auditStatus = FALSE; /* audit the ordinal */ TPM_BOOL transportEncrypt = FALSE; /* wrapped in encrypted transport session */ TPM_KEY *endorsementKey; /* EK object from permanent store */ TPM_BOOL writeAllNV1 = FALSE; /* flags to write back NV */ TPM_BOOL writeAllNV2 = FALSE; /* flags to write back NV */ /* output parameters */ uint32_t outParamStart; /* starting point of outParam's */ uint32_t outParamEnd; /* ending point of outParam's */ TPM_DIGEST outParamDigest; TPM_PUBKEY pubEndorsementKey; /* The public endorsement key */ TPM_DIGEST checksum; /* Hash of pubEndorsementKey and antiReplay */ printf("TPM_Process_CreateRevocableEK: Ordinal Entry\n"); /* get pointers */ endorsementKey = &(tpm_state->tpm_permanent_data.endorsementKey); /* so that Delete's are safe */ TPM_KeyParms_Init(&keyInfo); /* freed @1 */ TPM_Pubkey_Init(&pubEndorsementKey); /* freed @2 */ /* get inputs */ /* save the starting point of inParam's for authorization and auditing */ inParamStart = command; /* get antiReplay parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Nonce_Load(antiReplay, &command, &paramSize); } /* get keyInfo parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_KeyParms_Load(&keyInfo, &command, &paramSize); /* freed @1 */ } /* get generateReset parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_LoadBool(&generateReset, &command, &paramSize); } /* get inputEKreset parameter */ if (returnCode == TPM_SUCCESS) { printf("TPM_Process_CreateRevocableEK: generateReset %02x\n", generateReset); /* an email clarification says that this parameter is still present (but ignored) if generateReset is TRUE */ returnCode = TPM_Nonce_Load(inputEKreset, &command, &paramSize); } if (returnCode == TPM_SUCCESS) { TPM_PrintFour("TPM_Process_CreateRevocableEK: inputEKreset", inputEKreset); } /* save the ending point of inParam's for authorization and auditing */ inParamEnd = command; /* digest the input parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetInParamDigest(inParamDigest, /* output */ &auditStatus, /* output */ &transportEncrypt, /* output */ tpm_state, tag, ordinal, inParamStart, inParamEnd, transportInternal); } /* check state */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckState(tpm_state, tag, TPM_CHECK_ALLOW_NO_OWNER); } /* check tag */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckRequestTag0(tag); } if (returnCode == TPM_SUCCESS) { if (paramSize != 0) { printf("TPM_Process_CreateRevocableEK: Error, command has %u extra bytes\n", paramSize); returnCode = TPM_BAD_PARAM_SIZE; } } /* Processing */ /* 1. If an EK already exists, return TPM_DISABLED_CMD */ /* 2. Perform the actions of TPM_CreateEndorsementKeyPair, if any errors return with error */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CreateEndorsementKeyPair_Common(endorsementKey, &pubEndorsementKey, checksum, &writeAllNV1, tpm_state, &keyInfo, antiReplay); } if (returnCode == TPM_SUCCESS) { /* 3. Set TPM_PERMANENT_FLAGS -> enableRevokeEK to TRUE */ TPM_SetCapability_Flag(&writeAllNV1, /* altered */ &(tpm_state->tpm_permanent_flags.enableRevokeEK), /* flag */ TRUE); /* value */ /* a. If generateReset is TRUE then */ if (generateReset) { /* i. Set TPM_PERMANENT_DATA -> EKreset to the next value from the TPM RNG */ returnCode = TPM_Nonce_Generate(tpm_state->tpm_permanent_data.EKReset); } /* b. Else */ else { /* i. Set TPM_PERMANENT_DATA -> EKreset to inputEkreset */ TPM_Nonce_Copy(tpm_state->tpm_permanent_data.EKReset, inputEKreset); } } /* save the permanent data and flags structure sto NVRAM */ returnCode = TPM_PermanentAll_NVStore(tpm_state, (TPM_BOOL)(writeAllNV1 || writeAllNV2), returnCode); /* response */ /* standard response: tag, (dummy) paramSize, returnCode. Failure is fatal. */ if (rcf == 0) { printf("TPM_Process_CreateRevocableEK: Ordinal returnCode %08x %u\n", returnCode, returnCode); rcf = TPM_Sbuffer_StoreInitialResponse(response, tag, returnCode); } /* success response, append the rest of the parameters. */ if (rcf == 0) { if (returnCode == TPM_SUCCESS) { /* checkpoint the beginning of the outParam's */ outParamStart = response->buffer_current - response->buffer; /* 4. Return PUBEK, checksum and Ekreset */ /* append pubEndorsementKey. */ returnCode = TPM_Pubkey_Store(response, &pubEndorsementKey); } /* append checksum */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Digest_Store(response, checksum); } /* append outputEKreset */ /* 5. The outputEKreset authorization is sent in the clear. There is no uniqueness on the TPM available to actually perform encryption or use an encrypted channel. The assumption is that this operation is occurring in a controlled environment and sending the value in the clear is acceptable. */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Nonce_Store(response, tpm_state->tpm_permanent_data.EKReset); /* checkpoint the end of the outParam's */ outParamEnd = response->buffer_current - response->buffer; } /* digest the above the line output parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetOutParamDigest(outParamDigest, /* output */ auditStatus, /* input audit status */ transportEncrypt, tag, returnCode, ordinal, /* command ordinal */ response->buffer + outParamStart, /* start */ outParamEnd - outParamStart); /* length */ } /* audit if required */ if ((returnCode == TPM_SUCCESS) && auditStatus) { returnCode = TPM_ProcessAudit(tpm_state, transportEncrypt, inParamDigest, outParamDigest, ordinal); } /* adjust the initial response */ rcf = TPM_Sbuffer_StoreFinalResponse(response, returnCode, tpm_state); } /* cleanup */ TPM_KeyParms_Delete(&keyInfo); /* @1 */ TPM_Pubkey_Delete(&pubEndorsementKey); /* @2 */ return rcf; } /* 14.1 TPM_CreateEndorsementKeyPair rev 104 This command creates the TPM endorsement key. It returns a failure code if an endorsement key already exists. */ TPM_RESULT TPM_Process_CreateEndorsementKeyPair(tpm_state_t *tpm_state, TPM_STORE_BUFFER *response, TPM_TAG tag, uint32_t paramSize, /* of remaining parameters*/ TPM_COMMAND_CODE ordinal, unsigned char *command, TPM_TRANSPORT_INTERNAL *transportInternal) { TPM_RESULT rcf = 0; /* fatal error precluding response */ TPM_RESULT returnCode = TPM_SUCCESS; /* command return code */ /* input parameters */ TPM_NONCE antiReplay; /* Arbitrary data */ TPM_KEY_PARMS keyInfo; /* Information about key to be created, this includes all algorithm parameters */ /* processing parameters */ unsigned char * inParamStart; /* starting point of inParam's */ unsigned char * inParamEnd; /* ending point of inParam's */ TPM_DIGEST inParamDigest; TPM_BOOL auditStatus = FALSE; /* audit the ordinal */ TPM_BOOL transportEncrypt = FALSE; /* wrapped in encrypted transport session */ TPM_KEY *endorsementKey = FALSE; /* EK object from permanent store */ TPM_BOOL writeAllNV1 = FALSE; /* flags to write back data */ TPM_BOOL writeAllNV2 = FALSE; /* flags to write back flags */ /* output parameters */ uint32_t outParamStart; /* starting point of outParam's */ uint32_t outParamEnd; /* ending point of outParam's */ TPM_DIGEST outParamDigest; TPM_PUBKEY pubEndorsementKey; /* The public endorsement key */ TPM_DIGEST checksum; /* Hash of pubEndorsementKey and antiReplay */ printf("TPM_Process_CreateEndorsementKeyPair: Ordinal Entry\n"); /* get pointers */ endorsementKey = &(tpm_state->tpm_permanent_data.endorsementKey); /* so that Delete's are safe */ TPM_KeyParms_Init(&keyInfo); /* freed @1 */ TPM_Pubkey_Init(&pubEndorsementKey); /* freed @2 */ /* get inputs */ /* save the starting point of inParam's for authorization and auditing */ inParamStart = command; /* get antiReplay parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Nonce_Load(antiReplay, &command, &paramSize); } /* get keyInfo parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_KeyParms_Load(&keyInfo, &command, &paramSize); /* freed @1 */ } /* save the ending point of inParam's for authorization and auditing */ inParamEnd = command; /* digest the input parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetInParamDigest(inParamDigest, /* output */ &auditStatus, /* output */ &transportEncrypt, /* output */ tpm_state, tag, ordinal, inParamStart, inParamEnd, transportInternal); } /* check state */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckState(tpm_state, tag, TPM_CHECK_ALLOW_NO_OWNER); } /* check tag */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckRequestTag0(tag); } if (returnCode == TPM_SUCCESS) { if (paramSize != 0) { printf("TPM_Process_CreateEndorsementKeyPair: Error, command has %u extra bytes\n", paramSize); returnCode = TPM_BAD_PARAM_SIZE; } } /* Processing */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CreateEndorsementKeyPair_Common(endorsementKey, &pubEndorsementKey, checksum, &writeAllNV1, tpm_state, &keyInfo, antiReplay); } /* 10. Set TPM_PERMANENT_FLAGS -> enableRevokeEK to FALSE */ if (returnCode == TPM_SUCCESS) { TPM_SetCapability_Flag(&writeAllNV2, /* altered */ &(tpm_state->tpm_permanent_flags.enableRevokeEK), /* flag */ FALSE); /* value */ } /* save the permanent data and flags structures to NVRAM */ returnCode = TPM_PermanentAll_NVStore(tpm_state, (TPM_BOOL)(writeAllNV1 || writeAllNV2), returnCode); /* response */ /* standard response: tag, (dummy) paramSize, returnCode. Failure is fatal. */ if (rcf == 0) { printf("TPM_Process_CreateEndorsementKeyPair: Ordinal returnCode %08x %u\n", returnCode, returnCode); rcf = TPM_Sbuffer_StoreInitialResponse(response, tag, returnCode); } /* success response, append the rest of the parameters. */ if (rcf == 0) { /* append pubEndorsementKey. */ if (returnCode == TPM_SUCCESS) { /* checkpoint the beginning of the outParam's */ outParamStart = response->buffer_current - response->buffer; returnCode = TPM_Pubkey_Store(response, &pubEndorsementKey); } /* append checksum */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Digest_Store(response, checksum); /* checkpoint the end of the outParam's */ outParamEnd = response->buffer_current - response->buffer; } /* digest the above the line output parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetOutParamDigest(outParamDigest, /* output */ auditStatus, /* input audit status */ transportEncrypt, tag, returnCode, ordinal, /* command ordinal */ response->buffer + outParamStart, /* start */ outParamEnd - outParamStart); /* length */ } /* audit if required */ if ((returnCode == TPM_SUCCESS) && auditStatus) { returnCode = TPM_ProcessAudit(tpm_state, transportEncrypt, inParamDigest, outParamDigest, ordinal); } /* adjust the initial response */ rcf = TPM_Sbuffer_StoreFinalResponse(response, returnCode, tpm_state); } /* cleanup */ TPM_KeyParms_Delete(&keyInfo); /* @1 */ TPM_Pubkey_Delete(&pubEndorsementKey); /* @2 */ return rcf; } /* TPM_CreateEndorsementKeyPair_Common rev 104 Actions common to TPM_CreateEndorsementKeyPair and TPM_CreateRevocableEK 'endorsementKey' points to TPM_PERMANENT_DATA -> endorsementKey */ TPM_RESULT TPM_CreateEndorsementKeyPair_Common(TPM_KEY *endorsementKey, /* output */ TPM_PUBKEY *pubEndorsementKey, /* output */ TPM_DIGEST checksum, /* output */ TPM_BOOL *writePermanentData, /* output */ tpm_state_t *tpm_state, /* input */ TPM_KEY_PARMS *keyInfo, /* input */ TPM_NONCE antiReplay) /* input */ { TPM_RESULT returnCode = TPM_SUCCESS; TPM_RSA_KEY_PARMS *tpm_rsa_key_parms; /* from keyInfo */ TPM_STORE_BUFFER pubEndorsementKeySerial; /* serialization for checksum calculation */ const unsigned char *pubEndorsementKeyBuffer; uint32_t pubEndorsementKeyLength; printf("TPM_CreateEndorsementKeyPair_Common:\n"); TPM_Sbuffer_Init(&pubEndorsementKeySerial); /* freed @1 */ /* 1. If an EK already exists, return TPM_DISABLED_CMD */ if (returnCode == TPM_SUCCESS) { if (endorsementKey->keyUsage != TPM_KEY_UNINITIALIZED) { printf("TPM_CreateEndorsementKeyPair_Common: Error, key already initialized\n"); returnCode = TPM_DISABLED_CMD; } } /* 2. Validate the keyInfo parameters for the key description */ if (returnCode == TPM_SUCCESS) { /* RSA */ /* a. If the algorithm type is RSA the key length MUST be a minimum of 2048. For interoperability the key length SHOULD be 2048 */ if (keyInfo->algorithmID == TPM_ALG_RSA) { if (returnCode == TPM_SUCCESS) { /* get the keyInfo TPM_RSA_KEY_PARMS structure */ returnCode = TPM_KeyParms_GetRSAKeyParms(&tpm_rsa_key_parms, keyInfo); } if (returnCode == TPM_SUCCESS) { if (tpm_rsa_key_parms->keyLength != TPM_KEY_RSA_NUMBITS) { /* in bits */ printf("TPM_CreateEndorsementKeyPair_Common: Error, " "Bad keyLength should be %u, was %u\n", TPM_KEY_RSA_NUMBITS, tpm_rsa_key_parms->keyLength); returnCode = TPM_BAD_KEY_PROPERTY; } } /* kgold - Support only 2 primes */ if (returnCode == TPM_SUCCESS) { if (tpm_rsa_key_parms->numPrimes != 2) { printf("TPM_CreateEndorsementKeyPair_Common: Error, " "Bad numPrimes should be 2, was %u\n", tpm_rsa_key_parms->numPrimes); returnCode = TPM_BAD_KEY_PROPERTY; } } } /* not RSA */ /* b. If the algorithm type is other than RSA the strength provided by the key MUST be comparable to RSA 2048 */ else { if (returnCode == TPM_SUCCESS) { printf("TPM_CreateEndorsementKeyPair_Common: Error, " "algorithmID %08x not supported\n", keyInfo->algorithmID); returnCode = TPM_BAD_KEY_PROPERTY; } } } /* c. The other parameters of keyInfo (encScheme, sigScheme, etc.) are ignored. */ /* 3. Create a key pair called the "endorsement key pair" using a TPM-protected capability. The type and size of key are that indicated by keyInfo. Set encScheme to TPM_ES_RSAESOAEP_SHA1_MGF1. Save the endorsement key in permanent structure. Save the endorsement private key 'd' in the TPM_KEY structure as encData */ /* Certain HW TPMs do not ignore the encScheme parameter, and expect it to be TPM_ES_RSAESOAEP_SHA1_MGF1. Test the value here to detect an application program that will fail with that TPM. */ if (returnCode == TPM_SUCCESS) { if (keyInfo->encScheme != TPM_ES_RSAESOAEP_SHA1_MGF1) { returnCode = TPM_BAD_KEY_PROPERTY; printf("TPM_CreateEndorsementKeyPair_Common: Error, " "encScheme %08x must be TPM_ES_RSAESOAEP_SHA1_MGF1\n", keyInfo->encScheme); } } if (returnCode == TPM_SUCCESS) { keyInfo->sigScheme = TPM_ES_NONE; returnCode = TPM_Key_GenerateRSA(endorsementKey, tpm_state, NULL, /* parent key, indicate root key */ tpm_state->tpm_stclear_data.PCRS, /* PCR array */ 1, /* TPM_KEY */ TPM_KEY_STORAGE, /* keyUsage */ 0, /* keyFlags */ TPM_AUTH_ALWAYS, /* authDataUsage */ keyInfo, NULL, /* no PCR's */ NULL); /* no PCR's */ *writePermanentData = TRUE; } /* Assemble the TPM_PUBKEY pubEndorsementKey for the response */ if (returnCode == TPM_SUCCESS) { /* add TPM_KEY_PARMS algorithmParms */ returnCode = TPM_KeyParms_Copy(&(pubEndorsementKey->algorithmParms), keyInfo); } if (returnCode == TPM_SUCCESS) { /* add TPM_SIZED_BUFFER pubKey */ returnCode = TPM_SizedBuffer_Set(&(pubEndorsementKey->pubKey), endorsementKey->pubKey.size, endorsementKey->pubKey.buffer); } /* 4. Create checksum by performing SHA-1 on the concatenation of (PUBEK || antiReplay) */ if (returnCode == TPM_SUCCESS) { /* serialize the pubEndorsementKey */ returnCode = TPM_Pubkey_Store(&pubEndorsementKeySerial, pubEndorsementKey); } if (returnCode == TPM_SUCCESS) { TPM_Sbuffer_Get(&pubEndorsementKeySerial, &pubEndorsementKeyBuffer, &pubEndorsementKeyLength); /* create the checksum */ returnCode = TPM_SHA1(checksum, pubEndorsementKeyLength, pubEndorsementKeyBuffer, sizeof(TPM_NONCE), antiReplay, 0, NULL); } /* 5. Store the PRIVEK */ /* NOTE Created in TPM_PERMANENT_DATA, call should save to NVRAM */ /* 6. Create TPM_PERMANENT_DATA -> tpmDAASeed from the TPM RNG */ /* 7. Create TPM_PERMANENT_DATA -> daaProof from the TPM RNG */ /* 8. Create TPM_PERMANENT_DATA -> daaBlobKey from the TPM RNG */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_PermanentData_InitDaa(&(tpm_state->tpm_permanent_data)); } /* 9. Set TPM_PERMANENT_FLAGS -> CEKPUsed to TRUE */ if (returnCode == TPM_SUCCESS) { tpm_state->tpm_permanent_flags.CEKPUsed = TRUE; } /* cleanup */ TPM_Sbuffer_Delete(&pubEndorsementKeySerial); /* @1 */ return returnCode; } /* 14.3 TPM_RevokeTrust rev 98 This command clears the EK and sets the TPM back to a pure default state. The generation of the AuthData value occurs during the generation of the EK. It is the responsibility of the EK generator to properly protect and disseminate the RevokeTrust AuthData. */ TPM_RESULT TPM_Process_RevokeTrust(tpm_state_t *tpm_state, TPM_STORE_BUFFER *response, TPM_TAG tag, uint32_t paramSize, /* of remaining parameters*/ TPM_COMMAND_CODE ordinal, unsigned char *command, TPM_TRANSPORT_INTERNAL *transportInternal) { TPM_RESULT rcf = 0; /* fatal error precluding response */ TPM_RESULT returnCode = TPM_SUCCESS; /* command return code */ /* input parameters */ TPM_NONCE EKReset; /* The value that will be matched to EK Reset */ /* processing parameters */ unsigned char * inParamStart; /* starting point of inParam's */ unsigned char * inParamEnd; /* ending point of inParam's */ TPM_DIGEST inParamDigest; TPM_BOOL auditStatus = FALSE; /* audit the ordinal */ TPM_BOOL transportEncrypt = FALSE; /* wrapped in encrypted transport session */ TPM_BOOL writeAllNV1 = FALSE; /* flags to write back data */ TPM_BOOL writeAllNV2 = FALSE; /* flags to write back flags */ TPM_BOOL writeAllNV3 = FALSE; /* flags to write back flags */ TPM_BOOL physicalPresence; /* output parameters */ uint32_t outParamStart; /* starting point of outParam's */ uint32_t outParamEnd; /* ending point of outParam's */ TPM_DIGEST outParamDigest; printf("TPM_Process_RevokeTrust: Ordinal Entry\n"); /* get inputs */ /* save the starting point of inParam's for authorization and auditing */ inParamStart = command; /* get EKReset parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Nonce_Load(EKReset, &command, &paramSize); } if (returnCode == TPM_SUCCESS) { TPM_PrintFour(" TPM_Process_RevokeTrust: EKReset", EKReset); } /* save the ending point of inParam's for authorization and auditing */ inParamEnd = command; /* digest the input parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetInParamDigest(inParamDigest, /* output */ &auditStatus, /* output */ &transportEncrypt, /* output */ tpm_state, tag, ordinal, inParamStart, inParamEnd, transportInternal); } /* check state */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckState(tpm_state, tag, TPM_CHECK_ALLOW_NO_OWNER); } /* check tag */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckRequestTag0(tag); } if (returnCode == TPM_SUCCESS) { if (paramSize != 0) { printf("TPM_Process_RevokeTrust: Error, command has %u extra bytes\n", paramSize); returnCode = TPM_BAD_PARAM_SIZE; } } /* Processing */ /* 1. The TPM MUST validate that TPM_PERMANENT_FLAGS -> enableRevokeEK is TRUE, return TPM_PERMANENTEK on error */ if (returnCode == TPM_SUCCESS) { if (!tpm_state->tpm_permanent_flags.enableRevokeEK) { printf("TPM_Process_RevokeTrust: Error, enableRevokeEK is FALSE\n"); returnCode = TPM_PERMANENTEK; } } /* 2. The TPM MUST validate that the EKReset matches TPM_PERMANENT_DATA -> EKReset, return TPM_AUTHFAIL on error. */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Nonce_Compare(tpm_state->tpm_permanent_data.EKReset, EKReset); if (returnCode != 0) { printf("TPM_Process_RevokeTrust: Error, EKReset mismatch\n"); returnCode = TPM_AUTHFAIL; } } /* 3. Ensure that physical presence is being asserted */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Global_GetPhysicalPresence(&physicalPresence, tpm_state); } if (returnCode == TPM_SUCCESS) { if (!physicalPresence) { printf("TPM_Process_RevokeTrust: Error, physicalPresence is FALSE\n"); returnCode = TPM_BAD_PRESENCE; } } /* 4. Perform the actions of TPM_OwnerClear (excepting the command authentication) */ /* a. NV items with the pubInfo -> nvIndex D value set MUST be deleted. This changes the TPM_OwnerClear handling of the same NV areas */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_OwnerClearCommon(tpm_state, TRUE); /* delete all NVRAM */ writeAllNV1 = TRUE; } if (returnCode == TPM_SUCCESS) { /* b. Set TPM_PERMANENT_FLAGS -> nvLocked to FALSE */ TPM_SetCapability_Flag(&writeAllNV2, /* altered (dummy) */ &(tpm_state->tpm_permanent_flags.nvLocked), /* flag */ FALSE); /* value */ /* 5. Invalidate TPM_PERMANENT_DATA -> tpmDAASeed */ /* 6. Invalidate TPM_PERMANENT_DATA -> daaProof */ /* 7. Invalidate TPM_PERMANENT_DATA -> daaBlobKey */ returnCode = TPM_PermanentData_InitDaa(&(tpm_state->tpm_permanent_data)); } if (returnCode == TPM_SUCCESS) { /* 8. Invalidate the EK and any internal state associated with the EK */ printf("TPM_Process_RevokeTrust: Deleting endorsement key\n"); TPM_Key_Delete(&(tpm_state->tpm_permanent_data.endorsementKey)); TPM_SetCapability_Flag(&writeAllNV3, /* altered (dummy) */ &(tpm_state->tpm_permanent_flags.CEKPUsed), /* flag */ FALSE); /* value */ } /* Store the permanent data and flags back to NVRAM */ returnCode = TPM_PermanentAll_NVStore(tpm_state, writeAllNV1, returnCode); /* response */ /* standard response: tag, (dummy) paramSize, returnCode. Failure is fatal. */ if (rcf == 0) { printf("TPM_Process_RevokeTrust: Ordinal returnCode %08x %u\n", returnCode, returnCode); rcf = TPM_Sbuffer_StoreInitialResponse(response, tag, returnCode); } /* success response, append the rest of the parameters. */ if (rcf == 0) { if (returnCode == TPM_SUCCESS) { /* checkpoint the beginning of the outParam's */ outParamStart = response->buffer_current - response->buffer; /* checkpoint the end of the outParam's */ outParamEnd = response->buffer_current - response->buffer; } /* digest the above the line output parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetOutParamDigest(outParamDigest, /* output */ auditStatus, /* input audit status */ transportEncrypt, tag, returnCode, ordinal, /* command ordinal */ response->buffer + outParamStart, /* start */ outParamEnd - outParamStart); /* length */ } /* audit if required */ if ((returnCode == TPM_SUCCESS) && auditStatus) { returnCode = TPM_ProcessAudit(tpm_state, transportEncrypt, inParamDigest, outParamDigest, ordinal); } /* adjust the initial response */ rcf = TPM_Sbuffer_StoreFinalResponse(response, returnCode, tpm_state); } /* cleanup */ return rcf; } /* 27.7 TPM_DisablePubekRead rev 94 The TPM Owner may wish to prevent any entity from reading the PUBEK. This command sets the non-volatile flag so that the TPM_ReadPubek command always returns TPM_DISABLED_CMD. This commands has in essence been deprecated as TPM_TakeOwnership now sets the value to false. The commands remains at this time for backward compatibility. */ TPM_RESULT TPM_Process_DisablePubekRead(tpm_state_t *tpm_state, TPM_STORE_BUFFER *response, TPM_TAG tag, uint32_t paramSize, /* of remaining parameters*/ TPM_COMMAND_CODE ordinal, unsigned char *command, TPM_TRANSPORT_INTERNAL *transportInternal) { TPM_RESULT rcf = 0; /* fatal error precluding response */ TPM_RESULT returnCode = TPM_SUCCESS; /* command return code */ /* input parameters */ TPM_AUTHHANDLE authHandle; /* The authorization handle used for owner authorization. */ TPM_NONCE nonceOdd; /* Nonce generated by system associated with authHandle */ TPM_BOOL continueAuthSession = TRUE; /* The continue use flag for the authorization handle */ TPM_AUTHDATA ownerAuth; /* The authorization digest for inputs and owner authorization. HMAC key: ownerAuth. */ /* processing */ unsigned char * inParamStart; /* starting point of inParam's */ unsigned char * inParamEnd; /* ending point of inParam's */ TPM_DIGEST inParamDigest; TPM_BOOL auditStatus; /* audit the ordinal */ TPM_BOOL transportEncrypt; /* wrapped in encrypted transport session */ TPM_BOOL authHandleValid = FALSE; TPM_AUTH_SESSION_DATA *auth_session_data; /* session data for authHandle */ TPM_SECRET *hmacKey; TPM_BOOL writeAllNV = FALSE; /* flag to write back NV */ /* output parameters */ uint32_t outParamStart; /* starting point of outParam's */ uint32_t outParamEnd; /* ending point of outParam's */ TPM_DIGEST outParamDigest; printf("TPM_Process_DisablePubekRead: Ordinal Entry\n"); /* get inputs */ /* save the starting point of inParam's for authorization and auditing */ inParamStart = command; /* save the ending point of inParam's for authorization and auditing */ inParamEnd = command; /* digest the input parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetInParamDigest(inParamDigest, /* output */ &auditStatus, /* output */ &transportEncrypt, /* output */ tpm_state, tag, ordinal, inParamStart, inParamEnd, transportInternal); } /* check state */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckState(tpm_state, tag, TPM_CHECK_ALL); } /* check tag */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckRequestTag1(tag); } /* get the 'below the line' authorization parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_AuthParams_Get(&authHandle, &authHandleValid, nonceOdd, &continueAuthSession, ownerAuth, &command, &paramSize); } if (returnCode == TPM_SUCCESS) { if (paramSize != 0) { printf("TPM_Process_DisablePubekRead: Error, command has %u extra bytes\n", paramSize); returnCode = TPM_BAD_PARAM_SIZE; } } /* do not terminate sessions if the command did not parse correctly */ if (returnCode != TPM_SUCCESS) { authHandleValid = FALSE; } /* Processing */ /* Verify that the TPM Owner authorizes the command and all of the input, on error return TPM_AUTHFAIL. */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_AuthSessions_GetData(&auth_session_data, &hmacKey, tpm_state, authHandle, TPM_PID_NONE, TPM_ET_OWNER, ordinal, NULL, &(tpm_state->tpm_permanent_data.ownerAuth), /* OIAP */ tpm_state->tpm_permanent_data.ownerAuth); /* OSAP */ } if (returnCode == TPM_SUCCESS) { returnCode = TPM_Authdata_Check(tpm_state, *hmacKey, /* owner HMAC key */ inParamDigest, auth_session_data, /* authorization session */ nonceOdd, /* Nonce generated by system associated with authHandle */ continueAuthSession, ownerAuth); /* Authorization digest for input */ } /* 1. This capability sets the TPM_PERMANENT_FLAGS -> readPubek flag to FALSE. */ if (returnCode == TPM_SUCCESS) { TPM_SetCapability_Flag(&writeAllNV, /* altered */ &(tpm_state->tpm_permanent_flags.readPubek), /* flag */ FALSE); /* value */ printf("TPM_Process_DisablePubekRead: readPubek now %02x\n", tpm_state->tpm_permanent_flags.readPubek); /* save the permanent flags structure to NVRAM */ returnCode = TPM_PermanentAll_NVStore(tpm_state, writeAllNV, returnCode); } /* response */ /* standard response: tag, (dummy) paramSize, returnCode. Failure is fatal. */ if (rcf == 0) { printf("TPM_Process_DisablePubekRead: Ordinal returnCode %08x %u\n", returnCode, returnCode); rcf = TPM_Sbuffer_StoreInitialResponse(response, tag, returnCode); } /* success response, append the rest of the parameters. */ if (rcf == 0) { if (returnCode == TPM_SUCCESS) { /* checkpoint the beginning of the outParam's */ outParamStart = response->buffer_current - response->buffer; /* checkpoint the end of the outParam's */ outParamEnd = response->buffer_current - response->buffer; } /* digest the above the line output parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetOutParamDigest(outParamDigest, /* output */ auditStatus, /* input audit status */ transportEncrypt, tag, returnCode, ordinal, /* command ordinal */ response->buffer + outParamStart, /* start */ outParamEnd - outParamStart); /* length */ } /* calculate and set the below the line parameters */ if (returnCode == TPM_SUCCESS) { /* no outParam's, set authorization response data */ returnCode = TPM_AuthParams_Set(response, *hmacKey, /* owner HMAC key */ auth_session_data, outParamDigest, nonceOdd, continueAuthSession); } /* audit if required */ if ((returnCode == TPM_SUCCESS) && auditStatus) { returnCode = TPM_ProcessAudit(tpm_state, transportEncrypt, inParamDigest, outParamDigest, ordinal); } /* adjust the initial response */ rcf = TPM_Sbuffer_StoreFinalResponse(response, returnCode, tpm_state); } /* if there was an error, terminate the session. */ if (((rcf != 0) || ((returnCode != TPM_SUCCESS) && (returnCode != TPM_DEFEND_LOCK_RUNNING)) || !continueAuthSession) && authHandleValid) { TPM_AuthSessions_TerminateHandle(tpm_state->tpm_stclear_data.authSessions, authHandle); } return rcf; } /* 27.6 TPM_OwnerReadPubek rev 94 Return the endorsement key public portion. This is authorized by the TPM Owner. */ TPM_RESULT TPM_Process_OwnerReadPubek(tpm_state_t *tpm_state, TPM_STORE_BUFFER *response, TPM_TAG tag, uint32_t paramSize, /* of remaining parameters*/ TPM_COMMAND_CODE ordinal, unsigned char *command, TPM_TRANSPORT_INTERNAL *transportInternal) { TPM_RESULT rcf = 0; /* fatal error precluding response */ TPM_RESULT returnCode = TPM_SUCCESS; /* command return code */ /* input parameters */ TPM_AUTHHANDLE authHandle; /* The authorization handle used for owner authorization. */ TPM_NONCE nonceOdd; /* Nonce generated by system associated with authHandle */ TPM_BOOL continueAuthSession = TRUE; /* The continue use flag for the authorization handle */ TPM_AUTHDATA ownerAuth; /* The authorization digest for inputs and owner authorization. HMAC key: ownerAuth. */ /* processing parameters */ unsigned char * inParamStart; /* starting point of inParam's */ unsigned char * inParamEnd; /* ending point of inParam's */ TPM_DIGEST inParamDigest; TPM_BOOL auditStatus; /* audit the ordinal */ TPM_BOOL transportEncrypt; /* wrapped in encrypted transport session */ TPM_BOOL authHandleValid = FALSE; TPM_AUTH_SESSION_DATA *auth_session_data; /* session data for authHandle */ TPM_SECRET *hmacKey; const unsigned char *pubEndorsementKeyStreamBuffer; uint32_t pubEndorsementKeyStreamLength; /* output parameters */ uint32_t outParamStart; /* starting point of outParam's */ uint32_t outParamEnd; /* ending point of outParam's */ TPM_DIGEST outParamDigest; TPM_STORE_BUFFER pubEndorsementKeyStream; /* The public endorsement key */ printf("TPM_Process_OwnerReadPubek: Ordinal Entry\n"); TPM_Sbuffer_Init(&pubEndorsementKeyStream); /* freed @1 */ /* get inputs */ /* save the starting point of inParam's for authorization and auditing */ inParamStart = command; /* save the ending point of inParam's for authorization and auditing */ inParamEnd = command; /* digest the input parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetInParamDigest(inParamDigest, /* output */ &auditStatus, /* output */ &transportEncrypt, /* output */ tpm_state, tag, ordinal, inParamStart, inParamEnd, transportInternal); } /* check state */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckState(tpm_state, tag, TPM_CHECK_ALL); } /* check tag */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckRequestTag1(tag); } /* get the 'below the line' authorization parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_AuthParams_Get(&authHandle, &authHandleValid, nonceOdd, &continueAuthSession, ownerAuth, &command, &paramSize); } if (returnCode == TPM_SUCCESS) { if (paramSize != 0) { printf("TPM_Process_OwnerReadPubek: Error, command has %u extra bytes\n", paramSize); returnCode = TPM_BAD_PARAM_SIZE; } } /* do not terminate sessions if the command did not parse correctly */ if (returnCode != TPM_SUCCESS) { authHandleValid = FALSE; } /* Processing */ /* 1. Validate the TPM Owner authorization to execute this command */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_AuthSessions_GetData(&auth_session_data, &hmacKey, tpm_state, authHandle, TPM_PID_NONE, TPM_ET_OWNER, ordinal, NULL, &(tpm_state->tpm_permanent_data.ownerAuth), /* OIAP */ tpm_state->tpm_permanent_data.ownerAuth); /* OSAP */ } if (returnCode == TPM_SUCCESS) { returnCode = TPM_Authdata_Check(tpm_state, *hmacKey, /* owner HMAC key */ inParamDigest, auth_session_data, /* authorization session */ nonceOdd, /* Nonce generated by system associated with authHandle */ continueAuthSession, ownerAuth); /* Authorization digest for input */ } /* serialize the TPM_PUBKEY components of the EK */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Key_StorePubkey(&pubEndorsementKeyStream, /* output */ &pubEndorsementKeyStreamBuffer, /* output */ &pubEndorsementKeyStreamLength, /* output */ &(tpm_state->tpm_permanent_data.endorsementKey)); /* input */ } /* response */ /* standard response: tag, (dummy) paramSize, returnCode. Failure is fatal. */ if (rcf == 0) { printf("TPM_Process_OwnerReadPubek: Ordinal returnCode %08x %u\n", returnCode, returnCode); rcf = TPM_Sbuffer_StoreInitialResponse(response, tag, returnCode); } /* success response, append the rest of the parameters. */ if (rcf == 0) { if (returnCode == TPM_SUCCESS) { /* checkpoint the beginning of the outParam's */ outParamStart = response->buffer_current - response->buffer; /* 2. Export the PUBEK */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Sbuffer_Append(response, pubEndorsementKeyStreamBuffer, pubEndorsementKeyStreamLength); } /* checkpoint the end of the outParam's */ outParamEnd = response->buffer_current - response->buffer; } /* digest the above the line output parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetOutParamDigest(outParamDigest, /* output */ auditStatus, /* input audit status */ transportEncrypt, tag, returnCode, ordinal, /* command ordinal */ response->buffer + outParamStart, /* start */ outParamEnd - outParamStart); /* length */ } /* calculate and set the below the line parameters */ if (returnCode == TPM_SUCCESS) { /* no outParam's, set authorization response data */ returnCode = TPM_AuthParams_Set(response, *hmacKey, /* owner HMAC key */ auth_session_data, outParamDigest, nonceOdd, continueAuthSession); } /* audit if required */ if ((returnCode == TPM_SUCCESS) && auditStatus) { returnCode = TPM_ProcessAudit(tpm_state, transportEncrypt, inParamDigest, outParamDigest, ordinal); } /* adjust the initial response */ rcf = TPM_Sbuffer_StoreFinalResponse(response, returnCode, tpm_state); } /* if there was an error, terminate the session. */ if (((rcf != 0) || ((returnCode != TPM_SUCCESS) && (returnCode != TPM_DEFEND_LOCK_RUNNING)) || !continueAuthSession) && authHandleValid) { TPM_AuthSessions_TerminateHandle(tpm_state->tpm_stclear_data.authSessions, authHandle); } /* cleanup */ TPM_Sbuffer_Delete(&pubEndorsementKeyStream); /* @1 */ return rcf; } /* 27.1.1 TPM_EvictKey rev 87 The key commands are deprecated as the new way to handle keys is to use the standard context commands. So TPM_EvictKey is now handled by TPM_FlushSpecific, TPM_TerminateHandle by TPM_FlushSpecific. The TPM will invalidate the key stored in the specified handle and return the space to the available internal pool for subsequent query by TPM_GetCapability and usage by TPM_LoadKey. If the specified key handle does not correspond to a valid key, an error will be returned. */ TPM_RESULT TPM_Process_EvictKey(tpm_state_t *tpm_state, TPM_STORE_BUFFER *response, TPM_TAG tag, uint32_t paramSize, /* of remaining parameters*/ TPM_COMMAND_CODE ordinal, unsigned char *command, TPM_TRANSPORT_INTERNAL *transportInternal) { TPM_RESULT rcf = 0; /* fatal error precluding response */ TPM_RESULT returnCode = TPM_SUCCESS; /* command return code */ /* input parameters */ TPM_KEY_HANDLE evictHandle; /* The handle of the key to be evicted. */ /* processing parameters */ unsigned char * inParamStart; /* starting point of inParam's */ unsigned char * inParamEnd; /* ending point of inParam's */ TPM_DIGEST inParamDigest; TPM_BOOL auditStatus; /* audit the ordinal */ TPM_BOOL transportEncrypt; /* wrapped in encrypted transport session */ TPM_KEY_HANDLE_ENTRY *tpm_key_handle_entry; /* table entry for the evictHandle */ /* output parameters */ uint32_t outParamStart; /* starting point of outParam's */ uint32_t outParamEnd; /* ending point of outParam's */ TPM_DIGEST outParamDigest; printf("TPM_Process_EvictKey: Ordinal Entry\n"); /* get inputs */ /* get evictHandle parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Load32(&evictHandle, &command, &paramSize); } /* save the starting point of inParam's for authorization and auditing */ inParamStart = command; /* save the ending point of inParam's for authorization and auditing */ inParamEnd = command; /* digest the input parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetInParamDigest(inParamDigest, /* output */ &auditStatus, /* output */ &transportEncrypt, /* output */ tpm_state, tag, ordinal, inParamStart, inParamEnd, transportInternal); } /* check state */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckState(tpm_state, tag, TPM_CHECK_ALL); } /* check tag */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckRequestTag0(tag); } if (returnCode == TPM_SUCCESS) { if (paramSize != 0) { printf("TPM_Process_EvictKey: Error, command has %u extra bytes\n", paramSize); returnCode = TPM_BAD_PARAM_SIZE; } } /* Processing */ /* New 1.2 functionality The command must check the status of the ownerEvict flag for the key and if the flag is TRUE return TPM_KEY_CONTROL_OWNER */ /* evict the key stored in the specified handle */ /* get the TPM_KEY_HANDLE_ENTRY */ if (returnCode == TPM_SUCCESS) { printf("TPM_Process_EvictKey: Evicting handle %08x\n", evictHandle); returnCode = TPM_KeyHandleEntries_GetEntry(&tpm_key_handle_entry, tpm_state->tpm_key_handle_entries, evictHandle); if (returnCode != TPM_SUCCESS) { printf("TPM_Process_EvictKey: Error, key handle %08x not found\n", evictHandle); } } /* If tpm_key_handle_entry -> ownerEvict is TRUE return TPM_KEY_OWNER_CONTROL */ if (returnCode == TPM_SUCCESS) { if (tpm_key_handle_entry->keyControl & TPM_KEY_CONTROL_OWNER_EVICT) { printf("TPM_Process_EvictKey: Error, keyHandle specifies owner evict\n"); returnCode = TPM_KEY_OWNER_CONTROL; } } /* delete the entry, delete the key structure, and free the key */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_KeyHandleEntry_FlushSpecific(tpm_state, tpm_key_handle_entry); } /* response */ /* standard response: tag, (dummy) paramSize, returnCode. Failure is fatal. */ if (rcf == 0) { printf("TPM_Process_EvictKey: Ordinal returnCode %08x %u\n", returnCode, returnCode); rcf = TPM_Sbuffer_StoreInitialResponse(response, tag, returnCode); } /* success response, append the rest of the parameters. */ if (rcf == 0) { if (returnCode == TPM_SUCCESS) { /* checkpoint the beginning of the outParam's */ outParamStart = response->buffer_current - response->buffer; /* checkpoint the end of the outParam's */ outParamEnd = response->buffer_current - response->buffer; } /* digest the above the line output parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetOutParamDigest(outParamDigest, /* output */ auditStatus, /* input audit status */ transportEncrypt, tag, returnCode, ordinal, /* command ordinal */ response->buffer + outParamStart, /* start */ outParamEnd - outParamStart); /* length */ } /* audit if required */ if ((returnCode == TPM_SUCCESS) && auditStatus) { returnCode = TPM_ProcessAudit(tpm_state, transportEncrypt, inParamDigest, outParamDigest, ordinal); } /* adjust the initial response */ rcf = TPM_Sbuffer_StoreFinalResponse(response, returnCode, tpm_state); } return rcf; } /* 14.5 TPM_OwnerReadInternalPub rev 87 A TPM Owner authorized command that returns the public portion of the EK or SRK. The keyHandle parameter is included in the incoming session authorization to prevent alteration of the value, causing a different key to be read. Unlike most key handles, which can be mapped by higher layer software, this key handle has only two fixed values. */ TPM_RESULT TPM_Process_OwnerReadInternalPub(tpm_state_t *tpm_state, TPM_STORE_BUFFER *response, TPM_TAG tag, uint32_t paramSize, /* of remaining parameters */ TPM_COMMAND_CODE ordinal, unsigned char *command, TPM_TRANSPORT_INTERNAL *transportInternal) { TPM_RESULT rcf = 0; /* fatal error precluding response */ TPM_RESULT returnCode = TPM_SUCCESS; /* command return code */ /* input parameters */ TPM_KEY_HANDLE keyHandle; /* Handle for either PUBEK or SRK */ TPM_AUTHHANDLE authHandle; /* The authorization session handle used for owner authentication. */ TPM_NONCE nonceOdd; /* Nonce generated by system associated with authHandle */ TPM_BOOL continueAuthSession = TRUE; /* The continue use flag for the authorization session handle */ TPM_AUTHDATA ownerAuth; /* The authorization session digest for inputs and owner authentication. HMAC key: ownerAuth. */ /* processing parameters */ unsigned char * inParamStart; /* starting point of inParam's */ unsigned char * inParamEnd; /* ending point of inParam's */ TPM_DIGEST inParamDigest; TPM_BOOL auditStatus; /* audit the ordinal */ TPM_BOOL transportEncrypt; /* wrapped in encrypted transport session */ TPM_BOOL authHandleValid = FALSE; TPM_AUTH_SESSION_DATA *auth_session_data; /* session data for authHandle */ TPM_SECRET *hmacKey; TPM_KEY *readKey = NULL; /* key to be read back */ const unsigned char *stream; uint32_t stream_size; /* output parameters */ uint32_t outParamStart; /* starting point of outParam's */ uint32_t outParamEnd; /* ending point of outParam's */ TPM_DIGEST outParamDigest; printf("TPM_Process_OwnerReadInternalPub: Ordinal Entry\n"); /* get inputs */ /* save the starting point of inParam's for authorization and auditing */ /* NOTE: This is a special case, where the keyHandle is part of the HMAC calculation to avoid a man-in-the-middle privacy attack that replaces the SRK handle with the EK handle. */ inParamStart = command; /* get keyHandle parameter */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Load32(&keyHandle, &command, &paramSize); } if (returnCode == TPM_SUCCESS) { printf("TPM_Process_OwnerReadInternalPub: keyHandle %08x\n", keyHandle); } /* save the ending point of inParam's for authorization and auditing */ inParamEnd = command; /* digest the input parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetInParamDigest(inParamDigest, /* output */ &auditStatus, /* output */ &transportEncrypt, /* output */ tpm_state, tag, ordinal, inParamStart, inParamEnd, transportInternal); } /* check state */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckState(tpm_state, tag, TPM_CHECK_ALL); } /* check tag */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_CheckRequestTag1(tag); } /* get the 'below the line' authorization parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_AuthParams_Get(&authHandle, &authHandleValid, nonceOdd, &continueAuthSession, ownerAuth, &command, &paramSize); } if (returnCode == TPM_SUCCESS) { if (paramSize != 0) { printf("TPM_Process_OwnerReadInternalPub: Error, command has %u extra bytes\n", paramSize); returnCode = TPM_BAD_PARAM_SIZE; } } /* do not terminate sessions if the command did not parse correctly */ if (returnCode != TPM_SUCCESS) { authHandleValid = FALSE; } /* Processing */ /* 1. Validate the parameters and TPM Owner AuthData for this command */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_AuthSessions_GetData(&auth_session_data, &hmacKey, tpm_state, authHandle, TPM_PID_NONE, TPM_ET_OWNER, ordinal, NULL, &(tpm_state->tpm_permanent_data.ownerAuth), /* OIAP */ tpm_state->tpm_permanent_data.ownerAuth); /* OSAP */ } if (returnCode == TPM_SUCCESS) { returnCode = TPM_Authdata_Check(tpm_state, *hmacKey, /* owner HMAC key */ inParamDigest, auth_session_data, /* authorization session */ nonceOdd, /* Nonce generated by system associated with authHandle */ continueAuthSession, ownerAuth); /* Authorization digest for input */ } if (returnCode == TPM_SUCCESS) { /* 2. If keyHandle is TPM_KH_EK */ if (keyHandle == TPM_KH_EK) { /* a. Set publicPortion to PUBEK */ printf("TPM_Process_OwnerReadInternalPub: Reading EK\n"); readKey = &(tpm_state->tpm_permanent_data.endorsementKey); } /* 3. Else If keyHandle is TPM_KH_SRK */ else if (keyHandle == TPM_KH_SRK) { /* a. Set publicPortion to the TPM_PUBKEY of the SRK */ printf("TPM_Process_OwnerReadInternalPub: Reading SRK\n"); readKey = &(tpm_state->tpm_permanent_data.srk); } /* 4. Else return TPM_BAD_PARAMETER */ else { printf("TPM_Process_OwnerReadInternalPub: Error, invalid keyHandle %08x\n", keyHandle); returnCode = TPM_BAD_PARAMETER; } } /* response */ /* standard response: tag, (dummy) paramSize, returnCode. Failure is fatal. */ if (rcf == 0) { printf("TPM_Process_OwnerReadInternalPub: Ordinal returnCode %08x %u\n", returnCode, returnCode); rcf = TPM_Sbuffer_StoreInitialResponse(response, tag, returnCode); } /* success response, append the rest of the parameters. */ if (rcf == 0) { if (returnCode == TPM_SUCCESS) { /* checkpoint the beginning of the outParam's */ outParamStart = response->buffer_current - response->buffer; /* 5. Export the public key of the referenced key */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_Key_StorePubkey(response, &stream, &stream_size, readKey); } /* checkpoint the end of the outParam's */ outParamEnd = response->buffer_current - response->buffer; } /* digest the above the line output parameters */ if (returnCode == TPM_SUCCESS) { returnCode = TPM_GetOutParamDigest(outParamDigest, /* output */ auditStatus, /* input audit status */ transportEncrypt, tag, returnCode, ordinal, /* command ordinal */ response->buffer + outParamStart, /* start */ outParamEnd - outParamStart); /* length */ } /* calculate and set the below the line parameters */ if (returnCode == TPM_SUCCESS) { /* no outParam's, set authorization response data */ returnCode = TPM_AuthParams_Set(response, *hmacKey, /* owner HMAC key */ auth_session_data, outParamDigest, nonceOdd, continueAuthSession); } /* audit if required */ if ((returnCode == TPM_SUCCESS) && auditStatus) { returnCode = TPM_ProcessAudit(tpm_state, transportEncrypt, inParamDigest, outParamDigest, ordinal); } /* adjust the initial response */ rcf = TPM_Sbuffer_StoreFinalResponse(response, returnCode, tpm_state); } /* if there was an error, terminate the session. */ if (((rcf != 0) || ((returnCode != TPM_SUCCESS) && (returnCode != TPM_DEFEND_LOCK_RUNNING)) || !continueAuthSession) && authHandleValid) { TPM_AuthSessions_TerminateHandle(tpm_state->tpm_stclear_data.authSessions, authHandle); } /* cleanup */ return rcf; }
33.650081
100
0.673886
[ "object" ]
d527815c62ac56ef52ec82e360b749587abe355c
8,227
h
C
App/gallery_view.h
ouxianghui/mediasoup-client
3c58c2a79afa56c6cd0fb5e3ec337cd60d8fae55
[ "MIT" ]
1
2022-02-25T06:08:14.000Z
2022-02-25T06:08:14.000Z
App/gallery_view.h
ouxianghui/mediasoup-client
3c58c2a79afa56c6cd0fb5e3ec337cd60d8fae55
[ "MIT" ]
null
null
null
App/gallery_view.h
ouxianghui/mediasoup-client
3c58c2a79afa56c6cd0fb5e3ec337cd60d8fae55
[ "MIT" ]
null
null
null
/** * This file is part of mediasoup_client project. * Author: Jackie Ou * Created: 2021-11-01 **/ #ifndef GALLERY_VIEW_H #define GALLERY_VIEW_H #include <QFrame> #include <vector> #include <QLabel> #include <QToolButton> #include <QProgressBar> #include <algorithm> #include "api/media_stream_interface.h" #include "api/scoped_refptr.h" #include "mac_video_renderer.h" #include "video_renderer.h" #include "table.h" #include "service/participant.h" #define MV_STYLE_MAXNUM 64 // F(id, row, col, label, image) #define FOREACH_MV_STYLE(F) \ F(MV_STYLE_1, 1, 1, " MV1", ":/image/style1.png") \ F(MV_STYLE_2, 1, 2, " MV2", ":/image/style2.png") \ F(MV_STYLE_4, 2, 2, " MV4", ":/image/style4.png") \ F(MV_STYLE_9, 3, 3, " MV9", ":/image/style9.png") \ F(MV_STYLE_16, 4, 4, " MV16", ":/image/style16.png") \ F(MV_STYLE_25, 5, 5, " MV25", ":/image/style25.png") \ F(MV_STYLE_36, 6, 6, " MV36", ":/image/style36.png") \ F(MV_STYLE_49, 7, 7, " MV49", ":/image/style49.png") \ F(MV_STYLE_64, 8, 8, " MV64", ":/image/style64.png") \ enum MV_STYLE { #define ENUM_MV_STYLE(id, row, col, label, image) id, FOREACH_MV_STYLE(ENUM_MV_STYLE) }; namespace Ui { class GalleryView; } namespace webrtc { class VideoTrackInterface; } namespace vi { class IParticipant; } class VideoCanvas : public QWidget { Q_OBJECT public: enum Status { ATTACHED, DETACHED, }; VideoCanvas(QWidget* parent) : QWidget(parent) , _id(-1) , _track(nullptr) , _renderer(new VideoRenderer(this)) { _labelName = new QLabel(this); _buttonAudio = new QToolButton(this); _buttonVideo = new QToolButton(this); _progressBarVolume = new QProgressBar(this); } void init() { _renderer->init(); QFont font = QFont("Times", 10, QFont::Normal, false); _labelName->setFont(font); _labelName->setStyleSheet("color:red"); _labelName->setAlignment(Qt::AlignmentFlag::AlignCenter); _labelName->setAutoFillBackground(true); _buttonAudio->setIcon(QIcon(":/app/resource/icons8-block-microphone-100.png")); _buttonVideo->setIcon(QIcon(":/app/resource/icons8-no-video-100.png")); _progressBarVolume->setRange(0, 99); } void destroy() { if (_renderer) { _renderer->destroy(); } if (_track) { _track->RemoveSink(_renderer); _track = nullptr; } _status = Status::DETACHED; } void attach(std::shared_ptr<vi::IParticipant> participant) { if (!participant) { return; } if (_participant) { return; } _participant = participant; updateUI(participant); _status = Status::ATTACHED; } void update(std::shared_ptr<vi::IParticipant> participant) { if (!participant || !_participant) { return; } if (_participant->id() != participant->id()) { return; } _participant = participant; updateUI(participant); } void detach() { if (_renderer && _track) { _track->RemoveSink(_renderer); _track = nullptr; } _renderer->clear(); _labelName->setText(""); _buttonAudio->setIcon(QIcon(":/app/resource/icons8-block-microphone-100.png")); _buttonVideo->setIcon(QIcon(":/app/resource/icons8-no-video-100.png")); _progressBarVolume->setValue(0); _participant = nullptr; _status = Status::DETACHED; } int32_t id() { return _id; } void setId(int32_t id) { _id = id; } Status status() { return _status; } std::string pid() { return _participant ? _participant->id() : ""; } private: void updateUI(std::shared_ptr<vi::IParticipant> participant) { if (!participant) { return; } _labelName->setText(participant->displayName().c_str()); if (participant->isAudioMuted()) { _buttonAudio->setIcon(QIcon(":/app/resource/icons8-block-microphone-100.png")); } else { _buttonAudio->setIcon(QIcon(":/app/resource/icons8-microphone-100.png")); _progressBarVolume->setValue(100 + participant->speakingVolume()); } if (participant->isVideoMuted()) { _buttonVideo->setIcon(QIcon(":/app/resource/icons8-no-video-100.png")); } else { _buttonVideo->setIcon(QIcon(":/app/resource/icons8-video-call-100.png")); } auto trackMap = participant->getVideoTracks(); if (!trackMap.empty()) { auto item = trackMap.begin(); rtc::scoped_refptr<webrtc::VideoTrackInterface> track = static_cast<webrtc::VideoTrackInterface*>(item->second.get()); if (!_track) { _track = track; if (_track) { rtc::VideoSinkWants wants; _track->AddOrUpdateSink(_renderer, wants); _renderer->reset(); } } else { if (_track != track) { _track->RemoveSink(_renderer); _track = track; if (_track) { rtc::VideoSinkWants wants; _track->AddOrUpdateSink(_renderer, wants); _renderer->reset(); } } } } if (participant->isVideoMuted()) { if (_track) { _track->RemoveSink(_renderer); _track = nullptr; } _renderer->clear(); } else { _renderer->reset(); } } protected: void resizeEvent(QResizeEvent* event) override { _renderer->setGeometry(this->rect()); _labelName->setGeometry(QRect(this->rect().left() + 10, this->rect().bottom() - 35, 100, 30)); _buttonAudio->setGeometry(QRect(this->rect().left() + 10 + 110, this->rect().bottom() - 35, 30, 30)); _buttonVideo->setGeometry(QRect(this->rect().left() + 10 + 150, this->rect().bottom() - 35, 30, 30)); _progressBarVolume->setGeometry(QRect(this->rect().left() + 10 + 190, this->rect().bottom() - 30, 100, 20)); QWidget::resizeEvent(event); } private: int32_t _id; rtc::scoped_refptr<webrtc::VideoTrackInterface> _track; VideoRenderer* _renderer; Status _status = Status::DETACHED; std::shared_ptr<vi::IParticipant> _participant; QLabel* _labelName; QToolButton* _buttonAudio; QToolButton* _buttonVideo; QProgressBar* _progressBarVolume; }; class GalleryView : public QFrame { Q_OBJECT public: explicit GalleryView(QWidget *parent = nullptr); ~GalleryView(); enum Action { STRETCH, EXCHANGE, MERGE, }; public: void init(); void destroy(); void attach(std::shared_ptr<vi::IParticipant> participant); void detach(std::shared_ptr<vi::IParticipant> participant); void update(std::shared_ptr<vi::IParticipant> participant); void setLayout(int row, int col); void reset(); protected slots: void saveLayout(); void restoreLayout(); void mergeCells(int lt, int rb); void exchangeCells(VideoCanvas* canvas1, VideoCanvas* canvas2); void stretch(QWidget* widget); protected: void initUI(); void updateUI(); void resizeEvent(QResizeEvent* e) override; void mousePressEvent(QMouseEvent* e) override; void mouseReleaseEvent(QMouseEvent* e) override; void mouseMoveEvent(QMouseEvent* e) override; void mouseDoubleClickEvent(QMouseEvent* e) override; VideoCanvas* getCanvas(int id); VideoCanvas* getCanvas(QPoint pt); VideoCanvas* getIdleCanvas(); private: Ui::GalleryView* ui; Table _table; Table _prevTable; QVector<QWidget*> _canvases; QPoint _ptMousePress; uint64_t _tsMousePress; Action _action; bool _bStretch; QLabel* _labelRect; QLabel* _labelDrag; }; #endif // GALLERY_VIEW_H
23.708934
130
0.585025
[ "vector" ]
d529ea3d3a6cf7fc77a6266cb6a86c719e51b537
1,240
h
C
src/headers/clients/socket.h
doowzs/tank
f7e7288485f6d9ef7d68451d8b1959ee01a905f6
[ "MIT" ]
1
2020-06-05T02:31:28.000Z
2020-06-05T02:31:28.000Z
src/headers/clients/socket.h
doowzs/tank
f7e7288485f6d9ef7d68451d8b1959ee01a905f6
[ "MIT" ]
null
null
null
src/headers/clients/socket.h
doowzs/tank
f7e7288485f6d9ef7d68451d8b1959ee01a905f6
[ "MIT" ]
null
null
null
// Declaration of the socket based client. // Tianyun Zhang 2020 all rights reserved. #ifndef TANK_CLIENTS_SOCKET_H #define TANK_CLIENTS_SOCKET_H #include <client.h> #include <curses.h> #include <string> #include <vector> using std::vector, std::string; #include <boost/asio.hpp> using boost::asio::io_context; using boost::asio::ip::tcp; // forward declaration class ClientPacket; class ServerPacket; enum PlayerAction : unsigned; class SocketClient : public Client { private: string addr, port; io_context context; tcp::socket socket; vector<ServerPacket *> packets, refresh; WINDOW *game_window, *info_window, *mesg_window, *help_window; public: SocketClient(const char *name, unsigned fps, const string &addr, const string &port); explicit SocketClient(const char *name, tcp::socket &&socket); ~SocketClient(); enum PlayerAction act() final; enum PlayerAction input(); bool post(unsigned now, unsigned flags); bool post(unsigned now, unsigned flags, const Object *object); bool post(unsigned now, unsigned flags, const Player *player); bool post(unsigned now, unsigned flags, const char *message); void init(); void tick(); void over(); void sync(); void draw(); }; #endif
24.8
66
0.725
[ "object", "vector" ]
d53936e50dc9db2624bfe09360a15a522748c91e
937
h
C
cpp/cppsearch/include/FileUtil.h
clarkcb/xsearch
977ab28518c4560140e13eb0bf9050e32c2f5472
[ "MIT" ]
5
2015-06-30T04:13:04.000Z
2022-01-01T23:06:07.000Z
cpp/cppsearch/include/FileUtil.h
clarkcb/xsearch
977ab28518c4560140e13eb0bf9050e32c2f5472
[ "MIT" ]
4
2015-03-23T23:42:46.000Z
2020-11-30T04:42:59.000Z
cpp/cppsearch/include/FileUtil.h
clarkcb/xsearch
977ab28518c4560140e13eb0bf9050e32c2f5472
[ "MIT" ]
2
2015-03-23T23:41:21.000Z
2020-01-24T07:34:32.000Z
#ifndef CPPSEARCH_FILEUTIL_H #define CPPSEARCH_FILEUTIL_H #include <string> #include <vector> namespace cppsearch { class FileUtil { public: static std::string expand_path(const std::string& filepath); static bool file_exists(const std::string& name); static std::string get_contents(const std::string& filepath); static std::string get_contents(const std::ifstream& fin); static std::string get_extension(const std::string& name); static bool is_directory(const std::string& name); static bool is_regular_file(const std::string& name); static bool is_dot_dir(const std::string& name); static bool is_hidden(const std::string& name); static std::vector<std::string> split_path(const std::string& filepath); private: // Disallow creating an instance of this object FileUtil() = default; }; } #endif //CPPSEARCH_FILEUTIL_H
33.464286
80
0.685165
[ "object", "vector" ]
d543713fbc4c68440f017257854f5aa00c705eba
9,730
c
C
NGSpice/ngspice-30/src/ciderlib/input/dopset.c
Surya-98/Snapcuit
9789a779485d8af2426a2d4e6403a06f44acadcb
[ "MIT" ]
null
null
null
NGSpice/ngspice-30/src/ciderlib/input/dopset.c
Surya-98/Snapcuit
9789a779485d8af2426a2d4e6403a06f44acadcb
[ "MIT" ]
null
null
null
NGSpice/ngspice-30/src/ciderlib/input/dopset.c
Surya-98/Snapcuit
9789a779485d8af2426a2d4e6403a06f44acadcb
[ "MIT" ]
null
null
null
/********** Copyright 1991 Regents of the University of California. All rights reserved. Author: 1991 David A. Gates, U. C. Berkeley CAD Group Modifed: 2001 Paolo Nenzi **********/ #include "ngspice/ngspice.h" #include "ngspice/cktdefs.h" #include "ngspice/numenum.h" #include "ngspice/dopdefs.h" #include "ngspice/meshext.h" #include "ngspice/profile.h" #include "ngspice/gendev.h" #include "ngspice/sperror.h" #include "ngspice/suffix.h" #include "ngspice/cidersupt.h" #include "ngspice/carddefs.h" #include "ngspice/ciderinp.h" /* * Name: DOPcheck * Purpose: checks a list of DOPcards for input errors * Formals: cardList: the list to check * Returns: OK/E_PRIVATE * Users: numerical device setup routines * Calls: error message handler */ int DOPcheck(DOPcard *cardList, MESHcoord *xMeshList, MESHcoord *yMeshList) { DOPcard *card; int cardNum = 0; int error = OK; for ( card = cardList; card != NULL; card = card->DOPnextCard ) { cardNum++; if (!card->DOPdomainsGiven) { card->DOPnumDomains = 0; card->DOPdomains = NULL; } if (!card->DOPprofileTypeGiven) { SPfrontEnd->IFerrorf( ERR_WARNING, "doping card %d does not specify profile type", cardNum ); error = E_PRIVATE; } else switch (card->DOPprofileType) { case DOP_UNIF: if (!card->DOPconcGiven) { SPfrontEnd->IFerrorf( ERR_WARNING, "doping card %d needs conc of uniform distribution", cardNum ); error = E_PRIVATE; } break; case DOP_LINEAR: if (!card->DOPconcGiven) { SPfrontEnd->IFerrorf( ERR_WARNING, "doping card %d needs peak conc of linear distribution", cardNum ); error = E_PRIVATE; } break; case DOP_GAUSS: if (!card->DOPconcGiven) { SPfrontEnd->IFerrorf( ERR_WARNING, "doping card %d needs peak conc of gaussian distribution", cardNum ); error = E_PRIVATE; } break; case DOP_ERFC: if (!card->DOPconcGiven) { SPfrontEnd->IFerrorf( ERR_WARNING, "doping card %d needs peak conc of error-function distribution", cardNum ); error = E_PRIVATE; } break; case DOP_EXP: if (!card->DOPconcGiven) { SPfrontEnd->IFerrorf( ERR_WARNING, "doping card %d needs peak conc of exponential distribution", cardNum ); error = E_PRIVATE; } break; case DOP_SUPREM3: case DOP_SUPASCII: if (!card->DOPinFileGiven) { SPfrontEnd->IFerrorf( ERR_WARNING, "doping card %d needs input-file name of suprem3 data", cardNum ); error = E_PRIVATE; } break; case DOP_ASCII: if (!card->DOPinFileGiven) { SPfrontEnd->IFerrorf( ERR_WARNING, "doping card %d needs input-file name of ascii data", cardNum ); error = E_PRIVATE; } break; default: SPfrontEnd->IFerrorf( ERR_FATAL, "doping card %d has unrecognized profile type", cardNum ); error = E_NOTFOUND; break; } if (!card->DOProtateLatGiven) { card->DOProtateLat = FALSE; } if (!card->DOPlatProfileTypeGiven || card->DOProtateLat) { card->DOPlatProfileType = card->DOPprofileType; } if (!card->DOPratioLatGiven) { card->DOPratioLat = 1.0; } if (!card->DOPcharLenGiven) { card->DOPcharLen = 1.0e-4; /* 1um in centimeters */ } if (!card->DOPlocationGiven) { card->DOPlocation = 0.0; } if (!card->DOPimpurityTypeGiven) { card->DOPimpurityType = IMP_N_TYPE; } else switch (card->DOPimpurityType) { case DOP_BORON: card->DOPimpurityType = IMP_BORON; break; case DOP_PHOSP: card->DOPimpurityType = IMP_PHOSPHORUS; break; case DOP_ARSEN: card->DOPimpurityType = IMP_ARSENIC; break; case DOP_ANTIM: card->DOPimpurityType = IMP_ANTIMONY; break; case DOP_N_TYPE: card->DOPimpurityType = IMP_N_TYPE; break; case DOP_P_TYPE: card->DOPimpurityType = IMP_P_TYPE; break; default: break; } if (!card->DOPaxisTypeGiven) { if ( xMeshList && yMeshList ) { /* both lists are non-empty */ card->DOPaxisType = DOP_Y_AXIS; } else if ( xMeshList ) { /* x-mesh list is non-empty */ card->DOPaxisType = DOP_X_AXIS; } else if ( yMeshList ) { /* y-mesh list is non-empty */ card->DOPaxisType = DOP_Y_AXIS; } } /* Return now if anything has failed */ if (error) return(error); } return(OK); } /* * Name: DOPsetup * Purpose: convert a list of DOPcard's to DOPprofile's * Formals: cardList: list of cards to setup * profileList: returns the list of DOPprofile's * xMeshList: list of coordinates in the x mesh * yMeshList: list of coordinates in the y mesh * Returns: OK/E_PRIVATE * Users: numerical devices * Calls: DOPcheck */ int DOPsetup(DOPcard *cardList, DOPprofile **profileList, DOPtable **tableList, MESHcoord *xMeshList, MESHcoord *yMeshList) { DOPcard *card; DOPprofile *newProfile = NULL, *endProfile; int impurityId = 0; double xMin, xMax, yMin, yMax; double sign; int error, xProfUnif, yProfUnif; /* Initialize list of profiles */ *profileList = endProfile = NULL; /* Check the card list */ if ((error = DOPcheck( cardList, xMeshList, yMeshList )) != 0) return( error ); /* Find the limits on locations */ MESHlBounds( xMeshList, &xMin, &xMax ); MESHlBounds( yMeshList, &yMin, &yMax ); for ( card = cardList; card != NULL; card = card->DOPnextCard ) { if (*profileList == NULL) { RALLOC( newProfile, DOPprofile, 1 ); *profileList = newProfile; } else { RALLOC( newProfile->next, DOPprofile, 1 ); newProfile = newProfile->next; } newProfile->next = NULL; newProfile->numDomains = card->DOPnumDomains; if ( newProfile->numDomains > 0 ) { int i; RALLOC( newProfile->domains, int, newProfile->numDomains ); for ( i=0; i < newProfile->numDomains; i++ ) { newProfile->domains[i] = card->DOPdomains[i]; } } else { newProfile->domains = NULL; } if ( card->DOPimpurityType == IMP_P_TYPE ) { sign = -1.0; } else { sign = 1.0; } switch( card->DOPprofileType ) { case DOP_UNIF: newProfile->type = UNIF; newProfile->CONC = sign * card->DOPconc; break; case DOP_LINEAR: newProfile->type = LIN; newProfile->CONC = sign * card->DOPconc; break; case DOP_GAUSS: newProfile->type = GAUSS; newProfile->CONC = sign * card->DOPconc; break; case DOP_ERFC: newProfile->type = ERRFC; newProfile->CONC = sign * card->DOPconc; break; case DOP_EXP: newProfile->type = EXP; newProfile->CONC = sign * card->DOPconc; break; case DOP_SUPREM3: newProfile->type = LOOKUP; readSupremData( card->DOPinFile, 0, card->DOPimpurityType, tableList ); newProfile->IMPID = ++impurityId; break; case DOP_SUPASCII: newProfile->type = LOOKUP; readSupremData( card->DOPinFile, 1, card->DOPimpurityType, tableList ); newProfile->IMPID = ++impurityId; break; case DOP_ASCII: newProfile->type = LOOKUP; readAsciiData( card->DOPinFile, card->DOPimpurityType, tableList ); newProfile->IMPID = ++impurityId; break; default: break; } switch( card->DOPlatProfileType ) { case DOP_UNIF: newProfile->latType = UNIF; break; case DOP_LINEAR: newProfile->latType = LIN; break; case DOP_GAUSS: newProfile->latType = GAUSS; break; case DOP_ERFC: newProfile->latType = ERRFC; break; case DOP_EXP: newProfile->latType = EXP; break; case DOP_SUPREM3: case DOP_SUPASCII: newProfile->latType = LOOKUP; break; case DOP_ASCII: newProfile->latType = LOOKUP; break; default: break; } newProfile->rotate = card->DOProtateLat; newProfile->LOCATION = card->DOPlocation; newProfile->CHAR_LENGTH = card->DOPcharLen; newProfile->LAT_RATIO = card->DOPratioLat; xProfUnif = yProfUnif = FALSE; if (card->DOPaxisType == DOP_X_AXIS) { newProfile->DIRECTION = X; if (newProfile->type == UNIF) xProfUnif = TRUE; if (newProfile->latType == UNIF) yProfUnif = TRUE; } else { newProfile->DIRECTION = Y; if (newProfile->type == UNIF) yProfUnif = TRUE; if (newProfile->latType == UNIF) xProfUnif = TRUE; } /* Fill in x coordinates. Use defaults if necessary */ if (card->DOPxLowGiven && card->DOPxHighGiven) { newProfile->X_LOW = card->DOPxLow; newProfile->X_HIGH = card->DOPxHigh; } else if (card->DOPxLowGiven) { newProfile->X_LOW = card->DOPxLow; if (xProfUnif) { newProfile->X_HIGH = xMax; } else { newProfile->X_HIGH = newProfile->X_LOW; } } else if (card->DOPxHighGiven) { newProfile->X_HIGH = card->DOPxHigh; if (xProfUnif) { newProfile->X_LOW = xMin; } else { newProfile->X_LOW = newProfile->X_HIGH; } } else { if (xProfUnif) { newProfile->X_LOW = xMin; newProfile->X_HIGH = xMax; } else { newProfile->X_LOW = 0.5 * (xMin + xMax); newProfile->X_HIGH = 0.5 * (xMin + xMax); } } /* Fill in y coordinates. Use defaults if necessary */ if (card->DOPyLowGiven && card->DOPyHighGiven) { newProfile->Y_LOW = card->DOPyLow; newProfile->Y_HIGH = card->DOPyHigh; } else if (card->DOPyLowGiven) { newProfile->Y_LOW = card->DOPyLow; if (yProfUnif) { newProfile->Y_HIGH = yMax; } else { newProfile->Y_HIGH = newProfile->Y_LOW; } } else if (card->DOPyHighGiven) { newProfile->Y_HIGH = card->DOPyHigh; if (xProfUnif) { newProfile->Y_LOW = yMin; } else { newProfile->Y_LOW = newProfile->Y_HIGH; } } else { if (yProfUnif) { newProfile->Y_LOW = yMin; newProfile->Y_HIGH = yMax; } else { newProfile->Y_LOW = 0.5 * (yMin + yMax); newProfile->Y_HIGH = 0.5 * (yMin + yMax); } } } return( OK ); }
26.584699
113
0.644707
[ "cad", "mesh" ]
d54636c05aa8aec5866d5e4ee887de43580a1a2c
12,770
h
C
client/ipc/hub_impl.h
zamorajavi/google-input-tools
fc9f11d80d957560f7accf85a5fc27dd23625f70
[ "Apache-2.0" ]
175
2015-01-01T12:40:33.000Z
2019-05-24T22:33:59.000Z
client/ipc/hub_impl.h
zamorajavi/google-input-tools
fc9f11d80d957560f7accf85a5fc27dd23625f70
[ "Apache-2.0" ]
11
2015-01-19T16:30:56.000Z
2018-04-25T01:06:52.000Z
client/ipc/hub_impl.h
zamorajavi/google-input-tools
fc9f11d80d957560f7accf85a5fc27dd23625f70
[ "Apache-2.0" ]
97
2015-01-19T15:35:29.000Z
2019-05-15T05:48:02.000Z
/* Copyright 2014 Google Inc. 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. */ #ifndef GOOPY_IPC_HUB_IMPL_H_ #define GOOPY_IPC_HUB_IMPL_H_ #pragma once #include <algorithm> #include <map> #include <set> #include <vector> #include <utility> #include <string> #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/scoped_ptr.h" #include "ipc/constants.h" #include "ipc/hub.h" #include "ipc/hub_component.h" #include "ipc/hub_input_context.h" #include "ipc/message_types.h" #include "ipc/protos/ipc.pb.h" namespace ipc { namespace hub { extern const uint32 kHubProduceMessages[]; extern const size_t kHubProduceMessagesSize; extern const uint32 kHubConsumeMessages[]; extern const size_t kHubConsumeMessagesSize; extern const char kHubStringID[]; extern const char kHubName[]; class HubCommandListManager; class HubCompositionManager; class HubDefaultInputMethod; class HubHotkeyManager; class HubImplTestBase; class HubInputContextManager; class HubInputMethodManager; // The real implementation of Hub class. This class provides following // functionalities: // 1. Manages components and input contexts. // 2. Supports messages related to component management. // 3. Provides utility functions for its built-in components. // 4. Dispatches messages among components. // This class is not thread safe. A wrapper providing necessary lock or // multi-threading support should be used when using it in a multi-thread // environment. class HubImpl : public Hub, public Hub::Connector, public InputContext::Delegate { public: typedef Hub::Connector Connector; typedef InputContext::MessageTypeVector MessageTypeVector; HubImpl(); virtual ~HubImpl(); // Overridden from ipc::Hub interface virtual void Attach(Connector* connector) OVERRIDE; virtual void Detach(Connector* connector) OVERRIDE; virtual bool Dispatch(Connector* connector, proto::Message* message) OVERRIDE; // Gets a component object by id. Component* GetComponent(uint32 id) const { ComponentMap::const_iterator i = components_.find(id); return i != components_.end() ? i->second : NULL; } Component* GetComponentByStringID(const std::string& id) const { ComponentStringIDMap::const_iterator i = components_by_string_id_.find(id); return i != components_by_string_id_.end() ? i->second : NULL; } // Gets an input context object by id. InputContext* GetInputContext(uint32 id) const { if (id == kInputContextFocused) id = focused_input_context_; if (id == kInputContextNone) return hub_input_context_; InputContextMap::const_iterator iter = input_contexts_.find(id); return iter != input_contexts_.end() ? iter->second : NULL; } // Creates a component object for a specified |connector|. If |built_in| is // true, then it'll be attached to the default input context with // ACTIVE_STICKY mode directly. Component* CreateComponent(Connector* connector, const proto::ComponentInfo& info, bool built_in); // Deletes a component of a specified |connector| by id. bool DeleteComponent(Connector* connector, uint32 id); // Creates an input context object for a specified |owner| component. InputContext* CreateInputContext(Component* owner); // Deletes an input context owned by the |owner| component. bool DeleteInputContext(Component* owner, uint32 icid); // Converts a given |message| object into a reply message with an error // payload and sends it to the |connector| object directly. bool ReplyError(Connector* connector, proto::Message* message, proto::Error::Code error_code); // Converts a given |message| object into a reply message with a boolean value // as payload and sends it to the |connector| object directly. bool ReplyBoolean(Connector* connector, proto::Message* message, bool value); bool ReplyTrue(Connector* connector, proto::Message* message) { return ReplyBoolean(connector, message, true); } bool ReplyFalse(Connector* connector, proto::Message* message) { return ReplyBoolean(connector, message, false); } // Attaches the |component| object to the |input_context| object with // specified |state| and |persistent| mode. bool AttachToInputContext(Component* component, InputContext* input_context, InputContext::AttachState state, bool persistent); // Tries to attach a component to an input context with a desired state. // If the component can consume MSG_ATTACH_TO_INPUT_CONTEXT message, then // it'll be attached with an appropriate pending state and a message will // be sent to it. The component will be actually attached when we receive // its reply message. Otherwise, the component will only be attached to the // input context if |allow_implicit_attach| is true. // The |state| can only be PASSIVE or ACTIVE. // The actual attach state will be returned. NOT_ATTACHED will be returned on // error. InputContext::AttachState RequestAttachToInputContext( Component* component, InputContext* input_context, InputContext::AttachState state, bool allow_implicit_attach); // Focuses a specified input context. bool FocusInputContext(uint32 icid); // Blur a specified input context. The input context must be the current // focused one. bool BlurInputContext(uint32 icid); // Checks if a component is valid or not. bool IsComponentValid(Component* component) const { return component && components_.count(component->id()) && connectors_.count(component->connector()); } // Checks if a component id is valid or not. bool IsComponentIDValid(uint32 id) const { return IsComponentValid(GetComponent(id)); } // A utility method for built-in components to check if the given message // needs reply. If the check fails, then this method will delete the // message and return false. Returns true if the check passed. // The built-in component calling this method should always return true to // Hub indicating that it has handled the message, despite of this method's // return value. bool CheckMsgNeedReply(Component* source, proto::Message* message); // A utility method for built-in components to check if icid of the given // message is valid. If the check fails, then this method will reply an error // message to source if necessary and delete the message and return false. // Returns true if the check passed. // The built-in component calling this method should always return true to // Hub indicating that it has handled the message, despite of this method's // return value. bool CheckMsgInputContext(Component* source, proto::Message* message); // A utility method for built-in components to check if icid of the given // message is valid and if the source component is really attached to the IC. // If any of these two checks fails, then this method will reply an error // message to source if necessary and delete the message and return false. // Returns true if all checks passed. // The built-in component calling this method should always return true to // Hub indicating that it has handled the message, despite of this method's // return value. bool CheckMsgInputContextAndSourceAttached(Component* source, proto::Message* message); private: friend class HubImplTestBase; // Implementation of Hub::Connector interface for the special Hub component, // whose component id is kComponentDefault. virtual bool Send(proto::Message* message) OVERRIDE; // Implementation of InputContext::Delegate interface virtual void OnComponentActivated(InputContext* input_context, Component* component, const MessageTypeVector& messages) OVERRIDE; virtual void OnComponentDeactivated( InputContext* input_context, Component* component, const MessageTypeVector& messages) OVERRIDE; virtual void OnComponentDetached( InputContext* input_context, Component* component, InputContext::AttachState state) OVERRIDE; virtual void OnActiveConsumerChanged( InputContext* input_context, const MessageTypeVector& messages) OVERRIDE; virtual void MaybeDetachComponent( InputContext* input_context, Component* component) OVERRIDE; virtual void RequestConsumer( InputContext* input_context, const MessageTypeVector& messages, Component* exclude) OVERRIDE; // Allocates a unique component id. uint32 AllocateComponentID(); // Allocates a unique input context id. uint32 AllocateInputContextID(); // For testing purpose. bool IsConnectorAttached(Connector* connector) const { return connector && connectors_.count(connector); } bool RegisterComponents(Connector* connector, proto::Message* message); bool DeregisterComponents(Connector* connector, proto::Message* message); // Handles MSG_ATTACH_TO_INPUT_CONTEXT messages' reply messages. bool OnMsgAttachToInputContextReply(Component* source, proto::Message* message); bool OnMsgQueryComponent(Component* source, proto::Message* message); // TODO(suzhe): // MSG_SET_COMMAND_LIST, // MSG_CLEAR_COMMAND_LIST, // MSG_UPDATE_COMMANDS, // MSG_QUERY_COMMAND_LIST, // Dispatches a message to the active consumer component attached to the // target input context. bool DispatchToActiveConsumer(Component* source, proto::Message* message); // Broadcasts a specified message. The message will be deleted by this method. // Returns false if any error occurs. The message won't be sent to the // |exclude_component|. bool BroadcastMessage(proto::Message* message, uint32 exclude_component); bool BroadcastMessage(proto::Message* message) { return BroadcastMessage(message, kComponentDefault); } // Helper functions static proto::Message* NewMessage(uint32 type, uint32 target, uint32 icid); static bool CanComponentProduce(const Component* component, const proto::Message* message); static bool CanComponentConsume(const Component* component, const proto::Message* message); // Counter for generating unique component id. uint32 component_counter_; // Counter for generating unique input context id. uint32 input_context_counter_; // Id of current focused input context. kInputContextNone means no input // context is focused. uint32 focused_input_context_; typedef std::map<uint32, Component*> ComponentMap; // Component id -> Component object map. ComponentMap components_; typedef std::map<std::string, Component*> ComponentStringIDMap; // Component string id -> Component object map. ComponentStringIDMap components_by_string_id_; typedef std::map<uint32, InputContext*> InputContextMap; // Input context id -> InputContext object map. InputContextMap input_contexts_; typedef std::map<Connector*, std::set<uint32> > ConnectorMap; // Connector pointer -> component ids owned by it. ConnectorMap connectors_; // The special Component object representing the Hub itself. Component* hub_component_; // The special InputContext object represending kInputContextNone. InputContext* hub_input_context_; // A built-in component for handling input context related messages. scoped_ptr<HubInputContextManager> input_context_manager_; // A built-in component for managing input method components. scoped_ptr<HubInputMethodManager> input_method_manager_; // A built-in component for handling hotkey related messages. scoped_ptr<HubHotkeyManager> hotkey_manager_; // A built-in component for handling command list related messages. scoped_ptr<HubCommandListManager> command_list_manager_; // A built-in component for handling composition text and candidate list // related messages. scoped_ptr<HubCompositionManager> composition_manager_; DISALLOW_COPY_AND_ASSIGN(HubImpl); }; } // namespace hub } // namespace ipc #endif // GOOPY_IPC_HUB_IMPL_H_
36.485714
80
0.733203
[ "object", "vector" ]
d55970945ffd001aa3e4d469c31bbcf5ddcc4e80
20,049
h
C
tropter/tropter/optimalcontrol/Problem.h
chrisdembia/opensim-moco
ff67eaeae4d3f1a02d3a0dec78347a70802692d7
[ "Apache-2.0" ]
2
2020-05-16T11:13:13.000Z
2020-11-17T09:20:39.000Z
tropter/tropter/optimalcontrol/Problem.h
chrisdembia/opensim-moco
ff67eaeae4d3f1a02d3a0dec78347a70802692d7
[ "Apache-2.0" ]
null
null
null
tropter/tropter/optimalcontrol/Problem.h
chrisdembia/opensim-moco
ff67eaeae4d3f1a02d3a0dec78347a70802692d7
[ "Apache-2.0" ]
1
2020-07-23T22:24:26.000Z
2020-07-23T22:24:26.000Z
#ifndef TROPTER_OPTIMALCONTROL_PROBLEM_H #define TROPTER_OPTIMALCONTROL_PROBLEM_H // ---------------------------------------------------------------------------- // tropter: Problem.h // ---------------------------------------------------------------------------- // Copyright (c) 2017 tropter authors // // 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 "Iterate.h" #include <tropter/common.h> #include <Eigen/Dense> namespace tropter { /// @ingroup optimalcontrol struct Bounds { Bounds() = default; Bounds(double value) : lower(value), upper(value) {} // TODO check here that lower <= upper. Bounds(double lower_bound, double upper_bound); bool is_set() const { return !std::isnan(lower) && !std::isnan(upper); } // TODO create nicer name for NaN; double lower = std::numeric_limits<double>::quiet_NaN(); double upper = std::numeric_limits<double>::quiet_NaN(); }; /// @ingroup optimalcontrol struct InitialBounds : public Bounds { using Bounds::Bounds; }; /// @ingroup optimalcontrol struct FinalBounds : public Bounds { using Bounds::Bounds; }; /// This struct holds inputs to /// OptimalControlProblem::calc_differntial_algebraic_equations() and /// OptimalControlProblem::calc_integral_cost(). /// @ingroup optimalcontrol template<typename T> struct Input { /// This index may be helpful for using a cache computed in /// OptimalControlProblem::initialize_on_mesh(). const int mesh_index; /// The current time for the provided states and controls. const T& time; /// The vector of states at time `time`. This stores a reference to an /// Eigen matrix, thereby avoiding copying the memory. /// @note If you pass this reference into multiple functions that take an /// Eigen Vector as input, this could create multiple copies unnecessarily; /// in this case, create one copy and pass that to the other functions: /// @code{.cpp} /// const tropter::VectorX<T> states = input.states; /// calc_something(states); /// calc_something_else(states); /// @endcode const Eigen::Ref<const VectorX<T>>& states; /// The vector of controls at time `time`. /// @note If you pass this into functions that take an Eigen Vector as /// input, see the note above for the `states` variable. const Eigen::Ref<const VectorX<T>>& controls; /// The vector of adjuncts at time `time`. /// @note If you pass this into functions that take an Eigen Vector as /// input, see the note above for the `states` variable. const Eigen::Ref<const VectorX<T>>& adjuncts; /// The vector of time-invariant parameter values. /// @note If you pass this into functions that take an Eigen Vector as /// input, see the note above for the `states` variable. const Eigen::Ref<const VectorX<T>>& parameters; }; /// This struct holds the outputs of /// OptimalControlProblem::calc_differntial_algebraic_equations(). /// @ingroup optimalcontrol template<typename T> struct Output { /// Store the right-hand-side of the differential equations in this /// variable. The length of this vector is num_states. /// This is a reference to memory that is managed by the direct /// collocation solver. If you want to create a shorter variable name, /// you could do something like this: /// @code{.cpp} /// auto& xdot = output.dynamics; /// @endcode /// Do *not* copy this variable into a new Eigen Vector; the direct /// collocation solver will not be able to obtain your output. /// @code{.cpp} /// tropter::VectorX<T> xdot = output.dynamics; /// @endcode Eigen::Ref<VectorX<T>> dynamics; /// Store the path constraint errors in this variable. The length of this /// vector is num_path_constraints. See the notes above about using this /// reference. Eigen::Ref<VectorX<T>> path; }; /// We use the following terms to describe an optimal control problem: /// - *state*: a single state variable. /// - *states*: a vector of all state variables at a given time. /// - *states trajectory*: a trajectory through time of states (state vectors). /// - *control*: a single control variable. /// - *controls*: a vector of all control variables at a given time. /// - *controls trajectory*: a trajectory through time of controls /// (control vectors). /// - *adjunct*: a single supplemental continuous variable. /// - *adjuncts*: a vector of all adjunct varialbes at a given time. /// - *adjuncts trajectory*: a trajectory through time of adjuncts /// (adjunct vectors). /// - *parameter*: a single parameter variable. /// - *parameters*: a vector of all parameter variables. /// @ingroup optimalcontrol template <typename T> class Problem { private: struct ContinuousVariableInfo { ContinuousVariableInfo(std::string, Bounds, InitialBounds, FinalBounds); std::string name; Bounds bounds; InitialBounds initial_bounds; FinalBounds final_bounds; }; struct PathConstraintInfo { std::string name; Bounds bounds; }; struct ParameterInfo { std::string name; Bounds bounds; }; public: Problem() = default; Problem(const std::string& name) : m_name(name) {} virtual ~Problem() = default; /// @name Get information about the problem /// @{ int get_num_states() const { return (int)m_state_infos.size(); } int get_num_controls() const { return (int)m_control_infos.size(); } int get_num_adjuncts() const { return (int)m_adjunct_infos.size(); } int get_num_parameters() const { return (int)m_parameter_infos.size(); } int get_num_path_constraints() const { return (int)m_path_constraint_infos.size(); } /// Get the names of all the states in the order they appear in the /// `states` input to calc_differential_algebraic_equations(), etc. /// Note: this function is not free to call. std::vector<std::string> get_state_names() const { std::vector<std::string> names; for (const auto& info : m_state_infos) { names.push_back(info.name); } return names; } /// Get the names of all the controls in the order they appear in /// the `controls` input to calc_differential_algebraic_equations(), etc. /// Note: this function is not free to call. std::vector<std::string> get_control_names() const { std::vector<std::string> names; for (const auto& info : m_control_infos) { names.push_back(info.name); } return names; } /// Get the names of all the adjuncts in the order they appear in the /// `adjuncts` input to calc_differential_algebraic_equations(), etc. /// Note: this function is not free to call. std::vector<std::string> get_adjunct_names() const { std::vector<std::string> names; for (const auto& info : m_adjunct_infos) { names.push_back(info.name); } return names; } /// Get the names of all the parameters in the order they appear in /// the `parameters` input to calc_differential_algebraic_equations(), etc. /// Note: this function is not free to call. std::vector<std::string> get_parameter_names() const { std::vector<std::string> names; for (const auto& info : m_parameter_infos) { names.push_back(info.name); } return names; } /// Get the names of all the path constraints in the order they appear in /// the 'path' output to calc_differential_algebraic_equations(), etc. /// Note: this function is not free to call. std::vector<std::string> get_path_constraint_names() const { std::vector<std::string> names; for (const auto& info : m_path_constraint_infos) { names.push_back(info.name); } return names; } /// Print (to std::cout) the number, names, and bounds of the states, /// controls, and path constraints. void print_description() const; /// @} /// @name Assemble the problem /// @{ void set_time(const InitialBounds& initial_time, const FinalBounds& final_time); /// This returns an index that can be used to access this specific state /// variable within `dynamics()`, `path_constraints()`, etc. /// TODO check if a state with the provided name already exists. int add_state(const std::string& name, const Bounds& bounds, const InitialBounds& initial_bounds = InitialBounds(), const FinalBounds& final_bounds = FinalBounds()) { m_state_infos.push_back({name, bounds, initial_bounds, final_bounds}); return (int)m_state_infos.size() - 1; } /// This returns an index that can be used to access this specific control /// variable within `dynamics()` , `path_constraints()`, etc. /// TODO check if a control with the provided name already exists. // TODO no initial, final bounds for controls. int add_control(const std::string& name, const Bounds& bounds, const InitialBounds& initial_bounds = InitialBounds(), const FinalBounds& final_bounds = FinalBounds()) { // TODO proper handling of bounds: if initial_bounds is omitted, // then its values come from bounds. // TODO want to avoid adding unnecessary constraints to the optimization // problem if initial/final bounds are omitted. Use the Bounds' // objects' "is_set()" function. m_control_infos.push_back({name, bounds, initial_bounds, final_bounds}); return (int)m_control_infos.size() - 1; } /// This returns an index that can be used to access this specific adjunct /// variable within `dynamics()`, `path_constraints()`, etc. /// TODO check if an adjunct with the provided name already exists. int add_adjunct(const std::string& name, const Bounds& bounds, const InitialBounds& initial_bounds = InitialBounds(), const FinalBounds& final_bounds = FinalBounds()) { m_adjunct_infos.push_back({name, bounds, initial_bounds, final_bounds}); return (int)m_adjunct_infos.size() - 1; } /// This returns an index that can be used to access this specific parameter /// variable within `dynamics()` , `path_constraints()`, etc. /// TODO check if a parameter with the provided name already exists. int add_parameter(const std::string& name, const Bounds& bounds) { m_parameter_infos.push_back({name, bounds}); return (int)m_parameter_infos.size() - 1; } /// This returns an index that can be used to access this specific path /// constraint element within `path_constraints()`. /// TODO check if a path constraint with the provided name already exists. int add_path_constraint(const std::string& name, const Bounds& bounds) { m_path_constraint_infos.push_back({name, bounds}); return (int)m_path_constraint_infos.size() - 1; } /// @} /// @name Implement these functions /// These are the virtual functions you implement to define your optimal /// control problem. /// @{ /// Perform any precalculations or caching (e.g., interpolating data) /// necessary before the optimal control problem is solved. This is /// invoked every time there's a new mesh (e.g., in each mesh refinement /// iteration). Implementing this function probably only makes sense if /// your problem has fixed initial and final times. /// To perform any caching in member variables, you have to use *mutable* /// member variables or a const_cast: /// @code{.cpp} /// const_cast<MyOCP*>(this)->data = ...; /// @endcode /// @param mesh The length of mesh is the number of mesh points. The mesh /// points are normalized and are thus within [0, 1]. virtual void initialize_on_mesh(const Eigen::VectorXd& mesh) const; /// This function is invoked every time there is a new iterate (perhaps /// multiple times), and allows you to perform any initialization or caching /// based on the constant parameter values from the iterate, in case this is /// expensive. Implementing this function is optional, even if your problem /// has parameters. virtual void initialize_on_iterate(const VectorX<T>& parameters) const; /// Compute the right-hand side of the differntial algebraic equations /// (DAE) for the system you want to optimize. This is the function that /// provides the dynamics and path constraints. /// The initial values in `derivatives` and `constraints` are arbitrary and /// cannot be assumed to be 0, etc. You must set entries to 0 explicitly if /// you want that. virtual void calc_differential_algebraic_equations( const Input<T>& in, Output<T> out) const; // TODO alternate form that takes a matrix; state at every time. //virtual void continuous(const MatrixX<T>& x, MatrixX<T>& xdot) const = 0; // TODO Maybe this one signature could be used for both the "continuous, // entire trajectory" mode or the "one time" mode. // var.states[0]; // var.states_traj // var.controls[0]; // out.derivatives[0] = // out.constraints[0] = ... //} // TODO endpoint or terminal cost? virtual void calc_endpoint_cost(const T& final_time, const VectorX<T>& final_states, const VectorX<T>& parameters, T& cost) const; virtual void calc_integral_cost(const Input<T>& in, T& integrand) const; /// @} /// @name Helpers for setting an initial guess /// @{ /// Set a guess for the trajectory of a single state variable with name /// `name` to `value`. This function relieves you of the need to know the /// index of a state variable. The `guess` must already have its `time` /// vector filled out. If `guess.states` is empty, this function will set /// its dimensions appropriately according to the provided `guess.time`; /// otherwise, `guess.states` must have the correct dimensions (number of /// states x mesh points). /// @param[in,out] guess /// The row of the states matrix associated with the provided name /// is set to value. /// @param[in] name /// Name of the state variable (provided in add_state()). /// @param[in] value /// This must have the same number of columns as `guess.time` and /// `guess.states`. void set_state_guess(Iterate& guess, const std::string& name, const Eigen::VectorXd& value); /// Set a guess for the trajectory of a single control variable with name /// `name` to `value`. This function relieves you of the need to know the /// index of a control variable. The `guess` must already have its `time` /// vector filled out. If `guess.controls` is empty, this function will set /// its dimensions appropriately according to the provided `guess.time`; /// otherwise, `guess.controls` must have the correct dimensions (number of /// controls x mesh points). /// @param[in,out] guess /// The row of the controls matrix associated with the provided name /// is set to value. /// @param[in] name /// Name of the control variable (provided in add_control()). /// @param[in] value /// This must have the same number of columns as `guess.time` and /// `guess.controls`. void set_control_guess(Iterate& guess, const std::string& name, const Eigen::VectorXd& value); /// Set a guess for the trajectory of a single adjunct variable with name /// `name` to `value`. This function relieves you of the need to know the /// index of a adjunct variable. The `guess` must already have its `time` /// vector filled out. If `guess.adjuncts` is empty, this function will set /// its dimensions appropriately according to the provided `guess.time`; /// otherwise, `guess.adjuncts` must have the correct dimensions (number of /// adjuncts x mesh points). /// @param[in,out] guess /// The row of the adjuncts matrix associated with the provided name /// is set to value. /// @param[in] name /// Name of the adjunct variable (provided in add_adjunct()). /// @param[in] value /// This must have the same number of columns as `guess.time` and /// `guess.adjuncts`. void set_adjunct_guess(Iterate& guess, const std::string& name, const Eigen::VectorXd& value); /// Set a guess for the value of a single parameter variable with name /// `name` to `value`. This function relieves you of the need to know the /// index of a parameter variable. /// @param[in,out] guess /// The element of the parameters vector associated with the provided /// name is set to value. /// @param[in] name /// Name of the parameter variable (provided in add_parameter()). /// @param[in] value /// This value is time-invariant in the iterate `guess`. void set_parameter_guess(Iterate& guess, const std::string& name, const double& value); /// @} // TODO move to "getter" portion. /// @name For use by direct collocation solver /// @{ /// This function provides the bounds on time, states, and controls in a /// format that is easy for the direct collocation classes to use. void get_all_bounds( double& initial_time_lower, double& initial_time_upper, double& final_time_lower, double& final_time_upper, Eigen::Ref<Eigen::VectorXd> states_lower, Eigen::Ref<Eigen::VectorXd> states_upper, Eigen::Ref<Eigen::VectorXd> initial_states_lower, Eigen::Ref<Eigen::VectorXd> initial_states_upper, Eigen::Ref<Eigen::VectorXd> final_states_lower, Eigen::Ref<Eigen::VectorXd> final_states_upper, Eigen::Ref<Eigen::VectorXd> controls_lower, Eigen::Ref<Eigen::VectorXd> controls_upper, Eigen::Ref<Eigen::VectorXd> initial_controls_lower, Eigen::Ref<Eigen::VectorXd> initial_controls_upper, Eigen::Ref<Eigen::VectorXd> final_controls_lower, Eigen::Ref<Eigen::VectorXd> final_controls_upper, Eigen::Ref<Eigen::VectorXd> adjuncts_lower, Eigen::Ref<Eigen::VectorXd> adjuncts_upper, Eigen::Ref<Eigen::VectorXd> initial_adjuncts_lower, Eigen::Ref<Eigen::VectorXd> initial_adjuncts_upper, Eigen::Ref<Eigen::VectorXd> final_adjuncts_lower, Eigen::Ref<Eigen::VectorXd> final_adjuncts_upper, Eigen::Ref<Eigen::VectorXd> parameters_lower, Eigen::Ref<Eigen::VectorXd> parameters_upper, Eigen::Ref<Eigen::VectorXd> path_constraints_lower, Eigen::Ref<Eigen::VectorXd> path_constraints_upper) const; /// @} private: std::string m_name = "<unnamed>"; InitialBounds m_initial_time_bounds; FinalBounds m_final_time_bounds; std::vector<ContinuousVariableInfo> m_state_infos; std::vector<ContinuousVariableInfo> m_control_infos; std::vector<ContinuousVariableInfo> m_adjunct_infos; std::vector<ParameterInfo> m_parameter_infos; std::vector<PathConstraintInfo> m_path_constraint_infos; }; } // namespace tropter #endif // TROPTER_OPTIMALCONTROL_PROBLEM_H
45.773973
80
0.658537
[ "mesh", "vector" ]
d562de9be611a806fccfcc3c95af8e1874f1a276
4,334
h
C
dingus/tools/AtlasCreationToolFork/Packer.h
aras-p/dingus
22ef90c2bf01afd53c0b5b045f4dd0b59fe83009
[ "MIT" ]
17
2016-06-14T20:56:58.000Z
2021-11-15T10:14:16.000Z
dingus/tools/AtlasCreationToolFork/Packer.h
aras-p/dingus
22ef90c2bf01afd53c0b5b045f4dd0b59fe83009
[ "MIT" ]
null
null
null
dingus/tools/AtlasCreationToolFork/Packer.h
aras-p/dingus
22ef90c2bf01afd53c0b5b045f4dd0b59fe83009
[ "MIT" ]
5
2016-06-14T20:56:59.000Z
2021-06-22T00:09:18.000Z
//----------------------------------------------------------------------------- // Copyright NVIDIA Corporation 2004 // TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED // *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS // OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL // NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR // CONSEQUENTIAL DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR // LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS // INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR // INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE // POSSIBILITY OF SUCH DAMAGES. // // File: Packer.h // Desc: Header file Packer class //----------------------------------------------------------------------------- #ifndef PACKER_H #define PACKER_H #include <d3dx9.h> #include "TATypes.h" class CmdLineOptionCollection; class Texture2D; class Atlas2D; class AtlasVolume; //----------------------------------------------------------------------------- // Name: Region // Desc: Simple calss representing a rectangle. It knows how to intersect // against other such rectangles. // This class is used to store dirty (used) rectangles representing // areas in a texture that valid data has been copied into. // A collection of these thus shows which texels are not // available for storing new information (and thus which texels // *are* available). //----------------------------------------------------------------------------- class Region { public: Region(); ~Region(); long GetWidth() const; long GetHeight() const; bool Intersect(Region const &region) const; public: long mLeft; long mRight; long mTop; long mBottom; }; //----------------------------------------------------------------------------- // Name: Packer // Desc: Pure virtual base class for Packer objects. For example, a Packer2D // object knows how to insert new 2D textures into a 2D atlas. // The base class defines the common entry points and some house-keeping // data //----------------------------------------------------------------------------- class Packer { public: Packer(); ~Packer(); virtual bool Insert(Texture2D *pTexture) = 0; int GetMaxMipLevels() const; protected: int SizeOfTexel (D3DFORMAT format) const; bool IsDXTnFormat(D3DFORMAT format) const; protected: int mTotalFreeTexels; int mMaxNumberMipLevels; }; //----------------------------------------------------------------------------- // Name: Packer2D // Desc: Derived class that knows how to deal with Atlas2D objects, // specifically how to insert Texture2D objects into Atlas2D objects //----------------------------------------------------------------------------- class Packer2D : public Packer { public: Packer2D(Atlas2D * pAtlas); ~Packer2D(); virtual bool Insert(Texture2D *pTexture); Region const * Intersects(Region const &region) const; void CopyBits(Region const &test, IDirect3DTexture9 *pTexture); private: void Merge(Region * pNewRegion); private: Atlas2D * mpAtlas; std::vector<Region *> mUsedRegions; }; //----------------------------------------------------------------------------- // Name: PackerVolume // Desc: Derived class that knows how to deal with AtlasVolume objects, // specifically how to insert Texture2D objects into AtlasVolume objects //----------------------------------------------------------------------------- class PackerVolume : public Packer { public: PackerVolume(AtlasVolume * pAtlas); ~PackerVolume(); virtual bool Insert(Texture2D *pTexture); void CopyBits(IDirect3DTexture9 *pTexture); void CopyBits(IDirect3DVolumeTexture9 *pVolumeTexture); int GetSlicesUsed() const; private: AtlasVolume *mpAtlas; int mSlicesUsed; }; #endif // PACKER_H
33.083969
81
0.548454
[ "object", "vector" ]
d577d09ebf5579fed403a5335f624d848408f3ed
6,787
h
C
radix/CBManager/CBManager.h
hairlun/radix-ios
7eba628ee3922c18e6f262f8af080b716f242549
[ "Apache-2.0" ]
null
null
null
radix/CBManager/CBManager.h
hairlun/radix-ios
7eba628ee3922c18e6f262f8af080b716f242549
[ "Apache-2.0" ]
null
null
null
radix/CBManager/CBManager.h
hairlun/radix-ios
7eba628ee3922c18e6f262f8af080b716f242549
[ "Apache-2.0" ]
null
null
null
#import <Foundation/Foundation.h> #import <CoreBluetooth/CoreBluetooth.h> #import "Constants.h" #import "LoggerHandler.h" #import "ResourceHandler.h" #import "Utilities.h" /*! * @property CBDiscoveryDelegate * * @discussion The delegate object that will receive events which use for UI updation. * */ @protocol cbDiscoveryManagerDelegate <NSObject> /*! * @method discoveryDidRefresh * * @discussion This method invoke after a new peripheral found. */ - (void) discoveryDidRefresh; /*! * @method bluetoothStateUpdatedToState: * * @discussion This will be invoked when the Bluetooth state changes. */ - (void) bluetoothStateUpdatedToState:(BOOL)state; @end @protocol cbCharacteristicManagerDelegate <NSObject> @optional /*! * @method peripheral:didDiscoverCharacteristicsForService:error: * * @param peripheral The peripheral providing this information. * @param service The <code>CBService</code> object containing the characteristic(s). * @param error If an error occurred, the cause of the failure. * * @discussion This method returns the result of a @link discoverCharacteristics:forService: @/link call. If the characteristic(s) were read successfully, * they can be retrieved via <i>service</i>'s <code>characteristics</code> property. */ - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error; /*! * @method peripheral:didUpdateValueForCharacteristic:error: * * @param peripheral The peripheral providing this information. * @param characteristic A <code>CBCharacteristic</code> object. * @param error If an error occurred, the cause of the failure. * * @discussion This method is invoked after a @link readValueForCharacteristic: @/link call, or upon receipt of a notification/indication. */ - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; /*! * @method peripheral:didWriteValueForCharacteristic:error: * * @param peripheral The peripheral providing this information. * @param characteristic A <code>CBCharacteristic</code> object. * @param error If an error occurred, the cause of the failure. * * @discussion This method returns the result of a {@link writeValue:forCharacteristic:type:} call, when the <code>CBCharacteristicWriteWithResponse</code> type is used. */ - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; /*! * @method peripheral:didUpdateNotificationStateForCharacteristic:error: * * @param peripheral The peripheral providing this information. * @param characteristic A <code>CBCharacteristic</code> object. * @param error If an error occurred, the cause of the failure. * * @discussion This method returns the result of a @link setNotifyValue:forCharacteristic: @/link call. */ - (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; /*! * @method peripheral:didDiscoverDescriptorsForCharacteristic:error: * * @param peripheral The peripheral providing this information. * @param characteristic A <code>CBCharacteristic</code> object. * @param error If an error occurred, the cause of the failure. * * @discussion This method returns the result of a @link discoverDescriptorsForCharacteristic: @/link call. If the descriptors were read successfully, * they can be retrieved via <i>characteristic</i>'s <code>descriptors</code> property. */ - (void)peripheral:(CBPeripheral *)peripheral didDiscoverDescriptorsForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; /*! * @method peripheral:didUpdateValueForDescriptor:error: * * @param peripheral The peripheral providing this information. * @param descriptor A <code>CBDescriptor</code> object. * @param error If an error occurred, the cause of the failure. * * @discussion This method returns the result of a @link readValueForDescriptor: @/link call. */ -(void)peripheral:(CBPeripheral *)peripheral didUpdateValueForDescriptor:(CBDescriptor *)descriptor error:(NSError *)error; @end @interface CBManager : NSObject { } @property (strong,nonatomic) id<cbCharacteristicManagerDelegate> cbCharacteristicDelegate; @property (nonatomic, assign) id<cbDiscoveryManagerDelegate> cbDiscoveryDelegate; /*! * @property myPeripheral * * @discussion Current Connected Peripheral. * */ @property (nonatomic, retain)CBPeripheral *myPeripheral; /*! * @property myService * * @discussion The selected Service. * */ @property (nonatomic, retain)CBService *myService; /*! * @property myCharacteristic * * @discussion The selected Characteristic. * */ @property (nonatomic, retain)CBCharacteristic *myCharacteristic; /*! * @property myCharacteristic2 * * @discussion Is just for USR Debug Mode. * */ @property (nonatomic,retain)CBCharacteristic *myCharacteristic2; /*! * @property foundPeripherals * * @discussion All discovered peripherals while scanning. * */ @property (retain, nonatomic) NSMutableArray *foundPeripherals; /*! * @property foundServices * * @discussion All available services of connected peripheral.. * */ @property (retain, nonatomic) NSMutableArray *foundServices; /*! * @property serviceUUIDDict * * @discussion Dictionary contains all listed Known services from pList (ServiceUUIDPlist). * */ @property (retain, nonatomic) NSMutableDictionary *serviceUUIDDict; /*! * @property characteristicProperties * * @discussion Properties of characteristic . * */ @property (retain,nonatomic) NSMutableArray *characteristicProperties; /*! * @property characteristicDescriptors * * @discussion Descriptors of characteristic . * */ @property (retain,nonatomic) NSArray *characteristicDescriptors; /*! * @property bootLoaderFilesArray * * @discussion Firmware files selected for device upgrade. * */ @property (retain, nonatomic) NSArray *bootLoaderFilesArray; + (id)sharedManager; /* Actions */ /****************************************************************************/ - (void) startScanning; - (void) stopScanning; - (void) refreshPeripherals; - (void) connectPeripheral:(CBPeripheral*)peripheral CompletionBlock:(void (^)(BOOL success, NSError *error))completionHandler; - (void) disconnectPeripheral:(CBPeripheral*)peripheral; @end
31.714953
174
0.714896
[ "object" ]
d5781f6382fd7bf992f2147f08c0a7155750bfda
2,327
h
C
include/Cubism/Util/Histogram.h
cselab/CubismNova
cbd6876ae9b5864f82f3470b564132c92e0f2e00
[ "BSD-2-Clause" ]
9
2020-01-27T01:17:19.000Z
2022-02-26T12:20:17.000Z
include/Cubism/Util/Histogram.h
cselab/CubismNova
cbd6876ae9b5864f82f3470b564132c92e0f2e00
[ "BSD-2-Clause" ]
null
null
null
include/Cubism/Util/Histogram.h
cselab/CubismNova
cbd6876ae9b5864f82f3470b564132c92e0f2e00
[ "BSD-2-Clause" ]
1
2021-04-01T07:48:39.000Z
2021-04-01T07:48:39.000Z
// File : Histogram.h // Created : Mon Dec 23 2019 10:57:51 AM (+0100) // Author : Fabian Wermelinger // Description: Histogram profiling on given MPI communicator // Copyright 2019 ETH Zurich. All Rights Reserved. #ifndef HISTOGRAM_H_6SPETKCI #define HISTOGRAM_H_6SPETKCI #include "Cubism/Common.h" #include "Cubism/Util/Sampler.h" #include <mpi.h> #include <string> NAMESPACE_BEGIN(Cubism) /** * @addtogroup Util * @{ */ /** @brief Namespace for input/output operations * * @rst * The members of this namespace are optional utilities that are not required to * implement a working application. Its components form the content of * ``libCubismUtil.a``. An application using these utilities must link to * ``-lCubismUtil``. * @endrst */ NAMESPACE_BEGIN(Util) /** * @ingroup Util MPI * @brief MPI profiling using histograms * * Collects samples for a profiled quantity of interest on individual ranks. * Can be used to detect inhomogeneities among MPI ranks.*/ class Histogram : public Sampler { public: /** * @brief Main histogram constructor * @param comm MPI communicator used for the profiling * @param name Name of the histogram * @param active Activator switch * * @rst * Extends the :ref:`sampler` class with MPI consolidation during * destruction of the object. The consolidation generates a binary file * that can be post-processed using the :ref:`histbin` tool. The activator * switch can be used to disable sample collection for large scale runs. * The size of the binary files can become large depending on the number of * ranks involved and the number of different quantities that are being * sampled. * @endrst */ Histogram(const MPI_Comm comm, const std::string &name, const bool active = true) : Sampler(active), comm_(comm), name_(name) { } ~Histogram() { if (active_) { consolidate_(); } } Histogram(const Histogram &c) = delete; Histogram &operator=(const Histogram &c) = delete; private: const MPI_Comm comm_; const std::string name_; void consolidate_(); void homogenizeCollection_(); }; NAMESPACE_END(Util) /** @} */ NAMESPACE_END(Cubism) #endif /* HISTOGRAM_H_6SPETKCI */
27.702381
80
0.675978
[ "object" ]
d58043472fe75af42d2de4fed19d917ec70dbd54
911
h
C
src/core/world/objects/ObjectManager.h
Kubaaa96/IdleRomanEmpire
c41365babaccd309dd78e953a333b39d8045913a
[ "MIT" ]
null
null
null
src/core/world/objects/ObjectManager.h
Kubaaa96/IdleRomanEmpire
c41365babaccd309dd78e953a333b39d8045913a
[ "MIT" ]
29
2020-10-21T07:34:55.000Z
2021-01-12T15:15:53.000Z
src/core/world/objects/ObjectManager.h
Kubaaa96/IdleRomanEmpire
c41365babaccd309dd78e953a333b39d8045913a
[ "MIT" ]
1
2020-10-19T19:30:40.000Z
2020-10-19T19:30:40.000Z
#ifndef IRE_OBJECT_MANAGER_H #define IRE_OBJECT_MANAGER_H #include <vector> #include "Building.h" namespace ire::core::world::objects { struct ObjectManager { ObjectManager(); void appendBuildingsToVector(std::unique_ptr<Building> building); std::vector<core::world::TileOverlay> getOverlayVector(sf::Vector2i mousePosition); const bool isEmpty() const; void setPlanning(bool isPlanning); const bool isPlanning() const; void setSelectedBuilding(Building* selectedBuilding); Building* getSelectedBuilding(); void setCanBePlaced(bool canBePlaced); const bool canBePlaced() const; protected: bool m_isPlanning = false; bool m_canBePlaced = true; Building* m_selectedBuilding = nullptr; std::vector<std::unique_ptr<Building>> m_buildings; }; } #endif //!IRE_OBJECT_MANAGER_H
23.358974
91
0.681668
[ "vector" ]
d58129cc23c53aa8f884c8f07134bc4930e3ec54
2,199
h
C
include/OnePoint.PROM/IGroupRelationshipFactoryBase.h
OnePointGlobal/MySurvey-2.0-App_New
02368bee4a3b5b9e07f95d586c02c20880e35a4b
[ "MIT" ]
null
null
null
include/OnePoint.PROM/IGroupRelationshipFactoryBase.h
OnePointGlobal/MySurvey-2.0-App_New
02368bee4a3b5b9e07f95d586c02c20880e35a4b
[ "MIT" ]
12
2019-10-14T10:29:55.000Z
2020-04-23T10:52:13.000Z
include/OnePoint.PROM/IGroupRelationshipFactoryBase.h
OnePointGlobal/OnePoint-Global-MySurvey-2.0-App-iOS-Latest
02368bee4a3b5b9e07f95d586c02c20880e35a4b
[ "MIT" ]
1
2022-03-17T08:46:39.000Z
2022-03-17T08:46:39.000Z
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="IGroupRelationship" company="OnePoint Global"> // Copyright (c) 2012 OnePoint Global Ltd. All rights reserved. // </copyright> // <summary> // This file was autogenerated and you should not edit it. It will be // regenerated whenever the schema changes. // All changes should be made in GroupRelationship.cs and the mode.xml. // </summary> // -------------------------------------------------------------------------------------------------------------------- /// <summary> /// The IGroupRelationship Interface Data Object Base /// </summary> #import <Foundation/Foundation.h> /// <summary> /// The IGroupRelationshipFactoryBase Interface Data Object Base /// </summary> @protocol IGroupRelationshipFactoryBase <NSObject> -(NSString *) SelectAllStatement; -(NSString *)TableName; -(NSString *)ByPkClause; -(NSString *)InsertStatement; -(NSString *)UpdateStatement; -(NSString *)DeleteStatement; -(NSString *)DeleteByPk; -(void) AddGroupRelationshipIDParameter:(DataHandler *) dataHandler withGroupRelationshipID:(NSNumber*) GroupRelationshipID; -(void) AddGroupIDParameter:(DataHandler *) dataHandler withGroupID:(NSNumber*) GroupID; -(void) AddIdentfierIDParameter:(DataHandler *) dataHandler withIdentfierID:(NSNumber*) IdentfierID; -(void) AddCreatedDateParameter:(DataHandler *) dataHandler withCreatedDate:(NSDate *) CreatedDate; -(void) AddLastUpdatedDateParameter:(DataHandler *) dataHandler withLastUpdatedDate:(NSDate *) LastUpdatedDate; -(id<IGroupRelationshipData>) FindByGroupRelationshipID:(NSNumber *) fieldValue; -(id<IGroupRelationshipData>) FindByGroupID:(NSNumber *) fieldValue; -(id<IGroupRelationshipData>) FindByIdentfierID:(NSNumber *) fieldValue; -(id<IGroupRelationshipData>) FindByCreatedDate:(NSDate *) fieldValue; -(id<IGroupRelationshipData>) FindByLastUpdatedDate:(NSDate *) fieldValue; -(id<IGroupRelationshipData>) CreateGroupRelationship:(id<IDataReader>)reader; @end
37.913793
130
0.644384
[ "object" ]
d590133a71e3b074f2a7892bac491d62fab68b0f
13,841
h
C
deps/src/gropt/incl/ProductManifold.h
pnavaro/ElasticFDA.jl
0ed8c3f483c3a62f4215a6b65894da34e77eefc1
[ "MIT" ]
7
2017-02-05T23:39:14.000Z
2021-06-03T06:41:47.000Z
deps/src/gropt/incl/ProductManifold.h
pnavaro/ElasticFDA.jl
0ed8c3f483c3a62f4215a6b65894da34e77eefc1
[ "MIT" ]
3
2016-08-31T20:48:32.000Z
2021-12-15T02:18:36.000Z
deps/src/gropt/incl/ProductManifold.h
pnavaro/ElasticFDA.jl
0ed8c3f483c3a62f4215a6b65894da34e77eefc1
[ "MIT" ]
6
2016-07-12T02:13:16.000Z
2020-09-22T17:42:16.000Z
/* This file defines the class for all the product of manifolds It defines the common properties and features of all the product of manifolds. Users can write their own product of manifolds by deriving from this class. Note that if a function requires some arguments can be the same, then users need to guarantee that the derived function also support this property. Manifold --> ProductManifold ---- WH */ #ifndef PRODUCTMANIFOLD_H #define PRODUCTMANIFOLD_H /*This is used to help to check whether there is a memory leakage or not.*/ #define CHECKMEMORY /*ProductVariable and ProductVector are just ProductElement*/ #define ProdVariable ProductElement #define ProdVector ProductElement #include "Manifold.h" #include "ProductElement.h" #include "EucVariable.h" #include "EucVector.h" #include <cstdarg> #include <map> #include "def.h" /*Define the namespace*/ namespace ROPTLIB{ class ProductManifold : public Manifold{ public: /*Constructor of ProductManifold. An example of using this constructor to generate St(2,3)^2 \times Euc(2) is: integer n = 3, p = 2, m = 2; integer numofmanis = 2; integer numofmani1 = 2; integer numofmani2 = 1; Stiefel mani1(n, p); Euclidean mani2(m); ProductManifold ProdMani(numofmanis, &mani1, numofmani1, &mani2, numofmani2); See examples in TestProduct.cpp and more in test files. */ ProductManifold(integer numberofmanifolds, ...); /*Constructor of ProductManifold An example of using this constructor to generate St(2,3)^2 \times Euc(2) is: integer n = 3, p = 2, m = 2; Stiefel mani1(n, p); Euclidean mani2(m); Manifold **inmanifolds = new Manifold* [2]; inmanifolds[0] = &mani1; inmanifolds[1] = &mani2; integer inpowsinterval = {0, 2, 3}; ProductManifold ProdMani(inmanifolds, 2, inpowsinterval, 3); * The first argument indicates that there are two kinds of manifolds St(2, 3) and Euc(2). * The second argement indicates that the length of "inmanifolds" is 2. * The third argument indicates the number for each manifold. The number of St(2, 3) is inpowsinterval[1] - inpowsinterval[0] = 2 and the number of Euc(2) is inpowsinterval[2] - inpowsinterval[1] = 1. Therefore, the product manifold if St(2, 3)^2 \times Euc(2). * The fourth argument indicates the number of all manifolds, i.e., 2 Stiefel + 1 Euclidean = 3. */ ProductManifold(Manifold **inmanifolds, integer innumofmani, integer *inpowsinterval, integer innumoftotalmani); /*In ProductManifold, true of IsIntrApproach means that the representation of each component of tangent vector of each manifold is specified by IsIntrApproach parameter of each manifolds. True of IsIntrApproach does NOT mean the representation of each component of tangent vector uses intrinsic representation. */ void SetEMPTYINTR(); /*Destructor of ProductManifold. Delete EMPTYINTR, EMPTYEXTR, manifolds, and powsinterval;*/ virtual ~ProductManifold(); /*Define the Riemannian metric: g_x(etax, xix). The default one is summation of the metrics of all manifolds, i.e., g_x(etax, xix) = Sum g_{x_i}(etax_i, xix_i), where x_i, etax_i, and xix_i are components of x, etax, and xix respectively. */ virtual double Metric(Variable *x, Vector *etax, Vector *xix) const; /*Define the action of the linear operator, result = Hx(etax), where Hx is an linear operator on T_x M and etax is a tangent vector in T_x M. Note that etax and result must be different, i.e., calling this function by LinearOPEEta(x, Hx, result, result); is illegal. The default one is the matrix multiplication, i.e., result = Hx * etax*/ virtual void LinearOPEEta(Variable *x, LinearOPE *Hx, Vector *etax, Vector *result) const; /*Compute result = scalar1 * etax + scalar2 * xix; etax and result can be a same argument or xix and result can be a same argument, i.e., calling this function by VectorLinearCombination(x, scalar1, etax, scalar2, result, result); or VectorLinearCombination(x, scalar1, result, scalar2, xix, result); is legal. However, VectorLinearCombination(x, scalar1, result, scalar2, result, result) is illegal.*/ virtual void VectorLinearCombination(Variable *x, double scalar1, Vector *etax, double scalar2, Vector *xix, Vector *result) const; /*etax is in the ambient space. This function projects etax onto the tangent space of x, i.e., result = P_{T_x M} etax The component of v and results use the representation specified by each manifold if IsIntrApproach is true. Otherwise, the component of v and results use the extrinsic representation. etax and result can be a same argument, i.e., calling this function by Projection(x, result, result); is legal. Default function: Let x = (x_1, dots, x_n), v=(v_1, dots, v_n), result = (r_1, dots, r_n). The default computation is r_i = P_{T_{x_i} M_i} v_i for all i. */ virtual void Projection(Variable *x, Vector *v, Vector *result) const; /*Randomly generate N vectors in the tangent space of x. The resulting vectors are stored in result_arr. This is used for the gradient sampling method, which is not supported yet.*/ virtual void RandomTangentVectors(Variable *x, integer N, Vector **result_arr) const; /*Compute the retraction result = R_x(etax). A stepsize is also input for information. Default: Let x = (x_1, dots, x_n), etax=(etax_1, dots, etax_n), result = (r_1, dots, r_n). r_i = R_{x_i}(eta_i), for all i. */ virtual void Retraction(Variable *x, Vector *etax, Variable *result, double instepsize) const; /*Compute the tangent vector result satisfying g_y(\mathcal{T}_{R_etax}(xix), xiy) = g_x(xix, result) for all xix \in T_x M, where y = R_x(etax), xiy \in T_y M. This cotangent vector is used in the RBFGS defined in [RW2012] [RW2012]: W. Ring and B. Wirth. Optimization methods on Riemannian manifolds and their application to shape space. SIAM Journal on Optimization, 22(2):596?27, January 2012 xiy and result can be a same argument, i.e., calling this function by coTangentVector(x, etax, y, result, result); is legal. Default: compute the cotangent vector for each component */ virtual void coTangentVector(Variable *x, Vector *etax, Variable *y, Vector *xiy, Vector *result) const; /*Computes the vector transport by differentiated retraction, i.e., result = \mathcal{T}_{R_etax} (xix) if the input IsEtaXiSameDir is true, then this means etax and xix are along a same direction. This implies the computations may be simplied. xix and result can be a same argument, i.e., calling this function by DiffRetraction(x, etax, y, result, result); is legal. Default: compute the vector transport by differentiated retraction for each component */ virtual void DiffRetraction(Variable *x, Vector *etax, Variable *y, Vector *xix, Vector *result, bool IsEtaXiSameDir = false) const; /*computes beta = \|etax\| / \|\mathcal{T}_{R_etax} etax\| Default: etax = (etax_1, dots, eta_n); beta = \sqrt(sum \|eta_i\|_2^2) / \sqrt(sum \|\mathcal{T}_{R_{etax_i}} etax_i\|) */ virtual double Beta(Variable *x, Vector *etax) const; /*compute the distance between two points on the manifold. Default: sqrt(dist_M1(x1_1, x2_2)^2 + dist_M2(x1_2, x2_2)^2 + ... + dist_M1(x1_n, x2_n)^2) where x1_i is the i-th component of the product element.*/ virtual double Dist(Variable *x1, Variable *x2) const; /*Computes the vector transport, i.e., result = \mathcal{T}_etax (xix) xix and result can be a same argument, i.e., calling this function by VectorTransport(x, etax, y, result, result); is legal. Default: compute the vector transport for each component */ virtual void VectorTransport(Variable *x, Vector *etax, Variable *y, Vector *xix, Vector *result) const; /*Computes the inverse vector transport, i.e., result = \mathcal{T}_etax^{-1} (xiy) xiy and result can be a same argument, i.e., calling this function by InverseVectorTransport(x, etax, y, result, result); is legal. Default: compute the inverse vector transport for each component */ virtual void InverseVectorTransport(Variable *x, Vector *etax, Variable *y, Vector *xiy, Vector *result) const; /*Compute result = diag(\mathcal{T}_1, dots, \mathcal{T}_n) * H * diag(\mathcal{T}_1^{-1}, dots, \mathcal{T}_n^{-1}). Hx and result can be a same argument, i.e., calling this function by TranHInvTran(x, etax, y, result, result); is legal. Default: This is implemented by call the functions "HInvTran" and "TranH" in class "Manifold". */ virtual void TranHInvTran(Variable *x, Vector *etax, Variable *y, LinearOPE *Hx, LinearOPE *result) const; /*Compute result = Hx + scalar * etax * xix^{\flat}. Hx and result can be a same argument, i.e., calling this function by HaddScaledRank1OPE(x, result, scalar, etax, xix, result); is legal. Default: compute xix^{\flat} = (xix_1^\flat, cdots, xix_n^\flat) first, then compute esult = Hx + scalar * etax * xix^{\flat}*/ virtual void HaddScaledRank1OPE(Variable *x, LinearOPE *Hx, double scalar, Vector *etax, Vector *xix, LinearOPE *result) const; /*etax is in the ambient space. This function projects etax onto the tangent space of x, i.e., result = P_{T_x M} etax; For this function, the components of v and result are represented by extrinsic representations. etax and result can be a same argument, i.e., calling this function by ExtrProjection(x, result, result); is legal. Default function: Let x = (x_1, dots, x_n), v=(v_1, dots, v_n), result = (r_1, dots, r_n). The default computation is r_i = P_{T_{x_i} M_i} v_i for all i. */ virtual void ExtrProjection(Variable *x, Vector *v, Vector *result) const; /*Each component of etax must use extrinsic representation. This function turn the extrinsic representation of a component of etax to intrinsic representation if the component manifold has true IsIntrApproach. Otherwise, the component of etax still use extrinsic representation. See details in [Hua2013, Section 9.5] [Hua2013]: W. Huang. Optimization algorithms on Riemannian manifolds with applications. PhD thesis, Florida State University, Department of Mathematics, 2013 etax and result must be different arguments, i.e., calling this function by ObtainIntr(x, result, result); is illegal. Default: If the "IsIntrApproach" in M_i is true, then call M_i::ObtainIntr(x_i, etax_i, result_i). Otherwise, result_i <-- etax_i.*/ virtual void ObtainIntr(Variable *x, Vector *etax, Vector *result) const; /*Each component of etax use representation specified by the "IsIntrApproach" of each manifold. This function turn the intrinsic representation of a component of etax to extrinsic representation if the component manifold has true IsIntrApproach. See details in [Hua2013, Section 9.5] [Hua2013]: W. Huang. Optimization algorithms on Riemannian manifolds with applications. PhD thesis, Florida State University, Department of Mathematics, 2013 etax and result must be different arguments, i.e., calling this function by ObtainExtr(x, result, result); is illegal. Default: If the "IsIntrApproach" in M_i is true, then call M_i::ObtainExtr(x_i, intretax_i, result_i). Otherwise, result_i <-- etax_i.*/ virtual void ObtainExtr(Variable *x, Vector *intretax, Vector *result) const; /*Compute the Riemannian gradient from the Euclidean gradient of a function; The function is defined in "prob". egf is the Euclidean gradient; result is the output which is the Riemannian gradient. egf and result can be a same argument, i.e., calling this function by EucGradToGrad(x, result, result, prob); is legal. Default: call the EucGradToGrad for each component manifold. */ virtual void EucGradToGrad(Variable *x, Vector *egf, Vector *gf, const Problem *prob) const; /*Compute the Riemannian action of Hessian from the Euclidean action of Hessian of a function; The function is defined in "prob". the input exix is exix = EucHess [etax], where EucHess is the Euclidean Hessian, the output result is result = RieHess[eta], where RieHess is the Riemannian Hessian. exix and result can be a same argument, i.e., calling this function by EucHvToHv(x, etax, result, result, prob); is legal. Default: call the EucHvToHv for each component manifold. */ virtual void EucHvToHv(Variable *x, Vector *etax, Vector *exix, Vector* xix, const Problem *prob) const; /*Check whether all the parameters are legal or not.*/ virtual void CheckParams(void) const; /*Get the idx-th kind of manifolds.*/ inline Manifold *GetManifold(integer idx) const { if (idx < numofmani) return manifolds[idx]; return nullptr; }; protected: /*Turn ProdElement to Element. It is not the same as dynamic_cast. This function has not been used yet. I don't remember why I wrote it*/ void ProdElementToElement(const ProductElement *ProdElem, Element *Elem) const; /*Turn ProdElement to Element. It is not the same as dynamic_cast. This function has not been used yet. I don't remember why I wrote it*/ void ElementToProdElement(const Element *Elem, ProductElement *ProdElem) const; Manifold **manifolds; /*Store all kinds of manifolds*/ integer numofmani; /*The number of kinds of manifolds, i.e., the length of manifolds*/ integer *powsinterval; /*Each manifold are located in what interval*/ integer numoftotalmani; /*The number of all manifolds.*/ /*An example for store St(2, 3) ^ 2 \times Euc(2) is given below: (Not exactly C++ code. just give an idea) Stiefel mani1(3, 2); Euclidean mani2(2); manifolds = {&mani1, &mani2}; // two kinds of manifolds numofmani = 2; // two kinds of manifold powsinterval = {0, 2, 3}; // from 0 to 2-1 is St(2,3); from 2 to 3-1 is Euc(2); numoftotalmani = 3; // 2 Stiefel + 1 Euclidean = 3, i.e., 3 manifolds in total. */ }; }; /*end of ROPTLIB namespace*/ #endif // end of PRODUCTMANIFOLD_H
51.453532
139
0.732606
[ "shape", "vector" ]
9c4ef93a7cc5ff78506ee039054231189f4b371b
5,103
c
C
Lab_09/Lab_9.c
dthornton22/CPE325_FA20_UAH
be59704b4ff96145249de8dd5aa572916385ba8b
[ "MIT" ]
1
2020-11-11T02:14:02.000Z
2020-11-11T02:14:02.000Z
Lab_09/Lab_9.c
dthornton22/CPE325_FA20_UAH
be59704b4ff96145249de8dd5aa572916385ba8b
[ "MIT" ]
null
null
null
Lab_09/Lab_9.c
dthornton22/CPE325_FA20_UAH
be59704b4ff96145249de8dd5aa572916385ba8b
[ "MIT" ]
null
null
null
/*--------------------------------------------------------- * File: Lab_9.c * Description: This program measures acceleration * Input: ADXL335 accelerometer * Output: Blinking LEDs and data in UAH serial app * Author: David Thornton * Lab Section: 2 * Date: November 11, 2020 * *------------------------------------------------------*/ #include <msp430.h> #include <math.h> #define RED 0x01 // Red LED #define GREEN 0x80 // Green LED #define S1 ((P2IN&BIT1) == 0) // Switch 1 push defined #define S2 ((P1IN&BIT1) == 0) // Switch 2 push defined // Global variables for later use volatile long int ADCXval, ADCYval, ADCZval = -1; volatile float XDir, YDir, ZDir, netG = -1; void TimerA_setup(void); void ADC_setup(void); void UART_putCharacter(char c); void UART_setup(void); void sendData(void); void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer __enable_interrupt(); // Enable interrupts globally SFRIE1 |= WDTIE; // Enable WDT interrupt P1DIR |= RED; // P1.0 is output direction for REDLED P1REN |= BIT1; // Enable the pull-up resistor at P1.1 P1OUT &= ~RED; // LED is off at start P4DIR |= GREEN; // P4.7 is output direction for GREENLED P2REN |= BIT1; // Enable the pull-up resistor at P2.1 P4OUT &= ~GREEN; // LED is off at start // Configuring switch 1 interrupts P2IE |= BIT1; P2IES |= BIT1; P2IFG &= ~BIT1; // Configuring switch 2 interrupts P1IE |= BIT1; P1IES |= BIT1; P1IFG &= ~BIT1; ADC_setup(); // Setup ADC UART_setup(); // Setup UART Comms. TimerA_setup(); // Setup Timer A for 10 times a second while (1) // Infinite loop { __bis_SR_register(LPM0_bits + GIE); // Enter LPM0 sendData(); // Send out the data } } void sendData(void) { XDir = ((((ADCXval * 3.3)/4095)-1.65)/.330); YDir = ((((ADCYval * 3.3)/4095)-1.65)/.330); ZDir = ((((ADCZval * 3.3)/4095)-1.80)/.330); // Use character pointers to send one byte at a time char *xpointer=(char *)&XDir; char *ypointer=(char *)&YDir; char *zpointer=(char *)&ZDir; unsigned int i; UART_putCharacter(0x55); // Send header // Send floats one byte at a time for(i = 0; i < 4; i++) { UART_putCharacter(xpointer[i]); } for(i = 0; i < 4; i++) { UART_putCharacter(ypointer[i]); } for(i = 0; i < 4; i++) { UART_putCharacter(zpointer[i]); } // Use vector sum for calculation of netG netG = sqrtf((XDir*XDir) + (YDir * YDir) + (ZDir * ZDir)); if(netG >= 2) { WDTCTL = WDT_MDLY_0_5; // 0.5ms interval timer P1OUT |= RED; // Turn on REDLED P4OUT &= ~GREEN; // Make sure GREENLED is off } } void TimerA_setup(void) { TA0CCTL0 = CCIE; // Enabled interrupt TA0CCR0 = 3277; // 3277 / 32768 Hz = 0.1s, 10 samples/sec TA0CTL = TASSEL_1 + MC_1; // ACLK, up mode } #pragma vector = ADC12_VECTOR __interrupt void ADC12ISR(void) { ADCXval = ADC12MEM0; // Move ADC12MEM0 (x) to ADCXval ADCYval = ADC12MEM1; // Move ADC12MEM1 (y) to ADCYval ADCZval = ADC12MEM2; // Move ADC12MEM2 (z) to ADCZval __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0 } #pragma vector = TIMER0_A0_VECTOR __interrupt void timerA_isr() { ADC12CTL0 |= ADC12SC; } // Switch 2 Press #pragma vector = PORT1_VECTOR __interrupt void PORT1_ISR(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1OUT &= ~RED; // Turn Red LED off P4OUT &= ~GREEN; // Turn Green LED off P1IFG &= ~BIT1; } // Switch 1 Press #pragma vector = PORT2_VECTOR __interrupt void PORT2_ISR(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1OUT &= ~RED; // Turn Red LED off P4OUT &= ~GREEN; // Turn Green LED off P2IFG &= ~BIT1; } // Watchdog Timer ISR. #pragma vector=WDT_VECTOR __interrupt void watchdog_timer(void) { static int i = 1; if(i == 1000) { P4OUT ^= GREEN; // Toggle green LED P1OUT ^= RED; // Toggle the red LED i = 1; } i++; } void ADC_setup(void) { P6SEL = 0x07; // Enable A/D channel inputs for x, y, and z (0000 0111) ADC12CTL0 = ADC12ON + ADC12MSC + ADC12SHT0_8; // Turn on ADC12, extend sampling time to avoid overflow of results ADC12CTL1 = ADC12SHP + ADC12CONSEQ_1; // Use sampling timer, repeated sequence ADC12MCTL0 = ADC12INCH_0; // ref += AVcc, channel = A0 ADC12MCTL1 = ADC12INCH_1; // ref += AVcc, channel = A1 ADC12MCTL2 = ADC12INCH_2 + ADC12EOS; // ref += AVcc, channel = A2, end sequence ADC12IE = 0x02; // Enable ADC12IFG.1 ADC12CTL0 |= ADC12ENC; // Enable conversions } void UART_putCharacter(char c) { while (!(UCA0IFG&UCTXIFG)); // Wait for previous character to transmit UCA0TXBUF = c; // Put character into tx buffer } void UART_setup(void) { P3SEL |= BIT3 + BIT4; // Set USCI_A0 RXD/TXD to receive/transmit data UCA0CTL1 |= UCSWRST; // Set software reset during initialization UCA0CTL0 = 0; // USCI_A0 control register UCA0CTL1 |= UCSSEL_2; // Clock source SMCLK UCA0BR0 = 0x09; // 1048576 Hz / 115200 lower byte UCA0BR1 = 0x00; // upper byte UCA0MCTL |= UCBRS0; // Modulation (UCBRS0=0x01, UCOS16=0) UCA0CTL1 &= ~UCSWRST; // Clear software reset to initialize USCI state machine }
26.304124
114
0.643543
[ "vector" ]
9c5be616ca7f47bfc1b4ef83c5d0649c2fa00fef
4,971
h
C
FMMPS/Quadrature.h
pl2526/PSCAcoustic
eaf127f0bd6aa9bdf4a051b4390966e86fdf6751
[ "MIT" ]
null
null
null
FMMPS/Quadrature.h
pl2526/PSCAcoustic
eaf127f0bd6aa9bdf4a051b4390966e86fdf6751
[ "MIT" ]
null
null
null
FMMPS/Quadrature.h
pl2526/PSCAcoustic
eaf127f0bd6aa9bdf4a051b4390966e86fdf6751
[ "MIT" ]
null
null
null
/* * Quadrature.h * PSCAcoustic * * Quadrature for High-frequency portion of code * * * Copyright 2014 Pierre-David Letourneau * * 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. */ #ifndef QUADRATURE_FMM_H #define QUADRATURE_FMM_H #include "General.h" #include "Vec3.h" #include "HelmholtzUtil.h" #include "../Scatterer.h" namespace FMM { // A quadrature point struct QuadraturePoint { int index; double theta, phi, w; Vec3 s; QuadraturePoint( double theta_ = 0, double phi_ = 0, double w_ = 0 ); ~QuadraturePoint() {} }; // A row of quadrature points on the sphere struct QuadratureRow { int index; double theta; std::vector<QuadraturePoint> point; // Constructor // A row of N_phi quadrature points (of total weight w0) at constant theta QuadratureRow( double theta_ = 0, int N_phi = 0, double w0 = 0 ); // Destructor ~QuadratureRow() {} // Accessors inline int size() { return point.size(); } inline int numPoints() { return size(); } inline double getTheta() { return theta; } inline QuadraturePoint& getPoint( int k ) { return point[k]; } // Output friend ostream& operator<<(ostream& os, const QuadratureRow& quad){ return os; } }; class QuadratureHelm { public: // TODO : Should it be complex? const double kappa; std::vector<QuadratureRow> row; // List of quadrature rows (const theta) std::vector<QuadraturePoint*> point; // Enumerated quadrature points int L; // Gegenbauer truncation int max_N_phi; // Index maps for rotations and reflections of the quadrature std::vector< std::vector<int> > indexMap; QuadratureHelm( HelmKernel& K ); // Destructor ~QuadratureHelm(){} // Accessors inline int size() const { return point.size(); } inline int numPoints() const { return size(); } inline int numRows() const { return row.size(); } inline int maxRowSize() const { return max_N_phi; } inline int getTruncation() const { return L; } inline QuadratureRow& getRow( int k ) { return row[k]; } inline QuadraturePoint& getPoint( int k ) { return *(point[k]); } // Output friend ostream& operator<<(ostream& os, const QuadratureHelm& q) { os << "(" << q.getTruncation() << "," << q.numRows() << "," << q.size() << ")" << endl; return os; } protected: inline void makePointerAccess() { // Quadrature is done being constructed // Construct the enumerated point std::vector int rowNumber = 0, pointNumber = 0; max_N_phi = 0; for( int k = 0; k < numRows(); ++k ) { // Assign each a row number row[k].index = rowNumber++; // Find the largest row max_N_phi = std::max( max_N_phi, row[k].size() ); for( int p = 0; p < row[k].numPoints(); ++p ) { // Assign each a point number row[k].point[p].index = pointNumber++; // Insert point point.push_back( &(row[k].point[p]) ); } } } }; // A uniform quadrature in phi and theta class Quadrature_Uniform : public QuadratureHelm { complex k; complex k_out; public: // Constructor Quadrature_Uniform(HelmKernel& K, double boxSize, double eps, complex k, complex k_out); // Destructor ~Quadrature_Uniform() {} //----- Auxilliary functions -----// double g( int n, double C, double k_out, double r); double h( int n, double C, double k_out, double r, double theta); //----- Functions providing parameters values -----// int get_N_theta( int L, double k_out, double r0, double r, double boxSize, double eps ); int get_N_phi( std::vector< std::vector<complex> >& TL, int n, int N_phiT, double maxL, double theta, int N_theta, double k_out, double r, double boxSize, double eps); }; typedef Quadrature_Uniform Quadrature; } #endif
27.77095
92
0.650774
[ "vector" ]
9c5c41834a4312c94e4829183368a3b300c6c2c7
1,058
h
C
projects/assigment4/code/engine/node/graphicsNodes/Tetrahedron.h
Blinningjr/opengl-lab-env
dc041a6d502bf543f25271cd47dd7c5698eb33a1
[ "MIT" ]
1
2020-11-17T15:19:22.000Z
2020-11-17T15:19:22.000Z
projects/assigment4/code/engine/node/graphicsNodes/Tetrahedron.h
Blinningjr/opengl-lab-env
dc041a6d502bf543f25271cd47dd7c5698eb33a1
[ "MIT" ]
null
null
null
projects/assigment4/code/engine/node/graphicsNodes/Tetrahedron.h
Blinningjr/opengl-lab-env
dc041a6d502bf543f25271cd47dd7c5698eb33a1
[ "MIT" ]
null
null
null
#pragma once #include <glm/glm.hpp> #include <glm/vec3.hpp> // glm::vec3 #include <glm/mat4x4.hpp> // glm::mat4 #include <memory> #include "../../material/Material.h" #include "../../Mesh.h" #include "../GraphicsNode.h" namespace Graphics3D { class Tetrahedron : public GraphicsNode { public: Tetrahedron(float size, std::shared_ptr<Material> material, glm::vec3 position); Tetrahedron(float size, std::shared_ptr<Material> material, glm::vec3 position, float pitchSpeed, float rollSpeed, float yawnSpeed); Tetrahedron(float size, std::shared_ptr<Material> material, glm::vec3 position, GLfloat pitch, GLfloat roll, GLfloat yawn, float pitchSpeed, float rollSpeed, float yawnSpeed); ~Tetrahedron(); void update(float deltaTime) override; static std::shared_ptr<Mesh> genMesh(float size); private: float pitchSpeed; float rollSpeed; float yawnSpeed; }; }
27.128205
110
0.612476
[ "mesh" ]
9c5fd176ad6af12bd02e771980015ef6408dcdda
518,828
c
C
JointSpaceControl_Model_C_ForceEstim/slprj/_sfprj/JointSpaceControl_BestInertia/_self/sfun/src/c25_JointSpaceControl_BestInertia.c
kkufieta/force_estimate_ur5
dce0de88e75fc6af2a6336d75917244832c1a15e
[ "Apache-2.0" ]
28
2017-12-08T17:20:26.000Z
2022-03-14T09:26:55.000Z
JointSpaceControl_Model_C_ForceEstim/slprj/_sfprj/JointSpaceControl_BestInertia/_self/sfun/src/c25_JointSpaceControl_BestInertia.c
kkufieta/force_estimate_ur5
dce0de88e75fc6af2a6336d75917244832c1a15e
[ "Apache-2.0" ]
null
null
null
JointSpaceControl_Model_C_ForceEstim/slprj/_sfprj/JointSpaceControl_BestInertia/_self/sfun/src/c25_JointSpaceControl_BestInertia.c
kkufieta/force_estimate_ur5
dce0de88e75fc6af2a6336d75917244832c1a15e
[ "Apache-2.0" ]
11
2017-02-16T05:45:28.000Z
2021-11-17T01:21:48.000Z
/* Include files */ #include <stddef.h> #include "blas.h" #include "JointSpaceControl_BestInertia_sfun.h" #include "c25_JointSpaceControl_BestInertia.h" #include "mwmathutil.h" #define CHARTINSTANCE_CHARTNUMBER (chartInstance->chartNumber) #define CHARTINSTANCE_INSTANCENUMBER (chartInstance->instanceNumber) #include "JointSpaceControl_BestInertia_sfun_debug_macros.h" #define _SF_MEX_LISTEN_FOR_CTRL_C(S) sf_mex_listen_for_ctrl_c(sfGlobalDebugInstanceStruct,S); /* Type Definitions */ /* Named Constants */ #define CALL_EVENT (-1) /* Variable Declarations */ /* Variable Definitions */ static const char * c25_debug_family_names[9] = { "M", "G", "CDq", "nargin", "nargout", "q", "dq", "tau", "ddq" }; static const char * c25_b_debug_family_names[104] = { "q1", "q2", "q3", "q4", "q5", "q6", "theta_1", "theta_2", "theta_3", "theta_4", "theta_5", "theta_6", "dq1", "dq2", "dq3", "dq4", "dq5", "dq6", "m11", "m12", "m13", "m14", "m15", "m16", "m21", "m22", "m23", "m24", "m25", "m26", "m31", "m32", "m33", "m34", "m35", "m36", "m41", "m42", "m43", "m44", "m45", "m46", "m51", "m52", "m53", "m54", "m55", "m56", "m61", "m62", "m63", "m64", "m65", "m66", "c11", "c12", "c13", "c14", "c15", "c16", "c21", "c22", "c23", "c24", "c25", "c26", "c31", "c32", "c33", "c34", "c35", "c36", "c41", "c42", "c43", "c44", "c45", "c46", "c51", "c52", "c53", "c54", "c55", "c56", "c61", "c62", "c63", "c64", "c65", "c66", "g1", "g2", "g3", "g4", "g5", "g6", "C", "nargin", "nargout", "q", "dq", "M", "G", "CDq" }; /* Function Declarations */ static void initialize_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void initialize_params_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void enable_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void disable_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void c25_update_debugger_state_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static const mxArray *get_sim_state_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void set_sim_state_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_st); static void finalize_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void sf_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void initSimStructsc25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void registerMessagesc25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void c25_ur5_matrices(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_q[6], real_T c25_dq[6], real_T c25_M[36], real_T c25_G[6], real_T c25_CDq[6]); static void init_script_number_translation(uint32_T c25_machineNumber, uint32_T c25_chartNumber); static const mxArray *c25_sf_marshallOut(void *chartInstanceVoid, void *c25_inData); static void c25_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_ddq, const char_T *c25_identifier, real_T c25_y[6]); static void c25_b_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId, real_T c25_y[6]); static void c25_sf_marshallIn(void *chartInstanceVoid, const mxArray *c25_mxArrayInData, const char_T *c25_varName, void *c25_outData); static const mxArray *c25_b_sf_marshallOut(void *chartInstanceVoid, void *c25_inData); static real_T c25_c_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId); static void c25_b_sf_marshallIn(void *chartInstanceVoid, const mxArray *c25_mxArrayInData, const char_T *c25_varName, void *c25_outData); static const mxArray *c25_c_sf_marshallOut(void *chartInstanceVoid, void *c25_inData); static void c25_d_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId, real_T c25_y[36]); static void c25_c_sf_marshallIn(void *chartInstanceVoid, const mxArray *c25_mxArrayInData, const char_T *c25_varName, void *c25_outData); static void c25_info_helper(c25_ResolvedFunctionInfo c25_info[127]); static void c25_b_info_helper(c25_ResolvedFunctionInfo c25_info[127]); static real_T c25_mpower(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_a); static void c25_eml_scalar_eg(SFc25_JointSpaceControl_BestInertiaInstanceStruct * chartInstance); static void c25_b_eml_scalar_eg (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void c25_realmin(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void c25_eps(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void c25_eml_matlab_zgetrf (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_b_A[36], int32_T c25_ipiv[6], int32_T *c25_info); static void c25_check_forloop_overflow_error (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, boolean_T c25_overflow); static void c25_eml_xger(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, int32_T c25_m, int32_T c25_n, real_T c25_alpha1, int32_T c25_ix0, int32_T c25_iy0, real_T c25_A[36], int32_T c25_ia0, real_T c25_b_A[36]); static void c25_eml_warning(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void c25_eml_xtrsm(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_B[6], real_T c25_b_B[6]); static void c25_below_threshold (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void c25_c_eml_scalar_eg (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); static void c25_b_eml_xtrsm(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_B[6], real_T c25_b_B[6]); static const mxArray *c25_d_sf_marshallOut(void *chartInstanceVoid, void *c25_inData); static int32_T c25_e_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId); static void c25_d_sf_marshallIn(void *chartInstanceVoid, const mxArray *c25_mxArrayInData, const char_T *c25_varName, void *c25_outData); static uint8_T c25_f_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_b_is_active_c25_JointSpaceControl_BestInertia, const char_T *c25_identifier); static uint8_T c25_g_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId); static void c25_b_eml_matlab_zgetrf (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], int32_T c25_ipiv[6], int32_T *c25_info); static void c25_b_eml_xger(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, int32_T c25_m, int32_T c25_n, real_T c25_alpha1, int32_T c25_ix0, int32_T c25_iy0, real_T c25_A[36], int32_T c25_ia0); static void c25_c_eml_xtrsm(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_B[6]); static void c25_d_eml_xtrsm(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_B[6]); static void init_dsm_address_info (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance); /* Function Definitions */ static void initialize_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { chartInstance->c25_sfEvent = CALL_EVENT; _sfTime_ = (real_T)ssGetT(chartInstance->S); chartInstance->c25_is_active_c25_JointSpaceControl_BestInertia = 0U; } static void initialize_params_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void enable_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { _sfTime_ = (real_T)ssGetT(chartInstance->S); } static void disable_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { _sfTime_ = (real_T)ssGetT(chartInstance->S); } static void c25_update_debugger_state_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static const mxArray *get_sim_state_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { const mxArray *c25_st; const mxArray *c25_y = NULL; int32_T c25_i0; real_T c25_u[6]; const mxArray *c25_b_y = NULL; uint8_T c25_hoistedGlobal; uint8_T c25_b_u; const mxArray *c25_c_y = NULL; real_T (*c25_ddq)[6]; c25_ddq = (real_T (*)[6])ssGetOutputPortSignal(chartInstance->S, 1); c25_st = NULL; c25_st = NULL; c25_y = NULL; sf_mex_assign(&c25_y, sf_mex_createcellarray(2), FALSE); for (c25_i0 = 0; c25_i0 < 6; c25_i0++) { c25_u[c25_i0] = (*c25_ddq)[c25_i0]; } c25_b_y = NULL; sf_mex_assign(&c25_b_y, sf_mex_create("y", c25_u, 0, 0U, 1U, 0U, 1, 6), FALSE); sf_mex_setcell(c25_y, 0, c25_b_y); c25_hoistedGlobal = chartInstance->c25_is_active_c25_JointSpaceControl_BestInertia; c25_b_u = c25_hoistedGlobal; c25_c_y = NULL; sf_mex_assign(&c25_c_y, sf_mex_create("y", &c25_b_u, 3, 0U, 0U, 0U, 0), FALSE); sf_mex_setcell(c25_y, 1, c25_c_y); sf_mex_assign(&c25_st, c25_y, FALSE); return c25_st; } static void set_sim_state_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_st) { const mxArray *c25_u; real_T c25_dv0[6]; int32_T c25_i1; real_T (*c25_ddq)[6]; c25_ddq = (real_T (*)[6])ssGetOutputPortSignal(chartInstance->S, 1); chartInstance->c25_doneDoubleBufferReInit = TRUE; c25_u = sf_mex_dup(c25_st); c25_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c25_u, 0)), "ddq", c25_dv0); for (c25_i1 = 0; c25_i1 < 6; c25_i1++) { (*c25_ddq)[c25_i1] = c25_dv0[c25_i1]; } chartInstance->c25_is_active_c25_JointSpaceControl_BestInertia = c25_f_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c25_u, 1)), "is_active_c25_JointSpaceControl_BestInertia"); sf_mex_destroy(&c25_u); c25_update_debugger_state_c25_JointSpaceControl_BestInertia(chartInstance); sf_mex_destroy(&c25_st); } static void finalize_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void sf_c25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { int32_T c25_i2; int32_T c25_i3; int32_T c25_i4; int32_T c25_i5; int32_T c25_i6; real_T c25_q[6]; int32_T c25_i7; real_T c25_dq[6]; int32_T c25_i8; real_T c25_tau[6]; uint32_T c25_debug_family_var_map[9]; real_T c25_M[36]; real_T c25_G[6]; real_T c25_CDq[6]; real_T c25_nargin = 3.0; real_T c25_nargout = 1.0; real_T c25_ddq[6]; int32_T c25_i9; real_T c25_b_q[6]; int32_T c25_i10; real_T c25_b_dq[6]; real_T c25_b_CDq[6]; real_T c25_b_G[6]; real_T c25_b_M[36]; int32_T c25_i11; int32_T c25_i12; int32_T c25_i13; int32_T c25_i14; int32_T c25_i15; int32_T c25_info; int32_T c25_ipiv[6]; int32_T c25_b_info; int32_T c25_c_info; int32_T c25_d_info; int32_T c25_i16; int32_T c25_i; int32_T c25_b_i; int32_T c25_ip; real_T c25_temp; int32_T c25_i17; real_T c25_dv1[36]; int32_T c25_i18; real_T c25_dv2[36]; int32_T c25_i19; real_T c25_dv3[36]; int32_T c25_i20; real_T c25_dv4[36]; int32_T c25_i21; real_T (*c25_b_ddq)[6]; real_T (*c25_b_tau)[6]; real_T (*c25_c_dq)[6]; real_T (*c25_c_q)[6]; c25_b_ddq = (real_T (*)[6])ssGetOutputPortSignal(chartInstance->S, 1); c25_b_tau = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 2); c25_c_dq = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 1); c25_c_q = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 0); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 22U, chartInstance->c25_sfEvent); for (c25_i2 = 0; c25_i2 < 6; c25_i2++) { _SFD_DATA_RANGE_CHECK((*c25_c_q)[c25_i2], 0U); } for (c25_i3 = 0; c25_i3 < 6; c25_i3++) { _SFD_DATA_RANGE_CHECK((*c25_c_dq)[c25_i3], 1U); } for (c25_i4 = 0; c25_i4 < 6; c25_i4++) { _SFD_DATA_RANGE_CHECK((*c25_b_tau)[c25_i4], 2U); } for (c25_i5 = 0; c25_i5 < 6; c25_i5++) { _SFD_DATA_RANGE_CHECK((*c25_b_ddq)[c25_i5], 3U); } chartInstance->c25_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 22U, chartInstance->c25_sfEvent); for (c25_i6 = 0; c25_i6 < 6; c25_i6++) { c25_q[c25_i6] = (*c25_c_q)[c25_i6]; } for (c25_i7 = 0; c25_i7 < 6; c25_i7++) { c25_dq[c25_i7] = (*c25_c_dq)[c25_i7]; } for (c25_i8 = 0; c25_i8 < 6; c25_i8++) { c25_tau[c25_i8] = (*c25_b_tau)[c25_i8]; } _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 9U, 9U, c25_debug_family_names, c25_debug_family_var_map); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_M, 0U, c25_c_sf_marshallOut, c25_c_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_G, 1U, c25_sf_marshallOut, c25_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_CDq, 2U, c25_sf_marshallOut, c25_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_nargin, 3U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_nargout, 4U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML(c25_q, 5U, c25_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(c25_dq, 6U, c25_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(c25_tau, 7U, c25_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_ddq, 8U, c25_sf_marshallOut, c25_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, 4); for (c25_i9 = 0; c25_i9 < 6; c25_i9++) { c25_b_q[c25_i9] = c25_q[c25_i9]; } for (c25_i10 = 0; c25_i10 < 6; c25_i10++) { c25_b_dq[c25_i10] = c25_dq[c25_i10]; } c25_ur5_matrices(chartInstance, c25_b_q, c25_b_dq, c25_b_M, c25_b_G, c25_b_CDq); for (c25_i11 = 0; c25_i11 < 36; c25_i11++) { c25_M[c25_i11] = c25_b_M[c25_i11]; } for (c25_i12 = 0; c25_i12 < 6; c25_i12++) { c25_G[c25_i12] = c25_b_G[c25_i12]; } for (c25_i13 = 0; c25_i13 < 6; c25_i13++) { c25_CDq[c25_i13] = c25_b_CDq[c25_i13]; } _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, 6); for (c25_i14 = 0; c25_i14 < 36; c25_i14++) { c25_b_M[c25_i14] = c25_M[c25_i14]; } for (c25_i15 = 0; c25_i15 < 6; c25_i15++) { c25_b_G[c25_i15] = (c25_tau[c25_i15] - c25_CDq[c25_i15]) - c25_G[c25_i15]; } c25_b_eml_matlab_zgetrf(chartInstance, c25_b_M, c25_ipiv, &c25_info); c25_b_info = c25_info; c25_c_info = c25_b_info; c25_d_info = c25_c_info; if (c25_d_info > 0) { c25_eml_warning(chartInstance); } c25_b_eml_scalar_eg(chartInstance); for (c25_i16 = 0; c25_i16 < 6; c25_i16++) { c25_ddq[c25_i16] = c25_b_G[c25_i16]; } for (c25_i = 1; c25_i < 7; c25_i++) { c25_b_i = c25_i; if (c25_ipiv[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_b_i), 1, 6, 1, 0) - 1] != c25_b_i) { c25_ip = c25_ipiv[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T) _SFD_INTEGER_CHECK("", (real_T)c25_b_i), 1, 6, 1, 0) - 1]; c25_temp = c25_ddq[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T) _SFD_INTEGER_CHECK("", (real_T)c25_b_i), 1, 6, 1, 0) - 1]; c25_ddq[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_b_i), 1, 6, 1, 0) - 1] = c25_ddq[_SFD_EML_ARRAY_BOUNDS_CHECK ("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_ip), 1, 6, 1, 0) - 1]; c25_ddq[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_ip), 1, 6, 1, 0) - 1] = c25_temp; } } for (c25_i17 = 0; c25_i17 < 36; c25_i17++) { c25_dv1[c25_i17] = c25_b_M[c25_i17]; } for (c25_i18 = 0; c25_i18 < 36; c25_i18++) { c25_dv2[c25_i18] = c25_dv1[c25_i18]; } c25_c_eml_xtrsm(chartInstance, c25_dv2, c25_ddq); for (c25_i19 = 0; c25_i19 < 36; c25_i19++) { c25_dv3[c25_i19] = c25_b_M[c25_i19]; } for (c25_i20 = 0; c25_i20 < 36; c25_i20++) { c25_dv4[c25_i20] = c25_dv3[c25_i20]; } c25_d_eml_xtrsm(chartInstance, c25_dv4, c25_ddq); _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, -6); _SFD_SYMBOL_SCOPE_POP(); for (c25_i21 = 0; c25_i21 < 6; c25_i21++) { (*c25_b_ddq)[c25_i21] = c25_ddq[c25_i21]; } _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 22U, chartInstance->c25_sfEvent); _SFD_CHECK_FOR_STATE_INCONSISTENCY (_JointSpaceControl_BestInertiaMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); } static void initSimStructsc25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void registerMessagesc25_JointSpaceControl_BestInertia (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void c25_ur5_matrices(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_q[6], real_T c25_dq[6], real_T c25_M[36], real_T c25_G[6], real_T c25_CDq[6]) { uint32_T c25_debug_family_var_map[104]; real_T c25_q1; real_T c25_q2; real_T c25_q3; real_T c25_q4; real_T c25_q5; real_T c25_q6; real_T c25_theta_1; real_T c25_theta_2; real_T c25_theta_3; real_T c25_theta_4; real_T c25_theta_5; real_T c25_theta_6; real_T c25_dq1; real_T c25_dq2; real_T c25_dq3; real_T c25_dq4; real_T c25_dq5; real_T c25_dq6; real_T c25_m11; real_T c25_m12; real_T c25_m13; real_T c25_m14; real_T c25_m15; real_T c25_m16; real_T c25_m21; real_T c25_m22; real_T c25_m23; real_T c25_m24; real_T c25_m25; real_T c25_m26; real_T c25_m31; real_T c25_m32; real_T c25_m33; real_T c25_m34; real_T c25_m35; real_T c25_m36; real_T c25_m41; real_T c25_m42; real_T c25_m43; real_T c25_m44; real_T c25_m45; real_T c25_m46; real_T c25_m51; real_T c25_m52; real_T c25_m53; real_T c25_m54; real_T c25_m55; real_T c25_m56; real_T c25_m61; real_T c25_m62; real_T c25_m63; real_T c25_m64; real_T c25_m65; real_T c25_m66; real_T c25_c11; real_T c25_c12; real_T c25_c13; real_T c25_c14; real_T c25_c15; real_T c25_c16; real_T c25_c21; real_T c25_c22; real_T c25_c23; real_T c25_c24; real_T c25_c25; real_T c25_c26; real_T c25_c31; real_T c25_c32; real_T c25_c33; real_T c25_c34; real_T c25_c35; real_T c25_c36; real_T c25_c41; real_T c25_c42; real_T c25_c43; real_T c25_c44; real_T c25_c45; real_T c25_c46; real_T c25_c51; real_T c25_c52; real_T c25_c53; real_T c25_c54; real_T c25_c55; real_T c25_c56; real_T c25_c61; real_T c25_c62; real_T c25_c63; real_T c25_c64; real_T c25_c65; real_T c25_c66; real_T c25_g1; real_T c25_g2; real_T c25_g3; real_T c25_g4; real_T c25_g5; real_T c25_g6; real_T c25_C[36]; real_T c25_nargin = 2.0; real_T c25_nargout = 3.0; real_T c25_x; real_T c25_b_x; real_T c25_b; real_T c25_y; real_T c25_b_b; real_T c25_b_y; real_T c25_c_b; real_T c25_c_y; real_T c25_d_b; real_T c25_d_y; real_T c25_e_b; real_T c25_e_y; real_T c25_c_x; real_T c25_d_x; real_T c25_f_b; real_T c25_f_y; real_T c25_g_b; real_T c25_g_y; real_T c25_e_x; real_T c25_f_x; real_T c25_h_b; real_T c25_h_y; real_T c25_i_b; real_T c25_i_y; real_T c25_g_x; real_T c25_h_x; real_T c25_j_b; real_T c25_j_y; real_T c25_k_b; real_T c25_k_y; real_T c25_i_x; real_T c25_j_x; real_T c25_l_b; real_T c25_l_y; real_T c25_m_b; real_T c25_m_y; real_T c25_n_b; real_T c25_n_y; real_T c25_k_x; real_T c25_l_x; real_T c25_o_b; real_T c25_o_y; real_T c25_p_b; real_T c25_p_y; real_T c25_q_b; real_T c25_q_y; real_T c25_m_x; real_T c25_n_x; real_T c25_r_b; real_T c25_r_y; real_T c25_s_b; real_T c25_s_y; real_T c25_t_b; real_T c25_t_y; real_T c25_u_b; real_T c25_u_y; real_T c25_o_x; real_T c25_p_x; real_T c25_v_b; real_T c25_v_y; real_T c25_w_b; real_T c25_w_y; real_T c25_q_x; real_T c25_r_x; real_T c25_x_b; real_T c25_x_y; real_T c25_y_b; real_T c25_y_y; real_T c25_s_x; real_T c25_t_x; real_T c25_ab_b; real_T c25_ab_y; real_T c25_bb_b; real_T c25_bb_y; real_T c25_cb_b; real_T c25_cb_y; real_T c25_db_b; real_T c25_db_y; real_T c25_eb_b; real_T c25_eb_y; real_T c25_u_x; real_T c25_v_x; real_T c25_fb_b; real_T c25_fb_y; real_T c25_gb_b; real_T c25_gb_y; real_T c25_hb_b; real_T c25_hb_y; real_T c25_ib_b; real_T c25_ib_y; real_T c25_jb_b; real_T c25_jb_y; real_T c25_w_x; real_T c25_x_x; real_T c25_kb_b; real_T c25_kb_y; real_T c25_y_x; real_T c25_ab_x; real_T c25_lb_b; real_T c25_lb_y; real_T c25_bb_x; real_T c25_cb_x; real_T c25_mb_b; real_T c25_mb_y; real_T c25_nb_b; real_T c25_nb_y; real_T c25_db_x; real_T c25_eb_x; real_T c25_ob_b; real_T c25_ob_y; real_T c25_pb_b; real_T c25_pb_y; real_T c25_fb_x; real_T c25_gb_x; real_T c25_qb_b; real_T c25_qb_y; real_T c25_hb_x; real_T c25_ib_x; real_T c25_rb_b; real_T c25_rb_y; real_T c25_jb_x; real_T c25_kb_x; real_T c25_sb_b; real_T c25_sb_y; real_T c25_tb_b; real_T c25_tb_y; real_T c25_ub_b; real_T c25_ub_y; real_T c25_lb_x; real_T c25_mb_x; real_T c25_vb_b; real_T c25_vb_y; real_T c25_wb_b; real_T c25_wb_y; real_T c25_xb_b; real_T c25_xb_y; real_T c25_nb_x; real_T c25_ob_x; real_T c25_yb_b; real_T c25_yb_y; real_T c25_pb_x; real_T c25_qb_x; real_T c25_ac_b; real_T c25_ac_y; real_T c25_bc_b; real_T c25_bc_y; real_T c25_cc_b; real_T c25_cc_y; real_T c25_dc_b; real_T c25_dc_y; real_T c25_rb_x; real_T c25_sb_x; real_T c25_ec_b; real_T c25_ec_y; real_T c25_fc_b; real_T c25_fc_y; real_T c25_gc_b; real_T c25_gc_y; real_T c25_hc_b; real_T c25_hc_y; real_T c25_tb_x; real_T c25_ub_x; real_T c25_ic_b; real_T c25_ic_y; real_T c25_vb_x; real_T c25_wb_x; real_T c25_jc_b; real_T c25_jc_y; real_T c25_xb_x; real_T c25_yb_x; real_T c25_kc_b; real_T c25_kc_y; real_T c25_lc_b; real_T c25_lc_y; real_T c25_ac_x; real_T c25_bc_x; real_T c25_mc_b; real_T c25_mc_y; real_T c25_nc_b; real_T c25_nc_y; real_T c25_cc_x; real_T c25_dc_x; real_T c25_oc_b; real_T c25_oc_y; real_T c25_pc_b; real_T c25_pc_y; real_T c25_qc_b; real_T c25_qc_y; real_T c25_rc_b; real_T c25_rc_y; real_T c25_sc_b; real_T c25_sc_y; real_T c25_ec_x; real_T c25_fc_x; real_T c25_tc_b; real_T c25_tc_y; real_T c25_uc_b; real_T c25_uc_y; real_T c25_vc_b; real_T c25_vc_y; real_T c25_wc_b; real_T c25_wc_y; real_T c25_xc_b; real_T c25_xc_y; real_T c25_gc_x; real_T c25_hc_x; real_T c25_yc_b; real_T c25_yc_y; real_T c25_ic_x; real_T c25_jc_x; real_T c25_ad_b; real_T c25_ad_y; real_T c25_kc_x; real_T c25_lc_x; real_T c25_bd_b; real_T c25_bd_y; real_T c25_mc_x; real_T c25_nc_x; real_T c25_cd_b; real_T c25_cd_y; real_T c25_dd_b; real_T c25_dd_y; real_T c25_oc_x; real_T c25_pc_x; real_T c25_ed_b; real_T c25_ed_y; real_T c25_qc_x; real_T c25_rc_x; real_T c25_fd_b; real_T c25_fd_y; real_T c25_sc_x; real_T c25_tc_x; real_T c25_gd_b; real_T c25_gd_y; real_T c25_uc_x; real_T c25_vc_x; real_T c25_hd_b; real_T c25_hd_y; real_T c25_id_b; real_T c25_id_y; real_T c25_wc_x; real_T c25_xc_x; real_T c25_jd_b; real_T c25_jd_y; real_T c25_kd_b; real_T c25_kd_y; real_T c25_yc_x; real_T c25_ad_x; real_T c25_ld_b; real_T c25_ld_y; real_T c25_md_b; real_T c25_md_y; real_T c25_nd_b; real_T c25_nd_y; real_T c25_od_b; real_T c25_od_y; real_T c25_pd_b; real_T c25_pd_y; real_T c25_bd_x; real_T c25_cd_x; real_T c25_qd_b; real_T c25_qd_y; real_T c25_rd_b; real_T c25_rd_y; real_T c25_sd_b; real_T c25_sd_y; real_T c25_td_b; real_T c25_td_y; real_T c25_ud_b; real_T c25_ud_y; real_T c25_dd_x; real_T c25_ed_x; real_T c25_vd_b; real_T c25_vd_y; real_T c25_fd_x; real_T c25_gd_x; real_T c25_wd_b; real_T c25_wd_y; real_T c25_hd_x; real_T c25_id_x; real_T c25_xd_b; real_T c25_xd_y; real_T c25_jd_x; real_T c25_kd_x; real_T c25_yd_b; real_T c25_yd_y; real_T c25_ae_b; real_T c25_ae_y; real_T c25_ld_x; real_T c25_md_x; real_T c25_be_b; real_T c25_be_y; real_T c25_ce_b; real_T c25_ce_y; real_T c25_de_b; real_T c25_de_y; real_T c25_ee_b; real_T c25_ee_y; real_T c25_fe_b; real_T c25_fe_y; real_T c25_nd_x; real_T c25_od_x; real_T c25_ge_b; real_T c25_ge_y; real_T c25_he_b; real_T c25_he_y; real_T c25_ie_b; real_T c25_ie_y; real_T c25_je_b; real_T c25_je_y; real_T c25_ke_b; real_T c25_ke_y; real_T c25_pd_x; real_T c25_qd_x; real_T c25_le_b; real_T c25_le_y; real_T c25_rd_x; real_T c25_sd_x; real_T c25_me_b; real_T c25_me_y; real_T c25_ne_b; real_T c25_ne_y; real_T c25_td_x; real_T c25_ud_x; real_T c25_oe_b; real_T c25_oe_y; real_T c25_vd_x; real_T c25_wd_x; real_T c25_pe_b; real_T c25_pe_y; real_T c25_xd_x; real_T c25_yd_x; real_T c25_qe_b; real_T c25_qe_y; real_T c25_re_b; real_T c25_re_y; real_T c25_se_b; real_T c25_se_y; real_T c25_te_b; real_T c25_te_y; real_T c25_ue_b; real_T c25_ue_y; real_T c25_ae_x; real_T c25_be_x; real_T c25_ve_b; real_T c25_ve_y; real_T c25_ce_x; real_T c25_de_x; real_T c25_we_b; real_T c25_we_y; real_T c25_ee_x; real_T c25_fe_x; real_T c25_xe_b; real_T c25_xe_y; real_T c25_ye_b; real_T c25_ye_y; real_T c25_ge_x; real_T c25_he_x; real_T c25_af_b; real_T c25_af_y; real_T c25_ie_x; real_T c25_je_x; real_T c25_bf_b; real_T c25_bf_y; real_T c25_ke_x; real_T c25_le_x; real_T c25_a; real_T c25_cf_b; real_T c25_me_x; real_T c25_ne_x; real_T c25_df_b; real_T c25_cf_y; real_T c25_oe_x; real_T c25_pe_x; real_T c25_ef_b; real_T c25_df_y; real_T c25_ff_b; real_T c25_ef_y; real_T c25_qe_x; real_T c25_re_x; real_T c25_gf_b; real_T c25_ff_y; real_T c25_hf_b; real_T c25_gf_y; real_T c25_se_x; real_T c25_te_x; real_T c25_if_b; real_T c25_hf_y; real_T c25_jf_b; real_T c25_if_y; real_T c25_kf_b; real_T c25_jf_y; real_T c25_lf_b; real_T c25_kf_y; real_T c25_mf_b; real_T c25_lf_y; real_T c25_ue_x; real_T c25_ve_x; real_T c25_nf_b; real_T c25_mf_y; real_T c25_of_b; real_T c25_nf_y; real_T c25_pf_b; real_T c25_of_y; real_T c25_qf_b; real_T c25_pf_y; real_T c25_rf_b; real_T c25_qf_y; real_T c25_we_x; real_T c25_xe_x; real_T c25_sf_b; real_T c25_rf_y; real_T c25_ye_x; real_T c25_af_x; real_T c25_tf_b; real_T c25_sf_y; real_T c25_bf_x; real_T c25_cf_x; real_T c25_uf_b; real_T c25_tf_y; real_T c25_df_x; real_T c25_ef_x; real_T c25_vf_b; real_T c25_uf_y; real_T c25_wf_b; real_T c25_vf_y; real_T c25_ff_x; real_T c25_gf_x; real_T c25_xf_b; real_T c25_wf_y; real_T c25_hf_x; real_T c25_if_x; real_T c25_yf_b; real_T c25_xf_y; real_T c25_jf_x; real_T c25_kf_x; real_T c25_ag_b; real_T c25_yf_y; real_T c25_lf_x; real_T c25_mf_x; real_T c25_bg_b; real_T c25_ag_y; real_T c25_nf_x; real_T c25_of_x; real_T c25_cg_b; real_T c25_bg_y; real_T c25_pf_x; real_T c25_qf_x; real_T c25_b_a; real_T c25_dg_b; real_T c25_cg_y; real_T c25_rf_x; real_T c25_sf_x; real_T c25_eg_b; real_T c25_dg_y; real_T c25_tf_x; real_T c25_uf_x; real_T c25_c_a; real_T c25_fg_b; real_T c25_eg_y; real_T c25_vf_x; real_T c25_wf_x; real_T c25_gg_b; real_T c25_fg_y; real_T c25_xf_x; real_T c25_yf_x; real_T c25_d_a; real_T c25_hg_b; real_T c25_gg_y; real_T c25_ag_x; real_T c25_bg_x; real_T c25_ig_b; real_T c25_hg_y; real_T c25_cg_x; real_T c25_dg_x; real_T c25_jg_b; real_T c25_ig_y; real_T c25_eg_x; real_T c25_fg_x; real_T c25_e_a; real_T c25_kg_b; real_T c25_jg_y; real_T c25_gg_x; real_T c25_hg_x; real_T c25_f_a; real_T c25_lg_b; real_T c25_kg_y; real_T c25_ig_x; real_T c25_jg_x; real_T c25_mg_b; real_T c25_lg_y; real_T c25_kg_x; real_T c25_lg_x; real_T c25_g_a; real_T c25_ng_b; real_T c25_mg_y; real_T c25_mg_x; real_T c25_ng_x; real_T c25_h_a; real_T c25_og_b; real_T c25_ng_y; real_T c25_og_x; real_T c25_pg_x; real_T c25_pg_b; real_T c25_og_y; real_T c25_qg_x; real_T c25_rg_x; real_T c25_qg_b; real_T c25_pg_y; real_T c25_sg_x; real_T c25_tg_x; real_T c25_rg_b; real_T c25_qg_y; real_T c25_ug_x; real_T c25_vg_x; real_T c25_i_a; real_T c25_sg_b; real_T c25_rg_y; real_T c25_wg_x; real_T c25_xg_x; real_T c25_tg_b; real_T c25_sg_y; real_T c25_yg_x; real_T c25_ah_x; real_T c25_j_a; real_T c25_ug_b; real_T c25_tg_y; real_T c25_bh_x; real_T c25_ch_x; real_T c25_vg_b; real_T c25_ug_y; real_T c25_dh_x; real_T c25_eh_x; real_T c25_k_a; real_T c25_wg_b; real_T c25_vg_y; real_T c25_fh_x; real_T c25_gh_x; real_T c25_xg_b; real_T c25_wg_y; real_T c25_hh_x; real_T c25_ih_x; real_T c25_yg_b; real_T c25_xg_y; real_T c25_jh_x; real_T c25_kh_x; real_T c25_l_a; real_T c25_ah_b; real_T c25_yg_y; real_T c25_lh_x; real_T c25_mh_x; real_T c25_m_a; real_T c25_bh_b; real_T c25_ah_y; real_T c25_nh_x; real_T c25_oh_x; real_T c25_ch_b; real_T c25_bh_y; real_T c25_ph_x; real_T c25_qh_x; real_T c25_n_a; real_T c25_dh_b; real_T c25_ch_y; real_T c25_rh_x; real_T c25_sh_x; real_T c25_o_a; real_T c25_eh_b; real_T c25_dh_y; real_T c25_th_x; real_T c25_uh_x; real_T c25_fh_b; real_T c25_eh_y; real_T c25_vh_x; real_T c25_wh_x; real_T c25_p_a; real_T c25_gh_b; real_T c25_fh_y; real_T c25_xh_x; real_T c25_yh_x; real_T c25_hh_b; real_T c25_gh_y; real_T c25_ai_x; real_T c25_bi_x; real_T c25_q_a; real_T c25_ih_b; real_T c25_hh_y; real_T c25_ci_x; real_T c25_di_x; real_T c25_jh_b; real_T c25_ih_y; real_T c25_ei_x; real_T c25_fi_x; real_T c25_r_a; real_T c25_kh_b; real_T c25_jh_y; real_T c25_gi_x; real_T c25_hi_x; real_T c25_lh_b; real_T c25_kh_y; real_T c25_ii_x; real_T c25_ji_x; real_T c25_mh_b; real_T c25_lh_y; real_T c25_ki_x; real_T c25_li_x; real_T c25_nh_b; real_T c25_mh_y; real_T c25_mi_x; real_T c25_ni_x; real_T c25_s_a; real_T c25_oh_b; real_T c25_nh_y; real_T c25_oi_x; real_T c25_pi_x; real_T c25_t_a; real_T c25_ph_b; real_T c25_oh_y; real_T c25_qi_x; real_T c25_ri_x; real_T c25_qh_b; real_T c25_ph_y; real_T c25_si_x; real_T c25_ti_x; real_T c25_u_a; real_T c25_rh_b; real_T c25_qh_y; real_T c25_ui_x; real_T c25_vi_x; real_T c25_v_a; real_T c25_sh_b; real_T c25_rh_y; real_T c25_wi_x; real_T c25_xi_x; real_T c25_yi_x; real_T c25_aj_x; real_T c25_th_b; real_T c25_sh_y; real_T c25_bj_x; real_T c25_cj_x; real_T c25_uh_b; real_T c25_th_y; real_T c25_w_a; real_T c25_vh_b; real_T c25_dj_x; real_T c25_ej_x; real_T c25_wh_b; real_T c25_fj_x; real_T c25_gj_x; real_T c25_xh_b; real_T c25_uh_y; real_T c25_hj_x; real_T c25_ij_x; real_T c25_yh_b; real_T c25_vh_y; real_T c25_ai_b; real_T c25_wh_y; real_T c25_jj_x; real_T c25_kj_x; real_T c25_bi_b; real_T c25_xh_y; real_T c25_ci_b; real_T c25_yh_y; real_T c25_lj_x; real_T c25_mj_x; real_T c25_di_b; real_T c25_ai_y; real_T c25_ei_b; real_T c25_bi_y; real_T c25_fi_b; real_T c25_ci_y; real_T c25_gi_b; real_T c25_di_y; real_T c25_hi_b; real_T c25_ei_y; real_T c25_nj_x; real_T c25_oj_x; real_T c25_ii_b; real_T c25_fi_y; real_T c25_ji_b; real_T c25_gi_y; real_T c25_ki_b; real_T c25_hi_y; real_T c25_li_b; real_T c25_ii_y; real_T c25_mi_b; real_T c25_ji_y; real_T c25_pj_x; real_T c25_qj_x; real_T c25_ni_b; real_T c25_ki_y; real_T c25_rj_x; real_T c25_sj_x; real_T c25_oi_b; real_T c25_li_y; real_T c25_tj_x; real_T c25_uj_x; real_T c25_pi_b; real_T c25_mi_y; real_T c25_vj_x; real_T c25_wj_x; real_T c25_qi_b; real_T c25_ni_y; real_T c25_xj_x; real_T c25_yj_x; real_T c25_ri_b; real_T c25_oi_y; real_T c25_ak_x; real_T c25_bk_x; real_T c25_si_b; real_T c25_pi_y; real_T c25_ck_x; real_T c25_dk_x; real_T c25_x_a; real_T c25_ti_b; real_T c25_qi_y; real_T c25_ek_x; real_T c25_fk_x; real_T c25_ui_b; real_T c25_ri_y; real_T c25_gk_x; real_T c25_hk_x; real_T c25_y_a; real_T c25_vi_b; real_T c25_si_y; real_T c25_ik_x; real_T c25_jk_x; real_T c25_wi_b; real_T c25_ti_y; real_T c25_kk_x; real_T c25_lk_x; real_T c25_ab_a; real_T c25_xi_b; real_T c25_ui_y; real_T c25_mk_x; real_T c25_nk_x; real_T c25_yi_b; real_T c25_vi_y; real_T c25_ok_x; real_T c25_pk_x; real_T c25_aj_b; real_T c25_wi_y; real_T c25_qk_x; real_T c25_rk_x; real_T c25_bb_a; real_T c25_bj_b; real_T c25_xi_y; real_T c25_sk_x; real_T c25_tk_x; real_T c25_cb_a; real_T c25_cj_b; real_T c25_yi_y; real_T c25_uk_x; real_T c25_vk_x; real_T c25_dj_b; real_T c25_aj_y; real_T c25_wk_x; real_T c25_xk_x; real_T c25_db_a; real_T c25_ej_b; real_T c25_bj_y; real_T c25_yk_x; real_T c25_al_x; real_T c25_eb_a; real_T c25_fj_b; real_T c25_cj_y; real_T c25_bl_x; real_T c25_cl_x; real_T c25_gj_b; real_T c25_dj_y; real_T c25_dl_x; real_T c25_el_x; real_T c25_fb_a; real_T c25_hj_b; real_T c25_ej_y; real_T c25_fl_x; real_T c25_gl_x; real_T c25_ij_b; real_T c25_fj_y; real_T c25_hl_x; real_T c25_il_x; real_T c25_jj_b; real_T c25_gj_y; real_T c25_jl_x; real_T c25_kl_x; real_T c25_kj_b; real_T c25_hj_y; real_T c25_ll_x; real_T c25_ml_x; real_T c25_gb_a; real_T c25_lj_b; real_T c25_ij_y; real_T c25_nl_x; real_T c25_ol_x; real_T c25_mj_b; real_T c25_jj_y; real_T c25_pl_x; real_T c25_ql_x; real_T c25_nj_b; real_T c25_kj_y; real_T c25_rl_x; real_T c25_sl_x; real_T c25_tl_x; real_T c25_ul_x; real_T c25_oj_b; real_T c25_lj_y; real_T c25_hb_a; real_T c25_pj_b; real_T c25_vl_x; real_T c25_wl_x; real_T c25_qj_b; real_T c25_xl_x; real_T c25_yl_x; real_T c25_rj_b; real_T c25_mj_y; real_T c25_sj_b; real_T c25_nj_y; real_T c25_am_x; real_T c25_bm_x; real_T c25_tj_b; real_T c25_oj_y; real_T c25_uj_b; real_T c25_pj_y; real_T c25_vj_b; real_T c25_qj_y; real_T c25_wj_b; real_T c25_rj_y; real_T c25_xj_b; real_T c25_sj_y; real_T c25_cm_x; real_T c25_dm_x; real_T c25_yj_b; real_T c25_tj_y; real_T c25_ak_b; real_T c25_uj_y; real_T c25_bk_b; real_T c25_vj_y; real_T c25_ck_b; real_T c25_wj_y; real_T c25_dk_b; real_T c25_xj_y; real_T c25_em_x; real_T c25_fm_x; real_T c25_ek_b; real_T c25_yj_y; real_T c25_gm_x; real_T c25_hm_x; real_T c25_fk_b; real_T c25_ak_y; real_T c25_im_x; real_T c25_jm_x; real_T c25_gk_b; real_T c25_bk_y; real_T c25_km_x; real_T c25_lm_x; real_T c25_ib_a; real_T c25_hk_b; real_T c25_ck_y; real_T c25_mm_x; real_T c25_nm_x; real_T c25_ik_b; real_T c25_dk_y; real_T c25_om_x; real_T c25_pm_x; real_T c25_jb_a; real_T c25_jk_b; real_T c25_ek_y; real_T c25_qm_x; real_T c25_rm_x; real_T c25_kk_b; real_T c25_fk_y; real_T c25_sm_x; real_T c25_tm_x; real_T c25_kb_a; real_T c25_lk_b; real_T c25_gk_y; real_T c25_um_x; real_T c25_vm_x; real_T c25_mk_b; real_T c25_hk_y; real_T c25_wm_x; real_T c25_xm_x; real_T c25_nk_b; real_T c25_ik_y; real_T c25_ym_x; real_T c25_an_x; real_T c25_ok_b; real_T c25_jk_y; real_T c25_bn_x; real_T c25_cn_x; real_T c25_lb_a; real_T c25_pk_b; real_T c25_kk_y; real_T c25_dn_x; real_T c25_en_x; real_T c25_mb_a; real_T c25_qk_b; real_T c25_lk_y; real_T c25_fn_x; real_T c25_gn_x; real_T c25_rk_b; real_T c25_mk_y; real_T c25_hn_x; real_T c25_in_x; real_T c25_nb_a; real_T c25_sk_b; real_T c25_nk_y; real_T c25_jn_x; real_T c25_kn_x; real_T c25_ob_a; real_T c25_tk_b; real_T c25_ok_y; real_T c25_ln_x; real_T c25_mn_x; real_T c25_uk_b; real_T c25_pk_y; real_T c25_nn_x; real_T c25_on_x; real_T c25_pb_a; real_T c25_vk_b; real_T c25_qk_y; real_T c25_pn_x; real_T c25_qn_x; real_T c25_wk_b; real_T c25_rk_y; real_T c25_rn_x; real_T c25_sn_x; real_T c25_xk_b; real_T c25_sk_y; real_T c25_tn_x; real_T c25_un_x; real_T c25_yk_b; real_T c25_tk_y; real_T c25_vn_x; real_T c25_wn_x; real_T c25_al_b; real_T c25_xn_x; real_T c25_yn_x; real_T c25_bl_b; real_T c25_cl_b; real_T c25_uk_y; real_T c25_ao_x; real_T c25_bo_x; real_T c25_dl_b; real_T c25_vk_y; real_T c25_co_x; real_T c25_do_x; real_T c25_el_b; real_T c25_wk_y; real_T c25_eo_x; real_T c25_fo_x; real_T c25_fl_b; real_T c25_xk_y; real_T c25_gl_b; real_T c25_yk_y; real_T c25_hl_b; real_T c25_al_y; real_T c25_il_b; real_T c25_bl_y; real_T c25_jl_b; real_T c25_cl_y; real_T c25_go_x; real_T c25_ho_x; real_T c25_kl_b; real_T c25_dl_y; real_T c25_io_x; real_T c25_jo_x; real_T c25_ll_b; real_T c25_el_y; real_T c25_ko_x; real_T c25_lo_x; real_T c25_ml_b; real_T c25_fl_y; real_T c25_nl_b; real_T c25_gl_y; real_T c25_mo_x; real_T c25_no_x; real_T c25_ol_b; real_T c25_hl_y; real_T c25_oo_x; real_T c25_po_x; real_T c25_qo_x; real_T c25_ro_x; real_T c25_pl_b; real_T c25_il_y; real_T c25_so_x; real_T c25_to_x; real_T c25_ql_b; real_T c25_jl_y; real_T c25_qb_a; real_T c25_rl_b; real_T c25_uo_x; real_T c25_vo_x; real_T c25_wo_x; real_T c25_xo_x; real_T c25_sl_b; real_T c25_kl_y; real_T c25_rb_a; real_T c25_tl_b; real_T c25_yo_x; real_T c25_ap_x; real_T c25_ul_b; real_T c25_bp_x; real_T c25_cp_x; real_T c25_vl_b; real_T c25_ll_y; real_T c25_dp_x; real_T c25_ep_x; real_T c25_sb_a; real_T c25_wl_b; real_T c25_fp_x; real_T c25_gp_x; real_T c25_xl_b; real_T c25_hp_x; real_T c25_ip_x; real_T c25_yl_b; real_T c25_jp_x; real_T c25_kp_x; real_T c25_am_b; real_T c25_bm_b; real_T c25_ml_y; real_T c25_cm_b; real_T c25_nl_y; real_T c25_lp_x; real_T c25_mp_x; real_T c25_tb_a; real_T c25_dm_b; real_T c25_ol_y; real_T c25_em_b; real_T c25_pl_y; real_T c25_fm_b; real_T c25_ql_y; real_T c25_np_x; real_T c25_op_x; real_T c25_ub_a; real_T c25_gm_b; real_T c25_rl_y; real_T c25_hm_b; real_T c25_sl_y; real_T c25_im_b; real_T c25_tl_y; real_T c25_pp_x; real_T c25_qp_x; real_T c25_vb_a; real_T c25_jm_b; real_T c25_ul_y; real_T c25_km_b; real_T c25_vl_y; real_T c25_lm_b; real_T c25_wl_y; real_T c25_mm_b; real_T c25_xl_y; real_T c25_rp_x; real_T c25_sp_x; real_T c25_wb_a; real_T c25_nm_b; real_T c25_yl_y; real_T c25_om_b; real_T c25_am_y; real_T c25_pm_b; real_T c25_bm_y; real_T c25_qm_b; real_T c25_cm_y; real_T c25_tp_x; real_T c25_up_x; real_T c25_xb_a; real_T c25_rm_b; real_T c25_dm_y; real_T c25_sm_b; real_T c25_em_y; real_T c25_tm_b; real_T c25_fm_y; real_T c25_um_b; real_T c25_gm_y; real_T c25_vp_x; real_T c25_wp_x; real_T c25_yb_a; real_T c25_vm_b; real_T c25_hm_y; real_T c25_wm_b; real_T c25_im_y; real_T c25_xm_b; real_T c25_jm_y; real_T c25_ym_b; real_T c25_km_y; real_T c25_xp_x; real_T c25_yp_x; real_T c25_ac_a; real_T c25_an_b; real_T c25_lm_y; real_T c25_bn_b; real_T c25_mm_y; real_T c25_cn_b; real_T c25_nm_y; real_T c25_aq_x; real_T c25_bq_x; real_T c25_bc_a; real_T c25_dn_b; real_T c25_om_y; real_T c25_en_b; real_T c25_pm_y; real_T c25_fn_b; real_T c25_qm_y; real_T c25_cq_x; real_T c25_dq_x; real_T c25_cc_a; real_T c25_gn_b; real_T c25_rm_y; real_T c25_hn_b; real_T c25_sm_y; real_T c25_in_b; real_T c25_tm_y; real_T c25_jn_b; real_T c25_um_y; real_T c25_eq_x; real_T c25_fq_x; real_T c25_dc_a; real_T c25_kn_b; real_T c25_vm_y; real_T c25_ln_b; real_T c25_wm_y; real_T c25_mn_b; real_T c25_xm_y; real_T c25_nn_b; real_T c25_ym_y; real_T c25_gq_x; real_T c25_hq_x; real_T c25_ec_a; real_T c25_on_b; real_T c25_an_y; real_T c25_pn_b; real_T c25_bn_y; real_T c25_qn_b; real_T c25_cn_y; real_T c25_rn_b; real_T c25_dn_y; real_T c25_iq_x; real_T c25_jq_x; real_T c25_fc_a; real_T c25_sn_b; real_T c25_en_y; real_T c25_tn_b; real_T c25_fn_y; real_T c25_un_b; real_T c25_gn_y; real_T c25_vn_b; real_T c25_hn_y; real_T c25_wn_b; real_T c25_in_y; real_T c25_kq_x; real_T c25_lq_x; real_T c25_gc_a; real_T c25_xn_b; real_T c25_jn_y; real_T c25_yn_b; real_T c25_kn_y; real_T c25_ao_b; real_T c25_ln_y; real_T c25_bo_b; real_T c25_mn_y; real_T c25_co_b; real_T c25_nn_y; real_T c25_mq_x; real_T c25_nq_x; real_T c25_hc_a; real_T c25_do_b; real_T c25_on_y; real_T c25_eo_b; real_T c25_pn_y; real_T c25_fo_b; real_T c25_qn_y; real_T c25_go_b; real_T c25_rn_y; real_T c25_ho_b; real_T c25_sn_y; real_T c25_oq_x; real_T c25_pq_x; real_T c25_ic_a; real_T c25_io_b; real_T c25_tn_y; real_T c25_jo_b; real_T c25_un_y; real_T c25_ko_b; real_T c25_vn_y; real_T c25_lo_b; real_T c25_wn_y; real_T c25_mo_b; real_T c25_xn_y; real_T c25_qq_x; real_T c25_rq_x; real_T c25_jc_a; real_T c25_no_b; real_T c25_yn_y; real_T c25_oo_b; real_T c25_ao_y; real_T c25_po_b; real_T c25_bo_y; real_T c25_sq_x; real_T c25_tq_x; real_T c25_kc_a; real_T c25_qo_b; real_T c25_co_y; real_T c25_ro_b; real_T c25_do_y; real_T c25_so_b; real_T c25_eo_y; real_T c25_uq_x; real_T c25_vq_x; real_T c25_lc_a; real_T c25_to_b; real_T c25_fo_y; real_T c25_uo_b; real_T c25_go_y; real_T c25_vo_b; real_T c25_ho_y; real_T c25_wo_b; real_T c25_io_y; real_T c25_xo_b; real_T c25_jo_y; real_T c25_yo_b; real_T c25_ko_y; real_T c25_wq_x; real_T c25_xq_x; real_T c25_mc_a; real_T c25_ap_b; real_T c25_lo_y; real_T c25_bp_b; real_T c25_mo_y; real_T c25_cp_b; real_T c25_no_y; real_T c25_dp_b; real_T c25_oo_y; real_T c25_ep_b; real_T c25_po_y; real_T c25_fp_b; real_T c25_qo_y; real_T c25_yq_x; real_T c25_ar_x; real_T c25_nc_a; real_T c25_gp_b; real_T c25_ro_y; real_T c25_hp_b; real_T c25_so_y; real_T c25_ip_b; real_T c25_to_y; real_T c25_jp_b; real_T c25_uo_y; real_T c25_kp_b; real_T c25_vo_y; real_T c25_lp_b; real_T c25_wo_y; real_T c25_br_x; real_T c25_cr_x; real_T c25_oc_a; real_T c25_mp_b; real_T c25_xo_y; real_T c25_np_b; real_T c25_yo_y; real_T c25_op_b; real_T c25_ap_y; real_T c25_pp_b; real_T c25_bp_y; real_T c25_qp_b; real_T c25_cp_y; real_T c25_rp_b; real_T c25_dp_y; real_T c25_dr_x; real_T c25_er_x; real_T c25_pc_a; real_T c25_sp_b; real_T c25_ep_y; real_T c25_tp_b; real_T c25_fp_y; real_T c25_up_b; real_T c25_gp_y; real_T c25_vp_b; real_T c25_hp_y; real_T c25_wp_b; real_T c25_ip_y; real_T c25_xp_b; real_T c25_jp_y; real_T c25_fr_x; real_T c25_gr_x; real_T c25_qc_a; real_T c25_yp_b; real_T c25_kp_y; real_T c25_aq_b; real_T c25_lp_y; real_T c25_bq_b; real_T c25_mp_y; real_T c25_cq_b; real_T c25_np_y; real_T c25_dq_b; real_T c25_op_y; real_T c25_eq_b; real_T c25_pp_y; real_T c25_hr_x; real_T c25_ir_x; real_T c25_rc_a; real_T c25_fq_b; real_T c25_qp_y; real_T c25_gq_b; real_T c25_rp_y; real_T c25_hq_b; real_T c25_sp_y; real_T c25_iq_b; real_T c25_tp_y; real_T c25_jq_b; real_T c25_up_y; real_T c25_kq_b; real_T c25_vp_y; real_T c25_jr_x; real_T c25_kr_x; real_T c25_sc_a; real_T c25_lq_b; real_T c25_wp_y; real_T c25_mq_b; real_T c25_xp_y; real_T c25_nq_b; real_T c25_yp_y; real_T c25_oq_b; real_T c25_aq_y; real_T c25_pq_b; real_T c25_bq_y; real_T c25_qq_b; real_T c25_cq_y; real_T c25_lr_x; real_T c25_mr_x; real_T c25_tc_a; real_T c25_rq_b; real_T c25_dq_y; real_T c25_sq_b; real_T c25_eq_y; real_T c25_nr_x; real_T c25_or_x; real_T c25_uc_a; real_T c25_tq_b; real_T c25_fq_y; real_T c25_uq_b; real_T c25_gq_y; real_T c25_pr_x; real_T c25_qr_x; real_T c25_vc_a; real_T c25_vq_b; real_T c25_hq_y; real_T c25_wq_b; real_T c25_iq_y; real_T c25_rr_x; real_T c25_sr_x; real_T c25_wc_a; real_T c25_xq_b; real_T c25_jq_y; real_T c25_yq_b; real_T c25_kq_y; real_T c25_tr_x; real_T c25_ur_x; real_T c25_xc_a; real_T c25_ar_b; real_T c25_lq_y; real_T c25_br_b; real_T c25_mq_y; real_T c25_cr_b; real_T c25_nq_y; real_T c25_vr_x; real_T c25_wr_x; real_T c25_yc_a; real_T c25_dr_b; real_T c25_oq_y; real_T c25_er_b; real_T c25_pq_y; real_T c25_fr_b; real_T c25_qq_y; real_T c25_xr_x; real_T c25_yr_x; real_T c25_ad_a; real_T c25_gr_b; real_T c25_rq_y; real_T c25_hr_b; real_T c25_sq_y; real_T c25_ir_b; real_T c25_tq_y; real_T c25_as_x; real_T c25_bs_x; real_T c25_bd_a; real_T c25_jr_b; real_T c25_uq_y; real_T c25_kr_b; real_T c25_vq_y; real_T c25_lr_b; real_T c25_wq_y; real_T c25_cs_x; real_T c25_ds_x; real_T c25_cd_a; real_T c25_mr_b; real_T c25_xq_y; real_T c25_nr_b; real_T c25_yq_y; real_T c25_or_b; real_T c25_ar_y; real_T c25_es_x; real_T c25_fs_x; real_T c25_dd_a; real_T c25_pr_b; real_T c25_br_y; real_T c25_qr_b; real_T c25_cr_y; real_T c25_rr_b; real_T c25_dr_y; real_T c25_sr_b; real_T c25_er_y; real_T c25_gs_x; real_T c25_hs_x; real_T c25_ed_a; real_T c25_tr_b; real_T c25_fr_y; real_T c25_ur_b; real_T c25_gr_y; real_T c25_vr_b; real_T c25_hr_y; real_T c25_wr_b; real_T c25_ir_y; real_T c25_is_x; real_T c25_js_x; real_T c25_fd_a; real_T c25_xr_b; real_T c25_jr_y; real_T c25_yr_b; real_T c25_kr_y; real_T c25_as_b; real_T c25_lr_y; real_T c25_bs_b; real_T c25_mr_y; real_T c25_ks_x; real_T c25_ls_x; real_T c25_gd_a; real_T c25_cs_b; real_T c25_nr_y; real_T c25_ds_b; real_T c25_or_y; real_T c25_es_b; real_T c25_pr_y; real_T c25_fs_b; real_T c25_qr_y; real_T c25_ms_x; real_T c25_ns_x; real_T c25_hd_a; real_T c25_gs_b; real_T c25_rr_y; real_T c25_hs_b; real_T c25_sr_y; real_T c25_os_x; real_T c25_ps_x; real_T c25_id_a; real_T c25_is_b; real_T c25_tr_y; real_T c25_js_b; real_T c25_ur_y; real_T c25_qs_x; real_T c25_rs_x; real_T c25_jd_a; real_T c25_ks_b; real_T c25_vr_y; real_T c25_ls_b; real_T c25_wr_y; real_T c25_ss_x; real_T c25_ts_x; real_T c25_kd_a; real_T c25_ms_b; real_T c25_xr_y; real_T c25_ns_b; real_T c25_yr_y; real_T c25_os_b; real_T c25_as_y; real_T c25_ps_b; real_T c25_bs_y; real_T c25_qs_b; real_T c25_cs_y; real_T c25_us_x; real_T c25_vs_x; real_T c25_ld_a; real_T c25_rs_b; real_T c25_ds_y; real_T c25_ss_b; real_T c25_es_y; real_T c25_ts_b; real_T c25_fs_y; real_T c25_us_b; real_T c25_gs_y; real_T c25_vs_b; real_T c25_hs_y; real_T c25_ws_x; real_T c25_xs_x; real_T c25_md_a; real_T c25_ws_b; real_T c25_is_y; real_T c25_xs_b; real_T c25_js_y; real_T c25_ys_b; real_T c25_ks_y; real_T c25_at_b; real_T c25_ls_y; real_T c25_bt_b; real_T c25_ms_y; real_T c25_ys_x; real_T c25_at_x; real_T c25_nd_a; real_T c25_ct_b; real_T c25_ns_y; real_T c25_dt_b; real_T c25_os_y; real_T c25_et_b; real_T c25_ps_y; real_T c25_ft_b; real_T c25_qs_y; real_T c25_gt_b; real_T c25_rs_y; real_T c25_bt_x; real_T c25_ct_x; real_T c25_od_a; real_T c25_ht_b; real_T c25_ss_y; real_T c25_it_b; real_T c25_ts_y; real_T c25_jt_b; real_T c25_us_y; real_T c25_kt_b; real_T c25_vs_y; real_T c25_dt_x; real_T c25_et_x; real_T c25_pd_a; real_T c25_lt_b; real_T c25_ws_y; real_T c25_mt_b; real_T c25_xs_y; real_T c25_nt_b; real_T c25_ys_y; real_T c25_ot_b; real_T c25_at_y; real_T c25_ft_x; real_T c25_gt_x; real_T c25_qd_a; real_T c25_pt_b; real_T c25_bt_y; real_T c25_qt_b; real_T c25_ct_y; real_T c25_rt_b; real_T c25_dt_y; real_T c25_st_b; real_T c25_et_y; real_T c25_tt_b; real_T c25_ft_y; real_T c25_ht_x; real_T c25_it_x; real_T c25_rd_a; real_T c25_ut_b; real_T c25_gt_y; real_T c25_vt_b; real_T c25_ht_y; real_T c25_wt_b; real_T c25_it_y; real_T c25_xt_b; real_T c25_jt_y; real_T c25_yt_b; real_T c25_kt_y; real_T c25_jt_x; real_T c25_kt_x; real_T c25_sd_a; real_T c25_au_b; real_T c25_lt_y; real_T c25_bu_b; real_T c25_mt_y; real_T c25_cu_b; real_T c25_nt_y; real_T c25_du_b; real_T c25_ot_y; real_T c25_eu_b; real_T c25_pt_y; real_T c25_lt_x; real_T c25_mt_x; real_T c25_td_a; real_T c25_fu_b; real_T c25_qt_y; real_T c25_gu_b; real_T c25_rt_y; real_T c25_nt_x; real_T c25_ot_x; real_T c25_ud_a; real_T c25_hu_b; real_T c25_st_y; real_T c25_iu_b; real_T c25_tt_y; real_T c25_pt_x; real_T c25_qt_x; real_T c25_vd_a; real_T c25_ju_b; real_T c25_ut_y; real_T c25_ku_b; real_T c25_vt_y; real_T c25_rt_x; real_T c25_st_x; real_T c25_wd_a; real_T c25_lu_b; real_T c25_wt_y; real_T c25_mu_b; real_T c25_xt_y; real_T c25_nu_b; real_T c25_yt_y; real_T c25_ou_b; real_T c25_au_y; real_T c25_pu_b; real_T c25_bu_y; real_T c25_qu_b; real_T c25_cu_y; real_T c25_tt_x; real_T c25_ut_x; real_T c25_xd_a; real_T c25_ru_b; real_T c25_du_y; real_T c25_su_b; real_T c25_eu_y; real_T c25_tu_b; real_T c25_fu_y; real_T c25_uu_b; real_T c25_gu_y; real_T c25_vu_b; real_T c25_hu_y; real_T c25_wu_b; real_T c25_iu_y; real_T c25_vt_x; real_T c25_wt_x; real_T c25_yd_a; real_T c25_xu_b; real_T c25_ju_y; real_T c25_yu_b; real_T c25_ku_y; real_T c25_av_b; real_T c25_lu_y; real_T c25_bv_b; real_T c25_mu_y; real_T c25_cv_b; real_T c25_nu_y; real_T c25_dv_b; real_T c25_ou_y; real_T c25_xt_x; real_T c25_yt_x; real_T c25_ae_a; real_T c25_ev_b; real_T c25_pu_y; real_T c25_fv_b; real_T c25_qu_y; real_T c25_gv_b; real_T c25_ru_y; real_T c25_hv_b; real_T c25_su_y; real_T c25_iv_b; real_T c25_tu_y; real_T c25_jv_b; real_T c25_uu_y; real_T c25_au_x; real_T c25_bu_x; real_T c25_be_a; real_T c25_kv_b; real_T c25_vu_y; real_T c25_lv_b; real_T c25_wu_y; real_T c25_mv_b; real_T c25_xu_y; real_T c25_cu_x; real_T c25_du_x; real_T c25_ce_a; real_T c25_nv_b; real_T c25_yu_y; real_T c25_ov_b; real_T c25_av_y; real_T c25_pv_b; real_T c25_bv_y; real_T c25_eu_x; real_T c25_fu_x; real_T c25_de_a; real_T c25_qv_b; real_T c25_cv_y; real_T c25_rv_b; real_T c25_dv_y; real_T c25_sv_b; real_T c25_ev_y; real_T c25_gu_x; real_T c25_hu_x; real_T c25_ee_a; real_T c25_tv_b; real_T c25_fv_y; real_T c25_uv_b; real_T c25_gv_y; real_T c25_vv_b; real_T c25_hv_y; real_T c25_iu_x; real_T c25_ju_x; real_T c25_fe_a; real_T c25_wv_b; real_T c25_iv_y; real_T c25_xv_b; real_T c25_jv_y; real_T c25_yv_b; real_T c25_kv_y; real_T c25_ku_x; real_T c25_lu_x; real_T c25_ge_a; real_T c25_aw_b; real_T c25_lv_y; real_T c25_bw_b; real_T c25_mv_y; real_T c25_cw_b; real_T c25_nv_y; real_T c25_mu_x; real_T c25_nu_x; real_T c25_he_a; real_T c25_dw_b; real_T c25_ov_y; real_T c25_ew_b; real_T c25_pv_y; real_T c25_fw_b; real_T c25_qv_y; real_T c25_ou_x; real_T c25_pu_x; real_T c25_ie_a; real_T c25_gw_b; real_T c25_rv_y; real_T c25_hw_b; real_T c25_sv_y; real_T c25_iw_b; real_T c25_tv_y; real_T c25_qu_x; real_T c25_ru_x; real_T c25_je_a; real_T c25_jw_b; real_T c25_uv_y; real_T c25_kw_b; real_T c25_vv_y; real_T c25_lw_b; real_T c25_wv_y; real_T c25_su_x; real_T c25_tu_x; real_T c25_ke_a; real_T c25_mw_b; real_T c25_xv_y; real_T c25_nw_b; real_T c25_yv_y; real_T c25_ow_b; real_T c25_aw_y; real_T c25_uu_x; real_T c25_vu_x; real_T c25_le_a; real_T c25_pw_b; real_T c25_bw_y; real_T c25_qw_b; real_T c25_cw_y; real_T c25_rw_b; real_T c25_dw_y; real_T c25_sw_b; real_T c25_ew_y; real_T c25_wu_x; real_T c25_xu_x; real_T c25_me_a; real_T c25_tw_b; real_T c25_fw_y; real_T c25_uw_b; real_T c25_gw_y; real_T c25_vw_b; real_T c25_hw_y; real_T c25_yu_x; real_T c25_av_x; real_T c25_ne_a; real_T c25_ww_b; real_T c25_iw_y; real_T c25_xw_b; real_T c25_jw_y; real_T c25_yw_b; real_T c25_kw_y; real_T c25_ax_b; real_T c25_lw_y; real_T c25_bv_x; real_T c25_cv_x; real_T c25_oe_a; real_T c25_bx_b; real_T c25_mw_y; real_T c25_cx_b; real_T c25_nw_y; real_T c25_dx_b; real_T c25_ow_y; real_T c25_ex_b; real_T c25_pw_y; real_T c25_fx_b; real_T c25_qw_y; real_T c25_dv_x; real_T c25_ev_x; real_T c25_pe_a; real_T c25_gx_b; real_T c25_rw_y; real_T c25_hx_b; real_T c25_sw_y; real_T c25_ix_b; real_T c25_tw_y; real_T c25_fv_x; real_T c25_gv_x; real_T c25_qe_a; real_T c25_jx_b; real_T c25_uw_y; real_T c25_kx_b; real_T c25_vw_y; real_T c25_lx_b; real_T c25_ww_y; real_T c25_mx_b; real_T c25_xw_y; real_T c25_nx_b; real_T c25_yw_y; real_T c25_ox_b; real_T c25_ax_y; real_T c25_hv_x; real_T c25_iv_x; real_T c25_re_a; real_T c25_px_b; real_T c25_bx_y; real_T c25_qx_b; real_T c25_cx_y; real_T c25_rx_b; real_T c25_dx_y; real_T c25_sx_b; real_T c25_ex_y; real_T c25_tx_b; real_T c25_fx_y; real_T c25_ux_b; real_T c25_gx_y; real_T c25_jv_x; real_T c25_kv_x; real_T c25_se_a; real_T c25_vx_b; real_T c25_hx_y; real_T c25_wx_b; real_T c25_ix_y; real_T c25_lv_x; real_T c25_mv_x; real_T c25_te_a; real_T c25_xx_b; real_T c25_jx_y; real_T c25_yx_b; real_T c25_kx_y; real_T c25_nv_x; real_T c25_ov_x; real_T c25_ue_a; real_T c25_ay_b; real_T c25_lx_y; real_T c25_by_b; real_T c25_mx_y; real_T c25_pv_x; real_T c25_qv_x; real_T c25_ve_a; real_T c25_cy_b; real_T c25_nx_y; real_T c25_dy_b; real_T c25_ox_y; real_T c25_rv_x; real_T c25_sv_x; real_T c25_we_a; real_T c25_ey_b; real_T c25_px_y; real_T c25_fy_b; real_T c25_qx_y; real_T c25_tv_x; real_T c25_uv_x; real_T c25_xe_a; real_T c25_gy_b; real_T c25_rx_y; real_T c25_hy_b; real_T c25_sx_y; real_T c25_vv_x; real_T c25_wv_x; real_T c25_ye_a; real_T c25_iy_b; real_T c25_tx_y; real_T c25_jy_b; real_T c25_ux_y; real_T c25_xv_x; real_T c25_yv_x; real_T c25_af_a; real_T c25_ky_b; real_T c25_vx_y; real_T c25_ly_b; real_T c25_wx_y; real_T c25_my_b; real_T c25_xx_y; real_T c25_aw_x; real_T c25_bw_x; real_T c25_bf_a; real_T c25_ny_b; real_T c25_yx_y; real_T c25_oy_b; real_T c25_ay_y; real_T c25_py_b; real_T c25_by_y; real_T c25_cw_x; real_T c25_dw_x; real_T c25_cf_a; real_T c25_qy_b; real_T c25_cy_y; real_T c25_ry_b; real_T c25_dy_y; real_T c25_sy_b; real_T c25_ey_y; real_T c25_ew_x; real_T c25_fw_x; real_T c25_df_a; real_T c25_ty_b; real_T c25_fy_y; real_T c25_uy_b; real_T c25_gy_y; real_T c25_vy_b; real_T c25_hy_y; real_T c25_gw_x; real_T c25_hw_x; real_T c25_ef_a; real_T c25_wy_b; real_T c25_iy_y; real_T c25_xy_b; real_T c25_jy_y; real_T c25_yy_b; real_T c25_ky_y; real_T c25_iw_x; real_T c25_jw_x; real_T c25_ff_a; real_T c25_aab_b; real_T c25_ly_y; real_T c25_bab_b; real_T c25_my_y; real_T c25_cab_b; real_T c25_ny_y; real_T c25_kw_x; real_T c25_lw_x; real_T c25_gf_a; real_T c25_dab_b; real_T c25_oy_y; real_T c25_eab_b; real_T c25_py_y; real_T c25_fab_b; real_T c25_qy_y; real_T c25_mw_x; real_T c25_nw_x; real_T c25_hf_a; real_T c25_gab_b; real_T c25_ry_y; real_T c25_hab_b; real_T c25_sy_y; real_T c25_iab_b; real_T c25_ty_y; real_T c25_ow_x; real_T c25_pw_x; real_T c25_if_a; real_T c25_jab_b; real_T c25_uy_y; real_T c25_kab_b; real_T c25_vy_y; real_T c25_lab_b; real_T c25_wy_y; real_T c25_qw_x; real_T c25_rw_x; real_T c25_jf_a; real_T c25_mab_b; real_T c25_xy_y; real_T c25_nab_b; real_T c25_yy_y; real_T c25_oab_b; real_T c25_aab_y; real_T c25_sw_x; real_T c25_tw_x; real_T c25_kf_a; real_T c25_pab_b; real_T c25_bab_y; real_T c25_qab_b; real_T c25_cab_y; real_T c25_rab_b; real_T c25_dab_y; real_T c25_sab_b; real_T c25_eab_y; real_T c25_uw_x; real_T c25_vw_x; real_T c25_lf_a; real_T c25_tab_b; real_T c25_fab_y; real_T c25_uab_b; real_T c25_gab_y; real_T c25_ww_x; real_T c25_xw_x; real_T c25_mf_a; real_T c25_vab_b; real_T c25_hab_y; real_T c25_wab_b; real_T c25_iab_y; real_T c25_xab_b; real_T c25_jab_y; real_T c25_yab_b; real_T c25_kab_y; real_T c25_abb_b; real_T c25_lab_y; real_T c25_yw_x; real_T c25_ax_x; real_T c25_nf_a; real_T c25_bbb_b; real_T c25_mab_y; real_T c25_cbb_b; real_T c25_nab_y; real_T c25_dbb_b; real_T c25_oab_y; real_T c25_ebb_b; real_T c25_pab_y; real_T c25_bx_x; real_T c25_cx_x; real_T c25_of_a; real_T c25_fbb_b; real_T c25_qab_y; real_T c25_gbb_b; real_T c25_rab_y; real_T c25_hbb_b; real_T c25_sab_y; real_T c25_ibb_b; real_T c25_tab_y; real_T c25_jbb_b; real_T c25_uab_y; real_T c25_dx_x; real_T c25_ex_x; real_T c25_pf_a; real_T c25_kbb_b; real_T c25_vab_y; real_T c25_lbb_b; real_T c25_wab_y; real_T c25_fx_x; real_T c25_gx_x; real_T c25_qf_a; real_T c25_mbb_b; real_T c25_xab_y; real_T c25_nbb_b; real_T c25_yab_y; real_T c25_hx_x; real_T c25_ix_x; real_T c25_rf_a; real_T c25_obb_b; real_T c25_abb_y; real_T c25_pbb_b; real_T c25_bbb_y; real_T c25_qbb_b; real_T c25_cbb_y; real_T c25_rbb_b; real_T c25_dbb_y; real_T c25_sbb_b; real_T c25_ebb_y; real_T c25_tbb_b; real_T c25_fbb_y; real_T c25_jx_x; real_T c25_kx_x; real_T c25_sf_a; real_T c25_ubb_b; real_T c25_gbb_y; real_T c25_vbb_b; real_T c25_hbb_y; real_T c25_lx_x; real_T c25_mx_x; real_T c25_tf_a; real_T c25_wbb_b; real_T c25_ibb_y; real_T c25_xbb_b; real_T c25_jbb_y; real_T c25_nx_x; real_T c25_ox_x; real_T c25_uf_a; real_T c25_ybb_b; real_T c25_kbb_y; real_T c25_acb_b; real_T c25_lbb_y; real_T c25_px_x; real_T c25_qx_x; real_T c25_vf_a; real_T c25_bcb_b; real_T c25_mbb_y; real_T c25_ccb_b; real_T c25_nbb_y; real_T c25_rx_x; real_T c25_sx_x; real_T c25_wf_a; real_T c25_dcb_b; real_T c25_obb_y; real_T c25_ecb_b; real_T c25_pbb_y; real_T c25_fcb_b; real_T c25_qbb_y; real_T c25_tx_x; real_T c25_ux_x; real_T c25_xf_a; real_T c25_gcb_b; real_T c25_rbb_y; real_T c25_hcb_b; real_T c25_sbb_y; real_T c25_vx_x; real_T c25_wx_x; real_T c25_yf_a; real_T c25_icb_b; real_T c25_tbb_y; real_T c25_xx_x; real_T c25_yx_x; real_T c25_ag_a; real_T c25_jcb_b; real_T c25_ubb_y; real_T c25_kcb_b; real_T c25_vbb_y; real_T c25_lcb_b; real_T c25_wbb_y; real_T c25_ay_x; real_T c25_by_x; real_T c25_bg_a; real_T c25_mcb_b; real_T c25_xbb_y; real_T c25_ncb_b; real_T c25_ybb_y; real_T c25_ocb_b; real_T c25_acb_y; real_T c25_cy_x; real_T c25_dy_x; real_T c25_cg_a; real_T c25_pcb_b; real_T c25_bcb_y; real_T c25_qcb_b; real_T c25_ccb_y; real_T c25_rcb_b; real_T c25_dcb_y; real_T c25_ey_x; real_T c25_fy_x; real_T c25_dg_a; real_T c25_scb_b; real_T c25_ecb_y; real_T c25_tcb_b; real_T c25_fcb_y; real_T c25_ucb_b; real_T c25_gcb_y; real_T c25_gy_x; real_T c25_hy_x; real_T c25_eg_a; real_T c25_vcb_b; real_T c25_hcb_y; real_T c25_wcb_b; real_T c25_icb_y; real_T c25_xcb_b; real_T c25_jcb_y; real_T c25_iy_x; real_T c25_jy_x; real_T c25_fg_a; real_T c25_ycb_b; real_T c25_kcb_y; real_T c25_adb_b; real_T c25_lcb_y; real_T c25_bdb_b; real_T c25_mcb_y; real_T c25_ky_x; real_T c25_ly_x; real_T c25_gg_a; real_T c25_cdb_b; real_T c25_ncb_y; real_T c25_ddb_b; real_T c25_ocb_y; real_T c25_edb_b; real_T c25_pcb_y; real_T c25_my_x; real_T c25_ny_x; real_T c25_hg_a; real_T c25_fdb_b; real_T c25_qcb_y; real_T c25_gdb_b; real_T c25_rcb_y; real_T c25_hdb_b; real_T c25_scb_y; real_T c25_idb_b; real_T c25_tcb_y; real_T c25_oy_x; real_T c25_py_x; real_T c25_ig_a; real_T c25_jdb_b; real_T c25_ucb_y; real_T c25_kdb_b; real_T c25_vcb_y; real_T c25_ldb_b; real_T c25_wcb_y; real_T c25_qy_x; real_T c25_ry_x; real_T c25_jg_a; real_T c25_mdb_b; real_T c25_xcb_y; real_T c25_ndb_b; real_T c25_ycb_y; real_T c25_odb_b; real_T c25_adb_y; real_T c25_pdb_b; real_T c25_bdb_y; real_T c25_sy_x; real_T c25_ty_x; real_T c25_kg_a; real_T c25_qdb_b; real_T c25_cdb_y; real_T c25_rdb_b; real_T c25_ddb_y; real_T c25_sdb_b; real_T c25_edb_y; real_T c25_tdb_b; real_T c25_fdb_y; real_T c25_udb_b; real_T c25_gdb_y; real_T c25_uy_x; real_T c25_vy_x; real_T c25_lg_a; real_T c25_vdb_b; real_T c25_hdb_y; real_T c25_wdb_b; real_T c25_idb_y; real_T c25_xdb_b; real_T c25_jdb_y; real_T c25_ydb_b; real_T c25_kdb_y; real_T c25_aeb_b; real_T c25_ldb_y; real_T c25_beb_b; real_T c25_mdb_y; real_T c25_wy_x; real_T c25_xy_x; real_T c25_mg_a; real_T c25_ceb_b; real_T c25_ndb_y; real_T c25_deb_b; real_T c25_odb_y; real_T c25_eeb_b; real_T c25_pdb_y; real_T c25_feb_b; real_T c25_qdb_y; real_T c25_geb_b; real_T c25_rdb_y; real_T c25_heb_b; real_T c25_sdb_y; real_T c25_yy_x; real_T c25_aab_x; real_T c25_ng_a; real_T c25_ieb_b; real_T c25_tdb_y; real_T c25_jeb_b; real_T c25_udb_y; real_T c25_bab_x; real_T c25_cab_x; real_T c25_og_a; real_T c25_keb_b; real_T c25_vdb_y; real_T c25_leb_b; real_T c25_wdb_y; real_T c25_dab_x; real_T c25_eab_x; real_T c25_pg_a; real_T c25_meb_b; real_T c25_xdb_y; real_T c25_neb_b; real_T c25_ydb_y; real_T c25_fab_x; real_T c25_gab_x; real_T c25_qg_a; real_T c25_oeb_b; real_T c25_aeb_y; real_T c25_peb_b; real_T c25_beb_y; real_T c25_hab_x; real_T c25_iab_x; real_T c25_rg_a; real_T c25_qeb_b; real_T c25_ceb_y; real_T c25_reb_b; real_T c25_deb_y; real_T c25_jab_x; real_T c25_kab_x; real_T c25_sg_a; real_T c25_seb_b; real_T c25_eeb_y; real_T c25_teb_b; real_T c25_feb_y; real_T c25_lab_x; real_T c25_mab_x; real_T c25_tg_a; real_T c25_ueb_b; real_T c25_geb_y; real_T c25_veb_b; real_T c25_heb_y; real_T c25_nab_x; real_T c25_oab_x; real_T c25_ug_a; real_T c25_web_b; real_T c25_ieb_y; real_T c25_xeb_b; real_T c25_jeb_y; real_T c25_yeb_b; real_T c25_keb_y; real_T c25_pab_x; real_T c25_qab_x; real_T c25_vg_a; real_T c25_afb_b; real_T c25_leb_y; real_T c25_bfb_b; real_T c25_meb_y; real_T c25_cfb_b; real_T c25_neb_y; real_T c25_rab_x; real_T c25_sab_x; real_T c25_wg_a; real_T c25_dfb_b; real_T c25_oeb_y; real_T c25_efb_b; real_T c25_peb_y; real_T c25_ffb_b; real_T c25_qeb_y; real_T c25_tab_x; real_T c25_uab_x; real_T c25_xg_a; real_T c25_gfb_b; real_T c25_reb_y; real_T c25_hfb_b; real_T c25_seb_y; real_T c25_ifb_b; real_T c25_teb_y; real_T c25_vab_x; real_T c25_wab_x; real_T c25_yg_a; real_T c25_jfb_b; real_T c25_ueb_y; real_T c25_kfb_b; real_T c25_veb_y; real_T c25_lfb_b; real_T c25_web_y; real_T c25_xab_x; real_T c25_yab_x; real_T c25_ah_a; real_T c25_mfb_b; real_T c25_xeb_y; real_T c25_nfb_b; real_T c25_yeb_y; real_T c25_ofb_b; real_T c25_afb_y; real_T c25_abb_x; real_T c25_bbb_x; real_T c25_bh_a; real_T c25_pfb_b; real_T c25_bfb_y; real_T c25_qfb_b; real_T c25_cfb_y; real_T c25_rfb_b; real_T c25_dfb_y; real_T c25_cbb_x; real_T c25_dbb_x; real_T c25_ch_a; real_T c25_sfb_b; real_T c25_efb_y; real_T c25_tfb_b; real_T c25_ffb_y; real_T c25_ufb_b; real_T c25_gfb_y; real_T c25_ebb_x; real_T c25_fbb_x; real_T c25_dh_a; real_T c25_vfb_b; real_T c25_hfb_y; real_T c25_wfb_b; real_T c25_ifb_y; real_T c25_xfb_b; real_T c25_jfb_y; real_T c25_gbb_x; real_T c25_hbb_x; real_T c25_eh_a; real_T c25_yfb_b; real_T c25_kfb_y; real_T c25_agb_b; real_T c25_lfb_y; real_T c25_bgb_b; real_T c25_mfb_y; real_T c25_cgb_b; real_T c25_nfb_y; real_T c25_ibb_x; real_T c25_jbb_x; real_T c25_fh_a; real_T c25_dgb_b; real_T c25_ofb_y; real_T c25_egb_b; real_T c25_pfb_y; real_T c25_kbb_x; real_T c25_lbb_x; real_T c25_gh_a; real_T c25_fgb_b; real_T c25_qfb_y; real_T c25_ggb_b; real_T c25_rfb_y; real_T c25_hgb_b; real_T c25_sfb_y; real_T c25_igb_b; real_T c25_tfb_y; real_T c25_jgb_b; real_T c25_ufb_y; real_T c25_mbb_x; real_T c25_nbb_x; real_T c25_hh_a; real_T c25_kgb_b; real_T c25_vfb_y; real_T c25_lgb_b; real_T c25_wfb_y; real_T c25_mgb_b; real_T c25_xfb_y; real_T c25_ngb_b; real_T c25_yfb_y; real_T c25_obb_x; real_T c25_pbb_x; real_T c25_ih_a; real_T c25_ogb_b; real_T c25_agb_y; real_T c25_pgb_b; real_T c25_bgb_y; real_T c25_qgb_b; real_T c25_cgb_y; real_T c25_rgb_b; real_T c25_dgb_y; real_T c25_sgb_b; real_T c25_egb_y; real_T c25_qbb_x; real_T c25_rbb_x; real_T c25_jh_a; real_T c25_tgb_b; real_T c25_fgb_y; real_T c25_ugb_b; real_T c25_ggb_y; real_T c25_sbb_x; real_T c25_tbb_x; real_T c25_kh_a; real_T c25_vgb_b; real_T c25_hgb_y; real_T c25_wgb_b; real_T c25_igb_y; real_T c25_ubb_x; real_T c25_vbb_x; real_T c25_lh_a; real_T c25_xgb_b; real_T c25_jgb_y; real_T c25_ygb_b; real_T c25_kgb_y; real_T c25_wbb_x; real_T c25_xbb_x; real_T c25_mh_a; real_T c25_ahb_b; real_T c25_lgb_y; real_T c25_bhb_b; real_T c25_mgb_y; real_T c25_chb_b; real_T c25_ngb_y; real_T c25_dhb_b; real_T c25_ogb_y; real_T c25_ehb_b; real_T c25_pgb_y; real_T c25_fhb_b; real_T c25_qgb_y; real_T c25_ybb_x; real_T c25_acb_x; real_T c25_nh_a; real_T c25_ghb_b; real_T c25_rgb_y; real_T c25_hhb_b; real_T c25_sgb_y; real_T c25_bcb_x; real_T c25_ccb_x; real_T c25_oh_a; real_T c25_ihb_b; real_T c25_tgb_y; real_T c25_jhb_b; real_T c25_ugb_y; real_T c25_dcb_x; real_T c25_ecb_x; real_T c25_ph_a; real_T c25_khb_b; real_T c25_vgb_y; real_T c25_lhb_b; real_T c25_wgb_y; real_T c25_fcb_x; real_T c25_gcb_x; real_T c25_qh_a; real_T c25_mhb_b; real_T c25_xgb_y; real_T c25_nhb_b; real_T c25_ygb_y; real_T c25_hcb_x; real_T c25_icb_x; real_T c25_rh_a; real_T c25_ohb_b; real_T c25_ahb_y; real_T c25_phb_b; real_T c25_bhb_y; real_T c25_qhb_b; real_T c25_chb_y; real_T c25_jcb_x; real_T c25_kcb_x; real_T c25_sh_a; real_T c25_rhb_b; real_T c25_dhb_y; real_T c25_shb_b; real_T c25_ehb_y; real_T c25_lcb_x; real_T c25_mcb_x; real_T c25_th_a; real_T c25_thb_b; real_T c25_fhb_y; real_T c25_ncb_x; real_T c25_ocb_x; real_T c25_uh_a; real_T c25_uhb_b; real_T c25_ghb_y; real_T c25_vhb_b; real_T c25_hhb_y; real_T c25_whb_b; real_T c25_ihb_y; real_T c25_pcb_x; real_T c25_qcb_x; real_T c25_vh_a; real_T c25_xhb_b; real_T c25_jhb_y; real_T c25_yhb_b; real_T c25_khb_y; real_T c25_aib_b; real_T c25_lhb_y; real_T c25_rcb_x; real_T c25_scb_x; real_T c25_wh_a; real_T c25_bib_b; real_T c25_mhb_y; real_T c25_cib_b; real_T c25_nhb_y; real_T c25_dib_b; real_T c25_ohb_y; real_T c25_tcb_x; real_T c25_ucb_x; real_T c25_xh_a; real_T c25_eib_b; real_T c25_phb_y; real_T c25_fib_b; real_T c25_qhb_y; real_T c25_gib_b; real_T c25_rhb_y; real_T c25_vcb_x; real_T c25_wcb_x; real_T c25_yh_a; real_T c25_hib_b; real_T c25_shb_y; real_T c25_iib_b; real_T c25_thb_y; real_T c25_jib_b; real_T c25_uhb_y; real_T c25_xcb_x; real_T c25_ycb_x; real_T c25_ai_a; real_T c25_kib_b; real_T c25_vhb_y; real_T c25_lib_b; real_T c25_whb_y; real_T c25_mib_b; real_T c25_xhb_y; real_T c25_nib_b; real_T c25_yhb_y; real_T c25_adb_x; real_T c25_bdb_x; real_T c25_bi_a; real_T c25_oib_b; real_T c25_aib_y; real_T c25_pib_b; real_T c25_bib_y; real_T c25_qib_b; real_T c25_cib_y; real_T c25_rib_b; real_T c25_dib_y; real_T c25_cdb_x; real_T c25_ddb_x; real_T c25_ci_a; real_T c25_sib_b; real_T c25_eib_y; real_T c25_tib_b; real_T c25_fib_y; real_T c25_uib_b; real_T c25_gib_y; real_T c25_vib_b; real_T c25_hib_y; real_T c25_wib_b; real_T c25_iib_y; real_T c25_edb_x; real_T c25_fdb_x; real_T c25_di_a; real_T c25_xib_b; real_T c25_jib_y; real_T c25_yib_b; real_T c25_kib_y; real_T c25_ajb_b; real_T c25_lib_y; real_T c25_bjb_b; real_T c25_mib_y; real_T c25_cjb_b; real_T c25_nib_y; real_T c25_djb_b; real_T c25_oib_y; real_T c25_gdb_x; real_T c25_hdb_x; real_T c25_ei_a; real_T c25_ejb_b; real_T c25_pib_y; real_T c25_fjb_b; real_T c25_qib_y; real_T c25_gjb_b; real_T c25_rib_y; real_T c25_hjb_b; real_T c25_sib_y; real_T c25_ijb_b; real_T c25_tib_y; real_T c25_jjb_b; real_T c25_uib_y; real_T c25_idb_x; real_T c25_jdb_x; real_T c25_fi_a; real_T c25_kjb_b; real_T c25_vib_y; real_T c25_ljb_b; real_T c25_wib_y; real_T c25_kdb_x; real_T c25_ldb_x; real_T c25_gi_a; real_T c25_mjb_b; real_T c25_xib_y; real_T c25_njb_b; real_T c25_yib_y; real_T c25_mdb_x; real_T c25_ndb_x; real_T c25_hi_a; real_T c25_ojb_b; real_T c25_ajb_y; real_T c25_pjb_b; real_T c25_bjb_y; real_T c25_odb_x; real_T c25_pdb_x; real_T c25_ii_a; real_T c25_qjb_b; real_T c25_cjb_y; real_T c25_rjb_b; real_T c25_djb_y; real_T c25_qdb_x; real_T c25_rdb_x; real_T c25_ji_a; real_T c25_sjb_b; real_T c25_ejb_y; real_T c25_tjb_b; real_T c25_fjb_y; real_T c25_sdb_x; real_T c25_tdb_x; real_T c25_ki_a; real_T c25_ujb_b; real_T c25_gjb_y; real_T c25_vjb_b; real_T c25_hjb_y; real_T c25_udb_x; real_T c25_vdb_x; real_T c25_li_a; real_T c25_wjb_b; real_T c25_ijb_y; real_T c25_xjb_b; real_T c25_jjb_y; real_T c25_yjb_b; real_T c25_kjb_y; real_T c25_wdb_x; real_T c25_xdb_x; real_T c25_mi_a; real_T c25_akb_b; real_T c25_ljb_y; real_T c25_bkb_b; real_T c25_mjb_y; real_T c25_ckb_b; real_T c25_njb_y; real_T c25_ydb_x; real_T c25_aeb_x; real_T c25_ni_a; real_T c25_dkb_b; real_T c25_ojb_y; real_T c25_ekb_b; real_T c25_pjb_y; real_T c25_fkb_b; real_T c25_qjb_y; real_T c25_beb_x; real_T c25_ceb_x; real_T c25_oi_a; real_T c25_gkb_b; real_T c25_rjb_y; real_T c25_hkb_b; real_T c25_sjb_y; real_T c25_ikb_b; real_T c25_tjb_y; real_T c25_deb_x; real_T c25_eeb_x; real_T c25_pi_a; real_T c25_jkb_b; real_T c25_ujb_y; real_T c25_kkb_b; real_T c25_vjb_y; real_T c25_lkb_b; real_T c25_wjb_y; real_T c25_feb_x; real_T c25_geb_x; real_T c25_qi_a; real_T c25_mkb_b; real_T c25_xjb_y; real_T c25_nkb_b; real_T c25_yjb_y; real_T c25_okb_b; real_T c25_akb_y; real_T c25_heb_x; real_T c25_ieb_x; real_T c25_ri_a; real_T c25_pkb_b; real_T c25_bkb_y; real_T c25_qkb_b; real_T c25_ckb_y; real_T c25_rkb_b; real_T c25_dkb_y; real_T c25_jeb_x; real_T c25_keb_x; real_T c25_si_a; real_T c25_skb_b; real_T c25_ekb_y; real_T c25_tkb_b; real_T c25_fkb_y; real_T c25_ukb_b; real_T c25_gkb_y; real_T c25_leb_x; real_T c25_meb_x; real_T c25_ti_a; real_T c25_vkb_b; real_T c25_hkb_y; real_T c25_wkb_b; real_T c25_ikb_y; real_T c25_xkb_b; real_T c25_jkb_y; real_T c25_neb_x; real_T c25_oeb_x; real_T c25_ui_a; real_T c25_ykb_b; real_T c25_kkb_y; real_T c25_alb_b; real_T c25_lkb_y; real_T c25_blb_b; real_T c25_mkb_y; real_T c25_peb_x; real_T c25_qeb_x; real_T c25_vi_a; real_T c25_clb_b; real_T c25_nkb_y; real_T c25_dlb_b; real_T c25_okb_y; real_T c25_elb_b; real_T c25_pkb_y; real_T c25_flb_b; real_T c25_qkb_y; real_T c25_reb_x; real_T c25_seb_x; real_T c25_wi_a; real_T c25_glb_b; real_T c25_rkb_y; real_T c25_hlb_b; real_T c25_skb_y; real_T c25_teb_x; real_T c25_ueb_x; real_T c25_xi_a; real_T c25_ilb_b; real_T c25_tkb_y; real_T c25_jlb_b; real_T c25_ukb_y; real_T c25_klb_b; real_T c25_vkb_y; real_T c25_llb_b; real_T c25_wkb_y; real_T c25_mlb_b; real_T c25_xkb_y; real_T c25_veb_x; real_T c25_web_x; real_T c25_yi_a; real_T c25_nlb_b; real_T c25_ykb_y; real_T c25_olb_b; real_T c25_alb_y; real_T c25_plb_b; real_T c25_blb_y; real_T c25_qlb_b; real_T c25_clb_y; real_T c25_rlb_b; real_T c25_dlb_y; real_T c25_xeb_x; real_T c25_yeb_x; real_T c25_aj_a; real_T c25_slb_b; real_T c25_elb_y; real_T c25_tlb_b; real_T c25_flb_y; real_T c25_afb_x; real_T c25_bfb_x; real_T c25_bj_a; real_T c25_ulb_b; real_T c25_glb_y; real_T c25_vlb_b; real_T c25_hlb_y; real_T c25_wlb_b; real_T c25_ilb_y; real_T c25_xlb_b; real_T c25_jlb_y; real_T c25_ylb_b; real_T c25_klb_y; real_T c25_amb_b; real_T c25_llb_y; real_T c25_cfb_x; real_T c25_dfb_x; real_T c25_cj_a; real_T c25_bmb_b; real_T c25_mlb_y; real_T c25_cmb_b; real_T c25_nlb_y; real_T c25_efb_x; real_T c25_ffb_x; real_T c25_dj_a; real_T c25_dmb_b; real_T c25_olb_y; real_T c25_emb_b; real_T c25_plb_y; real_T c25_gfb_x; real_T c25_hfb_x; real_T c25_ej_a; real_T c25_fmb_b; real_T c25_qlb_y; real_T c25_gmb_b; real_T c25_rlb_y; real_T c25_ifb_x; real_T c25_jfb_x; real_T c25_fj_a; real_T c25_hmb_b; real_T c25_slb_y; real_T c25_imb_b; real_T c25_tlb_y; real_T c25_kfb_x; real_T c25_lfb_x; real_T c25_gj_a; real_T c25_jmb_b; real_T c25_ulb_y; real_T c25_kmb_b; real_T c25_vlb_y; real_T c25_lmb_b; real_T c25_wlb_y; real_T c25_mfb_x; real_T c25_nfb_x; real_T c25_hj_a; real_T c25_mmb_b; real_T c25_xlb_y; real_T c25_nmb_b; real_T c25_ylb_y; real_T c25_ofb_x; real_T c25_pfb_x; real_T c25_ij_a; real_T c25_omb_b; real_T c25_amb_y; real_T c25_qfb_x; real_T c25_rfb_x; real_T c25_jj_a; real_T c25_pmb_b; real_T c25_bmb_y; real_T c25_qmb_b; real_T c25_cmb_y; real_T c25_rmb_b; real_T c25_dmb_y; real_T c25_sfb_x; real_T c25_tfb_x; real_T c25_kj_a; real_T c25_smb_b; real_T c25_emb_y; real_T c25_tmb_b; real_T c25_fmb_y; real_T c25_umb_b; real_T c25_gmb_y; real_T c25_ufb_x; real_T c25_vfb_x; real_T c25_lj_a; real_T c25_vmb_b; real_T c25_hmb_y; real_T c25_wmb_b; real_T c25_imb_y; real_T c25_xmb_b; real_T c25_jmb_y; real_T c25_wfb_x; real_T c25_xfb_x; real_T c25_mj_a; real_T c25_ymb_b; real_T c25_kmb_y; real_T c25_anb_b; real_T c25_lmb_y; real_T c25_bnb_b; real_T c25_mmb_y; real_T c25_yfb_x; real_T c25_agb_x; real_T c25_nj_a; real_T c25_cnb_b; real_T c25_nmb_y; real_T c25_dnb_b; real_T c25_omb_y; real_T c25_enb_b; real_T c25_pmb_y; real_T c25_bgb_x; real_T c25_cgb_x; real_T c25_oj_a; real_T c25_fnb_b; real_T c25_qmb_y; real_T c25_gnb_b; real_T c25_rmb_y; real_T c25_hnb_b; real_T c25_smb_y; real_T c25_inb_b; real_T c25_tmb_y; real_T c25_dgb_x; real_T c25_egb_x; real_T c25_pj_a; real_T c25_jnb_b; real_T c25_umb_y; real_T c25_knb_b; real_T c25_vmb_y; real_T c25_lnb_b; real_T c25_wmb_y; real_T c25_mnb_b; real_T c25_xmb_y; real_T c25_nnb_b; real_T c25_ymb_y; real_T c25_fgb_x; real_T c25_ggb_x; real_T c25_qj_a; real_T c25_onb_b; real_T c25_anb_y; real_T c25_pnb_b; real_T c25_bnb_y; real_T c25_qnb_b; real_T c25_cnb_y; real_T c25_hgb_x; real_T c25_igb_x; real_T c25_rj_a; real_T c25_rnb_b; real_T c25_dnb_y; real_T c25_snb_b; real_T c25_enb_y; real_T c25_tnb_b; real_T c25_fnb_y; real_T c25_unb_b; real_T c25_gnb_y; real_T c25_vnb_b; real_T c25_hnb_y; real_T c25_wnb_b; real_T c25_inb_y; real_T c25_jgb_x; real_T c25_kgb_x; real_T c25_sj_a; real_T c25_xnb_b; real_T c25_jnb_y; real_T c25_ynb_b; real_T c25_knb_y; real_T c25_aob_b; real_T c25_lnb_y; real_T c25_bob_b; real_T c25_mnb_y; real_T c25_cob_b; real_T c25_nnb_y; real_T c25_dob_b; real_T c25_onb_y; real_T c25_lgb_x; real_T c25_mgb_x; real_T c25_tj_a; real_T c25_eob_b; real_T c25_pnb_y; real_T c25_fob_b; real_T c25_qnb_y; real_T c25_ngb_x; real_T c25_ogb_x; real_T c25_uj_a; real_T c25_gob_b; real_T c25_rnb_y; real_T c25_hob_b; real_T c25_snb_y; real_T c25_pgb_x; real_T c25_qgb_x; real_T c25_vj_a; real_T c25_iob_b; real_T c25_tnb_y; real_T c25_job_b; real_T c25_unb_y; real_T c25_rgb_x; real_T c25_sgb_x; real_T c25_wj_a; real_T c25_kob_b; real_T c25_vnb_y; real_T c25_lob_b; real_T c25_wnb_y; real_T c25_tgb_x; real_T c25_ugb_x; real_T c25_xj_a; real_T c25_mob_b; real_T c25_xnb_y; real_T c25_nob_b; real_T c25_ynb_y; real_T c25_vgb_x; real_T c25_wgb_x; real_T c25_yj_a; real_T c25_oob_b; real_T c25_aob_y; real_T c25_pob_b; real_T c25_bob_y; real_T c25_xgb_x; real_T c25_ygb_x; real_T c25_ak_a; real_T c25_qob_b; real_T c25_cob_y; real_T c25_rob_b; real_T c25_dob_y; real_T c25_sob_b; real_T c25_eob_y; real_T c25_ahb_x; real_T c25_bhb_x; real_T c25_bk_a; real_T c25_tob_b; real_T c25_fob_y; real_T c25_uob_b; real_T c25_gob_y; real_T c25_vob_b; real_T c25_hob_y; real_T c25_chb_x; real_T c25_dhb_x; real_T c25_ck_a; real_T c25_wob_b; real_T c25_iob_y; real_T c25_xob_b; real_T c25_job_y; real_T c25_yob_b; real_T c25_kob_y; real_T c25_ehb_x; real_T c25_fhb_x; real_T c25_dk_a; real_T c25_apb_b; real_T c25_lob_y; real_T c25_bpb_b; real_T c25_mob_y; real_T c25_cpb_b; real_T c25_nob_y; real_T c25_ghb_x; real_T c25_hhb_x; real_T c25_ek_a; real_T c25_dpb_b; real_T c25_oob_y; real_T c25_epb_b; real_T c25_pob_y; real_T c25_fpb_b; real_T c25_qob_y; real_T c25_ihb_x; real_T c25_jhb_x; real_T c25_fk_a; real_T c25_gpb_b; real_T c25_rob_y; real_T c25_hpb_b; real_T c25_sob_y; real_T c25_ipb_b; real_T c25_tob_y; real_T c25_khb_x; real_T c25_lhb_x; real_T c25_gk_a; real_T c25_jpb_b; real_T c25_uob_y; real_T c25_kpb_b; real_T c25_vob_y; real_T c25_lpb_b; real_T c25_wob_y; real_T c25_mhb_x; real_T c25_nhb_x; real_T c25_hk_a; real_T c25_mpb_b; real_T c25_xob_y; real_T c25_npb_b; real_T c25_yob_y; real_T c25_opb_b; real_T c25_apb_y; real_T c25_ohb_x; real_T c25_phb_x; real_T c25_ik_a; real_T c25_ppb_b; real_T c25_bpb_y; real_T c25_qpb_b; real_T c25_cpb_y; real_T c25_rpb_b; real_T c25_dpb_y; real_T c25_qhb_x; real_T c25_rhb_x; real_T c25_jk_a; real_T c25_spb_b; real_T c25_epb_y; real_T c25_tpb_b; real_T c25_fpb_y; real_T c25_upb_b; real_T c25_gpb_y; real_T c25_vpb_b; real_T c25_hpb_y; real_T c25_shb_x; real_T c25_thb_x; real_T c25_kk_a; real_T c25_wpb_b; real_T c25_ipb_y; real_T c25_xpb_b; real_T c25_jpb_y; real_T c25_uhb_x; real_T c25_vhb_x; real_T c25_lk_a; real_T c25_ypb_b; real_T c25_kpb_y; real_T c25_aqb_b; real_T c25_lpb_y; real_T c25_bqb_b; real_T c25_mpb_y; real_T c25_cqb_b; real_T c25_npb_y; real_T c25_dqb_b; real_T c25_opb_y; real_T c25_whb_x; real_T c25_xhb_x; real_T c25_mk_a; real_T c25_eqb_b; real_T c25_ppb_y; real_T c25_fqb_b; real_T c25_qpb_y; real_T c25_yhb_x; real_T c25_aib_x; real_T c25_nk_a; real_T c25_gqb_b; real_T c25_rpb_y; real_T c25_hqb_b; real_T c25_spb_y; real_T c25_bib_x; real_T c25_cib_x; real_T c25_ok_a; real_T c25_iqb_b; real_T c25_tpb_y; real_T c25_jqb_b; real_T c25_upb_y; real_T c25_kqb_b; real_T c25_vpb_y; real_T c25_lqb_b; real_T c25_wpb_y; real_T c25_mqb_b; real_T c25_xpb_y; real_T c25_nqb_b; real_T c25_ypb_y; real_T c25_dib_x; real_T c25_eib_x; real_T c25_pk_a; real_T c25_oqb_b; real_T c25_aqb_y; real_T c25_pqb_b; real_T c25_bqb_y; real_T c25_fib_x; real_T c25_gib_x; real_T c25_qk_a; real_T c25_qqb_b; real_T c25_cqb_y; real_T c25_rqb_b; real_T c25_dqb_y; real_T c25_hib_x; real_T c25_iib_x; real_T c25_rk_a; real_T c25_sqb_b; real_T c25_eqb_y; real_T c25_tqb_b; real_T c25_fqb_y; real_T c25_jib_x; real_T c25_kib_x; real_T c25_sk_a; real_T c25_uqb_b; real_T c25_gqb_y; real_T c25_vqb_b; real_T c25_hqb_y; real_T c25_wqb_b; real_T c25_iqb_y; real_T c25_lib_x; real_T c25_mib_x; real_T c25_tk_a; real_T c25_xqb_b; real_T c25_jqb_y; real_T c25_yqb_b; real_T c25_kqb_y; real_T c25_nib_x; real_T c25_oib_x; real_T c25_uk_a; real_T c25_arb_b; real_T c25_lqb_y; real_T c25_pib_x; real_T c25_qib_x; real_T c25_vk_a; real_T c25_brb_b; real_T c25_mqb_y; real_T c25_crb_b; real_T c25_nqb_y; real_T c25_rib_x; real_T c25_sib_x; real_T c25_wk_a; real_T c25_drb_b; real_T c25_oqb_y; real_T c25_tib_x; real_T c25_uib_x; real_T c25_xk_a; real_T c25_erb_b; real_T c25_pqb_y; real_T c25_frb_b; real_T c25_qqb_y; real_T c25_vib_x; real_T c25_wib_x; real_T c25_yk_a; real_T c25_grb_b; real_T c25_rqb_y; real_T c25_xib_x; real_T c25_yib_x; real_T c25_al_a; real_T c25_hrb_b; real_T c25_sqb_y; real_T c25_irb_b; real_T c25_tqb_y; real_T c25_ajb_x; real_T c25_bjb_x; real_T c25_bl_a; real_T c25_jrb_b; real_T c25_uqb_y; real_T c25_cjb_x; real_T c25_djb_x; real_T c25_cl_a; real_T c25_krb_b; real_T c25_vqb_y; real_T c25_lrb_b; real_T c25_wqb_y; real_T c25_ejb_x; real_T c25_fjb_x; real_T c25_dl_a; real_T c25_mrb_b; real_T c25_xqb_y; real_T c25_gjb_x; real_T c25_hjb_x; real_T c25_el_a; real_T c25_nrb_b; real_T c25_yqb_y; real_T c25_orb_b; real_T c25_arb_y; real_T c25_prb_b; real_T c25_brb_y; real_T c25_ijb_x; real_T c25_jjb_x; real_T c25_fl_a; real_T c25_qrb_b; real_T c25_crb_y; real_T c25_rrb_b; real_T c25_drb_y; real_T c25_srb_b; real_T c25_erb_y; real_T c25_kjb_x; real_T c25_ljb_x; real_T c25_gl_a; real_T c25_trb_b; real_T c25_frb_y; real_T c25_urb_b; real_T c25_grb_y; real_T c25_vrb_b; real_T c25_hrb_y; real_T c25_wrb_b; real_T c25_irb_y; real_T c25_mjb_x; real_T c25_njb_x; real_T c25_hl_a; real_T c25_xrb_b; real_T c25_jrb_y; real_T c25_yrb_b; real_T c25_krb_y; real_T c25_asb_b; real_T c25_lrb_y; real_T c25_ojb_x; real_T c25_pjb_x; real_T c25_il_a; real_T c25_bsb_b; real_T c25_mrb_y; real_T c25_csb_b; real_T c25_nrb_y; real_T c25_dsb_b; real_T c25_orb_y; real_T c25_esb_b; real_T c25_prb_y; real_T c25_qjb_x; real_T c25_rjb_x; real_T c25_jl_a; real_T c25_fsb_b; real_T c25_qrb_y; real_T c25_gsb_b; real_T c25_rrb_y; real_T c25_hsb_b; real_T c25_srb_y; real_T c25_isb_b; real_T c25_trb_y; real_T c25_jsb_b; real_T c25_urb_y; real_T c25_sjb_x; real_T c25_tjb_x; real_T c25_kl_a; real_T c25_ksb_b; real_T c25_vrb_y; real_T c25_lsb_b; real_T c25_wrb_y; real_T c25_msb_b; real_T c25_xrb_y; real_T c25_ujb_x; real_T c25_vjb_x; real_T c25_ll_a; real_T c25_nsb_b; real_T c25_yrb_y; real_T c25_osb_b; real_T c25_asb_y; real_T c25_psb_b; real_T c25_bsb_y; real_T c25_qsb_b; real_T c25_csb_y; real_T c25_rsb_b; real_T c25_dsb_y; real_T c25_ssb_b; real_T c25_esb_y; real_T c25_wjb_x; real_T c25_xjb_x; real_T c25_ml_a; real_T c25_tsb_b; real_T c25_fsb_y; real_T c25_usb_b; real_T c25_gsb_y; real_T c25_vsb_b; real_T c25_hsb_y; real_T c25_wsb_b; real_T c25_isb_y; real_T c25_xsb_b; real_T c25_jsb_y; real_T c25_ysb_b; real_T c25_ksb_y; real_T c25_yjb_x; real_T c25_akb_x; real_T c25_nl_a; real_T c25_atb_b; real_T c25_lsb_y; real_T c25_btb_b; real_T c25_msb_y; real_T c25_bkb_x; real_T c25_ckb_x; real_T c25_ol_a; real_T c25_ctb_b; real_T c25_nsb_y; real_T c25_dtb_b; real_T c25_osb_y; real_T c25_dkb_x; real_T c25_ekb_x; real_T c25_pl_a; real_T c25_etb_b; real_T c25_psb_y; real_T c25_ftb_b; real_T c25_qsb_y; real_T c25_gtb_b; real_T c25_rsb_y; real_T c25_fkb_x; real_T c25_gkb_x; real_T c25_ql_a; real_T c25_htb_b; real_T c25_ssb_y; real_T c25_itb_b; real_T c25_tsb_y; real_T c25_jtb_b; real_T c25_usb_y; real_T c25_hkb_x; real_T c25_ikb_x; real_T c25_rl_a; real_T c25_ktb_b; real_T c25_vsb_y; real_T c25_ltb_b; real_T c25_wsb_y; real_T c25_mtb_b; real_T c25_xsb_y; real_T c25_jkb_x; real_T c25_kkb_x; real_T c25_sl_a; real_T c25_ntb_b; real_T c25_ysb_y; real_T c25_otb_b; real_T c25_atb_y; real_T c25_ptb_b; real_T c25_btb_y; real_T c25_lkb_x; real_T c25_mkb_x; real_T c25_tl_a; real_T c25_qtb_b; real_T c25_ctb_y; real_T c25_rtb_b; real_T c25_dtb_y; real_T c25_stb_b; real_T c25_etb_y; real_T c25_ttb_b; real_T c25_ftb_y; real_T c25_nkb_x; real_T c25_okb_x; real_T c25_ul_a; real_T c25_utb_b; real_T c25_gtb_y; real_T c25_vtb_b; real_T c25_htb_y; real_T c25_wtb_b; real_T c25_itb_y; real_T c25_xtb_b; real_T c25_jtb_y; real_T c25_ytb_b; real_T c25_ktb_y; real_T c25_pkb_x; real_T c25_qkb_x; real_T c25_vl_a; real_T c25_aub_b; real_T c25_ltb_y; real_T c25_bub_b; real_T c25_mtb_y; real_T c25_cub_b; real_T c25_ntb_y; real_T c25_dub_b; real_T c25_otb_y; real_T c25_rkb_x; real_T c25_skb_x; real_T c25_wl_a; real_T c25_eub_b; real_T c25_ptb_y; real_T c25_fub_b; real_T c25_qtb_y; real_T c25_gub_b; real_T c25_rtb_y; real_T c25_hub_b; real_T c25_stb_y; real_T c25_iub_b; real_T c25_ttb_y; real_T c25_tkb_x; real_T c25_ukb_x; real_T c25_xl_a; real_T c25_jub_b; real_T c25_utb_y; real_T c25_kub_b; real_T c25_vtb_y; real_T c25_vkb_x; real_T c25_wkb_x; real_T c25_yl_a; real_T c25_lub_b; real_T c25_wtb_y; real_T c25_mub_b; real_T c25_xtb_y; real_T c25_nub_b; real_T c25_ytb_y; real_T c25_oub_b; real_T c25_aub_y; real_T c25_pub_b; real_T c25_bub_y; real_T c25_qub_b; real_T c25_cub_y; real_T c25_xkb_x; real_T c25_ykb_x; real_T c25_am_a; real_T c25_rub_b; real_T c25_dub_y; real_T c25_sub_b; real_T c25_eub_y; real_T c25_alb_x; real_T c25_blb_x; real_T c25_bm_a; real_T c25_tub_b; real_T c25_fub_y; real_T c25_uub_b; real_T c25_gub_y; real_T c25_vub_b; real_T c25_hub_y; real_T c25_clb_x; real_T c25_dlb_x; real_T c25_cm_a; real_T c25_wub_b; real_T c25_iub_y; real_T c25_xub_b; real_T c25_jub_y; real_T c25_elb_x; real_T c25_flb_x; real_T c25_dm_a; real_T c25_yub_b; real_T c25_kub_y; real_T c25_glb_x; real_T c25_hlb_x; real_T c25_em_a; real_T c25_avb_b; real_T c25_lub_y; real_T c25_bvb_b; real_T c25_mub_y; real_T c25_ilb_x; real_T c25_jlb_x; real_T c25_fm_a; real_T c25_cvb_b; real_T c25_nub_y; real_T c25_klb_x; real_T c25_llb_x; real_T c25_dvb_b; real_T c25_oub_y; real_T c25_mlb_x; real_T c25_nlb_x; real_T c25_evb_b; real_T c25_pub_y; real_T c25_olb_x; real_T c25_plb_x; real_T c25_fvb_b; real_T c25_qub_y; real_T c25_gm_a; real_T c25_gvb_b; real_T c25_rub_y; real_T c25_hvb_b; real_T c25_sub_y; real_T c25_qlb_x; real_T c25_rlb_x; real_T c25_ivb_b; real_T c25_tub_y; real_T c25_slb_x; real_T c25_tlb_x; real_T c25_jvb_b; real_T c25_uub_y; real_T c25_ulb_x; real_T c25_vlb_x; real_T c25_hm_a; real_T c25_kvb_b; real_T c25_vub_y; real_T c25_wlb_x; real_T c25_xlb_x; real_T c25_lvb_b; real_T c25_wub_y; real_T c25_ylb_x; real_T c25_amb_x; real_T c25_im_a; real_T c25_mvb_b; real_T c25_xub_y; real_T c25_bmb_x; real_T c25_cmb_x; real_T c25_nvb_b; real_T c25_yub_y; real_T c25_dmb_x; real_T c25_emb_x; real_T c25_jm_a; real_T c25_ovb_b; real_T c25_avb_y; real_T c25_fmb_x; real_T c25_gmb_x; real_T c25_pvb_b; real_T c25_bvb_y; real_T c25_hmb_x; real_T c25_imb_x; real_T c25_km_a; real_T c25_qvb_b; real_T c25_cvb_y; real_T c25_jmb_x; real_T c25_kmb_x; real_T c25_lm_a; real_T c25_rvb_b; real_T c25_dvb_y; real_T c25_lmb_x; real_T c25_mmb_x; real_T c25_svb_b; real_T c25_evb_y; real_T c25_nmb_x; real_T c25_omb_x; real_T c25_mm_a; real_T c25_tvb_b; real_T c25_fvb_y; real_T c25_pmb_x; real_T c25_qmb_x; real_T c25_nm_a; real_T c25_uvb_b; real_T c25_gvb_y; real_T c25_om_a; real_T c25_vvb_b; real_T c25_hvb_y; real_T c25_wvb_b; real_T c25_ivb_y; real_T c25_rmb_x; real_T c25_smb_x; real_T c25_xvb_b; real_T c25_jvb_y; real_T c25_tmb_x; real_T c25_umb_x; real_T c25_yvb_b; real_T c25_kvb_y; real_T c25_vmb_x; real_T c25_wmb_x; real_T c25_pm_a; real_T c25_awb_b; real_T c25_lvb_y; real_T c25_xmb_x; real_T c25_ymb_x; real_T c25_bwb_b; real_T c25_mvb_y; real_T c25_anb_x; real_T c25_bnb_x; real_T c25_qm_a; real_T c25_cwb_b; real_T c25_nvb_y; real_T c25_cnb_x; real_T c25_dnb_x; real_T c25_dwb_b; real_T c25_ovb_y; real_T c25_enb_x; real_T c25_fnb_x; real_T c25_rm_a; real_T c25_ewb_b; real_T c25_pvb_y; real_T c25_gnb_x; real_T c25_hnb_x; real_T c25_sm_a; real_T c25_fwb_b; real_T c25_qvb_y; real_T c25_inb_x; real_T c25_jnb_x; real_T c25_gwb_b; real_T c25_rvb_y; real_T c25_knb_x; real_T c25_lnb_x; real_T c25_tm_a; real_T c25_hwb_b; real_T c25_svb_y; real_T c25_mnb_x; real_T c25_nnb_x; real_T c25_um_a; real_T c25_iwb_b; real_T c25_tvb_y; real_T c25_vm_a; real_T c25_jwb_b; real_T c25_uvb_y; real_T c25_kwb_b; real_T c25_vvb_y; real_T c25_lwb_b; real_T c25_wvb_y; real_T c25_onb_x; real_T c25_pnb_x; real_T c25_wm_a; real_T c25_mwb_b; real_T c25_xvb_y; real_T c25_nwb_b; real_T c25_yvb_y; real_T c25_qnb_x; real_T c25_rnb_x; real_T c25_xm_a; real_T c25_owb_b; real_T c25_awb_y; real_T c25_pwb_b; real_T c25_bwb_y; real_T c25_snb_x; real_T c25_tnb_x; real_T c25_ym_a; real_T c25_qwb_b; real_T c25_cwb_y; real_T c25_rwb_b; real_T c25_dwb_y; real_T c25_unb_x; real_T c25_vnb_x; real_T c25_an_a; real_T c25_swb_b; real_T c25_ewb_y; real_T c25_twb_b; real_T c25_fwb_y; real_T c25_wnb_x; real_T c25_xnb_x; real_T c25_bn_a; real_T c25_uwb_b; real_T c25_gwb_y; real_T c25_vwb_b; real_T c25_hwb_y; real_T c25_ynb_x; real_T c25_aob_x; real_T c25_cn_a; real_T c25_wwb_b; real_T c25_iwb_y; real_T c25_xwb_b; real_T c25_jwb_y; real_T c25_bob_x; real_T c25_cob_x; real_T c25_dn_a; real_T c25_ywb_b; real_T c25_kwb_y; real_T c25_axb_b; real_T c25_lwb_y; real_T c25_dob_x; real_T c25_eob_x; real_T c25_en_a; real_T c25_bxb_b; real_T c25_mwb_y; real_T c25_cxb_b; real_T c25_nwb_y; real_T c25_fob_x; real_T c25_gob_x; real_T c25_fn_a; real_T c25_dxb_b; real_T c25_owb_y; real_T c25_exb_b; real_T c25_pwb_y; real_T c25_hob_x; real_T c25_iob_x; real_T c25_gn_a; real_T c25_fxb_b; real_T c25_qwb_y; real_T c25_gxb_b; real_T c25_rwb_y; real_T c25_job_x; real_T c25_kob_x; real_T c25_hn_a; real_T c25_hxb_b; real_T c25_swb_y; real_T c25_ixb_b; real_T c25_twb_y; real_T c25_lob_x; real_T c25_mob_x; real_T c25_in_a; real_T c25_jxb_b; real_T c25_uwb_y; real_T c25_kxb_b; real_T c25_vwb_y; real_T c25_nob_x; real_T c25_oob_x; real_T c25_jn_a; real_T c25_lxb_b; real_T c25_wwb_y; real_T c25_mxb_b; real_T c25_xwb_y; real_T c25_pob_x; real_T c25_qob_x; real_T c25_kn_a; real_T c25_nxb_b; real_T c25_ywb_y; real_T c25_oxb_b; real_T c25_axb_y; real_T c25_rob_x; real_T c25_sob_x; real_T c25_ln_a; real_T c25_pxb_b; real_T c25_bxb_y; real_T c25_qxb_b; real_T c25_cxb_y; real_T c25_tob_x; real_T c25_uob_x; real_T c25_mn_a; real_T c25_rxb_b; real_T c25_dxb_y; real_T c25_sxb_b; real_T c25_exb_y; real_T c25_vob_x; real_T c25_wob_x; real_T c25_nn_a; real_T c25_txb_b; real_T c25_fxb_y; real_T c25_uxb_b; real_T c25_gxb_y; real_T c25_xob_x; real_T c25_yob_x; real_T c25_on_a; real_T c25_vxb_b; real_T c25_hxb_y; real_T c25_wxb_b; real_T c25_ixb_y; real_T c25_apb_x; real_T c25_bpb_x; real_T c25_pn_a; real_T c25_xxb_b; real_T c25_jxb_y; real_T c25_yxb_b; real_T c25_kxb_y; real_T c25_ayb_b; real_T c25_lxb_y; real_T c25_cpb_x; real_T c25_dpb_x; real_T c25_qn_a; real_T c25_byb_b; real_T c25_mxb_y; real_T c25_cyb_b; real_T c25_nxb_y; real_T c25_epb_x; real_T c25_fpb_x; real_T c25_rn_a; real_T c25_dyb_b; real_T c25_oxb_y; real_T c25_eyb_b; real_T c25_pxb_y; real_T c25_gpb_x; real_T c25_hpb_x; real_T c25_sn_a; real_T c25_fyb_b; real_T c25_qxb_y; real_T c25_gyb_b; real_T c25_rxb_y; real_T c25_ipb_x; real_T c25_jpb_x; real_T c25_tn_a; real_T c25_hyb_b; real_T c25_sxb_y; real_T c25_iyb_b; real_T c25_txb_y; real_T c25_kpb_x; real_T c25_lpb_x; real_T c25_un_a; real_T c25_jyb_b; real_T c25_uxb_y; real_T c25_mpb_x; real_T c25_npb_x; real_T c25_vn_a; real_T c25_kyb_b; real_T c25_vxb_y; real_T c25_lyb_b; real_T c25_wxb_y; real_T c25_opb_x; real_T c25_ppb_x; real_T c25_wn_a; real_T c25_myb_b; real_T c25_xxb_y; real_T c25_qpb_x; real_T c25_rpb_x; real_T c25_xn_a; real_T c25_nyb_b; real_T c25_yxb_y; real_T c25_oyb_b; real_T c25_ayb_y; real_T c25_spb_x; real_T c25_tpb_x; real_T c25_yn_a; real_T c25_pyb_b; real_T c25_byb_y; real_T c25_upb_x; real_T c25_vpb_x; real_T c25_ao_a; real_T c25_qyb_b; real_T c25_cyb_y; real_T c25_ryb_b; real_T c25_dyb_y; real_T c25_wpb_x; real_T c25_xpb_x; real_T c25_bo_a; real_T c25_syb_b; real_T c25_eyb_y; real_T c25_ypb_x; real_T c25_aqb_x; real_T c25_co_a; real_T c25_tyb_b; real_T c25_fyb_y; real_T c25_uyb_b; real_T c25_gyb_y; real_T c25_bqb_x; real_T c25_cqb_x; real_T c25_do_a; real_T c25_vyb_b; real_T c25_hyb_y; real_T c25_dqb_x; real_T c25_eqb_x; real_T c25_eo_a; real_T c25_wyb_b; real_T c25_iyb_y; real_T c25_xyb_b; real_T c25_jyb_y; real_T c25_fqb_x; real_T c25_gqb_x; real_T c25_fo_a; real_T c25_yyb_b; real_T c25_kyb_y; real_T c25_hqb_x; real_T c25_iqb_x; real_T c25_go_a; real_T c25_aac_b; real_T c25_lyb_y; real_T c25_bac_b; real_T c25_myb_y; real_T c25_jqb_x; real_T c25_kqb_x; real_T c25_ho_a; real_T c25_cac_b; real_T c25_nyb_y; real_T c25_lqb_x; real_T c25_mqb_x; real_T c25_io_a; real_T c25_dac_b; real_T c25_oyb_y; real_T c25_eac_b; real_T c25_pyb_y; real_T c25_nqb_x; real_T c25_oqb_x; real_T c25_jo_a; real_T c25_fac_b; real_T c25_qyb_y; real_T c25_pqb_x; real_T c25_qqb_x; real_T c25_ko_a; real_T c25_gac_b; real_T c25_ryb_y; real_T c25_hac_b; real_T c25_syb_y; real_T c25_rqb_x; real_T c25_sqb_x; real_T c25_lo_a; real_T c25_iac_b; real_T c25_tyb_y; real_T c25_tqb_x; real_T c25_uqb_x; real_T c25_mo_a; real_T c25_jac_b; real_T c25_uyb_y; real_T c25_kac_b; real_T c25_vyb_y; real_T c25_vqb_x; real_T c25_wqb_x; real_T c25_no_a; real_T c25_lac_b; real_T c25_wyb_y; real_T c25_xqb_x; real_T c25_yqb_x; real_T c25_oo_a; real_T c25_mac_b; real_T c25_xyb_y; real_T c25_nac_b; real_T c25_yyb_y; real_T c25_arb_x; real_T c25_brb_x; real_T c25_po_a; real_T c25_oac_b; real_T c25_aac_y; real_T c25_crb_x; real_T c25_drb_x; real_T c25_qo_a; real_T c25_pac_b; real_T c25_bac_y; real_T c25_erb_x; real_T c25_frb_x; real_T c25_ro_a; real_T c25_qac_b; real_T c25_cac_y; real_T c25_rac_b; real_T c25_dac_y; real_T c25_grb_x; real_T c25_hrb_x; real_T c25_so_a; real_T c25_sac_b; real_T c25_eac_y; real_T c25_irb_x; real_T c25_jrb_x; real_T c25_to_a; real_T c25_tac_b; real_T c25_fac_y; real_T c25_krb_x; real_T c25_lrb_x; real_T c25_uo_a; real_T c25_uac_b; real_T c25_gac_y; real_T c25_vac_b; real_T c25_hac_y; real_T c25_mrb_x; real_T c25_nrb_x; real_T c25_vo_a; real_T c25_wac_b; real_T c25_iac_y; real_T c25_orb_x; real_T c25_prb_x; real_T c25_wo_a; real_T c25_xac_b; real_T c25_jac_y; real_T c25_qrb_x; real_T c25_rrb_x; real_T c25_xo_a; real_T c25_yac_b; real_T c25_kac_y; real_T c25_abc_b; real_T c25_lac_y; real_T c25_srb_x; real_T c25_trb_x; real_T c25_yo_a; real_T c25_bbc_b; real_T c25_mac_y; real_T c25_urb_x; real_T c25_vrb_x; real_T c25_ap_a; real_T c25_cbc_b; real_T c25_nac_y; real_T c25_wrb_x; real_T c25_xrb_x; real_T c25_bp_a; real_T c25_dbc_b; real_T c25_oac_y; real_T c25_ebc_b; real_T c25_pac_y; real_T c25_yrb_x; real_T c25_asb_x; real_T c25_cp_a; real_T c25_fbc_b; real_T c25_qac_y; real_T c25_bsb_x; real_T c25_csb_x; real_T c25_dp_a; real_T c25_gbc_b; real_T c25_rac_y; real_T c25_dsb_x; real_T c25_esb_x; real_T c25_ep_a; real_T c25_hbc_b; real_T c25_sac_y; real_T c25_ibc_b; real_T c25_tac_y; real_T c25_fsb_x; real_T c25_gsb_x; real_T c25_fp_a; real_T c25_jbc_b; real_T c25_uac_y; real_T c25_hsb_x; real_T c25_isb_x; real_T c25_gp_a; real_T c25_kbc_b; real_T c25_vac_y; real_T c25_jsb_x; real_T c25_ksb_x; real_T c25_hp_a; real_T c25_lbc_b; real_T c25_wac_y; real_T c25_mbc_b; real_T c25_xac_y; real_T c25_lsb_x; real_T c25_msb_x; real_T c25_ip_a; real_T c25_nbc_b; real_T c25_yac_y; real_T c25_nsb_x; real_T c25_osb_x; real_T c25_jp_a; real_T c25_obc_b; real_T c25_abc_y; real_T c25_psb_x; real_T c25_qsb_x; real_T c25_kp_a; real_T c25_pbc_b; real_T c25_bbc_y; real_T c25_qbc_b; real_T c25_cbc_y; real_T c25_rsb_x; real_T c25_ssb_x; real_T c25_lp_a; real_T c25_rbc_b; real_T c25_dbc_y; real_T c25_tsb_x; real_T c25_usb_x; real_T c25_mp_a; real_T c25_sbc_b; real_T c25_ebc_y; real_T c25_vsb_x; real_T c25_wsb_x; real_T c25_np_a; real_T c25_tbc_b; real_T c25_fbc_y; real_T c25_ubc_b; real_T c25_gbc_y; real_T c25_vbc_b; real_T c25_hbc_y; real_T c25_xsb_x; real_T c25_ysb_x; real_T c25_op_a; real_T c25_wbc_b; real_T c25_ibc_y; real_T c25_xbc_b; real_T c25_jbc_y; real_T c25_ybc_b; real_T c25_kbc_y; real_T c25_atb_x; real_T c25_btb_x; real_T c25_pp_a; real_T c25_acc_b; real_T c25_lbc_y; real_T c25_bcc_b; real_T c25_mbc_y; real_T c25_ccc_b; real_T c25_nbc_y; real_T c25_ctb_x; real_T c25_dtb_x; real_T c25_qp_a; real_T c25_dcc_b; real_T c25_obc_y; real_T c25_ecc_b; real_T c25_pbc_y; real_T c25_fcc_b; real_T c25_qbc_y; real_T c25_etb_x; real_T c25_ftb_x; real_T c25_rp_a; real_T c25_gcc_b; real_T c25_rbc_y; real_T c25_hcc_b; real_T c25_sbc_y; real_T c25_icc_b; real_T c25_tbc_y; real_T c25_gtb_x; real_T c25_htb_x; real_T c25_sp_a; real_T c25_jcc_b; real_T c25_ubc_y; real_T c25_kcc_b; real_T c25_vbc_y; real_T c25_lcc_b; real_T c25_wbc_y; real_T c25_mcc_b; real_T c25_xbc_y; real_T c25_ncc_b; real_T c25_ybc_y; real_T c25_occ_b; real_T c25_acc_y; real_T c25_itb_x; real_T c25_jtb_x; real_T c25_tp_a; real_T c25_pcc_b; real_T c25_bcc_y; real_T c25_qcc_b; real_T c25_ccc_y; real_T c25_ktb_x; real_T c25_ltb_x; real_T c25_up_a; real_T c25_rcc_b; real_T c25_dcc_y; real_T c25_scc_b; real_T c25_ecc_y; real_T c25_mtb_x; real_T c25_ntb_x; real_T c25_vp_a; real_T c25_tcc_b; real_T c25_fcc_y; real_T c25_ucc_b; real_T c25_gcc_y; real_T c25_vcc_b; real_T c25_hcc_y; real_T c25_otb_x; real_T c25_ptb_x; real_T c25_wp_a; real_T c25_wcc_b; real_T c25_icc_y; real_T c25_xcc_b; real_T c25_jcc_y; real_T c25_qtb_x; real_T c25_rtb_x; real_T c25_xp_a; real_T c25_ycc_b; real_T c25_kcc_y; real_T c25_adc_b; real_T c25_lcc_y; real_T c25_stb_x; real_T c25_ttb_x; real_T c25_yp_a; real_T c25_bdc_b; real_T c25_mcc_y; real_T c25_cdc_b; real_T c25_ncc_y; real_T c25_ddc_b; real_T c25_occ_y; real_T c25_edc_b; real_T c25_pcc_y; real_T c25_fdc_b; real_T c25_qcc_y; real_T c25_utb_x; real_T c25_vtb_x; real_T c25_aq_a; real_T c25_gdc_b; real_T c25_rcc_y; real_T c25_hdc_b; real_T c25_scc_y; real_T c25_wtb_x; real_T c25_xtb_x; real_T c25_bq_a; real_T c25_idc_b; real_T c25_tcc_y; real_T c25_jdc_b; real_T c25_ucc_y; real_T c25_ytb_x; real_T c25_aub_x; real_T c25_cq_a; real_T c25_kdc_b; real_T c25_vcc_y; real_T c25_ldc_b; real_T c25_wcc_y; real_T c25_bub_x; real_T c25_cub_x; real_T c25_dq_a; real_T c25_mdc_b; real_T c25_xcc_y; real_T c25_dub_x; real_T c25_eub_x; real_T c25_eq_a; real_T c25_ndc_b; real_T c25_ycc_y; real_T c25_odc_b; real_T c25_adc_y; real_T c25_fub_x; real_T c25_gub_x; real_T c25_fq_a; real_T c25_pdc_b; real_T c25_bdc_y; real_T c25_hub_x; real_T c25_iub_x; real_T c25_gq_a; real_T c25_qdc_b; real_T c25_cdc_y; real_T c25_rdc_b; real_T c25_ddc_y; real_T c25_jub_x; real_T c25_kub_x; real_T c25_hq_a; real_T c25_sdc_b; real_T c25_edc_y; real_T c25_lub_x; real_T c25_mub_x; real_T c25_iq_a; real_T c25_tdc_b; real_T c25_fdc_y; real_T c25_udc_b; real_T c25_gdc_y; real_T c25_nub_x; real_T c25_oub_x; real_T c25_jq_a; real_T c25_vdc_b; real_T c25_hdc_y; real_T c25_pub_x; real_T c25_qub_x; real_T c25_kq_a; real_T c25_wdc_b; real_T c25_idc_y; real_T c25_xdc_b; real_T c25_jdc_y; real_T c25_rub_x; real_T c25_sub_x; real_T c25_lq_a; real_T c25_ydc_b; real_T c25_kdc_y; real_T c25_tub_x; real_T c25_uub_x; real_T c25_mq_a; real_T c25_aec_b; real_T c25_ldc_y; real_T c25_bec_b; real_T c25_mdc_y; real_T c25_vub_x; real_T c25_wub_x; real_T c25_nq_a; real_T c25_cec_b; real_T c25_ndc_y; real_T c25_xub_x; real_T c25_yub_x; real_T c25_oq_a; real_T c25_dec_b; real_T c25_odc_y; real_T c25_eec_b; real_T c25_pdc_y; real_T c25_avb_x; real_T c25_bvb_x; real_T c25_pq_a; real_T c25_fec_b; real_T c25_qdc_y; real_T c25_cvb_x; real_T c25_dvb_x; real_T c25_qq_a; real_T c25_gec_b; real_T c25_rdc_y; real_T c25_hec_b; real_T c25_sdc_y; real_T c25_evb_x; real_T c25_fvb_x; real_T c25_rq_a; real_T c25_iec_b; real_T c25_tdc_y; real_T c25_gvb_x; real_T c25_hvb_x; real_T c25_sq_a; real_T c25_jec_b; real_T c25_udc_y; real_T c25_ivb_x; real_T c25_jvb_x; real_T c25_kec_b; real_T c25_vdc_y; real_T c25_lec_b; real_T c25_wdc_y; real_T c25_kvb_x; real_T c25_lvb_x; real_T c25_tq_a; real_T c25_mec_b; real_T c25_xdc_y; real_T c25_uq_a; real_T c25_nec_b; real_T c25_oec_b; real_T c25_ydc_y; real_T c25_pec_b; real_T c25_aec_y; real_T c25_mvb_x; real_T c25_nvb_x; real_T c25_vq_a; real_T c25_qec_b; real_T c25_bec_y; real_T c25_rec_b; real_T c25_cec_y; real_T c25_sec_b; real_T c25_dec_y; real_T c25_tec_b; real_T c25_eec_y; real_T c25_ovb_x; real_T c25_pvb_x; real_T c25_wq_a; real_T c25_uec_b; real_T c25_fec_y; real_T c25_vec_b; real_T c25_gec_y; real_T c25_wec_b; real_T c25_hec_y; real_T c25_qvb_x; real_T c25_rvb_x; real_T c25_xq_a; real_T c25_xec_b; real_T c25_iec_y; real_T c25_yec_b; real_T c25_jec_y; real_T c25_afc_b; real_T c25_kec_y; real_T c25_bfc_b; real_T c25_lec_y; real_T c25_svb_x; real_T c25_tvb_x; real_T c25_yq_a; real_T c25_cfc_b; real_T c25_mec_y; real_T c25_dfc_b; real_T c25_nec_y; real_T c25_efc_b; real_T c25_oec_y; real_T c25_uvb_x; real_T c25_vvb_x; real_T c25_ar_a; real_T c25_ffc_b; real_T c25_pec_y; real_T c25_gfc_b; real_T c25_qec_y; real_T c25_wvb_x; real_T c25_xvb_x; real_T c25_br_a; real_T c25_hfc_b; real_T c25_rec_y; real_T c25_ifc_b; real_T c25_sec_y; real_T c25_yvb_x; real_T c25_awb_x; real_T c25_cr_a; real_T c25_jfc_b; real_T c25_tec_y; real_T c25_kfc_b; real_T c25_uec_y; real_T c25_lfc_b; real_T c25_vec_y; real_T c25_mfc_b; real_T c25_wec_y; real_T c25_nfc_b; real_T c25_xec_y; real_T c25_bwb_x; real_T c25_cwb_x; real_T c25_dr_a; real_T c25_ofc_b; real_T c25_yec_y; real_T c25_pfc_b; real_T c25_afc_y; real_T c25_qfc_b; real_T c25_bfc_y; real_T c25_rfc_b; real_T c25_cfc_y; real_T c25_sfc_b; real_T c25_dfc_y; real_T c25_tfc_b; real_T c25_efc_y; real_T c25_dwb_x; real_T c25_ewb_x; real_T c25_er_a; real_T c25_ufc_b; real_T c25_ffc_y; real_T c25_vfc_b; real_T c25_gfc_y; real_T c25_wfc_b; real_T c25_hfc_y; real_T c25_xfc_b; real_T c25_ifc_y; real_T c25_yfc_b; real_T c25_jfc_y; real_T c25_agc_b; real_T c25_kfc_y; real_T c25_fwb_x; real_T c25_gwb_x; real_T c25_fr_a; real_T c25_bgc_b; real_T c25_lfc_y; real_T c25_cgc_b; real_T c25_mfc_y; real_T c25_hwb_x; real_T c25_iwb_x; real_T c25_gr_a; real_T c25_dgc_b; real_T c25_nfc_y; real_T c25_egc_b; real_T c25_ofc_y; real_T c25_jwb_x; real_T c25_kwb_x; real_T c25_hr_a; real_T c25_fgc_b; real_T c25_pfc_y; real_T c25_ggc_b; real_T c25_qfc_y; real_T c25_lwb_x; real_T c25_mwb_x; real_T c25_ir_a; real_T c25_hgc_b; real_T c25_rfc_y; real_T c25_igc_b; real_T c25_sfc_y; real_T c25_jgc_b; real_T c25_tfc_y; real_T c25_nwb_x; real_T c25_owb_x; real_T c25_jr_a; real_T c25_kgc_b; real_T c25_ufc_y; real_T c25_lgc_b; real_T c25_vfc_y; real_T c25_mgc_b; real_T c25_wfc_y; real_T c25_ngc_b; real_T c25_xfc_y; real_T c25_pwb_x; real_T c25_qwb_x; real_T c25_kr_a; real_T c25_ogc_b; real_T c25_yfc_y; real_T c25_pgc_b; real_T c25_agc_y; real_T c25_rwb_x; real_T c25_swb_x; real_T c25_lr_a; real_T c25_qgc_b; real_T c25_bgc_y; real_T c25_rgc_b; real_T c25_cgc_y; real_T c25_sgc_b; real_T c25_dgc_y; real_T c25_tgc_b; real_T c25_egc_y; real_T c25_ugc_b; real_T c25_fgc_y; real_T c25_twb_x; real_T c25_uwb_x; real_T c25_mr_a; real_T c25_vgc_b; real_T c25_ggc_y; real_T c25_wgc_b; real_T c25_hgc_y; real_T c25_xgc_b; real_T c25_igc_y; real_T c25_ygc_b; real_T c25_jgc_y; real_T c25_vwb_x; real_T c25_wwb_x; real_T c25_nr_a; real_T c25_ahc_b; real_T c25_kgc_y; real_T c25_bhc_b; real_T c25_lgc_y; real_T c25_xwb_x; real_T c25_ywb_x; real_T c25_or_a; real_T c25_chc_b; real_T c25_mgc_y; real_T c25_dhc_b; real_T c25_ngc_y; real_T c25_axb_x; real_T c25_bxb_x; real_T c25_pr_a; real_T c25_ehc_b; real_T c25_ogc_y; real_T c25_fhc_b; real_T c25_pgc_y; real_T c25_ghc_b; real_T c25_qgc_y; real_T c25_hhc_b; real_T c25_rgc_y; real_T c25_ihc_b; real_T c25_sgc_y; real_T c25_cxb_x; real_T c25_dxb_x; real_T c25_qr_a; real_T c25_jhc_b; real_T c25_tgc_y; real_T c25_khc_b; real_T c25_ugc_y; real_T c25_exb_x; real_T c25_fxb_x; real_T c25_rr_a; real_T c25_lhc_b; real_T c25_vgc_y; real_T c25_mhc_b; real_T c25_wgc_y; real_T c25_gxb_x; real_T c25_hxb_x; real_T c25_sr_a; real_T c25_nhc_b; real_T c25_xgc_y; real_T c25_ohc_b; real_T c25_ygc_y; real_T c25_phc_b; real_T c25_ahc_y; real_T c25_qhc_b; real_T c25_bhc_y; real_T c25_rhc_b; real_T c25_chc_y; real_T c25_shc_b; real_T c25_dhc_y; real_T c25_ixb_x; real_T c25_jxb_x; real_T c25_tr_a; real_T c25_thc_b; real_T c25_ehc_y; real_T c25_uhc_b; real_T c25_fhc_y; real_T c25_kxb_x; real_T c25_lxb_x; real_T c25_ur_a; real_T c25_vhc_b; real_T c25_ghc_y; real_T c25_whc_b; real_T c25_hhc_y; real_T c25_xhc_b; real_T c25_ihc_y; real_T c25_mxb_x; real_T c25_nxb_x; real_T c25_vr_a; real_T c25_yhc_b; real_T c25_jhc_y; real_T c25_aic_b; real_T c25_khc_y; real_T c25_bic_b; real_T c25_lhc_y; real_T c25_oxb_x; real_T c25_pxb_x; real_T c25_wr_a; real_T c25_cic_b; real_T c25_mhc_y; real_T c25_dic_b; real_T c25_nhc_y; real_T c25_qxb_x; real_T c25_rxb_x; real_T c25_xr_a; real_T c25_eic_b; real_T c25_ohc_y; real_T c25_fic_b; real_T c25_phc_y; real_T c25_sxb_x; real_T c25_txb_x; real_T c25_yr_a; real_T c25_gic_b; real_T c25_qhc_y; real_T c25_hic_b; real_T c25_rhc_y; real_T c25_uxb_x; real_T c25_vxb_x; real_T c25_as_a; real_T c25_iic_b; real_T c25_shc_y; real_T c25_wxb_x; real_T c25_xxb_x; real_T c25_bs_a; real_T c25_jic_b; real_T c25_thc_y; real_T c25_kic_b; real_T c25_uhc_y; real_T c25_yxb_x; real_T c25_ayb_x; real_T c25_cs_a; real_T c25_lic_b; real_T c25_vhc_y; real_T c25_byb_x; real_T c25_cyb_x; real_T c25_ds_a; real_T c25_mic_b; real_T c25_whc_y; real_T c25_nic_b; real_T c25_xhc_y; real_T c25_dyb_x; real_T c25_eyb_x; real_T c25_es_a; real_T c25_oic_b; real_T c25_yhc_y; real_T c25_fyb_x; real_T c25_gyb_x; real_T c25_fs_a; real_T c25_pic_b; real_T c25_aic_y; real_T c25_qic_b; real_T c25_bic_y; real_T c25_hyb_x; real_T c25_iyb_x; real_T c25_gs_a; real_T c25_ric_b; real_T c25_cic_y; real_T c25_jyb_x; real_T c25_kyb_x; real_T c25_hs_a; real_T c25_sic_b; real_T c25_dic_y; real_T c25_tic_b; real_T c25_eic_y; real_T c25_lyb_x; real_T c25_myb_x; real_T c25_is_a; real_T c25_uic_b; real_T c25_fic_y; real_T c25_nyb_x; real_T c25_oyb_x; real_T c25_js_a; real_T c25_vic_b; real_T c25_gic_y; real_T c25_pyb_x; real_T c25_qyb_x; real_T c25_ks_a; real_T c25_wic_b; real_T c25_hic_y; real_T c25_xic_b; real_T c25_iic_y; real_T c25_ryb_x; real_T c25_syb_x; real_T c25_ls_a; real_T c25_yic_b; real_T c25_jic_y; real_T c25_tyb_x; real_T c25_uyb_x; real_T c25_ms_a; real_T c25_ajc_b; real_T c25_kic_y; real_T c25_vyb_x; real_T c25_wyb_x; real_T c25_ns_a; real_T c25_bjc_b; real_T c25_lic_y; real_T c25_cjc_b; real_T c25_mic_y; real_T c25_xyb_x; real_T c25_yyb_x; real_T c25_os_a; real_T c25_djc_b; real_T c25_nic_y; real_T c25_aac_x; real_T c25_bac_x; real_T c25_ps_a; real_T c25_ejc_b; real_T c25_oic_y; real_T c25_cac_x; real_T c25_dac_x; real_T c25_qs_a; real_T c25_fjc_b; real_T c25_pic_y; real_T c25_gjc_b; real_T c25_qic_y; real_T c25_eac_x; real_T c25_fac_x; real_T c25_rs_a; real_T c25_hjc_b; real_T c25_ric_y; real_T c25_gac_x; real_T c25_hac_x; real_T c25_ss_a; real_T c25_ijc_b; real_T c25_sic_y; real_T c25_iac_x; real_T c25_jac_x; real_T c25_ts_a; real_T c25_jjc_b; real_T c25_tic_y; real_T c25_kjc_b; real_T c25_uic_y; real_T c25_kac_x; real_T c25_lac_x; real_T c25_us_a; real_T c25_ljc_b; real_T c25_vic_y; real_T c25_mac_x; real_T c25_nac_x; real_T c25_mjc_b; real_T c25_wic_y; real_T c25_oac_x; real_T c25_pac_x; real_T c25_njc_b; real_T c25_xic_y; real_T c25_vs_a; real_T c25_ojc_b; real_T c25_yic_y; real_T c25_pjc_b; real_T c25_ajc_y; real_T c25_qac_x; real_T c25_rac_x; real_T c25_qjc_b; real_T c25_bjc_y; real_T c25_sac_x; real_T c25_tac_x; real_T c25_rjc_b; real_T c25_cjc_y; real_T c25_uac_x; real_T c25_vac_x; real_T c25_ws_a; real_T c25_sjc_b; real_T c25_djc_y; real_T c25_xs_a; real_T c25_tjc_b; real_T c25_ejc_y; real_T c25_ujc_b; real_T c25_fjc_y; real_T c25_vjc_b; real_T c25_gjc_y; real_T c25_wac_x; real_T c25_xac_x; real_T c25_ys_a; real_T c25_wjc_b; real_T c25_hjc_y; real_T c25_xjc_b; real_T c25_ijc_y; real_T c25_yac_x; real_T c25_abc_x; real_T c25_at_a; real_T c25_yjc_b; real_T c25_jjc_y; real_T c25_akc_b; real_T c25_kjc_y; real_T c25_bbc_x; real_T c25_cbc_x; real_T c25_bt_a; real_T c25_bkc_b; real_T c25_ljc_y; real_T c25_ckc_b; real_T c25_mjc_y; real_T c25_dbc_x; real_T c25_ebc_x; real_T c25_ct_a; real_T c25_dkc_b; real_T c25_njc_y; real_T c25_ekc_b; real_T c25_ojc_y; real_T c25_fbc_x; real_T c25_gbc_x; real_T c25_dt_a; real_T c25_fkc_b; real_T c25_pjc_y; real_T c25_hbc_x; real_T c25_ibc_x; real_T c25_et_a; real_T c25_gkc_b; real_T c25_qjc_y; real_T c25_hkc_b; real_T c25_rjc_y; real_T c25_jbc_x; real_T c25_kbc_x; real_T c25_ft_a; real_T c25_ikc_b; real_T c25_sjc_y; real_T c25_lbc_x; real_T c25_mbc_x; real_T c25_gt_a; real_T c25_jkc_b; real_T c25_tjc_y; real_T c25_kkc_b; real_T c25_ujc_y; real_T c25_nbc_x; real_T c25_obc_x; real_T c25_ht_a; real_T c25_lkc_b; real_T c25_vjc_y; real_T c25_pbc_x; real_T c25_qbc_x; real_T c25_it_a; real_T c25_mkc_b; real_T c25_wjc_y; real_T c25_nkc_b; real_T c25_xjc_y; real_T c25_rbc_x; real_T c25_sbc_x; real_T c25_jt_a; real_T c25_okc_b; real_T c25_yjc_y; real_T c25_tbc_x; real_T c25_ubc_x; real_T c25_kt_a; real_T c25_pkc_b; real_T c25_akc_y; real_T c25_qkc_b; real_T c25_bkc_y; real_T c25_vbc_x; real_T c25_wbc_x; real_T c25_lt_a; real_T c25_rkc_b; real_T c25_ckc_y; real_T c25_xbc_x; real_T c25_ybc_x; real_T c25_mt_a; real_T c25_skc_b; real_T c25_dkc_y; real_T c25_acc_x; real_T c25_bcc_x; real_T c25_nt_a; real_T c25_tkc_b; real_T c25_ekc_y; real_T c25_ukc_b; real_T c25_fkc_y; real_T c25_ccc_x; real_T c25_dcc_x; real_T c25_ot_a; real_T c25_vkc_b; real_T c25_gkc_y; real_T c25_ecc_x; real_T c25_fcc_x; real_T c25_pt_a; real_T c25_wkc_b; real_T c25_hkc_y; real_T c25_gcc_x; real_T c25_hcc_x; real_T c25_qt_a; real_T c25_xkc_b; real_T c25_ikc_y; real_T c25_ykc_b; real_T c25_jkc_y; real_T c25_alc_b; real_T c25_kkc_y; real_T c25_icc_x; real_T c25_jcc_x; real_T c25_rt_a; real_T c25_blc_b; real_T c25_lkc_y; real_T c25_clc_b; real_T c25_mkc_y; real_T c25_dlc_b; real_T c25_nkc_y; real_T c25_kcc_x; real_T c25_lcc_x; real_T c25_st_a; real_T c25_elc_b; real_T c25_okc_y; real_T c25_flc_b; real_T c25_pkc_y; real_T c25_glc_b; real_T c25_qkc_y; real_T c25_mcc_x; real_T c25_ncc_x; real_T c25_tt_a; real_T c25_hlc_b; real_T c25_rkc_y; real_T c25_ilc_b; real_T c25_skc_y; real_T c25_jlc_b; real_T c25_tkc_y; real_T c25_occ_x; real_T c25_pcc_x; real_T c25_ut_a; real_T c25_klc_b; real_T c25_ukc_y; real_T c25_llc_b; real_T c25_vkc_y; real_T c25_mlc_b; real_T c25_wkc_y; real_T c25_qcc_x; real_T c25_rcc_x; real_T c25_vt_a; real_T c25_nlc_b; real_T c25_xkc_y; real_T c25_olc_b; real_T c25_ykc_y; real_T c25_scc_x; real_T c25_tcc_x; real_T c25_wt_a; real_T c25_plc_b; real_T c25_alc_y; real_T c25_qlc_b; real_T c25_blc_y; real_T c25_ucc_x; real_T c25_vcc_x; real_T c25_xt_a; real_T c25_rlc_b; real_T c25_clc_y; real_T c25_slc_b; real_T c25_dlc_y; real_T c25_wcc_x; real_T c25_xcc_x; real_T c25_yt_a; real_T c25_tlc_b; real_T c25_elc_y; real_T c25_ulc_b; real_T c25_flc_y; real_T c25_ycc_x; real_T c25_adc_x; real_T c25_au_a; real_T c25_vlc_b; real_T c25_glc_y; real_T c25_wlc_b; real_T c25_hlc_y; real_T c25_bdc_x; real_T c25_cdc_x; real_T c25_bu_a; real_T c25_xlc_b; real_T c25_ilc_y; real_T c25_ylc_b; real_T c25_jlc_y; real_T c25_ddc_x; real_T c25_edc_x; real_T c25_cu_a; real_T c25_amc_b; real_T c25_klc_y; real_T c25_bmc_b; real_T c25_llc_y; real_T c25_fdc_x; real_T c25_gdc_x; real_T c25_du_a; real_T c25_cmc_b; real_T c25_mlc_y; real_T c25_dmc_b; real_T c25_nlc_y; real_T c25_hdc_x; real_T c25_idc_x; real_T c25_eu_a; real_T c25_emc_b; real_T c25_olc_y; real_T c25_fmc_b; real_T c25_plc_y; real_T c25_jdc_x; real_T c25_kdc_x; real_T c25_fu_a; real_T c25_gmc_b; real_T c25_qlc_y; real_T c25_hmc_b; real_T c25_rlc_y; real_T c25_ldc_x; real_T c25_mdc_x; real_T c25_gu_a; real_T c25_imc_b; real_T c25_slc_y; real_T c25_jmc_b; real_T c25_tlc_y; real_T c25_ndc_x; real_T c25_odc_x; real_T c25_hu_a; real_T c25_kmc_b; real_T c25_ulc_y; real_T c25_lmc_b; real_T c25_vlc_y; real_T c25_pdc_x; real_T c25_qdc_x; real_T c25_iu_a; real_T c25_mmc_b; real_T c25_wlc_y; real_T c25_nmc_b; real_T c25_xlc_y; real_T c25_rdc_x; real_T c25_sdc_x; real_T c25_ju_a; real_T c25_omc_b; real_T c25_ylc_y; real_T c25_pmc_b; real_T c25_amc_y; real_T c25_tdc_x; real_T c25_udc_x; real_T c25_ku_a; real_T c25_qmc_b; real_T c25_bmc_y; real_T c25_rmc_b; real_T c25_cmc_y; real_T c25_vdc_x; real_T c25_wdc_x; real_T c25_lu_a; real_T c25_smc_b; real_T c25_dmc_y; real_T c25_xdc_x; real_T c25_ydc_x; real_T c25_tmc_b; real_T c25_emc_y; real_T c25_umc_b; real_T c25_fmc_y; real_T c25_aec_x; real_T c25_bec_x; real_T c25_mu_a; real_T c25_vmc_b; real_T c25_gmc_y; real_T c25_nu_a; real_T c25_wmc_b; real_T c25_xmc_b; real_T c25_hmc_y; real_T c25_ymc_b; real_T c25_imc_y; real_T c25_cec_x; real_T c25_dec_x; real_T c25_ou_a; real_T c25_anc_b; real_T c25_jmc_y; real_T c25_bnc_b; real_T c25_kmc_y; real_T c25_cnc_b; real_T c25_lmc_y; real_T c25_dnc_b; real_T c25_mmc_y; real_T c25_eec_x; real_T c25_fec_x; real_T c25_pu_a; real_T c25_enc_b; real_T c25_nmc_y; real_T c25_fnc_b; real_T c25_omc_y; real_T c25_gnc_b; real_T c25_pmc_y; real_T c25_hnc_b; real_T c25_qmc_y; real_T c25_gec_x; real_T c25_hec_x; real_T c25_qu_a; real_T c25_inc_b; real_T c25_rmc_y; real_T c25_jnc_b; real_T c25_smc_y; real_T c25_knc_b; real_T c25_tmc_y; real_T c25_iec_x; real_T c25_jec_x; real_T c25_ru_a; real_T c25_lnc_b; real_T c25_umc_y; real_T c25_mnc_b; real_T c25_vmc_y; real_T c25_kec_x; real_T c25_lec_x; real_T c25_su_a; real_T c25_nnc_b; real_T c25_wmc_y; real_T c25_onc_b; real_T c25_xmc_y; real_T c25_pnc_b; real_T c25_ymc_y; real_T c25_qnc_b; real_T c25_anc_y; real_T c25_rnc_b; real_T c25_bnc_y; real_T c25_mec_x; real_T c25_nec_x; real_T c25_tu_a; real_T c25_snc_b; real_T c25_cnc_y; real_T c25_tnc_b; real_T c25_dnc_y; real_T c25_unc_b; real_T c25_enc_y; real_T c25_vnc_b; real_T c25_fnc_y; real_T c25_wnc_b; real_T c25_gnc_y; real_T c25_xnc_b; real_T c25_hnc_y; real_T c25_oec_x; real_T c25_pec_x; real_T c25_uu_a; real_T c25_ync_b; real_T c25_inc_y; real_T c25_aoc_b; real_T c25_jnc_y; real_T c25_boc_b; real_T c25_knc_y; real_T c25_coc_b; real_T c25_lnc_y; real_T c25_doc_b; real_T c25_mnc_y; real_T c25_eoc_b; real_T c25_nnc_y; real_T c25_qec_x; real_T c25_rec_x; real_T c25_vu_a; real_T c25_foc_b; real_T c25_onc_y; real_T c25_goc_b; real_T c25_pnc_y; real_T c25_sec_x; real_T c25_tec_x; real_T c25_wu_a; real_T c25_hoc_b; real_T c25_qnc_y; real_T c25_ioc_b; real_T c25_rnc_y; real_T c25_uec_x; real_T c25_vec_x; real_T c25_xu_a; real_T c25_joc_b; real_T c25_snc_y; real_T c25_koc_b; real_T c25_tnc_y; real_T c25_wec_x; real_T c25_xec_x; real_T c25_yu_a; real_T c25_loc_b; real_T c25_unc_y; real_T c25_moc_b; real_T c25_vnc_y; real_T c25_yec_x; real_T c25_afc_x; real_T c25_av_a; real_T c25_noc_b; real_T c25_wnc_y; real_T c25_ooc_b; real_T c25_xnc_y; real_T c25_poc_b; real_T c25_ync_y; real_T c25_bfc_x; real_T c25_cfc_x; real_T c25_bv_a; real_T c25_qoc_b; real_T c25_aoc_y; real_T c25_roc_b; real_T c25_boc_y; real_T c25_soc_b; real_T c25_coc_y; real_T c25_toc_b; real_T c25_doc_y; real_T c25_dfc_x; real_T c25_efc_x; real_T c25_cv_a; real_T c25_uoc_b; real_T c25_eoc_y; real_T c25_voc_b; real_T c25_foc_y; real_T c25_ffc_x; real_T c25_gfc_x; real_T c25_dv_a; real_T c25_woc_b; real_T c25_goc_y; real_T c25_xoc_b; real_T c25_hoc_y; real_T c25_yoc_b; real_T c25_ioc_y; real_T c25_apc_b; real_T c25_joc_y; real_T c25_bpc_b; real_T c25_koc_y; real_T c25_hfc_x; real_T c25_ifc_x; real_T c25_ev_a; real_T c25_cpc_b; real_T c25_loc_y; real_T c25_dpc_b; real_T c25_moc_y; real_T c25_jfc_x; real_T c25_kfc_x; real_T c25_fv_a; real_T c25_epc_b; real_T c25_noc_y; real_T c25_fpc_b; real_T c25_ooc_y; real_T c25_lfc_x; real_T c25_mfc_x; real_T c25_gv_a; real_T c25_gpc_b; real_T c25_poc_y; real_T c25_hpc_b; real_T c25_qoc_y; real_T c25_nfc_x; real_T c25_ofc_x; real_T c25_hv_a; real_T c25_ipc_b; real_T c25_roc_y; real_T c25_jpc_b; real_T c25_soc_y; real_T c25_kpc_b; real_T c25_toc_y; real_T c25_lpc_b; real_T c25_uoc_y; real_T c25_mpc_b; real_T c25_voc_y; real_T c25_pfc_x; real_T c25_qfc_x; real_T c25_iv_a; real_T c25_npc_b; real_T c25_woc_y; real_T c25_opc_b; real_T c25_xoc_y; real_T c25_rfc_x; real_T c25_sfc_x; real_T c25_jv_a; real_T c25_ppc_b; real_T c25_yoc_y; real_T c25_qpc_b; real_T c25_apc_y; real_T c25_rpc_b; real_T c25_bpc_y; real_T c25_spc_b; real_T c25_cpc_y; real_T c25_tpc_b; real_T c25_dpc_y; real_T c25_upc_b; real_T c25_epc_y; real_T c25_tfc_x; real_T c25_ufc_x; real_T c25_kv_a; real_T c25_vpc_b; real_T c25_fpc_y; real_T c25_wpc_b; real_T c25_gpc_y; real_T c25_vfc_x; real_T c25_wfc_x; real_T c25_lv_a; real_T c25_xpc_b; real_T c25_hpc_y; real_T c25_ypc_b; real_T c25_ipc_y; real_T c25_aqc_b; real_T c25_jpc_y; real_T c25_xfc_x; real_T c25_yfc_x; real_T c25_mv_a; real_T c25_bqc_b; real_T c25_kpc_y; real_T c25_cqc_b; real_T c25_lpc_y; real_T c25_dqc_b; real_T c25_mpc_y; real_T c25_agc_x; real_T c25_bgc_x; real_T c25_nv_a; real_T c25_eqc_b; real_T c25_npc_y; real_T c25_fqc_b; real_T c25_opc_y; real_T c25_cgc_x; real_T c25_dgc_x; real_T c25_ov_a; real_T c25_gqc_b; real_T c25_ppc_y; real_T c25_hqc_b; real_T c25_qpc_y; real_T c25_egc_x; real_T c25_fgc_x; real_T c25_pv_a; real_T c25_iqc_b; real_T c25_rpc_y; real_T c25_jqc_b; real_T c25_spc_y; real_T c25_ggc_x; real_T c25_hgc_x; real_T c25_qv_a; real_T c25_kqc_b; real_T c25_tpc_y; real_T c25_igc_x; real_T c25_jgc_x; real_T c25_rv_a; real_T c25_lqc_b; real_T c25_upc_y; real_T c25_mqc_b; real_T c25_vpc_y; real_T c25_kgc_x; real_T c25_lgc_x; real_T c25_sv_a; real_T c25_nqc_b; real_T c25_wpc_y; real_T c25_mgc_x; real_T c25_ngc_x; real_T c25_tv_a; real_T c25_oqc_b; real_T c25_xpc_y; real_T c25_pqc_b; real_T c25_ypc_y; real_T c25_ogc_x; real_T c25_pgc_x; real_T c25_uv_a; real_T c25_qqc_b; real_T c25_aqc_y; real_T c25_qgc_x; real_T c25_rgc_x; real_T c25_vv_a; real_T c25_rqc_b; real_T c25_bqc_y; real_T c25_sqc_b; real_T c25_cqc_y; real_T c25_sgc_x; real_T c25_tgc_x; real_T c25_wv_a; real_T c25_tqc_b; real_T c25_dqc_y; real_T c25_ugc_x; real_T c25_vgc_x; real_T c25_xv_a; real_T c25_uqc_b; real_T c25_eqc_y; real_T c25_vqc_b; real_T c25_fqc_y; real_T c25_wgc_x; real_T c25_xgc_x; real_T c25_yv_a; real_T c25_wqc_b; real_T c25_gqc_y; real_T c25_ygc_x; real_T c25_ahc_x; real_T c25_aw_a; real_T c25_xqc_b; real_T c25_hqc_y; real_T c25_bhc_x; real_T c25_chc_x; real_T c25_bw_a; real_T c25_yqc_b; real_T c25_iqc_y; real_T c25_arc_b; real_T c25_jqc_y; real_T c25_dhc_x; real_T c25_ehc_x; real_T c25_cw_a; real_T c25_brc_b; real_T c25_kqc_y; real_T c25_fhc_x; real_T c25_ghc_x; real_T c25_dw_a; real_T c25_crc_b; real_T c25_lqc_y; real_T c25_hhc_x; real_T c25_ihc_x; real_T c25_ew_a; real_T c25_drc_b; real_T c25_mqc_y; real_T c25_erc_b; real_T c25_nqc_y; real_T c25_jhc_x; real_T c25_khc_x; real_T c25_fw_a; real_T c25_frc_b; real_T c25_oqc_y; real_T c25_lhc_x; real_T c25_mhc_x; real_T c25_gw_a; real_T c25_grc_b; real_T c25_pqc_y; real_T c25_nhc_x; real_T c25_ohc_x; real_T c25_hw_a; real_T c25_hrc_b; real_T c25_qqc_y; real_T c25_irc_b; real_T c25_rqc_y; real_T c25_phc_x; real_T c25_qhc_x; real_T c25_iw_a; real_T c25_jrc_b; real_T c25_sqc_y; real_T c25_rhc_x; real_T c25_shc_x; real_T c25_jw_a; real_T c25_krc_b; real_T c25_tqc_y; real_T c25_thc_x; real_T c25_uhc_x; real_T c25_kw_a; real_T c25_lrc_b; real_T c25_uqc_y; real_T c25_mrc_b; real_T c25_vqc_y; real_T c25_nrc_b; real_T c25_wqc_y; real_T c25_vhc_x; real_T c25_whc_x; real_T c25_lw_a; real_T c25_orc_b; real_T c25_xqc_y; real_T c25_prc_b; real_T c25_yqc_y; real_T c25_xhc_x; real_T c25_yhc_x; real_T c25_mw_a; real_T c25_qrc_b; real_T c25_arc_y; real_T c25_rrc_b; real_T c25_brc_y; real_T c25_aic_x; real_T c25_bic_x; real_T c25_nw_a; real_T c25_src_b; real_T c25_crc_y; real_T c25_trc_b; real_T c25_drc_y; real_T c25_cic_x; real_T c25_dic_x; real_T c25_ow_a; real_T c25_urc_b; real_T c25_erc_y; real_T c25_eic_x; real_T c25_fic_x; real_T c25_pw_a; real_T c25_vrc_b; real_T c25_frc_y; real_T c25_wrc_b; real_T c25_grc_y; real_T c25_gic_x; real_T c25_hic_x; real_T c25_qw_a; real_T c25_xrc_b; real_T c25_hrc_y; real_T c25_iic_x; real_T c25_jic_x; real_T c25_rw_a; real_T c25_yrc_b; real_T c25_irc_y; real_T c25_asc_b; real_T c25_jrc_y; real_T c25_kic_x; real_T c25_lic_x; real_T c25_sw_a; real_T c25_bsc_b; real_T c25_krc_y; real_T c25_mic_x; real_T c25_nic_x; real_T c25_tw_a; real_T c25_csc_b; real_T c25_lrc_y; real_T c25_oic_x; real_T c25_pic_x; real_T c25_uw_a; real_T c25_dsc_b; real_T c25_mrc_y; real_T c25_esc_b; real_T c25_nrc_y; real_T c25_qic_x; real_T c25_ric_x; real_T c25_vw_a; real_T c25_fsc_b; real_T c25_orc_y; real_T c25_sic_x; real_T c25_tic_x; real_T c25_ww_a; real_T c25_gsc_b; real_T c25_prc_y; real_T c25_uic_x; real_T c25_vic_x; real_T c25_xw_a; real_T c25_hsc_b; real_T c25_qrc_y; real_T c25_isc_b; real_T c25_rrc_y; real_T c25_jsc_b; real_T c25_src_y; real_T c25_wic_x; real_T c25_xic_x; real_T c25_yw_a; real_T c25_ksc_b; real_T c25_lsc_b; real_T c25_trc_y; real_T c25_msc_b; real_T c25_urc_y; real_T c25_yic_x; real_T c25_ajc_x; real_T c25_ax_a; real_T c25_nsc_b; real_T c25_vrc_y; real_T c25_osc_b; real_T c25_wrc_y; real_T c25_psc_b; real_T c25_xrc_y; real_T c25_bjc_x; real_T c25_cjc_x; real_T c25_bx_a; real_T c25_qsc_b; real_T c25_yrc_y; real_T c25_rsc_b; real_T c25_asc_y; real_T c25_ssc_b; real_T c25_bsc_y; real_T c25_djc_x; real_T c25_ejc_x; real_T c25_cx_a; real_T c25_tsc_b; real_T c25_csc_y; real_T c25_usc_b; real_T c25_dsc_y; real_T c25_vsc_b; real_T c25_esc_y; real_T c25_fjc_x; real_T c25_gjc_x; real_T c25_dx_a; real_T c25_wsc_b; real_T c25_fsc_y; real_T c25_xsc_b; real_T c25_gsc_y; real_T c25_ysc_b; real_T c25_hsc_y; real_T c25_hjc_x; real_T c25_ijc_x; real_T c25_ex_a; real_T c25_atc_b; real_T c25_isc_y; real_T c25_btc_b; real_T c25_jsc_y; real_T c25_jjc_x; real_T c25_kjc_x; real_T c25_fx_a; real_T c25_ctc_b; real_T c25_ksc_y; real_T c25_dtc_b; real_T c25_lsc_y; real_T c25_ljc_x; real_T c25_mjc_x; real_T c25_gx_a; real_T c25_etc_b; real_T c25_msc_y; real_T c25_ftc_b; real_T c25_nsc_y; real_T c25_njc_x; real_T c25_ojc_x; real_T c25_hx_a; real_T c25_gtc_b; real_T c25_osc_y; real_T c25_htc_b; real_T c25_psc_y; real_T c25_pjc_x; real_T c25_qjc_x; real_T c25_ix_a; real_T c25_itc_b; real_T c25_qsc_y; real_T c25_jtc_b; real_T c25_rsc_y; real_T c25_rjc_x; real_T c25_sjc_x; real_T c25_jx_a; real_T c25_ktc_b; real_T c25_ssc_y; real_T c25_tjc_x; real_T c25_ujc_x; real_T c25_ltc_b; real_T c25_tsc_y; real_T c25_mtc_b; real_T c25_usc_y; real_T c25_vjc_x; real_T c25_wjc_x; real_T c25_kx_a; real_T c25_ntc_b; real_T c25_vsc_y; real_T c25_lx_a; real_T c25_otc_b; real_T c25_ptc_b; real_T c25_wsc_y; real_T c25_qtc_b; real_T c25_xsc_y; real_T c25_xjc_x; real_T c25_yjc_x; real_T c25_mx_a; real_T c25_rtc_b; real_T c25_ysc_y; real_T c25_stc_b; real_T c25_atc_y; real_T c25_ttc_b; real_T c25_btc_y; real_T c25_akc_x; real_T c25_bkc_x; real_T c25_nx_a; real_T c25_utc_b; real_T c25_ctc_y; real_T c25_vtc_b; real_T c25_dtc_y; real_T c25_wtc_b; real_T c25_etc_y; real_T c25_ckc_x; real_T c25_dkc_x; real_T c25_ox_a; real_T c25_xtc_b; real_T c25_ftc_y; real_T c25_ytc_b; real_T c25_gtc_y; real_T c25_auc_b; real_T c25_htc_y; real_T c25_buc_b; real_T c25_itc_y; real_T c25_ekc_x; real_T c25_fkc_x; real_T c25_px_a; real_T c25_cuc_b; real_T c25_jtc_y; real_T c25_duc_b; real_T c25_ktc_y; real_T c25_euc_b; real_T c25_ltc_y; real_T c25_gkc_x; real_T c25_hkc_x; real_T c25_qx_a; real_T c25_fuc_b; real_T c25_mtc_y; real_T c25_guc_b; real_T c25_ntc_y; real_T c25_huc_b; real_T c25_otc_y; real_T c25_ikc_x; real_T c25_jkc_x; real_T c25_rx_a; real_T c25_iuc_b; real_T c25_ptc_y; real_T c25_juc_b; real_T c25_qtc_y; real_T c25_kuc_b; real_T c25_rtc_y; real_T c25_kkc_x; real_T c25_lkc_x; real_T c25_sx_a; real_T c25_luc_b; real_T c25_stc_y; real_T c25_muc_b; real_T c25_ttc_y; real_T c25_mkc_x; real_T c25_nkc_x; real_T c25_tx_a; real_T c25_nuc_b; real_T c25_utc_y; real_T c25_ouc_b; real_T c25_vtc_y; real_T c25_okc_x; real_T c25_pkc_x; real_T c25_ux_a; real_T c25_puc_b; real_T c25_wtc_y; real_T c25_quc_b; real_T c25_xtc_y; real_T c25_qkc_x; real_T c25_rkc_x; real_T c25_vx_a; real_T c25_ruc_b; real_T c25_ytc_y; real_T c25_suc_b; real_T c25_auc_y; real_T c25_tuc_b; real_T c25_buc_y; real_T c25_uuc_b; real_T c25_cuc_y; real_T c25_vuc_b; real_T c25_duc_y; real_T c25_skc_x; real_T c25_tkc_x; real_T c25_wx_a; real_T c25_wuc_b; real_T c25_euc_y; real_T c25_xuc_b; real_T c25_fuc_y; real_T c25_yuc_b; real_T c25_guc_y; real_T c25_ukc_x; real_T c25_vkc_x; real_T c25_xx_a; real_T c25_avc_b; real_T c25_huc_y; real_T c25_bvc_b; real_T c25_iuc_y; real_T c25_cvc_b; real_T c25_juc_y; real_T c25_dvc_b; real_T c25_kuc_y; real_T c25_evc_b; real_T c25_luc_y; real_T c25_fvc_b; real_T c25_muc_y; real_T c25_wkc_x; real_T c25_xkc_x; real_T c25_yx_a; real_T c25_gvc_b; real_T c25_nuc_y; real_T c25_hvc_b; real_T c25_ouc_y; real_T c25_ivc_b; real_T c25_puc_y; real_T c25_jvc_b; real_T c25_quc_y; real_T c25_kvc_b; real_T c25_ruc_y; real_T c25_lvc_b; real_T c25_suc_y; real_T c25_ykc_x; real_T c25_alc_x; real_T c25_ay_a; real_T c25_mvc_b; real_T c25_tuc_y; real_T c25_nvc_b; real_T c25_uuc_y; real_T c25_blc_x; real_T c25_clc_x; real_T c25_by_a; real_T c25_ovc_b; real_T c25_vuc_y; real_T c25_pvc_b; real_T c25_wuc_y; real_T c25_dlc_x; real_T c25_elc_x; real_T c25_cy_a; real_T c25_qvc_b; real_T c25_xuc_y; real_T c25_rvc_b; real_T c25_yuc_y; real_T c25_flc_x; real_T c25_glc_x; real_T c25_dy_a; real_T c25_svc_b; real_T c25_avc_y; real_T c25_tvc_b; real_T c25_bvc_y; real_T c25_hlc_x; real_T c25_ilc_x; real_T c25_ey_a; real_T c25_uvc_b; real_T c25_cvc_y; real_T c25_vvc_b; real_T c25_dvc_y; real_T c25_jlc_x; real_T c25_klc_x; real_T c25_fy_a; real_T c25_wvc_b; real_T c25_evc_y; real_T c25_xvc_b; real_T c25_fvc_y; real_T c25_llc_x; real_T c25_mlc_x; real_T c25_gy_a; real_T c25_yvc_b; real_T c25_gvc_y; real_T c25_awc_b; real_T c25_hvc_y; real_T c25_bwc_b; real_T c25_ivc_y; real_T c25_cwc_b; real_T c25_jvc_y; real_T c25_nlc_x; real_T c25_olc_x; real_T c25_hy_a; real_T c25_dwc_b; real_T c25_kvc_y; real_T c25_ewc_b; real_T c25_lvc_y; real_T c25_plc_x; real_T c25_qlc_x; real_T c25_iy_a; real_T c25_fwc_b; real_T c25_mvc_y; real_T c25_gwc_b; real_T c25_nvc_y; real_T c25_hwc_b; real_T c25_ovc_y; real_T c25_iwc_b; real_T c25_pvc_y; real_T c25_jwc_b; real_T c25_qvc_y; real_T c25_rlc_x; real_T c25_slc_x; real_T c25_jy_a; real_T c25_kwc_b; real_T c25_rvc_y; real_T c25_lwc_b; real_T c25_svc_y; real_T c25_tlc_x; real_T c25_ulc_x; real_T c25_ky_a; real_T c25_mwc_b; real_T c25_tvc_y; real_T c25_nwc_b; real_T c25_uvc_y; real_T c25_vlc_x; real_T c25_wlc_x; real_T c25_ly_a; real_T c25_owc_b; real_T c25_vvc_y; real_T c25_pwc_b; real_T c25_wvc_y; real_T c25_xlc_x; real_T c25_ylc_x; real_T c25_my_a; real_T c25_qwc_b; real_T c25_xvc_y; real_T c25_rwc_b; real_T c25_yvc_y; real_T c25_amc_x; real_T c25_bmc_x; real_T c25_ny_a; real_T c25_swc_b; real_T c25_awc_y; real_T c25_twc_b; real_T c25_bwc_y; real_T c25_cmc_x; real_T c25_dmc_x; real_T c25_oy_a; real_T c25_uwc_b; real_T c25_cwc_y; real_T c25_vwc_b; real_T c25_dwc_y; real_T c25_emc_x; real_T c25_fmc_x; real_T c25_py_a; real_T c25_wwc_b; real_T c25_ewc_y; real_T c25_xwc_b; real_T c25_fwc_y; real_T c25_gmc_x; real_T c25_hmc_x; real_T c25_qy_a; real_T c25_ywc_b; real_T c25_gwc_y; real_T c25_axc_b; real_T c25_hwc_y; real_T c25_imc_x; real_T c25_jmc_x; real_T c25_ry_a; real_T c25_bxc_b; real_T c25_iwc_y; real_T c25_cxc_b; real_T c25_jwc_y; real_T c25_kmc_x; real_T c25_lmc_x; real_T c25_sy_a; real_T c25_dxc_b; real_T c25_kwc_y; real_T c25_exc_b; real_T c25_lwc_y; real_T c25_fxc_b; real_T c25_mwc_y; real_T c25_gxc_b; real_T c25_nwc_y; real_T c25_hxc_b; real_T c25_owc_y; real_T c25_ixc_b; real_T c25_pwc_y; real_T c25_mmc_x; real_T c25_nmc_x; real_T c25_ty_a; real_T c25_jxc_b; real_T c25_qwc_y; real_T c25_kxc_b; real_T c25_rwc_y; real_T c25_omc_x; real_T c25_pmc_x; real_T c25_uy_a; real_T c25_lxc_b; real_T c25_swc_y; real_T c25_mxc_b; real_T c25_twc_y; real_T c25_qmc_x; real_T c25_rmc_x; real_T c25_vy_a; real_T c25_nxc_b; real_T c25_uwc_y; real_T c25_oxc_b; real_T c25_vwc_y; real_T c25_smc_x; real_T c25_tmc_x; real_T c25_wy_a; real_T c25_pxc_b; real_T c25_wwc_y; real_T c25_qxc_b; real_T c25_xwc_y; real_T c25_rxc_b; real_T c25_ywc_y; real_T c25_umc_x; real_T c25_vmc_x; real_T c25_xy_a; real_T c25_sxc_b; real_T c25_axc_y; real_T c25_txc_b; real_T c25_bxc_y; real_T c25_uxc_b; real_T c25_cxc_y; real_T c25_wmc_x; real_T c25_xmc_x; real_T c25_yy_a; real_T c25_vxc_b; real_T c25_dxc_y; real_T c25_wxc_b; real_T c25_exc_y; real_T c25_xxc_b; real_T c25_fxc_y; real_T c25_ymc_x; real_T c25_anc_x; real_T c25_aab_a; real_T c25_yxc_b; real_T c25_gxc_y; real_T c25_ayc_b; real_T c25_hxc_y; real_T c25_byc_b; real_T c25_ixc_y; real_T c25_bnc_x; real_T c25_cnc_x; real_T c25_bab_a; real_T c25_cyc_b; real_T c25_jxc_y; real_T c25_dyc_b; real_T c25_kxc_y; real_T c25_eyc_b; real_T c25_lxc_y; real_T c25_dnc_x; real_T c25_enc_x; real_T c25_cab_a; real_T c25_fyc_b; real_T c25_mxc_y; real_T c25_gyc_b; real_T c25_nxc_y; real_T c25_hyc_b; real_T c25_oxc_y; real_T c25_fnc_x; real_T c25_gnc_x; real_T c25_dab_a; real_T c25_iyc_b; real_T c25_pxc_y; real_T c25_jyc_b; real_T c25_qxc_y; real_T c25_hnc_x; real_T c25_inc_x; real_T c25_eab_a; real_T c25_kyc_b; real_T c25_rxc_y; real_T c25_lyc_b; real_T c25_sxc_y; real_T c25_jnc_x; real_T c25_knc_x; real_T c25_fab_a; real_T c25_myc_b; real_T c25_txc_y; real_T c25_nyc_b; real_T c25_uxc_y; real_T c25_lnc_x; real_T c25_mnc_x; real_T c25_gab_a; real_T c25_oyc_b; real_T c25_vxc_y; real_T c25_pyc_b; real_T c25_wxc_y; real_T c25_nnc_x; real_T c25_onc_x; real_T c25_hab_a; real_T c25_qyc_b; real_T c25_xxc_y; real_T c25_ryc_b; real_T c25_yxc_y; real_T c25_pnc_x; real_T c25_qnc_x; real_T c25_iab_a; real_T c25_syc_b; real_T c25_ayc_y; real_T c25_tyc_b; real_T c25_byc_y; real_T c25_rnc_x; real_T c25_snc_x; real_T c25_jab_a; real_T c25_uyc_b; real_T c25_cyc_y; real_T c25_vyc_b; real_T c25_dyc_y; real_T c25_tnc_x; real_T c25_unc_x; real_T c25_kab_a; real_T c25_wyc_b; real_T c25_eyc_y; real_T c25_xyc_b; real_T c25_fyc_y; real_T c25_vnc_x; real_T c25_wnc_x; real_T c25_lab_a; real_T c25_yyc_b; real_T c25_gyc_y; real_T c25_aad_b; real_T c25_hyc_y; real_T c25_xnc_x; real_T c25_ync_x; real_T c25_mab_a; real_T c25_bad_b; real_T c25_iyc_y; real_T c25_cad_b; real_T c25_jyc_y; real_T c25_aoc_x; real_T c25_boc_x; real_T c25_nab_a; real_T c25_dad_b; real_T c25_kyc_y; real_T c25_ead_b; real_T c25_lyc_y; real_T c25_coc_x; real_T c25_doc_x; real_T c25_oab_a; real_T c25_fad_b; real_T c25_myc_y; real_T c25_gad_b; real_T c25_nyc_y; real_T c25_eoc_x; real_T c25_foc_x; real_T c25_pab_a; real_T c25_had_b; real_T c25_oyc_y; real_T c25_iad_b; real_T c25_pyc_y; real_T c25_goc_x; real_T c25_hoc_x; real_T c25_qab_a; real_T c25_jad_b; real_T c25_qyc_y; real_T c25_kad_b; real_T c25_ryc_y; real_T c25_ioc_x; real_T c25_joc_x; real_T c25_rab_a; real_T c25_lad_b; real_T c25_syc_y; real_T c25_mad_b; real_T c25_tyc_y; real_T c25_nad_b; real_T c25_uyc_y; real_T c25_koc_x; real_T c25_loc_x; real_T c25_sab_a; real_T c25_oad_b; real_T c25_vyc_y; real_T c25_pad_b; real_T c25_wyc_y; real_T c25_qad_b; real_T c25_xyc_y; real_T c25_moc_x; real_T c25_noc_x; real_T c25_tab_a; real_T c25_rad_b; real_T c25_yyc_y; real_T c25_sad_b; real_T c25_aad_y; real_T c25_tad_b; real_T c25_bad_y; real_T c25_ooc_x; real_T c25_poc_x; real_T c25_uab_a; real_T c25_uad_b; real_T c25_cad_y; real_T c25_vad_b; real_T c25_dad_y; real_T c25_wad_b; real_T c25_ead_y; real_T c25_qoc_x; real_T c25_roc_x; real_T c25_vab_a; real_T c25_xad_b; real_T c25_fad_y; real_T c25_yad_b; real_T c25_gad_y; real_T c25_abd_b; real_T c25_had_y; real_T c25_soc_x; real_T c25_toc_x; real_T c25_wab_a; real_T c25_bbd_b; real_T c25_iad_y; real_T c25_cbd_b; real_T c25_jad_y; real_T c25_uoc_x; real_T c25_voc_x; real_T c25_xab_a; real_T c25_dbd_b; real_T c25_kad_y; real_T c25_ebd_b; real_T c25_lad_y; real_T c25_woc_x; real_T c25_xoc_x; real_T c25_yab_a; real_T c25_fbd_b; real_T c25_mad_y; real_T c25_gbd_b; real_T c25_nad_y; real_T c25_yoc_x; real_T c25_apc_x; real_T c25_abb_a; real_T c25_hbd_b; real_T c25_oad_y; real_T c25_ibd_b; real_T c25_pad_y; real_T c25_bpc_x; real_T c25_cpc_x; real_T c25_bbb_a; real_T c25_jbd_b; real_T c25_qad_y; real_T c25_kbd_b; real_T c25_rad_y; real_T c25_dpc_x; real_T c25_epc_x; real_T c25_cbb_a; real_T c25_lbd_b; real_T c25_sad_y; real_T c25_mbd_b; real_T c25_tad_y; real_T c25_fpc_x; real_T c25_gpc_x; real_T c25_dbb_a; real_T c25_nbd_b; real_T c25_uad_y; real_T c25_obd_b; real_T c25_vad_y; real_T c25_hpc_x; real_T c25_ipc_x; real_T c25_ebb_a; real_T c25_pbd_b; real_T c25_wad_y; real_T c25_qbd_b; real_T c25_xad_y; real_T c25_jpc_x; real_T c25_kpc_x; real_T c25_fbb_a; real_T c25_rbd_b; real_T c25_yad_y; real_T c25_sbd_b; real_T c25_abd_y; real_T c25_lpc_x; real_T c25_mpc_x; real_T c25_gbb_a; real_T c25_tbd_b; real_T c25_bbd_y; real_T c25_ubd_b; real_T c25_cbd_y; real_T c25_npc_x; real_T c25_opc_x; real_T c25_hbb_a; real_T c25_vbd_b; real_T c25_dbd_y; real_T c25_wbd_b; real_T c25_ebd_y; real_T c25_xbd_b; real_T c25_fbd_y; real_T c25_ppc_x; real_T c25_qpc_x; real_T c25_ibb_a; real_T c25_ybd_b; real_T c25_gbd_y; real_T c25_acd_b; real_T c25_hbd_y; real_T c25_bcd_b; real_T c25_ibd_y; real_T c25_rpc_x; real_T c25_spc_x; real_T c25_jbb_a; real_T c25_ccd_b; real_T c25_jbd_y; real_T c25_dcd_b; real_T c25_kbd_y; real_T c25_ecd_b; real_T c25_lbd_y; real_T c25_tpc_x; real_T c25_upc_x; real_T c25_kbb_a; real_T c25_fcd_b; real_T c25_mbd_y; real_T c25_gcd_b; real_T c25_nbd_y; real_T c25_hcd_b; real_T c25_obd_y; real_T c25_vpc_x; real_T c25_wpc_x; real_T c25_lbb_a; real_T c25_icd_b; real_T c25_pbd_y; real_T c25_jcd_b; real_T c25_qbd_y; real_T c25_kcd_b; real_T c25_rbd_y; real_T c25_xpc_x; real_T c25_ypc_x; real_T c25_mbb_a; real_T c25_lcd_b; real_T c25_sbd_y; real_T c25_mcd_b; real_T c25_tbd_y; real_T c25_aqc_x; real_T c25_bqc_x; real_T c25_nbb_a; real_T c25_ncd_b; real_T c25_ubd_y; real_T c25_ocd_b; real_T c25_vbd_y; real_T c25_cqc_x; real_T c25_dqc_x; real_T c25_obb_a; real_T c25_pcd_b; real_T c25_wbd_y; real_T c25_qcd_b; real_T c25_xbd_y; real_T c25_eqc_x; real_T c25_fqc_x; real_T c25_pbb_a; real_T c25_rcd_b; real_T c25_ybd_y; real_T c25_scd_b; real_T c25_acd_y; real_T c25_gqc_x; real_T c25_hqc_x; real_T c25_qbb_a; real_T c25_tcd_b; real_T c25_bcd_y; real_T c25_ucd_b; real_T c25_ccd_y; real_T c25_iqc_x; real_T c25_jqc_x; real_T c25_rbb_a; real_T c25_vcd_b; real_T c25_dcd_y; real_T c25_wcd_b; real_T c25_ecd_y; real_T c25_kqc_x; real_T c25_lqc_x; real_T c25_sbb_a; real_T c25_xcd_b; real_T c25_fcd_y; real_T c25_ycd_b; real_T c25_gcd_y; real_T c25_mqc_x; real_T c25_nqc_x; real_T c25_tbb_a; real_T c25_add_b; real_T c25_hcd_y; real_T c25_bdd_b; real_T c25_icd_y; real_T c25_oqc_x; real_T c25_pqc_x; real_T c25_ubb_a; real_T c25_cdd_b; real_T c25_jcd_y; real_T c25_qqc_x; real_T c25_rqc_x; real_T c25_vbb_a; real_T c25_ddd_b; real_T c25_kcd_y; real_T c25_edd_b; real_T c25_lcd_y; real_T c25_sqc_x; real_T c25_tqc_x; real_T c25_wbb_a; real_T c25_fdd_b; real_T c25_mcd_y; real_T c25_uqc_x; real_T c25_vqc_x; real_T c25_xbb_a; real_T c25_gdd_b; real_T c25_ncd_y; real_T c25_hdd_b; real_T c25_ocd_y; real_T c25_wqc_x; real_T c25_xqc_x; real_T c25_ybb_a; real_T c25_idd_b; real_T c25_pcd_y; real_T c25_yqc_x; real_T c25_arc_x; real_T c25_acb_a; real_T c25_jdd_b; real_T c25_qcd_y; real_T c25_kdd_b; real_T c25_rcd_y; real_T c25_brc_x; real_T c25_crc_x; real_T c25_bcb_a; real_T c25_ldd_b; real_T c25_scd_y; real_T c25_drc_x; real_T c25_erc_x; real_T c25_ccb_a; real_T c25_mdd_b; real_T c25_tcd_y; real_T c25_ndd_b; real_T c25_ucd_y; real_T c25_frc_x; real_T c25_grc_x; real_T c25_dcb_a; real_T c25_odd_b; real_T c25_vcd_y; real_T c25_hrc_x; real_T c25_irc_x; real_T c25_ecb_a; real_T c25_pdd_b; real_T c25_wcd_y; real_T c25_jrc_x; real_T c25_krc_x; real_T c25_qdd_b; real_T c25_xcd_y; real_T c25_lrc_x; real_T c25_mrc_x; real_T c25_fcb_a; real_T c25_rdd_b; real_T c25_ycd_y; real_T c25_gcb_a; real_T c25_sdd_b; real_T c25_nrc_x; real_T c25_orc_x; real_T c25_tdd_b; real_T c25_add_y; real_T c25_prc_x; real_T c25_qrc_x; real_T c25_hcb_a; real_T c25_udd_b; real_T c25_bdd_y; real_T c25_icb_a; real_T c25_vdd_b; real_T c25_rrc_x; real_T c25_src_x; real_T c25_wdd_b; real_T c25_cdd_y; real_T c25_trc_x; real_T c25_urc_x; real_T c25_jcb_a; real_T c25_xdd_b; real_T c25_ddd_y; real_T c25_kcb_a; real_T c25_ydd_b; real_T c25_aed_b; real_T c25_edd_y; real_T c25_vrc_x; real_T c25_wrc_x; real_T c25_lcb_a; real_T c25_bed_b; real_T c25_fdd_y; real_T c25_ced_b; real_T c25_gdd_y; real_T c25_xrc_x; real_T c25_yrc_x; real_T c25_mcb_a; real_T c25_ded_b; real_T c25_hdd_y; real_T c25_eed_b; real_T c25_idd_y; real_T c25_asc_x; real_T c25_bsc_x; real_T c25_ncb_a; real_T c25_fed_b; real_T c25_jdd_y; real_T c25_ged_b; real_T c25_kdd_y; real_T c25_csc_x; real_T c25_dsc_x; real_T c25_ocb_a; real_T c25_hed_b; real_T c25_ldd_y; real_T c25_esc_x; real_T c25_fsc_x; real_T c25_pcb_a; real_T c25_ied_b; real_T c25_mdd_y; real_T c25_gsc_x; real_T c25_hsc_x; real_T c25_jed_b; real_T c25_ndd_y; real_T c25_isc_x; real_T c25_jsc_x; real_T c25_ked_b; real_T c25_odd_y; real_T c25_ksc_x; real_T c25_lsc_x; real_T c25_led_b; real_T c25_pdd_y; real_T c25_msc_x; real_T c25_nsc_x; real_T c25_med_b; real_T c25_qdd_y; real_T c25_osc_x; real_T c25_psc_x; real_T c25_qcb_a; real_T c25_ned_b; real_T c25_rdd_y; real_T c25_qsc_x; real_T c25_rsc_x; real_T c25_oed_b; real_T c25_sdd_y; real_T c25_ssc_x; real_T c25_tsc_x; real_T c25_rcb_a; real_T c25_ped_b; real_T c25_tdd_y; real_T c25_scb_a; real_T c25_qed_b; real_T c25_udd_y; real_T c25_usc_x; real_T c25_vsc_x; real_T c25_red_b; real_T c25_vdd_y; real_T c25_wsc_x; real_T c25_xsc_x; real_T c25_tcb_a; real_T c25_sed_b; real_T c25_wdd_y; real_T c25_ysc_x; real_T c25_atc_x; real_T c25_ted_b; real_T c25_xdd_y; real_T c25_btc_x; real_T c25_ctc_x; real_T c25_ucb_a; real_T c25_ued_b; real_T c25_ydd_y; real_T c25_dtc_x; real_T c25_etc_x; real_T c25_ved_b; real_T c25_aed_y; real_T c25_ftc_x; real_T c25_gtc_x; real_T c25_wed_b; real_T c25_bed_y; real_T c25_htc_x; real_T c25_itc_x; real_T c25_xed_b; real_T c25_ced_y; real_T c25_jtc_x; real_T c25_ktc_x; real_T c25_vcb_a; real_T c25_yed_b; real_T c25_ded_y; real_T c25_ltc_x; real_T c25_mtc_x; real_T c25_afd_b; real_T c25_eed_y; real_T c25_ntc_x; real_T c25_otc_x; real_T c25_wcb_a; real_T c25_bfd_b; real_T c25_fed_y; real_T c25_ptc_x; real_T c25_qtc_x; real_T c25_cfd_b; real_T c25_ged_y; real_T c25_rtc_x; real_T c25_stc_x; real_T c25_dfd_b; real_T c25_hed_y; real_T c25_ttc_x; real_T c25_utc_x; real_T c25_xcb_a; real_T c25_efd_b; real_T c25_ycb_a[6]; int32_T c25_i22; int32_T c25_i23; real_T c25_adb_a[36]; int32_T c25_i24; int32_T c25_i25; int32_T c25_i26; int32_T c25_i27; real_T c25_b_C[6]; int32_T c25_i28; int32_T c25_i29; int32_T c25_i30; int32_T c25_i31; int32_T c25_i32; int32_T c25_i33; _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 104U, 104U, c25_b_debug_family_names, c25_debug_family_var_map); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_q1, 0U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_q2, 1U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_q3, 2U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_q4, 3U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_q5, 4U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_q6, 5U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_theta_1, 6U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_theta_2, 7U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_theta_3, 8U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_theta_4, 9U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_theta_5, 10U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_theta_6, 11U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_dq1, 12U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_dq2, 13U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_dq3, 14U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_dq4, 15U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_dq5, 16U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_dq6, 17U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m11, 18U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m12, 19U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m13, 20U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m14, 21U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m15, 22U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m16, 23U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m21, 24U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m22, 25U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m23, 26U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m24, 27U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m25, 28U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m26, 29U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m31, 30U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m32, 31U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m33, 32U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m34, 33U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m35, 34U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m36, 35U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m41, 36U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m42, 37U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m43, 38U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m44, 39U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m45, 40U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m46, 41U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m51, 42U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m52, 43U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m53, 44U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m54, 45U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m55, 46U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m56, 47U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m61, 48U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m62, 49U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m63, 50U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m64, 51U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m65, 52U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_m66, 53U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c11, 54U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c12, 55U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c13, 56U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c14, 57U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c15, 58U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c16, 59U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c21, 60U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c22, 61U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c23, 62U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c24, 63U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c25, 64U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c26, 65U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c31, 66U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c32, 67U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c33, 68U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c34, 69U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c35, 70U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c36, 71U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c41, 72U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c42, 73U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c43, 74U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c44, 75U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c45, 76U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c46, 77U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c51, 78U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c52, 79U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c53, 80U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c54, 81U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c55, 82U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c56, 83U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c61, 84U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c62, 85U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c63, 86U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c64, 87U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c65, 88U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_c66, 89U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_g1, 90U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_g2, 91U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_g3, 92U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_g4, 93U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_g5, 94U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_g6, 95U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_C, 96U, c25_c_sf_marshallOut, c25_c_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_nargin, 97U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_nargout, 98U, c25_b_sf_marshallOut, c25_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_q, 99U, c25_sf_marshallOut, c25_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_dq, 100U, c25_sf_marshallOut, c25_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_M, 101U, c25_c_sf_marshallOut, c25_c_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_G, 102U, c25_sf_marshallOut, c25_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_CDq, 103U, c25_sf_marshallOut, c25_sf_marshallIn); CV_SCRIPT_FCN(0, 0); _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 4); c25_q1 = c25_q[0]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 5); c25_q2 = c25_q[1]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 6); c25_q3 = c25_q[2]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 7); c25_q4 = c25_q[3]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 8); c25_q5 = c25_q[4]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 9); c25_q6 = c25_q[5]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 11); c25_theta_1 = c25_q1; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 12); c25_theta_2 = c25_q2; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 13); c25_theta_3 = c25_q3; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 14); c25_theta_4 = c25_q4; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 15); c25_theta_5 = c25_q5; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 16); c25_theta_6 = c25_q6; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 18); c25_dq1 = c25_dq[0]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 19); c25_dq2 = c25_dq[1]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 20); c25_dq3 = c25_dq[2]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 21); c25_dq4 = c25_dq[3]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 22); c25_dq5 = c25_dq[4]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 23); c25_dq6 = c25_dq[5]; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 25); c25_x = (c25_q3 + c25_q4) + c25_q5; c25_b_x = c25_x; c25_b_x = muDoubleScalarSin(c25_b_x); c25_b = c25_b_x; c25_y = 0.007460552829 * c25_b; c25_b_b = c25_q2; c25_b_y = 2.0 * c25_b_b; c25_c_b = c25_q3; c25_c_y = 2.0 * c25_c_b; c25_d_b = c25_q4; c25_d_y = 2.0 * c25_d_b; c25_e_b = c25_q5; c25_e_y = 2.0 * c25_e_b; c25_c_x = ((c25_b_y + c25_c_y) + c25_d_y) + c25_e_y; c25_d_x = c25_c_x; c25_d_x = muDoubleScalarCos(c25_d_x); c25_f_b = c25_d_x; c25_f_y = 0.0002254000336 * c25_f_b; c25_g_b = c25_q2; c25_g_y = 2.0 * c25_g_b; c25_e_x = ((c25_g_y + c25_q3) + c25_q4) + c25_q5; c25_f_x = c25_e_x; c25_f_x = muDoubleScalarSin(c25_f_x); c25_h_b = c25_f_x; c25_h_y = 0.007460552829 * c25_h_b; c25_i_b = c25_q2; c25_i_y = 2.0 * c25_i_b; c25_g_x = c25_i_y + c25_q3; c25_h_x = c25_g_x; c25_h_x = muDoubleScalarCos(c25_h_x); c25_j_b = c25_h_x; c25_j_y = 0.7014282607 * c25_j_b; c25_k_b = c25_q5; c25_k_y = c25_k_b; c25_i_x = (c25_q3 + c25_q4) - c25_k_y; c25_j_x = c25_i_x; c25_j_x = muDoubleScalarSin(c25_j_x); c25_l_b = c25_j_x; c25_l_y = 0.007460552829 * c25_l_b; c25_m_b = c25_q2; c25_m_y = 2.0 * c25_m_b; c25_n_b = c25_q5; c25_n_y = c25_n_b; c25_k_x = ((c25_m_y + c25_q3) + c25_q4) - c25_n_y; c25_l_x = c25_k_x; c25_l_x = muDoubleScalarSin(c25_l_x); c25_o_b = c25_l_x; c25_o_y = 0.007460552829 * c25_o_b; c25_p_b = c25_q2; c25_p_y = 2.0 * c25_p_b; c25_q_b = c25_q3; c25_q_y = 2.0 * c25_q_b; c25_m_x = (c25_p_y + c25_q_y) + c25_q4; c25_n_x = c25_m_x; c25_n_x = muDoubleScalarSin(c25_n_x); c25_r_b = c25_n_x; c25_r_y = 0.05830173968 * c25_r_b; c25_s_b = c25_q2; c25_s_y = 2.0 * c25_s_b; c25_t_b = c25_q3; c25_t_y = 2.0 * c25_t_b; c25_u_b = c25_q4; c25_u_y = 2.0 * c25_u_b; c25_o_x = ((c25_s_y + c25_t_y) + c25_u_y) + c25_q5; c25_p_x = c25_o_x; c25_p_x = muDoubleScalarCos(c25_p_x); c25_v_b = c25_p_x; c25_v_y = 0.001614617887 * c25_v_b; c25_w_b = c25_q2; c25_w_y = 2.0 * c25_w_b; c25_q_x = c25_w_y; c25_r_x = c25_q_x; c25_r_x = muDoubleScalarCos(c25_r_x); c25_x_b = c25_r_x; c25_x_y = 0.8028639871 * c25_x_b; c25_y_b = c25_q5; c25_y_y = 2.0 * c25_y_b; c25_s_x = c25_y_y; c25_t_x = c25_s_x; c25_t_x = muDoubleScalarCos(c25_t_x); c25_ab_b = c25_t_x; c25_ab_y = 0.0004508000672 * c25_ab_b; c25_bb_b = c25_q2; c25_bb_y = 2.0 * c25_bb_b; c25_cb_b = c25_q3; c25_cb_y = 2.0 * c25_cb_b; c25_db_b = c25_q4; c25_db_y = 2.0 * c25_db_b; c25_eb_b = c25_q5; c25_eb_y = c25_eb_b; c25_u_x = ((c25_bb_y + c25_cb_y) + c25_db_y) - c25_eb_y; c25_v_x = c25_u_x; c25_v_x = muDoubleScalarCos(c25_v_x); c25_fb_b = c25_v_x; c25_fb_y = 0.001614617887 * c25_fb_b; c25_gb_b = c25_q2; c25_gb_y = 2.0 * c25_gb_b; c25_hb_b = c25_q3; c25_hb_y = 2.0 * c25_hb_b; c25_ib_b = c25_q4; c25_ib_y = 2.0 * c25_ib_b; c25_jb_b = c25_q5; c25_jb_y = 2.0 * c25_jb_b; c25_w_x = ((c25_gb_y + c25_hb_y) + c25_ib_y) - c25_jb_y; c25_x_x = c25_w_x; c25_x_x = muDoubleScalarCos(c25_x_x); c25_kb_b = c25_x_x; c25_kb_y = 0.0002254000336 * c25_kb_b; c25_y_x = c25_q3 + c25_q4; c25_ab_x = c25_y_x; c25_ab_x = muDoubleScalarSin(c25_ab_x); c25_lb_b = c25_ab_x; c25_lb_y = 0.063140533 * c25_lb_b; c25_bb_x = c25_q4 + c25_q5; c25_cb_x = c25_bb_x; c25_cb_x = muDoubleScalarSin(c25_cb_x); c25_mb_b = c25_cb_x; c25_mb_y = 0.006888811168 * c25_mb_b; c25_nb_b = c25_q2; c25_nb_y = 2.0 * c25_nb_b; c25_db_x = (c25_nb_y + c25_q3) + c25_q4; c25_eb_x = c25_db_x; c25_eb_x = muDoubleScalarSin(c25_eb_x); c25_ob_b = c25_eb_x; c25_ob_y = 0.063140533 * c25_ob_b; c25_pb_b = c25_q5; c25_pb_y = c25_pb_b; c25_fb_x = c25_q4 - c25_pb_y; c25_gb_x = c25_fb_x; c25_gb_x = muDoubleScalarSin(c25_gb_x); c25_qb_b = c25_gb_x; c25_qb_y = 0.006888811168 * c25_qb_b; c25_hb_x = c25_q3; c25_ib_x = c25_hb_x; c25_ib_x = muDoubleScalarCos(c25_ib_x); c25_rb_b = c25_ib_x; c25_rb_y = 0.7014282607 * c25_rb_b; c25_jb_x = c25_q5; c25_kb_x = c25_jb_x; c25_kb_x = muDoubleScalarCos(c25_kb_x); c25_sb_b = c25_kb_x; c25_sb_y = 0.00765364949 * c25_sb_b; c25_tb_b = c25_q2; c25_tb_y = 2.0 * c25_tb_b; c25_ub_b = c25_q3; c25_ub_y = 2.0 * c25_ub_b; c25_lb_x = ((c25_tb_y + c25_ub_y) + c25_q4) + c25_q5; c25_mb_x = c25_lb_x; c25_mb_x = muDoubleScalarSin(c25_mb_x); c25_vb_b = c25_mb_x; c25_vb_y = 0.006888811168 * c25_vb_b; c25_wb_b = c25_q2; c25_wb_y = 2.0 * c25_wb_b; c25_xb_b = c25_q3; c25_xb_y = 2.0 * c25_xb_b; c25_nb_x = c25_wb_y + c25_xb_y; c25_ob_x = c25_nb_x; c25_ob_x = muDoubleScalarCos(c25_ob_x); c25_yb_b = c25_ob_x; c25_yb_y = 0.3129702942 * c25_yb_b; c25_pb_x = c25_q4; c25_qb_x = c25_pb_x; c25_qb_x = muDoubleScalarSin(c25_qb_x); c25_ac_b = c25_qb_x; c25_ac_y = 0.05830173968 * c25_ac_b; c25_bc_b = c25_q2; c25_bc_y = 2.0 * c25_bc_b; c25_cc_b = c25_q3; c25_cc_y = 2.0 * c25_cc_b; c25_dc_b = c25_q4; c25_dc_y = 2.0 * c25_dc_b; c25_rb_x = (c25_bc_y + c25_cc_y) + c25_dc_y; c25_sb_x = c25_rb_x; c25_sb_x = muDoubleScalarCos(c25_sb_x); c25_ec_b = c25_sb_x; c25_ec_y = 0.005743907935 * c25_ec_b; c25_fc_b = c25_q2; c25_fc_y = 2.0 * c25_fc_b; c25_gc_b = c25_q3; c25_gc_y = 2.0 * c25_gc_b; c25_hc_b = c25_q5; c25_hc_y = c25_hc_b; c25_tb_x = ((c25_fc_y + c25_gc_y) + c25_q4) - c25_hc_y; c25_ub_x = c25_tb_x; c25_ub_x = muDoubleScalarSin(c25_ub_x); c25_ic_b = c25_ub_x; c25_ic_y = 0.006888811168 * c25_ic_b; c25_m11 = ((((((((((((((((((((((c25_y - c25_f_y) + c25_h_y) + c25_j_y) - c25_l_y) - c25_o_y) - c25_r_y) + c25_v_y) + c25_x_y) + c25_ab_y) - c25_fb_y) - c25_kb_y) - c25_lb_y) + c25_mb_y) - c25_ob_y) - c25_qb_y) + c25_rb_y) + c25_sb_y) + c25_vb_y) + c25_yb_y) - c25_ac_y) - c25_ec_y) - c25_ic_y) + 1.28924888; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 26); c25_vb_x = (c25_q2 + c25_q3) + c25_q4; c25_wb_x = c25_vb_x; c25_wb_x = muDoubleScalarCos(c25_wb_x); c25_jc_b = c25_wb_x; c25_jc_y = 0.01615783641 * c25_jc_b; c25_xb_x = (c25_q2 + c25_q3) + c25_q5; c25_yb_x = c25_xb_x; c25_yb_x = muDoubleScalarSin(c25_yb_x); c25_kc_b = c25_yb_x; c25_kc_y = 0.006888811168 * c25_kc_b; c25_lc_b = c25_q5; c25_lc_y = 2.0 * c25_lc_b; c25_ac_x = ((c25_q2 + c25_q3) + c25_q4) + c25_lc_y; c25_bc_x = c25_ac_x; c25_bc_x = muDoubleScalarCos(c25_bc_x); c25_mc_b = c25_bc_x; c25_mc_y = 0.0004508000672 * c25_mc_b; c25_nc_b = c25_q5; c25_nc_y = c25_nc_b; c25_cc_x = (c25_q2 + c25_q3) - c25_nc_y; c25_dc_x = c25_cc_x; c25_dc_x = muDoubleScalarSin(c25_dc_x); c25_oc_b = c25_dc_x; c25_oc_y = 0.006888811168 * c25_oc_b; c25_pc_b = c25_q5; c25_pc_y = c25_pc_b; c25_qc_b = c25_q3; c25_qc_y = c25_qc_b; c25_rc_b = c25_q4; c25_rc_y = c25_rc_b; c25_sc_b = c25_q2; c25_sc_y = c25_sc_b; c25_ec_x = ((c25_pc_y - c25_qc_y) - c25_rc_y) - c25_sc_y; c25_fc_x = c25_ec_x; c25_fc_x = muDoubleScalarCos(c25_fc_x); c25_tc_b = c25_fc_x; c25_tc_y = 0.00352803026 * c25_tc_b; c25_uc_b = c25_q5; c25_uc_y = 2.0 * c25_uc_b; c25_vc_b = c25_q3; c25_vc_y = c25_vc_b; c25_wc_b = c25_q4; c25_wc_y = c25_wc_b; c25_xc_b = c25_q2; c25_xc_y = c25_xc_b; c25_gc_x = ((c25_uc_y - c25_vc_y) - c25_wc_y) - c25_xc_y; c25_hc_x = c25_gc_x; c25_hc_x = muDoubleScalarCos(c25_hc_x); c25_yc_b = c25_hc_x; c25_yc_y = 0.0004508000672 * c25_yc_b; c25_ic_x = ((c25_q2 + c25_q3) + c25_q4) + c25_q5; c25_jc_x = c25_ic_x; c25_jc_x = muDoubleScalarCos(c25_jc_x); c25_ad_b = c25_jc_x; c25_ad_y = 0.0002987944852 * c25_ad_b; c25_kc_x = c25_q2 + c25_q3; c25_lc_x = c25_kc_x; c25_lc_x = muDoubleScalarSin(c25_lc_x); c25_bd_b = c25_lc_x; c25_bd_y = 0.1313181732 * c25_bd_b; c25_mc_x = c25_q2 + c25_q5; c25_nc_x = c25_mc_x; c25_nc_x = muDoubleScalarSin(c25_nc_x); c25_cd_b = c25_nc_x; c25_cd_y = 0.007460552829 * c25_cd_b; c25_dd_b = c25_q5; c25_dd_y = c25_dd_b; c25_oc_x = c25_q2 - c25_dd_y; c25_pc_x = c25_oc_x; c25_pc_x = muDoubleScalarSin(c25_pc_x); c25_ed_b = c25_pc_x; c25_ed_y = 0.007460552829 * c25_ed_b; c25_qc_x = c25_q2; c25_rc_x = c25_qc_x; c25_rc_x = muDoubleScalarSin(c25_rc_x); c25_fd_b = c25_rc_x; c25_fd_y = 0.348513447 * c25_fd_b; c25_m12 = (((((((((c25_jc_y + c25_kc_y) - c25_mc_y) + c25_oc_y) + c25_tc_y) + c25_yc_y) - c25_ad_y) + c25_bd_y) + c25_cd_y) + c25_ed_y) + c25_fd_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 27); c25_sc_x = (c25_q2 + c25_q3) + c25_q4; c25_tc_x = c25_sc_x; c25_tc_x = muDoubleScalarCos(c25_tc_x); c25_gd_b = c25_tc_x; c25_gd_y = 0.01615783641 * c25_gd_b; c25_uc_x = (c25_q2 + c25_q3) + c25_q5; c25_vc_x = c25_uc_x; c25_vc_x = muDoubleScalarSin(c25_vc_x); c25_hd_b = c25_vc_x; c25_hd_y = 0.006888811168 * c25_hd_b; c25_id_b = c25_q5; c25_id_y = 2.0 * c25_id_b; c25_wc_x = ((c25_q2 + c25_q3) + c25_q4) + c25_id_y; c25_xc_x = c25_wc_x; c25_xc_x = muDoubleScalarCos(c25_xc_x); c25_jd_b = c25_xc_x; c25_jd_y = 0.0004508000672 * c25_jd_b; c25_kd_b = c25_q5; c25_kd_y = c25_kd_b; c25_yc_x = (c25_q2 + c25_q3) - c25_kd_y; c25_ad_x = c25_yc_x; c25_ad_x = muDoubleScalarSin(c25_ad_x); c25_ld_b = c25_ad_x; c25_ld_y = 0.006888811168 * c25_ld_b; c25_md_b = c25_q5; c25_md_y = c25_md_b; c25_nd_b = c25_q3; c25_nd_y = c25_nd_b; c25_od_b = c25_q4; c25_od_y = c25_od_b; c25_pd_b = c25_q2; c25_pd_y = c25_pd_b; c25_bd_x = ((c25_md_y - c25_nd_y) - c25_od_y) - c25_pd_y; c25_cd_x = c25_bd_x; c25_cd_x = muDoubleScalarCos(c25_cd_x); c25_qd_b = c25_cd_x; c25_qd_y = 0.00352803026 * c25_qd_b; c25_rd_b = c25_q5; c25_rd_y = 2.0 * c25_rd_b; c25_sd_b = c25_q3; c25_sd_y = c25_sd_b; c25_td_b = c25_q4; c25_td_y = c25_td_b; c25_ud_b = c25_q2; c25_ud_y = c25_ud_b; c25_dd_x = ((c25_rd_y - c25_sd_y) - c25_td_y) - c25_ud_y; c25_ed_x = c25_dd_x; c25_ed_x = muDoubleScalarCos(c25_ed_x); c25_vd_b = c25_ed_x; c25_vd_y = 0.0004508000672 * c25_vd_b; c25_fd_x = ((c25_q2 + c25_q3) + c25_q4) + c25_q5; c25_gd_x = c25_fd_x; c25_gd_x = muDoubleScalarCos(c25_gd_x); c25_wd_b = c25_gd_x; c25_wd_y = 0.0002987944852 * c25_wd_b; c25_hd_x = c25_q2 + c25_q3; c25_id_x = c25_hd_x; c25_id_x = muDoubleScalarSin(c25_id_x); c25_xd_b = c25_id_x; c25_xd_y = 0.1313181732 * c25_xd_b; c25_m13 = ((((((c25_gd_y + c25_hd_y) - c25_jd_y) + c25_ld_y) + c25_qd_y) + c25_vd_y) - c25_wd_y) + c25_xd_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 28); c25_jd_x = (c25_q2 + c25_q3) + c25_q4; c25_kd_x = c25_jd_x; c25_kd_x = muDoubleScalarCos(c25_kd_x); c25_yd_b = c25_kd_x; c25_yd_y = 0.01615783641 * c25_yd_b; c25_ae_b = c25_q5; c25_ae_y = 2.0 * c25_ae_b; c25_ld_x = ((c25_q2 + c25_q3) + c25_q4) + c25_ae_y; c25_md_x = c25_ld_x; c25_md_x = muDoubleScalarCos(c25_md_x); c25_be_b = c25_md_x; c25_be_y = 0.0004508000672 * c25_be_b; c25_ce_b = c25_q5; c25_ce_y = c25_ce_b; c25_de_b = c25_q3; c25_de_y = c25_de_b; c25_ee_b = c25_q4; c25_ee_y = c25_ee_b; c25_fe_b = c25_q2; c25_fe_y = c25_fe_b; c25_nd_x = ((c25_ce_y - c25_de_y) - c25_ee_y) - c25_fe_y; c25_od_x = c25_nd_x; c25_od_x = muDoubleScalarCos(c25_od_x); c25_ge_b = c25_od_x; c25_ge_y = 0.00352803026 * c25_ge_b; c25_he_b = c25_q5; c25_he_y = 2.0 * c25_he_b; c25_ie_b = c25_q3; c25_ie_y = c25_ie_b; c25_je_b = c25_q4; c25_je_y = c25_je_b; c25_ke_b = c25_q2; c25_ke_y = c25_ke_b; c25_pd_x = ((c25_he_y - c25_ie_y) - c25_je_y) - c25_ke_y; c25_qd_x = c25_pd_x; c25_qd_x = muDoubleScalarCos(c25_qd_x); c25_le_b = c25_qd_x; c25_le_y = 0.0004508000672 * c25_le_b; c25_rd_x = ((c25_q2 + c25_q3) + c25_q4) + c25_q5; c25_sd_x = c25_rd_x; c25_sd_x = muDoubleScalarCos(c25_sd_x); c25_me_b = c25_sd_x; c25_me_y = 0.0002987944852 * c25_me_b; c25_m14 = (((c25_yd_y - c25_be_y) + c25_ge_y) + c25_le_y) - c25_me_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 29); c25_ne_b = c25_q5; c25_ne_y = c25_ne_b; c25_td_x = (c25_q2 + c25_q3) - c25_ne_y; c25_ud_x = c25_td_x; c25_ud_x = muDoubleScalarSin(c25_ud_x); c25_oe_b = c25_ud_x; c25_oe_y = 0.006888811168 * c25_oe_b; c25_vd_x = (c25_q2 + c25_q3) + c25_q5; c25_wd_x = c25_vd_x; c25_wd_x = muDoubleScalarSin(c25_wd_x); c25_pe_b = c25_wd_x; c25_pe_y = 0.006888811168 * c25_pe_b; c25_xd_x = (c25_q2 + c25_q3) + c25_q4; c25_yd_x = c25_xd_x; c25_yd_x = muDoubleScalarCos(c25_yd_x); c25_qe_b = c25_yd_x; c25_qe_y = 0.002840479501 * c25_qe_b; c25_re_b = c25_q5; c25_re_y = c25_re_b; c25_se_b = c25_q3; c25_se_y = c25_se_b; c25_te_b = c25_q4; c25_te_y = c25_te_b; c25_ue_b = c25_q2; c25_ue_y = c25_ue_b; c25_ae_x = ((c25_re_y - c25_se_y) - c25_te_y) - c25_ue_y; c25_be_x = c25_ae_x; c25_be_x = muDoubleScalarCos(c25_be_x); c25_ve_b = c25_be_x; c25_ve_y = 0.0002987944852 * c25_ve_b; c25_ce_x = ((c25_q2 + c25_q3) + c25_q4) + c25_q5; c25_de_x = c25_ce_x; c25_de_x = muDoubleScalarCos(c25_de_x); c25_we_b = c25_de_x; c25_we_y = 0.00352803026 * c25_we_b; c25_ee_x = c25_q2 + c25_q5; c25_fe_x = c25_ee_x; c25_fe_x = muDoubleScalarSin(c25_fe_x); c25_xe_b = c25_fe_x; c25_xe_y = 0.007460552829 * c25_xe_b; c25_ye_b = c25_q5; c25_ye_y = c25_ye_b; c25_ge_x = c25_q2 - c25_ye_y; c25_he_x = c25_ge_x; c25_he_x = muDoubleScalarSin(c25_he_x); c25_af_b = c25_he_x; c25_af_y = 0.007460552829 * c25_af_b; c25_m15 = (((((c25_oe_y - c25_pe_y) - c25_qe_y) - c25_ve_y) - c25_we_y) - c25_xe_y) + c25_af_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 30); c25_ie_x = (c25_q2 + c25_q3) + c25_q4; c25_je_x = c25_ie_x; c25_je_x = muDoubleScalarSin(c25_je_x); c25_bf_b = c25_je_x; c25_bf_y = -0.000138534912 * c25_bf_b; c25_ke_x = c25_q5; c25_le_x = c25_ke_x; c25_le_x = muDoubleScalarSin(c25_le_x); c25_a = c25_bf_y; c25_cf_b = c25_le_x; c25_m16 = c25_a * c25_cf_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 31); c25_me_x = (c25_q2 + c25_q3) + c25_q4; c25_ne_x = c25_me_x; c25_ne_x = muDoubleScalarCos(c25_ne_x); c25_df_b = c25_ne_x; c25_cf_y = 0.01615783641 * c25_df_b; c25_oe_x = (c25_q2 + c25_q3) + c25_q5; c25_pe_x = c25_oe_x; c25_pe_x = muDoubleScalarSin(c25_pe_x); c25_ef_b = c25_pe_x; c25_df_y = 0.006888811168 * c25_ef_b; c25_ff_b = c25_q5; c25_ef_y = 2.0 * c25_ff_b; c25_qe_x = ((c25_q2 + c25_q3) + c25_q4) + c25_ef_y; c25_re_x = c25_qe_x; c25_re_x = muDoubleScalarCos(c25_re_x); c25_gf_b = c25_re_x; c25_ff_y = 0.0004508000672 * c25_gf_b; c25_hf_b = c25_q5; c25_gf_y = c25_hf_b; c25_se_x = (c25_q2 + c25_q3) - c25_gf_y; c25_te_x = c25_se_x; c25_te_x = muDoubleScalarSin(c25_te_x); c25_if_b = c25_te_x; c25_hf_y = 0.006888811168 * c25_if_b; c25_jf_b = c25_q5; c25_if_y = c25_jf_b; c25_kf_b = c25_q3; c25_jf_y = c25_kf_b; c25_lf_b = c25_q4; c25_kf_y = c25_lf_b; c25_mf_b = c25_q2; c25_lf_y = c25_mf_b; c25_ue_x = ((c25_if_y - c25_jf_y) - c25_kf_y) - c25_lf_y; c25_ve_x = c25_ue_x; c25_ve_x = muDoubleScalarCos(c25_ve_x); c25_nf_b = c25_ve_x; c25_mf_y = 0.00352803026 * c25_nf_b; c25_of_b = c25_q5; c25_nf_y = 2.0 * c25_of_b; c25_pf_b = c25_q3; c25_of_y = c25_pf_b; c25_qf_b = c25_q4; c25_pf_y = c25_qf_b; c25_rf_b = c25_q2; c25_qf_y = c25_rf_b; c25_we_x = ((c25_nf_y - c25_of_y) - c25_pf_y) - c25_qf_y; c25_xe_x = c25_we_x; c25_xe_x = muDoubleScalarCos(c25_xe_x); c25_sf_b = c25_xe_x; c25_rf_y = 0.0004508000672 * c25_sf_b; c25_ye_x = ((c25_q2 + c25_q3) + c25_q4) + c25_q5; c25_af_x = c25_ye_x; c25_af_x = muDoubleScalarCos(c25_af_x); c25_tf_b = c25_af_x; c25_sf_y = 0.0002987944852 * c25_tf_b; c25_bf_x = c25_q2 + c25_q3; c25_cf_x = c25_bf_x; c25_cf_x = muDoubleScalarSin(c25_cf_x); c25_uf_b = c25_cf_x; c25_tf_y = 0.1313181732 * c25_uf_b; c25_df_x = c25_q2 + c25_q5; c25_ef_x = c25_df_x; c25_ef_x = muDoubleScalarSin(c25_ef_x); c25_vf_b = c25_ef_x; c25_uf_y = 0.007460552829 * c25_vf_b; c25_wf_b = c25_q5; c25_vf_y = c25_wf_b; c25_ff_x = c25_q2 - c25_vf_y; c25_gf_x = c25_ff_x; c25_gf_x = muDoubleScalarSin(c25_gf_x); c25_xf_b = c25_gf_x; c25_wf_y = 0.007460552829 * c25_xf_b; c25_hf_x = c25_q2; c25_if_x = c25_hf_x; c25_if_x = muDoubleScalarSin(c25_if_x); c25_yf_b = c25_if_x; c25_xf_y = 0.348513447 * c25_yf_b; c25_m21 = (((((((((c25_cf_y + c25_df_y) - c25_ff_y) + c25_hf_y) + c25_mf_y) + c25_rf_y) - c25_sf_y) + c25_tf_y) + c25_uf_y) + c25_wf_y) + c25_xf_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 32); c25_jf_x = c25_q3; c25_kf_x = c25_jf_x; c25_kf_x = muDoubleScalarCos(c25_kf_x); c25_ag_b = c25_kf_x; c25_yf_y = 1.402856521 * c25_ag_b; c25_lf_x = c25_q4; c25_mf_x = c25_lf_x; c25_mf_x = muDoubleScalarSin(c25_mf_x); c25_bg_b = c25_mf_x; c25_ag_y = 0.1166034794 * c25_bg_b; c25_nf_x = c25_q3; c25_of_x = c25_nf_x; c25_of_x = muDoubleScalarCos(c25_of_x); c25_cg_b = c25_of_x; c25_bg_y = 0.126281066 * c25_cg_b; c25_pf_x = c25_q4; c25_qf_x = c25_pf_x; c25_qf_x = muDoubleScalarSin(c25_qf_x); c25_b_a = c25_bg_y; c25_dg_b = c25_qf_x; c25_cg_y = c25_b_a * c25_dg_b; c25_rf_x = c25_q4; c25_sf_x = c25_rf_x; c25_sf_x = muDoubleScalarCos(c25_sf_x); c25_eg_b = c25_sf_x; c25_dg_y = 0.126281066 * c25_eg_b; c25_tf_x = c25_q3; c25_uf_x = c25_tf_x; c25_uf_x = muDoubleScalarSin(c25_uf_x); c25_c_a = c25_dg_y; c25_fg_b = c25_uf_x; c25_eg_y = c25_c_a * c25_fg_b; c25_vf_x = c25_q4; c25_wf_x = c25_vf_x; c25_wf_x = muDoubleScalarCos(c25_wf_x); c25_gg_b = c25_wf_x; c25_fg_y = 0.02755524467 * c25_gg_b; c25_xf_x = c25_q5; c25_yf_x = c25_xf_x; c25_yf_x = muDoubleScalarSin(c25_yf_x); c25_d_a = c25_fg_y; c25_hg_b = c25_yf_x; c25_gg_y = c25_d_a * c25_hg_b; c25_ag_x = c25_q5; c25_bg_x = c25_ag_x; c25_bg_x = muDoubleScalarCos(c25_bg_x); c25_ig_b = c25_mpower(chartInstance, c25_bg_x); c25_hg_y = 0.001803200269 * c25_ig_b; c25_cg_x = c25_q3; c25_dg_x = c25_cg_x; c25_dg_x = muDoubleScalarSin(c25_dg_x); c25_jg_b = c25_dg_x; c25_ig_y = 0.02984221131 * c25_jg_b; c25_eg_x = c25_q4; c25_fg_x = c25_eg_x; c25_fg_x = muDoubleScalarSin(c25_fg_x); c25_e_a = c25_ig_y; c25_kg_b = c25_fg_x; c25_jg_y = c25_e_a * c25_kg_b; c25_gg_x = c25_q5; c25_hg_x = c25_gg_x; c25_hg_x = muDoubleScalarSin(c25_hg_x); c25_f_a = c25_jg_y; c25_lg_b = c25_hg_x; c25_kg_y = c25_f_a * c25_lg_b; c25_ig_x = c25_q3; c25_jg_x = c25_ig_x; c25_jg_x = muDoubleScalarCos(c25_jg_x); c25_mg_b = c25_jg_x; c25_lg_y = 0.02984221131 * c25_mg_b; c25_kg_x = c25_q4; c25_lg_x = c25_kg_x; c25_lg_x = muDoubleScalarCos(c25_lg_x); c25_g_a = c25_lg_y; c25_ng_b = c25_lg_x; c25_mg_y = c25_g_a * c25_ng_b; c25_mg_x = c25_q5; c25_ng_x = c25_mg_x; c25_ng_x = muDoubleScalarSin(c25_ng_x); c25_h_a = c25_mg_y; c25_og_b = c25_ng_x; c25_ng_y = c25_h_a * c25_og_b; c25_m22 = (((((((c25_yf_y - c25_ag_y) - c25_cg_y) - c25_eg_y) + c25_gg_y) - c25_hg_y) - c25_kg_y) + c25_ng_y) + 2.263576776; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 33); c25_og_x = c25_q3; c25_pg_x = c25_og_x; c25_pg_x = muDoubleScalarCos(c25_pg_x); c25_pg_b = c25_pg_x; c25_og_y = 0.7014282607 * c25_pg_b; c25_qg_x = c25_q4; c25_rg_x = c25_qg_x; c25_rg_x = muDoubleScalarSin(c25_rg_x); c25_qg_b = c25_rg_x; c25_pg_y = 0.1166034794 * c25_qg_b; c25_sg_x = c25_q3; c25_tg_x = c25_sg_x; c25_tg_x = muDoubleScalarCos(c25_tg_x); c25_rg_b = c25_tg_x; c25_qg_y = 0.063140533 * c25_rg_b; c25_ug_x = c25_q4; c25_vg_x = c25_ug_x; c25_vg_x = muDoubleScalarSin(c25_vg_x); c25_i_a = c25_qg_y; c25_sg_b = c25_vg_x; c25_rg_y = c25_i_a * c25_sg_b; c25_wg_x = c25_q4; c25_xg_x = c25_wg_x; c25_xg_x = muDoubleScalarCos(c25_xg_x); c25_tg_b = c25_xg_x; c25_sg_y = 0.063140533 * c25_tg_b; c25_yg_x = c25_q3; c25_ah_x = c25_yg_x; c25_ah_x = muDoubleScalarSin(c25_ah_x); c25_j_a = c25_sg_y; c25_ug_b = c25_ah_x; c25_tg_y = c25_j_a * c25_ug_b; c25_bh_x = c25_q4; c25_ch_x = c25_bh_x; c25_ch_x = muDoubleScalarCos(c25_ch_x); c25_vg_b = c25_ch_x; c25_ug_y = 0.02755524467 * c25_vg_b; c25_dh_x = c25_q5; c25_eh_x = c25_dh_x; c25_eh_x = muDoubleScalarSin(c25_eh_x); c25_k_a = c25_ug_y; c25_wg_b = c25_eh_x; c25_vg_y = c25_k_a * c25_wg_b; c25_fh_x = c25_q5; c25_gh_x = c25_fh_x; c25_gh_x = muDoubleScalarCos(c25_gh_x); c25_xg_b = c25_mpower(chartInstance, c25_gh_x); c25_wg_y = 0.001803200269 * c25_xg_b; c25_hh_x = c25_q3; c25_ih_x = c25_hh_x; c25_ih_x = muDoubleScalarSin(c25_ih_x); c25_yg_b = c25_ih_x; c25_xg_y = 0.01492110566 * c25_yg_b; c25_jh_x = c25_q4; c25_kh_x = c25_jh_x; c25_kh_x = muDoubleScalarSin(c25_kh_x); c25_l_a = c25_xg_y; c25_ah_b = c25_kh_x; c25_yg_y = c25_l_a * c25_ah_b; c25_lh_x = c25_q5; c25_mh_x = c25_lh_x; c25_mh_x = muDoubleScalarSin(c25_mh_x); c25_m_a = c25_yg_y; c25_bh_b = c25_mh_x; c25_ah_y = c25_m_a * c25_bh_b; c25_nh_x = c25_q3; c25_oh_x = c25_nh_x; c25_oh_x = muDoubleScalarCos(c25_oh_x); c25_ch_b = c25_oh_x; c25_bh_y = 0.01492110566 * c25_ch_b; c25_ph_x = c25_q4; c25_qh_x = c25_ph_x; c25_qh_x = muDoubleScalarCos(c25_qh_x); c25_n_a = c25_bh_y; c25_dh_b = c25_qh_x; c25_ch_y = c25_n_a * c25_dh_b; c25_rh_x = c25_q5; c25_sh_x = c25_rh_x; c25_sh_x = muDoubleScalarSin(c25_sh_x); c25_o_a = c25_ch_y; c25_eh_b = c25_sh_x; c25_dh_y = c25_o_a * c25_eh_b; c25_m23 = (((((((c25_og_y - c25_pg_y) - c25_rg_y) - c25_tg_y) + c25_vg_y) - c25_wg_y) - c25_ah_y) + c25_dh_y) + 0.644094696; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 34); c25_th_x = c25_q4; c25_uh_x = c25_th_x; c25_uh_x = muDoubleScalarCos(c25_uh_x); c25_fh_b = c25_uh_x; c25_eh_y = 0.01377762234 * c25_fh_b; c25_vh_x = c25_q5; c25_wh_x = c25_vh_x; c25_wh_x = muDoubleScalarSin(c25_wh_x); c25_p_a = c25_eh_y; c25_gh_b = c25_wh_x; c25_fh_y = c25_p_a * c25_gh_b; c25_xh_x = c25_q3; c25_yh_x = c25_xh_x; c25_yh_x = muDoubleScalarCos(c25_yh_x); c25_hh_b = c25_yh_x; c25_gh_y = 0.063140533 * c25_hh_b; c25_ai_x = c25_q4; c25_bi_x = c25_ai_x; c25_bi_x = muDoubleScalarSin(c25_bi_x); c25_q_a = c25_gh_y; c25_ih_b = c25_bi_x; c25_hh_y = c25_q_a * c25_ih_b; c25_ci_x = c25_q4; c25_di_x = c25_ci_x; c25_di_x = muDoubleScalarCos(c25_di_x); c25_jh_b = c25_di_x; c25_ih_y = 0.063140533 * c25_jh_b; c25_ei_x = c25_q3; c25_fi_x = c25_ei_x; c25_fi_x = muDoubleScalarSin(c25_fi_x); c25_r_a = c25_ih_y; c25_kh_b = c25_fi_x; c25_jh_y = c25_r_a * c25_kh_b; c25_gi_x = c25_q4; c25_hi_x = c25_gi_x; c25_hi_x = muDoubleScalarSin(c25_hi_x); c25_lh_b = c25_hi_x; c25_kh_y = 0.05830173968 * c25_lh_b; c25_ii_x = c25_q5; c25_ji_x = c25_ii_x; c25_ji_x = muDoubleScalarCos(c25_ji_x); c25_mh_b = c25_mpower(chartInstance, c25_ji_x); c25_lh_y = 0.001803200269 * c25_mh_b; c25_ki_x = c25_q3; c25_li_x = c25_ki_x; c25_li_x = muDoubleScalarSin(c25_li_x); c25_nh_b = c25_li_x; c25_mh_y = 0.01492110566 * c25_nh_b; c25_mi_x = c25_q4; c25_ni_x = c25_mi_x; c25_ni_x = muDoubleScalarSin(c25_ni_x); c25_s_a = c25_mh_y; c25_oh_b = c25_ni_x; c25_nh_y = c25_s_a * c25_oh_b; c25_oi_x = c25_q5; c25_pi_x = c25_oi_x; c25_pi_x = muDoubleScalarSin(c25_pi_x); c25_t_a = c25_nh_y; c25_ph_b = c25_pi_x; c25_oh_y = c25_t_a * c25_ph_b; c25_qi_x = c25_q3; c25_ri_x = c25_qi_x; c25_ri_x = muDoubleScalarCos(c25_ri_x); c25_qh_b = c25_ri_x; c25_ph_y = 0.01492110566 * c25_qh_b; c25_si_x = c25_q4; c25_ti_x = c25_si_x; c25_ti_x = muDoubleScalarCos(c25_ti_x); c25_u_a = c25_ph_y; c25_rh_b = c25_ti_x; c25_qh_y = c25_u_a * c25_rh_b; c25_ui_x = c25_q5; c25_vi_x = c25_ui_x; c25_vi_x = muDoubleScalarSin(c25_vi_x); c25_v_a = c25_qh_y; c25_sh_b = c25_vi_x; c25_rh_y = c25_v_a * c25_sh_b; c25_m24 = ((((((c25_fh_y - c25_hh_y) - c25_jh_y) - c25_kh_y) - c25_lh_y) - c25_oh_y) + c25_rh_y) + 0.01612863983; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 35); c25_wi_x = c25_q5; c25_xi_x = c25_wi_x; c25_xi_x = muDoubleScalarCos(c25_xi_x); c25_yi_x = c25_q3 + c25_q4; c25_aj_x = c25_yi_x; c25_aj_x = muDoubleScalarSin(c25_aj_x); c25_th_b = c25_aj_x; c25_sh_y = 0.01492110566 * c25_th_b; c25_bj_x = c25_q4; c25_cj_x = c25_bj_x; c25_cj_x = muDoubleScalarSin(c25_cj_x); c25_uh_b = c25_cj_x; c25_th_y = 0.01377762234 * c25_uh_b; c25_w_a = c25_xi_x; c25_vh_b = (c25_sh_y + c25_th_y) - 0.003229235775; c25_m25 = c25_w_a * c25_vh_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 36); c25_dj_x = c25_q5; c25_ej_x = c25_dj_x; c25_ej_x = muDoubleScalarCos(c25_ej_x); c25_wh_b = c25_ej_x; c25_m26 = 0.000138534912 * c25_wh_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 37); c25_fj_x = (c25_q2 + c25_q3) + c25_q4; c25_gj_x = c25_fj_x; c25_gj_x = muDoubleScalarCos(c25_gj_x); c25_xh_b = c25_gj_x; c25_uh_y = 0.01615783641 * c25_xh_b; c25_hj_x = (c25_q2 + c25_q3) + c25_q5; c25_ij_x = c25_hj_x; c25_ij_x = muDoubleScalarSin(c25_ij_x); c25_yh_b = c25_ij_x; c25_vh_y = 0.006888811168 * c25_yh_b; c25_ai_b = c25_q5; c25_wh_y = 2.0 * c25_ai_b; c25_jj_x = ((c25_q2 + c25_q3) + c25_q4) + c25_wh_y; c25_kj_x = c25_jj_x; c25_kj_x = muDoubleScalarCos(c25_kj_x); c25_bi_b = c25_kj_x; c25_xh_y = 0.0004508000672 * c25_bi_b; c25_ci_b = c25_q5; c25_yh_y = c25_ci_b; c25_lj_x = (c25_q2 + c25_q3) - c25_yh_y; c25_mj_x = c25_lj_x; c25_mj_x = muDoubleScalarSin(c25_mj_x); c25_di_b = c25_mj_x; c25_ai_y = 0.006888811168 * c25_di_b; c25_ei_b = c25_q5; c25_bi_y = c25_ei_b; c25_fi_b = c25_q3; c25_ci_y = c25_fi_b; c25_gi_b = c25_q4; c25_di_y = c25_gi_b; c25_hi_b = c25_q2; c25_ei_y = c25_hi_b; c25_nj_x = ((c25_bi_y - c25_ci_y) - c25_di_y) - c25_ei_y; c25_oj_x = c25_nj_x; c25_oj_x = muDoubleScalarCos(c25_oj_x); c25_ii_b = c25_oj_x; c25_fi_y = 0.00352803026 * c25_ii_b; c25_ji_b = c25_q5; c25_gi_y = 2.0 * c25_ji_b; c25_ki_b = c25_q3; c25_hi_y = c25_ki_b; c25_li_b = c25_q4; c25_ii_y = c25_li_b; c25_mi_b = c25_q2; c25_ji_y = c25_mi_b; c25_pj_x = ((c25_gi_y - c25_hi_y) - c25_ii_y) - c25_ji_y; c25_qj_x = c25_pj_x; c25_qj_x = muDoubleScalarCos(c25_qj_x); c25_ni_b = c25_qj_x; c25_ki_y = 0.0004508000672 * c25_ni_b; c25_rj_x = ((c25_q2 + c25_q3) + c25_q4) + c25_q5; c25_sj_x = c25_rj_x; c25_sj_x = muDoubleScalarCos(c25_sj_x); c25_oi_b = c25_sj_x; c25_li_y = 0.0002987944852 * c25_oi_b; c25_tj_x = c25_q2 + c25_q3; c25_uj_x = c25_tj_x; c25_uj_x = muDoubleScalarSin(c25_uj_x); c25_pi_b = c25_uj_x; c25_mi_y = 0.1313181732 * c25_pi_b; c25_m31 = ((((((c25_uh_y + c25_vh_y) - c25_xh_y) + c25_ai_y) + c25_fi_y) + c25_ki_y) - c25_li_y) + c25_mi_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 38); c25_vj_x = c25_q3; c25_wj_x = c25_vj_x; c25_wj_x = muDoubleScalarCos(c25_wj_x); c25_qi_b = c25_wj_x; c25_ni_y = 0.7014282607 * c25_qi_b; c25_xj_x = c25_q4; c25_yj_x = c25_xj_x; c25_yj_x = muDoubleScalarSin(c25_yj_x); c25_ri_b = c25_yj_x; c25_oi_y = 0.1166034794 * c25_ri_b; c25_ak_x = c25_q3; c25_bk_x = c25_ak_x; c25_bk_x = muDoubleScalarCos(c25_bk_x); c25_si_b = c25_bk_x; c25_pi_y = 0.063140533 * c25_si_b; c25_ck_x = c25_q4; c25_dk_x = c25_ck_x; c25_dk_x = muDoubleScalarSin(c25_dk_x); c25_x_a = c25_pi_y; c25_ti_b = c25_dk_x; c25_qi_y = c25_x_a * c25_ti_b; c25_ek_x = c25_q4; c25_fk_x = c25_ek_x; c25_fk_x = muDoubleScalarCos(c25_fk_x); c25_ui_b = c25_fk_x; c25_ri_y = 0.063140533 * c25_ui_b; c25_gk_x = c25_q3; c25_hk_x = c25_gk_x; c25_hk_x = muDoubleScalarSin(c25_hk_x); c25_y_a = c25_ri_y; c25_vi_b = c25_hk_x; c25_si_y = c25_y_a * c25_vi_b; c25_ik_x = c25_q4; c25_jk_x = c25_ik_x; c25_jk_x = muDoubleScalarCos(c25_jk_x); c25_wi_b = c25_jk_x; c25_ti_y = 0.02755524467 * c25_wi_b; c25_kk_x = c25_q5; c25_lk_x = c25_kk_x; c25_lk_x = muDoubleScalarSin(c25_lk_x); c25_ab_a = c25_ti_y; c25_xi_b = c25_lk_x; c25_ui_y = c25_ab_a * c25_xi_b; c25_mk_x = c25_q5; c25_nk_x = c25_mk_x; c25_nk_x = muDoubleScalarCos(c25_nk_x); c25_yi_b = c25_mpower(chartInstance, c25_nk_x); c25_vi_y = 0.001803200269 * c25_yi_b; c25_ok_x = c25_q3; c25_pk_x = c25_ok_x; c25_pk_x = muDoubleScalarSin(c25_pk_x); c25_aj_b = c25_pk_x; c25_wi_y = 0.01492110566 * c25_aj_b; c25_qk_x = c25_q4; c25_rk_x = c25_qk_x; c25_rk_x = muDoubleScalarSin(c25_rk_x); c25_bb_a = c25_wi_y; c25_bj_b = c25_rk_x; c25_xi_y = c25_bb_a * c25_bj_b; c25_sk_x = c25_q5; c25_tk_x = c25_sk_x; c25_tk_x = muDoubleScalarSin(c25_tk_x); c25_cb_a = c25_xi_y; c25_cj_b = c25_tk_x; c25_yi_y = c25_cb_a * c25_cj_b; c25_uk_x = c25_q3; c25_vk_x = c25_uk_x; c25_vk_x = muDoubleScalarCos(c25_vk_x); c25_dj_b = c25_vk_x; c25_aj_y = 0.01492110566 * c25_dj_b; c25_wk_x = c25_q4; c25_xk_x = c25_wk_x; c25_xk_x = muDoubleScalarCos(c25_xk_x); c25_db_a = c25_aj_y; c25_ej_b = c25_xk_x; c25_bj_y = c25_db_a * c25_ej_b; c25_yk_x = c25_q5; c25_al_x = c25_yk_x; c25_al_x = muDoubleScalarSin(c25_al_x); c25_eb_a = c25_bj_y; c25_fj_b = c25_al_x; c25_cj_y = c25_eb_a * c25_fj_b; c25_m32 = (((((((c25_ni_y - c25_oi_y) - c25_qi_y) - c25_si_y) + c25_ui_y) - c25_vi_y) - c25_yi_y) + c25_cj_y) + 0.644094696; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 39); c25_bl_x = c25_q4; c25_cl_x = c25_bl_x; c25_cl_x = muDoubleScalarCos(c25_cl_x); c25_gj_b = c25_cl_x; c25_dj_y = 0.02755524467 * c25_gj_b; c25_dl_x = c25_q5; c25_el_x = c25_dl_x; c25_el_x = muDoubleScalarSin(c25_el_x); c25_fb_a = c25_dj_y; c25_hj_b = c25_el_x; c25_ej_y = c25_fb_a * c25_hj_b; c25_fl_x = c25_q4; c25_gl_x = c25_fl_x; c25_gl_x = muDoubleScalarSin(c25_gl_x); c25_ij_b = c25_gl_x; c25_fj_y = 0.1166034794 * c25_ij_b; c25_hl_x = c25_q5; c25_il_x = c25_hl_x; c25_il_x = muDoubleScalarCos(c25_il_x); c25_jj_b = c25_mpower(chartInstance, c25_il_x); c25_gj_y = 0.001803200269 * c25_jj_b; c25_m33 = ((c25_ej_y - c25_fj_y) - c25_gj_y) + 0.644094696; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 40); c25_jl_x = c25_q4; c25_kl_x = c25_jl_x; c25_kl_x = muDoubleScalarCos(c25_kl_x); c25_kj_b = c25_kl_x; c25_hj_y = 0.01377762234 * c25_kj_b; c25_ll_x = c25_q5; c25_ml_x = c25_ll_x; c25_ml_x = muDoubleScalarSin(c25_ml_x); c25_gb_a = c25_hj_y; c25_lj_b = c25_ml_x; c25_ij_y = c25_gb_a * c25_lj_b; c25_nl_x = c25_q4; c25_ol_x = c25_nl_x; c25_ol_x = muDoubleScalarSin(c25_ol_x); c25_mj_b = c25_ol_x; c25_jj_y = 0.05830173968 * c25_mj_b; c25_pl_x = c25_q5; c25_ql_x = c25_pl_x; c25_ql_x = muDoubleScalarCos(c25_ql_x); c25_nj_b = c25_mpower(chartInstance, c25_ql_x); c25_kj_y = 0.001803200269 * c25_nj_b; c25_m34 = ((c25_ij_y - c25_jj_y) - c25_kj_y) + 0.01612863983; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 41); c25_rl_x = c25_q5; c25_sl_x = c25_rl_x; c25_sl_x = muDoubleScalarCos(c25_sl_x); c25_tl_x = c25_q4; c25_ul_x = c25_tl_x; c25_ul_x = muDoubleScalarSin(c25_ul_x); c25_oj_b = c25_ul_x; c25_lj_y = 0.01377762234 * c25_oj_b; c25_hb_a = c25_sl_x; c25_pj_b = c25_lj_y - 0.003229235775; c25_m35 = c25_hb_a * c25_pj_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 42); c25_vl_x = c25_q5; c25_wl_x = c25_vl_x; c25_wl_x = muDoubleScalarCos(c25_wl_x); c25_qj_b = c25_wl_x; c25_m36 = 0.000138534912 * c25_qj_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 43); c25_xl_x = (c25_q2 + c25_q3) + c25_q4; c25_yl_x = c25_xl_x; c25_yl_x = muDoubleScalarCos(c25_yl_x); c25_rj_b = c25_yl_x; c25_mj_y = 0.01615783641 * c25_rj_b; c25_sj_b = c25_q5; c25_nj_y = 2.0 * c25_sj_b; c25_am_x = ((c25_q2 + c25_q3) + c25_q4) + c25_nj_y; c25_bm_x = c25_am_x; c25_bm_x = muDoubleScalarCos(c25_bm_x); c25_tj_b = c25_bm_x; c25_oj_y = 0.0004508000672 * c25_tj_b; c25_uj_b = c25_q5; c25_pj_y = c25_uj_b; c25_vj_b = c25_q3; c25_qj_y = c25_vj_b; c25_wj_b = c25_q4; c25_rj_y = c25_wj_b; c25_xj_b = c25_q2; c25_sj_y = c25_xj_b; c25_cm_x = ((c25_pj_y - c25_qj_y) - c25_rj_y) - c25_sj_y; c25_dm_x = c25_cm_x; c25_dm_x = muDoubleScalarCos(c25_dm_x); c25_yj_b = c25_dm_x; c25_tj_y = 0.00352803026 * c25_yj_b; c25_ak_b = c25_q5; c25_uj_y = 2.0 * c25_ak_b; c25_bk_b = c25_q3; c25_vj_y = c25_bk_b; c25_ck_b = c25_q4; c25_wj_y = c25_ck_b; c25_dk_b = c25_q2; c25_xj_y = c25_dk_b; c25_em_x = ((c25_uj_y - c25_vj_y) - c25_wj_y) - c25_xj_y; c25_fm_x = c25_em_x; c25_fm_x = muDoubleScalarCos(c25_fm_x); c25_ek_b = c25_fm_x; c25_yj_y = 0.0004508000672 * c25_ek_b; c25_gm_x = ((c25_q2 + c25_q3) + c25_q4) + c25_q5; c25_hm_x = c25_gm_x; c25_hm_x = muDoubleScalarCos(c25_hm_x); c25_fk_b = c25_hm_x; c25_ak_y = 0.0002987944852 * c25_fk_b; c25_m41 = (((c25_mj_y - c25_oj_y) + c25_tj_y) + c25_yj_y) - c25_ak_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 44); c25_im_x = c25_q4; c25_jm_x = c25_im_x; c25_jm_x = muDoubleScalarCos(c25_jm_x); c25_gk_b = c25_jm_x; c25_bk_y = 0.01377762234 * c25_gk_b; c25_km_x = c25_q5; c25_lm_x = c25_km_x; c25_lm_x = muDoubleScalarSin(c25_lm_x); c25_ib_a = c25_bk_y; c25_hk_b = c25_lm_x; c25_ck_y = c25_ib_a * c25_hk_b; c25_mm_x = c25_q3; c25_nm_x = c25_mm_x; c25_nm_x = muDoubleScalarCos(c25_nm_x); c25_ik_b = c25_nm_x; c25_dk_y = 0.063140533 * c25_ik_b; c25_om_x = c25_q4; c25_pm_x = c25_om_x; c25_pm_x = muDoubleScalarSin(c25_pm_x); c25_jb_a = c25_dk_y; c25_jk_b = c25_pm_x; c25_ek_y = c25_jb_a * c25_jk_b; c25_qm_x = c25_q4; c25_rm_x = c25_qm_x; c25_rm_x = muDoubleScalarCos(c25_rm_x); c25_kk_b = c25_rm_x; c25_fk_y = 0.063140533 * c25_kk_b; c25_sm_x = c25_q3; c25_tm_x = c25_sm_x; c25_tm_x = muDoubleScalarSin(c25_tm_x); c25_kb_a = c25_fk_y; c25_lk_b = c25_tm_x; c25_gk_y = c25_kb_a * c25_lk_b; c25_um_x = c25_q4; c25_vm_x = c25_um_x; c25_vm_x = muDoubleScalarSin(c25_vm_x); c25_mk_b = c25_vm_x; c25_hk_y = 0.05830173968 * c25_mk_b; c25_wm_x = c25_q5; c25_xm_x = c25_wm_x; c25_xm_x = muDoubleScalarCos(c25_xm_x); c25_nk_b = c25_mpower(chartInstance, c25_xm_x); c25_ik_y = 0.001803200269 * c25_nk_b; c25_ym_x = c25_q3; c25_an_x = c25_ym_x; c25_an_x = muDoubleScalarSin(c25_an_x); c25_ok_b = c25_an_x; c25_jk_y = 0.01492110566 * c25_ok_b; c25_bn_x = c25_q4; c25_cn_x = c25_bn_x; c25_cn_x = muDoubleScalarSin(c25_cn_x); c25_lb_a = c25_jk_y; c25_pk_b = c25_cn_x; c25_kk_y = c25_lb_a * c25_pk_b; c25_dn_x = c25_q5; c25_en_x = c25_dn_x; c25_en_x = muDoubleScalarSin(c25_en_x); c25_mb_a = c25_kk_y; c25_qk_b = c25_en_x; c25_lk_y = c25_mb_a * c25_qk_b; c25_fn_x = c25_q3; c25_gn_x = c25_fn_x; c25_gn_x = muDoubleScalarCos(c25_gn_x); c25_rk_b = c25_gn_x; c25_mk_y = 0.01492110566 * c25_rk_b; c25_hn_x = c25_q4; c25_in_x = c25_hn_x; c25_in_x = muDoubleScalarCos(c25_in_x); c25_nb_a = c25_mk_y; c25_sk_b = c25_in_x; c25_nk_y = c25_nb_a * c25_sk_b; c25_jn_x = c25_q5; c25_kn_x = c25_jn_x; c25_kn_x = muDoubleScalarSin(c25_kn_x); c25_ob_a = c25_nk_y; c25_tk_b = c25_kn_x; c25_ok_y = c25_ob_a * c25_tk_b; c25_m42 = ((((((c25_ck_y - c25_ek_y) - c25_gk_y) - c25_hk_y) - c25_ik_y) - c25_lk_y) + c25_ok_y) + 0.01612863983; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 45); c25_ln_x = c25_q4; c25_mn_x = c25_ln_x; c25_mn_x = muDoubleScalarCos(c25_mn_x); c25_uk_b = c25_mn_x; c25_pk_y = 0.01377762234 * c25_uk_b; c25_nn_x = c25_q5; c25_on_x = c25_nn_x; c25_on_x = muDoubleScalarSin(c25_on_x); c25_pb_a = c25_pk_y; c25_vk_b = c25_on_x; c25_qk_y = c25_pb_a * c25_vk_b; c25_pn_x = c25_q4; c25_qn_x = c25_pn_x; c25_qn_x = muDoubleScalarSin(c25_qn_x); c25_wk_b = c25_qn_x; c25_rk_y = 0.05830173968 * c25_wk_b; c25_rn_x = c25_q5; c25_sn_x = c25_rn_x; c25_sn_x = muDoubleScalarCos(c25_sn_x); c25_xk_b = c25_mpower(chartInstance, c25_sn_x); c25_sk_y = 0.001803200269 * c25_xk_b; c25_m43 = ((c25_qk_y - c25_rk_y) - c25_sk_y) + 0.01612863983; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 46); c25_tn_x = c25_q5; c25_un_x = c25_tn_x; c25_un_x = muDoubleScalarSin(c25_un_x); c25_yk_b = c25_mpower(chartInstance, c25_un_x); c25_tk_y = 0.001803200269 * c25_yk_b; c25_m44 = c25_tk_y + 0.01432543956; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 47); c25_vn_x = c25_q5; c25_wn_x = c25_vn_x; c25_wn_x = muDoubleScalarCos(c25_wn_x); c25_al_b = c25_wn_x; c25_m45 = -0.003229235775 * c25_al_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 48); c25_xn_x = c25_q5; c25_yn_x = c25_xn_x; c25_yn_x = muDoubleScalarCos(c25_yn_x); c25_bl_b = c25_yn_x; c25_m46 = 0.000138534912 * c25_bl_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 49); c25_cl_b = c25_q5; c25_uk_y = c25_cl_b; c25_ao_x = (c25_q2 + c25_q3) - c25_uk_y; c25_bo_x = c25_ao_x; c25_bo_x = muDoubleScalarSin(c25_bo_x); c25_dl_b = c25_bo_x; c25_vk_y = 0.006888811168 * c25_dl_b; c25_co_x = (c25_q2 + c25_q3) + c25_q5; c25_do_x = c25_co_x; c25_do_x = muDoubleScalarSin(c25_do_x); c25_el_b = c25_do_x; c25_wk_y = 0.006888811168 * c25_el_b; c25_eo_x = (c25_q2 + c25_q3) + c25_q4; c25_fo_x = c25_eo_x; c25_fo_x = muDoubleScalarCos(c25_fo_x); c25_fl_b = c25_fo_x; c25_xk_y = 0.002840479501 * c25_fl_b; c25_gl_b = c25_q5; c25_yk_y = c25_gl_b; c25_hl_b = c25_q3; c25_al_y = c25_hl_b; c25_il_b = c25_q4; c25_bl_y = c25_il_b; c25_jl_b = c25_q2; c25_cl_y = c25_jl_b; c25_go_x = ((c25_yk_y - c25_al_y) - c25_bl_y) - c25_cl_y; c25_ho_x = c25_go_x; c25_ho_x = muDoubleScalarCos(c25_ho_x); c25_kl_b = c25_ho_x; c25_dl_y = 0.0002987944852 * c25_kl_b; c25_io_x = ((c25_q2 + c25_q3) + c25_q4) + c25_q5; c25_jo_x = c25_io_x; c25_jo_x = muDoubleScalarCos(c25_jo_x); c25_ll_b = c25_jo_x; c25_el_y = 0.00352803026 * c25_ll_b; c25_ko_x = c25_q2 + c25_q5; c25_lo_x = c25_ko_x; c25_lo_x = muDoubleScalarSin(c25_lo_x); c25_ml_b = c25_lo_x; c25_fl_y = 0.007460552829 * c25_ml_b; c25_nl_b = c25_q5; c25_gl_y = c25_nl_b; c25_mo_x = c25_q2 - c25_gl_y; c25_no_x = c25_mo_x; c25_no_x = muDoubleScalarSin(c25_no_x); c25_ol_b = c25_no_x; c25_hl_y = 0.007460552829 * c25_ol_b; c25_m51 = (((((c25_vk_y - c25_wk_y) - c25_xk_y) - c25_dl_y) - c25_el_y) - c25_fl_y) + c25_hl_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 50); c25_oo_x = c25_q5; c25_po_x = c25_oo_x; c25_po_x = muDoubleScalarCos(c25_po_x); c25_qo_x = c25_q3 + c25_q4; c25_ro_x = c25_qo_x; c25_ro_x = muDoubleScalarSin(c25_ro_x); c25_pl_b = c25_ro_x; c25_il_y = 0.01492110566 * c25_pl_b; c25_so_x = c25_q4; c25_to_x = c25_so_x; c25_to_x = muDoubleScalarSin(c25_to_x); c25_ql_b = c25_to_x; c25_jl_y = 0.01377762234 * c25_ql_b; c25_qb_a = c25_po_x; c25_rl_b = (c25_il_y + c25_jl_y) - 0.003229235775; c25_m52 = c25_qb_a * c25_rl_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 51); c25_uo_x = c25_q5; c25_vo_x = c25_uo_x; c25_vo_x = muDoubleScalarCos(c25_vo_x); c25_wo_x = c25_q4; c25_xo_x = c25_wo_x; c25_xo_x = muDoubleScalarSin(c25_xo_x); c25_sl_b = c25_xo_x; c25_kl_y = 0.01377762234 * c25_sl_b; c25_rb_a = c25_vo_x; c25_tl_b = c25_kl_y - 0.003229235775; c25_m53 = c25_rb_a * c25_tl_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 52); c25_yo_x = c25_q5; c25_ap_x = c25_yo_x; c25_ap_x = muDoubleScalarCos(c25_ap_x); c25_ul_b = c25_ap_x; c25_m54 = -0.003229235775 * c25_ul_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 53); c25_m55 = 0.002840479501; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 54); c25_m56 = 0.0; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 55); c25_bp_x = (c25_q2 + c25_q3) + c25_q4; c25_cp_x = c25_bp_x; c25_cp_x = muDoubleScalarSin(c25_cp_x); c25_vl_b = c25_cp_x; c25_ll_y = -0.000138534912 * c25_vl_b; c25_dp_x = c25_q5; c25_ep_x = c25_dp_x; c25_ep_x = muDoubleScalarSin(c25_ep_x); c25_sb_a = c25_ll_y; c25_wl_b = c25_ep_x; c25_m61 = c25_sb_a * c25_wl_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 56); c25_fp_x = c25_q5; c25_gp_x = c25_fp_x; c25_gp_x = muDoubleScalarCos(c25_gp_x); c25_xl_b = c25_gp_x; c25_m62 = 0.000138534912 * c25_xl_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 57); c25_hp_x = c25_q5; c25_ip_x = c25_hp_x; c25_ip_x = muDoubleScalarCos(c25_ip_x); c25_yl_b = c25_ip_x; c25_m63 = 0.000138534912 * c25_yl_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 58); c25_jp_x = c25_q5; c25_kp_x = c25_jp_x; c25_kp_x = muDoubleScalarCos(c25_kp_x); c25_am_b = c25_kp_x; c25_m64 = 0.000138534912 * c25_am_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 59); c25_m65 = 0.0; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 60); c25_m66 = 0.000138534912; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 62); c25_bm_b = c25_dq5; c25_ml_y = 0.003730276414375 * c25_bm_b; c25_cm_b = c25_theta_5; c25_nl_y = c25_cm_b; c25_lp_x = (c25_theta_3 + c25_theta_4) - c25_nl_y; c25_mp_x = c25_lp_x; c25_mp_x = muDoubleScalarCos(c25_mp_x); c25_tb_a = c25_ml_y; c25_dm_b = c25_mp_x; c25_ol_y = c25_tb_a * c25_dm_b; c25_em_b = c25_dq4; c25_pl_y = 0.003730276414375 * c25_em_b; c25_fm_b = c25_theta_5; c25_ql_y = c25_fm_b; c25_np_x = (c25_theta_3 + c25_theta_4) - c25_ql_y; c25_op_x = c25_np_x; c25_op_x = muDoubleScalarCos(c25_op_x); c25_ub_a = c25_pl_y; c25_gm_b = c25_op_x; c25_rl_y = c25_ub_a * c25_gm_b; c25_hm_b = c25_dq3; c25_sl_y = 0.003730276414375 * c25_hm_b; c25_im_b = c25_theta_5; c25_tl_y = c25_im_b; c25_pp_x = (c25_theta_3 + c25_theta_4) - c25_tl_y; c25_qp_x = c25_pp_x; c25_qp_x = muDoubleScalarCos(c25_qp_x); c25_vb_a = c25_sl_y; c25_jm_b = c25_qp_x; c25_ul_y = c25_vb_a * c25_jm_b; c25_km_b = c25_dq2; c25_vl_y = 0.00746055282875 * c25_km_b; c25_lm_b = c25_theta_2; c25_wl_y = 2.0 * c25_lm_b; c25_mm_b = c25_theta_5; c25_xl_y = c25_mm_b; c25_rp_x = ((c25_wl_y + c25_theta_3) + c25_theta_4) - c25_xl_y; c25_sp_x = c25_rp_x; c25_sp_x = muDoubleScalarCos(c25_sp_x); c25_wb_a = c25_vl_y; c25_nm_b = c25_sp_x; c25_yl_y = c25_wb_a * c25_nm_b; c25_om_b = c25_dq3; c25_am_y = 0.003730276414375 * c25_om_b; c25_pm_b = c25_theta_2; c25_bm_y = 2.0 * c25_pm_b; c25_qm_b = c25_theta_5; c25_cm_y = c25_qm_b; c25_tp_x = ((c25_bm_y + c25_theta_3) + c25_theta_4) - c25_cm_y; c25_up_x = c25_tp_x; c25_up_x = muDoubleScalarCos(c25_up_x); c25_xb_a = c25_am_y; c25_rm_b = c25_up_x; c25_dm_y = c25_xb_a * c25_rm_b; c25_sm_b = c25_dq4; c25_em_y = 0.003730276414375 * c25_sm_b; c25_tm_b = c25_theta_2; c25_fm_y = 2.0 * c25_tm_b; c25_um_b = c25_theta_5; c25_gm_y = c25_um_b; c25_vp_x = ((c25_fm_y + c25_theta_3) + c25_theta_4) - c25_gm_y; c25_wp_x = c25_vp_x; c25_wp_x = muDoubleScalarCos(c25_wp_x); c25_yb_a = c25_em_y; c25_vm_b = c25_wp_x; c25_hm_y = c25_yb_a * c25_vm_b; c25_wm_b = c25_dq5; c25_im_y = 0.003730276414375 * c25_wm_b; c25_xm_b = c25_theta_2; c25_jm_y = 2.0 * c25_xm_b; c25_ym_b = c25_theta_5; c25_km_y = c25_ym_b; c25_xp_x = ((c25_jm_y + c25_theta_3) + c25_theta_4) - c25_km_y; c25_yp_x = c25_xp_x; c25_yp_x = muDoubleScalarCos(c25_yp_x); c25_ac_a = c25_im_y; c25_an_b = c25_yp_x; c25_lm_y = c25_ac_a * c25_an_b; c25_bn_b = c25_dq2; c25_mm_y = 0.701428260725 * c25_bn_b; c25_cn_b = c25_theta_2; c25_nm_y = 2.0 * c25_cn_b; c25_aq_x = c25_nm_y + c25_theta_3; c25_bq_x = c25_aq_x; c25_bq_x = muDoubleScalarSin(c25_bq_x); c25_bc_a = c25_mm_y; c25_dn_b = c25_bq_x; c25_om_y = c25_bc_a * c25_dn_b; c25_en_b = c25_dq3; c25_pm_y = 0.3507141303625 * c25_en_b; c25_fn_b = c25_theta_2; c25_qm_y = 2.0 * c25_fn_b; c25_cq_x = c25_qm_y + c25_theta_3; c25_dq_x = c25_cq_x; c25_dq_x = muDoubleScalarSin(c25_dq_x); c25_cc_a = c25_pm_y; c25_gn_b = c25_dq_x; c25_rm_y = c25_cc_a * c25_gn_b; c25_hn_b = c25_dq2; c25_sm_y = 0.0583017396828 * c25_hn_b; c25_in_b = c25_theta_2; c25_tm_y = 2.0 * c25_in_b; c25_jn_b = c25_theta_3; c25_um_y = 2.0 * c25_jn_b; c25_eq_x = (c25_tm_y + c25_um_y) + c25_theta_4; c25_fq_x = c25_eq_x; c25_fq_x = muDoubleScalarCos(c25_fq_x); c25_dc_a = c25_sm_y; c25_kn_b = c25_fq_x; c25_vm_y = c25_dc_a * c25_kn_b; c25_ln_b = c25_dq3; c25_wm_y = 0.0583017396828 * c25_ln_b; c25_mn_b = c25_theta_2; c25_xm_y = 2.0 * c25_mn_b; c25_nn_b = c25_theta_3; c25_ym_y = 2.0 * c25_nn_b; c25_gq_x = (c25_xm_y + c25_ym_y) + c25_theta_4; c25_hq_x = c25_gq_x; c25_hq_x = muDoubleScalarCos(c25_hq_x); c25_ec_a = c25_wm_y; c25_on_b = c25_hq_x; c25_an_y = c25_ec_a * c25_on_b; c25_pn_b = c25_dq4; c25_bn_y = 0.0291508698414 * c25_pn_b; c25_qn_b = c25_theta_2; c25_cn_y = 2.0 * c25_qn_b; c25_rn_b = c25_theta_3; c25_dn_y = 2.0 * c25_rn_b; c25_iq_x = (c25_cn_y + c25_dn_y) + c25_theta_4; c25_jq_x = c25_iq_x; c25_jq_x = muDoubleScalarCos(c25_jq_x); c25_fc_a = c25_bn_y; c25_sn_b = c25_jq_x; c25_en_y = c25_fc_a * c25_sn_b; c25_tn_b = c25_dq2; c25_fn_y = 0.00161461788735 * c25_tn_b; c25_un_b = c25_theta_2; c25_gn_y = 2.0 * c25_un_b; c25_vn_b = c25_theta_3; c25_hn_y = 2.0 * c25_vn_b; c25_wn_b = c25_theta_4; c25_in_y = 2.0 * c25_wn_b; c25_kq_x = ((c25_gn_y + c25_hn_y) + c25_in_y) + c25_theta_5; c25_lq_x = c25_kq_x; c25_lq_x = muDoubleScalarSin(c25_lq_x); c25_gc_a = c25_fn_y; c25_xn_b = c25_lq_x; c25_jn_y = c25_gc_a * c25_xn_b; c25_yn_b = c25_dq3; c25_kn_y = 0.00161461788735 * c25_yn_b; c25_ao_b = c25_theta_2; c25_ln_y = 2.0 * c25_ao_b; c25_bo_b = c25_theta_3; c25_mn_y = 2.0 * c25_bo_b; c25_co_b = c25_theta_4; c25_nn_y = 2.0 * c25_co_b; c25_mq_x = ((c25_ln_y + c25_mn_y) + c25_nn_y) + c25_theta_5; c25_nq_x = c25_mq_x; c25_nq_x = muDoubleScalarSin(c25_nq_x); c25_hc_a = c25_kn_y; c25_do_b = c25_nq_x; c25_on_y = c25_hc_a * c25_do_b; c25_eo_b = c25_dq4; c25_pn_y = 0.00161461788735 * c25_eo_b; c25_fo_b = c25_theta_2; c25_qn_y = 2.0 * c25_fo_b; c25_go_b = c25_theta_3; c25_rn_y = 2.0 * c25_go_b; c25_ho_b = c25_theta_4; c25_sn_y = 2.0 * c25_ho_b; c25_oq_x = ((c25_qn_y + c25_rn_y) + c25_sn_y) + c25_theta_5; c25_pq_x = c25_oq_x; c25_pq_x = muDoubleScalarSin(c25_pq_x); c25_ic_a = c25_pn_y; c25_io_b = c25_pq_x; c25_tn_y = c25_ic_a * c25_io_b; c25_jo_b = c25_dq5; c25_un_y = 0.000807308943675 * c25_jo_b; c25_ko_b = c25_theta_2; c25_vn_y = 2.0 * c25_ko_b; c25_lo_b = c25_theta_3; c25_wn_y = 2.0 * c25_lo_b; c25_mo_b = c25_theta_4; c25_xn_y = 2.0 * c25_mo_b; c25_qq_x = ((c25_vn_y + c25_wn_y) + c25_xn_y) + c25_theta_5; c25_rq_x = c25_qq_x; c25_rq_x = muDoubleScalarSin(c25_rq_x); c25_jc_a = c25_un_y; c25_no_b = c25_rq_x; c25_yn_y = c25_jc_a * c25_no_b; c25_oo_b = c25_dq2; c25_ao_y = 0.80286398713 * c25_oo_b; c25_po_b = c25_theta_2; c25_bo_y = 2.0 * c25_po_b; c25_sq_x = c25_bo_y; c25_tq_x = c25_sq_x; c25_tq_x = muDoubleScalarSin(c25_tq_x); c25_kc_a = c25_ao_y; c25_qo_b = c25_tq_x; c25_co_y = c25_kc_a * c25_qo_b; c25_ro_b = c25_dq5; c25_do_y = 0.00045080006724164168 * c25_ro_b; c25_so_b = c25_theta_5; c25_eo_y = 2.0 * c25_so_b; c25_uq_x = c25_eo_y; c25_vq_x = c25_uq_x; c25_vq_x = muDoubleScalarSin(c25_vq_x); c25_lc_a = c25_do_y; c25_to_b = c25_vq_x; c25_fo_y = c25_lc_a * c25_to_b; c25_uo_b = c25_dq2; c25_go_y = 0.00161461788735 * c25_uo_b; c25_vo_b = c25_theta_2; c25_ho_y = 2.0 * c25_vo_b; c25_wo_b = c25_theta_3; c25_io_y = 2.0 * c25_wo_b; c25_xo_b = c25_theta_4; c25_jo_y = 2.0 * c25_xo_b; c25_yo_b = c25_theta_5; c25_ko_y = c25_yo_b; c25_wq_x = ((c25_ho_y + c25_io_y) + c25_jo_y) - c25_ko_y; c25_xq_x = c25_wq_x; c25_xq_x = muDoubleScalarSin(c25_xq_x); c25_mc_a = c25_go_y; c25_ap_b = c25_xq_x; c25_lo_y = c25_mc_a * c25_ap_b; c25_bp_b = c25_dq2; c25_mo_y = 0.00022540003362082084 * c25_bp_b; c25_cp_b = c25_theta_2; c25_no_y = 2.0 * c25_cp_b; c25_dp_b = c25_theta_3; c25_oo_y = 2.0 * c25_dp_b; c25_ep_b = c25_theta_4; c25_po_y = 2.0 * c25_ep_b; c25_fp_b = c25_theta_5; c25_qo_y = 2.0 * c25_fp_b; c25_yq_x = ((c25_no_y + c25_oo_y) + c25_po_y) - c25_qo_y; c25_ar_x = c25_yq_x; c25_ar_x = muDoubleScalarSin(c25_ar_x); c25_nc_a = c25_mo_y; c25_gp_b = c25_ar_x; c25_ro_y = c25_nc_a * c25_gp_b; c25_hp_b = c25_dq3; c25_so_y = 0.00161461788735 * c25_hp_b; c25_ip_b = c25_theta_2; c25_to_y = 2.0 * c25_ip_b; c25_jp_b = c25_theta_3; c25_uo_y = 2.0 * c25_jp_b; c25_kp_b = c25_theta_4; c25_vo_y = 2.0 * c25_kp_b; c25_lp_b = c25_theta_5; c25_wo_y = c25_lp_b; c25_br_x = ((c25_to_y + c25_uo_y) + c25_vo_y) - c25_wo_y; c25_cr_x = c25_br_x; c25_cr_x = muDoubleScalarSin(c25_cr_x); c25_oc_a = c25_so_y; c25_mp_b = c25_cr_x; c25_xo_y = c25_oc_a * c25_mp_b; c25_np_b = c25_dq3; c25_yo_y = 0.00022540003362082084 * c25_np_b; c25_op_b = c25_theta_2; c25_ap_y = 2.0 * c25_op_b; c25_pp_b = c25_theta_3; c25_bp_y = 2.0 * c25_pp_b; c25_qp_b = c25_theta_4; c25_cp_y = 2.0 * c25_qp_b; c25_rp_b = c25_theta_5; c25_dp_y = 2.0 * c25_rp_b; c25_dr_x = ((c25_ap_y + c25_bp_y) + c25_cp_y) - c25_dp_y; c25_er_x = c25_dr_x; c25_er_x = muDoubleScalarSin(c25_er_x); c25_pc_a = c25_yo_y; c25_sp_b = c25_er_x; c25_ep_y = c25_pc_a * c25_sp_b; c25_tp_b = c25_dq4; c25_fp_y = 0.00161461788735 * c25_tp_b; c25_up_b = c25_theta_2; c25_gp_y = 2.0 * c25_up_b; c25_vp_b = c25_theta_3; c25_hp_y = 2.0 * c25_vp_b; c25_wp_b = c25_theta_4; c25_ip_y = 2.0 * c25_wp_b; c25_xp_b = c25_theta_5; c25_jp_y = c25_xp_b; c25_fr_x = ((c25_gp_y + c25_hp_y) + c25_ip_y) - c25_jp_y; c25_gr_x = c25_fr_x; c25_gr_x = muDoubleScalarSin(c25_gr_x); c25_qc_a = c25_fp_y; c25_yp_b = c25_gr_x; c25_kp_y = c25_qc_a * c25_yp_b; c25_aq_b = c25_dq4; c25_lp_y = 0.00022540003362082084 * c25_aq_b; c25_bq_b = c25_theta_2; c25_mp_y = 2.0 * c25_bq_b; c25_cq_b = c25_theta_3; c25_np_y = 2.0 * c25_cq_b; c25_dq_b = c25_theta_4; c25_op_y = 2.0 * c25_dq_b; c25_eq_b = c25_theta_5; c25_pp_y = 2.0 * c25_eq_b; c25_hr_x = ((c25_mp_y + c25_np_y) + c25_op_y) - c25_pp_y; c25_ir_x = c25_hr_x; c25_ir_x = muDoubleScalarSin(c25_ir_x); c25_rc_a = c25_lp_y; c25_fq_b = c25_ir_x; c25_qp_y = c25_rc_a * c25_fq_b; c25_gq_b = c25_dq5; c25_rp_y = 0.000807308943675 * c25_gq_b; c25_hq_b = c25_theta_2; c25_sp_y = 2.0 * c25_hq_b; c25_iq_b = c25_theta_3; c25_tp_y = 2.0 * c25_iq_b; c25_jq_b = c25_theta_4; c25_up_y = 2.0 * c25_jq_b; c25_kq_b = c25_theta_5; c25_vp_y = c25_kq_b; c25_jr_x = ((c25_sp_y + c25_tp_y) + c25_up_y) - c25_vp_y; c25_kr_x = c25_jr_x; c25_kr_x = muDoubleScalarSin(c25_kr_x); c25_sc_a = c25_rp_y; c25_lq_b = c25_kr_x; c25_wp_y = c25_sc_a * c25_lq_b; c25_mq_b = c25_dq5; c25_xp_y = 0.00022540003362082084 * c25_mq_b; c25_nq_b = c25_theta_2; c25_yp_y = 2.0 * c25_nq_b; c25_oq_b = c25_theta_3; c25_aq_y = 2.0 * c25_oq_b; c25_pq_b = c25_theta_4; c25_bq_y = 2.0 * c25_pq_b; c25_qq_b = c25_theta_5; c25_cq_y = 2.0 * c25_qq_b; c25_lr_x = ((c25_yp_y + c25_aq_y) + c25_bq_y) - c25_cq_y; c25_mr_x = c25_lr_x; c25_mr_x = muDoubleScalarSin(c25_mr_x); c25_tc_a = c25_xp_y; c25_rq_b = c25_mr_x; c25_dq_y = c25_tc_a * c25_rq_b; c25_sq_b = c25_dq3; c25_eq_y = 0.0315702665 * c25_sq_b; c25_nr_x = c25_theta_3 + c25_theta_4; c25_or_x = c25_nr_x; c25_or_x = muDoubleScalarCos(c25_or_x); c25_uc_a = c25_eq_y; c25_tq_b = c25_or_x; c25_fq_y = c25_uc_a * c25_tq_b; c25_uq_b = c25_dq4; c25_gq_y = 0.0315702665 * c25_uq_b; c25_pr_x = c25_theta_3 + c25_theta_4; c25_qr_x = c25_pr_x; c25_qr_x = muDoubleScalarCos(c25_qr_x); c25_vc_a = c25_gq_y; c25_vq_b = c25_qr_x; c25_hq_y = c25_vc_a * c25_vq_b; c25_wq_b = c25_dq4; c25_iq_y = 0.00344440558421925 * c25_wq_b; c25_rr_x = c25_theta_4 + c25_theta_5; c25_sr_x = c25_rr_x; c25_sr_x = muDoubleScalarCos(c25_sr_x); c25_wc_a = c25_iq_y; c25_xq_b = c25_sr_x; c25_jq_y = c25_wc_a * c25_xq_b; c25_yq_b = c25_dq5; c25_kq_y = 0.00344440558421925 * c25_yq_b; c25_tr_x = c25_theta_4 + c25_theta_5; c25_ur_x = c25_tr_x; c25_ur_x = muDoubleScalarCos(c25_ur_x); c25_xc_a = c25_kq_y; c25_ar_b = c25_ur_x; c25_lq_y = c25_xc_a * c25_ar_b; c25_br_b = c25_dq2; c25_mq_y = 0.063140533 * c25_br_b; c25_cr_b = c25_theta_2; c25_nq_y = 2.0 * c25_cr_b; c25_vr_x = (c25_nq_y + c25_theta_3) + c25_theta_4; c25_wr_x = c25_vr_x; c25_wr_x = muDoubleScalarCos(c25_wr_x); c25_yc_a = c25_mq_y; c25_dr_b = c25_wr_x; c25_oq_y = c25_yc_a * c25_dr_b; c25_er_b = c25_dq3; c25_pq_y = 0.0315702665 * c25_er_b; c25_fr_b = c25_theta_2; c25_qq_y = 2.0 * c25_fr_b; c25_xr_x = (c25_qq_y + c25_theta_3) + c25_theta_4; c25_yr_x = c25_xr_x; c25_yr_x = muDoubleScalarCos(c25_yr_x); c25_ad_a = c25_pq_y; c25_gr_b = c25_yr_x; c25_rq_y = c25_ad_a * c25_gr_b; c25_hr_b = c25_dq4; c25_sq_y = 0.0315702665 * c25_hr_b; c25_ir_b = c25_theta_2; c25_tq_y = 2.0 * c25_ir_b; c25_as_x = (c25_tq_y + c25_theta_3) + c25_theta_4; c25_bs_x = c25_as_x; c25_bs_x = muDoubleScalarCos(c25_bs_x); c25_bd_a = c25_sq_y; c25_jr_b = c25_bs_x; c25_uq_y = c25_bd_a * c25_jr_b; c25_kr_b = c25_dq4; c25_vq_y = 0.00344440558421925 * c25_kr_b; c25_lr_b = c25_theta_5; c25_wq_y = c25_lr_b; c25_cs_x = c25_theta_4 - c25_wq_y; c25_ds_x = c25_cs_x; c25_ds_x = muDoubleScalarCos(c25_ds_x); c25_cd_a = c25_vq_y; c25_mr_b = c25_ds_x; c25_xq_y = c25_cd_a * c25_mr_b; c25_nr_b = c25_dq5; c25_yq_y = 0.00344440558421925 * c25_nr_b; c25_or_b = c25_theta_5; c25_ar_y = c25_or_b; c25_es_x = c25_theta_4 - c25_ar_y; c25_fs_x = c25_es_x; c25_fs_x = muDoubleScalarCos(c25_fs_x); c25_dd_a = c25_yq_y; c25_pr_b = c25_fs_x; c25_br_y = c25_dd_a * c25_pr_b; c25_qr_b = c25_dq2; c25_cr_y = 0.0068888111684385 * c25_qr_b; c25_rr_b = c25_theta_2; c25_dr_y = 2.0 * c25_rr_b; c25_sr_b = c25_theta_3; c25_er_y = 2.0 * c25_sr_b; c25_gs_x = ((c25_dr_y + c25_er_y) + c25_theta_4) + c25_theta_5; c25_hs_x = c25_gs_x; c25_hs_x = muDoubleScalarCos(c25_hs_x); c25_ed_a = c25_cr_y; c25_tr_b = c25_hs_x; c25_fr_y = c25_ed_a * c25_tr_b; c25_ur_b = c25_dq3; c25_gr_y = 0.0068888111684385 * c25_ur_b; c25_vr_b = c25_theta_2; c25_hr_y = 2.0 * c25_vr_b; c25_wr_b = c25_theta_3; c25_ir_y = 2.0 * c25_wr_b; c25_is_x = ((c25_hr_y + c25_ir_y) + c25_theta_4) + c25_theta_5; c25_js_x = c25_is_x; c25_js_x = muDoubleScalarCos(c25_js_x); c25_fd_a = c25_gr_y; c25_xr_b = c25_js_x; c25_jr_y = c25_fd_a * c25_xr_b; c25_yr_b = c25_dq4; c25_kr_y = 0.00344440558421925 * c25_yr_b; c25_as_b = c25_theta_2; c25_lr_y = 2.0 * c25_as_b; c25_bs_b = c25_theta_3; c25_mr_y = 2.0 * c25_bs_b; c25_ks_x = ((c25_lr_y + c25_mr_y) + c25_theta_4) + c25_theta_5; c25_ls_x = c25_ks_x; c25_ls_x = muDoubleScalarCos(c25_ls_x); c25_gd_a = c25_kr_y; c25_cs_b = c25_ls_x; c25_nr_y = c25_gd_a * c25_cs_b; c25_ds_b = c25_dq5; c25_or_y = 0.00344440558421925 * c25_ds_b; c25_es_b = c25_theta_2; c25_pr_y = 2.0 * c25_es_b; c25_fs_b = c25_theta_3; c25_qr_y = 2.0 * c25_fs_b; c25_ms_x = ((c25_pr_y + c25_qr_y) + c25_theta_4) + c25_theta_5; c25_ns_x = c25_ms_x; c25_ns_x = muDoubleScalarCos(c25_ns_x); c25_hd_a = c25_or_y; c25_gs_b = c25_ns_x; c25_rr_y = c25_hd_a * c25_gs_b; c25_hs_b = c25_dq4; c25_sr_y = 0.0291508698414 * c25_hs_b; c25_os_x = c25_theta_4; c25_ps_x = c25_os_x; c25_ps_x = muDoubleScalarCos(c25_ps_x); c25_id_a = c25_sr_y; c25_is_b = c25_ps_x; c25_tr_y = c25_id_a * c25_is_b; c25_js_b = c25_dq3; c25_ur_y = 0.3507141303625 * c25_js_b; c25_qs_x = c25_theta_3; c25_rs_x = c25_qs_x; c25_rs_x = muDoubleScalarSin(c25_rs_x); c25_jd_a = c25_ur_y; c25_ks_b = c25_rs_x; c25_vr_y = c25_jd_a * c25_ks_b; c25_ls_b = c25_dq5; c25_wr_y = 0.0038268247451 * c25_ls_b; c25_ss_x = c25_theta_5; c25_ts_x = c25_ss_x; c25_ts_x = muDoubleScalarSin(c25_ts_x); c25_kd_a = c25_wr_y; c25_ms_b = c25_ts_x; c25_xr_y = c25_kd_a * c25_ms_b; c25_ns_b = c25_dq2; c25_yr_y = 0.0068888111684385 * c25_ns_b; c25_os_b = c25_theta_2; c25_as_y = 2.0 * c25_os_b; c25_ps_b = c25_theta_3; c25_bs_y = 2.0 * c25_ps_b; c25_qs_b = c25_theta_5; c25_cs_y = c25_qs_b; c25_us_x = ((c25_as_y + c25_bs_y) + c25_theta_4) - c25_cs_y; c25_vs_x = c25_us_x; c25_vs_x = muDoubleScalarCos(c25_vs_x); c25_ld_a = c25_yr_y; c25_rs_b = c25_vs_x; c25_ds_y = c25_ld_a * c25_rs_b; c25_ss_b = c25_dq3; c25_es_y = 0.0068888111684385 * c25_ss_b; c25_ts_b = c25_theta_2; c25_fs_y = 2.0 * c25_ts_b; c25_us_b = c25_theta_3; c25_gs_y = 2.0 * c25_us_b; c25_vs_b = c25_theta_5; c25_hs_y = c25_vs_b; c25_ws_x = ((c25_fs_y + c25_gs_y) + c25_theta_4) - c25_hs_y; c25_xs_x = c25_ws_x; c25_xs_x = muDoubleScalarCos(c25_xs_x); c25_md_a = c25_es_y; c25_ws_b = c25_xs_x; c25_is_y = c25_md_a * c25_ws_b; c25_xs_b = c25_dq4; c25_js_y = 0.00344440558421925 * c25_xs_b; c25_ys_b = c25_theta_2; c25_ks_y = 2.0 * c25_ys_b; c25_at_b = c25_theta_3; c25_ls_y = 2.0 * c25_at_b; c25_bt_b = c25_theta_5; c25_ms_y = c25_bt_b; c25_ys_x = ((c25_ks_y + c25_ls_y) + c25_theta_4) - c25_ms_y; c25_at_x = c25_ys_x; c25_at_x = muDoubleScalarCos(c25_at_x); c25_nd_a = c25_js_y; c25_ct_b = c25_at_x; c25_ns_y = c25_nd_a * c25_ct_b; c25_dt_b = c25_dq5; c25_os_y = 0.00344440558421925 * c25_dt_b; c25_et_b = c25_theta_2; c25_ps_y = 2.0 * c25_et_b; c25_ft_b = c25_theta_3; c25_qs_y = 2.0 * c25_ft_b; c25_gt_b = c25_theta_5; c25_rs_y = c25_gt_b; c25_bt_x = ((c25_ps_y + c25_qs_y) + c25_theta_4) - c25_rs_y; c25_ct_x = c25_bt_x; c25_ct_x = muDoubleScalarCos(c25_ct_x); c25_od_a = c25_os_y; c25_ht_b = c25_ct_x; c25_ss_y = c25_od_a * c25_ht_b; c25_it_b = c25_dq2; c25_ts_y = 0.31297029415553834 * c25_it_b; c25_jt_b = c25_theta_2; c25_us_y = 2.0 * c25_jt_b; c25_kt_b = c25_theta_3; c25_vs_y = 2.0 * c25_kt_b; c25_dt_x = c25_us_y + c25_vs_y; c25_et_x = c25_dt_x; c25_et_x = muDoubleScalarSin(c25_et_x); c25_pd_a = c25_ts_y; c25_lt_b = c25_et_x; c25_ws_y = c25_pd_a * c25_lt_b; c25_mt_b = c25_dq3; c25_xs_y = 0.31297029415553834 * c25_mt_b; c25_nt_b = c25_theta_2; c25_ys_y = 2.0 * c25_nt_b; c25_ot_b = c25_theta_3; c25_at_y = 2.0 * c25_ot_b; c25_ft_x = c25_ys_y + c25_at_y; c25_gt_x = c25_ft_x; c25_gt_x = muDoubleScalarSin(c25_gt_x); c25_qd_a = c25_xs_y; c25_pt_b = c25_gt_x; c25_bt_y = c25_qd_a * c25_pt_b; c25_qt_b = c25_dq2; c25_ct_y = 0.0057439079350250248 * c25_qt_b; c25_rt_b = c25_theta_2; c25_dt_y = 2.0 * c25_rt_b; c25_st_b = c25_theta_3; c25_et_y = 2.0 * c25_st_b; c25_tt_b = c25_theta_4; c25_ft_y = 2.0 * c25_tt_b; c25_ht_x = (c25_dt_y + c25_et_y) + c25_ft_y; c25_it_x = c25_ht_x; c25_it_x = muDoubleScalarSin(c25_it_x); c25_rd_a = c25_ct_y; c25_ut_b = c25_it_x; c25_gt_y = c25_rd_a * c25_ut_b; c25_vt_b = c25_dq3; c25_ht_y = 0.0057439079350250248 * c25_vt_b; c25_wt_b = c25_theta_2; c25_it_y = 2.0 * c25_wt_b; c25_xt_b = c25_theta_3; c25_jt_y = 2.0 * c25_xt_b; c25_yt_b = c25_theta_4; c25_kt_y = 2.0 * c25_yt_b; c25_jt_x = (c25_it_y + c25_jt_y) + c25_kt_y; c25_kt_x = c25_jt_x; c25_kt_x = muDoubleScalarSin(c25_kt_x); c25_sd_a = c25_ht_y; c25_au_b = c25_kt_x; c25_lt_y = c25_sd_a * c25_au_b; c25_bu_b = c25_dq4; c25_mt_y = 0.0057439079350250248 * c25_bu_b; c25_cu_b = c25_theta_2; c25_nt_y = 2.0 * c25_cu_b; c25_du_b = c25_theta_3; c25_ot_y = 2.0 * c25_du_b; c25_eu_b = c25_theta_4; c25_pt_y = 2.0 * c25_eu_b; c25_lt_x = (c25_nt_y + c25_ot_y) + c25_pt_y; c25_mt_x = c25_lt_x; c25_mt_x = muDoubleScalarSin(c25_mt_x); c25_td_a = c25_mt_y; c25_fu_b = c25_mt_x; c25_qt_y = c25_td_a * c25_fu_b; c25_gu_b = c25_dq3; c25_rt_y = 0.003730276414375 * c25_gu_b; c25_nt_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_ot_x = c25_nt_x; c25_ot_x = muDoubleScalarCos(c25_ot_x); c25_ud_a = c25_rt_y; c25_hu_b = c25_ot_x; c25_st_y = c25_ud_a * c25_hu_b; c25_iu_b = c25_dq4; c25_tt_y = 0.003730276414375 * c25_iu_b; c25_pt_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_qt_x = c25_pt_x; c25_qt_x = muDoubleScalarCos(c25_qt_x); c25_vd_a = c25_tt_y; c25_ju_b = c25_qt_x; c25_ut_y = c25_vd_a * c25_ju_b; c25_ku_b = c25_dq5; c25_vt_y = 0.003730276414375 * c25_ku_b; c25_rt_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_st_x = c25_rt_x; c25_st_x = muDoubleScalarCos(c25_st_x); c25_wd_a = c25_vt_y; c25_lu_b = c25_st_x; c25_wt_y = c25_wd_a * c25_lu_b; c25_mu_b = c25_dq2; c25_xt_y = 0.00022540003362082084 * c25_mu_b; c25_nu_b = c25_theta_2; c25_yt_y = 2.0 * c25_nu_b; c25_ou_b = c25_theta_3; c25_au_y = 2.0 * c25_ou_b; c25_pu_b = c25_theta_4; c25_bu_y = 2.0 * c25_pu_b; c25_qu_b = c25_theta_5; c25_cu_y = 2.0 * c25_qu_b; c25_tt_x = ((c25_yt_y + c25_au_y) + c25_bu_y) + c25_cu_y; c25_ut_x = c25_tt_x; c25_ut_x = muDoubleScalarSin(c25_ut_x); c25_xd_a = c25_xt_y; c25_ru_b = c25_ut_x; c25_du_y = c25_xd_a * c25_ru_b; c25_su_b = c25_dq3; c25_eu_y = 0.00022540003362082084 * c25_su_b; c25_tu_b = c25_theta_2; c25_fu_y = 2.0 * c25_tu_b; c25_uu_b = c25_theta_3; c25_gu_y = 2.0 * c25_uu_b; c25_vu_b = c25_theta_4; c25_hu_y = 2.0 * c25_vu_b; c25_wu_b = c25_theta_5; c25_iu_y = 2.0 * c25_wu_b; c25_vt_x = ((c25_fu_y + c25_gu_y) + c25_hu_y) + c25_iu_y; c25_wt_x = c25_vt_x; c25_wt_x = muDoubleScalarSin(c25_wt_x); c25_yd_a = c25_eu_y; c25_xu_b = c25_wt_x; c25_ju_y = c25_yd_a * c25_xu_b; c25_yu_b = c25_dq4; c25_ku_y = 0.00022540003362082084 * c25_yu_b; c25_av_b = c25_theta_2; c25_lu_y = 2.0 * c25_av_b; c25_bv_b = c25_theta_3; c25_mu_y = 2.0 * c25_bv_b; c25_cv_b = c25_theta_4; c25_nu_y = 2.0 * c25_cv_b; c25_dv_b = c25_theta_5; c25_ou_y = 2.0 * c25_dv_b; c25_xt_x = ((c25_lu_y + c25_mu_y) + c25_nu_y) + c25_ou_y; c25_yt_x = c25_xt_x; c25_yt_x = muDoubleScalarSin(c25_yt_x); c25_ae_a = c25_ku_y; c25_ev_b = c25_yt_x; c25_pu_y = c25_ae_a * c25_ev_b; c25_fv_b = c25_dq5; c25_qu_y = 0.00022540003362082084 * c25_fv_b; c25_gv_b = c25_theta_2; c25_ru_y = 2.0 * c25_gv_b; c25_hv_b = c25_theta_3; c25_su_y = 2.0 * c25_hv_b; c25_iv_b = c25_theta_4; c25_tu_y = 2.0 * c25_iv_b; c25_jv_b = c25_theta_5; c25_uu_y = 2.0 * c25_jv_b; c25_au_x = ((c25_ru_y + c25_su_y) + c25_tu_y) + c25_uu_y; c25_bu_x = c25_au_x; c25_bu_x = muDoubleScalarSin(c25_bu_x); c25_be_a = c25_qu_y; c25_kv_b = c25_bu_x; c25_vu_y = c25_be_a * c25_kv_b; c25_lv_b = c25_dq2; c25_wu_y = 0.00746055282875 * c25_lv_b; c25_mv_b = c25_theta_2; c25_xu_y = 2.0 * c25_mv_b; c25_cu_x = ((c25_xu_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_du_x = c25_cu_x; c25_du_x = muDoubleScalarCos(c25_du_x); c25_ce_a = c25_wu_y; c25_nv_b = c25_du_x; c25_yu_y = c25_ce_a * c25_nv_b; c25_ov_b = c25_dq3; c25_av_y = 0.003730276414375 * c25_ov_b; c25_pv_b = c25_theta_2; c25_bv_y = 2.0 * c25_pv_b; c25_eu_x = ((c25_bv_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_fu_x = c25_eu_x; c25_fu_x = muDoubleScalarCos(c25_fu_x); c25_de_a = c25_av_y; c25_qv_b = c25_fu_x; c25_cv_y = c25_de_a * c25_qv_b; c25_rv_b = c25_dq4; c25_dv_y = 0.003730276414375 * c25_rv_b; c25_sv_b = c25_theta_2; c25_ev_y = 2.0 * c25_sv_b; c25_gu_x = ((c25_ev_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_hu_x = c25_gu_x; c25_hu_x = muDoubleScalarCos(c25_hu_x); c25_ee_a = c25_dv_y; c25_tv_b = c25_hu_x; c25_fv_y = c25_ee_a * c25_tv_b; c25_uv_b = c25_dq5; c25_gv_y = 0.003730276414375 * c25_uv_b; c25_vv_b = c25_theta_2; c25_hv_y = 2.0 * c25_vv_b; c25_iu_x = ((c25_hv_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ju_x = c25_iu_x; c25_ju_x = muDoubleScalarCos(c25_ju_x); c25_fe_a = c25_gv_y; c25_wv_b = c25_ju_x; c25_iv_y = c25_fe_a * c25_wv_b; c25_c11 = ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((c25_ol_y - c25_rl_y) - c25_ul_y) - c25_yl_y) - c25_dm_y) - c25_hm_y) + c25_lm_y) - c25_om_y) - c25_rm_y) - c25_vm_y) - c25_an_y) - c25_en_y) - c25_jn_y) - c25_on_y) - c25_tn_y) - c25_yn_y) - c25_co_y) - c25_fo_y) + c25_lo_y) + c25_ro_y) + c25_xo_y) + c25_ep_y) + c25_kp_y) + c25_qp_y) - c25_wp_y) - c25_dq_y) - c25_fq_y) - c25_hq_y) + c25_jq_y) + c25_lq_y) - c25_oq_y) - c25_rq_y) - c25_uq_y) - c25_xq_y) + c25_br_y) + c25_fr_y) + c25_jr_y) + c25_nr_y) + c25_rr_y) - c25_tr_y) - c25_vr_y) - c25_xr_y) - c25_ds_y) - c25_is_y) - c25_ns_y) + c25_ss_y) - c25_ws_y) - c25_bt_y) + c25_gt_y) + c25_lt_y) + c25_qt_y) + c25_st_y) + c25_ut_y) + c25_wt_y) + c25_du_y) + c25_ju_y) + c25_pu_y) + c25_vu_y) + c25_yu_y) + c25_cv_y) + c25_fv_y) + c25_iv_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 63); c25_xv_b = c25_dq2; c25_jv_y = 0.0068888111684385 * c25_xv_b; c25_yv_b = c25_theta_5; c25_kv_y = c25_yv_b; c25_ku_x = (c25_theta_2 + c25_theta_3) - c25_kv_y; c25_lu_x = c25_ku_x; c25_lu_x = muDoubleScalarCos(c25_lu_x); c25_ge_a = c25_jv_y; c25_aw_b = c25_lu_x; c25_lv_y = c25_ge_a * c25_aw_b; c25_bw_b = c25_dq3; c25_mv_y = 0.0068888111684385 * c25_bw_b; c25_cw_b = c25_theta_5; c25_nv_y = c25_cw_b; c25_mu_x = (c25_theta_2 + c25_theta_3) - c25_nv_y; c25_nu_x = c25_mu_x; c25_nu_x = muDoubleScalarCos(c25_nu_x); c25_he_a = c25_mv_y; c25_dw_b = c25_nu_x; c25_ov_y = c25_he_a * c25_dw_b; c25_ew_b = c25_dq2; c25_pv_y = 0.00045080006724164168 * c25_ew_b; c25_fw_b = c25_theta_5; c25_qv_y = 2.0 * c25_fw_b; c25_ou_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_qv_y; c25_pu_x = c25_ou_x; c25_pu_x = muDoubleScalarSin(c25_pu_x); c25_ie_a = c25_pv_y; c25_gw_b = c25_pu_x; c25_rv_y = c25_ie_a * c25_gw_b; c25_hw_b = c25_dq3; c25_sv_y = 0.00045080006724164168 * c25_hw_b; c25_iw_b = c25_theta_5; c25_tv_y = 2.0 * c25_iw_b; c25_qu_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_tv_y; c25_ru_x = c25_qu_x; c25_ru_x = muDoubleScalarSin(c25_ru_x); c25_je_a = c25_sv_y; c25_jw_b = c25_ru_x; c25_uv_y = c25_je_a * c25_jw_b; c25_kw_b = c25_dq4; c25_vv_y = 0.00045080006724164168 * c25_kw_b; c25_lw_b = c25_theta_5; c25_wv_y = 2.0 * c25_lw_b; c25_su_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_wv_y; c25_tu_x = c25_su_x; c25_tu_x = muDoubleScalarSin(c25_tu_x); c25_ke_a = c25_vv_y; c25_mw_b = c25_tu_x; c25_xv_y = c25_ke_a * c25_mw_b; c25_nw_b = c25_dq5; c25_yv_y = 0.00045080006724164168 * c25_nw_b; c25_ow_b = c25_theta_5; c25_aw_y = 2.0 * c25_ow_b; c25_uu_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_aw_y; c25_vu_x = c25_uu_x; c25_vu_x = muDoubleScalarSin(c25_vu_x); c25_le_a = c25_yv_y; c25_pw_b = c25_vu_x; c25_bw_y = c25_le_a * c25_pw_b; c25_qw_b = c25_dq1; c25_cw_y = 0.00746055282875 * c25_qw_b; c25_rw_b = c25_theta_2; c25_dw_y = 2.0 * c25_rw_b; c25_sw_b = c25_theta_5; c25_ew_y = c25_sw_b; c25_wu_x = ((c25_dw_y + c25_theta_3) + c25_theta_4) - c25_ew_y; c25_xu_x = c25_wu_x; c25_xu_x = muDoubleScalarCos(c25_xu_x); c25_me_a = c25_cw_y; c25_tw_b = c25_xu_x; c25_fw_y = c25_me_a * c25_tw_b; c25_uw_b = c25_dq1; c25_gw_y = 0.701428260725 * c25_uw_b; c25_vw_b = c25_theta_2; c25_hw_y = 2.0 * c25_vw_b; c25_yu_x = c25_hw_y + c25_theta_3; c25_av_x = c25_yu_x; c25_av_x = muDoubleScalarSin(c25_av_x); c25_ne_a = c25_gw_y; c25_ww_b = c25_av_x; c25_iw_y = c25_ne_a * c25_ww_b; c25_xw_b = c25_dq1; c25_jw_y = 0.0583017396828 * c25_xw_b; c25_yw_b = c25_theta_2; c25_kw_y = 2.0 * c25_yw_b; c25_ax_b = c25_theta_3; c25_lw_y = 2.0 * c25_ax_b; c25_bv_x = (c25_kw_y + c25_lw_y) + c25_theta_4; c25_cv_x = c25_bv_x; c25_cv_x = muDoubleScalarCos(c25_cv_x); c25_oe_a = c25_jw_y; c25_bx_b = c25_cv_x; c25_mw_y = c25_oe_a * c25_bx_b; c25_cx_b = c25_dq1; c25_nw_y = 0.00161461788735 * c25_cx_b; c25_dx_b = c25_theta_2; c25_ow_y = 2.0 * c25_dx_b; c25_ex_b = c25_theta_3; c25_pw_y = 2.0 * c25_ex_b; c25_fx_b = c25_theta_4; c25_qw_y = 2.0 * c25_fx_b; c25_dv_x = ((c25_ow_y + c25_pw_y) + c25_qw_y) + c25_theta_5; c25_ev_x = c25_dv_x; c25_ev_x = muDoubleScalarSin(c25_ev_x); c25_pe_a = c25_nw_y; c25_gx_b = c25_ev_x; c25_rw_y = c25_pe_a * c25_gx_b; c25_hx_b = c25_dq1; c25_sw_y = 0.80286398713 * c25_hx_b; c25_ix_b = c25_theta_2; c25_tw_y = 2.0 * c25_ix_b; c25_fv_x = c25_tw_y; c25_gv_x = c25_fv_x; c25_gv_x = muDoubleScalarSin(c25_gv_x); c25_qe_a = c25_sw_y; c25_jx_b = c25_gv_x; c25_uw_y = c25_qe_a * c25_jx_b; c25_kx_b = c25_dq1; c25_vw_y = 0.00161461788735 * c25_kx_b; c25_lx_b = c25_theta_2; c25_ww_y = 2.0 * c25_lx_b; c25_mx_b = c25_theta_3; c25_xw_y = 2.0 * c25_mx_b; c25_nx_b = c25_theta_4; c25_yw_y = 2.0 * c25_nx_b; c25_ox_b = c25_theta_5; c25_ax_y = c25_ox_b; c25_hv_x = ((c25_ww_y + c25_xw_y) + c25_yw_y) - c25_ax_y; c25_iv_x = c25_hv_x; c25_iv_x = muDoubleScalarSin(c25_iv_x); c25_re_a = c25_vw_y; c25_px_b = c25_iv_x; c25_bx_y = c25_re_a * c25_px_b; c25_qx_b = c25_dq1; c25_cx_y = 0.00022540003362082084 * c25_qx_b; c25_rx_b = c25_theta_2; c25_dx_y = 2.0 * c25_rx_b; c25_sx_b = c25_theta_3; c25_ex_y = 2.0 * c25_sx_b; c25_tx_b = c25_theta_4; c25_fx_y = 2.0 * c25_tx_b; c25_ux_b = c25_theta_5; c25_gx_y = 2.0 * c25_ux_b; c25_jv_x = ((c25_dx_y + c25_ex_y) + c25_fx_y) - c25_gx_y; c25_kv_x = c25_jv_x; c25_kv_x = muDoubleScalarSin(c25_kv_x); c25_se_a = c25_cx_y; c25_vx_b = c25_kv_x; c25_hx_y = c25_se_a * c25_vx_b; c25_wx_b = c25_dq2; c25_ix_y = 0.0002987944852 * c25_wx_b; c25_lv_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_mv_x = c25_lv_x; c25_mv_x = muDoubleScalarSin(c25_mv_x); c25_te_a = c25_ix_y; c25_xx_b = c25_mv_x; c25_jx_y = c25_te_a * c25_xx_b; c25_yx_b = c25_dq3; c25_kx_y = 0.0002987944852 * c25_yx_b; c25_nv_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ov_x = c25_nv_x; c25_ov_x = muDoubleScalarSin(c25_ov_x); c25_ue_a = c25_kx_y; c25_ay_b = c25_ov_x; c25_lx_y = c25_ue_a * c25_ay_b; c25_by_b = c25_dq4; c25_mx_y = 0.0002987944852 * c25_by_b; c25_pv_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_qv_x = c25_pv_x; c25_qv_x = muDoubleScalarSin(c25_qv_x); c25_ve_a = c25_mx_y; c25_cy_b = c25_qv_x; c25_nx_y = c25_ve_a * c25_cy_b; c25_dy_b = c25_dq5; c25_ox_y = 0.0019134123725500001 * c25_dy_b; c25_rv_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_sv_x = c25_rv_x; c25_sv_x = muDoubleScalarSin(c25_sv_x); c25_we_a = c25_ox_y; c25_ey_b = c25_sv_x; c25_px_y = c25_we_a * c25_ey_b; c25_fy_b = c25_dq2; c25_qx_y = 0.1313181732429 * c25_fy_b; c25_tv_x = c25_theta_2 + c25_theta_3; c25_uv_x = c25_tv_x; c25_uv_x = muDoubleScalarCos(c25_uv_x); c25_xe_a = c25_qx_y; c25_gy_b = c25_uv_x; c25_rx_y = c25_xe_a * c25_gy_b; c25_hy_b = c25_dq3; c25_sx_y = 0.1313181732429 * c25_hy_b; c25_vv_x = c25_theta_2 + c25_theta_3; c25_wv_x = c25_vv_x; c25_wv_x = muDoubleScalarCos(c25_wv_x); c25_ye_a = c25_sx_y; c25_iy_b = c25_wv_x; c25_tx_y = c25_ye_a * c25_iy_b; c25_jy_b = c25_dq2; c25_ux_y = 0.00746055282875 * c25_jy_b; c25_xv_x = c25_theta_2 + c25_theta_5; c25_yv_x = c25_xv_x; c25_yv_x = muDoubleScalarCos(c25_yv_x); c25_af_a = c25_ux_y; c25_ky_b = c25_yv_x; c25_vx_y = c25_af_a * c25_ky_b; c25_ly_b = c25_dq1; c25_wx_y = 0.063140533 * c25_ly_b; c25_my_b = c25_theta_2; c25_xx_y = 2.0 * c25_my_b; c25_aw_x = (c25_xx_y + c25_theta_3) + c25_theta_4; c25_bw_x = c25_aw_x; c25_bw_x = muDoubleScalarCos(c25_bw_x); c25_bf_a = c25_wx_y; c25_ny_b = c25_bw_x; c25_yx_y = c25_bf_a * c25_ny_b; c25_oy_b = c25_dq2; c25_ay_y = 0.0035280302599 * c25_oy_b; c25_py_b = c25_theta_5; c25_by_y = c25_py_b; c25_cw_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_by_y; c25_dw_x = c25_cw_x; c25_dw_x = muDoubleScalarSin(c25_dw_x); c25_cf_a = c25_ay_y; c25_qy_b = c25_dw_x; c25_cy_y = c25_cf_a * c25_qy_b; c25_ry_b = c25_dq2; c25_dy_y = 0.00045080006724164168 * c25_ry_b; c25_sy_b = c25_theta_5; c25_ey_y = 2.0 * c25_sy_b; c25_ew_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_ey_y; c25_fw_x = c25_ew_x; c25_fw_x = muDoubleScalarSin(c25_fw_x); c25_df_a = c25_dy_y; c25_ty_b = c25_fw_x; c25_fy_y = c25_df_a * c25_ty_b; c25_uy_b = c25_dq3; c25_gy_y = 0.0035280302599 * c25_uy_b; c25_vy_b = c25_theta_5; c25_hy_y = c25_vy_b; c25_gw_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_hy_y; c25_hw_x = c25_gw_x; c25_hw_x = muDoubleScalarSin(c25_hw_x); c25_ef_a = c25_gy_y; c25_wy_b = c25_hw_x; c25_iy_y = c25_ef_a * c25_wy_b; c25_xy_b = c25_dq3; c25_jy_y = 0.00045080006724164168 * c25_xy_b; c25_yy_b = c25_theta_5; c25_ky_y = 2.0 * c25_yy_b; c25_iw_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_ky_y; c25_jw_x = c25_iw_x; c25_jw_x = muDoubleScalarSin(c25_jw_x); c25_ff_a = c25_jy_y; c25_aab_b = c25_jw_x; c25_ly_y = c25_ff_a * c25_aab_b; c25_bab_b = c25_dq4; c25_my_y = 0.0035280302599 * c25_bab_b; c25_cab_b = c25_theta_5; c25_ny_y = c25_cab_b; c25_kw_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_ny_y; c25_lw_x = c25_kw_x; c25_lw_x = muDoubleScalarSin(c25_lw_x); c25_gf_a = c25_my_y; c25_dab_b = c25_lw_x; c25_oy_y = c25_gf_a * c25_dab_b; c25_eab_b = c25_dq4; c25_py_y = 0.00045080006724164168 * c25_eab_b; c25_fab_b = c25_theta_5; c25_qy_y = 2.0 * c25_fab_b; c25_mw_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_qy_y; c25_nw_x = c25_mw_x; c25_nw_x = muDoubleScalarSin(c25_nw_x); c25_hf_a = c25_py_y; c25_gab_b = c25_nw_x; c25_ry_y = c25_hf_a * c25_gab_b; c25_hab_b = c25_dq5; c25_sy_y = 0.0019134123725500001 * c25_hab_b; c25_iab_b = c25_theta_5; c25_ty_y = c25_iab_b; c25_ow_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_ty_y; c25_pw_x = c25_ow_x; c25_pw_x = muDoubleScalarSin(c25_pw_x); c25_if_a = c25_sy_y; c25_jab_b = c25_pw_x; c25_uy_y = c25_if_a * c25_jab_b; c25_kab_b = c25_dq5; c25_vy_y = 0.00045080006724164168 * c25_kab_b; c25_lab_b = c25_theta_5; c25_wy_y = 2.0 * c25_lab_b; c25_qw_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_wy_y; c25_rw_x = c25_qw_x; c25_rw_x = muDoubleScalarSin(c25_rw_x); c25_jf_a = c25_vy_y; c25_mab_b = c25_rw_x; c25_xy_y = c25_jf_a * c25_mab_b; c25_nab_b = c25_dq2; c25_yy_y = 0.00746055282875 * c25_nab_b; c25_oab_b = c25_theta_5; c25_aab_y = c25_oab_b; c25_sw_x = c25_theta_2 - c25_aab_y; c25_tw_x = c25_sw_x; c25_tw_x = muDoubleScalarCos(c25_tw_x); c25_kf_a = c25_yy_y; c25_pab_b = c25_tw_x; c25_bab_y = c25_kf_a * c25_pab_b; c25_qab_b = c25_dq1; c25_cab_y = 0.0068888111684385 * c25_qab_b; c25_rab_b = c25_theta_2; c25_dab_y = 2.0 * c25_rab_b; c25_sab_b = c25_theta_3; c25_eab_y = 2.0 * c25_sab_b; c25_uw_x = ((c25_dab_y + c25_eab_y) + c25_theta_4) + c25_theta_5; c25_vw_x = c25_uw_x; c25_vw_x = muDoubleScalarCos(c25_vw_x); c25_lf_a = c25_cab_y; c25_tab_b = c25_vw_x; c25_fab_y = c25_lf_a * c25_tab_b; c25_uab_b = c25_dq2; c25_gab_y = 0.348513447 * c25_uab_b; c25_ww_x = c25_theta_2; c25_xw_x = c25_ww_x; c25_xw_x = muDoubleScalarCos(c25_xw_x); c25_mf_a = c25_gab_y; c25_vab_b = c25_xw_x; c25_hab_y = c25_mf_a * c25_vab_b; c25_wab_b = c25_dq1; c25_iab_y = 0.0068888111684385 * c25_wab_b; c25_xab_b = c25_theta_2; c25_jab_y = 2.0 * c25_xab_b; c25_yab_b = c25_theta_3; c25_kab_y = 2.0 * c25_yab_b; c25_abb_b = c25_theta_5; c25_lab_y = c25_abb_b; c25_yw_x = ((c25_jab_y + c25_kab_y) + c25_theta_4) - c25_lab_y; c25_ax_x = c25_yw_x; c25_ax_x = muDoubleScalarCos(c25_ax_x); c25_nf_a = c25_iab_y; c25_bbb_b = c25_ax_x; c25_mab_y = c25_nf_a * c25_bbb_b; c25_cbb_b = c25_dq1; c25_nab_y = 0.31297029415553834 * c25_cbb_b; c25_dbb_b = c25_theta_2; c25_oab_y = 2.0 * c25_dbb_b; c25_ebb_b = c25_theta_3; c25_pab_y = 2.0 * c25_ebb_b; c25_bx_x = c25_oab_y + c25_pab_y; c25_cx_x = c25_bx_x; c25_cx_x = muDoubleScalarSin(c25_cx_x); c25_of_a = c25_nab_y; c25_fbb_b = c25_cx_x; c25_qab_y = c25_of_a * c25_fbb_b; c25_gbb_b = c25_dq1; c25_rab_y = 0.0057439079350250248 * c25_gbb_b; c25_hbb_b = c25_theta_2; c25_sab_y = 2.0 * c25_hbb_b; c25_ibb_b = c25_theta_3; c25_tab_y = 2.0 * c25_ibb_b; c25_jbb_b = c25_theta_4; c25_uab_y = 2.0 * c25_jbb_b; c25_dx_x = (c25_sab_y + c25_tab_y) + c25_uab_y; c25_ex_x = c25_dx_x; c25_ex_x = muDoubleScalarSin(c25_ex_x); c25_pf_a = c25_rab_y; c25_kbb_b = c25_ex_x; c25_vab_y = c25_pf_a * c25_kbb_b; c25_lbb_b = c25_dq2; c25_wab_y = 0.0068888111684385 * c25_lbb_b; c25_fx_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_gx_x = c25_fx_x; c25_gx_x = muDoubleScalarCos(c25_gx_x); c25_qf_a = c25_wab_y; c25_mbb_b = c25_gx_x; c25_xab_y = c25_qf_a * c25_mbb_b; c25_nbb_b = c25_dq3; c25_yab_y = 0.0068888111684385 * c25_nbb_b; c25_hx_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_ix_x = c25_hx_x; c25_ix_x = muDoubleScalarCos(c25_ix_x); c25_rf_a = c25_yab_y; c25_obb_b = c25_ix_x; c25_abb_y = c25_rf_a * c25_obb_b; c25_pbb_b = c25_dq1; c25_bbb_y = 0.00022540003362082084 * c25_pbb_b; c25_qbb_b = c25_theta_2; c25_cbb_y = 2.0 * c25_qbb_b; c25_rbb_b = c25_theta_3; c25_dbb_y = 2.0 * c25_rbb_b; c25_sbb_b = c25_theta_4; c25_ebb_y = 2.0 * c25_sbb_b; c25_tbb_b = c25_theta_5; c25_fbb_y = 2.0 * c25_tbb_b; c25_jx_x = ((c25_cbb_y + c25_dbb_y) + c25_ebb_y) + c25_fbb_y; c25_kx_x = c25_jx_x; c25_kx_x = muDoubleScalarSin(c25_kx_x); c25_sf_a = c25_bbb_y; c25_ubb_b = c25_kx_x; c25_gbb_y = c25_sf_a * c25_ubb_b; c25_vbb_b = c25_dq2; c25_hbb_y = 0.016157836412 * c25_vbb_b; c25_lx_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_mx_x = c25_lx_x; c25_mx_x = muDoubleScalarSin(c25_mx_x); c25_tf_a = c25_hbb_y; c25_wbb_b = c25_mx_x; c25_ibb_y = c25_tf_a * c25_wbb_b; c25_xbb_b = c25_dq3; c25_jbb_y = 0.016157836412 * c25_xbb_b; c25_nx_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_ox_x = c25_nx_x; c25_ox_x = muDoubleScalarSin(c25_ox_x); c25_uf_a = c25_jbb_y; c25_ybb_b = c25_ox_x; c25_kbb_y = c25_uf_a * c25_ybb_b; c25_acb_b = c25_dq4; c25_lbb_y = 0.016157836412 * c25_acb_b; c25_px_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_qx_x = c25_px_x; c25_qx_x = muDoubleScalarSin(c25_qx_x); c25_vf_a = c25_lbb_y; c25_bcb_b = c25_qx_x; c25_mbb_y = c25_vf_a * c25_bcb_b; c25_ccb_b = c25_dq5; c25_nbb_y = 0.0014202397504832836 * c25_ccb_b; c25_rx_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_sx_x = c25_rx_x; c25_sx_x = muDoubleScalarSin(c25_sx_x); c25_wf_a = c25_nbb_y; c25_dcb_b = c25_sx_x; c25_obb_y = c25_wf_a * c25_dcb_b; c25_ecb_b = c25_dq1; c25_pbb_y = 0.00746055282875 * c25_ecb_b; c25_fcb_b = c25_theta_2; c25_qbb_y = 2.0 * c25_fcb_b; c25_tx_x = ((c25_qbb_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ux_x = c25_tx_x; c25_ux_x = muDoubleScalarCos(c25_ux_x); c25_xf_a = c25_pbb_y; c25_gcb_b = c25_ux_x; c25_rbb_y = c25_xf_a * c25_gcb_b; c25_hcb_b = c25_dq6; c25_sbb_y = 6.9267456E-5 * c25_hcb_b; c25_vx_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_wx_x = c25_vx_x; c25_wx_x = muDoubleScalarCos(c25_wx_x); c25_yf_a = c25_sbb_y; c25_icb_b = c25_wx_x; c25_tbb_y = c25_yf_a * c25_icb_b; c25_xx_x = c25_theta_5; c25_yx_x = c25_xx_x; c25_yx_x = muDoubleScalarSin(c25_yx_x); c25_ag_a = c25_tbb_y; c25_jcb_b = c25_yx_x; c25_ubb_y = c25_ag_a * c25_jcb_b; c25_c12 = ((((((((((((((((((((((((((((((((((((((((((c25_lv_y + c25_ov_y) + c25_rv_y) + c25_uv_y) + c25_xv_y) + c25_bw_y) - c25_fw_y) - c25_iw_y) - c25_mw_y) - c25_rw_y) - c25_uw_y) + c25_bx_y) + c25_hx_y) + c25_jx_y) + c25_lx_y) + c25_nx_y) + c25_px_y) + c25_rx_y) + c25_tx_y) + c25_vx_y) - c25_yx_y) - c25_cy_y) - c25_fy_y) - c25_iy_y) - c25_ly_y) - c25_oy_y) - c25_ry_y) + c25_uy_y) + c25_xy_y) + c25_bab_y) + c25_fab_y) + c25_hab_y) - c25_mab_y) - c25_qab_y) + c25_vab_y) + c25_xab_y) + c25_abb_y) + c25_gbb_y) - c25_ibb_y) - c25_kbb_y) - c25_mbb_y) + c25_obb_y) + c25_rbb_y) - c25_ubb_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 64); c25_kcb_b = c25_dq2; c25_vbb_y = 0.0068888111684385 * c25_kcb_b; c25_lcb_b = c25_theta_5; c25_wbb_y = c25_lcb_b; c25_ay_x = (c25_theta_2 + c25_theta_3) - c25_wbb_y; c25_by_x = c25_ay_x; c25_by_x = muDoubleScalarCos(c25_by_x); c25_bg_a = c25_vbb_y; c25_mcb_b = c25_by_x; c25_xbb_y = c25_bg_a * c25_mcb_b; c25_ncb_b = c25_dq1; c25_ybb_y = 0.003730276414375 * c25_ncb_b; c25_ocb_b = c25_theta_5; c25_acb_y = c25_ocb_b; c25_cy_x = (c25_theta_3 + c25_theta_4) - c25_acb_y; c25_dy_x = c25_cy_x; c25_dy_x = muDoubleScalarCos(c25_dy_x); c25_cg_a = c25_ybb_y; c25_pcb_b = c25_dy_x; c25_bcb_y = c25_cg_a * c25_pcb_b; c25_qcb_b = c25_dq3; c25_ccb_y = 0.0068888111684385 * c25_qcb_b; c25_rcb_b = c25_theta_5; c25_dcb_y = c25_rcb_b; c25_ey_x = (c25_theta_2 + c25_theta_3) - c25_dcb_y; c25_fy_x = c25_ey_x; c25_fy_x = muDoubleScalarCos(c25_fy_x); c25_dg_a = c25_ccb_y; c25_scb_b = c25_fy_x; c25_ecb_y = c25_dg_a * c25_scb_b; c25_tcb_b = c25_dq2; c25_fcb_y = 0.00045080006724164168 * c25_tcb_b; c25_ucb_b = c25_theta_5; c25_gcb_y = 2.0 * c25_ucb_b; c25_gy_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_gcb_y; c25_hy_x = c25_gy_x; c25_hy_x = muDoubleScalarSin(c25_hy_x); c25_eg_a = c25_fcb_y; c25_vcb_b = c25_hy_x; c25_hcb_y = c25_eg_a * c25_vcb_b; c25_wcb_b = c25_dq3; c25_icb_y = 0.00045080006724164168 * c25_wcb_b; c25_xcb_b = c25_theta_5; c25_jcb_y = 2.0 * c25_xcb_b; c25_iy_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_jcb_y; c25_jy_x = c25_iy_x; c25_jy_x = muDoubleScalarSin(c25_jy_x); c25_fg_a = c25_icb_y; c25_ycb_b = c25_jy_x; c25_kcb_y = c25_fg_a * c25_ycb_b; c25_adb_b = c25_dq4; c25_lcb_y = 0.00045080006724164168 * c25_adb_b; c25_bdb_b = c25_theta_5; c25_mcb_y = 2.0 * c25_bdb_b; c25_ky_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_mcb_y; c25_ly_x = c25_ky_x; c25_ly_x = muDoubleScalarSin(c25_ly_x); c25_gg_a = c25_lcb_y; c25_cdb_b = c25_ly_x; c25_ncb_y = c25_gg_a * c25_cdb_b; c25_ddb_b = c25_dq5; c25_ocb_y = 0.00045080006724164168 * c25_ddb_b; c25_edb_b = c25_theta_5; c25_pcb_y = 2.0 * c25_edb_b; c25_my_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_pcb_y; c25_ny_x = c25_my_x; c25_ny_x = muDoubleScalarSin(c25_ny_x); c25_hg_a = c25_ocb_y; c25_fdb_b = c25_ny_x; c25_qcb_y = c25_hg_a * c25_fdb_b; c25_gdb_b = c25_dq1; c25_rcb_y = 0.003730276414375 * c25_gdb_b; c25_hdb_b = c25_theta_2; c25_scb_y = 2.0 * c25_hdb_b; c25_idb_b = c25_theta_5; c25_tcb_y = c25_idb_b; c25_oy_x = ((c25_scb_y + c25_theta_3) + c25_theta_4) - c25_tcb_y; c25_py_x = c25_oy_x; c25_py_x = muDoubleScalarCos(c25_py_x); c25_ig_a = c25_rcb_y; c25_jdb_b = c25_py_x; c25_ucb_y = c25_ig_a * c25_jdb_b; c25_kdb_b = c25_dq1; c25_vcb_y = 0.3507141303625 * c25_kdb_b; c25_ldb_b = c25_theta_2; c25_wcb_y = 2.0 * c25_ldb_b; c25_qy_x = c25_wcb_y + c25_theta_3; c25_ry_x = c25_qy_x; c25_ry_x = muDoubleScalarSin(c25_ry_x); c25_jg_a = c25_vcb_y; c25_mdb_b = c25_ry_x; c25_xcb_y = c25_jg_a * c25_mdb_b; c25_ndb_b = c25_dq1; c25_ycb_y = 0.0583017396828 * c25_ndb_b; c25_odb_b = c25_theta_2; c25_adb_y = 2.0 * c25_odb_b; c25_pdb_b = c25_theta_3; c25_bdb_y = 2.0 * c25_pdb_b; c25_sy_x = (c25_adb_y + c25_bdb_y) + c25_theta_4; c25_ty_x = c25_sy_x; c25_ty_x = muDoubleScalarCos(c25_ty_x); c25_kg_a = c25_ycb_y; c25_qdb_b = c25_ty_x; c25_cdb_y = c25_kg_a * c25_qdb_b; c25_rdb_b = c25_dq1; c25_ddb_y = 0.00161461788735 * c25_rdb_b; c25_sdb_b = c25_theta_2; c25_edb_y = 2.0 * c25_sdb_b; c25_tdb_b = c25_theta_3; c25_fdb_y = 2.0 * c25_tdb_b; c25_udb_b = c25_theta_4; c25_gdb_y = 2.0 * c25_udb_b; c25_uy_x = ((c25_edb_y + c25_fdb_y) + c25_gdb_y) + c25_theta_5; c25_vy_x = c25_uy_x; c25_vy_x = muDoubleScalarSin(c25_vy_x); c25_lg_a = c25_ddb_y; c25_vdb_b = c25_vy_x; c25_hdb_y = c25_lg_a * c25_vdb_b; c25_wdb_b = c25_dq1; c25_idb_y = 0.00161461788735 * c25_wdb_b; c25_xdb_b = c25_theta_2; c25_jdb_y = 2.0 * c25_xdb_b; c25_ydb_b = c25_theta_3; c25_kdb_y = 2.0 * c25_ydb_b; c25_aeb_b = c25_theta_4; c25_ldb_y = 2.0 * c25_aeb_b; c25_beb_b = c25_theta_5; c25_mdb_y = c25_beb_b; c25_wy_x = ((c25_jdb_y + c25_kdb_y) + c25_ldb_y) - c25_mdb_y; c25_xy_x = c25_wy_x; c25_xy_x = muDoubleScalarSin(c25_xy_x); c25_mg_a = c25_idb_y; c25_ceb_b = c25_xy_x; c25_ndb_y = c25_mg_a * c25_ceb_b; c25_deb_b = c25_dq1; c25_odb_y = 0.00022540003362082084 * c25_deb_b; c25_eeb_b = c25_theta_2; c25_pdb_y = 2.0 * c25_eeb_b; c25_feb_b = c25_theta_3; c25_qdb_y = 2.0 * c25_feb_b; c25_geb_b = c25_theta_4; c25_rdb_y = 2.0 * c25_geb_b; c25_heb_b = c25_theta_5; c25_sdb_y = 2.0 * c25_heb_b; c25_yy_x = ((c25_pdb_y + c25_qdb_y) + c25_rdb_y) - c25_sdb_y; c25_aab_x = c25_yy_x; c25_aab_x = muDoubleScalarSin(c25_aab_x); c25_ng_a = c25_odb_y; c25_ieb_b = c25_aab_x; c25_tdb_y = c25_ng_a * c25_ieb_b; c25_jeb_b = c25_dq2; c25_udb_y = 0.0002987944852 * c25_jeb_b; c25_bab_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_cab_x = c25_bab_x; c25_cab_x = muDoubleScalarSin(c25_cab_x); c25_og_a = c25_udb_y; c25_keb_b = c25_cab_x; c25_vdb_y = c25_og_a * c25_keb_b; c25_leb_b = c25_dq3; c25_wdb_y = 0.0002987944852 * c25_leb_b; c25_dab_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_eab_x = c25_dab_x; c25_eab_x = muDoubleScalarSin(c25_eab_x); c25_pg_a = c25_wdb_y; c25_meb_b = c25_eab_x; c25_xdb_y = c25_pg_a * c25_meb_b; c25_neb_b = c25_dq4; c25_ydb_y = 0.0002987944852 * c25_neb_b; c25_fab_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_gab_x = c25_fab_x; c25_gab_x = muDoubleScalarSin(c25_gab_x); c25_qg_a = c25_ydb_y; c25_oeb_b = c25_gab_x; c25_aeb_y = c25_qg_a * c25_oeb_b; c25_peb_b = c25_dq5; c25_beb_y = 0.0019134123725500001 * c25_peb_b; c25_hab_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_iab_x = c25_hab_x; c25_iab_x = muDoubleScalarSin(c25_iab_x); c25_rg_a = c25_beb_y; c25_qeb_b = c25_iab_x; c25_ceb_y = c25_rg_a * c25_qeb_b; c25_reb_b = c25_dq2; c25_deb_y = 0.1313181732429 * c25_reb_b; c25_jab_x = c25_theta_2 + c25_theta_3; c25_kab_x = c25_jab_x; c25_kab_x = muDoubleScalarCos(c25_kab_x); c25_sg_a = c25_deb_y; c25_seb_b = c25_kab_x; c25_eeb_y = c25_sg_a * c25_seb_b; c25_teb_b = c25_dq1; c25_feb_y = 0.0315702665 * c25_teb_b; c25_lab_x = c25_theta_3 + c25_theta_4; c25_mab_x = c25_lab_x; c25_mab_x = muDoubleScalarCos(c25_mab_x); c25_tg_a = c25_feb_y; c25_ueb_b = c25_mab_x; c25_geb_y = c25_tg_a * c25_ueb_b; c25_veb_b = c25_dq3; c25_heb_y = 0.1313181732429 * c25_veb_b; c25_nab_x = c25_theta_2 + c25_theta_3; c25_oab_x = c25_nab_x; c25_oab_x = muDoubleScalarCos(c25_oab_x); c25_ug_a = c25_heb_y; c25_web_b = c25_oab_x; c25_ieb_y = c25_ug_a * c25_web_b; c25_xeb_b = c25_dq1; c25_jeb_y = 0.0315702665 * c25_xeb_b; c25_yeb_b = c25_theta_2; c25_keb_y = 2.0 * c25_yeb_b; c25_pab_x = (c25_keb_y + c25_theta_3) + c25_theta_4; c25_qab_x = c25_pab_x; c25_qab_x = muDoubleScalarCos(c25_qab_x); c25_vg_a = c25_jeb_y; c25_afb_b = c25_qab_x; c25_leb_y = c25_vg_a * c25_afb_b; c25_bfb_b = c25_dq2; c25_meb_y = 0.0035280302599 * c25_bfb_b; c25_cfb_b = c25_theta_5; c25_neb_y = c25_cfb_b; c25_rab_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_neb_y; c25_sab_x = c25_rab_x; c25_sab_x = muDoubleScalarSin(c25_sab_x); c25_wg_a = c25_meb_y; c25_dfb_b = c25_sab_x; c25_oeb_y = c25_wg_a * c25_dfb_b; c25_efb_b = c25_dq2; c25_peb_y = 0.00045080006724164168 * c25_efb_b; c25_ffb_b = c25_theta_5; c25_qeb_y = 2.0 * c25_ffb_b; c25_tab_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_qeb_y; c25_uab_x = c25_tab_x; c25_uab_x = muDoubleScalarSin(c25_uab_x); c25_xg_a = c25_peb_y; c25_gfb_b = c25_uab_x; c25_reb_y = c25_xg_a * c25_gfb_b; c25_hfb_b = c25_dq3; c25_seb_y = 0.0035280302599 * c25_hfb_b; c25_ifb_b = c25_theta_5; c25_teb_y = c25_ifb_b; c25_vab_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_teb_y; c25_wab_x = c25_vab_x; c25_wab_x = muDoubleScalarSin(c25_wab_x); c25_yg_a = c25_seb_y; c25_jfb_b = c25_wab_x; c25_ueb_y = c25_yg_a * c25_jfb_b; c25_kfb_b = c25_dq3; c25_veb_y = 0.00045080006724164168 * c25_kfb_b; c25_lfb_b = c25_theta_5; c25_web_y = 2.0 * c25_lfb_b; c25_xab_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_web_y; c25_yab_x = c25_xab_x; c25_yab_x = muDoubleScalarSin(c25_yab_x); c25_ah_a = c25_veb_y; c25_mfb_b = c25_yab_x; c25_xeb_y = c25_ah_a * c25_mfb_b; c25_nfb_b = c25_dq4; c25_yeb_y = 0.0035280302599 * c25_nfb_b; c25_ofb_b = c25_theta_5; c25_afb_y = c25_ofb_b; c25_abb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_afb_y; c25_bbb_x = c25_abb_x; c25_bbb_x = muDoubleScalarSin(c25_bbb_x); c25_bh_a = c25_yeb_y; c25_pfb_b = c25_bbb_x; c25_bfb_y = c25_bh_a * c25_pfb_b; c25_qfb_b = c25_dq4; c25_cfb_y = 0.00045080006724164168 * c25_qfb_b; c25_rfb_b = c25_theta_5; c25_dfb_y = 2.0 * c25_rfb_b; c25_cbb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_dfb_y; c25_dbb_x = c25_cbb_x; c25_dbb_x = muDoubleScalarSin(c25_dbb_x); c25_ch_a = c25_cfb_y; c25_sfb_b = c25_dbb_x; c25_efb_y = c25_ch_a * c25_sfb_b; c25_tfb_b = c25_dq5; c25_ffb_y = 0.0019134123725500001 * c25_tfb_b; c25_ufb_b = c25_theta_5; c25_gfb_y = c25_ufb_b; c25_ebb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_gfb_y; c25_fbb_x = c25_ebb_x; c25_fbb_x = muDoubleScalarSin(c25_fbb_x); c25_dh_a = c25_ffb_y; c25_vfb_b = c25_fbb_x; c25_hfb_y = c25_dh_a * c25_vfb_b; c25_wfb_b = c25_dq5; c25_ifb_y = 0.00045080006724164168 * c25_wfb_b; c25_xfb_b = c25_theta_5; c25_jfb_y = 2.0 * c25_xfb_b; c25_gbb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_jfb_y; c25_hbb_x = c25_gbb_x; c25_hbb_x = muDoubleScalarSin(c25_hbb_x); c25_eh_a = c25_ifb_y; c25_yfb_b = c25_hbb_x; c25_kfb_y = c25_eh_a * c25_yfb_b; c25_agb_b = c25_dq1; c25_lfb_y = 0.0068888111684385 * c25_agb_b; c25_bgb_b = c25_theta_2; c25_mfb_y = 2.0 * c25_bgb_b; c25_cgb_b = c25_theta_3; c25_nfb_y = 2.0 * c25_cgb_b; c25_ibb_x = ((c25_mfb_y + c25_nfb_y) + c25_theta_4) + c25_theta_5; c25_jbb_x = c25_ibb_x; c25_jbb_x = muDoubleScalarCos(c25_jbb_x); c25_fh_a = c25_lfb_y; c25_dgb_b = c25_jbb_x; c25_ofb_y = c25_fh_a * c25_dgb_b; c25_egb_b = c25_dq1; c25_pfb_y = 0.3507141303625 * c25_egb_b; c25_kbb_x = c25_theta_3; c25_lbb_x = c25_kbb_x; c25_lbb_x = muDoubleScalarSin(c25_lbb_x); c25_gh_a = c25_pfb_y; c25_fgb_b = c25_lbb_x; c25_qfb_y = c25_gh_a * c25_fgb_b; c25_ggb_b = c25_dq1; c25_rfb_y = 0.0068888111684385 * c25_ggb_b; c25_hgb_b = c25_theta_2; c25_sfb_y = 2.0 * c25_hgb_b; c25_igb_b = c25_theta_3; c25_tfb_y = 2.0 * c25_igb_b; c25_jgb_b = c25_theta_5; c25_ufb_y = c25_jgb_b; c25_mbb_x = ((c25_sfb_y + c25_tfb_y) + c25_theta_4) - c25_ufb_y; c25_nbb_x = c25_mbb_x; c25_nbb_x = muDoubleScalarCos(c25_nbb_x); c25_hh_a = c25_rfb_y; c25_kgb_b = c25_nbb_x; c25_vfb_y = c25_hh_a * c25_kgb_b; c25_lgb_b = c25_dq1; c25_wfb_y = 0.31297029415553834 * c25_lgb_b; c25_mgb_b = c25_theta_2; c25_xfb_y = 2.0 * c25_mgb_b; c25_ngb_b = c25_theta_3; c25_yfb_y = 2.0 * c25_ngb_b; c25_obb_x = c25_xfb_y + c25_yfb_y; c25_pbb_x = c25_obb_x; c25_pbb_x = muDoubleScalarSin(c25_pbb_x); c25_ih_a = c25_wfb_y; c25_ogb_b = c25_pbb_x; c25_agb_y = c25_ih_a * c25_ogb_b; c25_pgb_b = c25_dq1; c25_bgb_y = 0.0057439079350250248 * c25_pgb_b; c25_qgb_b = c25_theta_2; c25_cgb_y = 2.0 * c25_qgb_b; c25_rgb_b = c25_theta_3; c25_dgb_y = 2.0 * c25_rgb_b; c25_sgb_b = c25_theta_4; c25_egb_y = 2.0 * c25_sgb_b; c25_qbb_x = (c25_cgb_y + c25_dgb_y) + c25_egb_y; c25_rbb_x = c25_qbb_x; c25_rbb_x = muDoubleScalarSin(c25_rbb_x); c25_jh_a = c25_bgb_y; c25_tgb_b = c25_rbb_x; c25_fgb_y = c25_jh_a * c25_tgb_b; c25_ugb_b = c25_dq2; c25_ggb_y = 0.0068888111684385 * c25_ugb_b; c25_sbb_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_tbb_x = c25_sbb_x; c25_tbb_x = muDoubleScalarCos(c25_tbb_x); c25_kh_a = c25_ggb_y; c25_vgb_b = c25_tbb_x; c25_hgb_y = c25_kh_a * c25_vgb_b; c25_wgb_b = c25_dq1; c25_igb_y = 0.003730276414375 * c25_wgb_b; c25_ubb_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_vbb_x = c25_ubb_x; c25_vbb_x = muDoubleScalarCos(c25_vbb_x); c25_lh_a = c25_igb_y; c25_xgb_b = c25_vbb_x; c25_jgb_y = c25_lh_a * c25_xgb_b; c25_ygb_b = c25_dq3; c25_kgb_y = 0.0068888111684385 * c25_ygb_b; c25_wbb_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_xbb_x = c25_wbb_x; c25_xbb_x = muDoubleScalarCos(c25_xbb_x); c25_mh_a = c25_kgb_y; c25_ahb_b = c25_xbb_x; c25_lgb_y = c25_mh_a * c25_ahb_b; c25_bhb_b = c25_dq1; c25_mgb_y = 0.00022540003362082084 * c25_bhb_b; c25_chb_b = c25_theta_2; c25_ngb_y = 2.0 * c25_chb_b; c25_dhb_b = c25_theta_3; c25_ogb_y = 2.0 * c25_dhb_b; c25_ehb_b = c25_theta_4; c25_pgb_y = 2.0 * c25_ehb_b; c25_fhb_b = c25_theta_5; c25_qgb_y = 2.0 * c25_fhb_b; c25_ybb_x = ((c25_ngb_y + c25_ogb_y) + c25_pgb_y) + c25_qgb_y; c25_acb_x = c25_ybb_x; c25_acb_x = muDoubleScalarSin(c25_acb_x); c25_nh_a = c25_mgb_y; c25_ghb_b = c25_acb_x; c25_rgb_y = c25_nh_a * c25_ghb_b; c25_hhb_b = c25_dq2; c25_sgb_y = 0.016157836412 * c25_hhb_b; c25_bcb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_ccb_x = c25_bcb_x; c25_ccb_x = muDoubleScalarSin(c25_ccb_x); c25_oh_a = c25_sgb_y; c25_ihb_b = c25_ccb_x; c25_tgb_y = c25_oh_a * c25_ihb_b; c25_jhb_b = c25_dq3; c25_ugb_y = 0.016157836412 * c25_jhb_b; c25_dcb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_ecb_x = c25_dcb_x; c25_ecb_x = muDoubleScalarSin(c25_ecb_x); c25_ph_a = c25_ugb_y; c25_khb_b = c25_ecb_x; c25_vgb_y = c25_ph_a * c25_khb_b; c25_lhb_b = c25_dq4; c25_wgb_y = 0.016157836412 * c25_lhb_b; c25_fcb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_gcb_x = c25_fcb_x; c25_gcb_x = muDoubleScalarSin(c25_gcb_x); c25_qh_a = c25_wgb_y; c25_mhb_b = c25_gcb_x; c25_xgb_y = c25_qh_a * c25_mhb_b; c25_nhb_b = c25_dq5; c25_ygb_y = 0.0014202397504832836 * c25_nhb_b; c25_hcb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_icb_x = c25_hcb_x; c25_icb_x = muDoubleScalarSin(c25_icb_x); c25_rh_a = c25_ygb_y; c25_ohb_b = c25_icb_x; c25_ahb_y = c25_rh_a * c25_ohb_b; c25_phb_b = c25_dq1; c25_bhb_y = 0.003730276414375 * c25_phb_b; c25_qhb_b = c25_theta_2; c25_chb_y = 2.0 * c25_qhb_b; c25_jcb_x = ((c25_chb_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_kcb_x = c25_jcb_x; c25_kcb_x = muDoubleScalarCos(c25_kcb_x); c25_sh_a = c25_bhb_y; c25_rhb_b = c25_kcb_x; c25_dhb_y = c25_sh_a * c25_rhb_b; c25_shb_b = c25_dq6; c25_ehb_y = 6.9267456E-5 * c25_shb_b; c25_lcb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_mcb_x = c25_lcb_x; c25_mcb_x = muDoubleScalarCos(c25_mcb_x); c25_th_a = c25_ehb_y; c25_thb_b = c25_mcb_x; c25_fhb_y = c25_th_a * c25_thb_b; c25_ncb_x = c25_theta_5; c25_ocb_x = c25_ncb_x; c25_ocb_x = muDoubleScalarSin(c25_ocb_x); c25_uh_a = c25_fhb_y; c25_uhb_b = c25_ocb_x; c25_ghb_y = c25_uh_a * c25_uhb_b; c25_c13 = ((((((((((((((((((((((((((((((((((((((((((c25_xbb_y - c25_bcb_y) + c25_ecb_y) + c25_hcb_y) + c25_kcb_y) + c25_ncb_y) + c25_qcb_y) - c25_ucb_y) - c25_xcb_y) - c25_cdb_y) - c25_hdb_y) + c25_ndb_y) + c25_tdb_y) + c25_vdb_y) + c25_xdb_y) + c25_aeb_y) + c25_ceb_y) + c25_eeb_y) - c25_geb_y) + c25_ieb_y) - c25_leb_y) - c25_oeb_y) - c25_reb_y) - c25_ueb_y) - c25_xeb_y) - c25_bfb_y) - c25_efb_y) + c25_hfb_y) + c25_kfb_y) + c25_ofb_y) - c25_qfb_y) - c25_vfb_y) - c25_agb_y) + c25_fgb_y) + c25_hgb_y) + c25_jgb_y) + c25_lgb_y) + c25_rgb_y) - c25_tgb_y) - c25_vgb_y) - c25_xgb_y) + c25_ahb_y) + c25_dhb_y) - c25_ghb_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 65); c25_vhb_b = c25_dq2; c25_hhb_y = 0.00045080006724164168 * c25_vhb_b; c25_whb_b = c25_theta_5; c25_ihb_y = 2.0 * c25_whb_b; c25_pcb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_ihb_y; c25_qcb_x = c25_pcb_x; c25_qcb_x = muDoubleScalarSin(c25_qcb_x); c25_vh_a = c25_hhb_y; c25_xhb_b = c25_qcb_x; c25_jhb_y = c25_vh_a * c25_xhb_b; c25_yhb_b = c25_dq1; c25_khb_y = 0.003730276414375 * c25_yhb_b; c25_aib_b = c25_theta_5; c25_lhb_y = c25_aib_b; c25_rcb_x = (c25_theta_3 + c25_theta_4) - c25_lhb_y; c25_scb_x = c25_rcb_x; c25_scb_x = muDoubleScalarCos(c25_scb_x); c25_wh_a = c25_khb_y; c25_bib_b = c25_scb_x; c25_mhb_y = c25_wh_a * c25_bib_b; c25_cib_b = c25_dq3; c25_nhb_y = 0.00045080006724164168 * c25_cib_b; c25_dib_b = c25_theta_5; c25_ohb_y = 2.0 * c25_dib_b; c25_tcb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_ohb_y; c25_ucb_x = c25_tcb_x; c25_ucb_x = muDoubleScalarSin(c25_ucb_x); c25_xh_a = c25_nhb_y; c25_eib_b = c25_ucb_x; c25_phb_y = c25_xh_a * c25_eib_b; c25_fib_b = c25_dq4; c25_qhb_y = 0.00045080006724164168 * c25_fib_b; c25_gib_b = c25_theta_5; c25_rhb_y = 2.0 * c25_gib_b; c25_vcb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_rhb_y; c25_wcb_x = c25_vcb_x; c25_wcb_x = muDoubleScalarSin(c25_wcb_x); c25_yh_a = c25_qhb_y; c25_hib_b = c25_wcb_x; c25_shb_y = c25_yh_a * c25_hib_b; c25_iib_b = c25_dq5; c25_thb_y = 0.00045080006724164168 * c25_iib_b; c25_jib_b = c25_theta_5; c25_uhb_y = 2.0 * c25_jib_b; c25_xcb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_uhb_y; c25_ycb_x = c25_xcb_x; c25_ycb_x = muDoubleScalarSin(c25_ycb_x); c25_ai_a = c25_thb_y; c25_kib_b = c25_ycb_x; c25_vhb_y = c25_ai_a * c25_kib_b; c25_lib_b = c25_dq1; c25_whb_y = 0.003730276414375 * c25_lib_b; c25_mib_b = c25_theta_2; c25_xhb_y = 2.0 * c25_mib_b; c25_nib_b = c25_theta_5; c25_yhb_y = c25_nib_b; c25_adb_x = ((c25_xhb_y + c25_theta_3) + c25_theta_4) - c25_yhb_y; c25_bdb_x = c25_adb_x; c25_bdb_x = muDoubleScalarCos(c25_bdb_x); c25_bi_a = c25_whb_y; c25_oib_b = c25_bdb_x; c25_aib_y = c25_bi_a * c25_oib_b; c25_pib_b = c25_dq1; c25_bib_y = 0.0291508698414 * c25_pib_b; c25_qib_b = c25_theta_2; c25_cib_y = 2.0 * c25_qib_b; c25_rib_b = c25_theta_3; c25_dib_y = 2.0 * c25_rib_b; c25_cdb_x = (c25_cib_y + c25_dib_y) + c25_theta_4; c25_ddb_x = c25_cdb_x; c25_ddb_x = muDoubleScalarCos(c25_ddb_x); c25_ci_a = c25_bib_y; c25_sib_b = c25_ddb_x; c25_eib_y = c25_ci_a * c25_sib_b; c25_tib_b = c25_dq1; c25_fib_y = 0.00161461788735 * c25_tib_b; c25_uib_b = c25_theta_2; c25_gib_y = 2.0 * c25_uib_b; c25_vib_b = c25_theta_3; c25_hib_y = 2.0 * c25_vib_b; c25_wib_b = c25_theta_4; c25_iib_y = 2.0 * c25_wib_b; c25_edb_x = ((c25_gib_y + c25_hib_y) + c25_iib_y) + c25_theta_5; c25_fdb_x = c25_edb_x; c25_fdb_x = muDoubleScalarSin(c25_fdb_x); c25_di_a = c25_fib_y; c25_xib_b = c25_fdb_x; c25_jib_y = c25_di_a * c25_xib_b; c25_yib_b = c25_dq1; c25_kib_y = 0.00161461788735 * c25_yib_b; c25_ajb_b = c25_theta_2; c25_lib_y = 2.0 * c25_ajb_b; c25_bjb_b = c25_theta_3; c25_mib_y = 2.0 * c25_bjb_b; c25_cjb_b = c25_theta_4; c25_nib_y = 2.0 * c25_cjb_b; c25_djb_b = c25_theta_5; c25_oib_y = c25_djb_b; c25_gdb_x = ((c25_lib_y + c25_mib_y) + c25_nib_y) - c25_oib_y; c25_hdb_x = c25_gdb_x; c25_hdb_x = muDoubleScalarSin(c25_hdb_x); c25_ei_a = c25_kib_y; c25_ejb_b = c25_hdb_x; c25_pib_y = c25_ei_a * c25_ejb_b; c25_fjb_b = c25_dq1; c25_qib_y = 0.00022540003362082084 * c25_fjb_b; c25_gjb_b = c25_theta_2; c25_rib_y = 2.0 * c25_gjb_b; c25_hjb_b = c25_theta_3; c25_sib_y = 2.0 * c25_hjb_b; c25_ijb_b = c25_theta_4; c25_tib_y = 2.0 * c25_ijb_b; c25_jjb_b = c25_theta_5; c25_uib_y = 2.0 * c25_jjb_b; c25_idb_x = ((c25_rib_y + c25_sib_y) + c25_tib_y) - c25_uib_y; c25_jdb_x = c25_idb_x; c25_jdb_x = muDoubleScalarSin(c25_jdb_x); c25_fi_a = c25_qib_y; c25_kjb_b = c25_jdb_x; c25_vib_y = c25_fi_a * c25_kjb_b; c25_ljb_b = c25_dq2; c25_wib_y = 0.0002987944852 * c25_ljb_b; c25_kdb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ldb_x = c25_kdb_x; c25_ldb_x = muDoubleScalarSin(c25_ldb_x); c25_gi_a = c25_wib_y; c25_mjb_b = c25_ldb_x; c25_xib_y = c25_gi_a * c25_mjb_b; c25_njb_b = c25_dq3; c25_yib_y = 0.0002987944852 * c25_njb_b; c25_mdb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ndb_x = c25_mdb_x; c25_ndb_x = muDoubleScalarSin(c25_ndb_x); c25_hi_a = c25_yib_y; c25_ojb_b = c25_ndb_x; c25_ajb_y = c25_hi_a * c25_ojb_b; c25_pjb_b = c25_dq4; c25_bjb_y = 0.0002987944852 * c25_pjb_b; c25_odb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_pdb_x = c25_odb_x; c25_pdb_x = muDoubleScalarSin(c25_pdb_x); c25_ii_a = c25_bjb_y; c25_qjb_b = c25_pdb_x; c25_cjb_y = c25_ii_a * c25_qjb_b; c25_rjb_b = c25_dq5; c25_djb_y = 0.0019134123725500001 * c25_rjb_b; c25_qdb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_rdb_x = c25_qdb_x; c25_rdb_x = muDoubleScalarSin(c25_rdb_x); c25_ji_a = c25_djb_y; c25_sjb_b = c25_rdb_x; c25_ejb_y = c25_ji_a * c25_sjb_b; c25_tjb_b = c25_dq1; c25_fjb_y = 0.0315702665 * c25_tjb_b; c25_sdb_x = c25_theta_3 + c25_theta_4; c25_tdb_x = c25_sdb_x; c25_tdb_x = muDoubleScalarCos(c25_tdb_x); c25_ki_a = c25_fjb_y; c25_ujb_b = c25_tdb_x; c25_gjb_y = c25_ki_a * c25_ujb_b; c25_vjb_b = c25_dq1; c25_hjb_y = 0.00344440558421925 * c25_vjb_b; c25_udb_x = c25_theta_4 + c25_theta_5; c25_vdb_x = c25_udb_x; c25_vdb_x = muDoubleScalarCos(c25_vdb_x); c25_li_a = c25_hjb_y; c25_wjb_b = c25_vdb_x; c25_ijb_y = c25_li_a * c25_wjb_b; c25_xjb_b = c25_dq1; c25_jjb_y = 0.0315702665 * c25_xjb_b; c25_yjb_b = c25_theta_2; c25_kjb_y = 2.0 * c25_yjb_b; c25_wdb_x = (c25_kjb_y + c25_theta_3) + c25_theta_4; c25_xdb_x = c25_wdb_x; c25_xdb_x = muDoubleScalarCos(c25_xdb_x); c25_mi_a = c25_jjb_y; c25_akb_b = c25_xdb_x; c25_ljb_y = c25_mi_a * c25_akb_b; c25_bkb_b = c25_dq2; c25_mjb_y = 0.0035280302599 * c25_bkb_b; c25_ckb_b = c25_theta_5; c25_njb_y = c25_ckb_b; c25_ydb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_njb_y; c25_aeb_x = c25_ydb_x; c25_aeb_x = muDoubleScalarSin(c25_aeb_x); c25_ni_a = c25_mjb_y; c25_dkb_b = c25_aeb_x; c25_ojb_y = c25_ni_a * c25_dkb_b; c25_ekb_b = c25_dq2; c25_pjb_y = 0.00045080006724164168 * c25_ekb_b; c25_fkb_b = c25_theta_5; c25_qjb_y = 2.0 * c25_fkb_b; c25_beb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_qjb_y; c25_ceb_x = c25_beb_x; c25_ceb_x = muDoubleScalarSin(c25_ceb_x); c25_oi_a = c25_pjb_y; c25_gkb_b = c25_ceb_x; c25_rjb_y = c25_oi_a * c25_gkb_b; c25_hkb_b = c25_dq3; c25_sjb_y = 0.0035280302599 * c25_hkb_b; c25_ikb_b = c25_theta_5; c25_tjb_y = c25_ikb_b; c25_deb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_tjb_y; c25_eeb_x = c25_deb_x; c25_eeb_x = muDoubleScalarSin(c25_eeb_x); c25_pi_a = c25_sjb_y; c25_jkb_b = c25_eeb_x; c25_ujb_y = c25_pi_a * c25_jkb_b; c25_kkb_b = c25_dq3; c25_vjb_y = 0.00045080006724164168 * c25_kkb_b; c25_lkb_b = c25_theta_5; c25_wjb_y = 2.0 * c25_lkb_b; c25_feb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_wjb_y; c25_geb_x = c25_feb_x; c25_geb_x = muDoubleScalarSin(c25_geb_x); c25_qi_a = c25_vjb_y; c25_mkb_b = c25_geb_x; c25_xjb_y = c25_qi_a * c25_mkb_b; c25_nkb_b = c25_dq4; c25_yjb_y = 0.0035280302599 * c25_nkb_b; c25_okb_b = c25_theta_5; c25_akb_y = c25_okb_b; c25_heb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_akb_y; c25_ieb_x = c25_heb_x; c25_ieb_x = muDoubleScalarSin(c25_ieb_x); c25_ri_a = c25_yjb_y; c25_pkb_b = c25_ieb_x; c25_bkb_y = c25_ri_a * c25_pkb_b; c25_qkb_b = c25_dq4; c25_ckb_y = 0.00045080006724164168 * c25_qkb_b; c25_rkb_b = c25_theta_5; c25_dkb_y = 2.0 * c25_rkb_b; c25_jeb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_dkb_y; c25_keb_x = c25_jeb_x; c25_keb_x = muDoubleScalarSin(c25_keb_x); c25_si_a = c25_ckb_y; c25_skb_b = c25_keb_x; c25_ekb_y = c25_si_a * c25_skb_b; c25_tkb_b = c25_dq5; c25_fkb_y = 0.0019134123725500001 * c25_tkb_b; c25_ukb_b = c25_theta_5; c25_gkb_y = c25_ukb_b; c25_leb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_gkb_y; c25_meb_x = c25_leb_x; c25_meb_x = muDoubleScalarSin(c25_meb_x); c25_ti_a = c25_fkb_y; c25_vkb_b = c25_meb_x; c25_hkb_y = c25_ti_a * c25_vkb_b; c25_wkb_b = c25_dq5; c25_ikb_y = 0.00045080006724164168 * c25_wkb_b; c25_xkb_b = c25_theta_5; c25_jkb_y = 2.0 * c25_xkb_b; c25_neb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_jkb_y; c25_oeb_x = c25_neb_x; c25_oeb_x = muDoubleScalarSin(c25_oeb_x); c25_ui_a = c25_ikb_y; c25_ykb_b = c25_oeb_x; c25_kkb_y = c25_ui_a * c25_ykb_b; c25_alb_b = c25_dq1; c25_lkb_y = 0.00344440558421925 * c25_alb_b; c25_blb_b = c25_theta_5; c25_mkb_y = c25_blb_b; c25_peb_x = c25_theta_4 - c25_mkb_y; c25_qeb_x = c25_peb_x; c25_qeb_x = muDoubleScalarCos(c25_qeb_x); c25_vi_a = c25_lkb_y; c25_clb_b = c25_qeb_x; c25_nkb_y = c25_vi_a * c25_clb_b; c25_dlb_b = c25_dq1; c25_okb_y = 0.00344440558421925 * c25_dlb_b; c25_elb_b = c25_theta_2; c25_pkb_y = 2.0 * c25_elb_b; c25_flb_b = c25_theta_3; c25_qkb_y = 2.0 * c25_flb_b; c25_reb_x = ((c25_pkb_y + c25_qkb_y) + c25_theta_4) + c25_theta_5; c25_seb_x = c25_reb_x; c25_seb_x = muDoubleScalarCos(c25_seb_x); c25_wi_a = c25_okb_y; c25_glb_b = c25_seb_x; c25_rkb_y = c25_wi_a * c25_glb_b; c25_hlb_b = c25_dq1; c25_skb_y = 0.0291508698414 * c25_hlb_b; c25_teb_x = c25_theta_4; c25_ueb_x = c25_teb_x; c25_ueb_x = muDoubleScalarCos(c25_ueb_x); c25_xi_a = c25_skb_y; c25_ilb_b = c25_ueb_x; c25_tkb_y = c25_xi_a * c25_ilb_b; c25_jlb_b = c25_dq1; c25_ukb_y = 0.00344440558421925 * c25_jlb_b; c25_klb_b = c25_theta_2; c25_vkb_y = 2.0 * c25_klb_b; c25_llb_b = c25_theta_3; c25_wkb_y = 2.0 * c25_llb_b; c25_mlb_b = c25_theta_5; c25_xkb_y = c25_mlb_b; c25_veb_x = ((c25_vkb_y + c25_wkb_y) + c25_theta_4) - c25_xkb_y; c25_web_x = c25_veb_x; c25_web_x = muDoubleScalarCos(c25_web_x); c25_yi_a = c25_ukb_y; c25_nlb_b = c25_web_x; c25_ykb_y = c25_yi_a * c25_nlb_b; c25_olb_b = c25_dq1; c25_alb_y = 0.0057439079350250248 * c25_olb_b; c25_plb_b = c25_theta_2; c25_blb_y = 2.0 * c25_plb_b; c25_qlb_b = c25_theta_3; c25_clb_y = 2.0 * c25_qlb_b; c25_rlb_b = c25_theta_4; c25_dlb_y = 2.0 * c25_rlb_b; c25_xeb_x = (c25_blb_y + c25_clb_y) + c25_dlb_y; c25_yeb_x = c25_xeb_x; c25_yeb_x = muDoubleScalarSin(c25_yeb_x); c25_aj_a = c25_alb_y; c25_slb_b = c25_yeb_x; c25_elb_y = c25_aj_a * c25_slb_b; c25_tlb_b = c25_dq1; c25_flb_y = 0.003730276414375 * c25_tlb_b; c25_afb_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_bfb_x = c25_afb_x; c25_bfb_x = muDoubleScalarCos(c25_bfb_x); c25_bj_a = c25_flb_y; c25_ulb_b = c25_bfb_x; c25_glb_y = c25_bj_a * c25_ulb_b; c25_vlb_b = c25_dq1; c25_hlb_y = 0.00022540003362082084 * c25_vlb_b; c25_wlb_b = c25_theta_2; c25_ilb_y = 2.0 * c25_wlb_b; c25_xlb_b = c25_theta_3; c25_jlb_y = 2.0 * c25_xlb_b; c25_ylb_b = c25_theta_4; c25_klb_y = 2.0 * c25_ylb_b; c25_amb_b = c25_theta_5; c25_llb_y = 2.0 * c25_amb_b; c25_cfb_x = ((c25_ilb_y + c25_jlb_y) + c25_klb_y) + c25_llb_y; c25_dfb_x = c25_cfb_x; c25_dfb_x = muDoubleScalarSin(c25_dfb_x); c25_cj_a = c25_hlb_y; c25_bmb_b = c25_dfb_x; c25_mlb_y = c25_cj_a * c25_bmb_b; c25_cmb_b = c25_dq2; c25_nlb_y = 0.016157836412 * c25_cmb_b; c25_efb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_ffb_x = c25_efb_x; c25_ffb_x = muDoubleScalarSin(c25_ffb_x); c25_dj_a = c25_nlb_y; c25_dmb_b = c25_ffb_x; c25_olb_y = c25_dj_a * c25_dmb_b; c25_emb_b = c25_dq3; c25_plb_y = 0.016157836412 * c25_emb_b; c25_gfb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_hfb_x = c25_gfb_x; c25_hfb_x = muDoubleScalarSin(c25_hfb_x); c25_ej_a = c25_plb_y; c25_fmb_b = c25_hfb_x; c25_qlb_y = c25_ej_a * c25_fmb_b; c25_gmb_b = c25_dq4; c25_rlb_y = 0.016157836412 * c25_gmb_b; c25_ifb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_jfb_x = c25_ifb_x; c25_jfb_x = muDoubleScalarSin(c25_jfb_x); c25_fj_a = c25_rlb_y; c25_hmb_b = c25_jfb_x; c25_slb_y = c25_fj_a * c25_hmb_b; c25_imb_b = c25_dq5; c25_tlb_y = 0.0014202397504832836 * c25_imb_b; c25_kfb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_lfb_x = c25_kfb_x; c25_lfb_x = muDoubleScalarSin(c25_lfb_x); c25_gj_a = c25_tlb_y; c25_jmb_b = c25_lfb_x; c25_ulb_y = c25_gj_a * c25_jmb_b; c25_kmb_b = c25_dq1; c25_vlb_y = 0.003730276414375 * c25_kmb_b; c25_lmb_b = c25_theta_2; c25_wlb_y = 2.0 * c25_lmb_b; c25_mfb_x = ((c25_wlb_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_nfb_x = c25_mfb_x; c25_nfb_x = muDoubleScalarCos(c25_nfb_x); c25_hj_a = c25_vlb_y; c25_mmb_b = c25_nfb_x; c25_xlb_y = c25_hj_a * c25_mmb_b; c25_nmb_b = c25_dq6; c25_ylb_y = 6.9267456E-5 * c25_nmb_b; c25_ofb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_pfb_x = c25_ofb_x; c25_pfb_x = muDoubleScalarCos(c25_pfb_x); c25_ij_a = c25_ylb_y; c25_omb_b = c25_pfb_x; c25_amb_y = c25_ij_a * c25_omb_b; c25_qfb_x = c25_theta_5; c25_rfb_x = c25_qfb_x; c25_rfb_x = muDoubleScalarSin(c25_rfb_x); c25_jj_a = c25_amb_y; c25_pmb_b = c25_rfb_x; c25_bmb_y = c25_jj_a * c25_pmb_b; c25_c14 = ((((((((((((((((((((((((((((((((((((c25_jhb_y - c25_mhb_y) + c25_phb_y) + c25_shb_y) + c25_vhb_y) - c25_aib_y) - c25_eib_y) - c25_jib_y) + c25_pib_y) + c25_vib_y) + c25_xib_y) + c25_ajb_y) + c25_cjb_y) + c25_ejb_y) - c25_gjb_y) + c25_ijb_y) - c25_ljb_y) - c25_ojb_y) - c25_rjb_y) - c25_ujb_y) - c25_xjb_y) - c25_bkb_y) - c25_ekb_y) + c25_hkb_y) + c25_kkb_y) - c25_nkb_y) + c25_rkb_y) - c25_tkb_y) - c25_ykb_y) + c25_elb_y) + c25_glb_y) + c25_mlb_y) - c25_olb_y) - c25_qlb_y) - c25_slb_y) + c25_ulb_y) + c25_xlb_y) - c25_bmb_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 66); c25_qmb_b = c25_dq1; c25_cmb_y = 0.003730276414375 * c25_qmb_b; c25_rmb_b = c25_theta_5; c25_dmb_y = c25_rmb_b; c25_sfb_x = (c25_theta_3 + c25_theta_4) - c25_dmb_y; c25_tfb_x = c25_sfb_x; c25_tfb_x = muDoubleScalarCos(c25_tfb_x); c25_kj_a = c25_cmb_y; c25_smb_b = c25_tfb_x; c25_emb_y = c25_kj_a * c25_smb_b; c25_tmb_b = c25_dq5; c25_fmb_y = 0.0068888111684385 * c25_tmb_b; c25_umb_b = c25_theta_5; c25_gmb_y = c25_umb_b; c25_ufb_x = (c25_theta_2 + c25_theta_3) - c25_gmb_y; c25_vfb_x = c25_ufb_x; c25_vfb_x = muDoubleScalarCos(c25_vfb_x); c25_lj_a = c25_fmb_y; c25_vmb_b = c25_vfb_x; c25_hmb_y = c25_lj_a * c25_vmb_b; c25_wmb_b = c25_dq2; c25_imb_y = 0.00045080006724164168 * c25_wmb_b; c25_xmb_b = c25_theta_5; c25_jmb_y = 2.0 * c25_xmb_b; c25_wfb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_jmb_y; c25_xfb_x = c25_wfb_x; c25_xfb_x = muDoubleScalarSin(c25_xfb_x); c25_mj_a = c25_imb_y; c25_ymb_b = c25_xfb_x; c25_kmb_y = c25_mj_a * c25_ymb_b; c25_anb_b = c25_dq3; c25_lmb_y = 0.00045080006724164168 * c25_anb_b; c25_bnb_b = c25_theta_5; c25_mmb_y = 2.0 * c25_bnb_b; c25_yfb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_mmb_y; c25_agb_x = c25_yfb_x; c25_agb_x = muDoubleScalarSin(c25_agb_x); c25_nj_a = c25_lmb_y; c25_cnb_b = c25_agb_x; c25_nmb_y = c25_nj_a * c25_cnb_b; c25_dnb_b = c25_dq4; c25_omb_y = 0.00045080006724164168 * c25_dnb_b; c25_enb_b = c25_theta_5; c25_pmb_y = 2.0 * c25_enb_b; c25_bgb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_pmb_y; c25_cgb_x = c25_bgb_x; c25_cgb_x = muDoubleScalarSin(c25_cgb_x); c25_oj_a = c25_omb_y; c25_fnb_b = c25_cgb_x; c25_qmb_y = c25_oj_a * c25_fnb_b; c25_gnb_b = c25_dq1; c25_rmb_y = 0.003730276414375 * c25_gnb_b; c25_hnb_b = c25_theta_2; c25_smb_y = 2.0 * c25_hnb_b; c25_inb_b = c25_theta_5; c25_tmb_y = c25_inb_b; c25_dgb_x = ((c25_smb_y + c25_theta_3) + c25_theta_4) - c25_tmb_y; c25_egb_x = c25_dgb_x; c25_egb_x = muDoubleScalarCos(c25_egb_x); c25_pj_a = c25_rmb_y; c25_jnb_b = c25_egb_x; c25_umb_y = c25_pj_a * c25_jnb_b; c25_knb_b = c25_dq1; c25_vmb_y = 0.000807308943675 * c25_knb_b; c25_lnb_b = c25_theta_2; c25_wmb_y = 2.0 * c25_lnb_b; c25_mnb_b = c25_theta_3; c25_xmb_y = 2.0 * c25_mnb_b; c25_nnb_b = c25_theta_4; c25_ymb_y = 2.0 * c25_nnb_b; c25_fgb_x = ((c25_wmb_y + c25_xmb_y) + c25_ymb_y) + c25_theta_5; c25_ggb_x = c25_fgb_x; c25_ggb_x = muDoubleScalarSin(c25_ggb_x); c25_qj_a = c25_vmb_y; c25_onb_b = c25_ggb_x; c25_anb_y = c25_qj_a * c25_onb_b; c25_pnb_b = c25_dq1; c25_bnb_y = 0.00045080006724164168 * c25_pnb_b; c25_qnb_b = c25_theta_5; c25_cnb_y = 2.0 * c25_qnb_b; c25_hgb_x = c25_cnb_y; c25_igb_x = c25_hgb_x; c25_igb_x = muDoubleScalarSin(c25_igb_x); c25_rj_a = c25_bnb_y; c25_rnb_b = c25_igb_x; c25_dnb_y = c25_rj_a * c25_rnb_b; c25_snb_b = c25_dq1; c25_enb_y = 0.000807308943675 * c25_snb_b; c25_tnb_b = c25_theta_2; c25_fnb_y = 2.0 * c25_tnb_b; c25_unb_b = c25_theta_3; c25_gnb_y = 2.0 * c25_unb_b; c25_vnb_b = c25_theta_4; c25_hnb_y = 2.0 * c25_vnb_b; c25_wnb_b = c25_theta_5; c25_inb_y = c25_wnb_b; c25_jgb_x = ((c25_fnb_y + c25_gnb_y) + c25_hnb_y) - c25_inb_y; c25_kgb_x = c25_jgb_x; c25_kgb_x = muDoubleScalarSin(c25_kgb_x); c25_sj_a = c25_enb_y; c25_xnb_b = c25_kgb_x; c25_jnb_y = c25_sj_a * c25_xnb_b; c25_ynb_b = c25_dq1; c25_knb_y = 0.00022540003362082084 * c25_ynb_b; c25_aob_b = c25_theta_2; c25_lnb_y = 2.0 * c25_aob_b; c25_bob_b = c25_theta_3; c25_mnb_y = 2.0 * c25_bob_b; c25_cob_b = c25_theta_4; c25_nnb_y = 2.0 * c25_cob_b; c25_dob_b = c25_theta_5; c25_onb_y = 2.0 * c25_dob_b; c25_lgb_x = ((c25_lnb_y + c25_mnb_y) + c25_nnb_y) - c25_onb_y; c25_mgb_x = c25_lgb_x; c25_mgb_x = muDoubleScalarSin(c25_mgb_x); c25_tj_a = c25_knb_y; c25_eob_b = c25_mgb_x; c25_pnb_y = c25_tj_a * c25_eob_b; c25_fob_b = c25_dq2; c25_qnb_y = 0.0019134123725500001 * c25_fob_b; c25_ngb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ogb_x = c25_ngb_x; c25_ogb_x = muDoubleScalarSin(c25_ogb_x); c25_uj_a = c25_qnb_y; c25_gob_b = c25_ogb_x; c25_rnb_y = c25_uj_a * c25_gob_b; c25_hob_b = c25_dq3; c25_snb_y = 0.0019134123725500001 * c25_hob_b; c25_pgb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_qgb_x = c25_pgb_x; c25_qgb_x = muDoubleScalarSin(c25_qgb_x); c25_vj_a = c25_snb_y; c25_iob_b = c25_qgb_x; c25_tnb_y = c25_vj_a * c25_iob_b; c25_job_b = c25_dq4; c25_unb_y = 0.0019134123725500001 * c25_job_b; c25_rgb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_sgb_x = c25_rgb_x; c25_sgb_x = muDoubleScalarSin(c25_sgb_x); c25_wj_a = c25_unb_y; c25_kob_b = c25_sgb_x; c25_vnb_y = c25_wj_a * c25_kob_b; c25_lob_b = c25_dq5; c25_wnb_y = 0.0035280302599 * c25_lob_b; c25_tgb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ugb_x = c25_tgb_x; c25_ugb_x = muDoubleScalarSin(c25_ugb_x); c25_xj_a = c25_wnb_y; c25_mob_b = c25_ugb_x; c25_xnb_y = c25_xj_a * c25_mob_b; c25_nob_b = c25_dq1; c25_ynb_y = 0.00344440558421925 * c25_nob_b; c25_vgb_x = c25_theta_4 + c25_theta_5; c25_wgb_x = c25_vgb_x; c25_wgb_x = muDoubleScalarCos(c25_wgb_x); c25_yj_a = c25_ynb_y; c25_oob_b = c25_wgb_x; c25_aob_y = c25_yj_a * c25_oob_b; c25_pob_b = c25_dq5; c25_bob_y = 0.00746055282875 * c25_pob_b; c25_xgb_x = c25_theta_2 + c25_theta_5; c25_ygb_x = c25_xgb_x; c25_ygb_x = muDoubleScalarCos(c25_ygb_x); c25_ak_a = c25_bob_y; c25_qob_b = c25_ygb_x; c25_cob_y = c25_ak_a * c25_qob_b; c25_rob_b = c25_dq2; c25_dob_y = 0.0019134123725500001 * c25_rob_b; c25_sob_b = c25_theta_5; c25_eob_y = c25_sob_b; c25_ahb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_eob_y; c25_bhb_x = c25_ahb_x; c25_bhb_x = muDoubleScalarSin(c25_bhb_x); c25_bk_a = c25_dob_y; c25_tob_b = c25_bhb_x; c25_fob_y = c25_bk_a * c25_tob_b; c25_uob_b = c25_dq2; c25_gob_y = 0.00045080006724164168 * c25_uob_b; c25_vob_b = c25_theta_5; c25_hob_y = 2.0 * c25_vob_b; c25_chb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_hob_y; c25_dhb_x = c25_chb_x; c25_dhb_x = muDoubleScalarSin(c25_dhb_x); c25_ck_a = c25_gob_y; c25_wob_b = c25_dhb_x; c25_iob_y = c25_ck_a * c25_wob_b; c25_xob_b = c25_dq3; c25_job_y = 0.0019134123725500001 * c25_xob_b; c25_yob_b = c25_theta_5; c25_kob_y = c25_yob_b; c25_ehb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_kob_y; c25_fhb_x = c25_ehb_x; c25_fhb_x = muDoubleScalarSin(c25_fhb_x); c25_dk_a = c25_job_y; c25_apb_b = c25_fhb_x; c25_lob_y = c25_dk_a * c25_apb_b; c25_bpb_b = c25_dq3; c25_mob_y = 0.00045080006724164168 * c25_bpb_b; c25_cpb_b = c25_theta_5; c25_nob_y = 2.0 * c25_cpb_b; c25_ghb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_nob_y; c25_hhb_x = c25_ghb_x; c25_hhb_x = muDoubleScalarSin(c25_hhb_x); c25_ek_a = c25_mob_y; c25_dpb_b = c25_hhb_x; c25_oob_y = c25_ek_a * c25_dpb_b; c25_epb_b = c25_dq4; c25_pob_y = 0.0019134123725500001 * c25_epb_b; c25_fpb_b = c25_theta_5; c25_qob_y = c25_fpb_b; c25_ihb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_qob_y; c25_jhb_x = c25_ihb_x; c25_jhb_x = muDoubleScalarSin(c25_jhb_x); c25_fk_a = c25_pob_y; c25_gpb_b = c25_jhb_x; c25_rob_y = c25_fk_a * c25_gpb_b; c25_hpb_b = c25_dq4; c25_sob_y = 0.00045080006724164168 * c25_hpb_b; c25_ipb_b = c25_theta_5; c25_tob_y = 2.0 * c25_ipb_b; c25_khb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_tob_y; c25_lhb_x = c25_khb_x; c25_lhb_x = muDoubleScalarSin(c25_lhb_x); c25_gk_a = c25_sob_y; c25_jpb_b = c25_lhb_x; c25_uob_y = c25_gk_a * c25_jpb_b; c25_kpb_b = c25_dq5; c25_vob_y = 0.0002987944852 * c25_kpb_b; c25_lpb_b = c25_theta_5; c25_wob_y = c25_lpb_b; c25_mhb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_wob_y; c25_nhb_x = c25_mhb_x; c25_nhb_x = muDoubleScalarSin(c25_nhb_x); c25_hk_a = c25_vob_y; c25_mpb_b = c25_nhb_x; c25_xob_y = c25_hk_a * c25_mpb_b; c25_npb_b = c25_dq1; c25_yob_y = 0.00344440558421925 * c25_npb_b; c25_opb_b = c25_theta_5; c25_apb_y = c25_opb_b; c25_ohb_x = c25_theta_4 - c25_apb_y; c25_phb_x = c25_ohb_x; c25_phb_x = muDoubleScalarCos(c25_phb_x); c25_ik_a = c25_yob_y; c25_ppb_b = c25_phb_x; c25_bpb_y = c25_ik_a * c25_ppb_b; c25_qpb_b = c25_dq5; c25_cpb_y = 0.00746055282875 * c25_qpb_b; c25_rpb_b = c25_theta_5; c25_dpb_y = c25_rpb_b; c25_qhb_x = c25_theta_2 - c25_dpb_y; c25_rhb_x = c25_qhb_x; c25_rhb_x = muDoubleScalarCos(c25_rhb_x); c25_jk_a = c25_cpb_y; c25_spb_b = c25_rhb_x; c25_epb_y = c25_jk_a * c25_spb_b; c25_tpb_b = c25_dq1; c25_fpb_y = 0.00344440558421925 * c25_tpb_b; c25_upb_b = c25_theta_2; c25_gpb_y = 2.0 * c25_upb_b; c25_vpb_b = c25_theta_3; c25_hpb_y = 2.0 * c25_vpb_b; c25_shb_x = ((c25_gpb_y + c25_hpb_y) + c25_theta_4) + c25_theta_5; c25_thb_x = c25_shb_x; c25_thb_x = muDoubleScalarCos(c25_thb_x); c25_kk_a = c25_fpb_y; c25_wpb_b = c25_thb_x; c25_ipb_y = c25_kk_a * c25_wpb_b; c25_xpb_b = c25_dq1; c25_jpb_y = 0.0038268247451 * c25_xpb_b; c25_uhb_x = c25_theta_5; c25_vhb_x = c25_uhb_x; c25_vhb_x = muDoubleScalarSin(c25_vhb_x); c25_lk_a = c25_jpb_y; c25_ypb_b = c25_vhb_x; c25_kpb_y = c25_lk_a * c25_ypb_b; c25_aqb_b = c25_dq1; c25_lpb_y = 0.00344440558421925 * c25_aqb_b; c25_bqb_b = c25_theta_2; c25_mpb_y = 2.0 * c25_bqb_b; c25_cqb_b = c25_theta_3; c25_npb_y = 2.0 * c25_cqb_b; c25_dqb_b = c25_theta_5; c25_opb_y = c25_dqb_b; c25_whb_x = ((c25_mpb_y + c25_npb_y) + c25_theta_4) - c25_opb_y; c25_xhb_x = c25_whb_x; c25_xhb_x = muDoubleScalarCos(c25_xhb_x); c25_mk_a = c25_lpb_y; c25_eqb_b = c25_xhb_x; c25_ppb_y = c25_mk_a * c25_eqb_b; c25_fqb_b = c25_dq1; c25_qpb_y = 0.003730276414375 * c25_fqb_b; c25_yhb_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_aib_x = c25_yhb_x; c25_aib_x = muDoubleScalarCos(c25_aib_x); c25_nk_a = c25_qpb_y; c25_gqb_b = c25_aib_x; c25_rpb_y = c25_nk_a * c25_gqb_b; c25_hqb_b = c25_dq5; c25_spb_y = 0.0068888111684385 * c25_hqb_b; c25_bib_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_cib_x = c25_bib_x; c25_cib_x = muDoubleScalarCos(c25_cib_x); c25_ok_a = c25_spb_y; c25_iqb_b = c25_cib_x; c25_tpb_y = c25_ok_a * c25_iqb_b; c25_jqb_b = c25_dq1; c25_upb_y = 0.00022540003362082084 * c25_jqb_b; c25_kqb_b = c25_theta_2; c25_vpb_y = 2.0 * c25_kqb_b; c25_lqb_b = c25_theta_3; c25_wpb_y = 2.0 * c25_lqb_b; c25_mqb_b = c25_theta_4; c25_xpb_y = 2.0 * c25_mqb_b; c25_nqb_b = c25_theta_5; c25_ypb_y = 2.0 * c25_nqb_b; c25_dib_x = ((c25_vpb_y + c25_wpb_y) + c25_xpb_y) + c25_ypb_y; c25_eib_x = c25_dib_x; c25_eib_x = muDoubleScalarSin(c25_eib_x); c25_pk_a = c25_upb_y; c25_oqb_b = c25_eib_x; c25_aqb_y = c25_pk_a * c25_oqb_b; c25_pqb_b = c25_dq2; c25_bqb_y = 0.0014202397504832836 * c25_pqb_b; c25_fib_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_gib_x = c25_fib_x; c25_gib_x = muDoubleScalarSin(c25_gib_x); c25_qk_a = c25_bqb_y; c25_qqb_b = c25_gib_x; c25_cqb_y = c25_qk_a * c25_qqb_b; c25_rqb_b = c25_dq3; c25_dqb_y = 0.0014202397504832836 * c25_rqb_b; c25_hib_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_iib_x = c25_hib_x; c25_iib_x = muDoubleScalarSin(c25_iib_x); c25_rk_a = c25_dqb_y; c25_sqb_b = c25_iib_x; c25_eqb_y = c25_rk_a * c25_sqb_b; c25_tqb_b = c25_dq4; c25_fqb_y = 0.0014202397504832836 * c25_tqb_b; c25_jib_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_kib_x = c25_jib_x; c25_kib_x = muDoubleScalarSin(c25_kib_x); c25_sk_a = c25_fqb_y; c25_uqb_b = c25_kib_x; c25_gqb_y = c25_sk_a * c25_uqb_b; c25_vqb_b = c25_dq1; c25_hqb_y = 0.003730276414375 * c25_vqb_b; c25_wqb_b = c25_theta_2; c25_iqb_y = 2.0 * c25_wqb_b; c25_lib_x = ((c25_iqb_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_mib_x = c25_lib_x; c25_mib_x = muDoubleScalarCos(c25_mib_x); c25_tk_a = c25_hqb_y; c25_xqb_b = c25_mib_x; c25_jqb_y = c25_tk_a * c25_xqb_b; c25_yqb_b = c25_dq6; c25_kqb_y = 6.9267456E-5 * c25_yqb_b; c25_nib_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_oib_x = c25_nib_x; c25_oib_x = muDoubleScalarSin(c25_oib_x); c25_uk_a = c25_kqb_y; c25_arb_b = c25_oib_x; c25_lqb_y = c25_uk_a * c25_arb_b; c25_pib_x = c25_theta_5; c25_qib_x = c25_pib_x; c25_qib_x = muDoubleScalarCos(c25_qib_x); c25_vk_a = c25_lqb_y; c25_brb_b = c25_qib_x; c25_mqb_y = c25_vk_a * c25_brb_b; c25_c15 = ((((((((((((((((((((((((((((((((((c25_emb_y - c25_hmb_y) + c25_kmb_y) + c25_nmb_y) + c25_qmb_y) + c25_umb_y) - c25_anb_y) - c25_dnb_y) - c25_jnb_y) - c25_pnb_y) + c25_rnb_y) + c25_tnb_y) + c25_vnb_y) + c25_xnb_y) + c25_aob_y) - c25_cob_y) + c25_fob_y) + c25_iob_y) + c25_lob_y) + c25_oob_y) + c25_rob_y) + c25_uob_y) - c25_xob_y) + c25_bpb_y) - c25_epb_y) + c25_ipb_y) - c25_kpb_y) + c25_ppb_y) + c25_rpb_y) - c25_tpb_y) + c25_aqb_y) + c25_cqb_y) + c25_eqb_y) + c25_gqb_y) + c25_jqb_y) - c25_mqb_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 67); c25_crb_b = c25_dq2; c25_nqb_y = -6.9267456E-5 * c25_crb_b; c25_rib_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_sib_x = c25_rib_x; c25_sib_x = muDoubleScalarCos(c25_sib_x); c25_wk_a = c25_nqb_y; c25_drb_b = c25_sib_x; c25_oqb_y = c25_wk_a * c25_drb_b; c25_tib_x = c25_theta_5; c25_uib_x = c25_tib_x; c25_uib_x = muDoubleScalarSin(c25_uib_x); c25_xk_a = c25_oqb_y; c25_erb_b = c25_uib_x; c25_pqb_y = c25_xk_a * c25_erb_b; c25_frb_b = c25_dq3; c25_qqb_y = 6.9267456E-5 * c25_frb_b; c25_vib_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_wib_x = c25_vib_x; c25_wib_x = muDoubleScalarCos(c25_wib_x); c25_yk_a = c25_qqb_y; c25_grb_b = c25_wib_x; c25_rqb_y = c25_yk_a * c25_grb_b; c25_xib_x = c25_theta_5; c25_yib_x = c25_xib_x; c25_yib_x = muDoubleScalarSin(c25_yib_x); c25_al_a = c25_rqb_y; c25_hrb_b = c25_yib_x; c25_sqb_y = c25_al_a * c25_hrb_b; c25_irb_b = c25_dq4; c25_tqb_y = 6.9267456E-5 * c25_irb_b; c25_ajb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_bjb_x = c25_ajb_x; c25_bjb_x = muDoubleScalarCos(c25_bjb_x); c25_bl_a = c25_tqb_y; c25_jrb_b = c25_bjb_x; c25_uqb_y = c25_bl_a * c25_jrb_b; c25_cjb_x = c25_theta_5; c25_djb_x = c25_cjb_x; c25_djb_x = muDoubleScalarSin(c25_djb_x); c25_cl_a = c25_uqb_y; c25_krb_b = c25_djb_x; c25_vqb_y = c25_cl_a * c25_krb_b; c25_lrb_b = c25_dq5; c25_wqb_y = 6.9267456E-5 * c25_lrb_b; c25_ejb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_fjb_x = c25_ejb_x; c25_fjb_x = muDoubleScalarSin(c25_fjb_x); c25_dl_a = c25_wqb_y; c25_mrb_b = c25_fjb_x; c25_xqb_y = c25_dl_a * c25_mrb_b; c25_gjb_x = c25_theta_5; c25_hjb_x = c25_gjb_x; c25_hjb_x = muDoubleScalarCos(c25_hjb_x); c25_el_a = c25_xqb_y; c25_nrb_b = c25_hjb_x; c25_yqb_y = c25_el_a * c25_nrb_b; c25_c16 = ((c25_pqb_y - c25_sqb_y) - c25_vqb_y) - c25_yqb_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 68); c25_orb_b = c25_dq5; c25_arb_y = 0.00045080006724164168 * c25_orb_b; c25_prb_b = c25_theta_5; c25_brb_y = 2.0 * c25_prb_b; c25_ijb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_brb_y; c25_jjb_x = c25_ijb_x; c25_jjb_x = muDoubleScalarSin(c25_jjb_x); c25_fl_a = c25_arb_y; c25_qrb_b = c25_jjb_x; c25_crb_y = c25_fl_a * c25_qrb_b; c25_rrb_b = c25_dq5; c25_drb_y = 0.0068888111684385 * c25_rrb_b; c25_srb_b = c25_theta_5; c25_erb_y = c25_srb_b; c25_kjb_x = (c25_theta_2 + c25_theta_3) - c25_erb_y; c25_ljb_x = c25_kjb_x; c25_ljb_x = muDoubleScalarCos(c25_ljb_x); c25_gl_a = c25_drb_y; c25_trb_b = c25_ljb_x; c25_frb_y = c25_gl_a * c25_trb_b; c25_urb_b = c25_dq1; c25_grb_y = 0.00746055282875 * c25_urb_b; c25_vrb_b = c25_theta_2; c25_hrb_y = 2.0 * c25_vrb_b; c25_wrb_b = c25_theta_5; c25_irb_y = c25_wrb_b; c25_mjb_x = ((c25_hrb_y + c25_theta_3) + c25_theta_4) - c25_irb_y; c25_njb_x = c25_mjb_x; c25_njb_x = muDoubleScalarCos(c25_njb_x); c25_hl_a = c25_grb_y; c25_xrb_b = c25_njb_x; c25_jrb_y = c25_hl_a * c25_xrb_b; c25_yrb_b = c25_dq1; c25_krb_y = 0.701428260725 * c25_yrb_b; c25_asb_b = c25_theta_2; c25_lrb_y = 2.0 * c25_asb_b; c25_ojb_x = c25_lrb_y + c25_theta_3; c25_pjb_x = c25_ojb_x; c25_pjb_x = muDoubleScalarSin(c25_pjb_x); c25_il_a = c25_krb_y; c25_bsb_b = c25_pjb_x; c25_mrb_y = c25_il_a * c25_bsb_b; c25_csb_b = c25_dq1; c25_nrb_y = 0.0583017396828 * c25_csb_b; c25_dsb_b = c25_theta_2; c25_orb_y = 2.0 * c25_dsb_b; c25_esb_b = c25_theta_3; c25_prb_y = 2.0 * c25_esb_b; c25_qjb_x = (c25_orb_y + c25_prb_y) + c25_theta_4; c25_rjb_x = c25_qjb_x; c25_rjb_x = muDoubleScalarCos(c25_rjb_x); c25_jl_a = c25_nrb_y; c25_fsb_b = c25_rjb_x; c25_qrb_y = c25_jl_a * c25_fsb_b; c25_gsb_b = c25_dq1; c25_rrb_y = 0.00161461788735 * c25_gsb_b; c25_hsb_b = c25_theta_2; c25_srb_y = 2.0 * c25_hsb_b; c25_isb_b = c25_theta_3; c25_trb_y = 2.0 * c25_isb_b; c25_jsb_b = c25_theta_4; c25_urb_y = 2.0 * c25_jsb_b; c25_sjb_x = ((c25_srb_y + c25_trb_y) + c25_urb_y) + c25_theta_5; c25_tjb_x = c25_sjb_x; c25_tjb_x = muDoubleScalarSin(c25_tjb_x); c25_kl_a = c25_rrb_y; c25_ksb_b = c25_tjb_x; c25_vrb_y = c25_kl_a * c25_ksb_b; c25_lsb_b = c25_dq1; c25_wrb_y = 0.80286398713 * c25_lsb_b; c25_msb_b = c25_theta_2; c25_xrb_y = 2.0 * c25_msb_b; c25_ujb_x = c25_xrb_y; c25_vjb_x = c25_ujb_x; c25_vjb_x = muDoubleScalarSin(c25_vjb_x); c25_ll_a = c25_wrb_y; c25_nsb_b = c25_vjb_x; c25_yrb_y = c25_ll_a * c25_nsb_b; c25_osb_b = c25_dq1; c25_asb_y = 0.00161461788735 * c25_osb_b; c25_psb_b = c25_theta_2; c25_bsb_y = 2.0 * c25_psb_b; c25_qsb_b = c25_theta_3; c25_csb_y = 2.0 * c25_qsb_b; c25_rsb_b = c25_theta_4; c25_dsb_y = 2.0 * c25_rsb_b; c25_ssb_b = c25_theta_5; c25_esb_y = c25_ssb_b; c25_wjb_x = ((c25_bsb_y + c25_csb_y) + c25_dsb_y) - c25_esb_y; c25_xjb_x = c25_wjb_x; c25_xjb_x = muDoubleScalarSin(c25_xjb_x); c25_ml_a = c25_asb_y; c25_tsb_b = c25_xjb_x; c25_fsb_y = c25_ml_a * c25_tsb_b; c25_usb_b = c25_dq1; c25_gsb_y = 0.00022540003362082084 * c25_usb_b; c25_vsb_b = c25_theta_2; c25_hsb_y = 2.0 * c25_vsb_b; c25_wsb_b = c25_theta_3; c25_isb_y = 2.0 * c25_wsb_b; c25_xsb_b = c25_theta_4; c25_jsb_y = 2.0 * c25_xsb_b; c25_ysb_b = c25_theta_5; c25_ksb_y = 2.0 * c25_ysb_b; c25_yjb_x = ((c25_hsb_y + c25_isb_y) + c25_jsb_y) - c25_ksb_y; c25_akb_x = c25_yjb_x; c25_akb_x = muDoubleScalarSin(c25_akb_x); c25_nl_a = c25_gsb_y; c25_atb_b = c25_akb_x; c25_lsb_y = c25_nl_a * c25_atb_b; c25_btb_b = c25_dq5; c25_msb_y = 0.0016146178873500002 * c25_btb_b; c25_bkb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ckb_x = c25_bkb_x; c25_ckb_x = muDoubleScalarSin(c25_ckb_x); c25_ol_a = c25_msb_y; c25_ctb_b = c25_ckb_x; c25_nsb_y = c25_ol_a * c25_ctb_b; c25_dtb_b = c25_dq5; c25_osb_y = 0.00746055282875 * c25_dtb_b; c25_dkb_x = c25_theta_2 + c25_theta_5; c25_ekb_x = c25_dkb_x; c25_ekb_x = muDoubleScalarCos(c25_ekb_x); c25_pl_a = c25_osb_y; c25_etb_b = c25_ekb_x; c25_psb_y = c25_pl_a * c25_etb_b; c25_ftb_b = c25_dq1; c25_qsb_y = 0.063140533 * c25_ftb_b; c25_gtb_b = c25_theta_2; c25_rsb_y = 2.0 * c25_gtb_b; c25_fkb_x = (c25_rsb_y + c25_theta_3) + c25_theta_4; c25_gkb_x = c25_fkb_x; c25_gkb_x = muDoubleScalarCos(c25_gkb_x); c25_ql_a = c25_qsb_y; c25_htb_b = c25_gkb_x; c25_ssb_y = c25_ql_a * c25_htb_b; c25_itb_b = c25_dq5; c25_tsb_y = 0.0016146178873500002 * c25_itb_b; c25_jtb_b = c25_theta_5; c25_usb_y = c25_jtb_b; c25_hkb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_usb_y; c25_ikb_x = c25_hkb_x; c25_ikb_x = muDoubleScalarSin(c25_ikb_x); c25_rl_a = c25_tsb_y; c25_ktb_b = c25_ikb_x; c25_vsb_y = c25_rl_a * c25_ktb_b; c25_ltb_b = c25_dq5; c25_wsb_y = 0.00045080006724164168 * c25_ltb_b; c25_mtb_b = c25_theta_5; c25_xsb_y = 2.0 * c25_mtb_b; c25_jkb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_xsb_y; c25_kkb_x = c25_jkb_x; c25_kkb_x = muDoubleScalarSin(c25_kkb_x); c25_sl_a = c25_wsb_y; c25_ntb_b = c25_kkb_x; c25_ysb_y = c25_sl_a * c25_ntb_b; c25_otb_b = c25_dq5; c25_atb_y = 0.00746055282875 * c25_otb_b; c25_ptb_b = c25_theta_5; c25_btb_y = c25_ptb_b; c25_lkb_x = c25_theta_2 - c25_btb_y; c25_mkb_x = c25_lkb_x; c25_mkb_x = muDoubleScalarCos(c25_mkb_x); c25_tl_a = c25_atb_y; c25_qtb_b = c25_mkb_x; c25_ctb_y = c25_tl_a * c25_qtb_b; c25_rtb_b = c25_dq1; c25_dtb_y = 0.0068888111684385 * c25_rtb_b; c25_stb_b = c25_theta_2; c25_etb_y = 2.0 * c25_stb_b; c25_ttb_b = c25_theta_3; c25_ftb_y = 2.0 * c25_ttb_b; c25_nkb_x = ((c25_etb_y + c25_ftb_y) + c25_theta_4) + c25_theta_5; c25_okb_x = c25_nkb_x; c25_okb_x = muDoubleScalarCos(c25_okb_x); c25_ul_a = c25_dtb_y; c25_utb_b = c25_okb_x; c25_gtb_y = c25_ul_a * c25_utb_b; c25_vtb_b = c25_dq1; c25_htb_y = 0.0068888111684385 * c25_vtb_b; c25_wtb_b = c25_theta_2; c25_itb_y = 2.0 * c25_wtb_b; c25_xtb_b = c25_theta_3; c25_jtb_y = 2.0 * c25_xtb_b; c25_ytb_b = c25_theta_5; c25_ktb_y = c25_ytb_b; c25_pkb_x = ((c25_itb_y + c25_jtb_y) + c25_theta_4) - c25_ktb_y; c25_qkb_x = c25_pkb_x; c25_qkb_x = muDoubleScalarCos(c25_qkb_x); c25_vl_a = c25_htb_y; c25_aub_b = c25_qkb_x; c25_ltb_y = c25_vl_a * c25_aub_b; c25_bub_b = c25_dq1; c25_mtb_y = 0.31297029415553834 * c25_bub_b; c25_cub_b = c25_theta_2; c25_ntb_y = 2.0 * c25_cub_b; c25_dub_b = c25_theta_3; c25_otb_y = 2.0 * c25_dub_b; c25_rkb_x = c25_ntb_y + c25_otb_y; c25_skb_x = c25_rkb_x; c25_skb_x = muDoubleScalarSin(c25_skb_x); c25_wl_a = c25_mtb_y; c25_eub_b = c25_skb_x; c25_ptb_y = c25_wl_a * c25_eub_b; c25_fub_b = c25_dq1; c25_qtb_y = 0.0057439079350250248 * c25_fub_b; c25_gub_b = c25_theta_2; c25_rtb_y = 2.0 * c25_gub_b; c25_hub_b = c25_theta_3; c25_stb_y = 2.0 * c25_hub_b; c25_iub_b = c25_theta_4; c25_ttb_y = 2.0 * c25_iub_b; c25_tkb_x = (c25_rtb_y + c25_stb_y) + c25_ttb_y; c25_ukb_x = c25_tkb_x; c25_ukb_x = muDoubleScalarSin(c25_ukb_x); c25_xl_a = c25_qtb_y; c25_jub_b = c25_ukb_x; c25_utb_y = c25_xl_a * c25_jub_b; c25_kub_b = c25_dq5; c25_vtb_y = 0.0068888111684385 * c25_kub_b; c25_vkb_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_wkb_x = c25_vkb_x; c25_wkb_x = muDoubleScalarCos(c25_wkb_x); c25_yl_a = c25_vtb_y; c25_lub_b = c25_wkb_x; c25_wtb_y = c25_yl_a * c25_lub_b; c25_mub_b = c25_dq1; c25_xtb_y = 0.00022540003362082084 * c25_mub_b; c25_nub_b = c25_theta_2; c25_ytb_y = 2.0 * c25_nub_b; c25_oub_b = c25_theta_3; c25_aub_y = 2.0 * c25_oub_b; c25_pub_b = c25_theta_4; c25_bub_y = 2.0 * c25_pub_b; c25_qub_b = c25_theta_5; c25_cub_y = 2.0 * c25_qub_b; c25_xkb_x = ((c25_ytb_y + c25_aub_y) + c25_bub_y) + c25_cub_y; c25_ykb_x = c25_xkb_x; c25_ykb_x = muDoubleScalarSin(c25_ykb_x); c25_am_a = c25_xtb_y; c25_rub_b = c25_ykb_x; c25_dub_y = c25_am_a * c25_rub_b; c25_sub_b = c25_dq5; c25_eub_y = 0.0014202397504832836 * c25_sub_b; c25_alb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_blb_x = c25_alb_x; c25_blb_x = muDoubleScalarSin(c25_blb_x); c25_bm_a = c25_eub_y; c25_tub_b = c25_blb_x; c25_fub_y = c25_bm_a * c25_tub_b; c25_uub_b = c25_dq1; c25_gub_y = 0.00746055282875 * c25_uub_b; c25_vub_b = c25_theta_2; c25_hub_y = 2.0 * c25_vub_b; c25_clb_x = ((c25_hub_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_dlb_x = c25_clb_x; c25_dlb_x = muDoubleScalarCos(c25_dlb_x); c25_cm_a = c25_gub_y; c25_wub_b = c25_dlb_x; c25_iub_y = c25_cm_a * c25_wub_b; c25_xub_b = c25_dq6; c25_jub_y = 6.9267456E-5 * c25_xub_b; c25_elb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_flb_x = c25_elb_x; c25_flb_x = muDoubleScalarCos(c25_flb_x); c25_dm_a = c25_jub_y; c25_yub_b = c25_flb_x; c25_kub_y = c25_dm_a * c25_yub_b; c25_glb_x = c25_theta_5; c25_hlb_x = c25_glb_x; c25_hlb_x = muDoubleScalarSin(c25_hlb_x); c25_em_a = c25_kub_y; c25_avb_b = c25_hlb_x; c25_lub_y = c25_em_a * c25_avb_b; c25_c21 = ((((((((((((((((((((((c25_crb_y - c25_frb_y) + c25_jrb_y) + c25_mrb_y) + c25_qrb_y) + c25_vrb_y) + c25_yrb_y) - c25_fsb_y) - c25_lsb_y) - c25_nsb_y) + c25_psb_y) + c25_ssb_y) + c25_vsb_y) + c25_ysb_y) - c25_ctb_y) - c25_gtb_y) + c25_ltb_y) + c25_ptb_y) - c25_utb_y) + c25_wtb_y) - c25_dub_y) - c25_fub_y) - c25_iub_y) + c25_lub_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 69); c25_bvb_b = c25_dq5; c25_mub_y = 0.5 * c25_bvb_b; c25_ilb_x = c25_theta_5; c25_jlb_x = c25_ilb_x; c25_jlb_x = muDoubleScalarCos(c25_jlb_x); c25_fm_a = c25_mub_y; c25_cvb_b = c25_jlb_x; c25_nub_y = c25_fm_a * c25_cvb_b; c25_klb_x = c25_theta_3 + c25_theta_4; c25_llb_x = c25_klb_x; c25_llb_x = muDoubleScalarCos(c25_llb_x); c25_dvb_b = c25_llb_x; c25_oub_y = 0.029842211315 * c25_dvb_b; c25_mlb_x = c25_theta_4; c25_nlb_x = c25_mlb_x; c25_nlb_x = muDoubleScalarCos(c25_nlb_x); c25_evb_b = c25_nlb_x; c25_pub_y = 0.027555244673754 * c25_evb_b; c25_olb_x = c25_theta_5; c25_plb_x = c25_olb_x; c25_plb_x = muDoubleScalarSin(c25_plb_x); c25_fvb_b = c25_plb_x; c25_qub_y = 0.0036064005379331339 * c25_fvb_b; c25_gm_a = c25_nub_y; c25_gvb_b = (c25_oub_y + c25_pub_y) + c25_qub_y; c25_rub_y = c25_gm_a * c25_gvb_b; c25_hvb_b = c25_dq4; c25_sub_y = c25_hvb_b; c25_qlb_x = c25_theta_4; c25_rlb_x = c25_qlb_x; c25_rlb_x = muDoubleScalarCos(c25_rlb_x); c25_ivb_b = c25_rlb_x; c25_tub_y = 0.0583017396828 * c25_ivb_b; c25_slb_x = c25_theta_3; c25_tlb_x = c25_slb_x; c25_tlb_x = muDoubleScalarCos(c25_tlb_x); c25_jvb_b = c25_tlb_x; c25_uub_y = 0.063140533 * c25_jvb_b; c25_ulb_x = c25_theta_4; c25_vlb_x = c25_ulb_x; c25_vlb_x = muDoubleScalarCos(c25_vlb_x); c25_hm_a = c25_uub_y; c25_kvb_b = c25_vlb_x; c25_vub_y = c25_hm_a * c25_kvb_b; c25_wlb_x = c25_theta_3; c25_xlb_x = c25_wlb_x; c25_xlb_x = muDoubleScalarSin(c25_xlb_x); c25_lvb_b = c25_xlb_x; c25_wub_y = 0.063140533 * c25_lvb_b; c25_ylb_x = c25_theta_4; c25_amb_x = c25_ylb_x; c25_amb_x = muDoubleScalarSin(c25_amb_x); c25_im_a = c25_wub_y; c25_mvb_b = c25_amb_x; c25_xub_y = c25_im_a * c25_mvb_b; c25_bmb_x = c25_theta_4; c25_cmb_x = c25_bmb_x; c25_cmb_x = muDoubleScalarSin(c25_cmb_x); c25_nvb_b = c25_cmb_x; c25_yub_y = 0.013777622336877 * c25_nvb_b; c25_dmb_x = c25_theta_5; c25_emb_x = c25_dmb_x; c25_emb_x = muDoubleScalarSin(c25_emb_x); c25_jm_a = c25_yub_y; c25_ovb_b = c25_emb_x; c25_avb_y = c25_jm_a * c25_ovb_b; c25_fmb_x = c25_theta_3; c25_gmb_x = c25_fmb_x; c25_gmb_x = muDoubleScalarCos(c25_gmb_x); c25_pvb_b = c25_gmb_x; c25_bvb_y = 0.0149211056575 * c25_pvb_b; c25_hmb_x = c25_theta_4; c25_imb_x = c25_hmb_x; c25_imb_x = muDoubleScalarSin(c25_imb_x); c25_km_a = c25_bvb_y; c25_qvb_b = c25_imb_x; c25_cvb_y = c25_km_a * c25_qvb_b; c25_jmb_x = c25_theta_5; c25_kmb_x = c25_jmb_x; c25_kmb_x = muDoubleScalarSin(c25_kmb_x); c25_lm_a = c25_cvb_y; c25_rvb_b = c25_kmb_x; c25_dvb_y = c25_lm_a * c25_rvb_b; c25_lmb_x = c25_theta_4; c25_mmb_x = c25_lmb_x; c25_mmb_x = muDoubleScalarCos(c25_mmb_x); c25_svb_b = c25_mmb_x; c25_evb_y = 0.0149211056575 * c25_svb_b; c25_nmb_x = c25_theta_3; c25_omb_x = c25_nmb_x; c25_omb_x = muDoubleScalarSin(c25_omb_x); c25_mm_a = c25_evb_y; c25_tvb_b = c25_omb_x; c25_fvb_y = c25_mm_a * c25_tvb_b; c25_pmb_x = c25_theta_5; c25_qmb_x = c25_pmb_x; c25_qmb_x = muDoubleScalarSin(c25_qmb_x); c25_nm_a = c25_fvb_y; c25_uvb_b = c25_qmb_x; c25_gvb_y = c25_nm_a * c25_uvb_b; c25_om_a = c25_sub_y; c25_vvb_b = ((((c25_tub_y + c25_vub_y) - c25_xub_y) + c25_avb_y) + c25_dvb_y) + c25_gvb_y; c25_hvb_y = c25_om_a * c25_vvb_b; c25_wvb_b = c25_dq3; c25_ivb_y = c25_wvb_b; c25_rmb_x = c25_theta_3; c25_smb_x = c25_rmb_x; c25_smb_x = muDoubleScalarSin(c25_smb_x); c25_xvb_b = c25_smb_x; c25_jvb_y = 0.701428260725 * c25_xvb_b; c25_tmb_x = c25_theta_3; c25_umb_x = c25_tmb_x; c25_umb_x = muDoubleScalarCos(c25_umb_x); c25_yvb_b = c25_umb_x; c25_kvb_y = 0.063140533 * c25_yvb_b; c25_vmb_x = c25_theta_4; c25_wmb_x = c25_vmb_x; c25_wmb_x = muDoubleScalarCos(c25_wmb_x); c25_pm_a = c25_kvb_y; c25_awb_b = c25_wmb_x; c25_lvb_y = c25_pm_a * c25_awb_b; c25_xmb_x = c25_theta_3; c25_ymb_x = c25_xmb_x; c25_ymb_x = muDoubleScalarSin(c25_ymb_x); c25_bwb_b = c25_ymb_x; c25_mvb_y = 0.063140533 * c25_bwb_b; c25_anb_x = c25_theta_4; c25_bnb_x = c25_anb_x; c25_bnb_x = muDoubleScalarSin(c25_bnb_x); c25_qm_a = c25_mvb_y; c25_cwb_b = c25_bnb_x; c25_nvb_y = c25_qm_a * c25_cwb_b; c25_cnb_x = c25_theta_3; c25_dnb_x = c25_cnb_x; c25_dnb_x = muDoubleScalarCos(c25_dnb_x); c25_dwb_b = c25_dnb_x; c25_ovb_y = 0.0149211056575 * c25_dwb_b; c25_enb_x = c25_theta_4; c25_fnb_x = c25_enb_x; c25_fnb_x = muDoubleScalarSin(c25_fnb_x); c25_rm_a = c25_ovb_y; c25_ewb_b = c25_fnb_x; c25_pvb_y = c25_rm_a * c25_ewb_b; c25_gnb_x = c25_theta_5; c25_hnb_x = c25_gnb_x; c25_hnb_x = muDoubleScalarSin(c25_hnb_x); c25_sm_a = c25_pvb_y; c25_fwb_b = c25_hnb_x; c25_qvb_y = c25_sm_a * c25_fwb_b; c25_inb_x = c25_theta_4; c25_jnb_x = c25_inb_x; c25_jnb_x = muDoubleScalarCos(c25_jnb_x); c25_gwb_b = c25_jnb_x; c25_rvb_y = 0.0149211056575 * c25_gwb_b; c25_knb_x = c25_theta_3; c25_lnb_x = c25_knb_x; c25_lnb_x = muDoubleScalarSin(c25_lnb_x); c25_tm_a = c25_rvb_y; c25_hwb_b = c25_lnb_x; c25_svb_y = c25_tm_a * c25_hwb_b; c25_mnb_x = c25_theta_5; c25_nnb_x = c25_mnb_x; c25_nnb_x = muDoubleScalarSin(c25_nnb_x); c25_um_a = c25_svb_y; c25_iwb_b = c25_nnb_x; c25_tvb_y = c25_um_a * c25_iwb_b; c25_vm_a = c25_ivb_y; c25_jwb_b = (((c25_jvb_y + c25_lvb_y) - c25_nvb_y) + c25_qvb_y) + c25_tvb_y; c25_uvb_y = c25_vm_a * c25_jwb_b; c25_c22 = (c25_rub_y - c25_hvb_y) - c25_uvb_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 70); c25_kwb_b = c25_dq5; c25_vvb_y = 0.00090160013448328346 * c25_kwb_b; c25_lwb_b = c25_theta_5; c25_wvb_y = 2.0 * c25_lwb_b; c25_onb_x = c25_wvb_y; c25_pnb_x = c25_onb_x; c25_pnb_x = muDoubleScalarSin(c25_pnb_x); c25_wm_a = c25_vvb_y; c25_mwb_b = c25_pnb_x; c25_xvb_y = c25_wm_a * c25_mwb_b; c25_nwb_b = c25_dq2; c25_yvb_y = 0.00746055282875 * c25_nwb_b; c25_qnb_x = (c25_theta_3 + c25_theta_4) - c25_theta_5; c25_rnb_x = c25_qnb_x; c25_rnb_x = muDoubleScalarCos(c25_rnb_x); c25_xm_a = c25_yvb_y; c25_owb_b = c25_rnb_x; c25_awb_y = c25_xm_a * c25_owb_b; c25_pwb_b = c25_dq3; c25_bwb_y = 0.00746055282875 * c25_pwb_b; c25_snb_x = (c25_theta_3 + c25_theta_4) - c25_theta_5; c25_tnb_x = c25_snb_x; c25_tnb_x = muDoubleScalarCos(c25_tnb_x); c25_ym_a = c25_bwb_y; c25_qwb_b = c25_tnb_x; c25_cwb_y = c25_ym_a * c25_qwb_b; c25_rwb_b = c25_dq4; c25_dwb_y = 0.00746055282875 * c25_rwb_b; c25_unb_x = (c25_theta_3 + c25_theta_4) - c25_theta_5; c25_vnb_x = c25_unb_x; c25_vnb_x = muDoubleScalarCos(c25_vnb_x); c25_an_a = c25_dwb_y; c25_swb_b = c25_vnb_x; c25_ewb_y = c25_an_a * c25_swb_b; c25_twb_b = c25_dq5; c25_fwb_y = 0.00746055282875 * c25_twb_b; c25_wnb_x = (c25_theta_3 + c25_theta_4) - c25_theta_5; c25_xnb_x = c25_wnb_x; c25_xnb_x = muDoubleScalarCos(c25_xnb_x); c25_bn_a = c25_fwb_y; c25_uwb_b = c25_xnb_x; c25_gwb_y = c25_bn_a * c25_uwb_b; c25_vwb_b = c25_dq2; c25_hwb_y = 0.063140533 * c25_vwb_b; c25_ynb_x = c25_theta_3 + c25_theta_4; c25_aob_x = c25_ynb_x; c25_aob_x = muDoubleScalarCos(c25_aob_x); c25_cn_a = c25_hwb_y; c25_wwb_b = c25_aob_x; c25_iwb_y = c25_cn_a * c25_wwb_b; c25_xwb_b = c25_dq3; c25_jwb_y = 0.063140533 * c25_xwb_b; c25_bob_x = c25_theta_3 + c25_theta_4; c25_cob_x = c25_bob_x; c25_cob_x = muDoubleScalarCos(c25_cob_x); c25_dn_a = c25_jwb_y; c25_ywb_b = c25_cob_x; c25_kwb_y = c25_dn_a * c25_ywb_b; c25_axb_b = c25_dq4; c25_lwb_y = 0.063140533 * c25_axb_b; c25_dob_x = c25_theta_3 + c25_theta_4; c25_eob_x = c25_dob_x; c25_eob_x = muDoubleScalarCos(c25_eob_x); c25_en_a = c25_lwb_y; c25_bxb_b = c25_eob_x; c25_mwb_y = c25_en_a * c25_bxb_b; c25_cxb_b = c25_dq4; c25_nwb_y = 0.0068888111684385 * c25_cxb_b; c25_fob_x = c25_theta_4 + c25_theta_5; c25_gob_x = c25_fob_x; c25_gob_x = muDoubleScalarCos(c25_gob_x); c25_fn_a = c25_nwb_y; c25_dxb_b = c25_gob_x; c25_owb_y = c25_fn_a * c25_dxb_b; c25_exb_b = c25_dq5; c25_pwb_y = 0.0068888111684385 * c25_exb_b; c25_hob_x = c25_theta_4 + c25_theta_5; c25_iob_x = c25_hob_x; c25_iob_x = muDoubleScalarCos(c25_iob_x); c25_gn_a = c25_pwb_y; c25_fxb_b = c25_iob_x; c25_qwb_y = c25_gn_a * c25_fxb_b; c25_gxb_b = c25_dq4; c25_rwb_y = 0.0583017396828 * c25_gxb_b; c25_job_x = c25_theta_4; c25_kob_x = c25_job_x; c25_kob_x = muDoubleScalarCos(c25_kob_x); c25_hn_a = c25_rwb_y; c25_hxb_b = c25_kob_x; c25_swb_y = c25_hn_a * c25_hxb_b; c25_ixb_b = c25_dq2; c25_twb_y = 0.701428260725 * c25_ixb_b; c25_lob_x = c25_theta_3; c25_mob_x = c25_lob_x; c25_mob_x = muDoubleScalarSin(c25_mob_x); c25_in_a = c25_twb_y; c25_jxb_b = c25_mob_x; c25_uwb_y = c25_in_a * c25_jxb_b; c25_kxb_b = c25_dq3; c25_vwb_y = 0.701428260725 * c25_kxb_b; c25_nob_x = c25_theta_3; c25_oob_x = c25_nob_x; c25_oob_x = muDoubleScalarSin(c25_oob_x); c25_jn_a = c25_vwb_y; c25_lxb_b = c25_oob_x; c25_wwb_y = c25_jn_a * c25_lxb_b; c25_mxb_b = c25_dq4; c25_xwb_y = 0.0068888111684385 * c25_mxb_b; c25_pob_x = c25_theta_4 - c25_theta_5; c25_qob_x = c25_pob_x; c25_qob_x = muDoubleScalarCos(c25_qob_x); c25_kn_a = c25_xwb_y; c25_nxb_b = c25_qob_x; c25_ywb_y = c25_kn_a * c25_nxb_b; c25_oxb_b = c25_dq5; c25_axb_y = 0.0068888111684385 * c25_oxb_b; c25_rob_x = c25_theta_4 - c25_theta_5; c25_sob_x = c25_rob_x; c25_sob_x = muDoubleScalarCos(c25_sob_x); c25_ln_a = c25_axb_y; c25_pxb_b = c25_sob_x; c25_bxb_y = c25_ln_a * c25_pxb_b; c25_qxb_b = c25_dq2; c25_cxb_y = 0.00746055282875 * c25_qxb_b; c25_tob_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_uob_x = c25_tob_x; c25_uob_x = muDoubleScalarCos(c25_uob_x); c25_mn_a = c25_cxb_y; c25_rxb_b = c25_uob_x; c25_dxb_y = c25_mn_a * c25_rxb_b; c25_sxb_b = c25_dq3; c25_exb_y = 0.00746055282875 * c25_sxb_b; c25_vob_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_wob_x = c25_vob_x; c25_wob_x = muDoubleScalarCos(c25_wob_x); c25_nn_a = c25_exb_y; c25_txb_b = c25_wob_x; c25_fxb_y = c25_nn_a * c25_txb_b; c25_uxb_b = c25_dq4; c25_gxb_y = 0.00746055282875 * c25_uxb_b; c25_xob_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_yob_x = c25_xob_x; c25_yob_x = muDoubleScalarCos(c25_yob_x); c25_on_a = c25_gxb_y; c25_vxb_b = c25_yob_x; c25_hxb_y = c25_on_a * c25_vxb_b; c25_wxb_b = c25_dq5; c25_ixb_y = 0.00746055282875 * c25_wxb_b; c25_apb_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_bpb_x = c25_apb_x; c25_bpb_x = muDoubleScalarCos(c25_bpb_x); c25_pn_a = c25_ixb_y; c25_xxb_b = c25_bpb_x; c25_jxb_y = c25_pn_a * c25_xxb_b; c25_c23 = (((((((((((((((((c25_xvb_y - c25_awb_y) - c25_cwb_y) - c25_ewb_y) + c25_gwb_y) - c25_iwb_y) - c25_kwb_y) - c25_mwb_y) + c25_owb_y) + c25_qwb_y) - c25_swb_y) - c25_uwb_y) - c25_wwb_y) - c25_ywb_y) + c25_bxb_y) + c25_dxb_y) + c25_fxb_y) + c25_hxb_y) + c25_jxb_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 71); c25_yxb_b = c25_dq5; c25_kxb_y = 0.00090160013448328346 * c25_yxb_b; c25_ayb_b = c25_theta_5; c25_lxb_y = 2.0 * c25_ayb_b; c25_cpb_x = c25_lxb_y; c25_dpb_x = c25_cpb_x; c25_dpb_x = muDoubleScalarSin(c25_dpb_x); c25_qn_a = c25_kxb_y; c25_byb_b = c25_dpb_x; c25_mxb_y = c25_qn_a * c25_byb_b; c25_cyb_b = c25_dq2; c25_nxb_y = 0.0583017396828 * c25_cyb_b; c25_epb_x = c25_theta_4; c25_fpb_x = c25_epb_x; c25_fpb_x = muDoubleScalarCos(c25_fpb_x); c25_rn_a = c25_nxb_y; c25_dyb_b = c25_fpb_x; c25_oxb_y = c25_rn_a * c25_dyb_b; c25_eyb_b = c25_dq3; c25_pxb_y = 0.0583017396828 * c25_eyb_b; c25_gpb_x = c25_theta_4; c25_hpb_x = c25_gpb_x; c25_hpb_x = muDoubleScalarCos(c25_hpb_x); c25_sn_a = c25_pxb_y; c25_fyb_b = c25_hpb_x; c25_qxb_y = c25_sn_a * c25_fyb_b; c25_gyb_b = c25_dq4; c25_rxb_y = 0.0583017396828 * c25_gyb_b; c25_ipb_x = c25_theta_4; c25_jpb_x = c25_ipb_x; c25_jpb_x = muDoubleScalarCos(c25_jpb_x); c25_tn_a = c25_rxb_y; c25_hyb_b = c25_jpb_x; c25_sxb_y = c25_tn_a * c25_hyb_b; c25_iyb_b = c25_dq2; c25_txb_y = 0.063140533 * c25_iyb_b; c25_kpb_x = c25_theta_3; c25_lpb_x = c25_kpb_x; c25_lpb_x = muDoubleScalarCos(c25_lpb_x); c25_un_a = c25_txb_y; c25_jyb_b = c25_lpb_x; c25_uxb_y = c25_un_a * c25_jyb_b; c25_mpb_x = c25_theta_4; c25_npb_x = c25_mpb_x; c25_npb_x = muDoubleScalarCos(c25_npb_x); c25_vn_a = c25_uxb_y; c25_kyb_b = c25_npb_x; c25_vxb_y = c25_vn_a * c25_kyb_b; c25_lyb_b = c25_dq3; c25_wxb_y = 0.063140533 * c25_lyb_b; c25_opb_x = c25_theta_3; c25_ppb_x = c25_opb_x; c25_ppb_x = muDoubleScalarCos(c25_ppb_x); c25_wn_a = c25_wxb_y; c25_myb_b = c25_ppb_x; c25_xxb_y = c25_wn_a * c25_myb_b; c25_qpb_x = c25_theta_4; c25_rpb_x = c25_qpb_x; c25_rpb_x = muDoubleScalarCos(c25_rpb_x); c25_xn_a = c25_xxb_y; c25_nyb_b = c25_rpb_x; c25_yxb_y = c25_xn_a * c25_nyb_b; c25_oyb_b = c25_dq4; c25_ayb_y = 0.063140533 * c25_oyb_b; c25_spb_x = c25_theta_3; c25_tpb_x = c25_spb_x; c25_tpb_x = muDoubleScalarCos(c25_tpb_x); c25_yn_a = c25_ayb_y; c25_pyb_b = c25_tpb_x; c25_byb_y = c25_yn_a * c25_pyb_b; c25_upb_x = c25_theta_4; c25_vpb_x = c25_upb_x; c25_vpb_x = muDoubleScalarCos(c25_vpb_x); c25_ao_a = c25_byb_y; c25_qyb_b = c25_vpb_x; c25_cyb_y = c25_ao_a * c25_qyb_b; c25_ryb_b = c25_dq5; c25_dyb_y = 0.013777622336877 * c25_ryb_b; c25_wpb_x = c25_theta_4; c25_xpb_x = c25_wpb_x; c25_xpb_x = muDoubleScalarCos(c25_xpb_x); c25_bo_a = c25_dyb_y; c25_syb_b = c25_xpb_x; c25_eyb_y = c25_bo_a * c25_syb_b; c25_ypb_x = c25_theta_5; c25_aqb_x = c25_ypb_x; c25_aqb_x = muDoubleScalarCos(c25_aqb_x); c25_co_a = c25_eyb_y; c25_tyb_b = c25_aqb_x; c25_fyb_y = c25_co_a * c25_tyb_b; c25_uyb_b = c25_dq2; c25_gyb_y = 0.063140533 * c25_uyb_b; c25_bqb_x = c25_theta_3; c25_cqb_x = c25_bqb_x; c25_cqb_x = muDoubleScalarSin(c25_cqb_x); c25_do_a = c25_gyb_y; c25_vyb_b = c25_cqb_x; c25_hyb_y = c25_do_a * c25_vyb_b; c25_dqb_x = c25_theta_4; c25_eqb_x = c25_dqb_x; c25_eqb_x = muDoubleScalarSin(c25_eqb_x); c25_eo_a = c25_hyb_y; c25_wyb_b = c25_eqb_x; c25_iyb_y = c25_eo_a * c25_wyb_b; c25_xyb_b = c25_dq3; c25_jyb_y = 0.063140533 * c25_xyb_b; c25_fqb_x = c25_theta_3; c25_gqb_x = c25_fqb_x; c25_gqb_x = muDoubleScalarSin(c25_gqb_x); c25_fo_a = c25_jyb_y; c25_yyb_b = c25_gqb_x; c25_kyb_y = c25_fo_a * c25_yyb_b; c25_hqb_x = c25_theta_4; c25_iqb_x = c25_hqb_x; c25_iqb_x = muDoubleScalarSin(c25_iqb_x); c25_go_a = c25_kyb_y; c25_aac_b = c25_iqb_x; c25_lyb_y = c25_go_a * c25_aac_b; c25_bac_b = c25_dq2; c25_myb_y = 0.013777622336877 * c25_bac_b; c25_jqb_x = c25_theta_4; c25_kqb_x = c25_jqb_x; c25_kqb_x = muDoubleScalarSin(c25_kqb_x); c25_ho_a = c25_myb_y; c25_cac_b = c25_kqb_x; c25_nyb_y = c25_ho_a * c25_cac_b; c25_lqb_x = c25_theta_5; c25_mqb_x = c25_lqb_x; c25_mqb_x = muDoubleScalarSin(c25_mqb_x); c25_io_a = c25_nyb_y; c25_dac_b = c25_mqb_x; c25_oyb_y = c25_io_a * c25_dac_b; c25_eac_b = c25_dq4; c25_pyb_y = 0.063140533 * c25_eac_b; c25_nqb_x = c25_theta_3; c25_oqb_x = c25_nqb_x; c25_oqb_x = muDoubleScalarSin(c25_oqb_x); c25_jo_a = c25_pyb_y; c25_fac_b = c25_oqb_x; c25_qyb_y = c25_jo_a * c25_fac_b; c25_pqb_x = c25_theta_4; c25_qqb_x = c25_pqb_x; c25_qqb_x = muDoubleScalarSin(c25_qqb_x); c25_ko_a = c25_qyb_y; c25_gac_b = c25_qqb_x; c25_ryb_y = c25_ko_a * c25_gac_b; c25_hac_b = c25_dq3; c25_syb_y = 0.013777622336877 * c25_hac_b; c25_rqb_x = c25_theta_4; c25_sqb_x = c25_rqb_x; c25_sqb_x = muDoubleScalarSin(c25_sqb_x); c25_lo_a = c25_syb_y; c25_iac_b = c25_sqb_x; c25_tyb_y = c25_lo_a * c25_iac_b; c25_tqb_x = c25_theta_5; c25_uqb_x = c25_tqb_x; c25_uqb_x = muDoubleScalarSin(c25_uqb_x); c25_mo_a = c25_tyb_y; c25_jac_b = c25_uqb_x; c25_uyb_y = c25_mo_a * c25_jac_b; c25_kac_b = c25_dq4; c25_vyb_y = 0.013777622336877 * c25_kac_b; c25_vqb_x = c25_theta_4; c25_wqb_x = c25_vqb_x; c25_wqb_x = muDoubleScalarSin(c25_wqb_x); c25_no_a = c25_vyb_y; c25_lac_b = c25_wqb_x; c25_wyb_y = c25_no_a * c25_lac_b; c25_xqb_x = c25_theta_5; c25_yqb_x = c25_xqb_x; c25_yqb_x = muDoubleScalarSin(c25_yqb_x); c25_oo_a = c25_wyb_y; c25_mac_b = c25_yqb_x; c25_xyb_y = c25_oo_a * c25_mac_b; c25_nac_b = c25_dq5; c25_yyb_y = 0.0149211056575 * c25_nac_b; c25_arb_x = c25_theta_3; c25_brb_x = c25_arb_x; c25_brb_x = muDoubleScalarCos(c25_brb_x); c25_po_a = c25_yyb_y; c25_oac_b = c25_brb_x; c25_aac_y = c25_po_a * c25_oac_b; c25_crb_x = c25_theta_4; c25_drb_x = c25_crb_x; c25_drb_x = muDoubleScalarCos(c25_drb_x); c25_qo_a = c25_aac_y; c25_pac_b = c25_drb_x; c25_bac_y = c25_qo_a * c25_pac_b; c25_erb_x = c25_theta_5; c25_frb_x = c25_erb_x; c25_frb_x = muDoubleScalarCos(c25_frb_x); c25_ro_a = c25_bac_y; c25_qac_b = c25_frb_x; c25_cac_y = c25_ro_a * c25_qac_b; c25_rac_b = c25_dq2; c25_dac_y = 0.0149211056575 * c25_rac_b; c25_grb_x = c25_theta_3; c25_hrb_x = c25_grb_x; c25_hrb_x = muDoubleScalarCos(c25_hrb_x); c25_so_a = c25_dac_y; c25_sac_b = c25_hrb_x; c25_eac_y = c25_so_a * c25_sac_b; c25_irb_x = c25_theta_4; c25_jrb_x = c25_irb_x; c25_jrb_x = muDoubleScalarSin(c25_jrb_x); c25_to_a = c25_eac_y; c25_tac_b = c25_jrb_x; c25_fac_y = c25_to_a * c25_tac_b; c25_krb_x = c25_theta_5; c25_lrb_x = c25_krb_x; c25_lrb_x = muDoubleScalarSin(c25_lrb_x); c25_uo_a = c25_fac_y; c25_uac_b = c25_lrb_x; c25_gac_y = c25_uo_a * c25_uac_b; c25_vac_b = c25_dq2; c25_hac_y = 0.0149211056575 * c25_vac_b; c25_mrb_x = c25_theta_4; c25_nrb_x = c25_mrb_x; c25_nrb_x = muDoubleScalarCos(c25_nrb_x); c25_vo_a = c25_hac_y; c25_wac_b = c25_nrb_x; c25_iac_y = c25_vo_a * c25_wac_b; c25_orb_x = c25_theta_3; c25_prb_x = c25_orb_x; c25_prb_x = muDoubleScalarSin(c25_prb_x); c25_wo_a = c25_iac_y; c25_xac_b = c25_prb_x; c25_jac_y = c25_wo_a * c25_xac_b; c25_qrb_x = c25_theta_5; c25_rrb_x = c25_qrb_x; c25_rrb_x = muDoubleScalarSin(c25_rrb_x); c25_xo_a = c25_jac_y; c25_yac_b = c25_rrb_x; c25_kac_y = c25_xo_a * c25_yac_b; c25_abc_b = c25_dq3; c25_lac_y = 0.0149211056575 * c25_abc_b; c25_srb_x = c25_theta_3; c25_trb_x = c25_srb_x; c25_trb_x = muDoubleScalarCos(c25_trb_x); c25_yo_a = c25_lac_y; c25_bbc_b = c25_trb_x; c25_mac_y = c25_yo_a * c25_bbc_b; c25_urb_x = c25_theta_4; c25_vrb_x = c25_urb_x; c25_vrb_x = muDoubleScalarSin(c25_vrb_x); c25_ap_a = c25_mac_y; c25_cbc_b = c25_vrb_x; c25_nac_y = c25_ap_a * c25_cbc_b; c25_wrb_x = c25_theta_5; c25_xrb_x = c25_wrb_x; c25_xrb_x = muDoubleScalarSin(c25_xrb_x); c25_bp_a = c25_nac_y; c25_dbc_b = c25_xrb_x; c25_oac_y = c25_bp_a * c25_dbc_b; c25_ebc_b = c25_dq3; c25_pac_y = 0.0149211056575 * c25_ebc_b; c25_yrb_x = c25_theta_4; c25_asb_x = c25_yrb_x; c25_asb_x = muDoubleScalarCos(c25_asb_x); c25_cp_a = c25_pac_y; c25_fbc_b = c25_asb_x; c25_qac_y = c25_cp_a * c25_fbc_b; c25_bsb_x = c25_theta_3; c25_csb_x = c25_bsb_x; c25_csb_x = muDoubleScalarSin(c25_csb_x); c25_dp_a = c25_qac_y; c25_gbc_b = c25_csb_x; c25_rac_y = c25_dp_a * c25_gbc_b; c25_dsb_x = c25_theta_5; c25_esb_x = c25_dsb_x; c25_esb_x = muDoubleScalarSin(c25_esb_x); c25_ep_a = c25_rac_y; c25_hbc_b = c25_esb_x; c25_sac_y = c25_ep_a * c25_hbc_b; c25_ibc_b = c25_dq4; c25_tac_y = 0.0149211056575 * c25_ibc_b; c25_fsb_x = c25_theta_3; c25_gsb_x = c25_fsb_x; c25_gsb_x = muDoubleScalarCos(c25_gsb_x); c25_fp_a = c25_tac_y; c25_jbc_b = c25_gsb_x; c25_uac_y = c25_fp_a * c25_jbc_b; c25_hsb_x = c25_theta_4; c25_isb_x = c25_hsb_x; c25_isb_x = muDoubleScalarSin(c25_isb_x); c25_gp_a = c25_uac_y; c25_kbc_b = c25_isb_x; c25_vac_y = c25_gp_a * c25_kbc_b; c25_jsb_x = c25_theta_5; c25_ksb_x = c25_jsb_x; c25_ksb_x = muDoubleScalarSin(c25_ksb_x); c25_hp_a = c25_vac_y; c25_lbc_b = c25_ksb_x; c25_wac_y = c25_hp_a * c25_lbc_b; c25_mbc_b = c25_dq4; c25_xac_y = 0.0149211056575 * c25_mbc_b; c25_lsb_x = c25_theta_4; c25_msb_x = c25_lsb_x; c25_msb_x = muDoubleScalarCos(c25_msb_x); c25_ip_a = c25_xac_y; c25_nbc_b = c25_msb_x; c25_yac_y = c25_ip_a * c25_nbc_b; c25_nsb_x = c25_theta_3; c25_osb_x = c25_nsb_x; c25_osb_x = muDoubleScalarSin(c25_osb_x); c25_jp_a = c25_yac_y; c25_obc_b = c25_osb_x; c25_abc_y = c25_jp_a * c25_obc_b; c25_psb_x = c25_theta_5; c25_qsb_x = c25_psb_x; c25_qsb_x = muDoubleScalarSin(c25_qsb_x); c25_kp_a = c25_abc_y; c25_pbc_b = c25_qsb_x; c25_bbc_y = c25_kp_a * c25_pbc_b; c25_qbc_b = c25_dq5; c25_cbc_y = 0.0149211056575 * c25_qbc_b; c25_rsb_x = c25_theta_5; c25_ssb_x = c25_rsb_x; c25_ssb_x = muDoubleScalarCos(c25_ssb_x); c25_lp_a = c25_cbc_y; c25_rbc_b = c25_ssb_x; c25_dbc_y = c25_lp_a * c25_rbc_b; c25_tsb_x = c25_theta_3; c25_usb_x = c25_tsb_x; c25_usb_x = muDoubleScalarSin(c25_usb_x); c25_mp_a = c25_dbc_y; c25_sbc_b = c25_usb_x; c25_ebc_y = c25_mp_a * c25_sbc_b; c25_vsb_x = c25_theta_4; c25_wsb_x = c25_vsb_x; c25_wsb_x = muDoubleScalarSin(c25_wsb_x); c25_np_a = c25_ebc_y; c25_tbc_b = c25_wsb_x; c25_fbc_y = c25_np_a * c25_tbc_b; c25_c24 = ((((((((((((((((((((c25_mxb_y - c25_oxb_y) - c25_qxb_y) - c25_sxb_y) - c25_vxb_y) - c25_yxb_y) - c25_cyb_y) + c25_fyb_y) + c25_iyb_y) + c25_lyb_y) - c25_oyb_y) + c25_ryb_y) - c25_uyb_y) - c25_xyb_y) + c25_cac_y) - c25_gac_y) - c25_kac_y) - c25_oac_y) - c25_sac_y) - c25_wac_y) - c25_bbc_y) - c25_fbc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 72); c25_ubc_b = c25_dq1; c25_gbc_y = 0.00045080006724164168 * c25_ubc_b; c25_vbc_b = c25_theta_5; c25_hbc_y = 2.0 * c25_vbc_b; c25_xsb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_hbc_y; c25_ysb_x = c25_xsb_x; c25_ysb_x = muDoubleScalarSin(c25_ysb_x); c25_op_a = c25_gbc_y; c25_wbc_b = c25_ysb_x; c25_ibc_y = c25_op_a * c25_wbc_b; c25_xbc_b = c25_dq2; c25_jbc_y = 0.00090160013448328346 * c25_xbc_b; c25_ybc_b = c25_theta_5; c25_kbc_y = 2.0 * c25_ybc_b; c25_atb_x = c25_kbc_y; c25_btb_x = c25_atb_x; c25_btb_x = muDoubleScalarSin(c25_btb_x); c25_pp_a = c25_jbc_y; c25_acc_b = c25_btb_x; c25_lbc_y = c25_pp_a * c25_acc_b; c25_bcc_b = c25_dq3; c25_mbc_y = 0.00090160013448328346 * c25_bcc_b; c25_ccc_b = c25_theta_5; c25_nbc_y = 2.0 * c25_ccc_b; c25_ctb_x = c25_nbc_y; c25_dtb_x = c25_ctb_x; c25_dtb_x = muDoubleScalarSin(c25_dtb_x); c25_qp_a = c25_mbc_y; c25_dcc_b = c25_dtb_x; c25_obc_y = c25_qp_a * c25_dcc_b; c25_ecc_b = c25_dq4; c25_pbc_y = 0.00090160013448328346 * c25_ecc_b; c25_fcc_b = c25_theta_5; c25_qbc_y = 2.0 * c25_fcc_b; c25_etb_x = c25_qbc_y; c25_ftb_x = c25_etb_x; c25_ftb_x = muDoubleScalarSin(c25_ftb_x); c25_rp_a = c25_pbc_y; c25_gcc_b = c25_ftb_x; c25_rbc_y = c25_rp_a * c25_gcc_b; c25_hcc_b = c25_dq1; c25_sbc_y = 0.0068888111684385 * c25_hcc_b; c25_icc_b = c25_theta_5; c25_tbc_y = c25_icc_b; c25_gtb_x = (c25_tbc_y - c25_theta_3) - c25_theta_2; c25_htb_x = c25_gtb_x; c25_htb_x = muDoubleScalarCos(c25_htb_x); c25_sp_a = c25_sbc_y; c25_jcc_b = c25_htb_x; c25_ubc_y = c25_sp_a * c25_jcc_b; c25_kcc_b = c25_dq1; c25_vbc_y = 0.00045080006724164168 * c25_kcc_b; c25_lcc_b = c25_theta_5; c25_wbc_y = 2.0 * c25_lcc_b; c25_mcc_b = c25_theta_3; c25_xbc_y = c25_mcc_b; c25_ncc_b = c25_theta_4; c25_ybc_y = c25_ncc_b; c25_occ_b = c25_theta_2; c25_acc_y = c25_occ_b; c25_itb_x = ((c25_wbc_y - c25_xbc_y) - c25_ybc_y) - c25_acc_y; c25_jtb_x = c25_itb_x; c25_jtb_x = muDoubleScalarSin(c25_jtb_x); c25_tp_a = c25_vbc_y; c25_pcc_b = c25_jtb_x; c25_bcc_y = c25_tp_a * c25_pcc_b; c25_qcc_b = c25_dq1; c25_ccc_y = 0.0016146178873500002 * c25_qcc_b; c25_ktb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ltb_x = c25_ktb_x; c25_ltb_x = muDoubleScalarSin(c25_ltb_x); c25_up_a = c25_ccc_y; c25_rcc_b = c25_ltb_x; c25_dcc_y = c25_up_a * c25_rcc_b; c25_scc_b = c25_dq1; c25_ecc_y = 0.00746055282875 * c25_scc_b; c25_mtb_x = c25_theta_2 + c25_theta_5; c25_ntb_x = c25_mtb_x; c25_ntb_x = muDoubleScalarCos(c25_ntb_x); c25_vp_a = c25_ecc_y; c25_tcc_b = c25_ntb_x; c25_fcc_y = c25_vp_a * c25_tcc_b; c25_ucc_b = c25_dq1; c25_gcc_y = 0.00746055282875 * c25_ucc_b; c25_vcc_b = c25_theta_5; c25_hcc_y = c25_vcc_b; c25_otb_x = c25_theta_2 - c25_hcc_y; c25_ptb_x = c25_otb_x; c25_ptb_x = muDoubleScalarCos(c25_ptb_x); c25_wp_a = c25_gcc_y; c25_wcc_b = c25_ptb_x; c25_icc_y = c25_wp_a * c25_wcc_b; c25_xcc_b = c25_dq5; c25_jcc_y = 0.0032292357747 * c25_xcc_b; c25_qtb_x = c25_theta_5; c25_rtb_x = c25_qtb_x; c25_rtb_x = muDoubleScalarSin(c25_rtb_x); c25_xp_a = c25_jcc_y; c25_ycc_b = c25_rtb_x; c25_kcc_y = c25_xp_a * c25_ycc_b; c25_adc_b = c25_dq6; c25_lcc_y = 6.9267456E-5 * c25_adc_b; c25_stb_x = c25_theta_5; c25_ttb_x = c25_stb_x; c25_ttb_x = muDoubleScalarSin(c25_ttb_x); c25_yp_a = c25_lcc_y; c25_bdc_b = c25_ttb_x; c25_mcc_y = c25_yp_a * c25_bdc_b; c25_cdc_b = c25_dq1; c25_ncc_y = 0.0016146178873500002 * c25_cdc_b; c25_ddc_b = c25_theta_3; c25_occ_y = c25_ddc_b; c25_edc_b = c25_theta_4; c25_pcc_y = c25_edc_b; c25_fdc_b = c25_theta_2; c25_qcc_y = c25_fdc_b; c25_utb_x = ((c25_theta_5 - c25_occ_y) - c25_pcc_y) - c25_qcc_y; c25_vtb_x = c25_utb_x; c25_vtb_x = muDoubleScalarSin(c25_vtb_x); c25_aq_a = c25_ncc_y; c25_gdc_b = c25_vtb_x; c25_rcc_y = c25_aq_a * c25_gdc_b; c25_hdc_b = c25_dq1; c25_scc_y = 0.0068888111684385 * c25_hdc_b; c25_wtb_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_xtb_x = c25_wtb_x; c25_xtb_x = muDoubleScalarCos(c25_xtb_x); c25_bq_a = c25_scc_y; c25_idc_b = c25_xtb_x; c25_tcc_y = c25_bq_a * c25_idc_b; c25_jdc_b = c25_dq1; c25_ucc_y = 0.0014202397504832836 * c25_jdc_b; c25_ytb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_aub_x = c25_ytb_x; c25_aub_x = muDoubleScalarSin(c25_aub_x); c25_cq_a = c25_ucc_y; c25_kdc_b = c25_aub_x; c25_vcc_y = c25_cq_a * c25_kdc_b; c25_ldc_b = c25_dq2; c25_wcc_y = 0.0149211056575 * c25_ldc_b; c25_bub_x = c25_theta_3 + c25_theta_4; c25_cub_x = c25_bub_x; c25_cub_x = muDoubleScalarCos(c25_cub_x); c25_dq_a = c25_wcc_y; c25_mdc_b = c25_cub_x; c25_xcc_y = c25_dq_a * c25_mdc_b; c25_dub_x = c25_theta_5; c25_eub_x = c25_dub_x; c25_eub_x = muDoubleScalarCos(c25_eub_x); c25_eq_a = c25_xcc_y; c25_ndc_b = c25_eub_x; c25_ycc_y = c25_eq_a * c25_ndc_b; c25_odc_b = c25_dq3; c25_adc_y = 0.0149211056575 * c25_odc_b; c25_fub_x = c25_theta_3 + c25_theta_4; c25_gub_x = c25_fub_x; c25_gub_x = muDoubleScalarCos(c25_gub_x); c25_fq_a = c25_adc_y; c25_pdc_b = c25_gub_x; c25_bdc_y = c25_fq_a * c25_pdc_b; c25_hub_x = c25_theta_5; c25_iub_x = c25_hub_x; c25_iub_x = muDoubleScalarCos(c25_iub_x); c25_gq_a = c25_bdc_y; c25_qdc_b = c25_iub_x; c25_cdc_y = c25_gq_a * c25_qdc_b; c25_rdc_b = c25_dq4; c25_ddc_y = 0.0149211056575 * c25_rdc_b; c25_jub_x = c25_theta_3 + c25_theta_4; c25_kub_x = c25_jub_x; c25_kub_x = muDoubleScalarCos(c25_kub_x); c25_hq_a = c25_ddc_y; c25_sdc_b = c25_kub_x; c25_edc_y = c25_hq_a * c25_sdc_b; c25_lub_x = c25_theta_5; c25_mub_x = c25_lub_x; c25_mub_x = muDoubleScalarCos(c25_mub_x); c25_iq_a = c25_edc_y; c25_tdc_b = c25_mub_x; c25_fdc_y = c25_iq_a * c25_tdc_b; c25_udc_b = c25_dq5; c25_gdc_y = 0.0149211056575 * c25_udc_b; c25_nub_x = c25_theta_3 + c25_theta_4; c25_oub_x = c25_nub_x; c25_oub_x = muDoubleScalarSin(c25_oub_x); c25_jq_a = c25_gdc_y; c25_vdc_b = c25_oub_x; c25_hdc_y = c25_jq_a * c25_vdc_b; c25_pub_x = c25_theta_5; c25_qub_x = c25_pub_x; c25_qub_x = muDoubleScalarSin(c25_qub_x); c25_kq_a = c25_hdc_y; c25_wdc_b = c25_qub_x; c25_idc_y = c25_kq_a * c25_wdc_b; c25_xdc_b = c25_dq2; c25_jdc_y = 0.013777622336877 * c25_xdc_b; c25_rub_x = c25_theta_4; c25_sub_x = c25_rub_x; c25_sub_x = muDoubleScalarCos(c25_sub_x); c25_lq_a = c25_jdc_y; c25_ydc_b = c25_sub_x; c25_kdc_y = c25_lq_a * c25_ydc_b; c25_tub_x = c25_theta_5; c25_uub_x = c25_tub_x; c25_uub_x = muDoubleScalarCos(c25_uub_x); c25_mq_a = c25_kdc_y; c25_aec_b = c25_uub_x; c25_ldc_y = c25_mq_a * c25_aec_b; c25_bec_b = c25_dq3; c25_mdc_y = 0.013777622336877 * c25_bec_b; c25_vub_x = c25_theta_4; c25_wub_x = c25_vub_x; c25_wub_x = muDoubleScalarCos(c25_wub_x); c25_nq_a = c25_mdc_y; c25_cec_b = c25_wub_x; c25_ndc_y = c25_nq_a * c25_cec_b; c25_xub_x = c25_theta_5; c25_yub_x = c25_xub_x; c25_yub_x = muDoubleScalarCos(c25_yub_x); c25_oq_a = c25_ndc_y; c25_dec_b = c25_yub_x; c25_odc_y = c25_oq_a * c25_dec_b; c25_eec_b = c25_dq4; c25_pdc_y = 0.013777622336877 * c25_eec_b; c25_avb_x = c25_theta_4; c25_bvb_x = c25_avb_x; c25_bvb_x = muDoubleScalarCos(c25_bvb_x); c25_pq_a = c25_pdc_y; c25_fec_b = c25_bvb_x; c25_qdc_y = c25_pq_a * c25_fec_b; c25_cvb_x = c25_theta_5; c25_dvb_x = c25_cvb_x; c25_dvb_x = muDoubleScalarCos(c25_dvb_x); c25_qq_a = c25_qdc_y; c25_gec_b = c25_dvb_x; c25_rdc_y = c25_qq_a * c25_gec_b; c25_hec_b = c25_dq5; c25_sdc_y = 0.013777622336877 * c25_hec_b; c25_evb_x = c25_theta_4; c25_fvb_x = c25_evb_x; c25_fvb_x = muDoubleScalarSin(c25_fvb_x); c25_rq_a = c25_sdc_y; c25_iec_b = c25_fvb_x; c25_tdc_y = c25_rq_a * c25_iec_b; c25_gvb_x = c25_theta_5; c25_hvb_x = c25_gvb_x; c25_hvb_x = muDoubleScalarSin(c25_hvb_x); c25_sq_a = c25_tdc_y; c25_jec_b = c25_hvb_x; c25_udc_y = c25_sq_a * c25_jec_b; c25_c25 = ((((((((((((((((((((c25_ibc_y + c25_lbc_y) + c25_obc_y) + c25_rbc_y) - c25_ubc_y) - c25_bcc_y) - c25_dcc_y) + c25_fcc_y) - c25_icc_y) + c25_kcc_y) - c25_mcc_y) - c25_rcc_y) + c25_tcc_y) - c25_vcc_y) + c25_ycc_y) + c25_cdc_y) + c25_fdc_y) - c25_idc_y) + c25_ldc_y) + c25_odc_y) + c25_rdc_y) - c25_udc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 73); c25_ivb_x = c25_theta_5; c25_jvb_x = c25_ivb_x; c25_jvb_x = muDoubleScalarSin(c25_jvb_x); c25_kec_b = c25_dq5; c25_vdc_y = 6.9267456E-5 * c25_kec_b; c25_lec_b = c25_dq1; c25_wdc_y = 6.9267456E-5 * c25_lec_b; c25_kvb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_lvb_x = c25_kvb_x; c25_lvb_x = muDoubleScalarCos(c25_lvb_x); c25_tq_a = c25_wdc_y; c25_mec_b = c25_lvb_x; c25_xdc_y = c25_tq_a * c25_mec_b; c25_uq_a = -c25_jvb_x; c25_nec_b = c25_vdc_y - c25_xdc_y; c25_c26 = c25_uq_a * c25_nec_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 74); c25_oec_b = c25_dq5; c25_ydc_y = 0.00045080006724164168 * c25_oec_b; c25_pec_b = c25_theta_5; c25_aec_y = 2.0 * c25_pec_b; c25_mvb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_aec_y; c25_nvb_x = c25_mvb_x; c25_nvb_x = muDoubleScalarSin(c25_nvb_x); c25_vq_a = c25_ydc_y; c25_qec_b = c25_nvb_x; c25_bec_y = c25_vq_a * c25_qec_b; c25_rec_b = c25_dq1; c25_cec_y = 0.003730276414375 * c25_rec_b; c25_sec_b = c25_theta_2; c25_dec_y = 2.0 * c25_sec_b; c25_tec_b = c25_theta_5; c25_eec_y = c25_tec_b; c25_ovb_x = ((c25_dec_y + c25_theta_3) + c25_theta_4) - c25_eec_y; c25_pvb_x = c25_ovb_x; c25_pvb_x = muDoubleScalarCos(c25_pvb_x); c25_wq_a = c25_cec_y; c25_uec_b = c25_pvb_x; c25_fec_y = c25_wq_a * c25_uec_b; c25_vec_b = c25_dq1; c25_gec_y = 0.3507141303625 * c25_vec_b; c25_wec_b = c25_theta_2; c25_hec_y = 2.0 * c25_wec_b; c25_qvb_x = c25_hec_y + c25_theta_3; c25_rvb_x = c25_qvb_x; c25_rvb_x = muDoubleScalarSin(c25_rvb_x); c25_xq_a = c25_gec_y; c25_xec_b = c25_rvb_x; c25_iec_y = c25_xq_a * c25_xec_b; c25_yec_b = c25_dq1; c25_jec_y = 0.0583017396828 * c25_yec_b; c25_afc_b = c25_theta_2; c25_kec_y = 2.0 * c25_afc_b; c25_bfc_b = c25_theta_3; c25_lec_y = 2.0 * c25_bfc_b; c25_svb_x = (c25_kec_y + c25_lec_y) + c25_theta_4; c25_tvb_x = c25_svb_x; c25_tvb_x = muDoubleScalarCos(c25_tvb_x); c25_yq_a = c25_jec_y; c25_cfc_b = c25_tvb_x; c25_mec_y = c25_yq_a * c25_cfc_b; c25_dfc_b = c25_dq5; c25_nec_y = 0.00045080006724164168 * c25_dfc_b; c25_efc_b = c25_theta_5; c25_oec_y = 2.0 * c25_efc_b; c25_uvb_x = ((c25_oec_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_vvb_x = c25_uvb_x; c25_vvb_x = muDoubleScalarSin(c25_vvb_x); c25_ar_a = c25_nec_y; c25_ffc_b = c25_vvb_x; c25_pec_y = c25_ar_a * c25_ffc_b; c25_gfc_b = c25_dq1; c25_qec_y = 0.003730276414375 * c25_gfc_b; c25_wvb_x = (c25_theta_3 + c25_theta_4) - c25_theta_5; c25_xvb_x = c25_wvb_x; c25_xvb_x = muDoubleScalarCos(c25_xvb_x); c25_br_a = c25_qec_y; c25_hfc_b = c25_xvb_x; c25_rec_y = c25_br_a * c25_hfc_b; c25_ifc_b = c25_dq5; c25_sec_y = 0.0068888111684385 * c25_ifc_b; c25_yvb_x = (c25_theta_2 + c25_theta_3) - c25_theta_5; c25_awb_x = c25_yvb_x; c25_awb_x = muDoubleScalarCos(c25_awb_x); c25_cr_a = c25_sec_y; c25_jfc_b = c25_awb_x; c25_tec_y = c25_cr_a * c25_jfc_b; c25_kfc_b = c25_dq1; c25_uec_y = 0.00161461788735 * c25_kfc_b; c25_lfc_b = c25_theta_2; c25_vec_y = 2.0 * c25_lfc_b; c25_mfc_b = c25_theta_3; c25_wec_y = 2.0 * c25_mfc_b; c25_nfc_b = c25_theta_4; c25_xec_y = 2.0 * c25_nfc_b; c25_bwb_x = ((c25_vec_y + c25_wec_y) + c25_xec_y) + c25_theta_5; c25_cwb_x = c25_bwb_x; c25_cwb_x = muDoubleScalarSin(c25_cwb_x); c25_dr_a = c25_uec_y; c25_ofc_b = c25_cwb_x; c25_yec_y = c25_dr_a * c25_ofc_b; c25_pfc_b = c25_dq1; c25_afc_y = 0.00161461788735 * c25_pfc_b; c25_qfc_b = c25_theta_2; c25_bfc_y = 2.0 * c25_qfc_b; c25_rfc_b = c25_theta_3; c25_cfc_y = 2.0 * c25_rfc_b; c25_sfc_b = c25_theta_4; c25_dfc_y = 2.0 * c25_sfc_b; c25_tfc_b = c25_theta_5; c25_efc_y = c25_tfc_b; c25_dwb_x = ((c25_bfc_y + c25_cfc_y) + c25_dfc_y) - c25_efc_y; c25_ewb_x = c25_dwb_x; c25_ewb_x = muDoubleScalarSin(c25_ewb_x); c25_er_a = c25_afc_y; c25_ufc_b = c25_ewb_x; c25_ffc_y = c25_er_a * c25_ufc_b; c25_vfc_b = c25_dq1; c25_gfc_y = 0.00022540003362082084 * c25_vfc_b; c25_wfc_b = c25_theta_2; c25_hfc_y = 2.0 * c25_wfc_b; c25_xfc_b = c25_theta_3; c25_ifc_y = 2.0 * c25_xfc_b; c25_yfc_b = c25_theta_4; c25_jfc_y = 2.0 * c25_yfc_b; c25_agc_b = c25_theta_5; c25_kfc_y = 2.0 * c25_agc_b; c25_fwb_x = ((c25_hfc_y + c25_ifc_y) + c25_jfc_y) - c25_kfc_y; c25_gwb_x = c25_fwb_x; c25_gwb_x = muDoubleScalarSin(c25_gwb_x); c25_fr_a = c25_gfc_y; c25_bgc_b = c25_gwb_x; c25_lfc_y = c25_fr_a * c25_bgc_b; c25_cgc_b = c25_dq5; c25_mfc_y = 0.0016146178873500002 * c25_cgc_b; c25_hwb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_iwb_x = c25_hwb_x; c25_iwb_x = muDoubleScalarSin(c25_iwb_x); c25_gr_a = c25_mfc_y; c25_dgc_b = c25_iwb_x; c25_nfc_y = c25_gr_a * c25_dgc_b; c25_egc_b = c25_dq6; c25_ofc_y = 3.4633728E-5 * c25_egc_b; c25_jwb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_kwb_x = c25_jwb_x; c25_kwb_x = muDoubleScalarSin(c25_kwb_x); c25_hr_a = c25_ofc_y; c25_fgc_b = c25_kwb_x; c25_pfc_y = c25_hr_a * c25_fgc_b; c25_ggc_b = c25_dq1; c25_qfc_y = 0.0315702665 * c25_ggc_b; c25_lwb_x = c25_theta_3 + c25_theta_4; c25_mwb_x = c25_lwb_x; c25_mwb_x = muDoubleScalarCos(c25_mwb_x); c25_ir_a = c25_qfc_y; c25_hgc_b = c25_mwb_x; c25_rfc_y = c25_ir_a * c25_hgc_b; c25_igc_b = c25_dq1; c25_sfc_y = 0.0315702665 * c25_igc_b; c25_jgc_b = c25_theta_2; c25_tfc_y = 2.0 * c25_jgc_b; c25_nwb_x = (c25_tfc_y + c25_theta_3) + c25_theta_4; c25_owb_x = c25_nwb_x; c25_owb_x = muDoubleScalarCos(c25_owb_x); c25_jr_a = c25_sfc_y; c25_kgc_b = c25_owb_x; c25_ufc_y = c25_jr_a * c25_kgc_b; c25_lgc_b = c25_dq1; c25_vfc_y = 0.0068888111684385 * c25_lgc_b; c25_mgc_b = c25_theta_2; c25_wfc_y = 2.0 * c25_mgc_b; c25_ngc_b = c25_theta_3; c25_xfc_y = 2.0 * c25_ngc_b; c25_pwb_x = ((c25_wfc_y + c25_xfc_y) + c25_theta_4) + c25_theta_5; c25_qwb_x = c25_pwb_x; c25_qwb_x = muDoubleScalarCos(c25_qwb_x); c25_kr_a = c25_vfc_y; c25_ogc_b = c25_qwb_x; c25_yfc_y = c25_kr_a * c25_ogc_b; c25_pgc_b = c25_dq1; c25_agc_y = 0.3507141303625 * c25_pgc_b; c25_rwb_x = c25_theta_3; c25_swb_x = c25_rwb_x; c25_swb_x = muDoubleScalarSin(c25_swb_x); c25_lr_a = c25_agc_y; c25_qgc_b = c25_swb_x; c25_bgc_y = c25_lr_a * c25_qgc_b; c25_rgc_b = c25_dq1; c25_cgc_y = 0.0068888111684385 * c25_rgc_b; c25_sgc_b = c25_theta_2; c25_dgc_y = 2.0 * c25_sgc_b; c25_tgc_b = c25_theta_3; c25_egc_y = 2.0 * c25_tgc_b; c25_ugc_b = c25_theta_5; c25_fgc_y = c25_ugc_b; c25_twb_x = ((c25_dgc_y + c25_egc_y) + c25_theta_4) - c25_fgc_y; c25_uwb_x = c25_twb_x; c25_uwb_x = muDoubleScalarCos(c25_uwb_x); c25_mr_a = c25_cgc_y; c25_vgc_b = c25_uwb_x; c25_ggc_y = c25_mr_a * c25_vgc_b; c25_wgc_b = c25_dq1; c25_hgc_y = 0.31297029415553834 * c25_wgc_b; c25_xgc_b = c25_theta_2; c25_igc_y = 2.0 * c25_xgc_b; c25_ygc_b = c25_theta_3; c25_jgc_y = 2.0 * c25_ygc_b; c25_vwb_x = c25_igc_y + c25_jgc_y; c25_wwb_x = c25_vwb_x; c25_wwb_x = muDoubleScalarSin(c25_wwb_x); c25_nr_a = c25_hgc_y; c25_ahc_b = c25_wwb_x; c25_kgc_y = c25_nr_a * c25_ahc_b; c25_bhc_b = c25_dq5; c25_lgc_y = 0.0016146178873500002 * c25_bhc_b; c25_xwb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_ywb_x = c25_xwb_x; c25_ywb_x = muDoubleScalarSin(c25_ywb_x); c25_or_a = c25_lgc_y; c25_chc_b = c25_ywb_x; c25_mgc_y = c25_or_a * c25_chc_b; c25_dhc_b = c25_dq6; c25_ngc_y = 3.4633728E-5 * c25_dhc_b; c25_axb_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_bxb_x = c25_axb_x; c25_bxb_x = muDoubleScalarSin(c25_bxb_x); c25_pr_a = c25_ngc_y; c25_ehc_b = c25_bxb_x; c25_ogc_y = c25_pr_a * c25_ehc_b; c25_fhc_b = c25_dq1; c25_pgc_y = 0.0057439079350250248 * c25_fhc_b; c25_ghc_b = c25_theta_2; c25_qgc_y = 2.0 * c25_ghc_b; c25_hhc_b = c25_theta_3; c25_rgc_y = 2.0 * c25_hhc_b; c25_ihc_b = c25_theta_4; c25_sgc_y = 2.0 * c25_ihc_b; c25_cxb_x = (c25_qgc_y + c25_rgc_y) + c25_sgc_y; c25_dxb_x = c25_cxb_x; c25_dxb_x = muDoubleScalarSin(c25_dxb_x); c25_qr_a = c25_pgc_y; c25_jhc_b = c25_dxb_x; c25_tgc_y = c25_qr_a * c25_jhc_b; c25_khc_b = c25_dq1; c25_ugc_y = 0.003730276414375 * c25_khc_b; c25_exb_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_fxb_x = c25_exb_x; c25_fxb_x = muDoubleScalarCos(c25_fxb_x); c25_rr_a = c25_ugc_y; c25_lhc_b = c25_fxb_x; c25_vgc_y = c25_rr_a * c25_lhc_b; c25_mhc_b = c25_dq5; c25_wgc_y = 0.0068888111684385 * c25_mhc_b; c25_gxb_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_hxb_x = c25_gxb_x; c25_hxb_x = muDoubleScalarCos(c25_hxb_x); c25_sr_a = c25_wgc_y; c25_nhc_b = c25_hxb_x; c25_xgc_y = c25_sr_a * c25_nhc_b; c25_ohc_b = c25_dq1; c25_ygc_y = 0.00022540003362082084 * c25_ohc_b; c25_phc_b = c25_theta_2; c25_ahc_y = 2.0 * c25_phc_b; c25_qhc_b = c25_theta_3; c25_bhc_y = 2.0 * c25_qhc_b; c25_rhc_b = c25_theta_4; c25_chc_y = 2.0 * c25_rhc_b; c25_shc_b = c25_theta_5; c25_dhc_y = 2.0 * c25_shc_b; c25_ixb_x = ((c25_ahc_y + c25_bhc_y) + c25_chc_y) + c25_dhc_y; c25_jxb_x = c25_ixb_x; c25_jxb_x = muDoubleScalarSin(c25_jxb_x); c25_tr_a = c25_ygc_y; c25_thc_b = c25_jxb_x; c25_ehc_y = c25_tr_a * c25_thc_b; c25_uhc_b = c25_dq5; c25_fhc_y = 0.0014202397504832836 * c25_uhc_b; c25_kxb_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_lxb_x = c25_kxb_x; c25_lxb_x = muDoubleScalarSin(c25_lxb_x); c25_ur_a = c25_fhc_y; c25_vhc_b = c25_lxb_x; c25_ghc_y = c25_ur_a * c25_vhc_b; c25_whc_b = c25_dq1; c25_hhc_y = 0.003730276414375 * c25_whc_b; c25_xhc_b = c25_theta_2; c25_ihc_y = 2.0 * c25_xhc_b; c25_mxb_x = ((c25_ihc_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_nxb_x = c25_mxb_x; c25_nxb_x = muDoubleScalarCos(c25_nxb_x); c25_vr_a = c25_hhc_y; c25_yhc_b = c25_nxb_x; c25_jhc_y = c25_vr_a * c25_yhc_b; c25_c31 = ((((((((((((((((((((((((c25_bec_y + c25_fec_y) + c25_iec_y) + c25_mec_y) - c25_pec_y) + c25_rec_y) - c25_tec_y) + c25_yec_y) - c25_ffc_y) - c25_lfc_y) - c25_nfc_y) + c25_pfc_y) + c25_rfc_y) + c25_ufc_y) - c25_yfc_y) + c25_bgc_y) + c25_ggc_y) + c25_kgc_y) + c25_mgc_y) - c25_ogc_y) - c25_tgc_y) - c25_vgc_y) + c25_xgc_y) - c25_ehc_y) - c25_ghc_y) - c25_jhc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 75); c25_aic_b = c25_dq5; c25_khc_y = 0.00090160013448328346 * c25_aic_b; c25_bic_b = c25_theta_5; c25_lhc_y = 2.0 * c25_bic_b; c25_oxb_x = c25_lhc_y; c25_pxb_x = c25_oxb_x; c25_pxb_x = muDoubleScalarSin(c25_pxb_x); c25_wr_a = c25_khc_y; c25_cic_b = c25_pxb_x; c25_mhc_y = c25_wr_a * c25_cic_b; c25_dic_b = c25_dq4; c25_nhc_y = 0.0583017396828 * c25_dic_b; c25_qxb_x = c25_theta_4; c25_rxb_x = c25_qxb_x; c25_rxb_x = muDoubleScalarCos(c25_rxb_x); c25_xr_a = c25_nhc_y; c25_eic_b = c25_rxb_x; c25_ohc_y = c25_xr_a * c25_eic_b; c25_fic_b = c25_dq2; c25_phc_y = 0.701428260725 * c25_fic_b; c25_sxb_x = c25_theta_3; c25_txb_x = c25_sxb_x; c25_txb_x = muDoubleScalarSin(c25_txb_x); c25_yr_a = c25_phc_y; c25_gic_b = c25_txb_x; c25_qhc_y = c25_yr_a * c25_gic_b; c25_hic_b = c25_dq2; c25_rhc_y = 0.063140533 * c25_hic_b; c25_uxb_x = c25_theta_3; c25_vxb_x = c25_uxb_x; c25_vxb_x = muDoubleScalarCos(c25_vxb_x); c25_as_a = c25_rhc_y; c25_iic_b = c25_vxb_x; c25_shc_y = c25_as_a * c25_iic_b; c25_wxb_x = c25_theta_4; c25_xxb_x = c25_wxb_x; c25_xxb_x = muDoubleScalarCos(c25_xxb_x); c25_bs_a = c25_shc_y; c25_jic_b = c25_xxb_x; c25_thc_y = c25_bs_a * c25_jic_b; c25_kic_b = c25_dq5; c25_uhc_y = 0.013777622336877 * c25_kic_b; c25_yxb_x = c25_theta_4; c25_ayb_x = c25_yxb_x; c25_ayb_x = muDoubleScalarCos(c25_ayb_x); c25_cs_a = c25_uhc_y; c25_lic_b = c25_ayb_x; c25_vhc_y = c25_cs_a * c25_lic_b; c25_byb_x = c25_theta_5; c25_cyb_x = c25_byb_x; c25_cyb_x = muDoubleScalarCos(c25_cyb_x); c25_ds_a = c25_vhc_y; c25_mic_b = c25_cyb_x; c25_whc_y = c25_ds_a * c25_mic_b; c25_nic_b = c25_dq2; c25_xhc_y = 0.063140533 * c25_nic_b; c25_dyb_x = c25_theta_3; c25_eyb_x = c25_dyb_x; c25_eyb_x = muDoubleScalarSin(c25_eyb_x); c25_es_a = c25_xhc_y; c25_oic_b = c25_eyb_x; c25_yhc_y = c25_es_a * c25_oic_b; c25_fyb_x = c25_theta_4; c25_gyb_x = c25_fyb_x; c25_gyb_x = muDoubleScalarSin(c25_gyb_x); c25_fs_a = c25_yhc_y; c25_pic_b = c25_gyb_x; c25_aic_y = c25_fs_a * c25_pic_b; c25_qic_b = c25_dq4; c25_bic_y = 0.013777622336877 * c25_qic_b; c25_hyb_x = c25_theta_4; c25_iyb_x = c25_hyb_x; c25_iyb_x = muDoubleScalarSin(c25_iyb_x); c25_gs_a = c25_bic_y; c25_ric_b = c25_iyb_x; c25_cic_y = c25_gs_a * c25_ric_b; c25_jyb_x = c25_theta_5; c25_kyb_x = c25_jyb_x; c25_kyb_x = muDoubleScalarSin(c25_kyb_x); c25_hs_a = c25_cic_y; c25_sic_b = c25_kyb_x; c25_dic_y = c25_hs_a * c25_sic_b; c25_tic_b = c25_dq2; c25_eic_y = 0.0149211056575 * c25_tic_b; c25_lyb_x = c25_theta_3; c25_myb_x = c25_lyb_x; c25_myb_x = muDoubleScalarCos(c25_myb_x); c25_is_a = c25_eic_y; c25_uic_b = c25_myb_x; c25_fic_y = c25_is_a * c25_uic_b; c25_nyb_x = c25_theta_4; c25_oyb_x = c25_nyb_x; c25_oyb_x = muDoubleScalarSin(c25_oyb_x); c25_js_a = c25_fic_y; c25_vic_b = c25_oyb_x; c25_gic_y = c25_js_a * c25_vic_b; c25_pyb_x = c25_theta_5; c25_qyb_x = c25_pyb_x; c25_qyb_x = muDoubleScalarSin(c25_qyb_x); c25_ks_a = c25_gic_y; c25_wic_b = c25_qyb_x; c25_hic_y = c25_ks_a * c25_wic_b; c25_xic_b = c25_dq2; c25_iic_y = 0.0149211056575 * c25_xic_b; c25_ryb_x = c25_theta_4; c25_syb_x = c25_ryb_x; c25_syb_x = muDoubleScalarCos(c25_syb_x); c25_ls_a = c25_iic_y; c25_yic_b = c25_syb_x; c25_jic_y = c25_ls_a * c25_yic_b; c25_tyb_x = c25_theta_3; c25_uyb_x = c25_tyb_x; c25_uyb_x = muDoubleScalarSin(c25_uyb_x); c25_ms_a = c25_jic_y; c25_ajc_b = c25_uyb_x; c25_kic_y = c25_ms_a * c25_ajc_b; c25_vyb_x = c25_theta_5; c25_wyb_x = c25_vyb_x; c25_wyb_x = muDoubleScalarSin(c25_wyb_x); c25_ns_a = c25_kic_y; c25_bjc_b = c25_wyb_x; c25_lic_y = c25_ns_a * c25_bjc_b; c25_cjc_b = c25_dq4; c25_mic_y = 1.0E-35 * c25_cjc_b; c25_xyb_x = c25_theta_3; c25_yyb_x = c25_xyb_x; c25_yyb_x = muDoubleScalarCos(c25_yyb_x); c25_os_a = c25_mic_y; c25_djc_b = c25_yyb_x; c25_nic_y = c25_os_a * c25_djc_b; c25_aac_x = c25_theta_4; c25_bac_x = c25_aac_x; c25_bac_x = muDoubleScalarSin(c25_bac_x); c25_ps_a = c25_nic_y; c25_ejc_b = c25_bac_x; c25_oic_y = c25_ps_a * c25_ejc_b; c25_cac_x = c25_theta_5; c25_dac_x = c25_cac_x; c25_dac_x = muDoubleScalarSin(c25_dac_x); c25_qs_a = c25_oic_y; c25_fjc_b = c25_dac_x; c25_pic_y = c25_qs_a * c25_fjc_b; c25_gjc_b = c25_dq4; c25_qic_y = 1.0E-35 * c25_gjc_b; c25_eac_x = c25_theta_4; c25_fac_x = c25_eac_x; c25_fac_x = muDoubleScalarCos(c25_fac_x); c25_rs_a = c25_qic_y; c25_hjc_b = c25_fac_x; c25_ric_y = c25_rs_a * c25_hjc_b; c25_gac_x = c25_theta_3; c25_hac_x = c25_gac_x; c25_hac_x = muDoubleScalarSin(c25_hac_x); c25_ss_a = c25_ric_y; c25_ijc_b = c25_hac_x; c25_sic_y = c25_ss_a * c25_ijc_b; c25_iac_x = c25_theta_5; c25_jac_x = c25_iac_x; c25_jac_x = muDoubleScalarSin(c25_jac_x); c25_ts_a = c25_sic_y; c25_jjc_b = c25_jac_x; c25_tic_y = c25_ts_a * c25_jjc_b; c25_c32 = (((((((((c25_mhc_y - c25_ohc_y) + c25_qhc_y) + c25_thc_y) + c25_whc_y) - c25_aic_y) - c25_dic_y) + c25_hic_y) + c25_lic_y) - c25_pic_y) - c25_tic_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 76); c25_kjc_b = c25_dq5; c25_uic_y = 0.5 * c25_kjc_b; c25_kac_x = c25_theta_5; c25_lac_x = c25_kac_x; c25_lac_x = muDoubleScalarCos(c25_lac_x); c25_us_a = c25_uic_y; c25_ljc_b = c25_lac_x; c25_vic_y = c25_us_a * c25_ljc_b; c25_mac_x = c25_theta_4; c25_nac_x = c25_mac_x; c25_nac_x = muDoubleScalarCos(c25_nac_x); c25_mjc_b = c25_nac_x; c25_wic_y = 0.027555244673754 * c25_mjc_b; c25_oac_x = c25_theta_5; c25_pac_x = c25_oac_x; c25_pac_x = muDoubleScalarSin(c25_pac_x); c25_njc_b = c25_pac_x; c25_xic_y = 0.0036064005379331339 * c25_njc_b; c25_vs_a = c25_vic_y; c25_ojc_b = c25_wic_y + c25_xic_y; c25_yic_y = c25_vs_a * c25_ojc_b; c25_pjc_b = c25_dq4; c25_ajc_y = c25_pjc_b; c25_qac_x = c25_theta_4; c25_rac_x = c25_qac_x; c25_rac_x = muDoubleScalarCos(c25_rac_x); c25_qjc_b = c25_rac_x; c25_bjc_y = 0.0583017396828 * c25_qjc_b; c25_sac_x = c25_theta_4; c25_tac_x = c25_sac_x; c25_tac_x = muDoubleScalarSin(c25_tac_x); c25_rjc_b = c25_tac_x; c25_cjc_y = 0.013777622336877 * c25_rjc_b; c25_uac_x = c25_theta_5; c25_vac_x = c25_uac_x; c25_vac_x = muDoubleScalarSin(c25_vac_x); c25_ws_a = c25_cjc_y; c25_sjc_b = c25_vac_x; c25_djc_y = c25_ws_a * c25_sjc_b; c25_xs_a = c25_ajc_y; c25_tjc_b = c25_bjc_y + c25_djc_y; c25_ejc_y = c25_xs_a * c25_tjc_b; c25_c33 = c25_yic_y - c25_ejc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 77); c25_ujc_b = c25_dq5; c25_fjc_y = 0.00090160013448328346 * c25_ujc_b; c25_vjc_b = c25_theta_5; c25_gjc_y = 2.0 * c25_vjc_b; c25_wac_x = c25_gjc_y; c25_xac_x = c25_wac_x; c25_xac_x = muDoubleScalarSin(c25_xac_x); c25_ys_a = c25_fjc_y; c25_wjc_b = c25_xac_x; c25_hjc_y = c25_ys_a * c25_wjc_b; c25_xjc_b = c25_dq2; c25_ijc_y = 0.0583017396828 * c25_xjc_b; c25_yac_x = c25_theta_4; c25_abc_x = c25_yac_x; c25_abc_x = muDoubleScalarCos(c25_abc_x); c25_at_a = c25_ijc_y; c25_yjc_b = c25_abc_x; c25_jjc_y = c25_at_a * c25_yjc_b; c25_akc_b = c25_dq3; c25_kjc_y = 0.0583017396828 * c25_akc_b; c25_bbc_x = c25_theta_4; c25_cbc_x = c25_bbc_x; c25_cbc_x = muDoubleScalarCos(c25_cbc_x); c25_bt_a = c25_kjc_y; c25_bkc_b = c25_cbc_x; c25_ljc_y = c25_bt_a * c25_bkc_b; c25_ckc_b = c25_dq4; c25_mjc_y = 0.0583017396828 * c25_ckc_b; c25_dbc_x = c25_theta_4; c25_ebc_x = c25_dbc_x; c25_ebc_x = muDoubleScalarCos(c25_ebc_x); c25_ct_a = c25_mjc_y; c25_dkc_b = c25_ebc_x; c25_njc_y = c25_ct_a * c25_dkc_b; c25_ekc_b = c25_dq5; c25_ojc_y = 0.013777622336877 * c25_ekc_b; c25_fbc_x = c25_theta_4; c25_gbc_x = c25_fbc_x; c25_gbc_x = muDoubleScalarCos(c25_gbc_x); c25_dt_a = c25_ojc_y; c25_fkc_b = c25_gbc_x; c25_pjc_y = c25_dt_a * c25_fkc_b; c25_hbc_x = c25_theta_5; c25_ibc_x = c25_hbc_x; c25_ibc_x = muDoubleScalarCos(c25_ibc_x); c25_et_a = c25_pjc_y; c25_gkc_b = c25_ibc_x; c25_qjc_y = c25_et_a * c25_gkc_b; c25_hkc_b = c25_dq2; c25_rjc_y = 0.013777622336877 * c25_hkc_b; c25_jbc_x = c25_theta_4; c25_kbc_x = c25_jbc_x; c25_kbc_x = muDoubleScalarSin(c25_kbc_x); c25_ft_a = c25_rjc_y; c25_ikc_b = c25_kbc_x; c25_sjc_y = c25_ft_a * c25_ikc_b; c25_lbc_x = c25_theta_5; c25_mbc_x = c25_lbc_x; c25_mbc_x = muDoubleScalarSin(c25_mbc_x); c25_gt_a = c25_sjc_y; c25_jkc_b = c25_mbc_x; c25_tjc_y = c25_gt_a * c25_jkc_b; c25_kkc_b = c25_dq3; c25_ujc_y = 0.013777622336877 * c25_kkc_b; c25_nbc_x = c25_theta_4; c25_obc_x = c25_nbc_x; c25_obc_x = muDoubleScalarSin(c25_obc_x); c25_ht_a = c25_ujc_y; c25_lkc_b = c25_obc_x; c25_vjc_y = c25_ht_a * c25_lkc_b; c25_pbc_x = c25_theta_5; c25_qbc_x = c25_pbc_x; c25_qbc_x = muDoubleScalarSin(c25_qbc_x); c25_it_a = c25_vjc_y; c25_mkc_b = c25_qbc_x; c25_wjc_y = c25_it_a * c25_mkc_b; c25_nkc_b = c25_dq4; c25_xjc_y = 0.013777622336877 * c25_nkc_b; c25_rbc_x = c25_theta_4; c25_sbc_x = c25_rbc_x; c25_sbc_x = muDoubleScalarSin(c25_sbc_x); c25_jt_a = c25_xjc_y; c25_okc_b = c25_sbc_x; c25_yjc_y = c25_jt_a * c25_okc_b; c25_tbc_x = c25_theta_5; c25_ubc_x = c25_tbc_x; c25_ubc_x = muDoubleScalarSin(c25_ubc_x); c25_kt_a = c25_yjc_y; c25_pkc_b = c25_ubc_x; c25_akc_y = c25_kt_a * c25_pkc_b; c25_qkc_b = c25_dq2; c25_bkc_y = 1.0E-35 * c25_qkc_b; c25_vbc_x = c25_theta_3; c25_wbc_x = c25_vbc_x; c25_wbc_x = muDoubleScalarCos(c25_wbc_x); c25_lt_a = c25_bkc_y; c25_rkc_b = c25_wbc_x; c25_ckc_y = c25_lt_a * c25_rkc_b; c25_xbc_x = c25_theta_4; c25_ybc_x = c25_xbc_x; c25_ybc_x = muDoubleScalarSin(c25_ybc_x); c25_mt_a = c25_ckc_y; c25_skc_b = c25_ybc_x; c25_dkc_y = c25_mt_a * c25_skc_b; c25_acc_x = c25_theta_5; c25_bcc_x = c25_acc_x; c25_bcc_x = muDoubleScalarSin(c25_bcc_x); c25_nt_a = c25_dkc_y; c25_tkc_b = c25_bcc_x; c25_ekc_y = c25_nt_a * c25_tkc_b; c25_ukc_b = c25_dq2; c25_fkc_y = 1.0E-35 * c25_ukc_b; c25_ccc_x = c25_theta_4; c25_dcc_x = c25_ccc_x; c25_dcc_x = muDoubleScalarCos(c25_dcc_x); c25_ot_a = c25_fkc_y; c25_vkc_b = c25_dcc_x; c25_gkc_y = c25_ot_a * c25_vkc_b; c25_ecc_x = c25_theta_3; c25_fcc_x = c25_ecc_x; c25_fcc_x = muDoubleScalarSin(c25_fcc_x); c25_pt_a = c25_gkc_y; c25_wkc_b = c25_fcc_x; c25_hkc_y = c25_pt_a * c25_wkc_b; c25_gcc_x = c25_theta_5; c25_hcc_x = c25_gcc_x; c25_hcc_x = muDoubleScalarSin(c25_hcc_x); c25_qt_a = c25_hkc_y; c25_xkc_b = c25_hcc_x; c25_ikc_y = c25_qt_a * c25_xkc_b; c25_c34 = ((((((((c25_hjc_y - c25_jjc_y) - c25_ljc_y) - c25_njc_y) + c25_qjc_y) - c25_tjc_y) - c25_wjc_y) - c25_akc_y) - c25_ekc_y) - c25_ikc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 78); c25_ykc_b = c25_dq1; c25_jkc_y = 0.00045080006724164168 * c25_ykc_b; c25_alc_b = c25_theta_5; c25_kkc_y = 2.0 * c25_alc_b; c25_icc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_kkc_y; c25_jcc_x = c25_icc_x; c25_jcc_x = muDoubleScalarSin(c25_jcc_x); c25_rt_a = c25_jkc_y; c25_blc_b = c25_jcc_x; c25_lkc_y = c25_rt_a * c25_blc_b; c25_clc_b = c25_dq2; c25_mkc_y = 0.00090160013448328346 * c25_clc_b; c25_dlc_b = c25_theta_5; c25_nkc_y = 2.0 * c25_dlc_b; c25_kcc_x = c25_nkc_y; c25_lcc_x = c25_kcc_x; c25_lcc_x = muDoubleScalarSin(c25_lcc_x); c25_st_a = c25_mkc_y; c25_elc_b = c25_lcc_x; c25_okc_y = c25_st_a * c25_elc_b; c25_flc_b = c25_dq3; c25_pkc_y = 0.00090160013448328346 * c25_flc_b; c25_glc_b = c25_theta_5; c25_qkc_y = 2.0 * c25_glc_b; c25_mcc_x = c25_qkc_y; c25_ncc_x = c25_mcc_x; c25_ncc_x = muDoubleScalarSin(c25_ncc_x); c25_tt_a = c25_pkc_y; c25_hlc_b = c25_ncc_x; c25_rkc_y = c25_tt_a * c25_hlc_b; c25_ilc_b = c25_dq4; c25_skc_y = 0.00090160013448328346 * c25_ilc_b; c25_jlc_b = c25_theta_5; c25_tkc_y = 2.0 * c25_jlc_b; c25_occ_x = c25_tkc_y; c25_pcc_x = c25_occ_x; c25_pcc_x = muDoubleScalarSin(c25_pcc_x); c25_ut_a = c25_skc_y; c25_klc_b = c25_pcc_x; c25_ukc_y = c25_ut_a * c25_klc_b; c25_llc_b = c25_dq1; c25_vkc_y = 0.00045080006724164168 * c25_llc_b; c25_mlc_b = c25_theta_5; c25_wkc_y = 2.0 * c25_mlc_b; c25_qcc_x = ((c25_wkc_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_rcc_x = c25_qcc_x; c25_rcc_x = muDoubleScalarSin(c25_rcc_x); c25_vt_a = c25_vkc_y; c25_nlc_b = c25_rcc_x; c25_xkc_y = c25_vt_a * c25_nlc_b; c25_olc_b = c25_dq1; c25_ykc_y = 0.0068888111684385 * c25_olc_b; c25_scc_x = (c25_theta_2 + c25_theta_3) - c25_theta_5; c25_tcc_x = c25_scc_x; c25_tcc_x = muDoubleScalarCos(c25_tcc_x); c25_wt_a = c25_ykc_y; c25_plc_b = c25_tcc_x; c25_alc_y = c25_wt_a * c25_plc_b; c25_qlc_b = c25_dq1; c25_blc_y = 0.0016146178873500002 * c25_qlc_b; c25_ucc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_vcc_x = c25_ucc_x; c25_vcc_x = muDoubleScalarSin(c25_vcc_x); c25_xt_a = c25_blc_y; c25_rlc_b = c25_vcc_x; c25_clc_y = c25_xt_a * c25_rlc_b; c25_slc_b = c25_dq2; c25_dlc_y = 0.0068888111684385 * c25_slc_b; c25_wcc_x = c25_theta_4 + c25_theta_5; c25_xcc_x = c25_wcc_x; c25_xcc_x = muDoubleScalarCos(c25_xcc_x); c25_yt_a = c25_dlc_y; c25_tlc_b = c25_xcc_x; c25_elc_y = c25_yt_a * c25_tlc_b; c25_ulc_b = c25_dq3; c25_flc_y = 0.0068888111684385 * c25_ulc_b; c25_ycc_x = c25_theta_4 + c25_theta_5; c25_adc_x = c25_ycc_x; c25_adc_x = muDoubleScalarCos(c25_adc_x); c25_au_a = c25_flc_y; c25_vlc_b = c25_adc_x; c25_glc_y = c25_au_a * c25_vlc_b; c25_wlc_b = c25_dq4; c25_hlc_y = 0.0068888111684385 * c25_wlc_b; c25_bdc_x = c25_theta_4 + c25_theta_5; c25_cdc_x = c25_bdc_x; c25_cdc_x = muDoubleScalarCos(c25_cdc_x); c25_bu_a = c25_hlc_y; c25_xlc_b = c25_cdc_x; c25_ilc_y = c25_bu_a * c25_xlc_b; c25_ylc_b = c25_dq5; c25_jlc_y = 0.0068888111684385 * c25_ylc_b; c25_ddc_x = c25_theta_4 + c25_theta_5; c25_edc_x = c25_ddc_x; c25_edc_x = muDoubleScalarCos(c25_edc_x); c25_cu_a = c25_jlc_y; c25_amc_b = c25_edc_x; c25_klc_y = c25_cu_a * c25_amc_b; c25_bmc_b = c25_dq5; c25_llc_y = 0.0032292357747 * c25_bmc_b; c25_fdc_x = c25_theta_5; c25_gdc_x = c25_fdc_x; c25_gdc_x = muDoubleScalarSin(c25_gdc_x); c25_du_a = c25_llc_y; c25_cmc_b = c25_gdc_x; c25_mlc_y = c25_du_a * c25_cmc_b; c25_dmc_b = c25_dq6; c25_nlc_y = 6.9267456E-5 * c25_dmc_b; c25_hdc_x = c25_theta_5; c25_idc_x = c25_hdc_x; c25_idc_x = muDoubleScalarSin(c25_idc_x); c25_eu_a = c25_nlc_y; c25_emc_b = c25_idc_x; c25_olc_y = c25_eu_a * c25_emc_b; c25_fmc_b = c25_dq1; c25_plc_y = 0.0016146178873500002 * c25_fmc_b; c25_jdc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_kdc_x = c25_jdc_x; c25_kdc_x = muDoubleScalarSin(c25_kdc_x); c25_fu_a = c25_plc_y; c25_gmc_b = c25_kdc_x; c25_qlc_y = c25_fu_a * c25_gmc_b; c25_hmc_b = c25_dq2; c25_rlc_y = 0.0068888111684385 * c25_hmc_b; c25_ldc_x = c25_theta_4 - c25_theta_5; c25_mdc_x = c25_ldc_x; c25_mdc_x = muDoubleScalarCos(c25_mdc_x); c25_gu_a = c25_rlc_y; c25_imc_b = c25_mdc_x; c25_slc_y = c25_gu_a * c25_imc_b; c25_jmc_b = c25_dq3; c25_tlc_y = 0.0068888111684385 * c25_jmc_b; c25_ndc_x = c25_theta_4 - c25_theta_5; c25_odc_x = c25_ndc_x; c25_odc_x = muDoubleScalarCos(c25_odc_x); c25_hu_a = c25_tlc_y; c25_kmc_b = c25_odc_x; c25_ulc_y = c25_hu_a * c25_kmc_b; c25_lmc_b = c25_dq4; c25_vlc_y = 0.0068888111684385 * c25_lmc_b; c25_pdc_x = c25_theta_4 - c25_theta_5; c25_qdc_x = c25_pdc_x; c25_qdc_x = muDoubleScalarCos(c25_qdc_x); c25_iu_a = c25_vlc_y; c25_mmc_b = c25_qdc_x; c25_wlc_y = c25_iu_a * c25_mmc_b; c25_nmc_b = c25_dq5; c25_xlc_y = 0.0068888111684385 * c25_nmc_b; c25_rdc_x = c25_theta_4 - c25_theta_5; c25_sdc_x = c25_rdc_x; c25_sdc_x = muDoubleScalarCos(c25_sdc_x); c25_ju_a = c25_xlc_y; c25_omc_b = c25_sdc_x; c25_ylc_y = c25_ju_a * c25_omc_b; c25_pmc_b = c25_dq1; c25_amc_y = 0.0068888111684385 * c25_pmc_b; c25_tdc_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_udc_x = c25_tdc_x; c25_udc_x = muDoubleScalarCos(c25_udc_x); c25_ku_a = c25_amc_y; c25_qmc_b = c25_udc_x; c25_bmc_y = c25_ku_a * c25_qmc_b; c25_rmc_b = c25_dq1; c25_cmc_y = 0.0014202397504832836 * c25_rmc_b; c25_vdc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_wdc_x = c25_vdc_x; c25_wdc_x = muDoubleScalarSin(c25_wdc_x); c25_lu_a = c25_cmc_y; c25_smc_b = c25_wdc_x; c25_dmc_y = c25_lu_a * c25_smc_b; c25_c35 = ((((((((((((((((((c25_lkc_y + c25_okc_y) + c25_rkc_y) + c25_ukc_y) - c25_xkc_y) - c25_alc_y) - c25_clc_y) + c25_elc_y) + c25_glc_y) + c25_ilc_y) + c25_klc_y) + c25_mlc_y) - c25_olc_y) + c25_qlc_y) + c25_slc_y) + c25_ulc_y) + c25_wlc_y) - c25_ylc_y) + c25_bmc_y) - c25_dmc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 79); c25_xdc_x = c25_theta_5; c25_ydc_x = c25_xdc_x; c25_ydc_x = muDoubleScalarSin(c25_ydc_x); c25_tmc_b = c25_dq5; c25_emc_y = 6.9267456E-5 * c25_tmc_b; c25_umc_b = c25_dq1; c25_fmc_y = 6.9267456E-5 * c25_umc_b; c25_aec_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_bec_x = c25_aec_x; c25_bec_x = muDoubleScalarCos(c25_bec_x); c25_mu_a = c25_fmc_y; c25_vmc_b = c25_bec_x; c25_gmc_y = c25_mu_a * c25_vmc_b; c25_nu_a = -c25_ydc_x; c25_wmc_b = c25_emc_y - c25_gmc_y; c25_c36 = c25_nu_a * c25_wmc_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 80); c25_xmc_b = c25_dq5; c25_hmc_y = 0.00045080006724164168 * c25_xmc_b; c25_ymc_b = c25_theta_5; c25_imc_y = 2.0 * c25_ymc_b; c25_cec_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_imc_y; c25_dec_x = c25_cec_x; c25_dec_x = muDoubleScalarSin(c25_dec_x); c25_ou_a = c25_hmc_y; c25_anc_b = c25_dec_x; c25_jmc_y = c25_ou_a * c25_anc_b; c25_bnc_b = c25_dq1; c25_kmc_y = 0.003730276414375 * c25_bnc_b; c25_cnc_b = c25_theta_2; c25_lmc_y = 2.0 * c25_cnc_b; c25_dnc_b = c25_theta_5; c25_mmc_y = c25_dnc_b; c25_eec_x = ((c25_lmc_y + c25_theta_3) + c25_theta_4) - c25_mmc_y; c25_fec_x = c25_eec_x; c25_fec_x = muDoubleScalarCos(c25_fec_x); c25_pu_a = c25_kmc_y; c25_enc_b = c25_fec_x; c25_nmc_y = c25_pu_a * c25_enc_b; c25_fnc_b = c25_dq1; c25_omc_y = 0.0291508698414 * c25_fnc_b; c25_gnc_b = c25_theta_2; c25_pmc_y = 2.0 * c25_gnc_b; c25_hnc_b = c25_theta_3; c25_qmc_y = 2.0 * c25_hnc_b; c25_gec_x = (c25_pmc_y + c25_qmc_y) + c25_theta_4; c25_hec_x = c25_gec_x; c25_hec_x = muDoubleScalarCos(c25_hec_x); c25_qu_a = c25_omc_y; c25_inc_b = c25_hec_x; c25_rmc_y = c25_qu_a * c25_inc_b; c25_jnc_b = c25_dq5; c25_smc_y = 0.00045080006724164168 * c25_jnc_b; c25_knc_b = c25_theta_5; c25_tmc_y = 2.0 * c25_knc_b; c25_iec_x = ((c25_tmc_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_jec_x = c25_iec_x; c25_jec_x = muDoubleScalarSin(c25_jec_x); c25_ru_a = c25_smc_y; c25_lnc_b = c25_jec_x; c25_umc_y = c25_ru_a * c25_lnc_b; c25_mnc_b = c25_dq1; c25_vmc_y = 0.003730276414375 * c25_mnc_b; c25_kec_x = (c25_theta_3 + c25_theta_4) - c25_theta_5; c25_lec_x = c25_kec_x; c25_lec_x = muDoubleScalarCos(c25_lec_x); c25_su_a = c25_vmc_y; c25_nnc_b = c25_lec_x; c25_wmc_y = c25_su_a * c25_nnc_b; c25_onc_b = c25_dq1; c25_xmc_y = 0.00161461788735 * c25_onc_b; c25_pnc_b = c25_theta_2; c25_ymc_y = 2.0 * c25_pnc_b; c25_qnc_b = c25_theta_3; c25_anc_y = 2.0 * c25_qnc_b; c25_rnc_b = c25_theta_4; c25_bnc_y = 2.0 * c25_rnc_b; c25_mec_x = ((c25_ymc_y + c25_anc_y) + c25_bnc_y) + c25_theta_5; c25_nec_x = c25_mec_x; c25_nec_x = muDoubleScalarSin(c25_nec_x); c25_tu_a = c25_xmc_y; c25_snc_b = c25_nec_x; c25_cnc_y = c25_tu_a * c25_snc_b; c25_tnc_b = c25_dq1; c25_dnc_y = 0.00161461788735 * c25_tnc_b; c25_unc_b = c25_theta_2; c25_enc_y = 2.0 * c25_unc_b; c25_vnc_b = c25_theta_3; c25_fnc_y = 2.0 * c25_vnc_b; c25_wnc_b = c25_theta_4; c25_gnc_y = 2.0 * c25_wnc_b; c25_xnc_b = c25_theta_5; c25_hnc_y = c25_xnc_b; c25_oec_x = ((c25_enc_y + c25_fnc_y) + c25_gnc_y) - c25_hnc_y; c25_pec_x = c25_oec_x; c25_pec_x = muDoubleScalarSin(c25_pec_x); c25_uu_a = c25_dnc_y; c25_ync_b = c25_pec_x; c25_inc_y = c25_uu_a * c25_ync_b; c25_aoc_b = c25_dq1; c25_jnc_y = 0.00022540003362082084 * c25_aoc_b; c25_boc_b = c25_theta_2; c25_knc_y = 2.0 * c25_boc_b; c25_coc_b = c25_theta_3; c25_lnc_y = 2.0 * c25_coc_b; c25_doc_b = c25_theta_4; c25_mnc_y = 2.0 * c25_doc_b; c25_eoc_b = c25_theta_5; c25_nnc_y = 2.0 * c25_eoc_b; c25_qec_x = ((c25_knc_y + c25_lnc_y) + c25_mnc_y) - c25_nnc_y; c25_rec_x = c25_qec_x; c25_rec_x = muDoubleScalarSin(c25_rec_x); c25_vu_a = c25_jnc_y; c25_foc_b = c25_rec_x; c25_onc_y = c25_vu_a * c25_foc_b; c25_goc_b = c25_dq5; c25_pnc_y = 0.0016146178873500002 * c25_goc_b; c25_sec_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_tec_x = c25_sec_x; c25_tec_x = muDoubleScalarSin(c25_tec_x); c25_wu_a = c25_pnc_y; c25_hoc_b = c25_tec_x; c25_qnc_y = c25_wu_a * c25_hoc_b; c25_ioc_b = c25_dq6; c25_rnc_y = 3.4633728E-5 * c25_ioc_b; c25_uec_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_vec_x = c25_uec_x; c25_vec_x = muDoubleScalarSin(c25_vec_x); c25_xu_a = c25_rnc_y; c25_joc_b = c25_vec_x; c25_snc_y = c25_xu_a * c25_joc_b; c25_koc_b = c25_dq1; c25_tnc_y = 0.0315702665 * c25_koc_b; c25_wec_x = c25_theta_3 + c25_theta_4; c25_xec_x = c25_wec_x; c25_xec_x = muDoubleScalarCos(c25_xec_x); c25_yu_a = c25_tnc_y; c25_loc_b = c25_xec_x; c25_unc_y = c25_yu_a * c25_loc_b; c25_moc_b = c25_dq1; c25_vnc_y = 0.00344440558421925 * c25_moc_b; c25_yec_x = c25_theta_4 + c25_theta_5; c25_afc_x = c25_yec_x; c25_afc_x = muDoubleScalarCos(c25_afc_x); c25_av_a = c25_vnc_y; c25_noc_b = c25_afc_x; c25_wnc_y = c25_av_a * c25_noc_b; c25_ooc_b = c25_dq1; c25_xnc_y = 0.0315702665 * c25_ooc_b; c25_poc_b = c25_theta_2; c25_ync_y = 2.0 * c25_poc_b; c25_bfc_x = (c25_ync_y + c25_theta_3) + c25_theta_4; c25_cfc_x = c25_bfc_x; c25_cfc_x = muDoubleScalarCos(c25_cfc_x); c25_bv_a = c25_xnc_y; c25_qoc_b = c25_cfc_x; c25_aoc_y = c25_bv_a * c25_qoc_b; c25_roc_b = c25_dq1; c25_boc_y = 0.00344440558421925 * c25_roc_b; c25_soc_b = c25_theta_2; c25_coc_y = 2.0 * c25_soc_b; c25_toc_b = c25_theta_3; c25_doc_y = 2.0 * c25_toc_b; c25_dfc_x = ((c25_coc_y + c25_doc_y) + c25_theta_4) + c25_theta_5; c25_efc_x = c25_dfc_x; c25_efc_x = muDoubleScalarCos(c25_efc_x); c25_cv_a = c25_boc_y; c25_uoc_b = c25_efc_x; c25_eoc_y = c25_cv_a * c25_uoc_b; c25_voc_b = c25_dq1; c25_foc_y = 0.0291508698414 * c25_voc_b; c25_ffc_x = c25_theta_4; c25_gfc_x = c25_ffc_x; c25_gfc_x = muDoubleScalarCos(c25_gfc_x); c25_dv_a = c25_foc_y; c25_woc_b = c25_gfc_x; c25_goc_y = c25_dv_a * c25_woc_b; c25_xoc_b = c25_dq1; c25_hoc_y = 0.00344440558421925 * c25_xoc_b; c25_yoc_b = c25_theta_2; c25_ioc_y = 2.0 * c25_yoc_b; c25_apc_b = c25_theta_3; c25_joc_y = 2.0 * c25_apc_b; c25_bpc_b = c25_theta_5; c25_koc_y = c25_bpc_b; c25_hfc_x = ((c25_ioc_y + c25_joc_y) + c25_theta_4) - c25_koc_y; c25_ifc_x = c25_hfc_x; c25_ifc_x = muDoubleScalarCos(c25_ifc_x); c25_ev_a = c25_hoc_y; c25_cpc_b = c25_ifc_x; c25_loc_y = c25_ev_a * c25_cpc_b; c25_dpc_b = c25_dq5; c25_moc_y = 0.0016146178873500002 * c25_dpc_b; c25_jfc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_kfc_x = c25_jfc_x; c25_kfc_x = muDoubleScalarSin(c25_kfc_x); c25_fv_a = c25_moc_y; c25_epc_b = c25_kfc_x; c25_noc_y = c25_fv_a * c25_epc_b; c25_fpc_b = c25_dq6; c25_ooc_y = 3.4633728E-5 * c25_fpc_b; c25_lfc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_mfc_x = c25_lfc_x; c25_mfc_x = muDoubleScalarSin(c25_mfc_x); c25_gv_a = c25_ooc_y; c25_gpc_b = c25_mfc_x; c25_poc_y = c25_gv_a * c25_gpc_b; c25_hpc_b = c25_dq1; c25_qoc_y = 0.00344440558421925 * c25_hpc_b; c25_nfc_x = c25_theta_4 - c25_theta_5; c25_ofc_x = c25_nfc_x; c25_ofc_x = muDoubleScalarCos(c25_ofc_x); c25_hv_a = c25_qoc_y; c25_ipc_b = c25_ofc_x; c25_roc_y = c25_hv_a * c25_ipc_b; c25_jpc_b = c25_dq1; c25_soc_y = 0.0057439079350250248 * c25_jpc_b; c25_kpc_b = c25_theta_2; c25_toc_y = 2.0 * c25_kpc_b; c25_lpc_b = c25_theta_3; c25_uoc_y = 2.0 * c25_lpc_b; c25_mpc_b = c25_theta_4; c25_voc_y = 2.0 * c25_mpc_b; c25_pfc_x = (c25_toc_y + c25_uoc_y) + c25_voc_y; c25_qfc_x = c25_pfc_x; c25_qfc_x = muDoubleScalarSin(c25_qfc_x); c25_iv_a = c25_soc_y; c25_npc_b = c25_qfc_x; c25_woc_y = c25_iv_a * c25_npc_b; c25_opc_b = c25_dq1; c25_xoc_y = 0.003730276414375 * c25_opc_b; c25_rfc_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_sfc_x = c25_rfc_x; c25_sfc_x = muDoubleScalarCos(c25_sfc_x); c25_jv_a = c25_xoc_y; c25_ppc_b = c25_sfc_x; c25_yoc_y = c25_jv_a * c25_ppc_b; c25_qpc_b = c25_dq1; c25_apc_y = 0.00022540003362082084 * c25_qpc_b; c25_rpc_b = c25_theta_2; c25_bpc_y = 2.0 * c25_rpc_b; c25_spc_b = c25_theta_3; c25_cpc_y = 2.0 * c25_spc_b; c25_tpc_b = c25_theta_4; c25_dpc_y = 2.0 * c25_tpc_b; c25_upc_b = c25_theta_5; c25_epc_y = 2.0 * c25_upc_b; c25_tfc_x = ((c25_bpc_y + c25_cpc_y) + c25_dpc_y) + c25_epc_y; c25_ufc_x = c25_tfc_x; c25_ufc_x = muDoubleScalarSin(c25_ufc_x); c25_kv_a = c25_apc_y; c25_vpc_b = c25_ufc_x; c25_fpc_y = c25_kv_a * c25_vpc_b; c25_wpc_b = c25_dq5; c25_gpc_y = 0.0014202397504832836 * c25_wpc_b; c25_vfc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_wfc_x = c25_vfc_x; c25_wfc_x = muDoubleScalarSin(c25_wfc_x); c25_lv_a = c25_gpc_y; c25_xpc_b = c25_wfc_x; c25_hpc_y = c25_lv_a * c25_xpc_b; c25_ypc_b = c25_dq1; c25_ipc_y = 0.003730276414375 * c25_ypc_b; c25_aqc_b = c25_theta_2; c25_jpc_y = 2.0 * c25_aqc_b; c25_xfc_x = ((c25_jpc_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_yfc_x = c25_xfc_x; c25_yfc_x = muDoubleScalarCos(c25_yfc_x); c25_mv_a = c25_ipc_y; c25_bqc_b = c25_yfc_x; c25_kpc_y = c25_mv_a * c25_bqc_b; c25_c41 = ((((((((((((((((((((((c25_jmc_y + c25_nmc_y) + c25_rmc_y) - c25_umc_y) + c25_wmc_y) + c25_cnc_y) - c25_inc_y) - c25_onc_y) - c25_qnc_y) + c25_snc_y) + c25_unc_y) - c25_wnc_y) + c25_aoc_y) - c25_eoc_y) + c25_goc_y) + c25_loc_y) + c25_noc_y) - c25_poc_y) + c25_roc_y) - c25_woc_y) - c25_yoc_y) - c25_fpc_y) - c25_hpc_y) - c25_kpc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 81); c25_cqc_b = c25_dq5; c25_lpc_y = 0.00090160013448328346 * c25_cqc_b; c25_dqc_b = c25_theta_5; c25_mpc_y = 2.0 * c25_dqc_b; c25_agc_x = c25_mpc_y; c25_bgc_x = c25_agc_x; c25_bgc_x = muDoubleScalarSin(c25_bgc_x); c25_nv_a = c25_lpc_y; c25_eqc_b = c25_bgc_x; c25_npc_y = c25_nv_a * c25_eqc_b; c25_fqc_b = c25_dq2; c25_opc_y = 0.0583017396828 * c25_fqc_b; c25_cgc_x = c25_theta_4; c25_dgc_x = c25_cgc_x; c25_dgc_x = muDoubleScalarCos(c25_dgc_x); c25_ov_a = c25_opc_y; c25_gqc_b = c25_dgc_x; c25_ppc_y = c25_ov_a * c25_gqc_b; c25_hqc_b = c25_dq3; c25_qpc_y = 0.0583017396828 * c25_hqc_b; c25_egc_x = c25_theta_4; c25_fgc_x = c25_egc_x; c25_fgc_x = muDoubleScalarCos(c25_fgc_x); c25_pv_a = c25_qpc_y; c25_iqc_b = c25_fgc_x; c25_rpc_y = c25_pv_a * c25_iqc_b; c25_jqc_b = c25_dq2; c25_spc_y = 0.063140533 * c25_jqc_b; c25_ggc_x = c25_theta_3; c25_hgc_x = c25_ggc_x; c25_hgc_x = muDoubleScalarCos(c25_hgc_x); c25_qv_a = c25_spc_y; c25_kqc_b = c25_hgc_x; c25_tpc_y = c25_qv_a * c25_kqc_b; c25_igc_x = c25_theta_4; c25_jgc_x = c25_igc_x; c25_jgc_x = muDoubleScalarCos(c25_jgc_x); c25_rv_a = c25_tpc_y; c25_lqc_b = c25_jgc_x; c25_upc_y = c25_rv_a * c25_lqc_b; c25_mqc_b = c25_dq2; c25_vpc_y = 0.063140533 * c25_mqc_b; c25_kgc_x = c25_theta_3; c25_lgc_x = c25_kgc_x; c25_lgc_x = muDoubleScalarSin(c25_lgc_x); c25_sv_a = c25_vpc_y; c25_nqc_b = c25_lgc_x; c25_wpc_y = c25_sv_a * c25_nqc_b; c25_mgc_x = c25_theta_4; c25_ngc_x = c25_mgc_x; c25_ngc_x = muDoubleScalarSin(c25_ngc_x); c25_tv_a = c25_wpc_y; c25_oqc_b = c25_ngc_x; c25_xpc_y = c25_tv_a * c25_oqc_b; c25_pqc_b = c25_dq2; c25_ypc_y = 0.013777622336877 * c25_pqc_b; c25_ogc_x = c25_theta_4; c25_pgc_x = c25_ogc_x; c25_pgc_x = muDoubleScalarSin(c25_pgc_x); c25_uv_a = c25_ypc_y; c25_qqc_b = c25_pgc_x; c25_aqc_y = c25_uv_a * c25_qqc_b; c25_qgc_x = c25_theta_5; c25_rgc_x = c25_qgc_x; c25_rgc_x = muDoubleScalarSin(c25_rgc_x); c25_vv_a = c25_aqc_y; c25_rqc_b = c25_rgc_x; c25_bqc_y = c25_vv_a * c25_rqc_b; c25_sqc_b = c25_dq3; c25_cqc_y = 0.013777622336877 * c25_sqc_b; c25_sgc_x = c25_theta_4; c25_tgc_x = c25_sgc_x; c25_tgc_x = muDoubleScalarSin(c25_tgc_x); c25_wv_a = c25_cqc_y; c25_tqc_b = c25_tgc_x; c25_dqc_y = c25_wv_a * c25_tqc_b; c25_ugc_x = c25_theta_5; c25_vgc_x = c25_ugc_x; c25_vgc_x = muDoubleScalarSin(c25_vgc_x); c25_xv_a = c25_dqc_y; c25_uqc_b = c25_vgc_x; c25_eqc_y = c25_xv_a * c25_uqc_b; c25_vqc_b = c25_dq2; c25_fqc_y = 0.0149211056575 * c25_vqc_b; c25_wgc_x = c25_theta_3; c25_xgc_x = c25_wgc_x; c25_xgc_x = muDoubleScalarCos(c25_xgc_x); c25_yv_a = c25_fqc_y; c25_wqc_b = c25_xgc_x; c25_gqc_y = c25_yv_a * c25_wqc_b; c25_ygc_x = c25_theta_4; c25_ahc_x = c25_ygc_x; c25_ahc_x = muDoubleScalarSin(c25_ahc_x); c25_aw_a = c25_gqc_y; c25_xqc_b = c25_ahc_x; c25_hqc_y = c25_aw_a * c25_xqc_b; c25_bhc_x = c25_theta_5; c25_chc_x = c25_bhc_x; c25_chc_x = muDoubleScalarSin(c25_chc_x); c25_bw_a = c25_hqc_y; c25_yqc_b = c25_chc_x; c25_iqc_y = c25_bw_a * c25_yqc_b; c25_arc_b = c25_dq2; c25_jqc_y = 0.0149211056575 * c25_arc_b; c25_dhc_x = c25_theta_4; c25_ehc_x = c25_dhc_x; c25_ehc_x = muDoubleScalarCos(c25_ehc_x); c25_cw_a = c25_jqc_y; c25_brc_b = c25_ehc_x; c25_kqc_y = c25_cw_a * c25_brc_b; c25_fhc_x = c25_theta_3; c25_ghc_x = c25_fhc_x; c25_ghc_x = muDoubleScalarSin(c25_ghc_x); c25_dw_a = c25_kqc_y; c25_crc_b = c25_ghc_x; c25_lqc_y = c25_dw_a * c25_crc_b; c25_hhc_x = c25_theta_5; c25_ihc_x = c25_hhc_x; c25_ihc_x = muDoubleScalarSin(c25_ihc_x); c25_ew_a = c25_lqc_y; c25_drc_b = c25_ihc_x; c25_mqc_y = c25_ew_a * c25_drc_b; c25_erc_b = c25_dq3; c25_nqc_y = 1.0E-35 * c25_erc_b; c25_jhc_x = c25_theta_3; c25_khc_x = c25_jhc_x; c25_khc_x = muDoubleScalarCos(c25_khc_x); c25_fw_a = c25_nqc_y; c25_frc_b = c25_khc_x; c25_oqc_y = c25_fw_a * c25_frc_b; c25_lhc_x = c25_theta_4; c25_mhc_x = c25_lhc_x; c25_mhc_x = muDoubleScalarSin(c25_mhc_x); c25_gw_a = c25_oqc_y; c25_grc_b = c25_mhc_x; c25_pqc_y = c25_gw_a * c25_grc_b; c25_nhc_x = c25_theta_5; c25_ohc_x = c25_nhc_x; c25_ohc_x = muDoubleScalarSin(c25_ohc_x); c25_hw_a = c25_pqc_y; c25_hrc_b = c25_ohc_x; c25_qqc_y = c25_hw_a * c25_hrc_b; c25_irc_b = c25_dq3; c25_rqc_y = 1.0E-35 * c25_irc_b; c25_phc_x = c25_theta_4; c25_qhc_x = c25_phc_x; c25_qhc_x = muDoubleScalarCos(c25_qhc_x); c25_iw_a = c25_rqc_y; c25_jrc_b = c25_qhc_x; c25_sqc_y = c25_iw_a * c25_jrc_b; c25_rhc_x = c25_theta_3; c25_shc_x = c25_rhc_x; c25_shc_x = muDoubleScalarSin(c25_shc_x); c25_jw_a = c25_sqc_y; c25_krc_b = c25_shc_x; c25_tqc_y = c25_jw_a * c25_krc_b; c25_thc_x = c25_theta_5; c25_uhc_x = c25_thc_x; c25_uhc_x = muDoubleScalarSin(c25_uhc_x); c25_kw_a = c25_tqc_y; c25_lrc_b = c25_uhc_x; c25_uqc_y = c25_kw_a * c25_lrc_b; c25_c42 = (((((((((c25_npc_y + c25_ppc_y) + c25_rpc_y) + c25_upc_y) - c25_xpc_y) + c25_bqc_y) + c25_eqc_y) + c25_iqc_y) + c25_mqc_y) + c25_qqc_y) + c25_uqc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 82); c25_mrc_b = c25_dq5; c25_vqc_y = 0.00090160013448328346 * c25_mrc_b; c25_nrc_b = c25_theta_5; c25_wqc_y = 2.0 * c25_nrc_b; c25_vhc_x = c25_wqc_y; c25_whc_x = c25_vhc_x; c25_whc_x = muDoubleScalarSin(c25_whc_x); c25_lw_a = c25_vqc_y; c25_orc_b = c25_whc_x; c25_xqc_y = c25_lw_a * c25_orc_b; c25_prc_b = c25_dq2; c25_yqc_y = 0.0583017396828 * c25_prc_b; c25_xhc_x = c25_theta_4; c25_yhc_x = c25_xhc_x; c25_yhc_x = muDoubleScalarCos(c25_yhc_x); c25_mw_a = c25_yqc_y; c25_qrc_b = c25_yhc_x; c25_arc_y = c25_mw_a * c25_qrc_b; c25_rrc_b = c25_dq3; c25_brc_y = 0.0583017396828 * c25_rrc_b; c25_aic_x = c25_theta_4; c25_bic_x = c25_aic_x; c25_bic_x = muDoubleScalarCos(c25_bic_x); c25_nw_a = c25_brc_y; c25_src_b = c25_bic_x; c25_crc_y = c25_nw_a * c25_src_b; c25_trc_b = c25_dq2; c25_drc_y = 0.013777622336877 * c25_trc_b; c25_cic_x = c25_theta_4; c25_dic_x = c25_cic_x; c25_dic_x = muDoubleScalarSin(c25_dic_x); c25_ow_a = c25_drc_y; c25_urc_b = c25_dic_x; c25_erc_y = c25_ow_a * c25_urc_b; c25_eic_x = c25_theta_5; c25_fic_x = c25_eic_x; c25_fic_x = muDoubleScalarSin(c25_fic_x); c25_pw_a = c25_erc_y; c25_vrc_b = c25_fic_x; c25_frc_y = c25_pw_a * c25_vrc_b; c25_wrc_b = c25_dq3; c25_grc_y = 0.013777622336877 * c25_wrc_b; c25_gic_x = c25_theta_4; c25_hic_x = c25_gic_x; c25_hic_x = muDoubleScalarSin(c25_hic_x); c25_qw_a = c25_grc_y; c25_xrc_b = c25_hic_x; c25_hrc_y = c25_qw_a * c25_xrc_b; c25_iic_x = c25_theta_5; c25_jic_x = c25_iic_x; c25_jic_x = muDoubleScalarSin(c25_jic_x); c25_rw_a = c25_hrc_y; c25_yrc_b = c25_jic_x; c25_irc_y = c25_rw_a * c25_yrc_b; c25_asc_b = c25_dq2; c25_jrc_y = 1.0E-35 * c25_asc_b; c25_kic_x = c25_theta_3; c25_lic_x = c25_kic_x; c25_lic_x = muDoubleScalarCos(c25_lic_x); c25_sw_a = c25_jrc_y; c25_bsc_b = c25_lic_x; c25_krc_y = c25_sw_a * c25_bsc_b; c25_mic_x = c25_theta_4; c25_nic_x = c25_mic_x; c25_nic_x = muDoubleScalarSin(c25_nic_x); c25_tw_a = c25_krc_y; c25_csc_b = c25_nic_x; c25_lrc_y = c25_tw_a * c25_csc_b; c25_oic_x = c25_theta_5; c25_pic_x = c25_oic_x; c25_pic_x = muDoubleScalarSin(c25_pic_x); c25_uw_a = c25_lrc_y; c25_dsc_b = c25_pic_x; c25_mrc_y = c25_uw_a * c25_dsc_b; c25_esc_b = c25_dq2; c25_nrc_y = 1.0E-35 * c25_esc_b; c25_qic_x = c25_theta_4; c25_ric_x = c25_qic_x; c25_ric_x = muDoubleScalarCos(c25_ric_x); c25_vw_a = c25_nrc_y; c25_fsc_b = c25_ric_x; c25_orc_y = c25_vw_a * c25_fsc_b; c25_sic_x = c25_theta_3; c25_tic_x = c25_sic_x; c25_tic_x = muDoubleScalarSin(c25_tic_x); c25_ww_a = c25_orc_y; c25_gsc_b = c25_tic_x; c25_prc_y = c25_ww_a * c25_gsc_b; c25_uic_x = c25_theta_5; c25_vic_x = c25_uic_x; c25_vic_x = muDoubleScalarSin(c25_vic_x); c25_xw_a = c25_prc_y; c25_hsc_b = c25_vic_x; c25_qrc_y = c25_xw_a * c25_hsc_b; c25_c43 = (((((c25_xqc_y + c25_arc_y) + c25_crc_y) + c25_frc_y) + c25_irc_y) + c25_mrc_y) + c25_qrc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 83); c25_isc_b = c25_dq5; c25_rrc_y = 0.00090160013448328346 * c25_isc_b; c25_jsc_b = c25_theta_5; c25_src_y = 2.0 * c25_jsc_b; c25_wic_x = c25_src_y; c25_xic_x = c25_wic_x; c25_xic_x = muDoubleScalarSin(c25_xic_x); c25_yw_a = c25_rrc_y; c25_ksc_b = c25_xic_x; c25_c44 = c25_yw_a * c25_ksc_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 84); c25_lsc_b = c25_dq1; c25_trc_y = 0.00045080006724164168 * c25_lsc_b; c25_msc_b = c25_theta_5; c25_urc_y = 2.0 * c25_msc_b; c25_yic_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_urc_y; c25_ajc_x = c25_yic_x; c25_ajc_x = muDoubleScalarSin(c25_ajc_x); c25_ax_a = c25_trc_y; c25_nsc_b = c25_ajc_x; c25_vrc_y = c25_ax_a * c25_nsc_b; c25_osc_b = c25_dq2; c25_wrc_y = 0.00090160013448328346 * c25_osc_b; c25_psc_b = c25_theta_5; c25_xrc_y = 2.0 * c25_psc_b; c25_bjc_x = c25_xrc_y; c25_cjc_x = c25_bjc_x; c25_cjc_x = muDoubleScalarSin(c25_cjc_x); c25_bx_a = c25_wrc_y; c25_qsc_b = c25_cjc_x; c25_yrc_y = c25_bx_a * c25_qsc_b; c25_rsc_b = c25_dq3; c25_asc_y = 0.00090160013448328346 * c25_rsc_b; c25_ssc_b = c25_theta_5; c25_bsc_y = 2.0 * c25_ssc_b; c25_djc_x = c25_bsc_y; c25_ejc_x = c25_djc_x; c25_ejc_x = muDoubleScalarSin(c25_ejc_x); c25_cx_a = c25_asc_y; c25_tsc_b = c25_ejc_x; c25_csc_y = c25_cx_a * c25_tsc_b; c25_usc_b = c25_dq1; c25_dsc_y = 0.00045080006724164168 * c25_usc_b; c25_vsc_b = c25_theta_5; c25_esc_y = 2.0 * c25_vsc_b; c25_fjc_x = ((c25_esc_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_gjc_x = c25_fjc_x; c25_gjc_x = muDoubleScalarSin(c25_gjc_x); c25_dx_a = c25_dsc_y; c25_wsc_b = c25_gjc_x; c25_fsc_y = c25_dx_a * c25_wsc_b; c25_xsc_b = c25_dq4; c25_gsc_y = 0.00090160013448328346 * c25_xsc_b; c25_ysc_b = c25_theta_5; c25_hsc_y = 2.0 * c25_ysc_b; c25_hjc_x = c25_hsc_y; c25_ijc_x = c25_hjc_x; c25_ijc_x = muDoubleScalarSin(c25_ijc_x); c25_ex_a = c25_gsc_y; c25_atc_b = c25_ijc_x; c25_isc_y = c25_ex_a * c25_atc_b; c25_btc_b = c25_dq1; c25_jsc_y = 0.0016146178873500002 * c25_btc_b; c25_jjc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_kjc_x = c25_jjc_x; c25_kjc_x = muDoubleScalarSin(c25_kjc_x); c25_fx_a = c25_jsc_y; c25_ctc_b = c25_kjc_x; c25_ksc_y = c25_fx_a * c25_ctc_b; c25_dtc_b = c25_dq5; c25_lsc_y = 0.0032292357747 * c25_dtc_b; c25_ljc_x = c25_theta_5; c25_mjc_x = c25_ljc_x; c25_mjc_x = muDoubleScalarSin(c25_mjc_x); c25_gx_a = c25_lsc_y; c25_etc_b = c25_mjc_x; c25_msc_y = c25_gx_a * c25_etc_b; c25_ftc_b = c25_dq6; c25_nsc_y = 6.9267456E-5 * c25_ftc_b; c25_njc_x = c25_theta_5; c25_ojc_x = c25_njc_x; c25_ojc_x = muDoubleScalarSin(c25_ojc_x); c25_hx_a = c25_nsc_y; c25_gtc_b = c25_ojc_x; c25_osc_y = c25_hx_a * c25_gtc_b; c25_htc_b = c25_dq1; c25_psc_y = 0.0016146178873500002 * c25_htc_b; c25_pjc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_qjc_x = c25_pjc_x; c25_qjc_x = muDoubleScalarSin(c25_qjc_x); c25_ix_a = c25_psc_y; c25_itc_b = c25_qjc_x; c25_qsc_y = c25_ix_a * c25_itc_b; c25_jtc_b = c25_dq1; c25_rsc_y = 0.0014202397504832836 * c25_jtc_b; c25_rjc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_sjc_x = c25_rjc_x; c25_sjc_x = muDoubleScalarSin(c25_sjc_x); c25_jx_a = c25_rsc_y; c25_ktc_b = c25_sjc_x; c25_ssc_y = c25_jx_a * c25_ktc_b; c25_c45 = ((((((((c25_vrc_y + c25_yrc_y) + c25_csc_y) - c25_fsc_y) + c25_isc_y) - c25_ksc_y) + c25_msc_y) - c25_osc_y) + c25_qsc_y) - c25_ssc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 85); c25_tjc_x = c25_theta_5; c25_ujc_x = c25_tjc_x; c25_ujc_x = muDoubleScalarSin(c25_ujc_x); c25_ltc_b = c25_dq5; c25_tsc_y = 6.9267456E-5 * c25_ltc_b; c25_mtc_b = c25_dq1; c25_usc_y = 6.9267456E-5 * c25_mtc_b; c25_vjc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_wjc_x = c25_vjc_x; c25_wjc_x = muDoubleScalarCos(c25_wjc_x); c25_kx_a = c25_usc_y; c25_ntc_b = c25_wjc_x; c25_vsc_y = c25_kx_a * c25_ntc_b; c25_lx_a = -c25_ujc_x; c25_otc_b = c25_tsc_y - c25_vsc_y; c25_c46 = c25_lx_a * c25_otc_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 86); c25_ptc_b = c25_dq2; c25_wsc_y = 0.00045080006724164168 * c25_ptc_b; c25_qtc_b = c25_theta_5; c25_xsc_y = 2.0 * c25_qtc_b; c25_xjc_x = ((c25_xsc_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_yjc_x = c25_xjc_x; c25_yjc_x = muDoubleScalarSin(c25_yjc_x); c25_mx_a = c25_wsc_y; c25_rtc_b = c25_yjc_x; c25_ysc_y = c25_mx_a * c25_rtc_b; c25_stc_b = c25_dq3; c25_atc_y = 0.00045080006724164168 * c25_stc_b; c25_ttc_b = c25_theta_5; c25_btc_y = 2.0 * c25_ttc_b; c25_akc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_btc_y; c25_bkc_x = c25_akc_x; c25_bkc_x = muDoubleScalarSin(c25_bkc_x); c25_nx_a = c25_atc_y; c25_utc_b = c25_bkc_x; c25_ctc_y = c25_nx_a * c25_utc_b; c25_vtc_b = c25_dq4; c25_dtc_y = 0.00045080006724164168 * c25_vtc_b; c25_wtc_b = c25_theta_5; c25_etc_y = 2.0 * c25_wtc_b; c25_ckc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_etc_y; c25_dkc_x = c25_ckc_x; c25_dkc_x = muDoubleScalarSin(c25_dkc_x); c25_ox_a = c25_dtc_y; c25_xtc_b = c25_dkc_x; c25_ftc_y = c25_ox_a * c25_xtc_b; c25_ytc_b = c25_dq1; c25_gtc_y = 0.003730276414375 * c25_ytc_b; c25_auc_b = c25_theta_2; c25_htc_y = 2.0 * c25_auc_b; c25_buc_b = c25_theta_5; c25_itc_y = c25_buc_b; c25_ekc_x = ((c25_htc_y + c25_theta_3) + c25_theta_4) - c25_itc_y; c25_fkc_x = c25_ekc_x; c25_fkc_x = muDoubleScalarCos(c25_fkc_x); c25_px_a = c25_gtc_y; c25_cuc_b = c25_fkc_x; c25_jtc_y = c25_px_a * c25_cuc_b; c25_duc_b = c25_dq2; c25_ktc_y = 0.00045080006724164168 * c25_duc_b; c25_euc_b = c25_theta_5; c25_ltc_y = 2.0 * c25_euc_b; c25_gkc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_ltc_y; c25_hkc_x = c25_gkc_x; c25_hkc_x = muDoubleScalarSin(c25_hkc_x); c25_qx_a = c25_ktc_y; c25_fuc_b = c25_hkc_x; c25_mtc_y = c25_qx_a * c25_fuc_b; c25_guc_b = c25_dq3; c25_ntc_y = 0.00045080006724164168 * c25_guc_b; c25_huc_b = c25_theta_5; c25_otc_y = 2.0 * c25_huc_b; c25_ikc_x = ((c25_otc_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_jkc_x = c25_ikc_x; c25_jkc_x = muDoubleScalarSin(c25_jkc_x); c25_rx_a = c25_ntc_y; c25_iuc_b = c25_jkc_x; c25_ptc_y = c25_rx_a * c25_iuc_b; c25_juc_b = c25_dq4; c25_qtc_y = 0.00045080006724164168 * c25_juc_b; c25_kuc_b = c25_theta_5; c25_rtc_y = 2.0 * c25_kuc_b; c25_kkc_x = ((c25_rtc_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_lkc_x = c25_kkc_x; c25_lkc_x = muDoubleScalarSin(c25_lkc_x); c25_sx_a = c25_qtc_y; c25_luc_b = c25_lkc_x; c25_stc_y = c25_sx_a * c25_luc_b; c25_muc_b = c25_dq2; c25_ttc_y = 0.0068888111684385 * c25_muc_b; c25_mkc_x = (c25_theta_2 + c25_theta_3) - c25_theta_5; c25_nkc_x = c25_mkc_x; c25_nkc_x = muDoubleScalarCos(c25_nkc_x); c25_tx_a = c25_ttc_y; c25_nuc_b = c25_nkc_x; c25_utc_y = c25_tx_a * c25_nuc_b; c25_ouc_b = c25_dq1; c25_vtc_y = 0.003730276414375 * c25_ouc_b; c25_okc_x = (c25_theta_3 + c25_theta_4) - c25_theta_5; c25_pkc_x = c25_okc_x; c25_pkc_x = muDoubleScalarCos(c25_pkc_x); c25_ux_a = c25_vtc_y; c25_puc_b = c25_pkc_x; c25_wtc_y = c25_ux_a * c25_puc_b; c25_quc_b = c25_dq3; c25_xtc_y = 0.0068888111684385 * c25_quc_b; c25_qkc_x = (c25_theta_2 + c25_theta_3) - c25_theta_5; c25_rkc_x = c25_qkc_x; c25_rkc_x = muDoubleScalarCos(c25_rkc_x); c25_vx_a = c25_xtc_y; c25_ruc_b = c25_rkc_x; c25_ytc_y = c25_vx_a * c25_ruc_b; c25_suc_b = c25_dq1; c25_auc_y = 0.000807308943675 * c25_suc_b; c25_tuc_b = c25_theta_2; c25_buc_y = 2.0 * c25_tuc_b; c25_uuc_b = c25_theta_3; c25_cuc_y = 2.0 * c25_uuc_b; c25_vuc_b = c25_theta_4; c25_duc_y = 2.0 * c25_vuc_b; c25_skc_x = ((c25_buc_y + c25_cuc_y) + c25_duc_y) + c25_theta_5; c25_tkc_x = c25_skc_x; c25_tkc_x = muDoubleScalarSin(c25_tkc_x); c25_wx_a = c25_auc_y; c25_wuc_b = c25_tkc_x; c25_euc_y = c25_wx_a * c25_wuc_b; c25_xuc_b = c25_dq1; c25_fuc_y = 0.00045080006724164168 * c25_xuc_b; c25_yuc_b = c25_theta_5; c25_guc_y = 2.0 * c25_yuc_b; c25_ukc_x = c25_guc_y; c25_vkc_x = c25_ukc_x; c25_vkc_x = muDoubleScalarSin(c25_vkc_x); c25_xx_a = c25_fuc_y; c25_avc_b = c25_vkc_x; c25_huc_y = c25_xx_a * c25_avc_b; c25_bvc_b = c25_dq1; c25_iuc_y = 0.000807308943675 * c25_bvc_b; c25_cvc_b = c25_theta_2; c25_juc_y = 2.0 * c25_cvc_b; c25_dvc_b = c25_theta_3; c25_kuc_y = 2.0 * c25_dvc_b; c25_evc_b = c25_theta_4; c25_luc_y = 2.0 * c25_evc_b; c25_fvc_b = c25_theta_5; c25_muc_y = c25_fvc_b; c25_wkc_x = ((c25_juc_y + c25_kuc_y) + c25_luc_y) - c25_muc_y; c25_xkc_x = c25_wkc_x; c25_xkc_x = muDoubleScalarSin(c25_xkc_x); c25_yx_a = c25_iuc_y; c25_gvc_b = c25_xkc_x; c25_nuc_y = c25_yx_a * c25_gvc_b; c25_hvc_b = c25_dq1; c25_ouc_y = 0.00022540003362082084 * c25_hvc_b; c25_ivc_b = c25_theta_2; c25_puc_y = 2.0 * c25_ivc_b; c25_jvc_b = c25_theta_3; c25_quc_y = 2.0 * c25_jvc_b; c25_kvc_b = c25_theta_4; c25_ruc_y = 2.0 * c25_kvc_b; c25_lvc_b = c25_theta_5; c25_suc_y = 2.0 * c25_lvc_b; c25_ykc_x = ((c25_puc_y + c25_quc_y) + c25_ruc_y) - c25_suc_y; c25_alc_x = c25_ykc_x; c25_alc_x = muDoubleScalarSin(c25_alc_x); c25_ay_a = c25_ouc_y; c25_mvc_b = c25_alc_x; c25_tuc_y = c25_ay_a * c25_mvc_b; c25_nvc_b = c25_dq2; c25_uuc_y = 0.0016146178873500002 * c25_nvc_b; c25_blc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_clc_x = c25_blc_x; c25_clc_x = muDoubleScalarSin(c25_clc_x); c25_by_a = c25_uuc_y; c25_ovc_b = c25_clc_x; c25_vuc_y = c25_by_a * c25_ovc_b; c25_pvc_b = c25_dq3; c25_wuc_y = 0.0016146178873500002 * c25_pvc_b; c25_dlc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_elc_x = c25_dlc_x; c25_elc_x = muDoubleScalarSin(c25_elc_x); c25_cy_a = c25_wuc_y; c25_qvc_b = c25_elc_x; c25_xuc_y = c25_cy_a * c25_qvc_b; c25_rvc_b = c25_dq4; c25_yuc_y = 0.0016146178873500002 * c25_rvc_b; c25_flc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_glc_x = c25_flc_x; c25_glc_x = muDoubleScalarSin(c25_glc_x); c25_dy_a = c25_yuc_y; c25_svc_b = c25_glc_x; c25_avc_y = c25_dy_a * c25_svc_b; c25_tvc_b = c25_dq6; c25_bvc_y = 3.4633728E-5 * c25_tvc_b; c25_hlc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_ilc_x = c25_hlc_x; c25_ilc_x = muDoubleScalarSin(c25_ilc_x); c25_ey_a = c25_bvc_y; c25_uvc_b = c25_ilc_x; c25_cvc_y = c25_ey_a * c25_uvc_b; c25_vvc_b = c25_dq2; c25_dvc_y = 0.00746055282875 * c25_vvc_b; c25_jlc_x = c25_theta_2 + c25_theta_5; c25_klc_x = c25_jlc_x; c25_klc_x = muDoubleScalarCos(c25_klc_x); c25_fy_a = c25_dvc_y; c25_wvc_b = c25_klc_x; c25_evc_y = c25_fy_a * c25_wvc_b; c25_xvc_b = c25_dq1; c25_fvc_y = 0.00344440558421925 * c25_xvc_b; c25_llc_x = c25_theta_4 + c25_theta_5; c25_mlc_x = c25_llc_x; c25_mlc_x = muDoubleScalarCos(c25_mlc_x); c25_gy_a = c25_fvc_y; c25_yvc_b = c25_mlc_x; c25_gvc_y = c25_gy_a * c25_yvc_b; c25_awc_b = c25_dq1; c25_hvc_y = 0.00344440558421925 * c25_awc_b; c25_bwc_b = c25_theta_2; c25_ivc_y = 2.0 * c25_bwc_b; c25_cwc_b = c25_theta_3; c25_jvc_y = 2.0 * c25_cwc_b; c25_nlc_x = ((c25_ivc_y + c25_jvc_y) + c25_theta_4) + c25_theta_5; c25_olc_x = c25_nlc_x; c25_olc_x = muDoubleScalarCos(c25_olc_x); c25_hy_a = c25_hvc_y; c25_dwc_b = c25_olc_x; c25_kvc_y = c25_hy_a * c25_dwc_b; c25_ewc_b = c25_dq1; c25_lvc_y = 0.0038268247451 * c25_ewc_b; c25_plc_x = c25_theta_5; c25_qlc_x = c25_plc_x; c25_qlc_x = muDoubleScalarSin(c25_qlc_x); c25_iy_a = c25_lvc_y; c25_fwc_b = c25_qlc_x; c25_mvc_y = c25_iy_a * c25_fwc_b; c25_gwc_b = c25_dq1; c25_nvc_y = 0.00344440558421925 * c25_gwc_b; c25_hwc_b = c25_theta_2; c25_ovc_y = 2.0 * c25_hwc_b; c25_iwc_b = c25_theta_3; c25_pvc_y = 2.0 * c25_iwc_b; c25_jwc_b = c25_theta_5; c25_qvc_y = c25_jwc_b; c25_rlc_x = ((c25_ovc_y + c25_pvc_y) + c25_theta_4) - c25_qvc_y; c25_slc_x = c25_rlc_x; c25_slc_x = muDoubleScalarCos(c25_slc_x); c25_jy_a = c25_nvc_y; c25_kwc_b = c25_slc_x; c25_rvc_y = c25_jy_a * c25_kwc_b; c25_lwc_b = c25_dq2; c25_svc_y = 0.0016146178873500002 * c25_lwc_b; c25_tlc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_ulc_x = c25_tlc_x; c25_ulc_x = muDoubleScalarSin(c25_ulc_x); c25_ky_a = c25_svc_y; c25_mwc_b = c25_ulc_x; c25_tvc_y = c25_ky_a * c25_mwc_b; c25_nwc_b = c25_dq3; c25_uvc_y = 0.0016146178873500002 * c25_nwc_b; c25_vlc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_wlc_x = c25_vlc_x; c25_wlc_x = muDoubleScalarSin(c25_wlc_x); c25_ly_a = c25_uvc_y; c25_owc_b = c25_wlc_x; c25_vvc_y = c25_ly_a * c25_owc_b; c25_pwc_b = c25_dq4; c25_wvc_y = 0.0016146178873500002 * c25_pwc_b; c25_xlc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_ylc_x = c25_xlc_x; c25_ylc_x = muDoubleScalarSin(c25_ylc_x); c25_my_a = c25_wvc_y; c25_qwc_b = c25_ylc_x; c25_xvc_y = c25_my_a * c25_qwc_b; c25_rwc_b = c25_dq6; c25_yvc_y = 3.4633728E-5 * c25_rwc_b; c25_amc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_bmc_x = c25_amc_x; c25_bmc_x = muDoubleScalarSin(c25_bmc_x); c25_ny_a = c25_yvc_y; c25_swc_b = c25_bmc_x; c25_awc_y = c25_ny_a * c25_swc_b; c25_twc_b = c25_dq2; c25_bwc_y = 0.00746055282875 * c25_twc_b; c25_cmc_x = c25_theta_2 - c25_theta_5; c25_dmc_x = c25_cmc_x; c25_dmc_x = muDoubleScalarCos(c25_dmc_x); c25_oy_a = c25_bwc_y; c25_uwc_b = c25_dmc_x; c25_cwc_y = c25_oy_a * c25_uwc_b; c25_vwc_b = c25_dq1; c25_dwc_y = 0.00344440558421925 * c25_vwc_b; c25_emc_x = c25_theta_4 - c25_theta_5; c25_fmc_x = c25_emc_x; c25_fmc_x = muDoubleScalarCos(c25_fmc_x); c25_py_a = c25_dwc_y; c25_wwc_b = c25_fmc_x; c25_ewc_y = c25_py_a * c25_wwc_b; c25_xwc_b = c25_dq2; c25_fwc_y = 0.0068888111684385 * c25_xwc_b; c25_gmc_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_hmc_x = c25_gmc_x; c25_hmc_x = muDoubleScalarCos(c25_hmc_x); c25_qy_a = c25_fwc_y; c25_ywc_b = c25_hmc_x; c25_gwc_y = c25_qy_a * c25_ywc_b; c25_axc_b = c25_dq1; c25_hwc_y = 0.003730276414375 * c25_axc_b; c25_imc_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_jmc_x = c25_imc_x; c25_jmc_x = muDoubleScalarCos(c25_jmc_x); c25_ry_a = c25_hwc_y; c25_bxc_b = c25_jmc_x; c25_iwc_y = c25_ry_a * c25_bxc_b; c25_cxc_b = c25_dq3; c25_jwc_y = 0.0068888111684385 * c25_cxc_b; c25_kmc_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_lmc_x = c25_kmc_x; c25_lmc_x = muDoubleScalarCos(c25_lmc_x); c25_sy_a = c25_jwc_y; c25_dxc_b = c25_lmc_x; c25_kwc_y = c25_sy_a * c25_dxc_b; c25_exc_b = c25_dq1; c25_lwc_y = 0.00022540003362082084 * c25_exc_b; c25_fxc_b = c25_theta_2; c25_mwc_y = 2.0 * c25_fxc_b; c25_gxc_b = c25_theta_3; c25_nwc_y = 2.0 * c25_gxc_b; c25_hxc_b = c25_theta_4; c25_owc_y = 2.0 * c25_hxc_b; c25_ixc_b = c25_theta_5; c25_pwc_y = 2.0 * c25_ixc_b; c25_mmc_x = ((c25_mwc_y + c25_nwc_y) + c25_owc_y) + c25_pwc_y; c25_nmc_x = c25_mmc_x; c25_nmc_x = muDoubleScalarSin(c25_nmc_x); c25_ty_a = c25_lwc_y; c25_jxc_b = c25_nmc_x; c25_qwc_y = c25_ty_a * c25_jxc_b; c25_kxc_b = c25_dq2; c25_rwc_y = 0.0014202397504832836 * c25_kxc_b; c25_omc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_pmc_x = c25_omc_x; c25_pmc_x = muDoubleScalarSin(c25_pmc_x); c25_uy_a = c25_rwc_y; c25_lxc_b = c25_pmc_x; c25_swc_y = c25_uy_a * c25_lxc_b; c25_mxc_b = c25_dq3; c25_twc_y = 0.0014202397504832836 * c25_mxc_b; c25_qmc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_rmc_x = c25_qmc_x; c25_rmc_x = muDoubleScalarSin(c25_rmc_x); c25_vy_a = c25_twc_y; c25_nxc_b = c25_rmc_x; c25_uwc_y = c25_vy_a * c25_nxc_b; c25_oxc_b = c25_dq4; c25_vwc_y = 0.0014202397504832836 * c25_oxc_b; c25_smc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_tmc_x = c25_smc_x; c25_tmc_x = muDoubleScalarSin(c25_tmc_x); c25_wy_a = c25_vwc_y; c25_pxc_b = c25_tmc_x; c25_wwc_y = c25_wy_a * c25_pxc_b; c25_qxc_b = c25_dq1; c25_xwc_y = 0.003730276414375 * c25_qxc_b; c25_rxc_b = c25_theta_2; c25_ywc_y = 2.0 * c25_rxc_b; c25_umc_x = ((c25_ywc_y + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_vmc_x = c25_umc_x; c25_vmc_x = muDoubleScalarCos(c25_vmc_x); c25_xy_a = c25_xwc_y; c25_sxc_b = c25_vmc_x; c25_axc_y = c25_xy_a * c25_sxc_b; c25_c51 = (((((((((((((((((((((((((((((((((((c25_ysc_y - c25_ctc_y) - c25_ftc_y) - c25_jtc_y) - c25_mtc_y) + c25_ptc_y) + c25_stc_y) + c25_utc_y) - c25_wtc_y) + c25_ytc_y) + c25_euc_y) + c25_huc_y) + c25_nuc_y) + c25_tuc_y) + c25_vuc_y) + c25_xuc_y) + c25_avc_y) + c25_cvc_y) - c25_evc_y) - c25_gvc_y) - c25_kvc_y) + c25_mvc_y) - c25_rvc_y) - c25_tvc_y) - c25_vvc_y) - c25_xvc_y) + c25_awc_y) + c25_cwc_y) - c25_ewc_y) - c25_gwc_y) - c25_iwc_y) - c25_kwc_y) - c25_qwc_y) + c25_swc_y) + c25_uwc_y) + c25_wwc_y) - c25_axc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 87); c25_txc_b = c25_dq1; c25_bxc_y = 0.00045080006724164168 * c25_txc_b; c25_uxc_b = c25_theta_5; c25_cxc_y = 2.0 * c25_uxc_b; c25_wmc_x = ((c25_cxc_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_xmc_x = c25_wmc_x; c25_xmc_x = muDoubleScalarSin(c25_xmc_x); c25_yy_a = c25_bxc_y; c25_vxc_b = c25_xmc_x; c25_dxc_y = c25_yy_a * c25_vxc_b; c25_wxc_b = c25_dq2; c25_exc_y = 0.00090160013448328346 * c25_wxc_b; c25_xxc_b = c25_theta_5; c25_fxc_y = 2.0 * c25_xxc_b; c25_ymc_x = c25_fxc_y; c25_anc_x = c25_ymc_x; c25_anc_x = muDoubleScalarSin(c25_anc_x); c25_aab_a = c25_exc_y; c25_yxc_b = c25_anc_x; c25_gxc_y = c25_aab_a * c25_yxc_b; c25_ayc_b = c25_dq3; c25_hxc_y = 0.00090160013448328346 * c25_ayc_b; c25_byc_b = c25_theta_5; c25_ixc_y = 2.0 * c25_byc_b; c25_bnc_x = c25_ixc_y; c25_cnc_x = c25_bnc_x; c25_cnc_x = muDoubleScalarSin(c25_cnc_x); c25_bab_a = c25_hxc_y; c25_cyc_b = c25_cnc_x; c25_jxc_y = c25_bab_a * c25_cyc_b; c25_dyc_b = c25_dq4; c25_kxc_y = 0.00090160013448328346 * c25_dyc_b; c25_eyc_b = c25_theta_5; c25_lxc_y = 2.0 * c25_eyc_b; c25_dnc_x = c25_lxc_y; c25_enc_x = c25_dnc_x; c25_enc_x = muDoubleScalarSin(c25_enc_x); c25_cab_a = c25_kxc_y; c25_fyc_b = c25_enc_x; c25_mxc_y = c25_cab_a * c25_fyc_b; c25_gyc_b = c25_dq1; c25_nxc_y = 0.00045080006724164168 * c25_gyc_b; c25_hyc_b = c25_theta_5; c25_oxc_y = 2.0 * c25_hyc_b; c25_fnc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_oxc_y; c25_gnc_x = c25_fnc_x; c25_gnc_x = muDoubleScalarSin(c25_gnc_x); c25_dab_a = c25_nxc_y; c25_iyc_b = c25_gnc_x; c25_pxc_y = c25_dab_a * c25_iyc_b; c25_jyc_b = c25_dq1; c25_qxc_y = 0.0068888111684385 * c25_jyc_b; c25_hnc_x = (c25_theta_2 + c25_theta_3) - c25_theta_5; c25_inc_x = c25_hnc_x; c25_inc_x = muDoubleScalarCos(c25_inc_x); c25_eab_a = c25_qxc_y; c25_kyc_b = c25_inc_x; c25_rxc_y = c25_eab_a * c25_kyc_b; c25_lyc_b = c25_dq2; c25_sxc_y = 0.00746055282875 * c25_lyc_b; c25_jnc_x = (c25_theta_3 + c25_theta_4) - c25_theta_5; c25_knc_x = c25_jnc_x; c25_knc_x = muDoubleScalarCos(c25_knc_x); c25_fab_a = c25_sxc_y; c25_myc_b = c25_knc_x; c25_txc_y = c25_fab_a * c25_myc_b; c25_nyc_b = c25_dq1; c25_uxc_y = 0.0016146178873500002 * c25_nyc_b; c25_lnc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_mnc_x = c25_lnc_x; c25_mnc_x = muDoubleScalarSin(c25_mnc_x); c25_gab_a = c25_uxc_y; c25_oyc_b = c25_mnc_x; c25_vxc_y = c25_gab_a * c25_oyc_b; c25_pyc_b = c25_dq1; c25_wxc_y = 0.00746055282875 * c25_pyc_b; c25_nnc_x = c25_theta_2 + c25_theta_5; c25_onc_x = c25_nnc_x; c25_onc_x = muDoubleScalarCos(c25_onc_x); c25_hab_a = c25_wxc_y; c25_qyc_b = c25_onc_x; c25_xxc_y = c25_hab_a * c25_qyc_b; c25_ryc_b = c25_dq2; c25_yxc_y = 0.0068888111684385 * c25_ryc_b; c25_pnc_x = c25_theta_4 + c25_theta_5; c25_qnc_x = c25_pnc_x; c25_qnc_x = muDoubleScalarCos(c25_qnc_x); c25_iab_a = c25_yxc_y; c25_syc_b = c25_qnc_x; c25_ayc_y = c25_iab_a * c25_syc_b; c25_tyc_b = c25_dq3; c25_byc_y = 0.0068888111684385 * c25_tyc_b; c25_rnc_x = c25_theta_4 + c25_theta_5; c25_snc_x = c25_rnc_x; c25_snc_x = muDoubleScalarCos(c25_snc_x); c25_jab_a = c25_byc_y; c25_uyc_b = c25_snc_x; c25_cyc_y = c25_jab_a * c25_uyc_b; c25_vyc_b = c25_dq6; c25_dyc_y = 6.9267456E-5 * c25_vyc_b; c25_tnc_x = c25_theta_5; c25_unc_x = c25_tnc_x; c25_unc_x = muDoubleScalarSin(c25_unc_x); c25_kab_a = c25_dyc_y; c25_wyc_b = c25_unc_x; c25_eyc_y = c25_kab_a * c25_wyc_b; c25_xyc_b = c25_dq1; c25_fyc_y = 0.0016146178873500002 * c25_xyc_b; c25_vnc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_wnc_x = c25_vnc_x; c25_wnc_x = muDoubleScalarSin(c25_wnc_x); c25_lab_a = c25_fyc_y; c25_yyc_b = c25_wnc_x; c25_gyc_y = c25_lab_a * c25_yyc_b; c25_aad_b = c25_dq1; c25_hyc_y = 0.00746055282875 * c25_aad_b; c25_xnc_x = c25_theta_2 - c25_theta_5; c25_ync_x = c25_xnc_x; c25_ync_x = muDoubleScalarCos(c25_ync_x); c25_mab_a = c25_hyc_y; c25_bad_b = c25_ync_x; c25_iyc_y = c25_mab_a * c25_bad_b; c25_cad_b = c25_dq2; c25_jyc_y = 0.0068888111684385 * c25_cad_b; c25_aoc_x = c25_theta_4 - c25_theta_5; c25_boc_x = c25_aoc_x; c25_boc_x = muDoubleScalarCos(c25_boc_x); c25_nab_a = c25_jyc_y; c25_dad_b = c25_boc_x; c25_kyc_y = c25_nab_a * c25_dad_b; c25_ead_b = c25_dq3; c25_lyc_y = 0.0068888111684385 * c25_ead_b; c25_coc_x = c25_theta_4 - c25_theta_5; c25_doc_x = c25_coc_x; c25_doc_x = muDoubleScalarCos(c25_doc_x); c25_oab_a = c25_lyc_y; c25_fad_b = c25_doc_x; c25_myc_y = c25_oab_a * c25_fad_b; c25_gad_b = c25_dq1; c25_nyc_y = 0.0068888111684385 * c25_gad_b; c25_eoc_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_foc_x = c25_eoc_x; c25_foc_x = muDoubleScalarCos(c25_foc_x); c25_pab_a = c25_nyc_y; c25_had_b = c25_foc_x; c25_oyc_y = c25_pab_a * c25_had_b; c25_iad_b = c25_dq2; c25_pyc_y = 0.00746055282875 * c25_iad_b; c25_goc_x = (c25_theta_3 + c25_theta_4) + c25_theta_5; c25_hoc_x = c25_goc_x; c25_hoc_x = muDoubleScalarCos(c25_hoc_x); c25_qab_a = c25_pyc_y; c25_jad_b = c25_hoc_x; c25_qyc_y = c25_qab_a * c25_jad_b; c25_kad_b = c25_dq1; c25_ryc_y = 0.0014202397504832836 * c25_kad_b; c25_ioc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_joc_x = c25_ioc_x; c25_joc_x = muDoubleScalarSin(c25_joc_x); c25_rab_a = c25_ryc_y; c25_lad_b = c25_joc_x; c25_syc_y = c25_rab_a * c25_lad_b; c25_c52 = (((((((((((((((((c25_dxc_y - c25_gxc_y) - c25_jxc_y) - c25_mxc_y) - c25_pxc_y) + c25_rxc_y) - c25_txc_y) + c25_vxc_y) - c25_xxc_y) - c25_ayc_y) - c25_cyc_y) + c25_eyc_y) - c25_gyc_y) + c25_iyc_y) - c25_kyc_y) - c25_myc_y) - c25_oyc_y) - c25_qyc_y) + c25_syc_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 88); c25_mad_b = c25_dq1; c25_tyc_y = 0.00045080006724164168 * c25_mad_b; c25_nad_b = c25_theta_5; c25_uyc_y = 2.0 * c25_nad_b; c25_koc_x = ((c25_uyc_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_loc_x = c25_koc_x; c25_loc_x = muDoubleScalarSin(c25_loc_x); c25_sab_a = c25_tyc_y; c25_oad_b = c25_loc_x; c25_vyc_y = c25_sab_a * c25_oad_b; c25_pad_b = c25_dq2; c25_wyc_y = 0.00090160013448328346 * c25_pad_b; c25_qad_b = c25_theta_5; c25_xyc_y = 2.0 * c25_qad_b; c25_moc_x = c25_xyc_y; c25_noc_x = c25_moc_x; c25_noc_x = muDoubleScalarSin(c25_noc_x); c25_tab_a = c25_wyc_y; c25_rad_b = c25_noc_x; c25_yyc_y = c25_tab_a * c25_rad_b; c25_sad_b = c25_dq3; c25_aad_y = 0.00090160013448328346 * c25_sad_b; c25_tad_b = c25_theta_5; c25_bad_y = 2.0 * c25_tad_b; c25_ooc_x = c25_bad_y; c25_poc_x = c25_ooc_x; c25_poc_x = muDoubleScalarSin(c25_poc_x); c25_uab_a = c25_aad_y; c25_uad_b = c25_poc_x; c25_cad_y = c25_uab_a * c25_uad_b; c25_vad_b = c25_dq4; c25_dad_y = 0.00090160013448328346 * c25_vad_b; c25_wad_b = c25_theta_5; c25_ead_y = 2.0 * c25_wad_b; c25_qoc_x = c25_ead_y; c25_roc_x = c25_qoc_x; c25_roc_x = muDoubleScalarSin(c25_roc_x); c25_vab_a = c25_dad_y; c25_xad_b = c25_roc_x; c25_fad_y = c25_vab_a * c25_xad_b; c25_yad_b = c25_dq1; c25_gad_y = 0.00045080006724164168 * c25_yad_b; c25_abd_b = c25_theta_5; c25_had_y = 2.0 * c25_abd_b; c25_soc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_had_y; c25_toc_x = c25_soc_x; c25_toc_x = muDoubleScalarSin(c25_toc_x); c25_wab_a = c25_gad_y; c25_bbd_b = c25_toc_x; c25_iad_y = c25_wab_a * c25_bbd_b; c25_cbd_b = c25_dq1; c25_jad_y = 0.0068888111684385 * c25_cbd_b; c25_uoc_x = (c25_theta_2 + c25_theta_3) - c25_theta_5; c25_voc_x = c25_uoc_x; c25_voc_x = muDoubleScalarCos(c25_voc_x); c25_xab_a = c25_jad_y; c25_dbd_b = c25_voc_x; c25_kad_y = c25_xab_a * c25_dbd_b; c25_ebd_b = c25_dq1; c25_lad_y = 0.0016146178873500002 * c25_ebd_b; c25_woc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_xoc_x = c25_woc_x; c25_xoc_x = muDoubleScalarSin(c25_xoc_x); c25_yab_a = c25_lad_y; c25_fbd_b = c25_xoc_x; c25_mad_y = c25_yab_a * c25_fbd_b; c25_gbd_b = c25_dq2; c25_nad_y = 0.0068888111684385 * c25_gbd_b; c25_yoc_x = c25_theta_4 + c25_theta_5; c25_apc_x = c25_yoc_x; c25_apc_x = muDoubleScalarCos(c25_apc_x); c25_abb_a = c25_nad_y; c25_hbd_b = c25_apc_x; c25_oad_y = c25_abb_a * c25_hbd_b; c25_ibd_b = c25_dq3; c25_pad_y = 0.0068888111684385 * c25_ibd_b; c25_bpc_x = c25_theta_4 + c25_theta_5; c25_cpc_x = c25_bpc_x; c25_cpc_x = muDoubleScalarCos(c25_cpc_x); c25_bbb_a = c25_pad_y; c25_jbd_b = c25_cpc_x; c25_qad_y = c25_bbb_a * c25_jbd_b; c25_kbd_b = c25_dq6; c25_rad_y = 6.9267456E-5 * c25_kbd_b; c25_dpc_x = c25_theta_5; c25_epc_x = c25_dpc_x; c25_epc_x = muDoubleScalarSin(c25_epc_x); c25_cbb_a = c25_rad_y; c25_lbd_b = c25_epc_x; c25_sad_y = c25_cbb_a * c25_lbd_b; c25_mbd_b = c25_dq1; c25_tad_y = 0.0016146178873500002 * c25_mbd_b; c25_fpc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_gpc_x = c25_fpc_x; c25_gpc_x = muDoubleScalarSin(c25_gpc_x); c25_dbb_a = c25_tad_y; c25_nbd_b = c25_gpc_x; c25_uad_y = c25_dbb_a * c25_nbd_b; c25_obd_b = c25_dq2; c25_vad_y = 0.0068888111684385 * c25_obd_b; c25_hpc_x = c25_theta_4 - c25_theta_5; c25_ipc_x = c25_hpc_x; c25_ipc_x = muDoubleScalarCos(c25_ipc_x); c25_ebb_a = c25_vad_y; c25_pbd_b = c25_ipc_x; c25_wad_y = c25_ebb_a * c25_pbd_b; c25_qbd_b = c25_dq3; c25_xad_y = 0.0068888111684385 * c25_qbd_b; c25_jpc_x = c25_theta_4 - c25_theta_5; c25_kpc_x = c25_jpc_x; c25_kpc_x = muDoubleScalarCos(c25_kpc_x); c25_fbb_a = c25_xad_y; c25_rbd_b = c25_kpc_x; c25_yad_y = c25_fbb_a * c25_rbd_b; c25_sbd_b = c25_dq1; c25_abd_y = 0.0068888111684385 * c25_sbd_b; c25_lpc_x = (c25_theta_2 + c25_theta_3) + c25_theta_5; c25_mpc_x = c25_lpc_x; c25_mpc_x = muDoubleScalarCos(c25_mpc_x); c25_gbb_a = c25_abd_y; c25_tbd_b = c25_mpc_x; c25_bbd_y = c25_gbb_a * c25_tbd_b; c25_ubd_b = c25_dq1; c25_cbd_y = 0.0014202397504832836 * c25_ubd_b; c25_npc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_opc_x = c25_npc_x; c25_opc_x = muDoubleScalarSin(c25_opc_x); c25_hbb_a = c25_cbd_y; c25_vbd_b = c25_opc_x; c25_dbd_y = c25_hbb_a * c25_vbd_b; c25_c53 = (((((((((((((c25_vyc_y - c25_yyc_y) - c25_cad_y) - c25_fad_y) - c25_iad_y) + c25_kad_y) + c25_mad_y) - c25_oad_y) - c25_qad_y) + c25_sad_y) - c25_uad_y) - c25_wad_y) - c25_yad_y) - c25_bbd_y) + c25_dbd_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 89); c25_wbd_b = c25_dq1; c25_ebd_y = 0.00045080006724164168 * c25_wbd_b; c25_xbd_b = c25_theta_5; c25_fbd_y = 2.0 * c25_xbd_b; c25_ppc_x = ((c25_fbd_y - c25_theta_3) - c25_theta_4) - c25_theta_2; c25_qpc_x = c25_ppc_x; c25_qpc_x = muDoubleScalarSin(c25_qpc_x); c25_ibb_a = c25_ebd_y; c25_ybd_b = c25_qpc_x; c25_gbd_y = c25_ibb_a * c25_ybd_b; c25_acd_b = c25_dq2; c25_hbd_y = 0.00090160013448328346 * c25_acd_b; c25_bcd_b = c25_theta_5; c25_ibd_y = 2.0 * c25_bcd_b; c25_rpc_x = c25_ibd_y; c25_spc_x = c25_rpc_x; c25_spc_x = muDoubleScalarSin(c25_spc_x); c25_jbb_a = c25_hbd_y; c25_ccd_b = c25_spc_x; c25_jbd_y = c25_jbb_a * c25_ccd_b; c25_dcd_b = c25_dq3; c25_kbd_y = 0.00090160013448328346 * c25_dcd_b; c25_ecd_b = c25_theta_5; c25_lbd_y = 2.0 * c25_ecd_b; c25_tpc_x = c25_lbd_y; c25_upc_x = c25_tpc_x; c25_upc_x = muDoubleScalarSin(c25_upc_x); c25_kbb_a = c25_kbd_y; c25_fcd_b = c25_upc_x; c25_mbd_y = c25_kbb_a * c25_fcd_b; c25_gcd_b = c25_dq1; c25_nbd_y = 0.00045080006724164168 * c25_gcd_b; c25_hcd_b = c25_theta_5; c25_obd_y = 2.0 * c25_hcd_b; c25_vpc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_obd_y; c25_wpc_x = c25_vpc_x; c25_wpc_x = muDoubleScalarSin(c25_wpc_x); c25_lbb_a = c25_nbd_y; c25_icd_b = c25_wpc_x; c25_pbd_y = c25_lbb_a * c25_icd_b; c25_jcd_b = c25_dq4; c25_qbd_y = 0.00090160013448328346 * c25_jcd_b; c25_kcd_b = c25_theta_5; c25_rbd_y = 2.0 * c25_kcd_b; c25_xpc_x = c25_rbd_y; c25_ypc_x = c25_xpc_x; c25_ypc_x = muDoubleScalarSin(c25_ypc_x); c25_mbb_a = c25_qbd_y; c25_lcd_b = c25_ypc_x; c25_sbd_y = c25_mbb_a * c25_lcd_b; c25_mcd_b = c25_dq1; c25_tbd_y = 0.0016146178873500002 * c25_mcd_b; c25_aqc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) + c25_theta_5; c25_bqc_x = c25_aqc_x; c25_bqc_x = muDoubleScalarSin(c25_bqc_x); c25_nbb_a = c25_tbd_y; c25_ncd_b = c25_bqc_x; c25_ubd_y = c25_nbb_a * c25_ncd_b; c25_ocd_b = c25_dq6; c25_vbd_y = 6.9267456E-5 * c25_ocd_b; c25_cqc_x = c25_theta_5; c25_dqc_x = c25_cqc_x; c25_dqc_x = muDoubleScalarSin(c25_dqc_x); c25_obb_a = c25_vbd_y; c25_pcd_b = c25_dqc_x; c25_wbd_y = c25_obb_a * c25_pcd_b; c25_qcd_b = c25_dq1; c25_xbd_y = 0.0016146178873500002 * c25_qcd_b; c25_eqc_x = ((c25_theta_2 + c25_theta_3) + c25_theta_4) - c25_theta_5; c25_fqc_x = c25_eqc_x; c25_fqc_x = muDoubleScalarSin(c25_fqc_x); c25_pbb_a = c25_xbd_y; c25_rcd_b = c25_fqc_x; c25_ybd_y = c25_pbb_a * c25_rcd_b; c25_scd_b = c25_dq1; c25_acd_y = 0.0014202397504832836 * c25_scd_b; c25_gqc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_hqc_x = c25_gqc_x; c25_hqc_x = muDoubleScalarSin(c25_hqc_x); c25_qbb_a = c25_acd_y; c25_tcd_b = c25_hqc_x; c25_bcd_y = c25_qbb_a * c25_tcd_b; c25_c54 = (((((((c25_gbd_y - c25_jbd_y) - c25_mbd_y) - c25_pbd_y) - c25_sbd_y) + c25_ubd_y) + c25_wbd_y) - c25_ybd_y) + c25_bcd_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 90); c25_c55 = 0.0; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 91); c25_ucd_b = c25_dq2; c25_ccd_y = 6.9267456E-5 * c25_ucd_b; c25_iqc_x = c25_theta_5; c25_jqc_x = c25_iqc_x; c25_jqc_x = muDoubleScalarSin(c25_jqc_x); c25_rbb_a = c25_ccd_y; c25_vcd_b = c25_jqc_x; c25_dcd_y = c25_rbb_a * c25_vcd_b; c25_wcd_b = c25_dq3; c25_ecd_y = 6.9267456E-5 * c25_wcd_b; c25_kqc_x = c25_theta_5; c25_lqc_x = c25_kqc_x; c25_lqc_x = muDoubleScalarSin(c25_lqc_x); c25_sbb_a = c25_ecd_y; c25_xcd_b = c25_lqc_x; c25_fcd_y = c25_sbb_a * c25_xcd_b; c25_ycd_b = c25_dq4; c25_gcd_y = 6.9267456E-5 * c25_ycd_b; c25_mqc_x = c25_theta_5; c25_nqc_x = c25_mqc_x; c25_nqc_x = muDoubleScalarSin(c25_nqc_x); c25_tbb_a = c25_gcd_y; c25_add_b = c25_nqc_x; c25_hcd_y = c25_tbb_a * c25_add_b; c25_bdd_b = c25_dq1; c25_icd_y = 6.9267456E-5 * c25_bdd_b; c25_oqc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_pqc_x = c25_oqc_x; c25_pqc_x = muDoubleScalarSin(c25_pqc_x); c25_ubb_a = c25_icd_y; c25_cdd_b = c25_pqc_x; c25_jcd_y = c25_ubb_a * c25_cdd_b; c25_qqc_x = c25_theta_5; c25_rqc_x = c25_qqc_x; c25_rqc_x = muDoubleScalarCos(c25_rqc_x); c25_vbb_a = c25_jcd_y; c25_ddd_b = c25_rqc_x; c25_kcd_y = c25_vbb_a * c25_ddd_b; c25_c56 = ((c25_dcd_y + c25_fcd_y) + c25_hcd_y) + c25_kcd_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 92); c25_edd_b = c25_dq2; c25_lcd_y = -6.9267456E-5 * c25_edd_b; c25_sqc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_tqc_x = c25_sqc_x; c25_tqc_x = muDoubleScalarCos(c25_tqc_x); c25_wbb_a = c25_lcd_y; c25_fdd_b = c25_tqc_x; c25_mcd_y = c25_wbb_a * c25_fdd_b; c25_uqc_x = c25_theta_5; c25_vqc_x = c25_uqc_x; c25_vqc_x = muDoubleScalarSin(c25_vqc_x); c25_xbb_a = c25_mcd_y; c25_gdd_b = c25_vqc_x; c25_ncd_y = c25_xbb_a * c25_gdd_b; c25_hdd_b = c25_dq3; c25_ocd_y = 6.9267456E-5 * c25_hdd_b; c25_wqc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_xqc_x = c25_wqc_x; c25_xqc_x = muDoubleScalarCos(c25_xqc_x); c25_ybb_a = c25_ocd_y; c25_idd_b = c25_xqc_x; c25_pcd_y = c25_ybb_a * c25_idd_b; c25_yqc_x = c25_theta_5; c25_arc_x = c25_yqc_x; c25_arc_x = muDoubleScalarSin(c25_arc_x); c25_acb_a = c25_pcd_y; c25_jdd_b = c25_arc_x; c25_qcd_y = c25_acb_a * c25_jdd_b; c25_kdd_b = c25_dq4; c25_rcd_y = 6.9267456E-5 * c25_kdd_b; c25_brc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_crc_x = c25_brc_x; c25_crc_x = muDoubleScalarCos(c25_crc_x); c25_bcb_a = c25_rcd_y; c25_ldd_b = c25_crc_x; c25_scd_y = c25_bcb_a * c25_ldd_b; c25_drc_x = c25_theta_5; c25_erc_x = c25_drc_x; c25_erc_x = muDoubleScalarSin(c25_erc_x); c25_ccb_a = c25_scd_y; c25_mdd_b = c25_erc_x; c25_tcd_y = c25_ccb_a * c25_mdd_b; c25_ndd_b = c25_dq5; c25_ucd_y = 6.9267456E-5 * c25_ndd_b; c25_frc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_grc_x = c25_frc_x; c25_grc_x = muDoubleScalarSin(c25_grc_x); c25_dcb_a = c25_ucd_y; c25_odd_b = c25_grc_x; c25_vcd_y = c25_dcb_a * c25_odd_b; c25_hrc_x = c25_theta_5; c25_irc_x = c25_hrc_x; c25_irc_x = muDoubleScalarCos(c25_irc_x); c25_ecb_a = c25_vcd_y; c25_pdd_b = c25_irc_x; c25_wcd_y = c25_ecb_a * c25_pdd_b; c25_c61 = ((c25_ncd_y - c25_qcd_y) - c25_tcd_y) - c25_wcd_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 93); c25_jrc_x = c25_theta_5; c25_krc_x = c25_jrc_x; c25_krc_x = muDoubleScalarSin(c25_krc_x); c25_qdd_b = c25_krc_x; c25_xcd_y = -6.9267456E-5 * c25_qdd_b; c25_lrc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_mrc_x = c25_lrc_x; c25_mrc_x = muDoubleScalarCos(c25_mrc_x); c25_fcb_a = c25_dq1; c25_rdd_b = c25_mrc_x; c25_ycd_y = c25_fcb_a * c25_rdd_b; c25_gcb_a = c25_xcd_y; c25_sdd_b = c25_dq5 + c25_ycd_y; c25_c62 = c25_gcb_a * c25_sdd_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 94); c25_nrc_x = c25_theta_5; c25_orc_x = c25_nrc_x; c25_orc_x = muDoubleScalarSin(c25_orc_x); c25_tdd_b = c25_orc_x; c25_add_y = -6.9267456E-5 * c25_tdd_b; c25_prc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_qrc_x = c25_prc_x; c25_qrc_x = muDoubleScalarCos(c25_qrc_x); c25_hcb_a = c25_dq1; c25_udd_b = c25_qrc_x; c25_bdd_y = c25_hcb_a * c25_udd_b; c25_icb_a = c25_add_y; c25_vdd_b = c25_dq5 + c25_bdd_y; c25_c63 = c25_icb_a * c25_vdd_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 95); c25_rrc_x = c25_theta_5; c25_src_x = c25_rrc_x; c25_src_x = muDoubleScalarSin(c25_src_x); c25_wdd_b = c25_src_x; c25_cdd_y = -6.9267456E-5 * c25_wdd_b; c25_trc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_urc_x = c25_trc_x; c25_urc_x = muDoubleScalarCos(c25_urc_x); c25_jcb_a = c25_dq1; c25_xdd_b = c25_urc_x; c25_ddd_y = c25_jcb_a * c25_xdd_b; c25_kcb_a = c25_cdd_y; c25_ydd_b = c25_dq5 + c25_ddd_y; c25_c64 = c25_kcb_a * c25_ydd_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 96); c25_aed_b = c25_dq2; c25_edd_y = -6.9267456E-5 * c25_aed_b; c25_vrc_x = c25_theta_5; c25_wrc_x = c25_vrc_x; c25_wrc_x = muDoubleScalarSin(c25_wrc_x); c25_lcb_a = c25_edd_y; c25_bed_b = c25_wrc_x; c25_fdd_y = c25_lcb_a * c25_bed_b; c25_ced_b = c25_dq3; c25_gdd_y = 6.9267456E-5 * c25_ced_b; c25_xrc_x = c25_theta_5; c25_yrc_x = c25_xrc_x; c25_yrc_x = muDoubleScalarSin(c25_yrc_x); c25_mcb_a = c25_gdd_y; c25_ded_b = c25_yrc_x; c25_hdd_y = c25_mcb_a * c25_ded_b; c25_eed_b = c25_dq4; c25_idd_y = 6.9267456E-5 * c25_eed_b; c25_asc_x = c25_theta_5; c25_bsc_x = c25_asc_x; c25_bsc_x = muDoubleScalarSin(c25_bsc_x); c25_ncb_a = c25_idd_y; c25_fed_b = c25_bsc_x; c25_jdd_y = c25_ncb_a * c25_fed_b; c25_ged_b = c25_dq1; c25_kdd_y = 6.9267456E-5 * c25_ged_b; c25_csc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_dsc_x = c25_csc_x; c25_dsc_x = muDoubleScalarSin(c25_dsc_x); c25_ocb_a = c25_kdd_y; c25_hed_b = c25_dsc_x; c25_ldd_y = c25_ocb_a * c25_hed_b; c25_esc_x = c25_theta_5; c25_fsc_x = c25_esc_x; c25_fsc_x = muDoubleScalarCos(c25_fsc_x); c25_pcb_a = c25_ldd_y; c25_ied_b = c25_fsc_x; c25_mdd_y = c25_pcb_a * c25_ied_b; c25_c65 = ((c25_fdd_y - c25_hdd_y) - c25_jdd_y) - c25_mdd_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 97); c25_c66 = 0.0; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 100); c25_g1 = 0.0; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 101); c25_gsc_x = c25_theta_2 + c25_theta_3; c25_hsc_x = c25_gsc_x; c25_hsc_x = muDoubleScalarCos(c25_hsc_x); c25_jed_b = c25_hsc_x; c25_ndd_y = 16.19061467697 * c25_jed_b; c25_isc_x = c25_theta_2; c25_jsc_x = c25_isc_x; c25_jsc_x = muDoubleScalarCos(c25_jsc_x); c25_ked_b = c25_jsc_x; c25_odd_y = 37.929334950000005 * c25_ked_b; c25_ksc_x = c25_theta_5; c25_lsc_x = c25_ksc_x; c25_lsc_x = muDoubleScalarSin(c25_lsc_x); c25_led_b = c25_lsc_x; c25_pdd_y = c25_led_b; c25_msc_x = c25_theta_2 + c25_theta_3; c25_nsc_x = c25_msc_x; c25_nsc_x = muDoubleScalarSin(c25_nsc_x); c25_med_b = c25_nsc_x; c25_qdd_y = 0.34441422705900004 * c25_med_b; c25_osc_x = c25_theta_4; c25_psc_x = c25_osc_x; c25_psc_x = muDoubleScalarSin(c25_psc_x); c25_qcb_a = c25_qdd_y; c25_ned_b = c25_psc_x; c25_rdd_y = c25_qcb_a * c25_ned_b; c25_qsc_x = c25_theta_2 + c25_theta_3; c25_rsc_x = c25_qsc_x; c25_rsc_x = muDoubleScalarCos(c25_rsc_x); c25_oed_b = c25_rsc_x; c25_sdd_y = 0.34441422705900004 * c25_oed_b; c25_ssc_x = c25_theta_4; c25_tsc_x = c25_ssc_x; c25_tsc_x = muDoubleScalarCos(c25_tsc_x); c25_rcb_a = c25_sdd_y; c25_ped_b = c25_tsc_x; c25_tdd_y = c25_rcb_a * c25_ped_b; c25_scb_a = c25_pdd_y; c25_qed_b = c25_rdd_y - c25_tdd_y; c25_udd_y = c25_scb_a * c25_qed_b; c25_usc_x = c25_theta_2 + c25_theta_3; c25_vsc_x = c25_usc_x; c25_vsc_x = muDoubleScalarCos(c25_vsc_x); c25_red_b = c25_vsc_x; c25_vdd_y = 1.4574320676 * c25_red_b; c25_wsc_x = c25_theta_4; c25_xsc_x = c25_wsc_x; c25_xsc_x = muDoubleScalarSin(c25_xsc_x); c25_tcb_a = c25_vdd_y; c25_sed_b = c25_xsc_x; c25_wdd_y = c25_tcb_a * c25_sed_b; c25_ysc_x = c25_theta_2 + c25_theta_3; c25_atc_x = c25_ysc_x; c25_atc_x = muDoubleScalarSin(c25_atc_x); c25_ted_b = c25_atc_x; c25_xdd_y = 1.4574320676 * c25_ted_b; c25_btc_x = c25_theta_4; c25_ctc_x = c25_btc_x; c25_ctc_x = muDoubleScalarCos(c25_ctc_x); c25_ucb_a = c25_xdd_y; c25_ued_b = c25_ctc_x; c25_ydd_y = c25_ucb_a * c25_ued_b; c25_g2 = (((c25_ndd_y + c25_odd_y) - c25_udd_y) - c25_wdd_y) - c25_ydd_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 102); c25_dtc_x = c25_theta_2 + c25_theta_3; c25_etc_x = c25_dtc_x; c25_etc_x = muDoubleScalarCos(c25_etc_x); c25_ved_b = c25_etc_x; c25_aed_y = 16.19061467697 * c25_ved_b; c25_ftc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_gtc_x = c25_ftc_x; c25_gtc_x = muDoubleScalarSin(c25_gtc_x); c25_wed_b = c25_gtc_x; c25_bed_y = 1.4574320676 * c25_wed_b; c25_htc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_itc_x = c25_htc_x; c25_itc_x = muDoubleScalarCos(c25_itc_x); c25_xed_b = c25_itc_x; c25_ced_y = 0.34441422705900004 * c25_xed_b; c25_jtc_x = c25_theta_5; c25_ktc_x = c25_jtc_x; c25_ktc_x = muDoubleScalarSin(c25_ktc_x); c25_vcb_a = c25_ced_y; c25_yed_b = c25_ktc_x; c25_ded_y = c25_vcb_a * c25_yed_b; c25_g3 = (c25_aed_y - c25_bed_y) + c25_ded_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 103); c25_ltc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_mtc_x = c25_ltc_x; c25_mtc_x = muDoubleScalarCos(c25_mtc_x); c25_afd_b = c25_mtc_x; c25_eed_y = 0.34441422705900004 * c25_afd_b; c25_ntc_x = c25_theta_5; c25_otc_x = c25_ntc_x; c25_otc_x = muDoubleScalarSin(c25_otc_x); c25_wcb_a = c25_eed_y; c25_bfd_b = c25_otc_x; c25_fed_y = c25_wcb_a * c25_bfd_b; c25_ptc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_qtc_x = c25_ptc_x; c25_qtc_x = muDoubleScalarSin(c25_qtc_x); c25_cfd_b = c25_qtc_x; c25_ged_y = 1.4574320676 * c25_cfd_b; c25_g4 = c25_fed_y - c25_ged_y; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 104); c25_rtc_x = (c25_theta_2 + c25_theta_3) + c25_theta_4; c25_stc_x = c25_rtc_x; c25_stc_x = muDoubleScalarSin(c25_stc_x); c25_dfd_b = c25_stc_x; c25_hed_y = 0.34441422705900004 * c25_dfd_b; c25_ttc_x = c25_theta_5; c25_utc_x = c25_ttc_x; c25_utc_x = muDoubleScalarCos(c25_utc_x); c25_xcb_a = c25_hed_y; c25_efd_b = c25_utc_x; c25_g5 = c25_xcb_a * c25_efd_b; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 105); c25_g6 = 0.0; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 109); c25_M[0] = c25_m11; c25_M[6] = c25_m12; c25_M[12] = c25_m13; c25_M[18] = c25_m14; c25_M[24] = c25_m15; c25_M[30] = c25_m16; c25_M[1] = c25_m21; c25_M[7] = c25_m22; c25_M[13] = c25_m23; c25_M[19] = c25_m24; c25_M[25] = c25_m25; c25_M[31] = c25_m26; c25_M[2] = c25_m31; c25_M[8] = c25_m32; c25_M[14] = c25_m33; c25_M[20] = c25_m34; c25_M[26] = c25_m35; c25_M[32] = c25_m36; c25_M[3] = c25_m41; c25_M[9] = c25_m42; c25_M[15] = c25_m43; c25_M[21] = c25_m44; c25_M[27] = c25_m45; c25_M[33] = c25_m46; c25_M[4] = c25_m51; c25_M[10] = c25_m52; c25_M[16] = c25_m53; c25_M[22] = c25_m54; c25_M[28] = c25_m55; c25_M[34] = c25_m56; c25_M[5] = c25_m61; c25_M[11] = c25_m62; c25_M[17] = c25_m63; c25_M[23] = c25_m64; c25_M[29] = c25_m65; c25_M[35] = c25_m66; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 110); c25_C[0] = c25_c11; c25_C[6] = c25_c12; c25_C[12] = c25_c13; c25_C[18] = c25_c14; c25_C[24] = c25_c15; c25_C[30] = c25_c16; c25_C[1] = c25_c21; c25_C[7] = c25_c22; c25_C[13] = c25_c23; c25_C[19] = c25_c24; c25_C[25] = c25_c25; c25_C[31] = c25_c26; c25_C[2] = c25_c31; c25_C[8] = c25_c32; c25_C[14] = c25_c33; c25_C[20] = c25_c34; c25_C[26] = c25_c35; c25_C[32] = c25_c36; c25_C[3] = c25_c41; c25_C[9] = c25_c42; c25_C[15] = c25_c43; c25_C[21] = c25_c44; c25_C[27] = c25_c45; c25_C[33] = c25_c46; c25_C[4] = c25_c51; c25_C[10] = c25_c52; c25_C[16] = c25_c53; c25_C[22] = c25_c54; c25_C[28] = c25_c55; c25_C[34] = c25_c56; c25_C[5] = c25_c61; c25_C[11] = c25_c62; c25_C[17] = c25_c63; c25_C[23] = c25_c64; c25_C[29] = c25_c65; c25_C[35] = c25_c66; _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 111); c25_ycb_a[0] = c25_g1; c25_ycb_a[1] = c25_g2; c25_ycb_a[2] = c25_g3; c25_ycb_a[3] = c25_g4; c25_ycb_a[4] = c25_g5; c25_ycb_a[5] = c25_g6; for (c25_i22 = 0; c25_i22 < 6; c25_i22++) { c25_G[c25_i22] = -c25_ycb_a[c25_i22]; } _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, 113); for (c25_i23 = 0; c25_i23 < 36; c25_i23++) { c25_adb_a[c25_i23] = c25_C[c25_i23]; } for (c25_i24 = 0; c25_i24 < 6; c25_i24++) { c25_ycb_a[c25_i24] = c25_dq[c25_i24]; } c25_b_eml_scalar_eg(chartInstance); c25_b_eml_scalar_eg(chartInstance); for (c25_i25 = 0; c25_i25 < 6; c25_i25++) { c25_CDq[c25_i25] = 0.0; } for (c25_i26 = 0; c25_i26 < 6; c25_i26++) { c25_CDq[c25_i26] = 0.0; } for (c25_i27 = 0; c25_i27 < 6; c25_i27++) { c25_b_C[c25_i27] = c25_CDq[c25_i27]; } for (c25_i28 = 0; c25_i28 < 6; c25_i28++) { c25_CDq[c25_i28] = c25_b_C[c25_i28]; } for (c25_i29 = 0; c25_i29 < 6; c25_i29++) { c25_b_C[c25_i29] = c25_CDq[c25_i29]; } for (c25_i30 = 0; c25_i30 < 6; c25_i30++) { c25_CDq[c25_i30] = c25_b_C[c25_i30]; } for (c25_i31 = 0; c25_i31 < 6; c25_i31++) { c25_CDq[c25_i31] = 0.0; c25_i32 = 0; for (c25_i33 = 0; c25_i33 < 6; c25_i33++) { c25_CDq[c25_i31] += c25_adb_a[c25_i32 + c25_i31] * c25_ycb_a[c25_i33]; c25_i32 += 6; } } _SFD_SCRIPT_CALL(0U, chartInstance->c25_sfEvent, -113); _SFD_SYMBOL_SCOPE_POP(); } static void init_script_number_translation(uint32_T c25_machineNumber, uint32_T c25_chartNumber) { _SFD_SCRIPT_TRANSLATION(c25_chartNumber, 0U, sf_debug_get_script_id( "/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl_ForceEstim/ur5_matrices.m")); } static const mxArray *c25_sf_marshallOut(void *chartInstanceVoid, void *c25_inData) { const mxArray *c25_mxArrayOutData = NULL; int32_T c25_i34; real_T c25_b_inData[6]; int32_T c25_i35; real_T c25_u[6]; const mxArray *c25_y = NULL; SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) chartInstanceVoid; c25_mxArrayOutData = NULL; for (c25_i34 = 0; c25_i34 < 6; c25_i34++) { c25_b_inData[c25_i34] = (*(real_T (*)[6])c25_inData)[c25_i34]; } for (c25_i35 = 0; c25_i35 < 6; c25_i35++) { c25_u[c25_i35] = c25_b_inData[c25_i35]; } c25_y = NULL; sf_mex_assign(&c25_y, sf_mex_create("y", c25_u, 0, 0U, 1U, 0U, 1, 6), FALSE); sf_mex_assign(&c25_mxArrayOutData, c25_y, FALSE); return c25_mxArrayOutData; } static void c25_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_ddq, const char_T *c25_identifier, real_T c25_y[6]) { emlrtMsgIdentifier c25_thisId; c25_thisId.fIdentifier = c25_identifier; c25_thisId.fParent = NULL; c25_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c25_ddq), &c25_thisId, c25_y); sf_mex_destroy(&c25_ddq); } static void c25_b_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId, real_T c25_y[6]) { real_T c25_dv5[6]; int32_T c25_i36; sf_mex_import(c25_parentId, sf_mex_dup(c25_u), c25_dv5, 1, 0, 0U, 1, 0U, 1, 6); for (c25_i36 = 0; c25_i36 < 6; c25_i36++) { c25_y[c25_i36] = c25_dv5[c25_i36]; } sf_mex_destroy(&c25_u); } static void c25_sf_marshallIn(void *chartInstanceVoid, const mxArray *c25_mxArrayInData, const char_T *c25_varName, void *c25_outData) { const mxArray *c25_ddq; const char_T *c25_identifier; emlrtMsgIdentifier c25_thisId; real_T c25_y[6]; int32_T c25_i37; SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) chartInstanceVoid; c25_ddq = sf_mex_dup(c25_mxArrayInData); c25_identifier = c25_varName; c25_thisId.fIdentifier = c25_identifier; c25_thisId.fParent = NULL; c25_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c25_ddq), &c25_thisId, c25_y); sf_mex_destroy(&c25_ddq); for (c25_i37 = 0; c25_i37 < 6; c25_i37++) { (*(real_T (*)[6])c25_outData)[c25_i37] = c25_y[c25_i37]; } sf_mex_destroy(&c25_mxArrayInData); } static const mxArray *c25_b_sf_marshallOut(void *chartInstanceVoid, void *c25_inData) { const mxArray *c25_mxArrayOutData = NULL; real_T c25_u; const mxArray *c25_y = NULL; SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) chartInstanceVoid; c25_mxArrayOutData = NULL; c25_u = *(real_T *)c25_inData; c25_y = NULL; sf_mex_assign(&c25_y, sf_mex_create("y", &c25_u, 0, 0U, 0U, 0U, 0), FALSE); sf_mex_assign(&c25_mxArrayOutData, c25_y, FALSE); return c25_mxArrayOutData; } static real_T c25_c_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId) { real_T c25_y; real_T c25_d0; sf_mex_import(c25_parentId, sf_mex_dup(c25_u), &c25_d0, 1, 0, 0U, 0, 0U, 0); c25_y = c25_d0; sf_mex_destroy(&c25_u); return c25_y; } static void c25_b_sf_marshallIn(void *chartInstanceVoid, const mxArray *c25_mxArrayInData, const char_T *c25_varName, void *c25_outData) { const mxArray *c25_nargout; const char_T *c25_identifier; emlrtMsgIdentifier c25_thisId; real_T c25_y; SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) chartInstanceVoid; c25_nargout = sf_mex_dup(c25_mxArrayInData); c25_identifier = c25_varName; c25_thisId.fIdentifier = c25_identifier; c25_thisId.fParent = NULL; c25_y = c25_c_emlrt_marshallIn(chartInstance, sf_mex_dup(c25_nargout), &c25_thisId); sf_mex_destroy(&c25_nargout); *(real_T *)c25_outData = c25_y; sf_mex_destroy(&c25_mxArrayInData); } static const mxArray *c25_c_sf_marshallOut(void *chartInstanceVoid, void *c25_inData) { const mxArray *c25_mxArrayOutData = NULL; int32_T c25_i38; int32_T c25_i39; int32_T c25_i40; real_T c25_b_inData[36]; int32_T c25_i41; int32_T c25_i42; int32_T c25_i43; real_T c25_u[36]; const mxArray *c25_y = NULL; SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) chartInstanceVoid; c25_mxArrayOutData = NULL; c25_i38 = 0; for (c25_i39 = 0; c25_i39 < 6; c25_i39++) { for (c25_i40 = 0; c25_i40 < 6; c25_i40++) { c25_b_inData[c25_i40 + c25_i38] = (*(real_T (*)[36])c25_inData)[c25_i40 + c25_i38]; } c25_i38 += 6; } c25_i41 = 0; for (c25_i42 = 0; c25_i42 < 6; c25_i42++) { for (c25_i43 = 0; c25_i43 < 6; c25_i43++) { c25_u[c25_i43 + c25_i41] = c25_b_inData[c25_i43 + c25_i41]; } c25_i41 += 6; } c25_y = NULL; sf_mex_assign(&c25_y, sf_mex_create("y", c25_u, 0, 0U, 1U, 0U, 2, 6, 6), FALSE); sf_mex_assign(&c25_mxArrayOutData, c25_y, FALSE); return c25_mxArrayOutData; } static void c25_d_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId, real_T c25_y[36]) { real_T c25_dv6[36]; int32_T c25_i44; sf_mex_import(c25_parentId, sf_mex_dup(c25_u), c25_dv6, 1, 0, 0U, 1, 0U, 2, 6, 6); for (c25_i44 = 0; c25_i44 < 36; c25_i44++) { c25_y[c25_i44] = c25_dv6[c25_i44]; } sf_mex_destroy(&c25_u); } static void c25_c_sf_marshallIn(void *chartInstanceVoid, const mxArray *c25_mxArrayInData, const char_T *c25_varName, void *c25_outData) { const mxArray *c25_M; const char_T *c25_identifier; emlrtMsgIdentifier c25_thisId; real_T c25_y[36]; int32_T c25_i45; int32_T c25_i46; int32_T c25_i47; SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) chartInstanceVoid; c25_M = sf_mex_dup(c25_mxArrayInData); c25_identifier = c25_varName; c25_thisId.fIdentifier = c25_identifier; c25_thisId.fParent = NULL; c25_d_emlrt_marshallIn(chartInstance, sf_mex_dup(c25_M), &c25_thisId, c25_y); sf_mex_destroy(&c25_M); c25_i45 = 0; for (c25_i46 = 0; c25_i46 < 6; c25_i46++) { for (c25_i47 = 0; c25_i47 < 6; c25_i47++) { (*(real_T (*)[36])c25_outData)[c25_i47 + c25_i45] = c25_y[c25_i47 + c25_i45]; } c25_i45 += 6; } sf_mex_destroy(&c25_mxArrayInData); } const mxArray *sf_c25_JointSpaceControl_BestInertia_get_eml_resolved_functions_info(void) { const mxArray *c25_nameCaptureInfo; c25_ResolvedFunctionInfo c25_info[127]; const mxArray *c25_m0 = NULL; int32_T c25_i48; c25_ResolvedFunctionInfo *c25_r0; c25_nameCaptureInfo = NULL; c25_nameCaptureInfo = NULL; c25_info_helper(c25_info); c25_b_info_helper(c25_info); sf_mex_assign(&c25_m0, sf_mex_createstruct("nameCaptureInfo", 1, 127), FALSE); for (c25_i48 = 0; c25_i48 < 127; c25_i48++) { c25_r0 = &c25_info[c25_i48]; sf_mex_addfield(c25_m0, sf_mex_create("nameCaptureInfo", c25_r0->context, 15, 0U, 0U, 0U, 2, 1, strlen(c25_r0->context)), "context", "nameCaptureInfo", c25_i48); sf_mex_addfield(c25_m0, sf_mex_create("nameCaptureInfo", c25_r0->name, 15, 0U, 0U, 0U, 2, 1, strlen(c25_r0->name)), "name", "nameCaptureInfo", c25_i48); sf_mex_addfield(c25_m0, sf_mex_create("nameCaptureInfo", c25_r0->dominantType, 15, 0U, 0U, 0U, 2, 1, strlen(c25_r0->dominantType)), "dominantType", "nameCaptureInfo", c25_i48); sf_mex_addfield(c25_m0, sf_mex_create("nameCaptureInfo", c25_r0->resolved, 15, 0U, 0U, 0U, 2, 1, strlen(c25_r0->resolved)), "resolved", "nameCaptureInfo", c25_i48); sf_mex_addfield(c25_m0, sf_mex_create("nameCaptureInfo", &c25_r0->fileTimeLo, 7, 0U, 0U, 0U, 0), "fileTimeLo", "nameCaptureInfo", c25_i48); sf_mex_addfield(c25_m0, sf_mex_create("nameCaptureInfo", &c25_r0->fileTimeHi, 7, 0U, 0U, 0U, 0), "fileTimeHi", "nameCaptureInfo", c25_i48); sf_mex_addfield(c25_m0, sf_mex_create("nameCaptureInfo", &c25_r0->mFileTimeLo, 7, 0U, 0U, 0U, 0), "mFileTimeLo", "nameCaptureInfo", c25_i48); sf_mex_addfield(c25_m0, sf_mex_create("nameCaptureInfo", &c25_r0->mFileTimeHi, 7, 0U, 0U, 0U, 0), "mFileTimeHi", "nameCaptureInfo", c25_i48); } sf_mex_assign(&c25_nameCaptureInfo, c25_m0, FALSE); sf_mex_emlrtNameCapturePostProcessR2012a(&c25_nameCaptureInfo); return c25_nameCaptureInfo; } static void c25_info_helper(c25_ResolvedFunctionInfo c25_info[127]) { c25_info[0].context = ""; c25_info[0].name = "ur5_matrices"; c25_info[0].dominantType = "double"; c25_info[0].resolved = "[E]/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl_ForceEstim/ur5_matrices.m"; c25_info[0].fileTimeLo = 1383398213U; c25_info[0].fileTimeHi = 0U; c25_info[0].mFileTimeLo = 0U; c25_info[0].mFileTimeHi = 0U; c25_info[1].context = "[E]/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl_ForceEstim/ur5_matrices.m"; c25_info[1].name = "sin"; c25_info[1].dominantType = "double"; c25_info[1].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/sin.m"; c25_info[1].fileTimeLo = 1343851986U; c25_info[1].fileTimeHi = 0U; c25_info[1].mFileTimeLo = 0U; c25_info[1].mFileTimeHi = 0U; c25_info[2].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/sin.m"; c25_info[2].name = "eml_scalar_sin"; c25_info[2].dominantType = "double"; c25_info[2].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_sin.m"; c25_info[2].fileTimeLo = 1286840336U; c25_info[2].fileTimeHi = 0U; c25_info[2].mFileTimeLo = 0U; c25_info[2].mFileTimeHi = 0U; c25_info[3].context = "[E]/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl_ForceEstim/ur5_matrices.m"; c25_info[3].name = "mtimes"; c25_info[3].dominantType = "double"; c25_info[3].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; c25_info[3].fileTimeLo = 1289541292U; c25_info[3].fileTimeHi = 0U; c25_info[3].mFileTimeLo = 0U; c25_info[3].mFileTimeHi = 0U; c25_info[4].context = "[E]/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl_ForceEstim/ur5_matrices.m"; c25_info[4].name = "cos"; c25_info[4].dominantType = "double"; c25_info[4].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/cos.m"; c25_info[4].fileTimeLo = 1343851972U; c25_info[4].fileTimeHi = 0U; c25_info[4].mFileTimeLo = 0U; c25_info[4].mFileTimeHi = 0U; c25_info[5].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/cos.m"; c25_info[5].name = "eml_scalar_cos"; c25_info[5].dominantType = "double"; c25_info[5].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_cos.m"; c25_info[5].fileTimeLo = 1286840322U; c25_info[5].fileTimeHi = 0U; c25_info[5].mFileTimeLo = 0U; c25_info[5].mFileTimeHi = 0U; c25_info[6].context = "[E]/Users/kasiunia/Documents/Diplomarbeit/DA_Matlab/JointSpaceControl_ForceEstim/ur5_matrices.m"; c25_info[6].name = "mpower"; c25_info[6].dominantType = "double"; c25_info[6].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m"; c25_info[6].fileTimeLo = 1286840442U; c25_info[6].fileTimeHi = 0U; c25_info[6].mFileTimeLo = 0U; c25_info[6].mFileTimeHi = 0U; c25_info[7].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m"; c25_info[7].name = "power"; c25_info[7].dominantType = "double"; c25_info[7].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m"; c25_info[7].fileTimeLo = 1348213530U; c25_info[7].fileTimeHi = 0U; c25_info[7].mFileTimeLo = 0U; c25_info[7].mFileTimeHi = 0U; c25_info[8].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"; c25_info[8].name = "eml_scalar_eg"; c25_info[8].dominantType = "double"; c25_info[8].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[8].fileTimeLo = 1286840396U; c25_info[8].fileTimeHi = 0U; c25_info[8].mFileTimeLo = 0U; c25_info[8].mFileTimeHi = 0U; c25_info[9].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"; c25_info[9].name = "eml_scalexp_alloc"; c25_info[9].dominantType = "double"; c25_info[9].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m"; c25_info[9].fileTimeLo = 1352446460U; c25_info[9].fileTimeHi = 0U; c25_info[9].mFileTimeLo = 0U; c25_info[9].mFileTimeHi = 0U; c25_info[10].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"; c25_info[10].name = "floor"; c25_info[10].dominantType = "double"; c25_info[10].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/floor.m"; c25_info[10].fileTimeLo = 1343851980U; c25_info[10].fileTimeHi = 0U; c25_info[10].mFileTimeLo = 0U; c25_info[10].mFileTimeHi = 0U; c25_info[11].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/floor.m"; c25_info[11].name = "eml_scalar_floor"; c25_info[11].dominantType = "double"; c25_info[11].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_floor.m"; c25_info[11].fileTimeLo = 1286840326U; c25_info[11].fileTimeHi = 0U; c25_info[11].mFileTimeLo = 0U; c25_info[11].mFileTimeHi = 0U; c25_info[12].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!scalar_float_power"; c25_info[12].name = "eml_scalar_eg"; c25_info[12].dominantType = "double"; c25_info[12].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[12].fileTimeLo = 1286840396U; c25_info[12].fileTimeHi = 0U; c25_info[12].mFileTimeLo = 0U; c25_info[12].mFileTimeHi = 0U; c25_info[13].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!scalar_float_power"; c25_info[13].name = "mtimes"; c25_info[13].dominantType = "double"; c25_info[13].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; c25_info[13].fileTimeLo = 1289541292U; c25_info[13].fileTimeHi = 0U; c25_info[13].mFileTimeLo = 0U; c25_info[13].mFileTimeHi = 0U; c25_info[14].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; c25_info[14].name = "eml_index_class"; c25_info[14].dominantType = ""; c25_info[14].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[14].fileTimeLo = 1323192178U; c25_info[14].fileTimeHi = 0U; c25_info[14].mFileTimeLo = 0U; c25_info[14].mFileTimeHi = 0U; c25_info[15].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; c25_info[15].name = "eml_scalar_eg"; c25_info[15].dominantType = "double"; c25_info[15].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[15].fileTimeLo = 1286840396U; c25_info[15].fileTimeHi = 0U; c25_info[15].mFileTimeLo = 0U; c25_info[15].mFileTimeHi = 0U; c25_info[16].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; c25_info[16].name = "eml_xgemm"; c25_info[16].dominantType = "char"; c25_info[16].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgemm.m"; c25_info[16].fileTimeLo = 1299098372U; c25_info[16].fileTimeHi = 0U; c25_info[16].mFileTimeLo = 0U; c25_info[16].mFileTimeHi = 0U; c25_info[17].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgemm.m"; c25_info[17].name = "eml_blas_inline"; c25_info[17].dominantType = ""; c25_info[17].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_blas_inline.m"; c25_info[17].fileTimeLo = 1299098368U; c25_info[17].fileTimeHi = 0U; c25_info[17].mFileTimeLo = 0U; c25_info[17].mFileTimeHi = 0U; c25_info[18].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xgemm.m!below_threshold"; c25_info[18].name = "mtimes"; c25_info[18].dominantType = "double"; c25_info[18].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; c25_info[18].fileTimeLo = 1289541292U; c25_info[18].fileTimeHi = 0U; c25_info[18].mFileTimeLo = 0U; c25_info[18].mFileTimeHi = 0U; c25_info[19].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xgemm.m"; c25_info[19].name = "eml_index_class"; c25_info[19].dominantType = ""; c25_info[19].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[19].fileTimeLo = 1323192178U; c25_info[19].fileTimeHi = 0U; c25_info[19].mFileTimeLo = 0U; c25_info[19].mFileTimeHi = 0U; c25_info[20].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xgemm.m"; c25_info[20].name = "eml_scalar_eg"; c25_info[20].dominantType = "double"; c25_info[20].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[20].fileTimeLo = 1286840396U; c25_info[20].fileTimeHi = 0U; c25_info[20].mFileTimeLo = 0U; c25_info[20].mFileTimeHi = 0U; c25_info[21].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xgemm.m"; c25_info[21].name = "eml_refblas_xgemm"; c25_info[21].dominantType = "char"; c25_info[21].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgemm.m"; c25_info[21].fileTimeLo = 1299098374U; c25_info[21].fileTimeHi = 0U; c25_info[21].mFileTimeLo = 0U; c25_info[21].mFileTimeHi = 0U; c25_info[22].context = ""; c25_info[22].name = "mldivide"; c25_info[22].dominantType = "double"; c25_info[22].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mldivide.p"; c25_info[22].fileTimeLo = 1357973148U; c25_info[22].fileTimeHi = 0U; c25_info[22].mFileTimeLo = 1319751566U; c25_info[22].mFileTimeHi = 0U; c25_info[23].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mldivide.p"; c25_info[23].name = "eml_lusolve"; c25_info[23].dominantType = "double"; c25_info[23].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_lusolve.m"; c25_info[23].fileTimeLo = 1309472796U; c25_info[23].fileTimeHi = 0U; c25_info[23].mFileTimeLo = 0U; c25_info[23].mFileTimeHi = 0U; c25_info[24].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_lusolve.m"; c25_info[24].name = "eml_index_class"; c25_info[24].dominantType = ""; c25_info[24].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[24].fileTimeLo = 1323192178U; c25_info[24].fileTimeHi = 0U; c25_info[24].mFileTimeLo = 0U; c25_info[24].mFileTimeHi = 0U; c25_info[25].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_lusolve.m!lusolveNxN"; c25_info[25].name = "eml_index_class"; c25_info[25].dominantType = ""; c25_info[25].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[25].fileTimeLo = 1323192178U; c25_info[25].fileTimeHi = 0U; c25_info[25].mFileTimeLo = 0U; c25_info[25].mFileTimeHi = 0U; c25_info[26].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_lusolve.m!lusolveNxN"; c25_info[26].name = "eml_xgetrf"; c25_info[26].dominantType = "double"; c25_info[26].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/eml_xgetrf.m"; c25_info[26].fileTimeLo = 1286840406U; c25_info[26].fileTimeHi = 0U; c25_info[26].mFileTimeLo = 0U; c25_info[26].mFileTimeHi = 0U; c25_info[27].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/eml_xgetrf.m"; c25_info[27].name = "eml_lapack_xgetrf"; c25_info[27].dominantType = "double"; c25_info[27].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/internal/eml_lapack_xgetrf.m"; c25_info[27].fileTimeLo = 1286840410U; c25_info[27].fileTimeHi = 0U; c25_info[27].mFileTimeLo = 0U; c25_info[27].mFileTimeHi = 0U; c25_info[28].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/internal/eml_lapack_xgetrf.m"; c25_info[28].name = "eml_matlab_zgetrf"; c25_info[28].dominantType = "double"; c25_info[28].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[28].fileTimeLo = 1302710594U; c25_info[28].fileTimeHi = 0U; c25_info[28].mFileTimeLo = 0U; c25_info[28].mFileTimeHi = 0U; c25_info[29].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[29].name = "realmin"; c25_info[29].dominantType = "char"; c25_info[29].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/realmin.m"; c25_info[29].fileTimeLo = 1307672842U; c25_info[29].fileTimeHi = 0U; c25_info[29].mFileTimeLo = 0U; c25_info[29].mFileTimeHi = 0U; c25_info[30].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/realmin.m"; c25_info[30].name = "eml_realmin"; c25_info[30].dominantType = "char"; c25_info[30].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_realmin.m"; c25_info[30].fileTimeLo = 1307672844U; c25_info[30].fileTimeHi = 0U; c25_info[30].mFileTimeLo = 0U; c25_info[30].mFileTimeHi = 0U; c25_info[31].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_realmin.m"; c25_info[31].name = "eml_float_model"; c25_info[31].dominantType = "char"; c25_info[31].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_float_model.m"; c25_info[31].fileTimeLo = 1326749596U; c25_info[31].fileTimeHi = 0U; c25_info[31].mFileTimeLo = 0U; c25_info[31].mFileTimeHi = 0U; c25_info[32].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[32].name = "eps"; c25_info[32].dominantType = "char"; c25_info[32].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/eps.m"; c25_info[32].fileTimeLo = 1326749596U; c25_info[32].fileTimeHi = 0U; c25_info[32].mFileTimeLo = 0U; c25_info[32].mFileTimeHi = 0U; c25_info[33].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/eps.m"; c25_info[33].name = "eml_is_float_class"; c25_info[33].dominantType = "char"; c25_info[33].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_is_float_class.m"; c25_info[33].fileTimeLo = 1286840382U; c25_info[33].fileTimeHi = 0U; c25_info[33].mFileTimeLo = 0U; c25_info[33].mFileTimeHi = 0U; c25_info[34].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/eps.m"; c25_info[34].name = "eml_eps"; c25_info[34].dominantType = "char"; c25_info[34].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_eps.m"; c25_info[34].fileTimeLo = 1326749596U; c25_info[34].fileTimeHi = 0U; c25_info[34].mFileTimeLo = 0U; c25_info[34].mFileTimeHi = 0U; c25_info[35].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_eps.m"; c25_info[35].name = "eml_float_model"; c25_info[35].dominantType = "char"; c25_info[35].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_float_model.m"; c25_info[35].fileTimeLo = 1326749596U; c25_info[35].fileTimeHi = 0U; c25_info[35].mFileTimeLo = 0U; c25_info[35].mFileTimeHi = 0U; c25_info[36].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[36].name = "min"; c25_info[36].dominantType = "coder.internal.indexInt"; c25_info[36].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/min.m"; c25_info[36].fileTimeLo = 1311276918U; c25_info[36].fileTimeHi = 0U; c25_info[36].mFileTimeLo = 0U; c25_info[36].mFileTimeHi = 0U; c25_info[37].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/min.m"; c25_info[37].name = "eml_min_or_max"; c25_info[37].dominantType = "char"; c25_info[37].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m"; c25_info[37].fileTimeLo = 1334093090U; c25_info[37].fileTimeHi = 0U; c25_info[37].mFileTimeLo = 0U; c25_info[37].mFileTimeHi = 0U; c25_info[38].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_bin_extremum"; c25_info[38].name = "eml_scalar_eg"; c25_info[38].dominantType = "coder.internal.indexInt"; c25_info[38].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[38].fileTimeLo = 1286840396U; c25_info[38].fileTimeHi = 0U; c25_info[38].mFileTimeLo = 0U; c25_info[38].mFileTimeHi = 0U; c25_info[39].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_bin_extremum"; c25_info[39].name = "eml_scalexp_alloc"; c25_info[39].dominantType = "coder.internal.indexInt"; c25_info[39].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m"; c25_info[39].fileTimeLo = 1352446460U; c25_info[39].fileTimeHi = 0U; c25_info[39].mFileTimeLo = 0U; c25_info[39].mFileTimeHi = 0U; c25_info[40].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_bin_extremum"; c25_info[40].name = "eml_index_class"; c25_info[40].dominantType = ""; c25_info[40].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[40].fileTimeLo = 1323192178U; c25_info[40].fileTimeHi = 0U; c25_info[40].mFileTimeLo = 0U; c25_info[40].mFileTimeHi = 0U; c25_info[41].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_scalar_bin_extremum"; c25_info[41].name = "eml_scalar_eg"; c25_info[41].dominantType = "coder.internal.indexInt"; c25_info[41].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[41].fileTimeLo = 1286840396U; c25_info[41].fileTimeHi = 0U; c25_info[41].mFileTimeLo = 0U; c25_info[41].mFileTimeHi = 0U; c25_info[42].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[42].name = "colon"; c25_info[42].dominantType = "double"; c25_info[42].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m"; c25_info[42].fileTimeLo = 1348213528U; c25_info[42].fileTimeHi = 0U; c25_info[42].mFileTimeLo = 0U; c25_info[42].mFileTimeHi = 0U; c25_info[43].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m"; c25_info[43].name = "colon"; c25_info[43].dominantType = "double"; c25_info[43].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m"; c25_info[43].fileTimeLo = 1348213528U; c25_info[43].fileTimeHi = 0U; c25_info[43].mFileTimeLo = 0U; c25_info[43].mFileTimeHi = 0U; c25_info[44].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m"; c25_info[44].name = "floor"; c25_info[44].dominantType = "double"; c25_info[44].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/floor.m"; c25_info[44].fileTimeLo = 1343851980U; c25_info[44].fileTimeHi = 0U; c25_info[44].mFileTimeLo = 0U; c25_info[44].mFileTimeHi = 0U; c25_info[45].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!checkrange"; c25_info[45].name = "intmin"; c25_info[45].dominantType = "char"; c25_info[45].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmin.m"; c25_info[45].fileTimeLo = 1311276918U; c25_info[45].fileTimeHi = 0U; c25_info[45].mFileTimeLo = 0U; c25_info[45].mFileTimeHi = 0U; c25_info[46].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!checkrange"; c25_info[46].name = "intmax"; c25_info[46].dominantType = "char"; c25_info[46].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m"; c25_info[46].fileTimeLo = 1311276916U; c25_info[46].fileTimeHi = 0U; c25_info[46].mFileTimeLo = 0U; c25_info[46].mFileTimeHi = 0U; c25_info[47].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!eml_integer_colon_dispatcher"; c25_info[47].name = "intmin"; c25_info[47].dominantType = "char"; c25_info[47].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmin.m"; c25_info[47].fileTimeLo = 1311276918U; c25_info[47].fileTimeHi = 0U; c25_info[47].mFileTimeLo = 0U; c25_info[47].mFileTimeHi = 0U; c25_info[48].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!eml_integer_colon_dispatcher"; c25_info[48].name = "intmax"; c25_info[48].dominantType = "char"; c25_info[48].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m"; c25_info[48].fileTimeLo = 1311276916U; c25_info[48].fileTimeHi = 0U; c25_info[48].mFileTimeLo = 0U; c25_info[48].mFileTimeHi = 0U; c25_info[49].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!eml_integer_colon_dispatcher"; c25_info[49].name = "eml_isa_uint"; c25_info[49].dominantType = "coder.internal.indexInt"; c25_info[49].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isa_uint.m"; c25_info[49].fileTimeLo = 1286840384U; c25_info[49].fileTimeHi = 0U; c25_info[49].mFileTimeLo = 0U; c25_info[49].mFileTimeHi = 0U; c25_info[50].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!integer_colon_length_nonnegd"; c25_info[50].name = "eml_unsigned_class"; c25_info[50].dominantType = "char"; c25_info[50].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_unsigned_class.m"; c25_info[50].fileTimeLo = 1323192180U; c25_info[50].fileTimeHi = 0U; c25_info[50].mFileTimeLo = 0U; c25_info[50].mFileTimeHi = 0U; c25_info[51].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_unsigned_class.m"; c25_info[51].name = "eml_index_class"; c25_info[51].dominantType = ""; c25_info[51].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[51].fileTimeLo = 1323192178U; c25_info[51].fileTimeHi = 0U; c25_info[51].mFileTimeLo = 0U; c25_info[51].mFileTimeHi = 0U; c25_info[52].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!integer_colon_length_nonnegd"; c25_info[52].name = "eml_index_class"; c25_info[52].dominantType = ""; c25_info[52].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[52].fileTimeLo = 1323192178U; c25_info[52].fileTimeHi = 0U; c25_info[52].mFileTimeLo = 0U; c25_info[52].mFileTimeHi = 0U; c25_info[53].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!integer_colon_length_nonnegd"; c25_info[53].name = "intmax"; c25_info[53].dominantType = "char"; c25_info[53].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m"; c25_info[53].fileTimeLo = 1311276916U; c25_info[53].fileTimeHi = 0U; c25_info[53].mFileTimeLo = 0U; c25_info[53].mFileTimeHi = 0U; c25_info[54].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!integer_colon_length_nonnegd"; c25_info[54].name = "eml_isa_uint"; c25_info[54].dominantType = "coder.internal.indexInt"; c25_info[54].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isa_uint.m"; c25_info[54].fileTimeLo = 1286840384U; c25_info[54].fileTimeHi = 0U; c25_info[54].mFileTimeLo = 0U; c25_info[54].mFileTimeHi = 0U; c25_info[55].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!integer_colon_length_nonnegd"; c25_info[55].name = "eml_index_plus"; c25_info[55].dominantType = "double"; c25_info[55].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[55].fileTimeLo = 1286840378U; c25_info[55].fileTimeHi = 0U; c25_info[55].mFileTimeLo = 0U; c25_info[55].mFileTimeHi = 0U; c25_info[56].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[56].name = "eml_index_class"; c25_info[56].dominantType = ""; c25_info[56].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[56].fileTimeLo = 1323192178U; c25_info[56].fileTimeHi = 0U; c25_info[56].mFileTimeLo = 0U; c25_info[56].mFileTimeHi = 0U; c25_info[57].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/colon.m!eml_signed_integer_colon"; c25_info[57].name = "eml_int_forloop_overflow_check"; c25_info[57].dominantType = ""; c25_info[57].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m"; c25_info[57].fileTimeLo = 1346531940U; c25_info[57].fileTimeHi = 0U; c25_info[57].mFileTimeLo = 0U; c25_info[57].mFileTimeHi = 0U; c25_info[58].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m!eml_int_forloop_overflow_check_helper"; c25_info[58].name = "intmax"; c25_info[58].dominantType = "char"; c25_info[58].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m"; c25_info[58].fileTimeLo = 1311276916U; c25_info[58].fileTimeHi = 0U; c25_info[58].mFileTimeLo = 0U; c25_info[58].mFileTimeHi = 0U; c25_info[59].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[59].name = "eml_index_class"; c25_info[59].dominantType = ""; c25_info[59].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[59].fileTimeLo = 1323192178U; c25_info[59].fileTimeHi = 0U; c25_info[59].mFileTimeLo = 0U; c25_info[59].mFileTimeHi = 0U; c25_info[60].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[60].name = "eml_index_plus"; c25_info[60].dominantType = "double"; c25_info[60].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[60].fileTimeLo = 1286840378U; c25_info[60].fileTimeHi = 0U; c25_info[60].mFileTimeLo = 0U; c25_info[60].mFileTimeHi = 0U; c25_info[61].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[61].name = "eml_int_forloop_overflow_check"; c25_info[61].dominantType = ""; c25_info[61].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m"; c25_info[61].fileTimeLo = 1346531940U; c25_info[61].fileTimeHi = 0U; c25_info[61].mFileTimeLo = 0U; c25_info[61].mFileTimeHi = 0U; c25_info[62].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[62].name = "eml_index_minus"; c25_info[62].dominantType = "double"; c25_info[62].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_minus.m"; c25_info[62].fileTimeLo = 1286840378U; c25_info[62].fileTimeHi = 0U; c25_info[62].mFileTimeLo = 0U; c25_info[62].mFileTimeHi = 0U; c25_info[63].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_minus.m"; c25_info[63].name = "eml_index_class"; c25_info[63].dominantType = ""; c25_info[63].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[63].fileTimeLo = 1323192178U; c25_info[63].fileTimeHi = 0U; c25_info[63].mFileTimeLo = 0U; c25_info[63].mFileTimeHi = 0U; } static void c25_b_info_helper(c25_ResolvedFunctionInfo c25_info[127]) { c25_info[64].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[64].name = "eml_index_minus"; c25_info[64].dominantType = "coder.internal.indexInt"; c25_info[64].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_minus.m"; c25_info[64].fileTimeLo = 1286840378U; c25_info[64].fileTimeHi = 0U; c25_info[64].mFileTimeLo = 0U; c25_info[64].mFileTimeHi = 0U; c25_info[65].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[65].name = "eml_index_times"; c25_info[65].dominantType = "coder.internal.indexInt"; c25_info[65].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_times.m"; c25_info[65].fileTimeLo = 1286840380U; c25_info[65].fileTimeHi = 0U; c25_info[65].mFileTimeLo = 0U; c25_info[65].mFileTimeHi = 0U; c25_info[66].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_times.m"; c25_info[66].name = "eml_index_class"; c25_info[66].dominantType = ""; c25_info[66].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[66].fileTimeLo = 1323192178U; c25_info[66].fileTimeHi = 0U; c25_info[66].mFileTimeLo = 0U; c25_info[66].mFileTimeHi = 0U; c25_info[67].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[67].name = "eml_index_plus"; c25_info[67].dominantType = "coder.internal.indexInt"; c25_info[67].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[67].fileTimeLo = 1286840378U; c25_info[67].fileTimeHi = 0U; c25_info[67].mFileTimeLo = 0U; c25_info[67].mFileTimeHi = 0U; c25_info[68].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[68].name = "eml_ixamax"; c25_info[68].dominantType = "double"; c25_info[68].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_ixamax.m"; c25_info[68].fileTimeLo = 1299098370U; c25_info[68].fileTimeHi = 0U; c25_info[68].mFileTimeLo = 0U; c25_info[68].mFileTimeHi = 0U; c25_info[69].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_ixamax.m"; c25_info[69].name = "eml_blas_inline"; c25_info[69].dominantType = ""; c25_info[69].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_blas_inline.m"; c25_info[69].fileTimeLo = 1299098368U; c25_info[69].fileTimeHi = 0U; c25_info[69].mFileTimeLo = 0U; c25_info[69].mFileTimeHi = 0U; c25_info[70].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_ixamax.m!below_threshold"; c25_info[70].name = "length"; c25_info[70].dominantType = "double"; c25_info[70].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/length.m"; c25_info[70].fileTimeLo = 1303167806U; c25_info[70].fileTimeHi = 0U; c25_info[70].mFileTimeLo = 0U; c25_info[70].mFileTimeHi = 0U; c25_info[71].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/length.m!intlength"; c25_info[71].name = "eml_index_class"; c25_info[71].dominantType = ""; c25_info[71].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[71].fileTimeLo = 1323192178U; c25_info[71].fileTimeHi = 0U; c25_info[71].mFileTimeLo = 0U; c25_info[71].mFileTimeHi = 0U; c25_info[72].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_ixamax.m"; c25_info[72].name = "eml_index_class"; c25_info[72].dominantType = ""; c25_info[72].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[72].fileTimeLo = 1323192178U; c25_info[72].fileTimeHi = 0U; c25_info[72].mFileTimeLo = 0U; c25_info[72].mFileTimeHi = 0U; c25_info[73].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_ixamax.m"; c25_info[73].name = "eml_refblas_ixamax"; c25_info[73].dominantType = "double"; c25_info[73].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_ixamax.m"; c25_info[73].fileTimeLo = 1299098370U; c25_info[73].fileTimeHi = 0U; c25_info[73].mFileTimeLo = 0U; c25_info[73].mFileTimeHi = 0U; c25_info[74].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_ixamax.m"; c25_info[74].name = "eml_index_class"; c25_info[74].dominantType = ""; c25_info[74].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[74].fileTimeLo = 1323192178U; c25_info[74].fileTimeHi = 0U; c25_info[74].mFileTimeLo = 0U; c25_info[74].mFileTimeHi = 0U; c25_info[75].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_ixamax.m"; c25_info[75].name = "eml_xcabs1"; c25_info[75].dominantType = "double"; c25_info[75].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xcabs1.m"; c25_info[75].fileTimeLo = 1286840306U; c25_info[75].fileTimeHi = 0U; c25_info[75].mFileTimeLo = 0U; c25_info[75].mFileTimeHi = 0U; c25_info[76].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xcabs1.m"; c25_info[76].name = "abs"; c25_info[76].dominantType = "double"; c25_info[76].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m"; c25_info[76].fileTimeLo = 1343851966U; c25_info[76].fileTimeHi = 0U; c25_info[76].mFileTimeLo = 0U; c25_info[76].mFileTimeHi = 0U; c25_info[77].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m"; c25_info[77].name = "eml_scalar_abs"; c25_info[77].dominantType = "double"; c25_info[77].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_abs.m"; c25_info[77].fileTimeLo = 1286840312U; c25_info[77].fileTimeHi = 0U; c25_info[77].mFileTimeLo = 0U; c25_info[77].mFileTimeHi = 0U; c25_info[78].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_ixamax.m"; c25_info[78].name = "eml_int_forloop_overflow_check"; c25_info[78].dominantType = ""; c25_info[78].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m"; c25_info[78].fileTimeLo = 1346531940U; c25_info[78].fileTimeHi = 0U; c25_info[78].mFileTimeLo = 0U; c25_info[78].mFileTimeHi = 0U; c25_info[79].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_ixamax.m"; c25_info[79].name = "eml_index_plus"; c25_info[79].dominantType = "coder.internal.indexInt"; c25_info[79].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[79].fileTimeLo = 1286840378U; c25_info[79].fileTimeHi = 0U; c25_info[79].mFileTimeLo = 0U; c25_info[79].mFileTimeHi = 0U; c25_info[80].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[80].name = "eml_xswap"; c25_info[80].dominantType = "double"; c25_info[80].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xswap.m"; c25_info[80].fileTimeLo = 1299098378U; c25_info[80].fileTimeHi = 0U; c25_info[80].mFileTimeLo = 0U; c25_info[80].mFileTimeHi = 0U; c25_info[81].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xswap.m"; c25_info[81].name = "eml_blas_inline"; c25_info[81].dominantType = ""; c25_info[81].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_blas_inline.m"; c25_info[81].fileTimeLo = 1299098368U; c25_info[81].fileTimeHi = 0U; c25_info[81].mFileTimeLo = 0U; c25_info[81].mFileTimeHi = 0U; c25_info[82].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xswap.m"; c25_info[82].name = "eml_index_class"; c25_info[82].dominantType = ""; c25_info[82].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[82].fileTimeLo = 1323192178U; c25_info[82].fileTimeHi = 0U; c25_info[82].mFileTimeLo = 0U; c25_info[82].mFileTimeHi = 0U; c25_info[83].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xswap.m"; c25_info[83].name = "eml_refblas_xswap"; c25_info[83].dominantType = "double"; c25_info[83].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xswap.m"; c25_info[83].fileTimeLo = 1299098386U; c25_info[83].fileTimeHi = 0U; c25_info[83].mFileTimeLo = 0U; c25_info[83].mFileTimeHi = 0U; c25_info[84].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xswap.m"; c25_info[84].name = "eml_index_class"; c25_info[84].dominantType = ""; c25_info[84].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[84].fileTimeLo = 1323192178U; c25_info[84].fileTimeHi = 0U; c25_info[84].mFileTimeLo = 0U; c25_info[84].mFileTimeHi = 0U; c25_info[85].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xswap.m"; c25_info[85].name = "abs"; c25_info[85].dominantType = "coder.internal.indexInt"; c25_info[85].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m"; c25_info[85].fileTimeLo = 1343851966U; c25_info[85].fileTimeHi = 0U; c25_info[85].mFileTimeLo = 0U; c25_info[85].mFileTimeHi = 0U; c25_info[86].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m"; c25_info[86].name = "eml_scalar_abs"; c25_info[86].dominantType = "coder.internal.indexInt"; c25_info[86].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_abs.m"; c25_info[86].fileTimeLo = 1286840312U; c25_info[86].fileTimeHi = 0U; c25_info[86].mFileTimeLo = 0U; c25_info[86].mFileTimeHi = 0U; c25_info[87].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xswap.m"; c25_info[87].name = "eml_int_forloop_overflow_check"; c25_info[87].dominantType = ""; c25_info[87].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m"; c25_info[87].fileTimeLo = 1346531940U; c25_info[87].fileTimeHi = 0U; c25_info[87].mFileTimeLo = 0U; c25_info[87].mFileTimeHi = 0U; c25_info[88].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xswap.m"; c25_info[88].name = "eml_index_plus"; c25_info[88].dominantType = "coder.internal.indexInt"; c25_info[88].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[88].fileTimeLo = 1286840378U; c25_info[88].fileTimeHi = 0U; c25_info[88].mFileTimeLo = 0U; c25_info[88].mFileTimeHi = 0U; c25_info[89].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[89].name = "eml_div"; c25_info[89].dominantType = "double"; c25_info[89].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m"; c25_info[89].fileTimeLo = 1313369410U; c25_info[89].fileTimeHi = 0U; c25_info[89].mFileTimeLo = 0U; c25_info[89].mFileTimeHi = 0U; c25_info[90].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/lapack/matlab/eml_matlab_zgetrf.m"; c25_info[90].name = "eml_xgeru"; c25_info[90].dominantType = "double"; c25_info[90].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgeru.m"; c25_info[90].fileTimeLo = 1299098374U; c25_info[90].fileTimeHi = 0U; c25_info[90].mFileTimeLo = 0U; c25_info[90].mFileTimeHi = 0U; c25_info[91].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgeru.m"; c25_info[91].name = "eml_blas_inline"; c25_info[91].dominantType = ""; c25_info[91].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_blas_inline.m"; c25_info[91].fileTimeLo = 1299098368U; c25_info[91].fileTimeHi = 0U; c25_info[91].mFileTimeLo = 0U; c25_info[91].mFileTimeHi = 0U; c25_info[92].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xgeru.m"; c25_info[92].name = "eml_xger"; c25_info[92].dominantType = "double"; c25_info[92].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xger.m"; c25_info[92].fileTimeLo = 1299098374U; c25_info[92].fileTimeHi = 0U; c25_info[92].mFileTimeLo = 0U; c25_info[92].mFileTimeHi = 0U; c25_info[93].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xger.m"; c25_info[93].name = "eml_blas_inline"; c25_info[93].dominantType = ""; c25_info[93].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_blas_inline.m"; c25_info[93].fileTimeLo = 1299098368U; c25_info[93].fileTimeHi = 0U; c25_info[93].mFileTimeLo = 0U; c25_info[93].mFileTimeHi = 0U; c25_info[94].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xger.m!below_threshold"; c25_info[94].name = "intmax"; c25_info[94].dominantType = "char"; c25_info[94].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m"; c25_info[94].fileTimeLo = 1311276916U; c25_info[94].fileTimeHi = 0U; c25_info[94].mFileTimeLo = 0U; c25_info[94].mFileTimeHi = 0U; c25_info[95].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xger.m!below_threshold"; c25_info[95].name = "min"; c25_info[95].dominantType = "double"; c25_info[95].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/min.m"; c25_info[95].fileTimeLo = 1311276918U; c25_info[95].fileTimeHi = 0U; c25_info[95].mFileTimeLo = 0U; c25_info[95].mFileTimeHi = 0U; c25_info[96].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_bin_extremum"; c25_info[96].name = "eml_scalar_eg"; c25_info[96].dominantType = "double"; c25_info[96].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[96].fileTimeLo = 1286840396U; c25_info[96].fileTimeHi = 0U; c25_info[96].mFileTimeLo = 0U; c25_info[96].mFileTimeHi = 0U; c25_info[97].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_bin_extremum"; c25_info[97].name = "eml_scalexp_alloc"; c25_info[97].dominantType = "double"; c25_info[97].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m"; c25_info[97].fileTimeLo = 1352446460U; c25_info[97].fileTimeHi = 0U; c25_info[97].mFileTimeLo = 0U; c25_info[97].mFileTimeHi = 0U; c25_info[98].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_scalar_bin_extremum"; c25_info[98].name = "eml_scalar_eg"; c25_info[98].dominantType = "double"; c25_info[98].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[98].fileTimeLo = 1286840396U; c25_info[98].fileTimeHi = 0U; c25_info[98].mFileTimeLo = 0U; c25_info[98].mFileTimeHi = 0U; c25_info[99].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xger.m!below_threshold"; c25_info[99].name = "mtimes"; c25_info[99].dominantType = "double"; c25_info[99].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; c25_info[99].fileTimeLo = 1289541292U; c25_info[99].fileTimeHi = 0U; c25_info[99].mFileTimeLo = 0U; c25_info[99].mFileTimeHi = 0U; c25_info[100].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xger.m"; c25_info[100].name = "eml_index_class"; c25_info[100].dominantType = ""; c25_info[100].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[100].fileTimeLo = 1323192178U; c25_info[100].fileTimeHi = 0U; c25_info[100].mFileTimeLo = 0U; c25_info[100].mFileTimeHi = 0U; c25_info[101].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xger.m"; c25_info[101].name = "eml_refblas_xger"; c25_info[101].dominantType = "double"; c25_info[101].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xger.m"; c25_info[101].fileTimeLo = 1299098376U; c25_info[101].fileTimeHi = 0U; c25_info[101].mFileTimeLo = 0U; c25_info[101].mFileTimeHi = 0U; c25_info[102].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xger.m"; c25_info[102].name = "eml_refblas_xgerx"; c25_info[102].dominantType = "char"; c25_info[102].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgerx.m"; c25_info[102].fileTimeLo = 1299098378U; c25_info[102].fileTimeHi = 0U; c25_info[102].mFileTimeLo = 0U; c25_info[102].mFileTimeHi = 0U; c25_info[103].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgerx.m"; c25_info[103].name = "eml_index_class"; c25_info[103].dominantType = ""; c25_info[103].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[103].fileTimeLo = 1323192178U; c25_info[103].fileTimeHi = 0U; c25_info[103].mFileTimeLo = 0U; c25_info[103].mFileTimeHi = 0U; c25_info[104].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgerx.m"; c25_info[104].name = "abs"; c25_info[104].dominantType = "coder.internal.indexInt"; c25_info[104].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/abs.m"; c25_info[104].fileTimeLo = 1343851966U; c25_info[104].fileTimeHi = 0U; c25_info[104].mFileTimeLo = 0U; c25_info[104].mFileTimeHi = 0U; c25_info[105].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgerx.m"; c25_info[105].name = "eml_index_minus"; c25_info[105].dominantType = "double"; c25_info[105].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_minus.m"; c25_info[105].fileTimeLo = 1286840378U; c25_info[105].fileTimeHi = 0U; c25_info[105].mFileTimeLo = 0U; c25_info[105].mFileTimeHi = 0U; c25_info[106].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgerx.m"; c25_info[106].name = "eml_int_forloop_overflow_check"; c25_info[106].dominantType = ""; c25_info[106].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m"; c25_info[106].fileTimeLo = 1346531940U; c25_info[106].fileTimeHi = 0U; c25_info[106].mFileTimeLo = 0U; c25_info[106].mFileTimeHi = 0U; c25_info[107].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgerx.m"; c25_info[107].name = "eml_index_plus"; c25_info[107].dominantType = "double"; c25_info[107].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[107].fileTimeLo = 1286840378U; c25_info[107].fileTimeHi = 0U; c25_info[107].mFileTimeLo = 0U; c25_info[107].mFileTimeHi = 0U; c25_info[108].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xgerx.m"; c25_info[108].name = "eml_index_plus"; c25_info[108].dominantType = "coder.internal.indexInt"; c25_info[108].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[108].fileTimeLo = 1286840378U; c25_info[108].fileTimeHi = 0U; c25_info[108].mFileTimeLo = 0U; c25_info[108].mFileTimeHi = 0U; c25_info[109].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_lusolve.m!warn_singular"; c25_info[109].name = "eml_warning"; c25_info[109].dominantType = "char"; c25_info[109].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_warning.m"; c25_info[109].fileTimeLo = 1286840402U; c25_info[109].fileTimeHi = 0U; c25_info[109].mFileTimeLo = 0U; c25_info[109].mFileTimeHi = 0U; c25_info[110].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_lusolve.m!lusolveNxN"; c25_info[110].name = "eml_scalar_eg"; c25_info[110].dominantType = "double"; c25_info[110].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[110].fileTimeLo = 1286840396U; c25_info[110].fileTimeHi = 0U; c25_info[110].mFileTimeLo = 0U; c25_info[110].mFileTimeHi = 0U; c25_info[111].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_lusolve.m!lusolveNxN"; c25_info[111].name = "eml_int_forloop_overflow_check"; c25_info[111].dominantType = ""; c25_info[111].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m"; c25_info[111].fileTimeLo = 1346531940U; c25_info[111].fileTimeHi = 0U; c25_info[111].mFileTimeLo = 0U; c25_info[111].mFileTimeHi = 0U; c25_info[112].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_lusolve.m!lusolveNxN"; c25_info[112].name = "eml_xtrsm"; c25_info[112].dominantType = "char"; c25_info[112].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xtrsm.m"; c25_info[112].fileTimeLo = 1299098378U; c25_info[112].fileTimeHi = 0U; c25_info[112].mFileTimeLo = 0U; c25_info[112].mFileTimeHi = 0U; c25_info[113].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_xtrsm.m"; c25_info[113].name = "eml_blas_inline"; c25_info[113].dominantType = ""; c25_info[113].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/eml_blas_inline.m"; c25_info[113].fileTimeLo = 1299098368U; c25_info[113].fileTimeHi = 0U; c25_info[113].mFileTimeLo = 0U; c25_info[113].mFileTimeHi = 0U; c25_info[114].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m!below_threshold"; c25_info[114].name = "mtimes"; c25_info[114].dominantType = "double"; c25_info[114].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m"; c25_info[114].fileTimeLo = 1289541292U; c25_info[114].fileTimeHi = 0U; c25_info[114].mFileTimeLo = 0U; c25_info[114].mFileTimeHi = 0U; c25_info[115].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m"; c25_info[115].name = "eml_index_class"; c25_info[115].dominantType = ""; c25_info[115].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[115].fileTimeLo = 1323192178U; c25_info[115].fileTimeHi = 0U; c25_info[115].mFileTimeLo = 0U; c25_info[115].mFileTimeHi = 0U; c25_info[116].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m"; c25_info[116].name = "eml_scalar_eg"; c25_info[116].dominantType = "double"; c25_info[116].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[116].fileTimeLo = 1286840396U; c25_info[116].fileTimeHi = 0U; c25_info[116].mFileTimeLo = 0U; c25_info[116].mFileTimeHi = 0U; c25_info[117].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m"; c25_info[117].name = "eml_refblas_xtrsm"; c25_info[117].dominantType = "char"; c25_info[117].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[117].fileTimeLo = 1299098386U; c25_info[117].fileTimeHi = 0U; c25_info[117].mFileTimeLo = 0U; c25_info[117].mFileTimeHi = 0U; c25_info[118].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[118].name = "eml_scalar_eg"; c25_info[118].dominantType = "double"; c25_info[118].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"; c25_info[118].fileTimeLo = 1286840396U; c25_info[118].fileTimeHi = 0U; c25_info[118].mFileTimeLo = 0U; c25_info[118].mFileTimeHi = 0U; c25_info[119].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[119].name = "eml_index_minus"; c25_info[119].dominantType = "double"; c25_info[119].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_minus.m"; c25_info[119].fileTimeLo = 1286840378U; c25_info[119].fileTimeHi = 0U; c25_info[119].mFileTimeLo = 0U; c25_info[119].mFileTimeHi = 0U; c25_info[120].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[120].name = "eml_index_class"; c25_info[120].dominantType = ""; c25_info[120].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m"; c25_info[120].fileTimeLo = 1323192178U; c25_info[120].fileTimeHi = 0U; c25_info[120].mFileTimeLo = 0U; c25_info[120].mFileTimeHi = 0U; c25_info[121].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[121].name = "eml_index_times"; c25_info[121].dominantType = "coder.internal.indexInt"; c25_info[121].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_times.m"; c25_info[121].fileTimeLo = 1286840380U; c25_info[121].fileTimeHi = 0U; c25_info[121].mFileTimeLo = 0U; c25_info[121].mFileTimeHi = 0U; c25_info[122].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[122].name = "eml_index_plus"; c25_info[122].dominantType = "coder.internal.indexInt"; c25_info[122].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[122].fileTimeLo = 1286840378U; c25_info[122].fileTimeHi = 0U; c25_info[122].mFileTimeLo = 0U; c25_info[122].mFileTimeHi = 0U; c25_info[123].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[123].name = "eml_int_forloop_overflow_check"; c25_info[123].dominantType = ""; c25_info[123].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m"; c25_info[123].fileTimeLo = 1346531940U; c25_info[123].fileTimeHi = 0U; c25_info[123].mFileTimeLo = 0U; c25_info[123].mFileTimeHi = 0U; c25_info[124].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[124].name = "eml_index_plus"; c25_info[124].dominantType = "double"; c25_info[124].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m"; c25_info[124].fileTimeLo = 1286840378U; c25_info[124].fileTimeHi = 0U; c25_info[124].mFileTimeLo = 0U; c25_info[124].mFileTimeHi = 0U; c25_info[125].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_int_forloop_overflow_check.m!eml_int_forloop_overflow_check_helper"; c25_info[125].name = "intmin"; c25_info[125].dominantType = "char"; c25_info[125].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmin.m"; c25_info[125].fileTimeLo = 1311276918U; c25_info[125].fileTimeHi = 0U; c25_info[125].mFileTimeLo = 0U; c25_info[125].mFileTimeHi = 0U; c25_info[126].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/blas/refblas/eml_refblas_xtrsm.m"; c25_info[126].name = "eml_div"; c25_info[126].dominantType = "double"; c25_info[126].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m"; c25_info[126].fileTimeLo = 1313369410U; c25_info[126].fileTimeHi = 0U; c25_info[126].mFileTimeLo = 0U; c25_info[126].mFileTimeHi = 0U; } static real_T c25_mpower(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_a) { real_T c25_b_a; real_T c25_c_a; real_T c25_ak; real_T c25_d_a; real_T c25_e_a; real_T c25_b; c25_b_a = c25_a; c25_c_a = c25_b_a; c25_eml_scalar_eg(chartInstance); c25_ak = c25_c_a; c25_d_a = c25_ak; c25_eml_scalar_eg(chartInstance); c25_e_a = c25_d_a; c25_b = c25_d_a; return c25_e_a * c25_b; } static void c25_eml_scalar_eg(SFc25_JointSpaceControl_BestInertiaInstanceStruct * chartInstance) { } static void c25_b_eml_scalar_eg (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void c25_realmin(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void c25_eps(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void c25_eml_matlab_zgetrf (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_b_A[36], int32_T c25_ipiv[6], int32_T *c25_info) { int32_T c25_i49; for (c25_i49 = 0; c25_i49 < 36; c25_i49++) { c25_b_A[c25_i49] = c25_A[c25_i49]; } c25_b_eml_matlab_zgetrf(chartInstance, c25_b_A, c25_ipiv, c25_info); } static void c25_check_forloop_overflow_error (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, boolean_T c25_overflow) { int32_T c25_i50; static char_T c25_cv0[34] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 'i', 'n', 't', '_', 'f', 'o', 'r', 'l', 'o', 'o', 'p', '_', 'o', 'v', 'e', 'r', 'f', 'l', 'o', 'w' }; char_T c25_u[34]; const mxArray *c25_y = NULL; int32_T c25_i51; static char_T c25_cv1[23] = { 'c', 'o', 'd', 'e', 'r', '.', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '.', 'i', 'n', 'd', 'e', 'x', 'I', 'n', 't' }; char_T c25_b_u[23]; const mxArray *c25_b_y = NULL; if (!c25_overflow) { } else { for (c25_i50 = 0; c25_i50 < 34; c25_i50++) { c25_u[c25_i50] = c25_cv0[c25_i50]; } c25_y = NULL; sf_mex_assign(&c25_y, sf_mex_create("y", c25_u, 10, 0U, 1U, 0U, 2, 1, 34), FALSE); for (c25_i51 = 0; c25_i51 < 23; c25_i51++) { c25_b_u[c25_i51] = c25_cv1[c25_i51]; } c25_b_y = NULL; sf_mex_assign(&c25_b_y, sf_mex_create("y", c25_b_u, 10, 0U, 1U, 0U, 2, 1, 23), FALSE); sf_mex_call_debug("error", 0U, 1U, 14, sf_mex_call_debug("message", 1U, 2U, 14, c25_y, 14, c25_b_y)); } } static void c25_eml_xger(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, int32_T c25_m, int32_T c25_n, real_T c25_alpha1, int32_T c25_ix0, int32_T c25_iy0, real_T c25_A[36], int32_T c25_ia0, real_T c25_b_A[36]) { int32_T c25_i52; for (c25_i52 = 0; c25_i52 < 36; c25_i52++) { c25_b_A[c25_i52] = c25_A[c25_i52]; } c25_b_eml_xger(chartInstance, c25_m, c25_n, c25_alpha1, c25_ix0, c25_iy0, c25_b_A, c25_ia0); } static void c25_eml_warning(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { int32_T c25_i53; static char_T c25_varargin_1[27] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'i', 'n', 'g', 'u', 'l', 'a', 'r', 'M', 'a', 't', 'r', 'i', 'x' }; char_T c25_u[27]; const mxArray *c25_y = NULL; for (c25_i53 = 0; c25_i53 < 27; c25_i53++) { c25_u[c25_i53] = c25_varargin_1[c25_i53]; } c25_y = NULL; sf_mex_assign(&c25_y, sf_mex_create("y", c25_u, 10, 0U, 1U, 0U, 2, 1, 27), FALSE); sf_mex_call_debug("warning", 0U, 1U, 14, sf_mex_call_debug("message", 1U, 1U, 14, c25_y)); } static void c25_eml_xtrsm(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_B[6], real_T c25_b_B[6]) { int32_T c25_i54; int32_T c25_i55; real_T c25_b_A[36]; for (c25_i54 = 0; c25_i54 < 6; c25_i54++) { c25_b_B[c25_i54] = c25_B[c25_i54]; } for (c25_i55 = 0; c25_i55 < 36; c25_i55++) { c25_b_A[c25_i55] = c25_A[c25_i55]; } c25_c_eml_xtrsm(chartInstance, c25_b_A, c25_b_B); } static void c25_below_threshold (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void c25_c_eml_scalar_eg (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } static void c25_b_eml_xtrsm(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_B[6], real_T c25_b_B[6]) { int32_T c25_i56; int32_T c25_i57; real_T c25_b_A[36]; for (c25_i56 = 0; c25_i56 < 6; c25_i56++) { c25_b_B[c25_i56] = c25_B[c25_i56]; } for (c25_i57 = 0; c25_i57 < 36; c25_i57++) { c25_b_A[c25_i57] = c25_A[c25_i57]; } c25_d_eml_xtrsm(chartInstance, c25_b_A, c25_b_B); } static const mxArray *c25_d_sf_marshallOut(void *chartInstanceVoid, void *c25_inData) { const mxArray *c25_mxArrayOutData = NULL; int32_T c25_u; const mxArray *c25_y = NULL; SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) chartInstanceVoid; c25_mxArrayOutData = NULL; c25_u = *(int32_T *)c25_inData; c25_y = NULL; sf_mex_assign(&c25_y, sf_mex_create("y", &c25_u, 6, 0U, 0U, 0U, 0), FALSE); sf_mex_assign(&c25_mxArrayOutData, c25_y, FALSE); return c25_mxArrayOutData; } static int32_T c25_e_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId) { int32_T c25_y; int32_T c25_i58; sf_mex_import(c25_parentId, sf_mex_dup(c25_u), &c25_i58, 1, 6, 0U, 0, 0U, 0); c25_y = c25_i58; sf_mex_destroy(&c25_u); return c25_y; } static void c25_d_sf_marshallIn(void *chartInstanceVoid, const mxArray *c25_mxArrayInData, const char_T *c25_varName, void *c25_outData) { const mxArray *c25_b_sfEvent; const char_T *c25_identifier; emlrtMsgIdentifier c25_thisId; int32_T c25_y; SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) chartInstanceVoid; c25_b_sfEvent = sf_mex_dup(c25_mxArrayInData); c25_identifier = c25_varName; c25_thisId.fIdentifier = c25_identifier; c25_thisId.fParent = NULL; c25_y = c25_e_emlrt_marshallIn(chartInstance, sf_mex_dup(c25_b_sfEvent), &c25_thisId); sf_mex_destroy(&c25_b_sfEvent); *(int32_T *)c25_outData = c25_y; sf_mex_destroy(&c25_mxArrayInData); } static uint8_T c25_f_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_b_is_active_c25_JointSpaceControl_BestInertia, const char_T *c25_identifier) { uint8_T c25_y; emlrtMsgIdentifier c25_thisId; c25_thisId.fIdentifier = c25_identifier; c25_thisId.fParent = NULL; c25_y = c25_g_emlrt_marshallIn(chartInstance, sf_mex_dup (c25_b_is_active_c25_JointSpaceControl_BestInertia), &c25_thisId); sf_mex_destroy(&c25_b_is_active_c25_JointSpaceControl_BestInertia); return c25_y; } static uint8_T c25_g_emlrt_marshallIn (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, const mxArray *c25_u, const emlrtMsgIdentifier *c25_parentId) { uint8_T c25_y; uint8_T c25_u0; sf_mex_import(c25_parentId, sf_mex_dup(c25_u), &c25_u0, 1, 3, 0U, 0, 0U, 0); c25_y = c25_u0; sf_mex_destroy(&c25_u); return c25_y; } static void c25_b_eml_matlab_zgetrf (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], int32_T c25_ipiv[6], int32_T *c25_info) { int32_T c25_i59; int32_T c25_j; int32_T c25_b_j; int32_T c25_a; int32_T c25_jm1; int32_T c25_b; int32_T c25_mmj; int32_T c25_b_a; int32_T c25_c; int32_T c25_b_b; int32_T c25_jj; int32_T c25_c_a; int32_T c25_jp1j; int32_T c25_d_a; int32_T c25_b_c; int32_T c25_n; int32_T c25_ix0; int32_T c25_b_n; int32_T c25_b_ix0; int32_T c25_c_n; int32_T c25_c_ix0; int32_T c25_idxmax; int32_T c25_ix; real_T c25_x; real_T c25_b_x; real_T c25_c_x; real_T c25_y; real_T c25_d_x; real_T c25_e_x; real_T c25_b_y; real_T c25_smax; int32_T c25_d_n; int32_T c25_c_b; int32_T c25_d_b; boolean_T c25_overflow; int32_T c25_k; int32_T c25_b_k; int32_T c25_e_a; real_T c25_f_x; real_T c25_g_x; real_T c25_h_x; real_T c25_c_y; real_T c25_i_x; real_T c25_j_x; real_T c25_d_y; real_T c25_s; int32_T c25_f_a; int32_T c25_jpiv_offset; int32_T c25_g_a; int32_T c25_e_b; int32_T c25_jpiv; int32_T c25_h_a; int32_T c25_f_b; int32_T c25_c_c; int32_T c25_g_b; int32_T c25_jrow; int32_T c25_i_a; int32_T c25_h_b; int32_T c25_jprow; int32_T c25_d_ix0; int32_T c25_iy0; int32_T c25_e_ix0; int32_T c25_b_iy0; int32_T c25_f_ix0; int32_T c25_c_iy0; int32_T c25_b_ix; int32_T c25_iy; int32_T c25_c_k; real_T c25_temp; int32_T c25_j_a; int32_T c25_k_a; int32_T c25_b_jp1j; int32_T c25_l_a; int32_T c25_d_c; int32_T c25_m_a; int32_T c25_i_b; int32_T c25_i60; int32_T c25_n_a; int32_T c25_j_b; int32_T c25_o_a; int32_T c25_k_b; boolean_T c25_b_overflow; int32_T c25_i; int32_T c25_b_i; real_T c25_k_x; real_T c25_e_y; real_T c25_z; int32_T c25_l_b; int32_T c25_e_c; int32_T c25_p_a; int32_T c25_f_c; int32_T c25_q_a; int32_T c25_g_c; int32_T c25_m; int32_T c25_e_n; int32_T c25_g_ix0; int32_T c25_d_iy0; int32_T c25_ia0; real_T c25_d1; c25_realmin(chartInstance); c25_eps(chartInstance); for (c25_i59 = 0; c25_i59 < 6; c25_i59++) { c25_ipiv[c25_i59] = 1 + c25_i59; } *c25_info = 0; for (c25_j = 1; c25_j < 6; c25_j++) { c25_b_j = c25_j; c25_a = c25_b_j - 1; c25_jm1 = c25_a; c25_b = c25_b_j; c25_mmj = 6 - c25_b; c25_b_a = c25_jm1; c25_c = c25_b_a * 7; c25_b_b = c25_c + 1; c25_jj = c25_b_b; c25_c_a = c25_jj + 1; c25_jp1j = c25_c_a; c25_d_a = c25_mmj; c25_b_c = c25_d_a; c25_n = c25_b_c + 1; c25_ix0 = c25_jj; c25_b_n = c25_n; c25_b_ix0 = c25_ix0; c25_c_n = c25_b_n; c25_c_ix0 = c25_b_ix0; if (c25_c_n < 1) { c25_idxmax = 0; } else { c25_idxmax = 1; if (c25_c_n > 1) { c25_ix = c25_c_ix0; c25_x = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T) _SFD_INTEGER_CHECK("", (real_T)c25_ix), 1, 36, 1, 0) - 1]; c25_b_x = c25_x; c25_c_x = c25_b_x; c25_y = muDoubleScalarAbs(c25_c_x); c25_d_x = 0.0; c25_e_x = c25_d_x; c25_b_y = muDoubleScalarAbs(c25_e_x); c25_smax = c25_y + c25_b_y; c25_d_n = c25_c_n; c25_c_b = c25_d_n; c25_d_b = c25_c_b; if (2 > c25_d_b) { c25_overflow = FALSE; } else { c25_overflow = (c25_d_b > 2147483646); } if (c25_overflow) { c25_check_forloop_overflow_error(chartInstance, c25_overflow); } for (c25_k = 2; c25_k <= c25_d_n; c25_k++) { c25_b_k = c25_k; c25_e_a = c25_ix + 1; c25_ix = c25_e_a; c25_f_x = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T) _SFD_INTEGER_CHECK("", (real_T)c25_ix), 1, 36, 1, 0) - 1]; c25_g_x = c25_f_x; c25_h_x = c25_g_x; c25_c_y = muDoubleScalarAbs(c25_h_x); c25_i_x = 0.0; c25_j_x = c25_i_x; c25_d_y = muDoubleScalarAbs(c25_j_x); c25_s = c25_c_y + c25_d_y; if (c25_s > c25_smax) { c25_idxmax = c25_b_k; c25_smax = c25_s; } } } } c25_f_a = c25_idxmax - 1; c25_jpiv_offset = c25_f_a; c25_g_a = c25_jj; c25_e_b = c25_jpiv_offset; c25_jpiv = c25_g_a + c25_e_b; if (c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_jpiv), 1, 36, 1, 0) - 1] != 0.0) { if (c25_jpiv_offset != 0) { c25_h_a = c25_b_j; c25_f_b = c25_jpiv_offset; c25_c_c = c25_h_a + c25_f_b; c25_ipiv[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_b_j), 1, 6, 1, 0) - 1] = c25_c_c; c25_g_b = c25_jm1 + 1; c25_jrow = c25_g_b; c25_i_a = c25_jrow; c25_h_b = c25_jpiv_offset; c25_jprow = c25_i_a + c25_h_b; c25_d_ix0 = c25_jrow; c25_iy0 = c25_jprow; c25_e_ix0 = c25_d_ix0; c25_b_iy0 = c25_iy0; c25_f_ix0 = c25_e_ix0; c25_c_iy0 = c25_b_iy0; c25_b_ix = c25_f_ix0; c25_iy = c25_c_iy0; for (c25_c_k = 1; c25_c_k < 7; c25_c_k++) { c25_temp = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T) _SFD_INTEGER_CHECK("", (real_T)c25_b_ix), 1, 36, 1, 0) - 1]; c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_b_ix), 1, 36, 1, 0) - 1] = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_iy), 1, 36, 1, 0) - 1]; c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_iy), 1, 36, 1, 0) - 1] = c25_temp; c25_j_a = c25_b_ix + 6; c25_b_ix = c25_j_a; c25_k_a = c25_iy + 6; c25_iy = c25_k_a; } } c25_b_jp1j = c25_jp1j; c25_l_a = c25_mmj; c25_d_c = c25_l_a; c25_m_a = c25_jp1j; c25_i_b = c25_d_c - 1; c25_i60 = c25_m_a + c25_i_b; c25_n_a = c25_b_jp1j; c25_j_b = c25_i60; c25_o_a = c25_n_a; c25_k_b = c25_j_b; if (c25_o_a > c25_k_b) { c25_b_overflow = FALSE; } else { c25_b_overflow = (c25_k_b > 2147483646); } if (c25_b_overflow) { c25_check_forloop_overflow_error(chartInstance, c25_b_overflow); } for (c25_i = c25_b_jp1j; c25_i <= c25_i60; c25_i++) { c25_b_i = c25_i; c25_k_x = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T) _SFD_INTEGER_CHECK("", (real_T)c25_b_i), 1, 36, 1, 0) - 1]; c25_e_y = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T) _SFD_INTEGER_CHECK("", (real_T)c25_jj), 1, 36, 1, 0) - 1]; c25_z = c25_k_x / c25_e_y; c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_b_i), 1, 36, 1, 0) - 1] = c25_z; } } else { *c25_info = c25_b_j; } c25_l_b = c25_b_j; c25_e_c = 6 - c25_l_b; c25_p_a = c25_jj; c25_f_c = c25_p_a; c25_q_a = c25_jj; c25_g_c = c25_q_a; c25_m = c25_mmj; c25_e_n = c25_e_c; c25_g_ix0 = c25_jp1j; c25_d_iy0 = c25_f_c + 6; c25_ia0 = c25_g_c + 7; c25_d1 = -1.0; c25_b_eml_xger(chartInstance, c25_m, c25_e_n, c25_d1, c25_g_ix0, c25_d_iy0, c25_A, c25_ia0); } if (*c25_info == 0) { if (!(c25_A[35] != 0.0)) { *c25_info = 6; } } } static void c25_b_eml_xger(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, int32_T c25_m, int32_T c25_n, real_T c25_alpha1, int32_T c25_ix0, int32_T c25_iy0, real_T c25_A[36], int32_T c25_ia0) { int32_T c25_b_m; int32_T c25_b_n; real_T c25_b_alpha1; int32_T c25_b_ix0; int32_T c25_b_iy0; int32_T c25_b_ia0; int32_T c25_c_m; int32_T c25_c_n; real_T c25_c_alpha1; int32_T c25_c_ix0; int32_T c25_c_iy0; int32_T c25_c_ia0; int32_T c25_d_m; int32_T c25_d_n; real_T c25_d_alpha1; int32_T c25_d_ix0; int32_T c25_d_iy0; int32_T c25_d_ia0; int32_T c25_ixstart; int32_T c25_a; int32_T c25_jA; int32_T c25_jy; int32_T c25_e_n; int32_T c25_b; int32_T c25_b_b; boolean_T c25_overflow; int32_T c25_j; real_T c25_yjy; real_T c25_temp; int32_T c25_ix; int32_T c25_c_b; int32_T c25_i61; int32_T c25_b_a; int32_T c25_d_b; int32_T c25_i62; int32_T c25_c_a; int32_T c25_e_b; int32_T c25_d_a; int32_T c25_f_b; boolean_T c25_b_overflow; int32_T c25_ijA; int32_T c25_b_ijA; int32_T c25_e_a; int32_T c25_f_a; int32_T c25_g_a; c25_b_m = c25_m; c25_b_n = c25_n; c25_b_alpha1 = c25_alpha1; c25_b_ix0 = c25_ix0; c25_b_iy0 = c25_iy0; c25_b_ia0 = c25_ia0; c25_c_m = c25_b_m; c25_c_n = c25_b_n; c25_c_alpha1 = c25_b_alpha1; c25_c_ix0 = c25_b_ix0; c25_c_iy0 = c25_b_iy0; c25_c_ia0 = c25_b_ia0; c25_d_m = c25_c_m; c25_d_n = c25_c_n; c25_d_alpha1 = c25_c_alpha1; c25_d_ix0 = c25_c_ix0; c25_d_iy0 = c25_c_iy0; c25_d_ia0 = c25_c_ia0; if (c25_d_alpha1 == 0.0) { } else { c25_ixstart = c25_d_ix0; c25_a = c25_d_ia0 - 1; c25_jA = c25_a; c25_jy = c25_d_iy0; c25_e_n = c25_d_n; c25_b = c25_e_n; c25_b_b = c25_b; if (1 > c25_b_b) { c25_overflow = FALSE; } else { c25_overflow = (c25_b_b > 2147483646); } if (c25_overflow) { c25_check_forloop_overflow_error(chartInstance, c25_overflow); } for (c25_j = 1; c25_j <= c25_e_n; c25_j++) { c25_yjy = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T) _SFD_INTEGER_CHECK("", (real_T)c25_jy), 1, 36, 1, 0) - 1]; if (c25_yjy != 0.0) { c25_temp = c25_yjy * c25_d_alpha1; c25_ix = c25_ixstart; c25_c_b = c25_jA + 1; c25_i61 = c25_c_b; c25_b_a = c25_d_m; c25_d_b = c25_jA; c25_i62 = c25_b_a + c25_d_b; c25_c_a = c25_i61; c25_e_b = c25_i62; c25_d_a = c25_c_a; c25_f_b = c25_e_b; if (c25_d_a > c25_f_b) { c25_b_overflow = FALSE; } else { c25_b_overflow = (c25_f_b > 2147483646); } if (c25_b_overflow) { c25_check_forloop_overflow_error(chartInstance, c25_b_overflow); } for (c25_ijA = c25_i61; c25_ijA <= c25_i62; c25_ijA++) { c25_b_ijA = c25_ijA; c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_b_ijA), 1, 36, 1, 0) - 1] = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_b_ijA), 1, 36, 1, 0) - 1] + c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_ix), 1, 36, 1, 0) - 1] * c25_temp; c25_e_a = c25_ix + 1; c25_ix = c25_e_a; } } c25_f_a = c25_jy + 6; c25_jy = c25_f_a; c25_g_a = c25_jA + 6; c25_jA = c25_g_a; } } } static void c25_c_eml_xtrsm(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_B[6]) { int32_T c25_k; int32_T c25_b_k; int32_T c25_a; int32_T c25_c; int32_T c25_b; int32_T c25_b_c; int32_T c25_b_b; int32_T c25_kAcol; int32_T c25_b_a; int32_T c25_c_c; int32_T c25_c_a; int32_T c25_i63; boolean_T c25_overflow; int32_T c25_i; int32_T c25_b_i; int32_T c25_d_a; int32_T c25_d_c; int32_T c25_e_a; int32_T c25_e_c; int32_T c25_f_a; int32_T c25_f_c; int32_T c25_g_a; int32_T c25_c_b; int32_T c25_g_c; c25_below_threshold(chartInstance); c25_c_eml_scalar_eg(chartInstance); for (c25_k = 1; c25_k < 7; c25_k++) { c25_b_k = c25_k; c25_a = c25_b_k; c25_c = c25_a; c25_b = c25_c - 1; c25_b_c = 6 * c25_b; c25_b_b = c25_b_c; c25_kAcol = c25_b_b; c25_b_a = c25_b_k; c25_c_c = c25_b_a; if (c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_c_c), 1, 6, 1, 0) - 1] != 0.0) { c25_c_a = c25_b_k; c25_i63 = c25_c_a; c25_overflow = FALSE; if (c25_overflow) { c25_check_forloop_overflow_error(chartInstance, c25_overflow); } for (c25_i = c25_i63 + 1; c25_i < 7; c25_i++) { c25_b_i = c25_i; c25_d_a = c25_b_i; c25_d_c = c25_d_a; c25_e_a = c25_b_i; c25_e_c = c25_e_a; c25_f_a = c25_b_k; c25_f_c = c25_f_a; c25_g_a = c25_b_i; c25_c_b = c25_kAcol; c25_g_c = c25_g_a + c25_c_b; c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_d_c), 1, 6, 1, 0) - 1] = c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK ("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_e_c), 1, 6, 1, 0) - 1] - c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_f_c), 1, 6, 1, 0) - 1] * c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK ("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_g_c), 1, 36, 1, 0) - 1]; } } } } static void c25_d_eml_xtrsm(SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance, real_T c25_A[36], real_T c25_B[6]) { int32_T c25_k; int32_T c25_b_k; int32_T c25_a; int32_T c25_c; int32_T c25_b; int32_T c25_b_c; int32_T c25_b_b; int32_T c25_kAcol; int32_T c25_b_a; int32_T c25_c_c; int32_T c25_c_a; int32_T c25_d_c; int32_T c25_d_a; int32_T c25_e_c; int32_T c25_e_a; int32_T c25_c_b; int32_T c25_f_c; real_T c25_x; real_T c25_y; real_T c25_z; int32_T c25_f_a; int32_T c25_i64; int32_T c25_d_b; int32_T c25_e_b; boolean_T c25_overflow; int32_T c25_i; int32_T c25_b_i; int32_T c25_g_a; int32_T c25_g_c; int32_T c25_h_a; int32_T c25_h_c; int32_T c25_i_a; int32_T c25_i_c; int32_T c25_j_a; int32_T c25_f_b; int32_T c25_j_c; c25_below_threshold(chartInstance); c25_c_eml_scalar_eg(chartInstance); for (c25_k = 6; c25_k > 0; c25_k--) { c25_b_k = c25_k; c25_a = c25_b_k; c25_c = c25_a; c25_b = c25_c - 1; c25_b_c = 6 * c25_b; c25_b_b = c25_b_c; c25_kAcol = c25_b_b; c25_b_a = c25_b_k; c25_c_c = c25_b_a; if (c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_c_c), 1, 6, 1, 0) - 1] != 0.0) { c25_c_a = c25_b_k; c25_d_c = c25_c_a; c25_d_a = c25_b_k; c25_e_c = c25_d_a; c25_e_a = c25_b_k; c25_c_b = c25_kAcol; c25_f_c = c25_e_a + c25_c_b; c25_x = c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK( "", (real_T)c25_e_c), 1, 6, 1, 0) - 1]; c25_y = c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK( "", (real_T)c25_f_c), 1, 36, 1, 0) - 1]; c25_z = c25_x / c25_y; c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_d_c), 1, 6, 1, 0) - 1] = c25_z; c25_f_a = c25_b_k - 1; c25_i64 = c25_f_a; c25_d_b = c25_i64; c25_e_b = c25_d_b; if (1 > c25_e_b) { c25_overflow = FALSE; } else { c25_overflow = (c25_e_b > 2147483646); } if (c25_overflow) { c25_check_forloop_overflow_error(chartInstance, c25_overflow); } for (c25_i = 1; c25_i <= c25_i64; c25_i++) { c25_b_i = c25_i; c25_g_a = c25_b_i; c25_g_c = c25_g_a; c25_h_a = c25_b_i; c25_h_c = c25_h_a; c25_i_a = c25_b_k; c25_i_c = c25_i_a; c25_j_a = c25_b_i; c25_f_b = c25_kAcol; c25_j_c = c25_j_a + c25_f_b; c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_g_c), 1, 6, 1, 0) - 1] = c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK ("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_h_c), 1, 6, 1, 0) - 1] - c25_B[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_i_c), 1, 6, 1, 0) - 1] * c25_A[_SFD_EML_ARRAY_BOUNDS_CHECK ("", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c25_j_c), 1, 36, 1, 0) - 1]; } } } } static void init_dsm_address_info (SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance) { } /* SFunction Glue Code */ #ifdef utFree #undef utFree #endif #ifdef utMalloc #undef utMalloc #endif #ifdef __cplusplus extern "C" void *utMalloc(size_t size); extern "C" void utFree(void*); #else extern void *utMalloc(size_t size); extern void utFree(void*); #endif void sf_c25_JointSpaceControl_BestInertia_get_check_sum(mxArray *plhs[]) { ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(2498298470U); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3961626612U); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(3497625679U); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1627147255U); } mxArray *sf_c25_JointSpaceControl_BestInertia_get_autoinheritance_info(void) { const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters", "outputs", "locals" }; mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,5, autoinheritanceFields); { mxArray *mxChecksum = mxCreateString("1iXtMBqI8BvdUyOMOjf4VG"); mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum); } { const char *dataFields[] = { "size", "type", "complexity" }; mxArray *mxData = mxCreateStructMatrix(1,3,3,dataFields); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(6); pr[1] = (double)(1); mxSetField(mxData,0,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,0,"type",mxType); } mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(6); pr[1] = (double)(1); mxSetField(mxData,1,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,1,"type",mxType); } mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0)); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(6); pr[1] = (double)(1); mxSetField(mxData,2,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,2,"type",mxType); } mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0)); mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData); } { mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0, mxREAL)); } { const char *dataFields[] = { "size", "type", "complexity" }; mxArray *mxData = mxCreateStructMatrix(1,1,3,dataFields); { mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL); double *pr = mxGetPr(mxSize); pr[0] = (double)(6); pr[1] = (double)(1); mxSetField(mxData,0,"size",mxSize); } { const char *typeFields[] = { "base", "fixpt" }; mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields); mxSetField(mxType,0,"base",mxCreateDoubleScalar(10)); mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL)); mxSetField(mxData,0,"type",mxType); } mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0)); mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData); } { mxSetField(mxAutoinheritanceInfo,0,"locals",mxCreateDoubleMatrix(0,0,mxREAL)); } return(mxAutoinheritanceInfo); } mxArray *sf_c25_JointSpaceControl_BestInertia_third_party_uses_info(void) { mxArray * mxcell3p = mxCreateCellMatrix(1,0); return(mxcell3p); } static const mxArray *sf_get_sim_state_info_c25_JointSpaceControl_BestInertia (void) { const char *infoFields[] = { "chartChecksum", "varInfo" }; mxArray *mxInfo = mxCreateStructMatrix(1, 1, 2, infoFields); const char *infoEncStr[] = { "100 S1x2'type','srcId','name','auxInfo'{{M[1],M[10],T\"ddq\",},{M[8],M[0],T\"is_active_c25_JointSpaceControl_BestInertia\",}}" }; mxArray *mxVarInfo = sf_mex_decode_encoded_mx_struct_array(infoEncStr, 2, 10); mxArray *mxChecksum = mxCreateDoubleMatrix(1, 4, mxREAL); sf_c25_JointSpaceControl_BestInertia_get_check_sum(&mxChecksum); mxSetField(mxInfo, 0, infoFields[0], mxChecksum); mxSetField(mxInfo, 0, infoFields[1], mxVarInfo); return mxInfo; } static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *) ((ChartInfoStruct *)(ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (sfGlobalDebugInstanceStruct, _JointSpaceControl_BestInertiaMachineNumber_, 25, 1, 1, 4, 0, 0, 0, 0, 1, &(chartInstance->chartNumber), &(chartInstance->instanceNumber), ssGetPath(S), (void *)S); if (chartAlreadyPresent==0) { /* this is the first instance */ init_script_number_translation (_JointSpaceControl_BestInertiaMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (sfGlobalDebugInstanceStruct, _JointSpaceControl_BestInertiaMachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct, _JointSpaceControl_BestInertiaMachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"q"); _SFD_SET_DATA_PROPS(1,1,1,0,"dq"); _SFD_SET_DATA_PROPS(2,1,1,0,"tau"); _SFD_SET_DATA_PROPS(3,2,0,1,"ddq"); _SFD_STATE_INFO(0,0,2); _SFD_CH_SUBSTATE_COUNT(0); _SFD_CH_SUBSTATE_DECOMP(0); } _SFD_CV_INIT_CHART(0,0,0,0); { _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL); } _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL); /* Initialization of MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,188); _SFD_CV_INIT_SCRIPT(0,1,0,0,0,0,0,0,0,0); _SFD_CV_INIT_SCRIPT_FCN(0,0,"ur5_matrices",0,-1,51289); _SFD_TRANS_COV_WTS(0,0,0,1,0); if (chartAlreadyPresent==0) { _SFD_TRANS_COV_MAPS(0, 0,NULL,NULL, 0,NULL,NULL, 1,NULL,NULL, 0,NULL,NULL); } { unsigned int dimVector[1]; dimVector[0]= 6; _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c25_sf_marshallOut,(MexInFcnForType)NULL); } { unsigned int dimVector[1]; dimVector[0]= 6; _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c25_sf_marshallOut,(MexInFcnForType)NULL); } { unsigned int dimVector[1]; dimVector[0]= 6; _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c25_sf_marshallOut,(MexInFcnForType)NULL); } { unsigned int dimVector[1]; dimVector[0]= 6; _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c25_sf_marshallOut,(MexInFcnForType) c25_sf_marshallIn); } { real_T (*c25_q)[6]; real_T (*c25_dq)[6]; real_T (*c25_tau)[6]; real_T (*c25_ddq)[6]; c25_ddq = (real_T (*)[6])ssGetOutputPortSignal(chartInstance->S, 1); c25_tau = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 2); c25_dq = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 1); c25_q = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, *c25_q); _SFD_SET_DATA_VALUE_PTR(1U, *c25_dq); _SFD_SET_DATA_VALUE_PTR(2U, *c25_tau); _SFD_SET_DATA_VALUE_PTR(3U, *c25_ddq); } } } else { sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct, _JointSpaceControl_BestInertiaMachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } } static const char* sf_get_instance_specialization(void) { return "SilIb6Cx2GyA59NBQhDvfH"; } static void sf_opaque_initialize_c25_JointSpaceControl_BestInertia(void *chartInstanceVar) { chart_debug_initialization(((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar)->S,0); initialize_params_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar); initialize_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar); } static void sf_opaque_enable_c25_JointSpaceControl_BestInertia(void *chartInstanceVar) { enable_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar); } static void sf_opaque_disable_c25_JointSpaceControl_BestInertia(void *chartInstanceVar) { disable_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar); } static void sf_opaque_gateway_c25_JointSpaceControl_BestInertia(void *chartInstanceVar) { sf_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar); } extern const mxArray* sf_internal_get_sim_state_c25_JointSpaceControl_BestInertia(SimStruct* S) { ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S); mxArray *plhs[1] = { NULL }; mxArray *prhs[4]; int mxError = 0; prhs[0] = mxCreateString("chart_simctx_raw2high"); prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S)); prhs[2] = (mxArray*) get_sim_state_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInfo->chartInstance); /* raw sim ctx */ prhs[3] = (mxArray*) sf_get_sim_state_info_c25_JointSpaceControl_BestInertia();/* state var info */ mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate"); mxDestroyArray(prhs[0]); mxDestroyArray(prhs[1]); mxDestroyArray(prhs[2]); mxDestroyArray(prhs[3]); if (mxError || plhs[0] == NULL) { sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_raw2high'.\n"); } return plhs[0]; } extern void sf_internal_set_sim_state_c25_JointSpaceControl_BestInertia (SimStruct* S, const mxArray *st) { ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S); mxArray *plhs[1] = { NULL }; mxArray *prhs[4]; int mxError = 0; prhs[0] = mxCreateString("chart_simctx_high2raw"); prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S)); prhs[2] = mxDuplicateArray(st); /* high level simctx */ prhs[3] = (mxArray*) sf_get_sim_state_info_c25_JointSpaceControl_BestInertia();/* state var info */ mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate"); mxDestroyArray(prhs[0]); mxDestroyArray(prhs[1]); mxDestroyArray(prhs[2]); mxDestroyArray(prhs[3]); if (mxError || plhs[0] == NULL) { sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n"); } set_sim_state_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInfo->chartInstance, mxDuplicateArray(plhs[0])); mxDestroyArray(plhs[0]); } static const mxArray* sf_opaque_get_sim_state_c25_JointSpaceControl_BestInertia (SimStruct* S) { return sf_internal_get_sim_state_c25_JointSpaceControl_BestInertia(S); } static void sf_opaque_set_sim_state_c25_JointSpaceControl_BestInertia(SimStruct* S, const mxArray *st) { sf_internal_set_sim_state_c25_JointSpaceControl_BestInertia(S, st); } static void sf_opaque_terminate_c25_JointSpaceControl_BestInertia(void *chartInstanceVar) { if (chartInstanceVar!=NULL) { SimStruct *S = ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar)->S; if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) { sf_clear_rtw_identifier(S); unload_JointSpaceControl_BestInertia_optimization_info(); } finalize_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar); utFree((void *)chartInstanceVar); ssSetUserData(S,NULL); } } static void sf_opaque_init_subchart_simstructs(void *chartInstanceVar) { initSimStructsc25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*) chartInstanceVar); } extern unsigned int sf_machine_global_initializer_called(void); static void mdlProcessParameters_c25_JointSpaceControl_BestInertia(SimStruct *S) { int i; for (i=0;i<ssGetNumRunTimeParams(S);i++) { if (ssGetSFcnParamTunable(S,i)) { ssUpdateDlgParamAsRunTimeParam(S,i); } } if (sf_machine_global_initializer_called()) { initialize_params_c25_JointSpaceControl_BestInertia ((SFc25_JointSpaceControl_BestInertiaInstanceStruct*)(((ChartInfoStruct *) ssGetUserData(S))->chartInstance)); } } static void mdlSetWorkWidths_c25_JointSpaceControl_BestInertia(SimStruct *S) { if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) { mxArray *infoStruct = load_JointSpaceControl_BestInertia_optimization_info(); int_T chartIsInlinable = (int_T)sf_is_chart_inlinable(S,sf_get_instance_specialization(),infoStruct, 25); ssSetStateflowIsInlinable(S,chartIsInlinable); ssSetRTWCG(S,sf_rtw_info_uint_prop(S,sf_get_instance_specialization(), infoStruct,25,"RTWCG")); ssSetEnableFcnIsTrivial(S,1); ssSetDisableFcnIsTrivial(S,1); ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop(S, sf_get_instance_specialization(),infoStruct,25, "gatewayCannotBeInlinedMultipleTimes")); sf_update_buildInfo(S,sf_get_instance_specialization(),infoStruct,25); if (chartIsInlinable) { ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL); ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL); ssSetInputPortOptimOpts(S, 2, SS_REUSABLE_AND_LOCAL); sf_mark_chart_expressionable_inputs(S,sf_get_instance_specialization(), infoStruct,25,3); sf_mark_chart_reusable_outputs(S,sf_get_instance_specialization(), infoStruct,25,1); } { unsigned int outPortIdx; for (outPortIdx=1; outPortIdx<=1; ++outPortIdx) { ssSetOutputPortOptimizeInIR(S, outPortIdx, 1U); } } { unsigned int inPortIdx; for (inPortIdx=0; inPortIdx < 3; ++inPortIdx) { ssSetInputPortOptimizeInIR(S, inPortIdx, 1U); } } sf_set_rtw_dwork_info(S,sf_get_instance_specialization(),infoStruct,25); ssSetHasSubFunctions(S,!(chartIsInlinable)); } else { } ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE); ssSetChecksum0(S,(2792083038U)); ssSetChecksum1(S,(3670368505U)); ssSetChecksum2(S,(1423641672U)); ssSetChecksum3(S,(2615427243U)); ssSetmdlDerivatives(S, NULL); ssSetExplicitFCSSCtrl(S,1); ssSupportsMultipleExecInstances(S,1); } static void mdlRTW_c25_JointSpaceControl_BestInertia(SimStruct *S) { if (sim_mode_is_rtw_gen(S)) { ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB"); } } static void mdlStart_c25_JointSpaceControl_BestInertia(SimStruct *S) { SFc25_JointSpaceControl_BestInertiaInstanceStruct *chartInstance; chartInstance = (SFc25_JointSpaceControl_BestInertiaInstanceStruct *)utMalloc (sizeof(SFc25_JointSpaceControl_BestInertiaInstanceStruct)); memset(chartInstance, 0, sizeof (SFc25_JointSpaceControl_BestInertiaInstanceStruct)); if (chartInstance==NULL) { sf_mex_error_message("Could not allocate memory for chart instance."); } chartInstance->chartInfo.chartInstance = chartInstance; chartInstance->chartInfo.isEMLChart = 1; chartInstance->chartInfo.chartInitialized = 0; chartInstance->chartInfo.sFunctionGateway = sf_opaque_gateway_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.initializeChart = sf_opaque_initialize_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.terminateChart = sf_opaque_terminate_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.enableChart = sf_opaque_enable_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.disableChart = sf_opaque_disable_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.getSimState = sf_opaque_get_sim_state_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.setSimState = sf_opaque_set_sim_state_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.getSimStateInfo = sf_get_sim_state_info_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.zeroCrossings = NULL; chartInstance->chartInfo.outputs = NULL; chartInstance->chartInfo.derivatives = NULL; chartInstance->chartInfo.mdlRTW = mdlRTW_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.mdlStart = mdlStart_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c25_JointSpaceControl_BestInertia; chartInstance->chartInfo.extModeExec = NULL; chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL; chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL; chartInstance->chartInfo.storeCurrentConfiguration = NULL; chartInstance->S = S; ssSetUserData(S,(void *)(&(chartInstance->chartInfo)));/* register the chart instance with simstruct */ init_dsm_address_info(chartInstance); if (!sim_mode_is_rtw_gen(S)) { } sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance); chart_debug_initialization(S,1); } void c25_JointSpaceControl_BestInertia_method_dispatcher(SimStruct *S, int_T method, void *data) { switch (method) { case SS_CALL_MDL_START: mdlStart_c25_JointSpaceControl_BestInertia(S); break; case SS_CALL_MDL_SET_WORK_WIDTHS: mdlSetWorkWidths_c25_JointSpaceControl_BestInertia(S); break; case SS_CALL_MDL_PROCESS_PARAMETERS: mdlProcessParameters_c25_JointSpaceControl_BestInertia(S); break; default: /* Unhandled method */ sf_mex_error_message("Stateflow Internal Error:\n" "Error calling c25_JointSpaceControl_BestInertia_method_dispatcher.\n" "Can't handle method %d.\n", method); break; } }
29.001006
131
0.725641
[ "model" ]
9c67b0aac877b6ae2ac753beb9ae1973024c1e10
506
h
C
cppchessengine/model/Pawn.h
MikeAllport/cpp_chess
51d0ae531cb73099a983fdeb192e9aa7a5ad85a5
[ "MIT" ]
null
null
null
cppchessengine/model/Pawn.h
MikeAllport/cpp_chess
51d0ae531cb73099a983fdeb192e9aa7a5ad85a5
[ "MIT" ]
null
null
null
cppchessengine/model/Pawn.h
MikeAllport/cpp_chess
51d0ae531cb73099a983fdeb192e9aa7a5ad85a5
[ "MIT" ]
null
null
null
#ifndef CHESS_MODEL_PAWN #define CHESS_MODEL_PAWN #include "Piece.h" namespace ChessEngine::Model { class Pawn : public Piece { public: Pawn(Enums::Colour colour, Point position) : Piece(colour, position) {}; Piece* Copy() override { return (Piece*) new Pawn(*this); } Enums::PieceType GetType() const override { return Enums::PAWN; } bool HasMoved() { return hasMoved; }; void SetMoved(bool moved) { hasMoved = moved; } private: bool hasMoved = false; }; } #endif // !CHESS_MODEL_PAWN
23
74
0.699605
[ "model" ]
9c6d3d5a37b614f8a90b39992f51c06c19d0fb0e
645
h
C
include/bindings/model/eval-result.h
Accelergy-Project/timeloop-python
e81d4e0c8db05cbfc23c3ed04839758ba617da7c
[ "MIT" ]
2
2021-09-30T06:13:40.000Z
2022-03-21T20:20:13.000Z
include/bindings/model/eval-result.h
Accelergy-Project/timeloop-python
e81d4e0c8db05cbfc23c3ed04839758ba617da7c
[ "MIT" ]
2
2021-06-22T03:56:55.000Z
2022-02-25T21:12:10.000Z
include/bindings/model/eval-result.h
Accelergy-Project/timeloop-python
e81d4e0c8db05cbfc23c3ed04839758ba617da7c
[ "MIT" ]
1
2021-08-01T09:12:24.000Z
2021-08-01T09:12:24.000Z
#pragma once #include <cstdint> #include <optional> #include <vector> // Timeloop headers #include <model/level.hpp> // PyBind11 headers #include <pybind11/pybind11.h> #include <pybind11/stl.h> namespace py = pybind11; namespace model_bindings { void BindEvaluationResult(py::module& m); } // namespace model_bindings struct EvaluationResult { uint64_t id; std::vector<model::EvalStatus> pre_eval_status; std::optional<std::vector<model::EvalStatus>> eval_status; double utilization; double energy; double area; uint64_t cycles; uint64_t algorithmic_computes; uint64_t actual_computes; uint64_t last_level_accesses; };
20.806452
60
0.76124
[ "vector", "model" ]
9c7d720f1bf8e45b79f8cf2cd2216b19afb54ca2
1,286
c
C
nitan/cmds/usr/icon.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
1
2019-03-27T07:25:16.000Z
2019-03-27T07:25:16.000Z
nitan/cmds/usr/icon.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
nitan/cmds/usr/icon.c
cantona/NT6
073f4d491b3cfe6bfbe02fbad12db8983c1b9201
[ "MIT" ]
null
null
null
#include <ansi.h> inherit F_CLEAN_UP; #define MAX_ICONS 2159 int help(); int main(object me,string arg) { mixed tmp; int ico; string str="",icon=HIR"空,沒有設置"NOR; if( (tmp=query("icon", me)) ) { if( intp(tmp) ) { icon = sprintf("%d",tmp); str=L_ICON(icon); } else if( stringp(tmp) ) { icon = tmp; str=L_ICON(icon); } } str+=NOR+"你原來的頭像編號是"+HIY+icon+NOR+"!\n"; if(arg) { if(sscanf(arg,"%d",ico)!=1||ico<=0||ico>=MAX_ICONS) return help(); icon=sprintf("%d",ico); while( sizeof(icon)<5 ) icon = "0" + icon; str+="它已經被修改為"+HIG+icon+NOR+"了!\n"; set("icon", icon, me); } else help(); tell_object(me,str); return 1; } int help() { write("命令格式:"+HIY+"icon [圖標編號]\n"+NOR+ " 你可以用本命令查詢和修改自己的頭像編號。\n"+ " 你可以去[http://www.qqchat.net]查詢和選擇自己的頭像圖標編號。\n"+ " 目前圖標可以選擇範圍是"+HIR+" 1 - "+MAX_ICONS+NOR+" 。\n"); return 1; }
24.730769
68
0.393468
[ "object" ]
9c90db9a56ac9a95671d58add327a5c6d1dbf360
9,676
c
C
pngtostl.c
Andrea-MariaDB-2/pngtostl
72858dad9ec191863a911ba76dd99df323397fb5
[ "BSD-2-Clause" ]
157
2021-07-31T09:16:23.000Z
2022-01-11T08:49:01.000Z
pngtostl.c
Andrea-MariaDB-2/pngtostl
72858dad9ec191863a911ba76dd99df323397fb5
[ "BSD-2-Clause" ]
1
2021-09-30T09:43:55.000Z
2021-11-03T15:22:22.000Z
pngtostl.c
Andrea-MariaDB-2/pngtostl
72858dad9ec191863a911ba76dd99df323397fb5
[ "BSD-2-Clause" ]
6
2021-08-01T00:32:13.000Z
2021-11-05T19:59:39.000Z
/* Copyright (c) 2021, Salvatore Sanfilippo <antirez at gmail dot com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 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. * * 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 OWNER 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. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #define PNG_DEBUG 3 #include <png.h> #include <math.h> /* Global parameters set via command line options. */ int OptNegative = 1; int OptLevels = 20; float OptReliefHeight = 1; float OptBaseHeight = .2; /* Emits a triangle in the format of STL files. We use a normal set to * zero, so it is up to the slicer to calculate the real normal: for this * reason the function should be called with the three vertexes in * counter clockwise order from the POV of looking at the face from outside * the solid. */ void emitTriangle(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) { printf("facet normal 0,0,0\n"); printf("\touter loop\n"); printf("\t\tvertex %f %f %f\n",x1,y1,z1); printf("\t\tvertex %f %f %f\n",x2,y2,z2); printf("\t\tvertex %f %f %f\n",x3,y3,z3); printf("\tendloop\n"); printf("endfacet\n"); } /* Transforms the box originating at x,y and with x-y dimension xsize,ysize * and height (from the Z plane) zheight, into the corresponding set * of triangles. * * The x,y pair identifies the bottom-left corner of the box. */ void boxToTriangles(float x, float y, float xsize, float ysize, float zheight) { /* Bottom side. */ emitTriangle(x,y,0,x,y+ysize,0,x+xsize,y,0); emitTriangle(x+xsize,y,0,x,y+ysize,0,x+xsize,y+ysize,0); /* Top side. */ emitTriangle(x,y,zheight,x+xsize,y,zheight,x,y+ysize,zheight); emitTriangle(x+xsize,y,zheight,x+xsize,y+ysize,zheight,x,y+ysize,zheight); /* Left side. */ emitTriangle(x,y,0,x,y,zheight,x,y+ysize,0); emitTriangle(x,y+ysize,0,x,y,zheight,x,y+ysize,zheight); /* Right side. */ float rx = x+xsize; emitTriangle(rx,y,0,rx,y+ysize,0,rx,y,zheight); emitTriangle(rx,y+ysize,0,rx,y+ysize,zheight,rx,y,zheight); /* Front side. */ emitTriangle(x,y,0,x+xsize,y,zheight,x,y,zheight); emitTriangle(x,y,0,x+xsize,y,0,x+xsize,y,zheight); /* Back side. */ float by = y+ysize; emitTriangle(x,by,0,x,by,zheight,x+xsize,by,zheight); emitTriangle(x,by,0,x+xsize,by,zheight,x+xsize,by,0); } /* Load a PNG and returns it as a raw RGB representation, as an array of bytes. * As a side effect the function populates widthptr, heigthptr with the * size of the image in pixel. The integer pointed by alphaptr is set to one. * if the image is of type RGB_ALPHA, otherwise it's set to zero. * * This function is able to load both RGB and RGBA images, but it will always * return data as RGB, discarding the alpha channel. */ #define PNG_BYTES_TO_CHECK 8 unsigned char *PngLoad(FILE *fp, int *widthptr, int *heightptr, int *alphaptr) { unsigned char buf[PNG_BYTES_TO_CHECK]; png_structp png_ptr; png_infop info_ptr; png_uint_32 width, height, j; int color_type, row_bytes; unsigned char **imageData, *rgb; /* Check signature */ if (fread(buf, 1, PNG_BYTES_TO_CHECK, fp) != PNG_BYTES_TO_CHECK) return NULL; if (png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK)) return NULL; /* Not a PNG image */ /* Initialize data structures */ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL,NULL,NULL); if (png_ptr == NULL) { return NULL; /* Out of memory */ } info_ptr = png_create_info_struct(png_ptr); if (info_ptr == NULL) { png_destroy_read_struct(&png_ptr, NULL, NULL); return NULL; } /* Error handling code */ if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return NULL; } /* Set the I/O method */ png_init_io(png_ptr, fp); /* Undo the fact that we read some data to detect the PNG file */ png_set_sig_bytes(png_ptr, PNG_BYTES_TO_CHECK); /* Read the PNG in memory at once */ png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); /* Get image info */ width = png_get_image_width(png_ptr, info_ptr); height = png_get_image_height(png_ptr, info_ptr); color_type = png_get_color_type(png_ptr, info_ptr); if (color_type != PNG_COLOR_TYPE_RGB && color_type != PNG_COLOR_TYPE_RGB_ALPHA) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return NULL; } /* Get the image data */ imageData = png_get_rows(png_ptr, info_ptr); row_bytes = png_get_rowbytes(png_ptr, info_ptr); rgb = malloc(row_bytes*height); if (!rgb) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return NULL; } for (j = 0; j < height; j++) { unsigned char *dst = rgb+(j*width*3); unsigned char *src = imageData[j]; unsigned int i; for (i = 0; i < width; i++) { dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst += 3; src += (color_type == PNG_COLOR_TYPE_RGB_ALPHA) ? 4 : 3; } } /* Free the image and resources and return */ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); *widthptr = width; *heightptr = height; if (alphaptr) *alphaptr = (color_type == PNG_COLOR_TYPE_RGB_ALPHA); return rgb; } /* Convert the specified PNG file into an STL where thickness of any point is * proportional to the image level of gray. */ void pngtostl(const char *filename) { FILE *fp = fopen(filename,"r"); if (fp == NULL) { perror("Opening the PNG file"); exit(1); } /* Load the PNG file in memory as RGB raw data. */ int w, h; unsigned char *rgb = PngLoad(fp,&w,&h,NULL); if (rgb == NULL) { fprintf(stderr,"Error parsing the PNG file.\n"); exit(1); } fclose(fp); float max = 0; /* Calculate the max white level in the image. */ unsigned char *p = rgb; for (int j = 0; j < w*h; j++) { float lum = (float)(p[0]+p[1]+p[2])/3; if (lum > max) max = lum; p += 3; } /* Emit the STL file. */ p = rgb; printf("solid PngToStl\n"); for (int y = h-1; y >= 0; y--) { for (int x = 0; x < w; x++) { float lum = (float)(p[0]+p[1]+p[2])/3; int level = round((OptLevels-1)*lum/max); if (OptNegative) level = OptLevels-level-1; float height = OptBaseHeight+(OptReliefHeight*level/OptLevels); boxToTriangles(x,y,1,1,height); p += 3; } } printf("endsolidPngToStl\n"); } /* Show help on wrong call or if --help is given. */ void showHelp(void) { fprintf(stderr,"png2stl image.png [... options ...]\n" " --relief-height <mm> | Relief height. Default: 1 mm\n" " --base-height <mm> | Fixed base height. Default: .2 mm\n" " --levels | Number of different levels (heights/greys). Default: 20\n" " --negative | Use thicker plastic for black (default).\n" " --positive | Use thicker plastic for white.\n"); } int main(int argc, char **argv) { const char *filename = NULL; /* Check arity and parse additional args if any. */ if (argc < 2) { showHelp(); exit(0); } int j; for (j = 1; j < argc; j++) { int moreargs = j+1 < argc; if (!strcmp(argv[j],"--relief-height") && moreargs) { OptReliefHeight = atof(argv[++j]); } else if (!strcmp(argv[j],"--base-height") && moreargs) { OptBaseHeight = atof(argv[++j]); } else if (!strcmp(argv[j],"--levels") && moreargs) { OptLevels = atoi(argv[++j]); if (OptLevels < 2) OptLevels = 2; } else if (!strcmp(argv[j],"--positive")) { OptNegative = 0; } else if (!strcmp(argv[j],"--negative")) { OptNegative = 1; } else if (!strcmp(argv[j],"--help")) { showHelp(); exit(0); } else if (argv[j][0] != '-' && filename == NULL) { filename = argv[j]; } else { fprintf(stderr,"Invalid options."); showHelp(); exit(1); } } if (filename == NULL) { fprintf(stderr,"No PNG filename given\n"); exit(1); } pngtostl(filename); return 0; }
35.313869
95
0.617507
[ "solid" ]
9c90e1b350c80bf02395f895f9d57e9a3a43a7a1
29,584
h
C
CLR/Tools/Include/AssemblyParser.h
Sirokujira/MicroFrameworkPK_v4_3
a0d80b4fd8eeda6dbdb58f6f7beb4f07f7ef563e
[ "Apache-2.0" ]
4
2019-01-21T11:47:53.000Z
2020-06-09T02:14:15.000Z
CLR/Tools/Include/AssemblyParser.h
yisea123/NetmfSTM32
62ddb8aa0362b83d2e73f3621a56593988e3620f
[ "Apache-2.0" ]
null
null
null
CLR/Tools/Include/AssemblyParser.h
yisea123/NetmfSTM32
62ddb8aa0362b83d2e73f3621a56593988e3620f
[ "Apache-2.0" ]
6
2017-11-09T11:48:10.000Z
2020-05-24T09:43:07.000Z
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) Microsoft Corporation. All rights reserved. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #pragma once #include <TinyCLR_Runtime.h> typedef LPCSTR LPCUTF8; typedef LPSTR LPUTF8; #include <cor.h> #include <corhdr.h> #include <corhlpr.h> #include <corsym.h> _COM_SMRT_PTR(ISymUnmanagedReader); _COM_SMRT_PTR(ISymUnmanagedBinder); _COM_SMRT_PTR_2(IMetaDataDispenserEx,IID_IMetaDataDispenserEx); _COM_SMRT_PTR_2(IMetaDataImport, IID_IMetaDataImport); _COM_SMRT_PTR_2(IMetaDataImport2, IID_IMetaDataImport2); _COM_SMRT_PTR_2(IMetaDataAssemblyImport, IID_IMetaDataAssemblyImport); ////////////////////////////////////////////////////// namespace WatchAssemblyBuilder { class Linker; }; //--// class PELoader { HANDLE m_hFile; HANDLE m_hMapFile; HMODULE m_hMod; PIMAGE_NT_HEADERS m_pNT; HRESULT Initialize(); public: PELoader(); ~PELoader(); PELoader( const PELoader& pe ); PELoader& operator= ( const PELoader& pe ); HRESULT OpenAndMapToMemory( const WCHAR* moduleNameIn ); HRESULT OpenAndDecode ( const WCHAR* moduleNameIn ); bool GetCOMHeader( IMAGE_COR20_HEADER*& pCorHeader ); bool GetResource ( DWORD offset, BYTE*& pResource, DWORD& iSize ); bool GetVAforRVA ( DWORD rva , void*& va ); void Close(); PIMAGE_NT_HEADERS NtHeaders () { return m_pNT; } BYTE* Base () { return (BYTE*)m_hMod; } HMODULE GetHModule() { return m_hMod; } HANDLE GetHFile () { return m_hFile; } private: void InitToZero(); }; //--// namespace MetaData { typedef std::set<mdToken> mdTokenSet; typedef mdTokenSet::iterator mdTokenSetIter; typedef std::list<mdToken> mdTokenList; typedef mdTokenList::iterator mdTokenListIter; typedef std::map<mdToken,int> mdTokenMap; typedef mdTokenMap::iterator mdTokenMapIter; typedef std::list<mdTypeRef> mdTypeRefList; typedef mdTypeRefList::iterator mdTypeRefListIter; typedef std::list<mdMemberRef> mdMemberRefList; typedef mdMemberRefList::iterator mdMemberRefListIter; typedef std::list<mdTypeDef> mdTypeDefList; typedef mdTypeDefList::iterator mdTypeDefListIter; typedef std::list<mdFieldDef> mdFieldDefList; typedef mdFieldDefList::iterator mdFieldDefListIter; typedef std::list<mdMethodDef> mdMethodDefList; typedef mdMethodDefList::iterator mdMethodDefListIter; typedef std::list<mdInterfaceImpl> mdInterfaceImplList; typedef mdInterfaceImplList::iterator mdInterfaceImplListIter; typedef std::list<int> LimitList; typedef LimitList::iterator LimitListIter; class Parser; class Collection; struct TypeDef; struct MethodDef; //--// void SetReference( MetaData::mdTokenSet& m, mdToken d ); template <class K> bool IsTokenPresent( std::set<K>& d, mdToken tk ) { if(IsNilToken(tk)) return true; return d.find( tk ) != d.end(); } template <class T> bool IsTokenPresent( T& d, mdToken tk ) { if(IsNilToken(tk)) return true; return d.find( tk ) != d.end(); } //--// struct ByteCode { struct LogicalOpcodeDesc { const CLR_RT_OpcodeLookup* m_ol; CLR_OPCODE m_op; CLR_UINT32 m_ipOffset; CLR_UINT32 m_ipLength; CLR_UINT32 m_stackDepth; CLR_INT32 m_stackDiff; CLR_UINT32 m_references; CLR_UINT32 m_index; mdToken m_token; CLR_INT32 m_arg_I4; CLR_INT32 m_arg_R4; CLR_INT64 m_arg_I8; CLR_INT64 m_arg_R8; std::vector<CLR_INT32> m_targets; LogicalOpcodeDesc( const CLR_RT_OpcodeLookup& ol, CLR_OPCODE op, const UINT8* ip, const UINT8* ipEnd ); }; struct LogicalExceptionBlock { CorExceptionFlag m_Flags; CLR_INT32 m_TryIndex; CLR_INT32 m_TryIndexEnd; CLR_UINT32 m_TryOffset; CLR_UINT32 m_TryLength; CLR_INT32 m_HandlerIndex; CLR_INT32 m_HandlerIndexEnd; CLR_UINT32 m_HandlerOffset; CLR_UINT32 m_HandlerLength; mdToken m_ClassToken; CLR_UINT32 m_FilterOffset; CLR_INT32 m_FilterIndex; }; typedef std::map<CLR_INT32,CLR_INT32> OffsetToIndex; typedef OffsetToIndex::iterator OffsetToIndexIter; typedef OffsetToIndex::const_iterator OffsetToIndexConstIter; typedef std::vector<LogicalOpcodeDesc> LogicalOpcodeDescVector; typedef LogicalOpcodeDescVector::iterator LogicalOpcodeDescVectorIter; typedef LogicalOpcodeDescVector::const_iterator LogicalOpcodeDescVectorConstIter; typedef std::vector<LogicalExceptionBlock> LogicalExceptionBlockVector; typedef LogicalExceptionBlockVector::iterator LogicalExceptionBlockVectorIter; typedef LogicalExceptionBlockVector::const_iterator LogicalExceptionBlockVectorConstIter; typedef std::map<size_t,size_t> Distribution; typedef Distribution::iterator DistributionIter; typedef Distribution::const_iterator DistributionConstIter; //--// std::wstring m_name; LogicalOpcodeDescVector m_opcodes; LogicalExceptionBlockVector m_exceptions; static Distribution s_numOfOpcodes; static Distribution s_numOfEHs; static Distribution s_sizeOfMethod; //--// HRESULT Parse ( const TypeDef& td, const MethodDef& md, COR_ILMETHOD_DECODER& il ); HRESULT VerifyConsistency( const TypeDef& td, const MethodDef& md, Parser* pr ); //--// HRESULT ConvertTokens( mdTokenMap& lookupIDs ); HRESULT GenerateOldIL( std::vector<BYTE>& code, bool fBigEndian ); CLR_UINT32 MaxStackDepth(); //--// void DumpStats(); static void DumpDistributionStats(); private: HRESULT UpdateStackDepth ( ); HRESULT ComputeStackDepth( size_t pos, CLR_UINT32 depth ); LogicalOpcodeDesc* FindTarget( OffsetToIndex& map, CLR_INT32 offset, CLR_INT32& index ); void DumpOpcode( size_t index, LogicalOpcodeDesc& ref ); //--// HRESULT Parse_ByteCode( const MethodDef& md, COR_ILMETHOD_DECODER& il ); }; //--// struct TypeSignature { Parser* m_holder; // Type of element. CorElementType m_opt; // It was introduced for supporting of pinned attribute on local variables. See ELEMENT_TYPE_MODIFIER // In theory it could be incorporated into m_opt. Then it would require modification of existing code using m_opt. // Also in signature for local variables type modifier inserted as separate 8 bit field. So we follow the same logic. CorElementType m_optTypeModifier; mdToken m_token; TypeSignature* m_sub; int m_rank; LimitList m_sizes; LimitList m_lowBounds; //--// TypeSignature( Parser* holder ); TypeSignature( const TypeSignature& ts ); // Assigment opertor creates new based on ts.m_sub. // Operator should be updated if new members are added to TypeSignature!!! TypeSignature& operator= ( const TypeSignature& ts ); ~TypeSignature(); //--// void ExtractTypeRef( mdTokenSet& set ); HRESULT Parse( PCCOR_SIGNATURE& pSigBlob ); HRESULT Parse( CLR_RT_StringVector& sig , CLR_RT_StringVector::size_type& pos ); bool operator==( const TypeSignature& sig ) const ; bool operator!=( const TypeSignature& sig ) const { return !(*this == sig); } private: void Init (); void Clean(); HRESULT ParseToken ( PCCOR_SIGNATURE& pSigBlob ); HRESULT ParseToken ( CLR_RT_StringVector& sig , CLR_RT_StringVector::size_type& pos ); HRESULT ParseSubType( PCCOR_SIGNATURE& pSigBlob ); HRESULT ParseSubType( CLR_RT_StringVector& sig , CLR_RT_StringVector::size_type& pos ); HRESULT ParseSzArray( PCCOR_SIGNATURE& pSigBlob ); HRESULT ParseSzArray( CLR_RT_StringVector& sig , CLR_RT_StringVector::size_type& pos ); HRESULT ParseArray ( PCCOR_SIGNATURE& pSigBlob ); HRESULT ParseArray ( CLR_RT_StringVector& sig , CLR_RT_StringVector::size_type& pos ); }; typedef std::list<TypeSignature> TypeSignatureList; typedef TypeSignatureList::iterator TypeSignatureIter; struct MethodSignature { Parser* m_holder; BYTE m_flags; TypeSignature m_retValue; TypeSignatureList m_lstParams; //--// MethodSignature( Parser* holder ); //--// void ExtractTypeRef( mdTokenSet& set ); HRESULT Parse( PCCOR_SIGNATURE& pSigBlob ); HRESULT Parse( CLR_RT_StringVector& sig , CLR_RT_StringVector::size_type& pos ); bool operator==( const MethodSignature& sig ) const ; bool operator!=( const MethodSignature& sig ) const { return !(*this == sig); } }; struct LocalVarSignature { Parser* m_holder; TypeSignatureList m_lstVars; //--// LocalVarSignature( Parser* holder ); //--// void ExtractTypeRef( mdTokenSet& set ); HRESULT Parse( PCCOR_SIGNATURE& pSigBlob ); HRESULT Parse( CLR_RT_StringVector& sig , CLR_RT_StringVector::size_type& pos ); }; struct TypeSpecSignature { Parser* m_holder; mdToken m_type; TypeSignature m_sigField; LocalVarSignature m_sigLocal; MethodSignature m_sigMethod; //--// TypeSpecSignature( Parser* holder ); //--// void ExtractTypeRef( mdTokenSet& set ); HRESULT Parse( PCCOR_SIGNATURE& pSigBlob ); HRESULT Parse( CLR_RT_StringVector& sig , CLR_RT_StringVector::size_type& pos ); }; //--// struct AssemblyRef { mdAssemblyRef m_ar; DWORD m_flags; std::wstring m_name; CLR_RECORD_VERSION m_version; AssemblyRef(); }; struct ModuleRef { mdModuleRef m_mr; std::wstring m_name; ModuleRef(); }; struct TypeRef { mdTypeRef m_tr; std::wstring m_name; mdToken m_scope; // ResolutionScope coded index. mdMemberRefList m_lst; TypeRef(); }; struct MemberRef { mdToken m_tr; // MemberRefParent coded index. mdToken m_mr; // MemberRefParent coded index. std::wstring m_name; TypeSpecSignature m_sig; MemberRef( Parser* holder ); }; struct TypeDef { mdTypeDef m_td; DWORD m_flags; std::wstring m_name; mdToken m_extends; // TypeDefOrRef coded index. mdTypeDef m_enclosingClass; mdFieldDefList m_fields; mdMethodDefList m_methods; mdInterfaceImplList m_interfaces; TypeDef(); }; struct FieldDef { mdTypeDef m_td; mdFieldDef m_fd; DWORD m_attr; DWORD m_flags; std::wstring m_name; CLR_RT_Buffer m_value; TypeSpecSignature m_sig; FieldDef( Parser* holder ); bool SetValue( const void* ptr, int len ); }; struct MethodDef { mdTypeDef m_td; mdMethodDef m_md; DWORD m_implFlags; DWORD m_flags; std::wstring m_name; MethodSignature m_method; LocalVarSignature m_vars; DWORD m_RVA; const BYTE* m_VA; ByteCode m_byteCode; ByteCode m_byteCodeOriginal; CLR_UINT32 m_maxStack; MethodDef( Parser* holder ); }; struct InterfaceImpl { mdTypeDef m_td; mdToken m_itf; // TypeDefOrRef InterfaceImpl(); }; struct CustomAttribute { struct Reader { std::vector<BYTE>& m_blob; const BYTE* m_pos; Reader( std::vector<BYTE>& blob ); bool Read( void* dst, int size ); bool ReadCompressedLength( int& val ); bool Read( CorSerializationType& val ); bool Read( CLR_UINT8& val ); bool Read( CLR_UINT16& val ); bool Read( CLR_UINT32& val ); bool Read( CLR_UINT64& val ); bool Read( std::wstring& val ); }; struct Writer { WatchAssemblyBuilder::Linker* m_lk; BYTE*& m_ptr; BYTE* m_end; Writer( WatchAssemblyBuilder::Linker* lk, BYTE*& ptr, BYTE* end ); bool Write( const void* dst, int size ); bool WriteCompressedLength( int val ); bool Write( const CorSerializationType val ); bool Write( const CLR_UINT8 val ); bool Write( const CLR_UINT16 val ); bool Write( const CLR_UINT32 val ); bool Write( const CLR_UINT64 val ); bool Write( const std::wstring& val ); }; struct Name { bool m_fField; std::wstring m_text; bool operator<( const Name& r ) const { return m_text < r.m_text; } }; union Numeric { CLR_UINT8 u1; CLR_UINT16 u2; CLR_UINT32 u4; CLR_UINT64 u8; // CLR_INT8 s1; CLR_INT16 s2; CLR_INT32 s4; CLR_INT64 s8; Numeric() { u8 = 0; } }; struct Value { CorSerializationType m_opt; Numeric m_numeric; std::wstring m_text; //--// Value() { m_opt = (CorSerializationType)ELEMENT_TYPE_VOID; } bool Parse( Reader& reader ); bool Emit ( Writer& writer ); }; typedef std::list< Value > ValueList; typedef ValueList::iterator ValueListIter; typedef std::map< Name, Value > ValueMap ; typedef ValueMap ::iterator ValueMapIter; Parser* m_holder; mdToken m_tkObj; mdToken m_tkType; std::vector<BYTE> m_blob; ValueList m_valuesFixed; ValueMap m_valuesVariable; std::wstring m_nameOfAttributeClass; //--// CustomAttribute( Parser* holder ); HRESULT Parse(); }; struct TypeSpec { mdTypeSpec m_ts; TypeSignature m_sig; TypeSpec( Parser* holder ); }; struct ManifestResource { mdManifestResource m_mr; std::wstring m_name; std::vector<BYTE> m_blob; mdToken m_tkImplementation; DWORD m_dwResourceFlags; bool m_fUsed; //--// ManifestResource( Parser* holder ); }; struct ParsedResource { CLR_UINT16 m_kind; mdToken m_tkObj; CLR_UINT16 m_langId; CLR_UINT32 m_id; std::wstring m_text; CLR_RT_Buffer m_blob; //--// std::wstring m_fullName; bool m_fNoCompression; }; //--// class TypeDefMapSorted : public std::map<std::wstring, TypeDef> { std::map<mdTypeDef, std::wstring> m_mdTokenToTypeName; public : iterator find(const mdTypeDef& mdKey) { // Map from type token into full type name. std::map<mdTypeDef, std::wstring>::iterator pName = m_mdTokenToTypeName.find( mdKey ); // If there is no string for token - not found. if ( pName == m_mdTokenToTypeName.end() ) { // Means element was not found return end(); } // pName->second is type name. Looks element by type name return std::map<std::wstring, MetaData::TypeDef>::find( pName->second ); } void insert( const mdTypeDef& tk, const TypeDef& td ) { // Create string representation of token. wchar_t name_buffer[100]; swprintf( name_buffer, ARRAYSIZE(name_buffer) - 1, L"%x", (UINT32)tk ); // Take the type name and concatinate with string representation of token. // This way we cover the case if type name is empty and also absolutely sure that string is unique. // The strings still ordered alphabetically by type name becuase it goes first. std::wstring strName = td.m_name + std::wstring( name_buffer ) ; // Insert token/typename into m_mdTokenToTypeName - map of type tokens to typename strings. m_mdTokenToTypeName.insert( std::pair<mdTypeDef,std::wstring>( tk, strName ) ); // Insert into typename/TypeDef map. Calls "insert" of base map class. std::map<std::wstring, TypeDef>::insert( std::pair<std::wstring, TypeDef>( strName, td ) ); } void RemoveByToken( mdToken tk ) { // First search in the list of type names. std::map<mdTypeDef, std::wstring>::iterator pName = m_mdTokenToTypeName.find( tk ); // If found, remove type by name. if ( pName != m_mdTokenToTypeName.end() ) { // Removes string to type pair erase( pName->second ); // Removes token to string pair m_mdTokenToTypeName.erase( tk ); } } }; typedef std::map < mdAssemblyRef , AssemblyRef > AssemblyRefMap ; typedef AssemblyRefMap ::iterator AssemblyRefMapIter ; typedef std::map < mdModuleRef , ModuleRef > ModuleRefMap ; typedef ModuleRefMap ::iterator ModuleRefMapIter ; typedef std::map < mdTypeRef , TypeRef > TypeRefMap ; typedef TypeRefMap ::iterator TypeRefMapIter ; typedef std::map < mdMemberRef , MemberRef > MemberRefMap ; typedef MemberRefMap ::iterator MemberRefMapIter ; typedef TypeDefMapSorted TypeDefMap ; typedef TypeDefMap ::iterator TypeDefMapIter ; typedef std::map < mdFieldDef , FieldDef > FieldDefMap ; typedef FieldDefMap ::iterator FieldDefMapIter ; typedef std::map < mdMethodDef , MethodDef > MethodDefMap ; typedef MethodDefMap ::iterator MethodDefMapIter ; typedef std::map < mdInterfaceImpl , InterfaceImpl > InterfaceImplMap ; typedef InterfaceImplMap ::iterator InterfaceImplMapIter ; typedef std::map < mdTypeSpec , TypeSpec > TypeSpecMap ; typedef TypeSpecMap ::iterator TypeSpecMapIter ; typedef std::map < mdCustomAttribute , CustomAttribute > CustomAttributeMap ; typedef CustomAttributeMap ::iterator CustomAttributeMapIter ; typedef std::map < mdString , std::wstring > UserStringMap ; typedef UserStringMap ::iterator UserStringMapIter ; typedef std::map < mdManifestResource, ManifestResource > ManifestResourceMap; typedef ManifestResourceMap::iterator ManifestResourceMapIter; typedef std::multimap< mdToken , ParsedResource > ParsedResourceMap ; typedef ParsedResourceMap ::iterator ParsedResourceMapIter ; //--// class Parser { public: typedef std::list< FieldDef > fieldDefList ; typedef fieldDefList ::iterator fieldDefListIter; typedef std::map< mdToken, fieldDefList > fieldDefMap ; typedef fieldDefMap ::iterator fieldDefMapIter; typedef std::list< MethodDef > methodDefList; typedef methodDefList::iterator methodDefListIter; typedef std::map< mdToken, MethodDef > methodDefMap ; typedef methodDefMap ::iterator methodDefMapIter; //--// Collection* m_holder; std::wstring m_assemblyFile; std::wstring m_assemblyName; CLR_RECORD_VERSION m_version; mdToken m_entryPointToken; mdAssembly m_tkAsm; AssemblyRefMap m_mapRef_Assembly; ModuleRefMap m_mapRef_Module; TypeRefMap m_mapRef_Type; MemberRefMap m_mapRef_Member; TypeDefMap m_mapDef_Type; FieldDefMap m_mapDef_Field; MethodDefMap m_mapDef_Method; InterfaceImplMap m_mapDef_Interface; CustomAttributeMap m_mapDef_CustomAttribute; mdTokenSet m_setAttributes_Methods_NativeProfiler; mdTokenSet m_setAttributes_Methods_GloballySynchronized; mdTokenSet m_setAttributes_Types_PublishInApplicationDirectory; mdTokenSet m_setAttributes_Fields_NoReflection; TypeSpecMap m_mapSpec_Type; UserStringMap m_mapDef_String; ManifestResourceMap m_mapDef_ManifestResource; //--// bool m_fVerboseMinimize; bool m_fNoByteCode; bool m_fNoAttributes; CLR_RT_StringSet m_setFilter_ExcludeClassByName; CLR_RT_StringSet m_resources; ISymUnmanagedReaderPtr m_pSymReader; private: IMetaDataDispenserExPtr m_pDisp; IMetaDataImportPtr m_pImport; IMetaDataImport2Ptr m_pImport2; IMetaDataAssemblyImportPtr m_pAssemblyImport; PELoader m_pe; FILE* m_output; FILE* m_toclose; //--// HRESULT GetAssemblyDef ( ); HRESULT GetAssemblyRef ( mdAssemblyRef ar ); HRESULT GetModuleRef ( mdModuleRef mr ); HRESULT GetTypeRef ( mdTypeRef tr ); HRESULT GetMemberRef ( mdMemberRef mr ); HRESULT GetTypeDef ( mdTypeDef td ); HRESULT GetTypeField ( mdFieldDef fd ); HRESULT GetTypeMethod ( mdMethodDef md ); HRESULT GetTypeInterface ( mdInterfaceImpl ii ); HRESULT GetCustomAttribute ( mdCustomAttribute ca ); HRESULT GetTypeSpec ( mdTypeSpec ts ); HRESULT GetUserString ( mdString s ); HRESULT GetManifestResource( mdManifestResource mr ); HRESULT EnumAssemblyRefs ( ); HRESULT EnumModuleRefs ( ); HRESULT EnumTypeRefs ( ); HRESULT EnumMemberRefs ( TypeRef& tr ); HRESULT EnumTypeDefs ( ); HRESULT EnumTypeFields ( TypeDef& td ); HRESULT EnumTypeMethods ( TypeDef& td ); HRESULT EnumTypeInterfaces ( TypeDef& td ); HRESULT EnumCustomAttributes ( ); HRESULT EnumTypeSpecs ( ); HRESULT EnumUserStrings ( ); HRESULT EnumManifestResources( ); HRESULT EnumGenericParams ( mdToken tk ); HRESULT ParseResource ( CustomAttribute& ca, CLR_UINT16 kind ); HRESULT ParseByteCode ( MethodDef& db ); HRESULT CanIncludeMember ( mdToken tk, mdToken tm ); HRESULT BuildDependencyList ( mdToken tk, mdTokenSet& set ); HRESULT IncludeAttributes ( mdToken tk, mdTokenSet& set ); //--// void Dump_SetDevice ( LPCWSTR szFileName ); void Dump_CloseDevice( ); void Dump_PrintSigForType ( TypeSignature & sig ); void Dump_PrintSigForMethod ( MethodSignature & sig ); void Dump_PrintSigForLocalVar( LocalVarSignature& sig ); void Dump_PrintSigForTypeSpec( TypeSpecSignature& sig ); void Dump_EnumAssemblyRefs ( ); void Dump_EnumModuleRefs ( ); void Dump_EnumTypeRefs ( ); void Dump_EnumTypeDefs ( bool fNoByteCode ); void Dump_EnumCustomAttributes( ); void Dump_EnumUserStrings ( ); void Dump_ShowDependencies( mdToken tk, mdTokenSet& set, mdTokenSet& setAdd ); //--// int SizeFromElementType( CorElementType et ); // bool m_fSwapEndian; public: Parser( Collection* holder ); ~Parser(); HRESULT Analyze( LPCWSTR szFileName ); HRESULT RemoveUnused(); HRESULT VerifyConsistency(); void DumpCompact( LPCWSTR szFileName ); void DumpSchema ( LPCWSTR szFileName, bool fNoByteCode ); //--// bool CheckIsTokenPresent ( mdToken tk ); HRESULT CheckTokenPresence ( mdToken tk ); HRESULT CheckTokensPresence ( mdTokenSet& set ); void TokenToString( mdToken tk, std::wstring& str ); bool SetSwapEndian( bool State ) { m_fSwapEndian=State; } bool GetSwapEndian( void ) { return m_fSwapEndian; } }; class Collection { friend class Parser; typedef std::map< std::wstring, std::wstring > LoadHintsMap ; typedef LoadHintsMap ::iterator LoadHintsMapIter; typedef std::map< std::wstring, Parser* > AssembliesMap; typedef AssembliesMap::iterator AssembliesMapIter; //--// CLR_RT_StringSet m_setIgnoreAssemblies; LoadHintsMap m_mapLoadHints; AssembliesMap m_mapAssemblies; //--// HRESULT FromNameToFile( const std::wstring& name, std::wstring& file ); bool FileExists( const std::wstring& assemblyName, const std::wstring& targetPath, std::wstring& filename ); bool FileExists( const std::wstring& filename ); public: Collection(); ~Collection(); void Clear( bool fAll ); HRESULT IgnoreAssembly( LPCWSTR szAssemblyName ); HRESULT LoadHints ( LPCWSTR szAssemblyName, LPCWSTR szFileName ); HRESULT CreateAssembly ( Parser*& pr ); HRESULT CreateDependentAssembly( LPCWSTR szFileName, Parser*& pr ); HRESULT ResolveAssemblyDef( Parser* pr, mdToken tk, Parser*& prDst ); HRESULT ResolveTypeDef ( Parser* pr, mdToken tk, Parser*& prDst, TypeDef* & tdDst ); HRESULT ResolveMethodDef ( Parser* pr, mdToken tk, Parser*& prDst, MethodDef*& mdDst ); HRESULT ResolveFieldDef ( Parser* pr, mdToken tk, Parser*& prDst, FieldDef* & fdDst ); bool IsAssemblyToken( Parser* pr, mdToken tk ); bool IsTypeToken ( Parser* pr, mdToken tk ); bool IsMethodToken ( Parser* pr, mdToken tk ); bool IsFieldToken ( Parser* pr, mdToken tk ); }; };
34.682298
200
0.546883
[ "vector" ]
9c9b5091c0ed194689c1874814ae739123064494
1,874
c
C
src/uml/send_signal_action.c
Quicksilver-Project/quicksilveruml
c9019443360c98c61edbd60c93cf2c1701912c2e
[ "MIT" ]
null
null
null
src/uml/send_signal_action.c
Quicksilver-Project/quicksilveruml
c9019443360c98c61edbd60c93cf2c1701912c2e
[ "MIT" ]
null
null
null
src/uml/send_signal_action.c
Quicksilver-Project/quicksilveruml
c9019443360c98c61edbd60c93cf2c1701912c2e
[ "MIT" ]
1
2021-04-02T21:35:06.000Z
2021-04-02T21:35:06.000Z
/**~action~ * SendSignalAction [Class] * * Description * * A SendSignalAction is an InvocationAction * that creates a Signal instance and * transmits it to the target object. * Values from the argument InputPins * are used to provide values for the * attributes of the Signal. * The requestor continues * execution immediately after * the Signal instance is sent out * and cannot receive reply values. * * Diagrams * * Invocation Actions * * Generalizations * * InvocationAction * * Association Ends * *  signal : Signal [1..1] * (opposite A_signal_sendSignalAction::sendSignalAction) * * The Signal whose instance is * transmitted to the target. * *  ♦ target : InputPin [1..1]{subsets Action::input} * (opposite A_target_sendSignalAction::sendSignalAction) * * The InputPin that provides the target object * to which the Signal instance is sent. * * Constraints * *  type_ordering_multiplicity * * The type, ordering, and multiplicity of an argument * InputPin must be the same as the corresponding attribute * of the signal. * * inv: let attribute: OrderedSet(Property) = signal.allAttributes() in * Sequence{1..argument->size()}->forAll(i | * argument->at(i).type.conformsTo(attribute->at(i).type) and * argument->at(i).isOrdered = attribute->at(i).isOrdered and * argument->at(i).compatibleWith(attribute->at(i))) * *  number_order * * The number and order of argument InputPins * must be the same as the number * and order of attributes of the signal. * * inv: argument->size()=signal.allAttributes()->size() * *  type_target_pin * * If onPort is not empty, * the Port given by onPort * must be an owned or inherited feature * of the type of the target InputPin. * * inv: not onPort->isEmpty() implies target.type.oclAsType(Classifier).allFeatures()- * >includes(onPort) **/
26.771429
86
0.703842
[ "object" ]
9ca502956a89c92a131a86178c0e0e66953cbb70
7,369
h
C
VS/Math/VS_Box.h
vectorstorm/vectorstorm
7306214108b23fa97d4a1a598197bbaa52c17d3a
[ "Zlib" ]
19
2017-04-03T09:06:21.000Z
2022-03-05T19:06:07.000Z
VS/Math/VS_Box.h
vectorstorm/vectorstorm
7306214108b23fa97d4a1a598197bbaa52c17d3a
[ "Zlib" ]
2
2019-05-24T14:40:07.000Z
2020-04-15T01:10:23.000Z
VS/Math/VS_Box.h
vectorstorm/vectorstorm
7306214108b23fa97d4a1a598197bbaa52c17d3a
[ "Zlib" ]
2
2020-03-08T07:14:49.000Z
2020-03-09T10:39:52.000Z
/* * VS_Box.h * Lord * * Created by Trevor Powell on 9/02/09. * Copyright 2009 Trevor Powell. All rights reserved. * */ #ifndef VS_BOX_H #define VS_BOX_H #include "VS/Math/VS_Vector.h" #include "VS/Math/VS_Transform.h" class vsDisplayList; class vsBox2D { bool set; vsVector2D min; vsVector2D max; public: vsBox2D() { min = max = vsVector2D::Zero; set = false; } vsBox2D(const vsBox2D &o) { *this = o; } vsBox2D(const vsVector2D &min_in, const vsVector2D &max_in) { Set(min_in,max_in); } static vsBox2D CenteredBox( const vsVector2D &dimensions ) { vsBox2D result(vsVector2D::Zero, dimensions); result -= 0.5f * dimensions; return result; } void Clear() { set = false; min = max = vsVector2D::Zero; } const vsVector2D & GetMin() const { return min; } const vsVector2D & GetMax() const { return max; } float Width() const { return max.x - min.x; } float Height() const { return max.y - min.y; } vsVector2D Middle() const { return (min + max) * 0.5f; } vsVector2D Extents() const { return max - min; } vsVector2D TopLeft() const { return min; } vsVector2D TopRight() const { return vsVector2D(max.x, min.y); } vsVector2D BottomLeft() const { return vsVector2D(min.x, max.y); } vsVector2D BottomRight() const { return max; } vsVector2D Corner(int i) const; void Expand( float amt ) { min += -amt * vsVector2D::One; max += amt * vsVector2D::One; } void Contract( float amt ) { Expand(-amt); } // TODO: Make sure we don't invert ourselves. void Union( const vsBox2D& other ); // sets me to the union of my box and that box. void Intersect( const vsBox2D& other ); // sets me to the intersection of my box and that box. bool CollideRay(vsVector2D *result, float *resultT, const vsVector2D &pos, const vsVector2D &dir) const; void Set(const vsVector2D &min_in, const vsVector2D &max_in) { min = min_in; max = max_in; set = true; } bool ContainsPoint(const vsVector2D &pos) const; // 'pos' must be in local coordinates! bool Intersects(const vsBox2D &other) const; void ExpandToInclude( const vsVector2D &pos ); void ExpandToInclude( const vsBox2D &box ); bool operator==(const vsBox2D &b) const { return( min==b.min && max==b.max ); } bool operator!=(const vsBox2D &b) const { return( min!=b.min || max!=b.max ); } vsBox2D operator+(const vsVector2D &v) const { return vsBox2D(min+v, max+v); } vsBox2D operator-(const vsVector2D &v) const { return vsBox2D(min-v, max-v); } vsBox2D operator*(float f) const { return vsBox2D(min*f, max*f); } vsBox2D& operator+=(const vsVector2D &v) { min+=v; max+=v; return *this; } vsBox2D& operator-=(const vsVector2D &v) { min-=v; max-=v; return *this; } vsBox2D& operator*=(float f) { min*=f; max*=f; return *this; } }; vsBox2D vsInterpolate( float alpha, const vsBox2D& a, const vsBox2D& b ); class vsBox3D { bool set; vsVector3D min; vsVector3D max; public: vsBox3D() { min = max = vsVector2D::Zero; set = false; } vsBox3D(const vsBox3D &o) { *this = o; set = true; } vsBox3D(const vsVector3D &min_in, const vsVector3D &max_in) { Set(min_in,max_in); set = true; } static vsBox3D CenteredBox( const vsVector3D &dimensions ) { vsBox3D result(vsVector3D::Zero, dimensions); result -= 0.5f * dimensions; return result; } void Clear() { set = false; min = max = vsVector3D::Zero; } const vsVector3D & GetMin() const { return min; } const vsVector3D & GetMax() const { return max; } void DrawOutline( vsDisplayList *list ); void Set(const vsVector3D &min_in, const vsVector3D &max_in) { min = min_in; max = max_in; set = true; } void Set(vsVector3D *pointArray, int pointCount); bool ContainsPoint(const vsVector3D &pos) const; bool ContainsPointXZ(const vsVector3D &pos) const; // only tests x and z components. bool ContainsRay(const vsVector3D &pos, const vsVector3D &dir) const; // returns true if any portion of the passed ray is included inside this bounding box bool Intersects(const vsBox3D &other) const; bool IntersectsXZ(const vsBox3D &other) const; bool IntersectsSphere(const vsVector3D &center, float radius) const; bool EncompassesBox(const vsBox3D &box) const; bool CollideRay(vsVector3D *result, float *resultT, const vsVector3D &pos, const vsVector3D &dir) const; void ExpandToInclude( const vsVector3D &pos ); void ExpandToInclude( const vsBox3D &box ); float DistanceFrom( const vsVector3D &pos ) const; float SqDistanceFrom( const vsVector3D &pos ) const; vsVector3D OffsetFrom( const vsVector3D &pos ) const; float Width() const { return max.x - min.x; } float Height() const { return max.y - min.y; } float Depth() const { return max.z - min.z; } vsVector3D Middle() const { return (min + max) * 0.5f; } vsVector3D Extents() const { return max - min; } vsVector3D Corner(int i) const; void Expand( float amt ) { min += -amt * vsVector3D::One; max += amt * vsVector3D::One; } void Expand( const vsVector3D &amt ) { min -= amt; max += amt; } void Contract( float amt ) { Expand(-amt); } // TODO: Make sure we don't invert ourselves. bool operator==(const vsBox3D &b) const { return( min==b.min && max==b.max ); } bool operator!=(const vsBox3D &b) const { return( min!=b.min || max!=b.max ); } vsBox3D operator+(const vsVector3D &b) const { return vsBox3D(min+b, max+b); } vsBox3D & operator+=(const vsVector3D &b) { min += b; max += b; return *this; } vsBox3D operator-(const vsVector3D &b) const { return vsBox3D(min-b, max-b); } vsBox3D & operator-=(const vsVector3D &b) { min -= b; max -= b; return *this; } vsBox3D operator*(const float b) const { return vsBox3D(min*b, max*b); } vsBox3D & operator*=(const float b) { min *= b; max *= b; return *this; } }; class vsOrientedBox3D { vsBox3D m_box; vsTransform3D m_transform; // As an optimisation, we're going to apply the orientation store the // vertices directly, here. Note that our intersection test is customised // for boxes -- this isn't a generalised convex hull collision test // implementation! (Although it shouldn't be too hard to write one based on // this general approach. Might do that someday if/when I need one) vsVector3D m_corner[8]; // run a single Separating Axis Theorem test, along the proposed axis bool SAT_Intersects( const vsOrientedBox3D& other, const vsVector3D& axis ) const; bool SAT_Intersects( const vsVector3D* points, int pountCount, const vsVector3D& axis, float otherRadius = 0.f ) const; // run a single test for containment, along the proposed axis bool SAT_Contains( const vsOrientedBox3D& other, const vsVector3D& axis ) const; bool SAT_Contains( const vsVector3D* points, int pountCount, const vsVector3D& axis, float otherRadius = 0.f ) const; public: vsOrientedBox3D(); vsOrientedBox3D( const vsBox3D& box, const vsTransform3D& transform ); const vsVector3D& Corner(int i) const { return m_corner[i]; } bool Contains( const vsOrientedBox3D& other ) const; bool Intersects( const vsOrientedBox3D& other ) const; bool IntersectsLineStrip( const vsVector3D* point, int pointCount, float radius ) const; bool IntersectsLineSegment( const vsVector3D& a, const vsVector3D& b, float radius ) const; bool IntersectsSphere( const vsVector3D& point, float radius ) const; bool ContainsPoint( const vsVector3D& point ) const; }; vsBox3D vsInterpolate( float alpha, const vsBox3D& a, const vsBox3D& b ); #endif // VS_BOX_H
40.26776
157
0.705523
[ "transform" ]
8416b9a9ceea7e88cd487a81507d4860d0980c61
24,210
c
C
plugins/processors/utterances/dsp/unit_selection/halfphone/select_units/src/select_units.c
Oghma/speect
f618e8d651cb9ec4c90cc244af3e7aa993599f6d
[ "BSD-2-Clause", "BSD-3-Clause" ]
5
2016-01-29T14:39:46.000Z
2019-04-24T14:45:55.000Z
plugins/processors/utterances/dsp/unit_selection/halfphone/select_units/src/select_units.c
Oghma/speect
f618e8d651cb9ec4c90cc244af3e7aa993599f6d
[ "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
plugins/processors/utterances/dsp/unit_selection/halfphone/select_units/src/select_units.c
Oghma/speect
f618e8d651cb9ec4c90cc244af3e7aa993599f6d
[ "BSD-2-Clause", "BSD-3-Clause" ]
7
2015-09-17T14:45:05.000Z
2020-03-30T13:19:29.000Z
/************************************************************************************/ /* Copyright (c) 2009-2011 The Department of Arts and Culture, */ /* The Government of the Republic of South Africa. */ /* */ /* Contributors: Meraka Institute, CSIR, South Africa. */ /* */ /* 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. */ /* */ /************************************************************************************/ /* */ /* AUTHOR : Aby Louw */ /* DATE : December 2009 */ /* */ /************************************************************************************/ /* */ /* An utterance processor to select the halfphone units relation stream. */ /* */ /* */ /************************************************************************************/ /************************************************************************************/ /* */ /* Modules used */ /* */ /************************************************************************************/ #include "halfphone_db.h" #include "viterbi.h" #include "cost_function.h" #include "select_units.h" /************************************************************************************/ /* */ /* Static variables */ /* */ /************************************************************************************/ /* SSelectUnitsUttProc class declaration. */ static SSelectUnitsUttProcClass SelectUnitsUttProcClass; /************************************************************************************/ /* */ /* Static function prototypes */ /* */ /************************************************************************************/ static s_bool units_contiguous(const SItem *leftItem, const SItem *rightItem, s_erc *error); static float run_cost_functions(const SList *costFunctions, const SItem *item1, const SItem *item2, const char *costs_name, s_erc *error); static SViterbiPath *extend_path(SViterbiPath *p, SViterbiCandidate *c, SMap *features, s_erc *error); static void count_pauses(SItem *item, uint32 *counter, s_erc *error); static SViterbiCandidate *get_candidates(const SItem *s, SMap *features, s_erc *error); /************************************************************************************/ /* */ /* Plug-in class registration/free */ /* */ /************************************************************************************/ /* local functions to register and free classes */ S_LOCAL void _s_select_units_utt_proc_class_reg(s_erc *error) { S_CLR_ERR(error); s_class_reg(S_OBJECTCLASS(&SelectUnitsUttProcClass), error); S_CHK_ERR(error, S_CONTERR, "_s_select_units_utt_proc_class_reg", "Failed to register SSelectUnitsUttProcClass"); } S_LOCAL void _s_select_units_utt_proc_class_free(s_erc *error) { S_CLR_ERR(error); s_class_free(S_OBJECTCLASS(&SelectUnitsUttProcClass), error); S_CHK_ERR(error, S_CONTERR, "_s_select_units_utt_proc_class_free", "Failed to free SSelectUnitsUttProcClass"); } /************************************************************************************/ /* */ /* Static function implementations */ /* */ /************************************************************************************/ static float run_cost_functions(const SList *costFunctions, const SItem *item1, const SItem *item2, const char *costs_name, s_erc *error) { SIterator *itr; int counter; const SMap *costFuncMap; const SCostFunction *costFunc; float total_cost = 0.0; float function_cost = 0.0; uint32 total_weight = 0; S_CLR_ERR(error); if (costFunctions == NULL) return 0; itr = S_ITERATOR_GET(costFunctions, error); if (S_CHK_ERR(error, S_CONTERR, "run_cost_functions", "Call to \"S_ITERATOR_GET\" failed")) return 0; counter = 0; while (itr != NULL) { /* get cost function map */ costFuncMap = (const SMap*)SIteratorObject(itr, error); if (S_CHK_ERR(error, S_CONTERR, "run_cost_functions", "Call to \"SIteratorObject\" failed")) { S_DELETE(itr, "run_cost_functions", error); return total_cost; } /* get cost function */ costFunc = (const SCostFunction*)SMapGetObjectDef(costFuncMap, "_function", NULL, error); if (S_CHK_ERR(error, S_CONTERR, "run_cost_functions", "Call to \"SMapGetObjectDef\" failed")) { S_DELETE(itr, "run_cost_functions", error); return total_cost; } if (costFunc == NULL) { S_CTX_ERR(error, S_FAILURE, "run_cost_functions", "Failed to find function for '%s' function definition #%d", costs_name, counter); S_DELETE(itr, "run_cost_functions", error); return total_cost; } /* some cost functions do not define 'set_feature' */ if (!S_COST_FUNCTION_METH_VALID(costFunc, get_cost)) { itr = SIteratorNext(itr); counter++; continue; } function_cost = S_COST_FUNCTION_CALL(costFunc, get_cost)(costFunc, item1, item2, error); if (S_CHK_ERR(error, S_CONTERR, "run_cost_functions", "Call to SCostFunction (%s, #d) method \"get_cost\" failed", costs_name, counter)) { S_DELETE(itr, "run_cost_functions", error); return total_cost; } total_cost += (function_cost * costFunc->weight); total_weight += costFunc->weight; itr = SIteratorNext(itr); counter++; } return total_cost/total_weight; } /* this isn't completely right, but it will do for now */ static s_bool units_contiguous(const SItem *leftItem, const SItem *rightItem, s_erc *error) { const char *left_file_id; const char *right_file_id; int scomp; S_CLR_ERR(error); left_file_id = SItemGetString(leftItem, "file_id", error); if (S_CHK_ERR(error, S_CONTERR, "units_contiguous", "Call to \"SItemGetString\" failed")) return FALSE; right_file_id = SItemGetString(rightItem, "file_id", error); if (S_CHK_ERR(error, S_CONTERR, "units_contiguous", "Call to \"SItemGetString\" failed")) return FALSE; scomp = s_strcmp(left_file_id, right_file_id, error); if (S_CHK_ERR(error, S_CONTERR, "units_contiguous", "Call to \"s_strcmp\" failed")) return FALSE; if (scomp == 0) { sint32 left_segment_id; sint32 right_segment_id; left_segment_id = SItemGetInt(leftItem, "segment_id", error); if (S_CHK_ERR(error, S_CONTERR, "units_contiguous", "Call to \"SItemGetInt\" failed")) return FALSE; right_segment_id = SItemGetInt(rightItem, "segment_id", error); if (S_CHK_ERR(error, S_CONTERR, "units_contiguous", "Call to \"SItemGetInt\" failed")) return FALSE; /* * halfphone items are contiguous if they originate from the same * parent segment item. */ if (left_segment_id == right_segment_id) return TRUE; } return FALSE; } static SViterbiPath *extend_path(SViterbiPath *p, SViterbiCandidate *c, SMap *features, s_erc *error) { SViterbiPath *newPath; const SList *joinCosts; SItem *left; SItem *right; float cost; s_bool is_contiguous; S_CLR_ERR(error); joinCosts = S_LIST(SMapGetObject(features, "join costs", error)); if (S_CHK_ERR(error, S_CONTERR, "extend_path", "Call to \"SMapGetObject\" failed")) return NULL; newPath = S_NEW(SViterbiPath, error); if (S_CHK_ERR(error, S_CONTERR, "extend_path", "Failed to create new 'SViterbiPath' object")) return NULL; newPath->from = p; newPath->state = c->pos; newPath->c = c; if ((p == NULL) || (p->c == NULL)) { newPath->score = c->score; /* cost = 0, nothing previous to join to */ SMapSetFloat(newPath->features, "lscore", 0.0, error); if (S_CHK_ERR(error, S_CONTERR, "extend_path", "Call to \"SMapSetFloat\" failed")) { S_DELETE(newPath, "extend_path", error); return NULL; } } else { left = (SItem*)p->c->name; right = (SItem*)c->name; /* ABY :check this in taylor */ is_contiguous = units_contiguous(left, right, error); if (S_CHK_ERR(error, S_CONTERR, "extend_path", "Call to \"units_contiguous\" failed")) { S_DELETE(newPath, "extend_path", error); return NULL; } if (is_contiguous) { /* default to zero cost if units contiguous in database */ cost = 0.0; } else { cost = run_cost_functions(joinCosts, left, right, "join costs", error); if (S_CHK_ERR(error, S_CONTERR, "extend_path", "Call to \"run_cost_functions\" failed")) { S_DELETE(newPath, "extend_path", error); return NULL; } } SMapSetFloat(newPath->features, "lscore", cost, error); if (S_CHK_ERR(error, S_CONTERR, "extend_path", "Call to \"SMapSetFloat\" failed")) { S_DELETE(newPath, "extend_path", error); return NULL; } /* ABY: here tc 2 jc weights apply */ newPath->score = c->score + p->score + cost; } return newPath; } /* *A function to count the pauses. This is a hack to limit the number * of pauses that are used in candidates for selection. It speeds up * the selection process. Note that this makes an assumption that the * silence phone of the phoneset is '#'. */ static void count_pauses(SItem *item, uint32 *counter, s_erc *error) { int scomp; const char *name; name = SItemGetName(item, error); if (S_CHK_ERR(error, S_CONTERR, "count_pauses", "Call to \"SItemGetName\" failed")) return; scomp = s_strcmp(name, "left-#", error); if (S_CHK_ERR(error, S_CONTERR, "count_pauses", "Call to \"s_strcmp\" failed")) return; if (scomp == 0) { (*counter)++; return; } scomp = s_strcmp(name, "right-#", error); if (S_CHK_ERR(error, S_CONTERR, "count_pauses", "Call to \"s_strcmp\" failed")) return; if (scomp == 0) { (*counter)++; return; } } static SViterbiCandidate *get_candidates(const SItem *s, SMap *features, s_erc *error) { SViterbiCandidate *candidate = NULL; SViterbiCandidate *allCandidates = NULL; const SHalfphoneDB *unitDB; const SList *targetCosts; sint32 min_3_gram; sint32 min_2_gram; const char *left_context; const char *right_context; const char *unit_name; const SList *candidateList; SIterator *itr = NULL; SItem *candidateItem; uint32 hack_counter = 0; S_CLR_ERR(error); unitDB = (SHalfphoneDB*)SMapGetObject(features, "unit_db", error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"SMapGetObject\" failed")) goto quit_error; targetCosts = (SList*)SMapGetObject(features, "target costs", error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"SMapGetObject\" failed")) goto quit_error; /* init with big value (if not defined) so that we dont get cutoff */ min_3_gram = SMapGetIntDef(features, "min-3-gram-context", 1000000, error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"SMapGetIntDef\" failed")) goto quit_error; /* init with big value (if not defined) so that we dont get cutoff */ min_2_gram = SMapGetIntDef(features, "min-2-gram-context", 1000000, error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"SMapGetIntDef\" failed")) goto quit_error; unit_name = SItemGetName(s, error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"SItemGetName\" failed")) goto quit_error; /* get the item's context */ left_context = SItemGetString(s, "left_context", error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"SItemGetString\" failed")) goto quit_error; right_context = SItemGetString(s, "right_context", error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"SItemGetString\" failed")) goto quit_error; candidateList = S_HALFPHONE_DB_CALL(unitDB, get_units)(unitDB, unit_name, left_context, right_context, (uint)min_3_gram, (uint)min_2_gram, error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to SHalfPhoneDB method \"get_units\" failed")) goto quit_error; if (candidateList == NULL) { S_CTX_ERR(error, S_FAILURE, "get_candidates", "Failed to find candidates in unit database for unit type '%s'", unit_name); goto quit_error; } itr = S_ITERATOR_GET(candidateList, error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"S_ITERATOR_GET\" failed")) goto quit_error; /* now create the candidate list */ while (itr != NULL) { candidate = S_NEW(SViterbiCandidate, error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Failed to create new 'SViterbiCandidate' object")) goto quit_error; candidate->next = allCandidates; allCandidates = candidate; candidateItem = (SItem*)SIteratorObject(itr, error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"SIteratorObject\" failed")) goto quit_error; candidate->name = (SObject*)candidateItem; /* candidate */ candidate->s = (SItem*)s; /* target */ count_pauses(candidateItem, &hack_counter, error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"count_pauses\" failed")) goto quit_error; /* calculate the target cost */ candidate->score = run_cost_functions(targetCosts, s, candidateItem, "target costs", error); if (S_CHK_ERR(error, S_CONTERR, "get_candidates", "Call to \"run_cost_functions\" failed")) goto quit_error; itr = SIteratorNext(itr); /* limit the number of pauses used in selection to 15 */ if (hack_counter == 15) { S_DELETE(itr, "get_candidates", error); break; } } return allCandidates; quit_error: if (itr != NULL) S_DELETE(itr, "get_candidates", error); if (allCandidates != NULL) S_DELETE(allCandidates, "get_candidates", error); return NULL; } /************************************************************************************/ /* */ /* Static class function implementations */ /* */ /************************************************************************************/ static void Dispose(void *obj, s_erc *error) { S_CLR_ERR(error); SObjectDecRef(obj); } static void Run(const SUttProcessor *self, SUtterance *utt, s_erc *error) { SRelation *unitRel; s_bool is_present; SHalfphoneDB *unitDB; const SVoice *voice; SViterbi *viterbi = NULL; const SMap *viterbiConfig; const SMap *halfphoneDBConfig; const SList *joinCosts; const SList *targetCosts; const SMap *allCostFunctions; S_CLR_ERR(error); /* we require the unit relation */ is_present = SUtteranceRelationIsPresent(utt, "Unit", error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SUtteranceRelationIsPresent\" failed")) goto quit_error; if (!is_present) { S_CTX_ERR(error, S_FAILURE, "Run", "Failed to find 'Unit' relation in utterance"); goto quit_error; } unitRel = (SRelation*)SUtteranceGetRelation(utt, "Unit", error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SUtteranceGetRelation\" failed")) goto quit_error; voice = SUtteranceVoice(utt, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SUtteranceVoice\" failed")) goto quit_error; if (voice == NULL) { S_CTX_ERR(error, S_FAILURE, "Run", "SSelectUnitsUttProc utterance processor requires an utterance to have a voice"); goto quit_error; } /* get "unit selection cost functions" in voice features */ allCostFunctions = (const SMap*)SVoiceGetFeature(voice, "unit selection cost functions", error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SVoiceGetFeature\" failed")) goto quit_error; /* nothing, return */ if (allCostFunctions == NULL) { S_CTX_ERR(error, S_FAILURE, "Run", "Failed to get 'unit selection cost functions' in voice features"); goto quit_error; } /* get target cost functions */ targetCosts = (SList*)SMapGetObjectDef(allCostFunctions, "target costs", NULL, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SMapGetObjectDef\" failed")) goto quit_error; /* get join cost functions */ joinCosts = (SList*)SMapGetObjectDef(allCostFunctions, "join costs", NULL, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SMapGetObjectDef\" failed")) goto quit_error; /* get halfphone unit database */ unitDB = (SHalfphoneDB*)SVoiceGetData(voice, "unit_db", error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SVoiceGetData\" failed")) goto quit_error; if (unitDB == NULL) { S_CTX_ERR(error, S_FAILURE, "Run", "Failed to find unit database 'unit_db', in voice data"); goto quit_error; } /* get halfphone db config params */ halfphoneDBConfig = (SMap*)SMapGetObjectDef(self->features, "halfphone database config", NULL, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SMapGetObjectDef\" failed")) goto quit_error; /* get viterbi config params */ viterbiConfig = (SMap*)SMapGetObjectDef(self->features, "viterbi config", NULL, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SMapGetObjectDef\" failed")) goto quit_error; /* create viterbi */ viterbi = S_NEW(SViterbi, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Failed to create new 'SViterbi' object")) goto quit_error; /* initialize viterbi, (-1 = dynamic states) */ S_VITERBI_CALL(viterbi, init_viterbi)(&viterbi, unitRel, get_candidates, extend_path, -1, viterbiConfig, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Failed to initialize new 'SViterbi' object")) goto quit_error; if (halfphoneDBConfig != NULL) { const SObject *tmp; tmp = SMapGetObjectDef(halfphoneDBConfig, "min-3-gram-context", NULL, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SMapGetObjectDef\" failed")) goto quit_error; if (tmp != NULL) { S_VITERBI_CALL(viterbi, set_feature)(viterbi, "min-3-gram-context", tmp, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to SViterbi method \"set_feature\" failed")) goto quit_error; } tmp = SMapGetObjectDef(halfphoneDBConfig, "min-2-gram-context", NULL, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to \"SMapGetObjectDef\" failed")) goto quit_error; if (tmp != NULL) { S_VITERBI_CALL(viterbi, set_feature)(viterbi, "min-2-gram-context", tmp, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to SViterbi method \"set_feature\" failed")) goto quit_error; } } S_VITERBI_CALL(viterbi, set_feature)(viterbi, "unit_db", S_OBJECT(unitDB), error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to SViterbi method \"set_feature\" failed")) goto quit_error; if (targetCosts != NULL) { S_VITERBI_CALL(viterbi, set_feature)(viterbi, "target costs", S_OBJECT(targetCosts), error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to SViterbi method \"set_feature\" failed")) goto quit_error; } if (joinCosts != NULL) { S_VITERBI_CALL(viterbi, set_feature)(viterbi, "join costs", S_OBJECT(joinCosts), error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to SViterbi method \"set_feature\" failed")) goto quit_error; } /* viterbi search */ S_VITERBI_CALL(viterbi, search)(viterbi, error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to SViterbi method \"search\" failed")) goto quit_error; /* copy best source units to units relation under "source-unit" feature */ S_VITERBI_CALL(viterbi, copy_best_result)(viterbi, "source-unit", error); if (S_CHK_ERR(error, S_CONTERR, "Run", "Call to SViterbi method \"copy_best_result\" failed")) goto quit_error; /* here all is OK */ S_DELETE(viterbi, "Run", error); return; /* error clean up and normal clean up */ quit_error: if (viterbi != NULL) S_DELETE(viterbi, "Run", error); } /************************************************************************************/ /* */ /* SSelectUnitsUttProc class initialization */ /* */ /************************************************************************************/ static SSelectUnitsUttProcClass SelectUnitsUttProcClass = { /* SObjectClass */ { "SUttProcessor:SSelectUnitsUttProc", sizeof(SSelectUnitsUttProc), { 0, 1}, NULL, /* init */ NULL, /* destroy */ Dispose, /* dispose */ NULL, /* compare */ NULL, /* print */ NULL, /* copy */ }, /* SUttProcessorClass */ NULL, /* initialize */ Run /* run */ };
30.762389
103
0.554358
[ "object" ]
8417976045e52e24c3ea2c934a1fda6ff326b733
10,648
h
C
internal/ccall/glcomp/glcompdefs.h
edamato/go-graphviz
c6e832de6f05c754b430d996f3493d507ab7061a
[ "MIT" ]
343
2020-01-28T15:13:22.000Z
2022-03-29T08:03:06.000Z
internal/ccall/glcomp/glcompdefs.h
edamato/go-graphviz
c6e832de6f05c754b430d996f3493d507ab7061a
[ "MIT" ]
31
2020-02-21T16:09:37.000Z
2022-03-29T12:23:19.000Z
internal/ccall/glcomp/glcompdefs.h
edamato/go-graphviz
c6e832de6f05c754b430d996f3493d507ab7061a
[ "MIT" ]
38
2020-02-05T11:09:55.000Z
2022-03-23T19:09:03.000Z
/* $Id$Revision: */ /* vim:set shiftwidth=4 ts=8: */ /************************************************************************* * Copyright (c) 2011 AT&T Intellectual Property * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ #ifndef GLCOMPDEFS_H #define GLCOMPDEFS_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <math.h> #ifdef WIN32 #include <windows.h> #include <winuser.h> #include <tchar.h> #endif #include <GL/gl.h> #include <stdlib.h> #include <stdio.h> #include <GL/gl.h> #include <GL/glu.h> #ifdef WIN32 #define strdup _strdup #endif #ifdef __cplusplus extern "C" { #endif #define GLCOMPSET_PANEL_COLOR_R (GLfloat)0.16 #define GLCOMPSET_PANEL_COLOR_G (GLfloat)0.44 #define GLCOMPSET_PANEL_COLOR_B (GLfloat)0.87 #define GLCOMPSET_PANEL_COLOR_ALPHA (GLfloat)0.5 #define GLCOMPSET_PANEL_SHADOW_COLOR_R (GLfloat)0 #define GLCOMPSET_PANEL_SHADOW_COLOR_G (GLfloat)0 #define GLCOMPSET_PANEL_SHADOW_COLOR_B (GLfloat)0 #define GLCOMPSET_PANEL_SHADOW_COLOR_A (GLfloat)0.3 #define GLCOMPSET_PANEL_SHADOW_WIDTH (GLfloat)4 #define GLCOMPSET_BUTTON_COLOR_R (GLfloat)0 #define GLCOMPSET_BUTTON_COLOR_G (GLfloat)1 #define GLCOMPSET_BUTTON_COLOR_B (GLfloat)0.3 #define GLCOMPSET_BUTTON_COLOR_ALPHA (GLfloat)0.6 #define GLCOMPSET_BUTTON_THICKNESS (GLfloat)3 #define GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS (GLfloat)1.7 #define GLCOMPSET_FONT_SIZE (GLfloat)14 #define GLCOMPSET_BUTTON_FONT_COLOR_R (GLfloat)0 #define GLCOMPSET_BUTTON_FONT_COLOR_G (GLfloat)0 #define GLCOMPSET_BUTTON_FONT_COLOR_B (GLfloat)0 #define GLCOMPSET_BUTTON_FONT_COLOR_ALPHA (GLfloat)1 #define GLCOMPSET_FONT_SIZE_FACTOR (GLfloat)0.7 #define GLCOMPSET_LABEL_COLOR_R (GLfloat)0 #define GLCOMPSET_LABEL_COLOR_G (GLfloat)0 #define GLCOMPSET_LABEL_COLOR_B (GLfloat)0 #define GLCOMPSET_LABEL_COLOR_ALPHA (GLfloat)1 #define GLCOMPSET_FONT_COLOR_R (GLfloat)0 #define GLCOMPSET_FONT_COLOR_G (GLfloat)0 #define GLCOMPSET_FONT_COLOR_B (GLfloat)0 #define GLCOMPSET_FONT_COLOR_ALPHA (GLfloat)1 #define GLCOMPSET_FONT_DESC "Times Italic" #define GL_FONTOPTIMIZE 1 #define GL_FONTVJUSTIFY 0 #define GL_FONTHJUSTIFY 0 #define DEFAULT_GLUT_FONT GLUT_BITMAP_HELVETICA_12 #define GLCOMPSET_BORDERWIDTH (GLfloat)2 #define GLCOMPSET_PANEL_BORDERWIDTH (GLfloat)3 #define GLCOMPSET_BUTTON_BEVEL (GLfloat)5 #define GLCOMPSET_BEVEL_DIFF (GLfloat)0.001 #define GLCOMPSET_DEFAULT_PAD (GLfloat)3 #define GLCOMP_DEFAULT_WIDTH (GLfloat)10 #define GLCOMP_DEFAULT_HEIGHT (GLfloat)10 #define FONT_MAX_LEN 1024 /* maximum chars to draw to the screen, used for buffers also */ #define FONT_TAB_SPACE 4 /* spaces to draw for a tab, make option? */ #define C_DPI 16 #define R_DPI 16 typedef enum { inverted_y, scientific_y } glCompOrientation; typedef enum { gluttext, pangotext } glCompFontType; typedef enum { glAlignNone, glAlignLeft, glAlignTop, glAlignBottom, glAlignRight, glAlignParent, glAlignCenter } glCompAlignment; typedef enum { glFontVJustifyNone, glFontVJustifyTop, glFontVJustifyBottom, glFontVJustifyCenter } glCompVJustify; typedef enum { glFontHJustifyNone, glFontHJustifyLeft, glFontHJustifyRight, glFontHJustifyCenter } glCompHJustify; typedef enum { glButtonGlyphLeft, glButtonGlyphRight, glButtonGlyphTop, glButtonGlyphBottom } glCompButtonGlyph; typedef enum { glBorderNone, glBorderSolid, glBorderBevel, glBorderCustom } glCompBorderType; typedef enum { glMouseDown, glMouseUp } glCompMouseStatus; typedef enum { glMouseLeftButton, glMouseRightButton, glMouseMiddleButton } glMouseButtonType; typedef enum { glTexImage, glTexLabel } glCompTexType; typedef enum { glPanelObj, glButtonObj, glLabelObj, glImageObj } glObjType; typedef struct _glCompButton glCompButton; typedef struct _glCompObj glCompObj; /*call backs for widgets*/ typedef void (*glcompdrawfunc_t) (void *obj); typedef void (*glcompclickfunc_t) (glCompObj * obj, GLfloat x, GLfloat y, glMouseButtonType t); typedef void (*glcompdoubleclickfunc_t) (glCompObj * obj, GLfloat x, GLfloat y, glMouseButtonType t); typedef void (*glcompmouseoverfunc_t) (glCompObj * obj, GLfloat x, GLfloat y); typedef void (*glcompmouseinfunc_t) (glCompObj * obj, GLfloat x, GLfloat y); typedef void (*glcompmouseoutfunc_t) (glCompObj * obj, GLfloat x, GLfloat y); typedef void (*glcompmousedownfunc_t) (glCompObj * obj, GLfloat x, GLfloat y, glMouseButtonType t); typedef void (*glcompmouseupfunc_t) (glCompObj * obj, GLfloat x, GLfloat y, glMouseButtonType t); typedef void (*glcompmousedragfunct_t) (glCompObj * obj, GLfloat dx, GLfloat dy, glMouseButtonType t); typedef struct _glCompAnchor { int topAnchor; /*anchor booleans */ int leftAnchor; int rightAnchor; int bottomAnchor; GLfloat top; /*anchor values */ GLfloat left; GLfloat right; GLfloat bottom; } glCompAnchor; typedef struct _glCompJustify { glCompVJustify VJustify; glCompHJustify HJustify; } glCompJustify; typedef struct _glCompPoint { GLfloat x, y, z; } glCompPoint; typedef struct _glCompPointI { int x, y; } glCompPointI; typedef struct { int cnt; int hotKey; glCompPoint* pts; }glCompPoly; typedef struct { GLfloat R; GLfloat G; GLfloat B; GLfloat A; //Alpha int tag; int test; } glCompColor; typedef struct _glCompRect { glCompPoint pos; GLfloat w; GLfloat h; } glCompRect; typedef struct _glCompTex { GLuint id; char *def; char *text; float width; float height; glCompTexType type; int userCount; int fontSize; unsigned char *data; /*data */ } glCompTex; /*opengl font*/ typedef struct { char *fontdesc; //font description , only used with pango fonts glCompColor color; glCompFontType type; void *glutfont; /*glut font pointer if used */ int transparent; glCompTex *tex; /* texture, if type is pangotext */ int size; int reference; /*if font has references to parent */ glCompJustify justify; int is2D; int optimize; } glCompFont; typedef struct _glCompCallBacks { glcompdrawfunc_t draw; glcompclickfunc_t click; glcompdoubleclickfunc_t doubleclick; glcompmouseoverfunc_t mouseover; glcompmouseinfunc_t mousein; glcompmouseoutfunc_t mouseout; glcompmousedownfunc_t mousedown; glcompmouseupfunc_t mouseup; glcompmousedragfunct_t mousedrag; } glCompCallBacks; /* common widget properties also each widget has pointer to its parents common */ typedef struct _glCompCommon { glCompPoint pos; glCompPoint refPos; /*calculated pos after anchors and aligns */ GLfloat width, height; GLfloat borderWidth; glCompBorderType borderType; glCompColor color; int enabled; int visible; void *compset; // compset void *parent; /*parent widget */ int data; glCompFont *font; //pointer to font to use glCompAlignment align; glCompAnchor anchor; int layer; /*keep track of object order, what to draw on top */ glCompCallBacks callbacks; glCompCallBacks functions; glCompJustify justify; } glCompCommon; /*generic image*/ typedef struct _glCompImage { glObjType objType; /*always keep this here for each drawable object */ glCompCommon common; glCompTex *texture; GLfloat width, height; /* width and height in world coords */ /* char *pngFile; */ int stretch; } glCompImage; /*generic panel*/ typedef struct _glCompPanel { glObjType objType; /*always keep this here for each drawable object */ glCompCommon common; GLfloat shadowwidth; glCompColor shadowcolor; char *text; glCompImage *image; } glCompPanel; /*label*/ typedef struct _glCompLabel { glObjType objType; /*always keep this here for each drawable object */ glCompCommon common; int autosize; /*if 1 label sized is calculated from font */ char *text; int transparent; } glCompLabel; /*buttons*/ struct _glCompButton { glObjType objType; /*always keep this here for each drawable object */ glCompCommon common; GLfloat width, height; glCompLabel *label; int status; //0 not pressed 1 pressed; int refStatus; //0 not pressed 1 pressed; int groupid; glCompImage *image; /*glyph */ glCompButtonGlyph glyphPos; void *customptr; //general purpose void pointer to pass to call back int data; }; /*texture based image*/ /*track bar*/ typedef struct _glCompTrackBar { glObjType objType; /*always keep this here for each drawable object */ GLfloat width, height; glCompPanel *outerpanel; glCompPanel *trackline; glCompPanel *indicator; GLfloat bevel; glCompColor color; glCompColor shadowcolor; float value; float maxvalue; float minvalue; int enabled; int visible; void *parentset; //parent compset int data; glCompFont *font; //pointer to font to use glCompOrientation orientation; } glCompTrackBar; /*glCompFont container class*/ typedef struct { glCompFont **fonts; int count; int activefont; char *font_directory; //location where the glfont files are stored } fontset_t; /*object prototype*/ struct _glCompObj { glObjType objType; glCompCommon common; }; typedef struct _glCompMouse { glCompMouseStatus status; glMouseButtonType t; glCompPoint initPos; /*current mouse pos,*/ glCompPoint pos; /*current mouse pos,*/ glCompPoint finalPos; /*current mouse pos,*/ glCompPoint GLpos;/*3d converted opengl position*/ glCompPoint GLinitPos;/*mouse button down pos*/ glCompPoint GLfinalPos;/*mouse button up pos*/ GLfloat dragX, dragY;/*GLpos - GLinitpos*/ glCompObj *clickedObj; glCompCallBacks callbacks; glCompCallBacks functions; int down; } glCompMouse; /*main widget set manager*/ typedef struct { glObjType objType; /*always keep this here for each drawable object */ glCompCommon common; glCompObj **obj; int objcnt; glCompPanel **panels; glCompButton **buttons; glCompLabel **labels; int groupCount; /*group id counter */ int active; //0 dont draw, 1 draw int enabled; //0 disabled 1 enabled(allow mouse interaction) GLfloat clickedX, clickedY; int textureCount; glCompTex **textures; glCompMouse mouse; } glCompSet; #ifdef __cplusplus } #endif #endif
26.686717
105
0.733377
[ "object", "3d" ]
841af360a5bbca51d9dfd867a3b0775cc49d7afe
4,982
h
C
Sources/Objectively/Resource.h
jdolan/Objectively
7baa84639854c82af80eb177ff027a9fe046f640
[ "Zlib" ]
21
2016-03-14T20:13:24.000Z
2022-02-13T06:27:02.000Z
Sources/Objectively/Resource.h
jdolan/Objectively
7baa84639854c82af80eb177ff027a9fe046f640
[ "Zlib" ]
12
2016-06-24T01:29:16.000Z
2017-10-06T13:15:23.000Z
Sources/Objectively/Resource.h
jdolan/Objectively
7baa84639854c82af80eb177ff027a9fe046f640
[ "Zlib" ]
8
2016-03-18T16:59:57.000Z
2022-03-27T16:14:46.000Z
/* * Objectively: Ultra-lightweight object oriented framework for GNU C. * Copyright (C) 2014 Jay Dolan <[email protected]> * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source distribution. */ #pragma once #include <Objectively/Data.h> #if defined(_WIN32) #define PATH_DELIM ";" #define PATH_SEPAR "\\" #else #define PATH_DELIM ":" #define PATH_SEPAR "/" #endif /** * @file * @brief Resources provide an abstraction for file and stream resources. */ typedef struct Resource Resource; typedef struct ResourceInterface ResourceInterface; /** * @brief Applications may specify a provider function for loading via file system abstractions. */ typedef Data *(*ResourceProvider)(const char *name); /** * @brief Resources provide an abstraction for file and stream resources. * @extends Object */ struct Resource { /** * @brief The superclass. */ Object object; /** * @brief The interface. * @protected */ ResourceInterface *interface; /** * @brief The resource data. */ Data *data; /** * @brief The resource name. */ char *name; }; /** * @brief The Resource interface. */ struct ResourceInterface { /** * @brief The superclass interface. */ ObjectInterface objectInterface; /** * @static * @fn void Resource::addResourcePath(const char *path) * @brief Adds the specified Resource path. * @param path The resource path to add. * @remarks Resource paths may be relative to the working directory, or absolute. * @memberof Resource */ void (*addResourcePath)(const char *path); /** * @static * @fn void Resource::addResourceProvider(ResourceProvider provider) * @brief Adds the specified ResourceProvider. * @param provider The ResoureProvider to add. * @memberof Resource */ void (*addResourceProvider)(ResourceProvider provider); /** * @fn Resource *Resource::initWithBytes(Resource *self, const uint8_t *bytes, size_t length, const char *name) * @brief Initializes this Resource with the specified bytes. * @param self The Resource. * @param bytes The bytes. * @param length The length of bytes. * @param name The resource name. * @return The initialized Resource, or `NULL` on error. * @memberof Resource */ Resource *(*initWithBytes)(Resource *self, const uint8_t *bytes, size_t length, const char *name); /** * @fn Resource *Resource::initWithData(Resource *self, Data *data, const char *name) * @brief Initializes this Resource with the specified Data. * @param self The Resource. * @param data The Data. * @param name The resource name. * @return The initialized Resource, or `NULL` on error. * @memberof Resource */ Resource *(*initWithData)(Resource *self, Data *data, const char *name); /** * @fn Resource *Resource::initWithName(Resource *self, const char *name) * @brief Initializes this Resource with the specified `name`. * @param self The Resource. * @param name The resource name. * @return The initialized Resource, or `NULL` on error. * @details The configured resource paths are searched, in order, for a file by the given name. * @memberof Resource */ Resource *(*initWithName)(Resource *self, const char *name); /** * @static * @fn void Resource::removeResourcePath(const char *path) * @brief Removes the specified Resource path. * @param path The resource path to remove. * @memberof Resource */ void (*removeResourcePath)(const char *path); /** * @static * @fn void Resource::removeResourceProvider(ResourceProvider provider) * @brief Removes the specified ResourceProvider. * @param provider The ResourceProvider to remove. * @memberof Resource */ void (*removeResourceProvider)(ResourceProvider provider); /** * @static * @fn Resource *Resource::resourceWithName(const char *name) * @brief Returns a new Resource with the specified `name`. * @param name The resource name. * @return The new Resource, or `NULL` on error. * @memberof Resource */ Resource *(*resourceWithName)(const char *name); }; /** * @fn Class *Resource::_Resource(void) * @brief The Resource archetype. * @return The Resource Class. * @memberof Resource */ OBJECTIVELY_EXPORT Class *_Resource(void);
28.306818
112
0.712164
[ "object" ]
842ff4d4e3ce63cb0f1ef6eb108b0905243d7e19
2,915
h
C
src/read_fast5.h
hiruna72/slow5tools
62eddcbb84112a06cb2d1bc826367c35e84c72d3
[ "MIT" ]
null
null
null
src/read_fast5.h
hiruna72/slow5tools
62eddcbb84112a06cb2d1bc826367c35e84c72d3
[ "MIT" ]
null
null
null
src/read_fast5.h
hiruna72/slow5tools
62eddcbb84112a06cb2d1bc826367c35e84c72d3
[ "MIT" ]
null
null
null
#ifndef HAVE_CONFIG_H #define HAVE_CONFIG_H #include "config.h" #endif #define H5_USE_110_API 1 #ifdef HAVE_HDF5_SERIAL_HDF5_H # include <hdf5/serial/hdf5.h> #endif #ifdef HAVE_HDF5_H # include <hdf5.h> #endif #ifdef HAVE_HDF5_HDF5_H # include <hdf5/hdf5.h> #endif #ifdef HAVE___HDF5_INCLUDE_HDF5_H # include <hdf5.h> #endif #include <unordered_map> #define VERSION "0.1" #define FAST5_NAME "fast5" #define FAST5_EXTENSION "." FAST5_NAME #define SLOW5_NAME "slow5" #define SLOW5_EXTENSION "." SLOW5_NAME #define SLOW5_FILE_FORMAT_SHORT SLOW5_NAME "v" VERSION #define SLOW5_NAME "slow5" KHASH_MAP_INIT_STR(warncount, uint32_t) typedef struct { uint64_t bad_5_file = 0; uint64_t total_5 = 0; uint64_t multi_group_slow5 = 0; }reads_count; typedef struct{ hid_t hdf5_file; bool is_multi_fast5; const char* fast5_path; } fast5_file_t; enum group_flags{ROOT, READ, RAW, CHANNEL_ID, CONTEXT_TAGS, TRACKING_ID}; struct operator_obj { //attributes to track hdf5 hierarchy unsigned group_level; /* Recursion level. 0=root */ struct operator_obj *prev; /* Pointer to previous opdata */ haddr_t addr; /* Group address */ //attributes are useful when writing. They are also passed to the fast5_group_itr function along with the struct struct program_meta *meta; FILE *f_out; enum slow5_fmt format_out; enum slow5_press_method pressMethod; slow5_press_t* press_ptr; const char *fast5_path; fast5_file_t* fast5_file; const char * group_name; //attributes store infomation slow5_rec_t *slow5_record; int *flag_context_tags; int *flag_tracking_id; int *flag_run_id; int *flag_lossy; int *flag_write_header; int *flag_allow_run_id_mismatch; hsize_t* num_read_groups; size_t* nreads; size_t* warning_flag_allow_run_id_mismatch; slow5_file_t* slow5File; std::unordered_map<std::string, uint32_t>* warning_map; }; //implemented in read_fast5.c int read_fast5(fast5_file_t *fast5_file, slow5_fmt format_out, slow5_press_method pressMethod, int lossy, int write_header_flag, int flag_allow_run_id_mismatch, struct program_meta *meta, slow5_file_t *slow5File, std::unordered_map<std::string, uint32_t>* warning_map); fast5_file_t fast5_open(const char* filename); //void free_attributes(group_flags group_flag, operator_obj* operator_data); std::vector< std::string > list_directory(const std::string& file_name); void list_all_items(const std::string& path, std::vector<std::string>& files, int count_dir, const char* extension); void slow5_hdr_initialize(slow5_hdr *header, int lossy); // args for processes typedef struct { int32_t starti; int32_t endi; int32_t proc_index; }proc_arg_t; union attribute_data { int attr_int; double attr_double; uint8_t attr_uint8_t; char* attr_string; };
28.578431
151
0.735163
[ "vector" ]
8446c7aed7f89b83e7b18680bf0f23e104ac6031
1,734
h
C
src/Transform.h
anloro/modular_slam
fbcb125f57e7875051ca0f600e882c87d72b1bdb
[ "MIT" ]
1
2021-09-05T10:58:01.000Z
2021-09-05T10:58:01.000Z
src/Transform.h
anloro/modular_slam
fbcb125f57e7875051ca0f600e882c87d72b1bdb
[ "MIT" ]
null
null
null
src/Transform.h
anloro/modular_slam
fbcb125f57e7875051ca0f600e882c87d72b1bdb
[ "MIT" ]
1
2021-09-05T10:58:04.000Z
2021-09-05T10:58:04.000Z
/** * @file Transform.h * @brief Defines the Transform. * @author Ángel Lorente Rogel * @date 01/06/2021 */ #pragma once #include <Eigen/Geometry> #include <iostream> namespace anloro{ class Transform { public: // Constructors Transform(float x, float y, float z, float roll, float pitch, float yaw); // rotation matrix r__ and origin o__ Transform(float r11, float r12, float r13, float o14, float r21, float r22, float r23, float o24, float r31, float r32, float r33, float o34); Transform(Eigen::Matrix4f matrix); Transform(Eigen::Affine3f transform); // Using quaternions Transform(float x, float y, float z, float qx, float qy, float qz, float qw); // The compiler takes care of the default constructor Transform() = default; // Member functions Eigen::Affine3f EulerToAffineTransform(float x, float y, float z, float roll, float pitch, float yaw); Eigen::Matrix4f ToMatrix4f(); void SetTranslationalVector(float x, float y, float z); void SetEulerAngles(float roll, float pitch, float yaw); void SetTranslationalAndEulerAngles(float x, float y, float z, float roll, float pitch, float yaw); void GetTranslationalVector(float &x, float &y, float &z); void GetEulerAngles(float &roll, float &pitch, float &yaw); void GetTranslationalAndEulerAngles(float &x, float &y, float &z, float &roll, float &pitch, float &yaw); float X(); float Y(); float Z(); Eigen::Affine3f GetAffineTransform() {return _affine;}; Transform inverse(); Transform operator*(Transform t) const; Transform Clone(); protected: // Transform _transform; Eigen::Affine3f _affine; }; } // namespace anloro
32.111111
109
0.682238
[ "geometry", "transform" ]
8446de39d45c1016ae39faa8fee50b989cdffe16
2,199
h
C
Marker less position estimation/PatternDetector.h
isamu-isozaki/Mastering-OpenCV-with-Practical-Computer-Vision-Projects
35d754c45a2162dfd986143f7124805a3283705e
[ "MIT" ]
1
2020-08-19T16:22:32.000Z
2020-08-19T16:22:32.000Z
Marker less position estimation/PatternDetector.h
isamu-isozaki/Mastering-OpenCV-with-Practical-Computer-Vision-Projects
35d754c45a2162dfd986143f7124805a3283705e
[ "MIT" ]
null
null
null
Marker less position estimation/PatternDetector.h
isamu-isozaki/Mastering-OpenCV-with-Practical-Computer-Vision-Projects
35d754c45a2162dfd986143f7124805a3283705e
[ "MIT" ]
null
null
null
#ifndef LOADED_ALL #include <opencv2\opencv.hpp> #define LOADED_ALL #endif //#ifndef PATTERN_DETECTOR //#define PATTERN_DETECTOR #include "Pattern.h" #include "PatternTrackingInfo.h" class PatternDetector{ public: PatternDetector(); void extractFeatures(const cv::Mat&, std::vector<cv::KeyPoint>&, cv::Mat&);//obtain the keypoints and the descriptors given the image void train(const Pattern&);//train the matcher void getMatch(cv::Mat&, std::vector<cv::DMatch>&, const bool&);//From input image return matches depending on the type specified 0:match(), 1:knnMatch(), 2:radiusMatch bool refineMatches(const std::vector<cv::KeyPoint>&, const std::vector<cv::KeyPoint>&, const float&, std::vector<cv::DMatch>&, cv::Mat&, const bool&);//refine the matches by using homography and only returning inliners void prepareForFindPattern(const cv::Mat&);//Makes pattern, sets marker and trains the marker bool findPattern(const std::string&, const std::string&, PatternTrackingInfo&, const bool&, const bool&);//finds the pattern in the query image and stores the homography matrix and the transformed 2d image points in void estimatePosition(const Pattern&, const CameraCalibration&, cv::Mat&, const bool&);//compute the marker pose and the extrinsic matrix given the pattern and the camera calibration Pattern m_pattern; PatternTrackingInfo info; cv::Mat m_markerPose; cv::Mat m_extrinsic; private: cv::Mat m_grayImg; cv::Mat m_warpedImg; CameraCalibration calibration; cv::Ptr<cv::FeatureDetector> m_detector; cv::Ptr<cv::DescriptorExtractor> m_extractor; cv::Ptr<cv::DescriptorMatcher> m_matcher; std::vector<cv::KeyPoint> m_queryKeyPoints; cv::Mat m_queryDescriptors; std::vector<cv::DMatch> m_matches; cv::Mat m_roughHomography; cv::Mat m_refinedHomography; cv::Mat rMat; cv::Mat tvec; bool enableRatioTest = true; bool enableHomographyRefinement = true; float homographyReprojectionThreshold = 3; void getGray(const cv::Mat&, cv::Mat&); void setMatcher(const int&);//0:BFMatcher with crosscheck, 1:FlannBasedMatcher void makeTrainPattern(const cv::Mat& train, Pattern& pattern, const bool& apply); };
39.981818
220
0.744429
[ "vector" ]
845709ae01281276d474d0849585bdb00a4efd0f
481
h
C
Game/Includes/Message/Collision.h
YvesHenri/Chico
e583a9995cd6e26fe198b21b9c7996c3199c4ff3
[ "MIT" ]
6
2017-01-09T13:19:56.000Z
2021-11-15T11:18:35.000Z
Game/Includes/Message/Collision.h
YvesHenri/Chico
e583a9995cd6e26fe198b21b9c7996c3199c4ff3
[ "MIT" ]
null
null
null
Game/Includes/Message/Collision.h
YvesHenri/Chico
e583a9995cd6e26fe198b21b9c7996c3199c4ff3
[ "MIT" ]
null
null
null
#pragma once #include <Engine/Messages/Message.hpp> #include "../Component/Transform.h" #include "../Component/Motion.h" #include "../Component/Body.h" struct Collision final : public mqs::ManagedMessage<Collision> { explicit Collision(Body& b1, Body& b2, Motion& m1, Motion& m2, Transform& t1, Transform& t2) : ManagedMessage(1U) , b1(b1), b2(b2) , m1(m1), m2(m2) , t1(t1), t2(t2) {} Body& b1; Body& b2; Motion& m1; Motion& m2; Transform& t1; Transform& t2; };
20.913043
94
0.665281
[ "transform" ]
845907014999cb9577bead902a1b123723400e71
144,463
c
C
sdk-6.5.20/libs/sdklt/bcmfp/handler/bcmfp_cth_entry.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmfp/handler/bcmfp_cth_entry.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmfp/handler/bcmfp_cth_entry.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/*! \file bcmfp_cth_entry.c * * APIs for FP entry template LTs custom handler. * * This file contains functions to insert, update, * delete, lookup or validate entry config provided * using entry template LTs. */ /* * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2020 Broadcom Inc. All rights reserved. */ /******************************************************************************* Includes */ #include <shr/shr_debug.h> #include <bsl/bsl.h> #include <shr/shr_util.h> #include <bcmlrd/bcmlrd_table.h> #include <bcmlrd/bcmlrd_client.h> #include <bcmltd/bcmltd_types.h> #include <bcmfp/bcmfp_internal.h> #include <bcmfp/bcmfp_stage_internal.h> #include <bcmfp/bcmfp_cth_filter.h> #include <bcmfp/bcmfp_trie_mgmt.h> #include <bcmfp/bcmfp_compression_internal.h> #define BSL_LOG_MODULE BSL_LS_BCMFP_DEV static int bcmfp_entry_id_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *entry_id) { uint32_t entry_id_fid = 0; uint64_t entry_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(entry_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } entry_id_fid = stage->tbls.entry_tbl->key_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, entry_id_fid, (void *)buffer, &entry_id_u64), SHR_E_NOT_FOUND); *entry_id = entry_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_group_id_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *group_id) { uint32_t group_id_fid = 0; uint64_t group_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(group_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } group_id_fid = stage->tbls.entry_tbl->group_id_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, group_id_fid, (void *)buffer, &group_id_u64), SHR_E_NOT_FOUND); *group_id = group_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_rule_id_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *rule_id) { uint32_t rule_id_fid = 0; uint64_t rule_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(rule_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } rule_id_fid = stage->tbls.entry_tbl->rule_id_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, rule_id_fid, (void *)buffer, &rule_id_u64), SHR_E_NOT_FOUND); *rule_id = rule_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_policy_id_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *policy_id) { uint32_t policy_id_fid = 0; uint64_t policy_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(policy_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } policy_id_fid = stage->tbls.entry_tbl->policy_id_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, policy_id_fid, (void *)buffer, &policy_id_u64), SHR_E_NOT_FOUND); *policy_id = policy_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_pdd_id_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *pdd_id) { uint32_t pdd_id_fid = 0; uint64_t pdd_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(pdd_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } pdd_id_fid = stage->tbls.entry_tbl->pdd_id_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, pdd_id_fid, (void *)buffer, &pdd_id_u64), SHR_E_NOT_FOUND); *pdd_id = pdd_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_sbr_id_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *sbr_id) { uint32_t sbr_id_fid = 0; uint64_t sbr_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(sbr_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } sbr_id_fid = stage->tbls.entry_tbl->sbr_id_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, sbr_id_fid, (void *)buffer, &sbr_id_u64), SHR_E_NOT_FOUND); *sbr_id = sbr_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_meter_id_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *meter_id) { uint32_t meter_id_fid = 0; uint64_t meter_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(meter_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } meter_id_fid = stage->tbls.entry_tbl->meter_id_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, meter_id_fid, (void *)buffer, &meter_id_u64), SHR_E_NOT_FOUND); *meter_id = meter_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_ctr_entry_id_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *ctr_entry_id) { uint32_t ctr_id_fid = 0; uint64_t ctr_entry_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(ctr_entry_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } ctr_id_fid = stage->tbls.entry_tbl->ctr_id_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, ctr_id_fid, (void *)buffer, &ctr_entry_id_u64), SHR_E_NOT_FOUND); *ctr_entry_id = ctr_entry_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } /*! * \brief Get the enhanced flex counter action ID and object ID * from FP entry LT entry. * * \param [in] unit Logical device id. * \param [in] stage BCMFP stage. * \param [in] buffer Field buffer * \param [out] flex_ctr_action Flex ctr action ID * * \retval SHR_E_NONE Success * \retval SHR_E_PARAM Invalid parameters. */ static int bcmfp_entry_eflex_ctr_params_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *flex_ctr_action) { uint32_t flex_ctr_action_fid = 0; uint64_t flex_ctr_action_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(flex_ctr_action, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } flex_ctr_action_fid = stage->tbls.entry_tbl->flex_ctr_action_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, flex_ctr_action_fid, (void *)buffer, &flex_ctr_action_u64), SHR_E_NOT_FOUND); *flex_ctr_action = flex_ctr_action_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_priority_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *priority) { uint32_t priority_fid = 0; uint64_t priority_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(priority, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } priority_fid = stage->tbls.entry_tbl->priority_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, priority_fid, (void *)buffer, &priority_u64), SHR_E_NOT_FOUND); *priority = priority_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_state_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, bcmfp_entry_state_t *state) { uint32_t state_fid = 0; uint64_t state_u64 = BCMFP_ENTRY_SUCCESS; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(state, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } state_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, state_fid, (void *)buffer, &state_u64), SHR_E_NOT_FOUND); *state = state_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_enable_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, bool *enable) { uint32_t enable_fid = 0; uint64_t enable_u64 = 1; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(enable, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } enable_fid = stage->tbls.entry_tbl->enable_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, enable_fid, (void *)buffer, &enable_u64), SHR_E_NOT_FOUND); *enable = enable_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_flex_ctr_params_get(int unit, bcmfp_stage_t *stage, bcmltd_field_t *buffer, uint32_t *base_idx, uint32_t *offset_mode, uint32_t *pool_id) { uint32_t base_idx_fid = 0; uint64_t base_idx_u64 = 0; uint32_t offset_mode_fid = 0; uint64_t offset_mode_u64 = 0; uint32_t pool_id_fid = 0; uint64_t pool_id_u64 = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(buffer, SHR_E_PARAM); SHR_NULL_CHECK(stage, SHR_E_PARAM); SHR_NULL_CHECK(base_idx, SHR_E_PARAM); SHR_NULL_CHECK(offset_mode, SHR_E_PARAM); SHR_NULL_CHECK(pool_id, SHR_E_PARAM); if (stage->tbls.entry_tbl == NULL) { SHR_ERR_EXIT(SHR_E_INTERNAL); } base_idx_fid = stage->tbls.entry_tbl->flex_ctr_base_idx_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, base_idx_fid, (void *)buffer, &base_idx_u64), SHR_E_NOT_FOUND); *base_idx = base_idx_u64 & 0xFFFFFFFF; offset_mode_fid = stage->tbls.entry_tbl->flex_ctr_offset_mode_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, offset_mode_fid, (void *)buffer, &offset_mode_u64), SHR_E_NOT_FOUND); *offset_mode = offset_mode_u64 & 0xFFFFFFFF; pool_id_fid = stage->tbls.entry_tbl->flex_ctr_pool_id_fid; SHR_IF_ERR_EXIT_EXCEPT_IF (bcmfp_fid_value_get(unit, pool_id_fid, (void *)buffer, &pool_id_u64), SHR_E_NOT_FOUND); *pool_id = pool_id_u64 & 0xFFFFFFFF; exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_config_dump(int unit, bcmltd_sid_t tbl_id, bcmfp_stage_id_t stage_id, bcmfp_entry_config_t *entry_config) { bcmfp_stage_t *stage = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(entry_config, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); if (stage->tbls.entry_tbl == NULL || stage->tbls.entry_tbl->sid != tbl_id) { SHR_ERR_EXIT(SHR_E_INTERNAL); } /* Dump the entry ID */ if (stage->tbls.entry_tbl->key_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entry ID = %d\n"), entry_config->entry_id)); } /* Dump the entries group ID */ if (stage->tbls.entry_tbl->group_id_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entries group ID = %d\n"), entry_config->group_id)); } /* Dump the entries rule ID */ if (stage->tbls.entry_tbl->rule_id_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entries rule ID = %d\n"), entry_config->rule_id)); } /* Dump the entries policy ID */ if (stage->tbls.entry_tbl->policy_id_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entries policy ID = %d\n"), entry_config->policy_id)); } /* Dump the entries meter ID */ if (stage->tbls.entry_tbl->meter_id_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entries meter ID = %d\n"), entry_config->meter_id)); } /* Dump the entries counter ID */ if (stage->tbls.entry_tbl->ctr_id_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entries counter ID = %d\n"), entry_config->ctr_entry_id)); } /* Dump the entries flex counter parameters */ if (stage->tbls.entry_tbl->flex_ctr_base_idx_fid != 0 && stage->tbls.entry_tbl->flex_ctr_offset_mode_fid != 0 && stage->tbls.entry_tbl->flex_ctr_pool_id_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entries flex counter base index = %d\n"), entry_config->flex_ctr_base_idx)); LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entries flex counter offset mode = %d\n"), entry_config->flex_ctr_offset_mode)); LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entries flex counter pool id = %d\n"), entry_config->flex_ctr_pool_id)); } /* Dump the entry priority */ if (stage->tbls.entry_tbl->priority_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entry priority = %d\n"), entry_config->priority)); } /* Dump the entry enable */ if (stage->tbls.entry_tbl->enable_fid != 0) { LOG_VERBOSE(BSL_LOG_MODULE, (BSL_META_U(unit, "Entry enable = %d\n"), entry_config->enable)); } exit: SHR_FUNC_EXIT(); } int bcmfp_entry_config_get(int unit, const bcmltd_op_arg_t *op_arg, bcmltd_sid_t tbl_id, bcmfp_stage_id_t stage_id, const bcmltd_field_t *key, const bcmltd_field_t *data, bcmfp_entry_config_t **config) { bcmfp_stage_t *stage = NULL; bcmltd_field_t *buffer = NULL; uint32_t entry_id = 0; uint32_t group_id = 0; uint32_t rule_id = 0; uint32_t policy_id = 0; uint32_t pdd_id = 0; uint32_t sbr_id = 0; uint32_t meter_id = 0; uint32_t ctr_entry_id = 0; uint32_t base_idx = 0; uint32_t pool_id = 0; uint32_t offset_mode = 0; uint32_t priority = 0; uint32_t flex_ctr_action = 0; bool enable = 0; bcmfp_entry_config_t *entry_config = NULL; bcmfp_entry_state_t state = BCMFP_ENTRY_SUCCESS; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(key, SHR_E_PARAM); SHR_NULL_CHECK(config, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); if (stage->tbls.entry_tbl == NULL || stage->tbls.entry_tbl->sid != tbl_id) { SHR_ERR_EXIT(SHR_E_INTERNAL); } BCMFP_ALLOC(entry_config, sizeof(bcmfp_entry_config_t), "bcmfpEntryConfig"); *config = entry_config; /* Get the entry ID */ buffer = (bcmltd_field_t *)key; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_id_get(unit, stage, buffer, &entry_id)); entry_config->entry_id = entry_id; /* * if data is NULL no need to extract the * remaining config. */ if (data == NULL) { SHR_EXIT(); } /* Get the entries group ID */ if (stage->tbls.entry_tbl->group_id_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_group_id_get(unit, stage, buffer, &group_id)); entry_config->group_id = group_id; } /* Get the entries rule ID */ if (stage->tbls.entry_tbl->rule_id_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_rule_id_get(unit, stage, buffer, &rule_id)); entry_config->rule_id = rule_id; } /* Get the entries policy ID */ if (stage->tbls.entry_tbl->policy_id_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_policy_id_get(unit, stage, buffer, &policy_id)); entry_config->policy_id = policy_id; } /* Get the entries PDD ID */ if (stage->tbls.entry_tbl->pdd_id_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_pdd_id_get(unit, stage, buffer, &pdd_id)); entry_config->pdd_id = pdd_id; } /* Get the entries SBR ID */ if (stage->tbls.entry_tbl->sbr_id_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_sbr_id_get(unit, stage, buffer, &sbr_id)); entry_config->sbr_id = sbr_id; } /* Get the entries meter ID */ if (stage->tbls.entry_tbl->meter_id_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_meter_id_get(unit, stage, buffer, &meter_id)); entry_config->meter_id = meter_id; } /* Get the entries counter ID */ if (stage->tbls.entry_tbl->ctr_id_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_ctr_entry_id_get(unit, stage, buffer, &ctr_entry_id)); entry_config->ctr_entry_id = ctr_entry_id; } /* Get the entries flex counter parameters */ if (stage->tbls.entry_tbl->flex_ctr_base_idx_fid != 0 && stage->tbls.entry_tbl->flex_ctr_offset_mode_fid != 0 && stage->tbls.entry_tbl->flex_ctr_pool_id_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_flex_ctr_params_get(unit, stage, buffer, &base_idx, &offset_mode, &pool_id)); entry_config->flex_ctr_base_idx = base_idx; entry_config->flex_ctr_offset_mode = offset_mode; entry_config->flex_ctr_pool_id = pool_id; } /* Get the entry flex ctr action and object */ if (stage->tbls.entry_tbl->flex_ctr_action_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_eflex_ctr_params_get(unit, stage, buffer, &flex_ctr_action)); entry_config->flex_ctr_action = flex_ctr_action; } /* Get the entry priority */ if (stage->tbls.entry_tbl->priority_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_priority_get(unit, stage, buffer, &priority)); entry_config->priority = priority; } /* Get the entry operational state. */ if (stage->tbls.entry_tbl->oprtnl_state_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_state_get(unit, stage, buffer, &state)); entry_config->entry_state = state; } /* Get the entry enable bit. */ if (stage->tbls.entry_tbl->enable_fid != 0) { buffer = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_enable_get(unit, stage, buffer, &enable)); entry_config->enable = enable; } exit: SHR_FUNC_EXIT(); } int bcmfp_entry_config_copy(int unit, bcmfp_entry_config_t *src_econfig, bcmfp_entry_config_t *dst_econfig) { size_t size = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(src_econfig, SHR_E_PARAM); SHR_NULL_CHECK(dst_econfig, SHR_E_PARAM); size = sizeof(bcmfp_entry_config_t); sal_memcpy(dst_econfig, src_econfig, size); exit: SHR_FUNC_EXIT(); } int bcmfp_entry_remote_config_get(int unit, const bcmltd_op_arg_t *op_arg, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_entry_config_t **config) { int rv; bcmltd_fid_t key_fid; bcmltd_fields_t in; bcmltd_fields_t out; bcmltd_field_t *key = NULL; bcmltd_field_t *data = NULL; bcmltd_sid_t tbl_id; bcmfp_entry_config_t *entry_config = NULL; size_t num_fid = 0; bcmfp_stage_t *stage = NULL; SHR_FUNC_ENTER(unit); sal_memset(&in, 0, sizeof(bcmltd_fields_t)); sal_memset(&out, 0, sizeof(bcmltd_fields_t)); SHR_NULL_CHECK(config, SHR_E_PARAM); *config = NULL; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); key_fid = stage->tbls.entry_tbl->key_fid; tbl_id = stage->tbls.entry_tbl->sid; num_fid = stage->tbls.entry_tbl->lrd_info.num_fid; /* Get the FP entry LT entry saved in IMM. */ rv = bcmfp_imm_entry_lookup(unit, tbl_id, &key_fid, &entry_id, 1, num_fid, &in, &out, &(stage->imm_buffers)); /* * If not found found in IMM return with no error but * config is set to NULL. */ if (rv == SHR_E_NOT_FOUND) { SHR_EXIT(); } SHR_IF_ERR_EXIT(rv); /* Assign key and data from in and out. */ key = in.field[0]; if (out.count != 0) { data = out.field[0]; } /* Get the FP entry LT entry config of ACL. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_config_get(unit, op_arg, tbl_id, stage->stage_id, key, data, &entry_config)); *config = entry_config; entry_config = NULL; exit: SHR_FREE(entry_config); SHR_FUNC_EXIT(); } int bcmfp_entry_config_free(int unit, bcmfp_entry_config_t *config) { SHR_FUNC_ENTER(unit); SHR_FREE(config); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_list_compress_insert(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t child_eid, bcmfp_entry_id_t parent_eid, bcmfp_idp_info_t *idp_info) { SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); /* Add entry Id to list compressed entry ID mapping. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_child_entry_map_add(unit, stage_id, parent_eid, child_eid)); /* Add parent entry Id to list compressed entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_parent_entry_map_add(unit, stage_id, child_eid, parent_eid)); exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_list_compress_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t child_eid, bcmfp_entry_id_t parent_eid, bcmfp_idp_info_t *idp_info) { SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); /* * Get the parent entry ID for the given list compressed * entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_parent_entry_get(unit, stage_id, child_eid, &parent_eid)); /* Delete entry Id from list compressed entry ID mapping. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_child_entry_map_delete(unit, stage_id, parent_eid, child_eid)); /* Delete parent entry Id from list compressed entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_parent_entry_map_delete(unit, stage_id, child_eid, parent_eid)); exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_list_compress_update(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t child_eid, bcmfp_entry_id_t parent_eid, bcmfp_idp_info_t *idp_info) { bcmfp_filter_t filter; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_entry_config_t *entry_config = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); /* * Delete all the list compressed child entries from * parent entry id and add them(except first child entry) * to the first child entry as child entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_child_entry_map_move(unit, stage_id, parent_eid, &child_eid)); /* Copy the parent entry filter to child entry. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, child_eid, &entry_config)); sal_memset(&filter, 0, sizeof(bcmfp_filter_t)); filter.entry_config = entry_config; group_id = filter.entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter.group_oper_info = opinfo; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_copy_cid_update(unit, idp_info->op_arg, stage_id, idp_info->tbl_id, idp_info->compress_type, idp_info->cid_next, idp_info->cid_mask_next, parent_eid, &filter)); exit: bcmfp_entry_config_free(unit,entry_config); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_list_compress_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t child_eid, bcmfp_entry_id_t parent_eid, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); if (idp_info->event_reason == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_list_compress_insert(unit, stage_id, child_eid, parent_eid, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_DELETE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_list_compress_delete(unit, stage_id, child_eid, parent_eid, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_UPDATE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_list_compress_update(unit, stage_id, child_eid, parent_eid, idp_info)); } else { SHR_ERR_EXIT(SHR_E_INTERNAL); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_ckey_insert(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, uint32_t ckey, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ckey_entry_map_add(unit, stage_id, idp_info->compress_type, idp_info->ckey, idp_info->prefix, entry_id)); exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_ckey_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, uint32_t ckey, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ckey_entry_map_delete(unit, stage_id, idp_info->compress_type, idp_info->ckey, idp_info->prefix, entry_id)); exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_ckey_update(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, uint32_t ckey, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; bool list_compressed = FALSE, map_not_found = FALSE; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t filter; bcmfp_entry_id_t parent_eid = 0; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_cid_update_cb_info_t *cb_info = NULL; uint8_t compress_type = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); cb_info = idp_info->generic_data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_status_get(unit, stage_id, entry_id, &list_compressed)); if (idp_info->cid_update_flags == BCMFP_TRIE_NODE_LIST_COMPRESSED && list_compressed == TRUE) { SHR_EXIT(); } if (list_compressed == TRUE && idp_info->cid_update_flags == BCMFP_TRIE_NODE_WIDTH_COMPRESSED) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_parent_entry_get(unit, stage_id, entry_id, &parent_eid)); if (cb_info->event == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); sal_memset(&filter, 0, sizeof(bcmfp_filter_t)); filter.entry_config = entry_config; group_id = filter.entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter.group_oper_info = opinfo; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_copy_cid_update(unit, idp_info->op_arg, stage_id, idp_info->tbl_id, idp_info->compress_type, idp_info->cid_next, idp_info->cid_mask_next, parent_eid, &filter)); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_child_entry_map_delete(unit, stage_id, parent_eid, entry_id)); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_parent_entry_map_delete(unit, stage_id, entry_id, parent_eid)); } else if (cb_info->event == BCMIMM_ENTRY_DELETE) { /* * Check if the parent entry has * list compressed child nodes attached to it. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_child_entry_map_check(unit, stage_id, parent_eid, &map_not_found)); /* * If map is found, move child nodes to current entry, * as the parent entry is going to be deleted. */ if (map_not_found == FALSE) { idp_info->event_reason = BCMIMM_ENTRY_UPDATE; idp_info->list_compress_child_entry_id = entry_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_list_compress_process(unit, stage_id, entry_id, parent_eid, (void *)idp_info)); } } } else if (list_compressed == FALSE) { /* * Update the CID and CID_MASK in FP entry to * new values. */ compress_type = idp_info->compress_type; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); sal_memset(&filter, 0, sizeof(bcmfp_filter_t)); filter.entry_config = entry_config; group_id = filter.entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter.group_oper_info = opinfo; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_cid_update(unit, idp_info->op_arg, stage_id, idp_info->tbl_id, compress_type, idp_info->cid_next, idp_info->cid_mask_next, &filter)); } exit: bcmfp_entry_config_free(unit, entry_config); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_ckey_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, uint32_t ckey, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); if (idp_info->event_reason == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_ckey_insert(unit, stage_id, entry_id, ckey, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_DELETE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_ckey_delete(unit, stage_id, entry_id, ckey, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_UPDATE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_ckey_update(unit, stage_id, entry_id, ckey, idp_info)); } else { SHR_ERR_EXIT(SHR_E_INTERNAL); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_ctr_entry_insert(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_ctr_entry_id_t ctr_entry_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_ctr_entry_config_t *ctr_entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.ctr_entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ctr_entry_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &ctr_entry_config)); filter->ctr_entry_config = ctr_entry_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); /* Create the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; filter->group_oper_info = opinfo; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } /* Update the operational state of the entry id. */ key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_ctr_entry_update(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_ctr_entry_id_t ctr_entry_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state_curr; bcmfp_entry_state_t entry_state_prev; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_group_id_t group_id = 0; bcmfp_ctr_entry_config_t *ctr_entry_config = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.ctr_entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ctr_entry_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &ctr_entry_config)); filter->ctr_entry_config = ctr_entry_config; /* * Keep the group id and entry state for incrementing * or decrementing its entry reference count at the * end of this function. */ group_id = filter->entry_config->group_id; entry_state_prev = filter->entry_config->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; /* Update the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_update(unit, idp_info->op_arg, tbl_id, stage->stage_id, NULL, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS && entry_state_prev != BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } if (filter->entry_state != BCMFP_ENTRY_SUCCESS && entry_state_prev == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count--; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state_curr = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state_curr, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_ctr_entry_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_ctr_entry_id_t ctr_entry_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); /* * If entry ID is not operational then this filter * was not created. Now create to reflect the right * entry operatioal state. */ tbl_id = stage->tbls.entry_tbl->sid; filter->group_oper_info = opinfo; if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { /* Create the filter corresponding to entry ID. */ filter->event_reason = BCMIMM_ENTRY_DELETE; filter->sid_type = BCMFP_SID_TYPE_CTR_ENTRY; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); entry_state = filter->entry_state; } else { /* Delete the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_delete(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); /* Decrement the group reference count. */ opinfo->ref_count--; /* Update the entry state. */ entry_state = BCMFP_ENTRY_COUNTER_NOT_CREATED; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_ctr_entry_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_ctr_entry_id_t ctr_entry_id, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single counter can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); if (idp_info->event_reason == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_ctr_entry_insert(unit, stage_id, entry_id, ctr_entry_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_DELETE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_ctr_entry_delete(unit, stage_id, entry_id, ctr_entry_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_UPDATE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_ctr_entry_update(unit, stage_id, entry_id, ctr_entry_id, idp_info)); } else { SHR_ERR_EXIT(SHR_E_INTERNAL); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_meter_insert(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_meter_id_t meter_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); /* Create the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; filter->group_oper_info = opinfo; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } /* Update the operational state of the entry id. */ key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_meter_update(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_meter_id_t meter_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state_curr; bcmfp_entry_state_t entry_state_prev; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_group_id_t group_id = 0; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Keep the group id and entry state for incrementing * or decrementing its entry reference count at the * end of this function. */ group_id = filter->entry_config->group_id; entry_state_prev = filter->entry_config->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; /* Update the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_update(unit, idp_info->op_arg, tbl_id, stage->stage_id, NULL, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS && entry_state_prev != BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } if (filter->entry_state != BCMFP_ENTRY_SUCCESS && entry_state_prev == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count--; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state_curr = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state_curr, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_meter_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_meter_id_t meter_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); /* * If entry ID is not operational then this filter * was not created. Now create to reflect the right * entry operatioal state. */ tbl_id = stage->tbls.entry_tbl->sid; filter->group_oper_info = opinfo; if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { /* Create the filter corresponding to entry ID. */ filter->event_reason = BCMIMM_ENTRY_DELETE; filter->sid_type = BCMFP_SID_TYPE_METER_TEMPLATE; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); entry_state = filter->entry_state; } else { /* Delete the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_delete(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); /* Decrement the group reference count. */ opinfo->ref_count--; /* Update the entry state. */ entry_state = BCMFP_ENTRY_METER_NOT_CREATED; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_meter_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_meter_id_t meter_id, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); if (idp_info->event_reason == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_meter_insert(unit, stage_id, entry_id, meter_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_DELETE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_meter_delete(unit, stage_id, entry_id, meter_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_UPDATE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_meter_update(unit, stage_id, entry_id, meter_id, idp_info)); } else { SHR_ERR_EXIT(SHR_E_INTERNAL); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_group_insert(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_group_id_t group_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_group_config_t *group_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.group_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &group_config)); filter->group_config = group_config; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; /* Create the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } /* Update the operational state of the entry id. */ key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_group_update(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_group_id_t group_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state_curr; bcmfp_entry_state_t entry_state_prev; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_group_config_t *group_config = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.group_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &group_config)); filter->group_config = group_config; /* * Keep the entry state for incrementing or * decrementing its entry reference count at the * end of this function. */ entry_state_prev = filter->entry_config->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; /* Update the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_update(unit, idp_info->op_arg, tbl_id, stage->stage_id, NULL, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS && entry_state_prev != BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } if (filter->entry_state != BCMFP_ENTRY_SUCCESS && entry_state_prev == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count--; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state_curr = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state_curr, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_group_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_group_id_t group_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; /* * If entry ID is not operational then this filter * was not created. Now create to reflect the right * entry operatioal state. */ tbl_id = stage->tbls.entry_tbl->sid; if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { filter->event_reason = BCMIMM_ENTRY_DELETE; filter->sid_type = BCMFP_SID_TYPE_GRP_TEMPLATE; /* Create the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); entry_state = filter->entry_state; } else { /* Delete the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_delete(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); /* Decrement the group reference count. */ opinfo->ref_count--; /* Update the entry state. */ entry_state = BCMFP_ENTRY_GROUP_NOT_CREATED; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_group_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_group_id_t group_id, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single group can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); if (idp_info->event_reason == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_group_insert(unit, stage_id, entry_id, group_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_DELETE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_group_delete(unit, stage_id, entry_id, group_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_UPDATE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_group_update(unit, stage_id, entry_id, group_id, idp_info)); } else { SHR_ERR_EXIT(SHR_E_INTERNAL); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_rule_insert(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_rule_id_t rule_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_rule_config_t *rule_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.rule_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_rule_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &rule_config)); filter->rule_config = rule_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; if (!(idp_info->entry_or_group_count == 1 && opinfo != NULL && opinfo->ref_count != 0)) { /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single rule can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } /* Create the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } /* Update the operational state of the entry id. */ key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_rule_update(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_rule_id_t rule_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state_curr; bcmfp_entry_state_t entry_state_prev; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_group_id_t group_id = 0; bcmfp_rule_config_t *rule_config = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.rule_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_rule_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &rule_config)); filter->rule_config = rule_config; /* * Keep the group id and entry state for incrementing * or decrementing its entry reference count at the * end of this function. */ group_id = filter->entry_config->group_id; entry_state_prev = filter->entry_config->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single rule can be associated * to multiple entries. */ if ((!(idp_info->entry_or_group_count == 1 && entry_state_prev == BCMFP_ENTRY_SUCCESS)) || BCMFP_STAGE_FLAGS_TEST(stage, BCMFP_STAGE_ENTRY_TYPE_HASH)) { /* Enable atomic transaction if hash tables are included * in the stage updates as hash entry updates are deleted * and inserted again resulting in multiple PT requests. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } if (opinfo != NULL) { if (idp_info->entry_or_group_count == 1 && opinfo->ref_count == 1) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } } /* Update the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_update(unit, idp_info->op_arg, tbl_id, stage->stage_id, NULL, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS && entry_state_prev != BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } if (filter->entry_state != BCMFP_ENTRY_SUCCESS && entry_state_prev == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count--; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state_curr = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state_curr, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_rule_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_rule_id_t rule_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; if (!(idp_info->entry_or_group_count == 1 && opinfo != NULL && opinfo->ref_count != 1)) { /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single rule can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } /* * If entry ID is not operational then this filter * was not created. Now create to reflect the right * entry operatioal state. */ tbl_id = stage->tbls.entry_tbl->sid; if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { filter->event_reason = BCMIMM_ENTRY_DELETE; filter->sid_type = BCMFP_SID_TYPE_RULE_TEMPLATE; /* Create the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); entry_state = filter->entry_state; } else { /* Delete the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_delete(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); /* Decrement the group reference count. */ opinfo->ref_count--; /* Update the entry state. */ entry_state = BCMFP_ENTRY_RULE_NOT_CREATED; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_rule_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_rule_id_t rule_id, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); if (idp_info->event_reason == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_rule_insert(unit, stage_id, entry_id, rule_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_DELETE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_rule_delete(unit, stage_id, entry_id, rule_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_UPDATE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_rule_update(unit, stage_id, entry_id, rule_id, idp_info)); } else { SHR_ERR_EXIT(SHR_E_INTERNAL); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_policy_insert(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_policy_id_t policy_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_policy_config_t *policy_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.policy_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_policy_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &policy_config)); filter->policy_config = policy_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; if (!(idp_info->entry_or_group_count == 1 && opinfo != NULL && opinfo->ref_count != 0)) { /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single rule can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } /* Create the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } /* Update the operational state of the entry id. */ key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_policy_update(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_policy_id_t policy_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state_curr; bcmfp_entry_state_t entry_state_prev; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_group_id_t group_id = 0; bcmfp_policy_config_t *policy_config = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.policy_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_policy_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &policy_config)); filter->policy_config = policy_config; /* * Keep the group id and entry state for incrementing * or decrementing its entry reference count at the * end of this function. */ group_id = filter->entry_config->group_id; entry_state_prev = filter->entry_config->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single rule can be associated * to multiple entries. */ if ((!(idp_info->entry_or_group_count == 1 && entry_state_prev == BCMFP_ENTRY_SUCCESS)) || BCMFP_STAGE_FLAGS_TEST(stage, BCMFP_STAGE_ENTRY_TYPE_HASH)) { /* Enable atomic transaction if hash tables are included * in the stage updates as hash entry updates are deleted * and inserted again resulting in multiple PT requests. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } if (opinfo != NULL) { if (idp_info->entry_or_group_count == 1 && opinfo->ref_count == 1) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } } /* Update the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_update(unit, idp_info->op_arg, tbl_id, stage->stage_id, NULL, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS && entry_state_prev != BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } if (filter->entry_state != BCMFP_ENTRY_SUCCESS && entry_state_prev == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count--; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state_curr = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state_curr, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_policy_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_policy_id_t policy_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; if (!(idp_info->entry_or_group_count == 1 && opinfo != NULL && opinfo->ref_count != 1)) { /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single rule can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } /* * If entry ID is not operational then this filter * was not created. Now create to reflect the right * entry operatioal state. */ tbl_id = stage->tbls.entry_tbl->sid; if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { filter->event_reason = BCMIMM_ENTRY_DELETE; filter->sid_type = BCMFP_SID_TYPE_POLICY_TEMPLATE; /* Create the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); entry_state = filter->entry_state; } else { /* Delete the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_delete(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); /* Decrement the group reference count. */ opinfo->ref_count--; /* Update the entry state. */ entry_state = BCMFP_ENTRY_POLICY_NOT_CREATED; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_policy_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_policy_id_t policy_id, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); if (idp_info->event_reason == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_policy_insert(unit, stage_id, entry_id, policy_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_DELETE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_policy_delete(unit, stage_id, entry_id, policy_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_UPDATE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_policy_update(unit, stage_id, entry_id, policy_id, idp_info)); } else { SHR_ERR_EXIT(SHR_E_INTERNAL); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_sbr_insert(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_policy_id_t policy_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_sbr_config_t *sbr_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Should use incoming key and data as the data is not * yet present in IMM. */ tbl_id = stage->tbls.sbr_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_sbr_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &sbr_config)); filter->sbr_config = sbr_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; if (!(idp_info->entry_or_group_count == 1 && opinfo != NULL && opinfo->ref_count != 0)) { /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single rule can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } /* Create the filter corresponding to entry ID. */ tbl_id = stage->tbls.entry_tbl->sid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); if (filter->entry_state == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } /* Update the operational state of the entry id. */ key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; entry_state = filter->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_sbr_update(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_sbr_id_t sbr_id, bcmfp_idp_info_t *idp_info) { bcmfp_filter_t *filter = NULL; bcmfp_stage_t *stage = NULL; bcmltd_sid_t tbl_id; bcmfp_group_id_t group_id = 0; bcmfp_pdd_config_t *pdd_config = NULL; bcmfp_sbr_config_t *sbr_config = NULL; bcmfp_group_config_t *group_config = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); tbl_id = stage->tbls.sbr_tbl->sid; BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpEntryIdpSbrUpdate"); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_sbr_config_get(unit, idp_info->op_arg, tbl_id, stage_id, idp_info->key, idp_info->data, &sbr_config)); filter->sbr_config = sbr_config; /* Get the entry configuration. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * If entry was not operational its SBR might not be installed * in hardware until unless the same SBR is associated with * some other entry which is operational. And SBR will be updated * when this function is called for that entry. */ if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { SHR_EXIT(); } group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; /* Get the group configuration. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_remote_config_get(unit, idp_info->op_arg, stage_id, group_id, &group_config)); filter->group_config = group_config; /* Get the PDD configuration. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_pdd_remote_config_get(unit, idp_info->op_arg->trans_id, stage_id, filter->group_config->pdd_id, &pdd_config)); filter->pdd_config = pdd_config; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_update_sbr(unit, idp_info->op_arg, tbl_id, stage_id, filter)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } static int bcmfp_entry_idp_sbr_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_policy_id_t sbr_id, bcmfp_idp_info_t *idp_info) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(idp_info, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = filter->entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; if (!(idp_info->entry_or_group_count == 1 && opinfo != NULL && opinfo->ref_count != 1)) { /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single rule can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); } /* * If entry ID is not operational then this filter * was not created. Now create to reflect the right * entry operatioal state. */ tbl_id = stage->tbls.entry_tbl->sid; if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { filter->event_reason = BCMIMM_ENTRY_DELETE; filter->sid_type = BCMFP_SID_TYPE_SBR_TEMPLATE; /* Create the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); entry_state = filter->entry_state; } else { /* Delete the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_delete(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); /* Decrement the group reference count. */ opinfo->ref_count--; /* Update the entry state. */ entry_state = BCMFP_ENTRY_SBR_NOT_CREATED; } key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_sbr_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_sbr_id_t sbr_id, void *user_data) { bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(user_data, SHR_E_PARAM); if (idp_info->event_reason == BCMIMM_ENTRY_INSERT) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_sbr_insert(unit, stage_id, entry_id, sbr_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_DELETE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_sbr_delete(unit, stage_id, entry_id, sbr_id, idp_info)); } else if (idp_info->event_reason == BCMIMM_ENTRY_UPDATE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_idp_sbr_update(unit, stage_id, entry_id, sbr_id, idp_info)); } else { SHR_ERR_EXIT(SHR_E_INTERNAL); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_maps_add(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_config_t *ec) { bcmfp_group_id_t group_id = 0; bcmfp_entry_id_t entry_id = 0; bcmfp_rule_id_t rule_id = 0; bcmfp_policy_id_t policy_id = 0; bcmfp_meter_id_t meter_id = 0; bcmfp_ctr_entry_id_t ctr_entry_id = 0; bcmfp_sbr_id_t sbr_id = 0; bcmfp_stage_t *stage = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(ec, SHR_E_PARAM); SHR_IF_ERR_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); group_id = ec->group_id; entry_id = ec->entry_id; rule_id = ec->rule_id; policy_id = ec->policy_id; meter_id = ec->meter_id; ctr_entry_id = ec->ctr_entry_id; sbr_id = ec->sbr_id; /* Map group associated to the entry. */ if (group_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_entry_map_add(unit, stage_id, group_id, entry_id)); } /* Map rule associated to the entry. */ if (rule_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_rule_entry_map_add(unit, stage_id, rule_id, entry_id)); } /* Map policy associated to the entry. */ if (policy_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_policy_entry_map_add(unit, stage_id, policy_id, entry_id)); } /* * Map meter associated to the entry and inform * meter module. */ if (meter_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_meter_entry_map_add(unit, stage_id, meter_id, entry_id)); SHR_IF_ERR_VERBOSE_EXIT (bcmcth_meter_entry_attach(unit, stage_id, meter_id)); } /* Map counter (not flex) associated to the entry. */ if (ctr_entry_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ctr_entry_map_add(unit, stage_id, ctr_entry_id, entry_id)); } /* Map SBR id associated to the entry. */ if (BCMFP_STAGE_FLAGS_TEST(stage, BCMFP_STAGE_ACTION_RESOLUTION_SBR) && (sbr_id != 0)) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_sbr_entry_map_add(unit, stage_id, sbr_id, entry_id)); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_maps_delete(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_config_t *ec) { bcmfp_group_id_t group_id = 0; bcmfp_entry_id_t entry_id = 0; bcmfp_rule_id_t rule_id = 0; bcmfp_policy_id_t policy_id = 0; bcmfp_meter_id_t meter_id = 0; bcmfp_ctr_entry_id_t ctr_entry_id = 0; bcmfp_sbr_id_t sbr_id = 0; bcmfp_stage_t *stage = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(ec, SHR_E_PARAM); SHR_IF_ERR_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); group_id = ec->group_id; entry_id = ec->entry_id; rule_id = ec->rule_id; policy_id = ec->policy_id; meter_id = ec->meter_id; ctr_entry_id = ec->ctr_entry_id; sbr_id = ec->sbr_id; /* Unmap group associated to the entry. */ if (group_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_entry_map_delete(unit, stage_id, group_id, entry_id)); } /* Unmap rule associated to the entry. */ if (rule_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_rule_entry_map_delete(unit, stage_id, rule_id, entry_id)); } /* Unmap policy associated to the entry. */ if (policy_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_policy_entry_map_delete(unit, stage_id, policy_id, entry_id)); } /* * Unmap meter associated to the entry and also inform * the meter module. */ if (meter_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_meter_entry_map_delete(unit, stage_id, meter_id, entry_id)); SHR_IF_ERR_VERBOSE_EXIT (bcmcth_meter_entry_detach(unit, stage_id, meter_id)); } /* Unmap counter (not flex) associated to the entry. */ if (ctr_entry_id != 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ctr_entry_map_delete(unit, stage_id, ctr_entry_id, entry_id)); } /* Unmap SBR id associated to the entry. */ if (BCMFP_STAGE_FLAGS_TEST(stage, BCMFP_STAGE_ACTION_RESOLUTION_SBR) && (sbr_id != 0)) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_sbr_entry_map_delete(unit, stage_id, sbr_id, entry_id)); } exit: SHR_FUNC_EXIT(); } static int bcmfp_entry_ro_fields_add(int unit, bcmfp_stage_id_t stage_id, bcmfp_filter_t *filter, bcmltd_fields_t *ro_fields) { uint32_t entry_state_fid = 0; bcmfp_stage_t *stage = NULL; SHR_FUNC_ENTER(unit); SHR_NULL_CHECK(ro_fields, SHR_E_PARAM); SHR_NULL_CHECK(filter, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); entry_state_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ltd_field_add(unit, entry_state_fid, filter->entry_state, ro_fields)); exit: SHR_FUNC_EXIT(); } int bcmfp_entry_config_insert(int unit, const bcmltd_op_arg_t *op_arg, bcmltd_sid_t tbl_id, bcmfp_stage_id_t stage_id, const bcmltd_field_t *key, const bcmltd_field_t *data, bcmltd_fields_t *output_fields) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t filter; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_group_id_t group_id = 0; bcmltd_field_t *in_data = NULL; bcmltd_field_t *non_default_data = NULL; bcmfp_stage_oper_info_t *stage_oper_info = NULL; SHR_FUNC_ENTER(unit); sal_memset(&filter, 0, sizeof(bcmfp_filter_t)); SHR_NULL_CHECK(key, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_oper_info_get(unit, stage_id, &stage_oper_info)); /* * Build list of fields with non default values from * the incoming data. */ in_data = (bcmltd_field_t *)data; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ltd_non_default_data_get(unit, tbl_id, in_data, &non_default_data, &(stage->imm_buffers))); /* Get the entry configuration from key and data */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_config_get(unit, op_arg, tbl_id, stage_id, key, non_default_data, &entry_config)); if (LOG_CHECK_VERBOSE(BSL_LOG_MODULE)) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_config_dump(unit, tbl_id, stage_id, entry_config)); } /* * Keep the group id for incrementing its entry * reference count at the end of this function. */ group_id = entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Multiple PTM requests will be triggered * when the first entry in the group is inserted. */ if (opinfo != NULL && opinfo->ref_count == 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, op_arg->trans_id, TRUE)); } /* Insert the entry in HW. */ sal_memset(&filter, 0, sizeof(bcmfp_filter_t)); filter.entry_config = entry_config; entry_config = NULL; filter.group_oper_info = opinfo; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, op_arg, tbl_id, stage->stage_id, &filter)); /* * Map the resources(group, rule, policy, meter * and counters). */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_maps_add(unit, stage_id, filter.entry_config)); /* Add read only LT fields to output_fields. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_ro_fields_add(unit, stage_id, &filter, output_fields)); /* Increment the groups entry reference count. */ if (filter.entry_state == BCMFP_ENTRY_SUCCESS) { opinfo->ref_count++; } exit: if (SHR_FUNC_ERR()) { if (entry_config != NULL) { SHR_FREE(entry_config); } } bcmfp_filter_configs_free(unit, &filter); SHR_FUNC_EXIT(); } int bcmfp_entry_config_update(int unit, const bcmltd_op_arg_t *op_arg, bcmltd_sid_t tbl_id, bcmfp_stage_id_t stage_id, const bcmltd_field_t *key, const bcmltd_field_t *data, bcmltd_fields_t *output_fields) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *ec_curr = NULL; bcmfp_entry_config_t *ec_prev = NULL; bcmfp_entry_id_t entry_id = 0; bcmfp_filter_t *filter_curr = NULL; bcmfp_filter_t *filter_prev = NULL; bcmfp_group_oper_info_t *curr_opinfo = NULL; bcmfp_group_oper_info_t *prev_opinfo = NULL; bcmfp_group_id_t group_id_prev = 0; bcmfp_group_id_t group_id_curr = 0; size_t size = 0; bcmltd_field_t *in_key = NULL; bcmltd_field_t *in_data = NULL; bcmltd_fields_t updated_fields; uint16_t num_fid = 0; const bcmltd_field_t *updated_data = NULL; bcmfp_entry_state_t entry_state_prev = BCMFP_ENTRY_SUCCESS; bcmfp_entry_state_t entry_state_curr = BCMFP_ENTRY_SUCCESS; SHR_FUNC_ENTER(unit); sal_memset(&updated_fields, 0, sizeof(bcmltd_fields_t)); SHR_NULL_CHECK(key, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); in_key = (bcmltd_field_t *)key; in_data = (bcmltd_field_t *)data; num_fid = stage->tbls.entry_tbl->lrd_info.num_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_ltd_updated_data_get(unit, tbl_id, num_fid, in_key, in_data, &updated_fields)); updated_data = (const bcmltd_field_t *)(updated_fields.field[0]); /* Get the entry configuration from key and data */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_config_get(unit, op_arg, tbl_id, stage_id, key, updated_data, &ec_curr)); /* * Keep the current group id for increment or decremnt * its entry reference count at the end of this function. */ group_id_curr = ec_curr->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id_curr, &curr_opinfo)); /* Get the entry configuration from data in IMM */ entry_id = ec_curr->entry_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, op_arg, stage_id, entry_id, &ec_prev)); /* * Keep the previous group id for increment or decremnt * its entry reference count at the end of this function. */ group_id_prev = ec_prev->group_id; entry_state_prev = ec_prev->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id_prev, &prev_opinfo)); /* * If group id is changed, then delete the entry from * old group and insert the entry in new group. */ if ((ec_prev->group_id != 0) && (ec_prev->group_id != ec_curr->group_id)) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_config_delete(unit, op_arg, tbl_id, stage_id, key, NULL, output_fields)); } else { /* * Unmap the old resources(group, rule, policy, meter * and counters). */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_maps_delete(unit, stage_id, ec_prev)); } /* * Map the new resources(group, rule, policy, meter * and counters). */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_maps_add(unit, stage_id, ec_curr)); /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Multiple PTM requests will be triggered * when the first entry in the group is inserted. */ if (curr_opinfo != NULL && curr_opinfo->ref_count == 0) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, op_arg->trans_id, TRUE)); } size = sizeof(bcmfp_filter_t); BCMFP_ALLOC(filter_curr, size, "bcmfpEntryUpdateCurrentFilter"); BCMFP_ALLOC(filter_prev, size, "bcmfpEntryUpdatePreviousFilter"); filter_curr->entry_config = ec_curr; filter_prev->entry_config = ec_prev; ec_curr = NULL; ec_prev = NULL; filter_curr->group_oper_info = curr_opinfo; filter_prev->group_oper_info = prev_opinfo; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_update(unit, op_arg, tbl_id, stage->stage_id, filter_prev, filter_curr)); entry_state_curr = filter_curr->entry_state; /* Add read only LT fields to output_fields. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_ro_fields_add(unit, stage_id, filter_curr, output_fields)); if (group_id_curr == group_id_prev) { /* * Decrement the groups entry reference count if * 1. No change in group id. * 2. Entries previous state is SUCCESS. * 3. Entries current state is not SUCCESS. */ if (entry_state_curr != BCMFP_ENTRY_SUCCESS && entry_state_prev == BCMFP_ENTRY_SUCCESS) { if (curr_opinfo != NULL) { curr_opinfo->ref_count--; } } /* * Increment the groups entry reference count if * 1. No change in group id. * 2. Entries previous state is not SUCCESS. * 3. Entries current state is SUCCESS. */ if (entry_state_curr == BCMFP_ENTRY_SUCCESS && entry_state_prev != BCMFP_ENTRY_SUCCESS) { if (curr_opinfo != NULL) { curr_opinfo->ref_count++; } } } /* * Update the groups entry reference count if * 1. group id is changed. * 2. Entries current state or previous state is SUCCESS. */ if (group_id_curr != group_id_prev) { if (entry_state_curr == BCMFP_ENTRY_SUCCESS) { if (curr_opinfo != NULL) { curr_opinfo->ref_count++; } } /* * Decrementing the ref count of the prev group is done * during the entry delete. */ } exit: if (SHR_FUNC_ERR()) { if (ec_curr != NULL) { SHR_FREE(ec_curr); } if (ec_prev != NULL) { SHR_FREE(ec_prev); } } bcmfp_filter_configs_free(unit, filter_curr); bcmfp_filter_configs_free(unit, filter_prev); bcmfp_ltd_buffers_free(unit, &updated_fields, num_fid); SHR_FREE(filter_curr); SHR_FREE(filter_prev); SHR_FUNC_EXIT(); } int bcmfp_entry_config_delete(int unit, const bcmltd_op_arg_t *op_arg, bcmltd_sid_t tbl_id, bcmfp_stage_id_t stage_id, const bcmltd_field_t *key, const bcmltd_field_t *data, bcmltd_fields_t *output_fields) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t filter; bcmfp_entry_id_t entry_id = 0; bcmfp_group_id_t group_id = 0; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_entry_state_t entry_state; SHR_FUNC_ENTER(unit); sal_memset(&filter, 0, sizeof(bcmfp_filter_t)); SHR_NULL_CHECK(key, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); /* * Get the entry configuration. Only entry_id will be * populated in entry_config as data is NULL in case * of delete. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_config_get(unit, op_arg, tbl_id, stage_id, key, data, &entry_config)); /* Get the entry configuration from data in IMM */ entry_id = entry_config->entry_id; bcmfp_entry_config_free(unit, entry_config); entry_config = NULL; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, op_arg, stage_id, entry_id, &entry_config)); /* * Unmap the resources(group, rule, policy, meter * and counters). */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_maps_delete(unit, stage_id, entry_config)); /* * Keep the group id for decrementing its entry * reference count at the end of this function. */ group_id = entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter.group_oper_info = opinfo; /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Multiple PTM requests will be triggered * when the last entry in the group is deleted. */ if (opinfo != NULL && opinfo->ref_count == 1) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, op_arg->trans_id, TRUE)); } /* Delete the entry confiuration from the HW. */ filter.entry_config = entry_config; entry_state = entry_config->entry_state; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_delete(unit, op_arg, tbl_id, stage->stage_id, &filter)); if ((entry_state == BCMFP_ENTRY_SUCCESS) && (opinfo != NULL)) { opinfo->ref_count--; } exit: bcmfp_filter_configs_free(unit, &filter); SHR_FUNC_EXIT(); } int bcmfp_entry_config_lookup(int unit, const bcmltd_op_arg_t *op_arg, bcmltd_sid_t tbl_id, bcmfp_stage_id_t stage_id, bcmimm_lookup_type_t lkup_type, const bcmltd_fields_t *key, bcmltd_fields_t *data) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_filter_t filter; bcmfp_entry_id_t entry_id = 0; bcmfp_group_id_t group_id = 0; bool lc_status = FALSE; bcmfp_entry_id_t parent_eid = 0; SHR_FUNC_ENTER(unit); sal_memset(&filter,0,sizeof(bcmfp_filter_t)); if (lkup_type == BCMIMM_LOOKUP) { SHR_NULL_CHECK(key, SHR_E_PARAM); } SHR_NULL_CHECK(data, SHR_E_PARAM); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); if (lkup_type == BCMIMM_LOOKUP) { entry_id = key->field[0]->data & 0xFFFFFFFF; } else if (lkup_type == BCMIMM_TRAVERSE) { entry_id = data->field[0]->data & 0xFFFFFFFF; } /* * If the entry is list compressed, entry will not be * installed in the hardware. */ if (BCMFP_STAGE_FLAGS_TEST(stage, BCMFP_STAGE_LIST_COMPRESSION)) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_status_get(unit, stage_id, entry_id, &lc_status)); if (lc_status == TRUE) { SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_list_compress_parent_entry_get(unit, stage_id, entry_id, &parent_eid)); entry_id = parent_eid; } } /* Get the entry configuration from data in IMM */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, op_arg, stage_id, entry_id, &entry_config)); if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { bcmfp_entry_config_free(unit, entry_config); entry_config = NULL; SHR_EXIT(); } /* Delete the entry confiuration from the HW. */ sal_memset(&filter, 0, sizeof(bcmfp_filter_t)); filter.entry_config = entry_config; group_id = entry_config->group_id; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter.group_oper_info = opinfo; filter.lkup_type = lkup_type; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_lookup(unit, op_arg, tbl_id, stage->stage_id, &filter, data)); exit: bcmfp_filter_configs_free(unit, &filter); SHR_FUNC_EXIT(); } int bcmfp_entry_idp_pse_process(int unit, bcmfp_stage_id_t stage_id, bcmfp_entry_id_t entry_id, bcmfp_group_id_t group_id, void *user_data) { bcmfp_stage_t *stage = NULL; bcmfp_entry_config_t *entry_config = NULL; bcmfp_filter_t *filter = NULL; bcmltd_sid_t tbl_id; bcmltd_fid_t key_fid = 0; bcmltd_fid_t data_fid = 0; bcmfp_entry_state_t entry_state; bcmfp_group_oper_info_t *opinfo = NULL; bcmfp_idp_info_t *idp_info = user_data; SHR_FUNC_ENTER(unit); /* * Enable atomic transaction because there might be * multiple PTM opcode requests for single LT opcode * request. Because single presel entry can be associated * to multiple entries. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_trans_atomic_state_set(unit, idp_info->op_arg->trans_id, TRUE)); SHR_IF_ERR_VERBOSE_EXIT (bcmfp_stage_get(unit, stage_id, &stage)); BCMFP_ALLOC(filter, sizeof(bcmfp_filter_t), "bcmfpFilter"); tbl_id = stage->tbls.entry_tbl->sid; /* Get the entry configuration for the entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_entry_remote_config_get(unit, idp_info->op_arg, stage_id, entry_id, &entry_config)); filter->entry_config = entry_config; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_group_oper_info_get(unit, stage_id, group_id, &opinfo)); filter->group_oper_info = opinfo; if (idp_info->entry_state != BCMFP_ENTRY_SUCCESS) { if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { /* Create the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); entry_state = filter->entry_state; } else { /* Delete the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_delete(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); /* Decrement the group reference count. */ opinfo->ref_count--; /* Update the entry state. */ entry_state = idp_info->entry_state; key_fid = stage->tbls.entry_tbl->key_fid; data_fid = stage->tbls.entry_tbl->oprtnl_state_fid; SHR_IF_ERR_VERBOSE_EXIT (bcmfp_imm_entry_update(unit, tbl_id, &key_fid, &entry_id, 1, &data_fid, &entry_state, 1)); SHR_EXIT(); } } else { if (entry_config->entry_state != BCMFP_ENTRY_SUCCESS) { /* Create the filter corresponding to entry ID. */ SHR_IF_ERR_VERBOSE_EXIT (bcmfp_filter_create(unit, idp_info->op_arg, tbl_id, stage->stage_id, filter)); entry_state = filter->entry_state; } } exit: bcmfp_filter_configs_free(unit, filter); SHR_FREE(filter); SHR_FUNC_EXIT(); }
33.808331
134
0.512574
[ "object" ]
84766ef7c888147e8a56733f386135c5af28429b
11,183
h
C
modules/bullet/armature_bullet.h
Wapit1/godot
b4b063c5f2b94fbd7fc7dff7488146d36ec69eed
[ "CC-BY-3.0", "Apache-2.0", "MIT" ]
null
null
null
modules/bullet/armature_bullet.h
Wapit1/godot
b4b063c5f2b94fbd7fc7dff7488146d36ec69eed
[ "CC-BY-3.0", "Apache-2.0", "MIT" ]
null
null
null
modules/bullet/armature_bullet.h
Wapit1/godot
b4b063c5f2b94fbd7fc7dff7488146d36ec69eed
[ "CC-BY-3.0", "Apache-2.0", "MIT" ]
null
null
null
/*************************************************************************/ /* bullet_physics_server.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* 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. */ /*************************************************************************/ #ifndef ARMATURE_BULLET_H #define ARMATURE_BULLET_H /** @author AndreaCatania */ #include "collision_object_bullet.h" #include "space_bullet.h" #include <BulletDynamics/Featherstone/btMultiBodyLink.h> class btMultiBody; class btMultiBodyLinkCollider; class btMultiBodyConstraint; class JointBullet; class ArmatureBullet : public RIDBullet { struct ForceIntegrationCallback { ObjectID id; StringName method; Variant udata; }; SpaceBullet *space; btMultiBody *bt_body; bool active; btTransform transform; ForceIntegrationCallback *force_integration_callback; /** * @brief The list of joints between two multibody, or between a rigid body * So this is not the list of internal joints */ Vector<JointBullet *> ext_joints; public: ArmatureBullet(); ~ArmatureBullet(); btMultiBody *get_bt_body() const; void set_bone_count(int p_count); int get_bone_count() const; void set_space(SpaceBullet *p_space); SpaceBullet *get_space() const; void set_active(bool p_active); bool is_active() const { return active; } void set_transform(const Transform &p_global_transform); Transform get_transform() const; void set_transform__bullet(const btTransform &p_global_transform); const btTransform &get_transform__bullet() const; void set_force_integration_callback( ObjectID p_id, const StringName &p_method, const Variant &p_udata = Variant()); void set_bone(BoneBullet *p_bone); BoneBullet *get_bone(int p_link_id) const; void remove_bone(int p_link_id); void update_base_inertia(); void update_link_mass_and_inertia(int p_link_id); void set_param(PhysicsServer::ArmatureParameter p_param, real_t p_value); real_t get_param(PhysicsServer::ArmatureParameter p_param) const; void register_ext_joint(JointBullet *p_joint); void erase_ext_joint(JointBullet *p_joint); private: void clear_links(); void update_activation(); void update_ext_joints(); }; class BoneBullet; class BoneBulletPhysicsDirectBodyState : public PhysicsDirectBodyState { GDCLASS(BoneBulletPhysicsDirectBodyState, PhysicsDirectBodyState) static BoneBulletPhysicsDirectBodyState *singleton; public: /// This class avoid the creation of more object of this class static void initSingleton() { if (!singleton) { singleton = memnew(BoneBulletPhysicsDirectBodyState); } } static void destroySingleton() { memdelete(singleton); singleton = NULL; } static void singleton_setDeltaTime(real_t p_deltaTime) { singleton->deltaTime = p_deltaTime; } static BoneBulletPhysicsDirectBodyState *get_singleton(BoneBullet *p_body) { singleton->bone = p_body; return singleton; } public: BoneBullet *bone; real_t deltaTime; private: BoneBulletPhysicsDirectBodyState() {} public: virtual Vector3 get_total_gravity() const; virtual float get_total_angular_damp() const; virtual float get_total_linear_damp() const; virtual Vector3 get_center_of_mass() const; virtual Basis get_principal_inertia_axes() const; // get the mass virtual float get_inverse_mass() const; // get density of this body space virtual Vector3 get_inverse_inertia() const; // get density of this body space virtual Basis get_inverse_inertia_tensor() const; virtual void set_linear_velocity(const Vector3 &p_velocity); virtual Vector3 get_linear_velocity() const; virtual void set_angular_velocity(const Vector3 &p_velocity); virtual Vector3 get_angular_velocity() const; virtual void set_transform(const Transform &p_transform); virtual Transform get_transform() const; virtual void add_central_force(const Vector3 &p_force); virtual void add_force(const Vector3 &p_force, const Vector3 &p_pos); virtual void add_torque(const Vector3 &p_torque); virtual void apply_central_impulse(const Vector3 &p_impulse); virtual void apply_impulse(const Vector3 &p_pos, const Vector3 &p_j); virtual void apply_torque_impulse(const Vector3 &p_j); virtual void set_sleep_state(bool p_enable); virtual bool is_sleeping() const; virtual int get_contact_count() const; virtual Vector3 get_contact_local_position(int p_contact_idx) const; virtual Vector3 get_contact_local_normal(int p_contact_idx) const; virtual float get_contact_impulse(int p_contact_idx) const; virtual int get_contact_local_shape(int p_contact_idx) const; virtual RID get_contact_collider(int p_contact_idx) const; virtual Vector3 get_contact_collider_position(int p_contact_idx) const; virtual ObjectID get_contact_collider_id(int p_contact_idx) const; virtual int get_contact_collider_shape(int p_contact_idx) const; virtual Vector3 get_contact_collider_velocity_at_position(int p_contact_idx) const; virtual real_t get_step() const { return deltaTime; } virtual void integrate_forces() { // Skip the execution of this function } virtual PhysicsDirectSpaceState *get_space_state(); }; class BoneBullet : public RigidCollisionObjectBullet { friend class ArmatureBullet; friend class BoneBulletPhysicsDirectBodyState; struct ForceIntegrationCallback { ObjectID id; StringName method; Variant udata; }; btMultiBodyLinkCollider *bt_body; btMultiBodyConstraint *bt_joint_limiter; btMultiBodyConstraint *bt_joint_motor; ArmatureBullet *armature; ForceIntegrationCallback *force_integration_callback; real_t link_mass; real_t link_half_size; int parent_link_id; // Set -1 if no parent btTransform joint_offset; bool disable_parent_collision; bool is_limit_active; real_t lower_limit; // In m if slider, in deg if hinge real_t upper_limit; // In m if slider, in deg if hinge // Check this http://www.ode.org/ode-latest-userguide.html#sec_3_7_0 // For information about these parameters bool is_motor_enabled; btVector3 velocity_target; // Used for 1D and 3D motor real_t position_target; // Used for 1D btQuaternion rotation_target; // Used for 3D motor real_t max_motor_impulse; real_t error_reduction_parameter; // From 0 to 1 real_t spring_constant; real_t damping_constant; real_t maximum_error; bool is_root; public: BoneBullet(); virtual ~BoneBullet(); virtual void set_space(SpaceBullet *p_space); virtual void on_collision_filters_change(); virtual void on_collision_checker_end(); virtual void dispatch_callbacks(); virtual void on_enter_area(AreaBullet *p_area); virtual void main_shape_changed(); virtual void reload_body(); virtual void set_transform__bullet(const btTransform &p_global_transform); virtual const btTransform &get_transform__bullet() const; btMultiBodyLinkCollider *get_bt_body() const; btMultiBodyConstraint *get_bt_joint_limiter() const; btMultiBodyConstraint *get_bt_joint_motor() const; void set_force_integration_callback( ObjectID p_id, const StringName &p_method, const Variant &p_udata = Variant()); void set_armature(ArmatureBullet *p_armature); ArmatureBullet *get_armature() const; void set_bone_id(int p_link_id); int get_bone_id() const; int get_link_id() const; void set_parent_bone_id(int p_bone_id); int get_parent_bone_id() const; int get_parent_link_id() const; void set_joint_offset(const Transform &p_transform); Transform get_joint_offset() const; const btTransform &get_joint_offset__bullet() const; btTransform get_joint_offset_scaled__bullet() const; void set_link_mass(real_t p_link_mass); real_t get_link_mass() const; void set_param(PhysicsServer::BodyParameter p_param, real_t p_value); real_t get_param(PhysicsServer::BodyParameter p_param) const; void set_disable_parent_collision(bool p_disable); bool get_disable_parent_collision() const; void set_limit_active(bool p_limit_active); bool get_is_limit_active() const; void set_lower_limit(real_t p_lower_limit); real_t get_lower_limit() const; void set_upper_limit(real_t p_upper_limit); real_t get_upper_limit() const; void set_motor_enabled(bool p_v); bool get_motor_enabled() const; void set_velocity_target(const Vector3 &p_v); Vector3 get_velocity_target() const; void set_position_target(real_t p_v); real_t get_position_target() const; void set_rotation_target(const Basis &p_v); Basis get_rotation_target() const; void set_max_motor_impulse(real_t p_v); real_t get_max_motor_impulse() const; void set_error_reduction_parameter(real_t p_v); real_t get_error_reduction_parameter() const; void set_spring_constant(real_t p_v); real_t get_spring_constant() const; void set_damping_constant(real_t p_v); real_t get_damping_constant() const; void set_maximum_error(real_t p_v); real_t get_maximum_error() const; Vector3 get_joint_force() const; Vector3 get_joint_torque() const; void setup_joint_fixed(); void setup_joint_prismatic(); void setup_joint_revolute(); void setup_joint_spherical(); void setup_joint_planar(); void update_joint_limits(); void update_joint_motor(); void update_joint_motor_params(); void calc_link_inertia( btMultibodyLink::eFeatherstoneJointType p_joint_type, real_t p_link_mass, real_t p_link_half_length, btVector3 &r_inertia); }; #endif // ARMATURE_BULLET_H
31.951429
84
0.73111
[ "object", "vector", "transform", "3d" ]
847db4cd1dff9069491d12399c18d56b24731f0b
2,536
h
C
libvis/src/libvis/libvis.h
ulricheck/surfelmeshing
bacaf70a1877185af844b31597cb59d4cbed0722
[ "BSD-3-Clause" ]
1
2018-11-10T06:10:24.000Z
2018-11-10T06:10:24.000Z
libvis/src/libvis/libvis.h
ulricheck/surfelmeshing
bacaf70a1877185af844b31597cb59d4cbed0722
[ "BSD-3-Clause" ]
null
null
null
libvis/src/libvis/libvis.h
ulricheck/surfelmeshing
bacaf70a1877185af844b31597cb59d4cbed0722
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2018 ETH Zürich, Thomas Schöps // // 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. // This file should be included in every other file in libvis. #pragma once #include <stddef.h> #include <stdint.h> namespace vis { // Import std namespace into vis namespace. using namespace std; // Type definitions which are more concise and thus easier to read and write (no // underscore). int is used as-is. typedef size_t usize; typedef int64_t i64; typedef uint64_t u64; typedef int32_t i32; typedef uint32_t u32; typedef int16_t i16; typedef uint16_t u16; typedef int8_t i8; typedef uint8_t u8; // Helper object which allows to do some global initialization and destruction. // Must be allocated at the start of the main() function (and destructed at its // end). This should be done with the LIBVIS_APPLICATION() macro. class LibvisApplication { public: LibvisApplication(); ~LibvisApplication(); }; // This macro should be at the start of the main() function of every program // using libvis. #define LIBVIS_APPLICATION() vis::LibvisApplication app }
37.850746
80
0.766956
[ "object" ]
847f45e9dc996687d037a639e035b0277d78656a
1,470
h
C
Reloaded/trunk/src/mame/includes/cinemat.h
lofunz/mieme
4226c2960b46121ec44fa8eab9717d2d644bff04
[ "Unlicense" ]
51
2015-11-22T14:53:28.000Z
2021-12-14T07:17:42.000Z
Reloaded/trunk/src/mame/includes/cinemat.h
lofunz/mieme
4226c2960b46121ec44fa8eab9717d2d644bff04
[ "Unlicense" ]
8
2018-01-14T07:19:06.000Z
2021-08-22T15:29:59.000Z
Reloaded/trunk/src/mame/includes/cinemat.h
lofunz/mieme
4226c2960b46121ec44fa8eab9717d2d644bff04
[ "Unlicense" ]
35
2017-02-15T09:39:00.000Z
2021-12-14T07:17:43.000Z
/************************************************************************* Cinematronics vector hardware *************************************************************************/ /*----------- defined in drivers/cinemat.c -----------*/ MACHINE_RESET( cinemat ); /*----------- defined in audio/cinemat.c -----------*/ WRITE8_HANDLER( cinemat_sound_control_w ); MACHINE_DRIVER_EXTERN( spacewar_sound ); MACHINE_DRIVER_EXTERN( barrier_sound ); MACHINE_DRIVER_EXTERN( speedfrk_sound ); MACHINE_DRIVER_EXTERN( starhawk_sound ); MACHINE_DRIVER_EXTERN( sundance_sound ); MACHINE_DRIVER_EXTERN( tailg_sound ); MACHINE_DRIVER_EXTERN( warrior_sound ); MACHINE_DRIVER_EXTERN( armora_sound ); MACHINE_DRIVER_EXTERN( ripoff_sound ); MACHINE_DRIVER_EXTERN( starcas_sound ); MACHINE_DRIVER_EXTERN( solarq_sound ); MACHINE_DRIVER_EXTERN( boxingb_sound ); MACHINE_DRIVER_EXTERN( wotw_sound ); MACHINE_DRIVER_EXTERN( wotwc_sound ); MACHINE_DRIVER_EXTERN( demon_sound ); MACHINE_DRIVER_EXTERN( qb3_sound ); /*----------- defined in video/cinemat.c -----------*/ void cinemat_vector_callback(running_device *device, INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift); WRITE8_HANDLER( cinemat_vector_control_w ); VIDEO_START( cinemat_bilevel ); VIDEO_START( cinemat_16level ); VIDEO_START( cinemat_64level ); VIDEO_START( cinemat_color ); VIDEO_START( cinemat_qb3color ); VIDEO_UPDATE( cinemat ); VIDEO_UPDATE( spacewar );
30.625
107
0.663265
[ "vector" ]
8491832db9452845c695fe636e5373b533b5f3f3
9,679
h
C
chrome/test/automation/automation_proxy.h
bluebellzhy/chromium
008c4fef2676506869a0404239da31e83fd6ccc7
[ "BSD-3-Clause" ]
1
2016-05-08T15:35:17.000Z
2016-05-08T15:35:17.000Z
chrome/test/automation/automation_proxy.h
bluebellzhy/chromium
008c4fef2676506869a0404239da31e83fd6ccc7
[ "BSD-3-Clause" ]
null
null
null
chrome/test/automation/automation_proxy.h
bluebellzhy/chromium
008c4fef2676506869a0404239da31e83fd6ccc7
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2006-2008 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. #ifndef CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H__ #define CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H__ #include <string> #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/thread.h" #include "chrome/common/ipc_channel_proxy.h" #include "chrome/common/ipc_message.h" #include "chrome/test/automation/automation_handle_tracker.h" #include "chrome/test/automation/automation_messages.h" class AutomationRequest; class BrowserProxy; class WindowProxy; class TabProxy; class AutocompleteEditProxy; // This is an interface that AutomationProxy-related objects can use to // access the message-sending abilities of the Proxy. class AutomationMessageSender : public IPC::Message::Sender { public: // Sends a message synchronously (from the perspective of the caller's // thread, at least); it doesn't return until a response has been received. // This method takes ownership of the request object passed in. The caller // is responsible for deleting the response object when they're done with it. // response_type should be set to the message type of the expected response. // A response object will only be available if the method returns true. // NOTE: This method will overwrite any routing_id on the request message, // since it uses this field to match the response up with the request. virtual bool SendAndWaitForResponse(IPC::Message* request, IPC::Message** response, int response_type) = 0; // Sends a message synchronously; it doesn't return until a response has been // received or a timeout has expired. // The function returns true if a response is received, and returns false if // there is a failure or timeout (in milliseconds). If return after timeout, // is_timeout is set to true. // See the comments in SendAndWaitForResponse for other details on usage. // NOTE: When timeout occurs, the connection between proxy provider may be // in transit state. Specifically, there might be pending IPC messages, // and the proxy provider might be still working on the previous // request. virtual bool SendAndWaitForResponseWithTimeout(IPC::Message* request, IPC::Message** response, int response_type, uint32 timeout_ms, bool* is_timeout) = 0; }; // This is the interface that external processes can use to interact with // a running instance of the app. class AutomationProxy : public IPC::Channel::Listener, public AutomationMessageSender { public: AutomationProxy(); virtual ~AutomationProxy(); // IPC callback virtual void OnMessageReceived(const IPC::Message& msg); virtual void OnChannelError(); // Close the automation IPC channel. void Disconnect(); // Waits for the app to launch and the automation provider to say hello // (the app isn't fully done loading by this point). // Returns true if the launch is successful bool WaitForAppLaunch(); // Waits for any initial page loads to complete. // NOTE: this only fires once for a run of the application. // Returns true if the load is successful bool WaitForInitialLoads(); // Waits for the initial destinations tab to report that it has finished // querying. |load_time| is filled in with how long it took, in milliseconds. // NOTE: this only fires once for a run of the application. // Returns true if the load is successful. bool WaitForInitialNewTabUILoad(int* load_time); // Open a new browser window, returning true on success. |show_command| // identifies how the window should be shown. // False likely indicates an IPC error. bool OpenNewBrowserWindow(int show_command); // Fills the number of open browser windows into the given variable, returning // true on success. False likely indicates an IPC error. bool GetBrowserWindowCount(int* num_windows); // Block the thread until the window count changes. // First parameter is the original window count. // The second parameter is updated with the number of window tabs. // The third parameter specifies the timeout length for the wait loop. // Returns false if the window count does not change before time out. // TODO(evanm): this function has a confusing name and semantics; it should // be deprecated for WaitForWindowCountToBecome. bool WaitForWindowCountToChange(int count, int* new_counter, int wait_timeout); // Block the thread until the window count becomes the provided value. // Returns true on success. bool WaitForWindowCountToBecome(int target_count, int wait_timeout); // Returns the BrowserProxy for the browser window at the given index, // transferring ownership of the pointer to the caller. // On failure, returns NULL. // // Use GetBrowserWindowCount to see how many browser windows you can ask for. // Window numbers are 0-based. BrowserProxy* GetBrowserWindow(int window_index); // Returns the BrowserProxy for the browser window which was last active, // transferring ownership of the pointer to the caller. // If there was no last active browser window, or the last active browser // window no longer exists (for example, if it was closed), returns // GetBrowserWindow(0). BrowserProxy* GetLastActiveBrowserWindow(); // Returns the WindowProxy for the currently active window, transferring // ownership of the pointer to the caller. // On failure, returns NULL. WindowProxy* GetActiveWindow(); // Returns the browser this window corresponds to, or NULL if this window // is not a browser. The caller owns the returned BrowserProxy. BrowserProxy* GetBrowserForWindow(WindowProxy* window); // Same as GetBrowserForWindow except return NULL if response isn't received // before the specified timeout. BrowserProxy* GetBrowserForWindowWithTimeout(WindowProxy* window, uint32 timeout_ms, bool* is_timeout); // Returns the WindowProxy for this browser's window. It can be used to // retreive view bounds, simulate clicks and key press events. The caller // owns the returned WindowProxy. // On failure, returns NULL. WindowProxy* GetWindowForBrowser(BrowserProxy* browser); // Returns an AutocompleteEdit for this browser's window. It can be used to // manipulate the omnibox. The caller owns the returned pointer. // On failure, returns NULL. AutocompleteEditProxy* GetAutocompleteEditForBrowser(BrowserProxy* browser); // Tells the browser to enable or disable network request filtering. Returns // false if the message fails to send to the browser. bool SetFilteredInet(bool enabled); // These methods are intended to be called by the background thread // to signal that the given event has occurred, and that any corresponding // Wait... function can return. void SignalAppLaunch(); void SignalInitialLoads(); // load_time is how long, in ms, the tab contents took to load. void SignalNewTabUITab(int load_time); // Returns the ID of the automation IPC channel, so that it can be // passed to the app as a launch parameter. const std::wstring& channel_id() const { return channel_id_; } // AutomationMessageSender implementations. virtual bool Send(IPC::Message* message); virtual bool SendAndWaitForResponse(IPC::Message* request, IPC::Message** response, int response_type); virtual bool SendAndWaitForResponseWithTimeout(IPC::Message* request, IPC::Message** response, int response_type, uint32 timeout_ms, bool* is_timeout); // Returns the current AutomationRequest object. AutomationRequest* current_request() { return current_request_; } // Clears the current AutomationRequest object. void clear_current_request() { current_request_ = NULL; } // Wrapper over AutomationHandleTracker::InvalidateHandle. Receives the message // from AutomationProxy, unpacks the messages and routes that call to the // tracker. void InvalidateHandle(const IPC::Message& message); // Creates a tab that can hosted in an external process. The function // returns a TabProxy representing the tab as well as a window handle // that can be reparented in another process. TabProxy* CreateExternalTab(HWND* external_tab_container); private: DISALLOW_EVIL_CONSTRUCTORS(AutomationProxy); void InitializeEvents(); void InitializeChannelID(); void InitializeThread(); void InitializeChannel(); void InitializeHandleTracker(); std::wstring channel_id_; scoped_ptr<base::Thread> thread_; scoped_ptr<IPC::ChannelProxy> channel_; scoped_ptr<AutomationHandleTracker> tracker_; HANDLE app_launched_; HANDLE initial_loads_complete_; HANDLE new_tab_ui_load_complete_; int new_tab_ui_load_time_; AutomationRequest* current_request_; static const int kMaxCommandExecutionTime; // Delay to let the browser // execute the command.; }; #endif // CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H__
43.79638
81
0.703895
[ "object" ]
84919c14f25640da869827733f66fd6a303f0399
2,065
h
C
ElementEngine/enginelib/include/element/Transform.h
lbondi7/Element-2.0
ecba7a5f4402167643984d15b7a1b3bcff951907
[ "MIT" ]
null
null
null
ElementEngine/enginelib/include/element/Transform.h
lbondi7/Element-2.0
ecba7a5f4402167643984d15b7a1b3bcff951907
[ "MIT" ]
null
null
null
ElementEngine/enginelib/include/element/Transform.h
lbondi7/Element-2.0
ecba7a5f4402167643984d15b7a1b3bcff951907
[ "MIT" ]
null
null
null
// // Created by lbondi7 on 08/11/2020. // #pragma once #include "element/Maths/Vec3.h" namespace Element { struct Transform { public: bool operator==(const Transform& other) const; Transform &operator=(const Transform& other); [[nodiscard]] virtual const Element::Maths::Vec3& getPosition() const { return m_position; } [[nodiscard]] float getPositionX() const; [[nodiscard]] float getPositionY() const; [[nodiscard]] float getPositionZ() const; virtual void setPosition(const Element::Maths::Vec3& position); virtual void setPosition(float x, float y, float z) final; void setPositionX(float x); void setPositionY(float y); virtual void setPositionZ(float z); [[nodiscard]] virtual const Element::Maths::Vec3& getRotation() const; [[nodiscard]] float getRotationX() const; [[nodiscard]] float getRotationY() const; [[nodiscard]] float getRotationZ() const; virtual void setRotation(const Element::Maths::Vec3& rotation); virtual void setRotation(float x, float y, float z); virtual void setRotationX(float x); virtual void setRotationY(float y); void setRotationZ(float z); [[nodiscard]] const Element::Maths::Vec3& getScale() const; [[nodiscard]] float getScaleX() const; [[nodiscard]] float getScaleY() const; [[nodiscard]] float getScaleZ() const; virtual void setScale(const Element::Maths::Vec3& scale); virtual void setScale(float x, float y, float z); virtual void setScale(float scale); void setScaleX(float x); void setScaleY(float y); virtual void setScaleZ(float z); [[nodiscard]] const bool isUpdated() const { return updated; } bool updated = false; protected: Element::Maths::Vec3 m_position = Vec3(0.0f); Element::Maths::Vec3 m_rotation = Vec3(0.0f); Element::Maths::Vec3 m_scale = Vec3(1.0f); private: }; } //ELEMENTENGINE_TRANSFORM_H
33.852459
100
0.637772
[ "transform" ]
849573a23f5593c1ec33ec4756420d938f343429
1,886
h
C
Gear/src/Gear/Renderer/Animation.h
GearEngine/GearEngine
fa5ed49ca6289a215799a7b84ece1241eb33bd36
[ "Apache-2.0" ]
3
2020-03-05T06:56:51.000Z
2020-03-12T09:36:20.000Z
Gear/src/Gear/Renderer/Animation.h
GearEngine/GearEngine
fa5ed49ca6289a215799a7b84ece1241eb33bd36
[ "Apache-2.0" ]
2
2020-03-05T15:40:28.000Z
2020-03-11T16:04:44.000Z
Gear/src/Gear/Renderer/Animation.h
GearEngine/GearEngine
fa5ed49ca6289a215799a7b84ece1241eb33bd36
[ "Apache-2.0" ]
null
null
null
#pragma once #include "Texture.h" #include "Gear/Core/Timestep.h" namespace Gear { class Animation { public: virtual ~Animation() = default; virtual void Update(Timestep ts) = 0; virtual void Start() = 0; virtual void Stop() = 0; virtual void Pause() = 0; virtual void Resume() = 0; }; class Animation2D : public Animation { public: Animation2D(Ref<FrameTexture2D> sprite, float fps, bool loop); Animation2D(Ref<FrameTexture2D> sprite, float fps, const std::vector<std::pair<int, int>> frameOrder, bool loop); public: static Ref<Animation2D> Create(Ref<FrameTexture2D> sprite, float fps, bool loop = false); static Ref<Animation2D> Create(Ref<FrameTexture2D> sprite, float fps, const std::vector<std::pair<int, int>> frameOrder, bool loop = false); public: virtual void Update(Timestep ts) override; virtual void Start() override; virtual void Stop() override; virtual void Pause() override; virtual void Resume() override; inline bool isCompleteOneLoop() { return m_CompleteOneLoop; } inline glm::vec4& GetTintColor() { return m_TintColor; } inline void SetTintColor(const glm::vec4& tintColor) { m_TintColor = tintColor; } void SetFrameX(uint32_t frameX); void SetFrameY(uint32_t frameY); inline const uint32_t GetFrameX() const { return m_CurrentFrameX; } inline const uint32_t GetFrameY() const { return m_CurrentFrameY; } void Bind(uint32_t slot = 0) const; private: float pastTime = 0.0f; private: bool m_Loop = false; bool m_OnAnimation = false; bool m_CompleteOneLoop = false; float m_Fps = 0.0f; Ref<FrameTexture2D> m_Sprite; uint32_t m_MaxFrameX; uint32_t m_MaxFrameY; uint32_t m_CurrentFrameX = 0; uint32_t m_CurrentFrameY = 0; glm::vec4 m_TintColor = glm::vec4(1.0f); bool m_HasFrameOrder = false; std::vector<std::pair<int, int>> m_FrameOrder; int m_FrameOrderIndex; }; }
27.735294
142
0.721633
[ "vector" ]
84a7772018fbe3404e126fcc7f0bc9006bf60bec
2,338
h
C
PVRMonitor/PVRMonitor/Source/PVRMonitorPlugin/Public/PVRMonitorBlueprint.h
powervr-graphics/PVRMonitorForUE4Plugin
977fd8c71160f45be8e55e7223073547f3d4811e
[ "MIT" ]
7
2019-05-03T03:12:57.000Z
2022-03-25T21:37:54.000Z
PVRMonitor/PVRMonitor/Source/PVRMonitorPlugin/Public/PVRMonitorBlueprint.h
powervr-graphics/PVRMonitorForUE4Plugin
977fd8c71160f45be8e55e7223073547f3d4811e
[ "MIT" ]
1
2022-03-26T22:14:39.000Z
2022-03-26T22:14:39.000Z
PVRMonitor/PVRMonitor/Source/PVRMonitorPlugin/Public/PVRMonitorBlueprint.h
powervr-graphics/PVRMonitorForUE4Plugin
977fd8c71160f45be8e55e7223073547f3d4811e
[ "MIT" ]
1
2021-01-29T09:28:18.000Z
2021-01-29T09:28:18.000Z
/*!*********************************************************************** @file PVRMonitorBlueprint.h @copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved. 2019 **************************************************************************/ #pragma once #include "CoreMinimal.h" #include "PVRScopeStats.h" #include <memory> #include <vector> //#include "UObject/NoExportTypes.h" #include "PVRMonitorBlueprint.generated.h" DEFINE_LOG_CATEGORY_STATIC(LogPVRMonitorPlugin, Log, All); USTRUCT(Blueprintable, BlueprintType) struct FPVRGraphCounter { GENERATED_BODY() public: UPROPERTY(BlueprintReadOnly, Category="PVRMonitor") TArray<float> valueCB; // Circular buffer of counter values uint32_t writePosCB; // Current write position of circular buffer UPROPERTY(BlueprintReadOnly, Category = "PVRMonitor") float maximum; UPROPERTY(BlueprintReadOnly, Category = "PVRMonitor") float minimum; UPROPERTY(BlueprintReadOnly, Category = "PVRMonitor") float average; FPVRGraphCounter() : writePosCB(0), maximum(0.0f), minimum(0.0f), average(0.0f) {} }; UCLASS(Blueprintable, BlueprintType) class UPVRMonitorManager : public UObject { GENERATED_BODY() public: UFUNCTION(BlueprintCallable, Category = Init) int32 InitializeManager(); UFUNCTION(BlueprintCallable, Category = Init) int32 DeInitializeManager(); UFUNCTION(BlueprintCallable, Category = Actions) int32 Ping(); UFUNCTION(BlueprintCallable, Category = Actions) int32 SetGroup(int32 group); UFUNCTION(BlueprintCallable, Category = Access) FPVRGraphCounter GetCounter(int32 index); UFUNCTION(BlueprintCallable, Category = Access) int32 GetCounterIndex(FString str); UFUNCTION(BlueprintCallable, Category = Access) TArray<FString> GetCounterNames(); UFUNCTION(BlueprintCallable, Category = Access) int32 GetNumBars(); UFUNCTION(BlueprintCallable, Category = Access) TArray<int32> GetGroups(); void InitCounters(); UPVRMonitorManager(); ~UPVRMonitorManager(); private: SPVRScopeImplData* scopeData; SPVRScopeCounterReading reading; uint32_t numCounter; SPVRScopeCounterDef* counters; uint32_t activeGroup; // most recent group seen uint32_t activeGroupSelect; // users desired group bool isActiveGroupChanged; std::vector<FPVRGraphCounter> graphCounters; uint32_t idxFPS; };
24.354167
86
0.724979
[ "vector" ]
84acae14847fec01e6038c9e3fb9b8dd1f502460
2,600
h
C
Tankas.h
sheirys/tankai-praktika
42f77ee3c30560179c2015d7400d18a7d4de5ec0
[ "MIT" ]
null
null
null
Tankas.h
sheirys/tankai-praktika
42f77ee3c30560179c2015d7400d18a7d4de5ec0
[ "MIT" ]
null
null
null
Tankas.h
sheirys/tankai-praktika
42f77ee3c30560179c2015d7400d18a7d4de5ec0
[ "MIT" ]
null
null
null
#ifndef _TANKAS_H_ #define _TANKAS_H_ #include <iostream> #include <string> #include <stdlib.h> #include <stdio.h> #include <math.h> #include <iostream> #include <sstream> #include <vector> #include "Konstantos.h" #include "CLoad_image.h" #include "Kulka.h" #include "Susidurimai.h" #include <SDL/SDL.h> #include <SDL/SDL_image.h> #include <SDL/SDL_rotozoom.h> #include <SDL/SDL_mixer.h> class data_loader; using std::vector; class Tankas { private: int ID;//Tanko id. Kiekvienas turi unikalu id bool gyvas;//ar tankas egzistuoja bool sprogsta; //ar tankas jau sprogimo stadijoje short int gyvybe; //------------------------------------- double kampas; double senas_kampas; double senas_kampasP; int X, Y;//Tanko surfeiso koordinates double pk;//kampas kurio reikia pasukti vamzdi, kad jis butu nukreiptas i zimekli double vk;//vamzdzio kampas neisk tanko padieties vector<SDL_Surface*> TS1; static const int T_AUKSTIS = 100; static const int T_PLOTIS = 100; static const int D = 3; Mix_Music *Grotuvas; Mix_Chunk *TankasStovi; Mix_Chunk *TankasVaziuoja; Mix_Chunk *TankasStoja; SDL_Surface* Tanks; //pagrindinis tanko surfeisas SDL_Surface* Patranka;//tanko vmzd pagrindinis int lastW;//paskutinio surfeiso iki sprogimo plotis int lastH; int Kuris_kadras; void Sprogimas(); public: //Surface, kuri grazina SDL_Surface* rotation; Tankas(data_loader &data, int ID = 0, int x =50, int y=50, double angle=0); Tankas(); void veiksmas(int kur, int mode, int xp, int yp); void Inicijuoti(); void Sauti(); int load_image(); void atnaujinti(int xp, int yp, vector<Kulka*> &kulkos); int getX(); int getY(); double GetAngle(); int GetID(); bool GetBusena(); //grazina true jei tankas dar gyvas bool Normal(); short int hp(); //grazina kiek liko gyvkiu void SendXY(int x, int y); void render(SDL_Surface* Ekranas); //Grazina koordinates kurios bus pavaziavus pasirinkta kryptimi /** @param kur nurodo kuria kryptimi vaziuos: 0 pirmyn 1 atgal. Pagal nutylejima pirmyn **/ int GetNextX(unsigned short int kur); int GetNextY(unsigned short int kur); SDL_Rect dst; }; #endif
26.804124
92
0.591154
[ "render", "vector" ]
806d6d5a809e4b5f9aff9acce4792c4595d163c3
54
h
C
include/Paper3D/pgeometrycube.h
lihw/paper3d
a06d056b2ad894a8065b7a996eb7f6ceefec1511
[ "MIT" ]
34
2015-01-29T12:27:25.000Z
2022-03-09T08:07:11.000Z
include/Paper3D/pgeometrycube.h
lihw/paper3d
a06d056b2ad894a8065b7a996eb7f6ceefec1511
[ "MIT" ]
1
2015-02-04T07:26:50.000Z
2015-02-04T07:36:55.000Z
include/Paper3D/pgeometrycube.h
lihw/paper3d
a06d056b2ad894a8065b7a996eb7f6ceefec1511
[ "MIT" ]
12
2015-03-24T22:16:53.000Z
2018-07-22T02:09:49.000Z
#include "../../src/renderer/geometry/pgeometrycube.h"
54
54
0.740741
[ "geometry" ]
807c097818f1310796f0e2e7ef5878ec7fbcb1a7
6,478
c
C
usr/src/lib/pkcs11/pkcs11_tpm/common/mech_sha.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/lib/pkcs11/pkcs11_tpm/common/mech_sha.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/lib/pkcs11/pkcs11_tpm/common/mech_sha.c
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
1
2020-12-30T00:04:16.000Z
2020-12-30T00:04:16.000Z
/* * The Initial Developer of the Original Code is International * Business Machines Corporation. Portions created by IBM * Corporation are Copyright (C) 2005 International Business * Machines Corporation. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the Common Public License as published by * IBM Corporation; either version 1 of the License, or (at your option) * any later version. * * This program 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 * Common Public License for more details. * * You should have received a copy of the Common Public License * along with this program; if not, a copy can be viewed at * http://www.opensource.org/licenses/cpl1.0.php. */ /* (C) COPYRIGHT International Business Machines Corp. 2001, 2002, 2005 */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #include "tpmtok_int.h" CK_RV sha1_hash(SESSION *sess, CK_BBOOL length_only, DIGEST_CONTEXT *ctx, CK_BYTE *in_data, CK_ULONG in_data_len, CK_BYTE *out_data, CK_ULONG *out_data_len) { if (! sess || ! ctx || ! out_data_len) { return (CKR_FUNCTION_FAILED); } *out_data_len = SHA1_DIGEST_LENGTH; if (length_only == TRUE) { return (CKR_OK); } if (ctx->context.sha1ctx == NULL) return (CKR_HOST_MEMORY); SHA1Update(ctx->context.sha1ctx, in_data, in_data_len); SHA1Final(out_data, ctx->context.sha1ctx); return (CKR_OK); } CK_RV sha1_hmac_sign(SESSION * sess, CK_BBOOL length_only, SIGN_VERIFY_CONTEXT * ctx, CK_BYTE * in_data, CK_ULONG in_data_len, CK_BYTE * out_data, CK_ULONG * out_data_len) { OBJECT * key_obj = NULL; CK_ATTRIBUTE * attr = NULL; CK_BYTE hash[SHA1_DIGEST_LENGTH]; DIGEST_CONTEXT digest_ctx; CK_MECHANISM digest_mech; CK_BYTE k_ipad[SHA1_BLOCK_SIZE]; CK_BYTE k_opad[SHA1_BLOCK_SIZE]; CK_ULONG key_bytes, hash_len, hmac_len; CK_ULONG i; CK_RV rc; if (! sess || ! ctx || ! out_data_len) { return (CKR_FUNCTION_FAILED); } if (ctx->mech.mechanism == CKM_SHA_1_HMAC_GENERAL) { hmac_len = *(CK_ULONG *)ctx->mech.pParameter; if (hmac_len == 0) { *out_data_len = 0; return (CKR_OK); } } else { hmac_len = SHA1_DIGEST_LENGTH; } *out_data_len = hmac_len; if (length_only == TRUE) { return (CKR_OK); } (void) memset(&digest_ctx, 0x0, sizeof (DIGEST_CONTEXT)); rc = object_mgr_find_in_map1(sess->hContext, ctx->key, &key_obj); if (rc != CKR_OK) { return (rc); } rc = template_attribute_find(key_obj->template, CKA_VALUE, &attr); if (rc == FALSE) { return (CKR_FUNCTION_FAILED); } else key_bytes = attr->ulValueLen; if (key_bytes > SHA1_BLOCK_SIZE) { digest_mech.mechanism = CKM_SHA_1; digest_mech.ulParameterLen = 0; digest_mech.pParameter = NULL; rc = digest_mgr_init(sess, &digest_ctx, &digest_mech); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } hash_len = sizeof (hash); rc = digest_mgr_digest(sess, FALSE, &digest_ctx, attr->pValue, attr->ulValueLen, hash, &hash_len); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } (void) digest_mgr_cleanup(&digest_ctx); (void) memset(&digest_ctx, 0x0, sizeof (DIGEST_CONTEXT)); for (i = 0; i < hash_len; i++) { k_ipad[i] = hash[i] ^ 0x36; k_opad[i] = hash[i] ^ 0x5C; } (void) memset(&k_ipad[i], 0x36, SHA1_BLOCK_SIZE - i); (void) memset(&k_opad[i], 0x5C, SHA1_BLOCK_SIZE - i); } else { CK_BYTE *key = attr->pValue; for (i = 0; i < key_bytes; i++) { k_ipad[i] = key[i] ^ 0x36; k_opad[i] = key[i] ^ 0x5C; } (void) memset(&k_ipad[i], 0x36, SHA1_BLOCK_SIZE - key_bytes); (void) memset(&k_opad[i], 0x5C, SHA1_BLOCK_SIZE - key_bytes); } digest_mech.mechanism = CKM_SHA_1; digest_mech.ulParameterLen = 0; digest_mech.pParameter = NULL; if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } rc = digest_mgr_digest_update(sess, &digest_ctx, k_ipad, SHA1_BLOCK_SIZE); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } rc = digest_mgr_digest_update(sess, &digest_ctx, in_data, in_data_len); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } hash_len = sizeof (hash); rc = digest_mgr_digest_final(sess, &digest_ctx, hash, &hash_len); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } (void) digest_mgr_cleanup(&digest_ctx); (void) memset(&digest_ctx, 0x0, sizeof (DIGEST_CONTEXT)); rc = digest_mgr_init(sess, &digest_ctx, &digest_mech); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } rc = digest_mgr_digest_update(sess, &digest_ctx, k_opad, SHA1_BLOCK_SIZE); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } rc = digest_mgr_digest_update(sess, &digest_ctx, hash, hash_len); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } hash_len = sizeof (hash); rc = digest_mgr_digest_final(sess, &digest_ctx, hash, &hash_len); if (rc != CKR_OK) { (void) digest_mgr_cleanup(&digest_ctx); return (rc); } (void) memcpy(out_data, hash, hmac_len); *out_data_len = hmac_len; (void) digest_mgr_cleanup(&digest_ctx); return (CKR_OK); } CK_RV sha1_hmac_verify(SESSION *sess, SIGN_VERIFY_CONTEXT *ctx, CK_BYTE *in_data, CK_ULONG in_data_len, CK_BYTE *signature, CK_ULONG sig_len) { CK_BYTE hmac[SHA1_DIGEST_LENGTH]; SIGN_VERIFY_CONTEXT hmac_ctx; CK_ULONG hmac_len, len; CK_RV rc; if (! sess || ! ctx || ! in_data || ! signature) { return (CKR_FUNCTION_FAILED); } if (ctx->mech.mechanism == CKM_SHA_1_HMAC_GENERAL) hmac_len = *(CK_ULONG *)ctx->mech.pParameter; else hmac_len = SHA1_DIGEST_LENGTH; (void) memset(&hmac_ctx, 0, sizeof (SIGN_VERIFY_CONTEXT)); rc = sign_mgr_init(sess, &hmac_ctx, &ctx->mech, FALSE, ctx->key); if (rc != CKR_OK) { goto done; } len = sizeof (hmac); rc = sign_mgr_sign(sess, FALSE, &hmac_ctx, in_data, in_data_len, hmac, &len); if (rc != CKR_OK) { goto done; } if ((len != hmac_len) || (len != sig_len)) { rc = CKR_SIGNATURE_LEN_RANGE; goto done; } if (memcmp(hmac, signature, hmac_len) != 0) { rc = CKR_SIGNATURE_INVALID; } done: (void) sign_mgr_cleanup(&hmac_ctx); return (rc); }
25.011583
74
0.688793
[ "object" ]
807fba5e325aca9b1724608bea9b045ec0e4e10f
5,518
h
C
01 VacantHusky-2048GameAutoMovePython/2048python&c/grid.h
Guleixibian2009/Game-Collection
1d8997b3ab0ea38958ed67dab7132bc89d467644
[ "Unlicense" ]
1
2021-12-19T05:37:19.000Z
2021-12-19T05:37:19.000Z
01 VacantHusky-2048GameAutoMovePython/2048python&c/grid.h
Guleixibian2009/Game-Collection
1d8997b3ab0ea38958ed67dab7132bc89d467644
[ "Unlicense" ]
null
null
null
01 VacantHusky-2048GameAutoMovePython/2048python&c/grid.h
Guleixibian2009/Game-Collection
1d8997b3ab0ea38958ed67dab7132bc89d467644
[ "Unlicense" ]
null
null
null
#ifndef GRID_H #define GRID_H // 二维向量 typedef struct _Vector { int x; int y; } Vector; typedef struct _Grid { int* tiles; int size; int length; int score; int (*is_zero)(struct _Grid* self, int x, int y); int (*is_full)(struct _Grid* self); void (*set_tiles)(struct _Grid* self, Vector xy, int number); Vector (*get_random_xy)(struct _Grid* self); void (*add_random_tile)(struct _Grid* self); void (*add_tile_init)(struct _Grid* self); void (*move_hl)(struct _Grid* self, int ii, char direction); int (*run)(struct _Grid* self, char direction, int is_fake); int (*is_over)(struct _Grid* self); void (*print)(struct _Grid* self); } Grid; int is_zero(Grid* self, int x, int y) { return *(self->tiles + (self->size * y + x)) == 0 ? 1 : 0; } int is_full(Grid* self) { int* p = self->tiles; for (int i = self->length; i; i--) if (*p++ == 0) return 0; return 1; } // 设置瓷砖 void set_tiles(Grid* self, Vector xy, int number) { self->tiles[self->size * xy.y + xy.x] = number; } // 获取一个随机的空坐标 Vector get_random_xy(Grid* self) { Vector xy = {-1, -1}; if (self->is_full(self) == 0) { int size = self->size, x, y; while (1) { x = rand() % size, y = rand() % size; if (self->is_zero(self, x, y)) { xy.x = x; xy.y = y; break; } } } return xy; } // 添加一个随机的瓷砖 void add_random_tile(Grid* self) { if (self->is_full(self) == 0) { int value = (float)rand() / RAND_MAX < 0.9 ? 2 : 4; self->set_tiles(self, self->get_random_xy(self), value); } } // 初始设置瓷砖 void add_tile_init(Grid* self) { self->add_random_tile(self); self->add_random_tile(self); } // 移动某一行或某一列 // ii: 要移动的行数还是列数 // direction: 方向 void move_hl(Grid* self, int ii, char direction) { int *hl[self->size], i, j, fuck = self->size * ii; int **p = hl, **q; switch (direction) { case 'U': for (i = 0; i < self->size; i++, p++) *p = self->tiles + (i * self->size + ii); break; case 'D': for (i = self->size - 1; i >= 0; i--, p++) *p = self->tiles + (i * self->size + ii); break; case 'L': for (i = 0; i < self->size; i++, p++) *p = self->tiles + (fuck + i); break; case 'R': for (i = self->size - 1; i >= 0; i--, p++) *p = self->tiles + (fuck + i); break; default: printf("move_hl: fuck=%X\n", direction); break; } p = hl; for (i = 0; i < self->size - 1; i++, p++) { if (**p == 0) for (j = self->size - i - 1, q = p + 1; j > 0; j--, q++) { if (**q != 0) { **p = **q; **q = 0; self->score++; break; } } if (**p == 0) break; for (j = self->size - i - 1, q = p + 1; j > 0; j--, q++) { if (**q == **p) { **p += **q; self->score += **q; **q = 0; break; } if (**q != 0) break; } } } // 运行 int run(Grid* self, char direction, int is_fake) { if (direction != 'U' && direction != 'D' && direction != 'L' && direction != 'R') printf("run fuck: %x\n", direction); int *t, i; self->score = 0; if (is_fake) { t = (int*)malloc(sizeof(self->tiles)); memcpy(t, self->tiles, sizeof(self->tiles)); } else t = self->tiles; for (i = 0; i < self->size; i++) self->move_hl(self, i, direction); if (is_fake) free(t); return self->score; } // 判断是否结束 int is_over(Grid* self) { if (self->is_full(self) == 0) return 0; int x, y, ys, ys1, tem, *t = self->tiles, s = self->size; for (y = s - 2; y >= 0; y--) { ys = y * s; ys1 = (y + 1) * s; for (x = s - 2; x >= 0; x--) { tem = *(t + (ys + x)); if (tem == *(t + (ys + x + 1)) || tem == *(t + (ys1 + x))) return 0; } } return 1; } void print(Grid* self){ printf("====================\n"); int x, y; for(y = 0; y < self->size; y ++) { for(x = 0; x< 5 * self->size + 1; x++) printf("-"); printf("\n"); for(x = 0; x< self->size; x++) { printf("|%4d", *(self->tiles + (self->size*y+x))); } printf("\n"); } for(x = 0; x< 5 * self->size + 1; x++) printf("-"); printf("\n"); printf("====================\n"); } Grid g_obj; int g_flag = 1; void CreateGrid() { // 提前创建对象 // g_obj = (Grid*)malloc(sizeof(Grid)); // 赋值成员变量 g_obj.score = 0; // 赋值成员方法 g_obj.is_zero = is_zero; g_obj.is_full = is_full; g_obj.set_tiles = set_tiles; g_obj.get_random_xy = get_random_xy; g_obj.add_random_tile = add_random_tile; g_obj.add_tile_init = add_tile_init; g_obj.move_hl = move_hl; g_obj.run = run; g_obj.is_over = is_over; g_obj.print = print; g_flag = 0; } Grid* NewGrid(int size) { // new一个对象 Grid* g = (Grid*)malloc(sizeof(Grid)); if (g_flag) CreateGrid(); memcpy(g, &g_obj, sizeof(Grid)); g->size = size; g->length = size * size; g->tiles = (int*)calloc(g->length, sizeof(int)); return g; } #endif
27.182266
85
0.4556
[ "vector" ]