void fprint_const_Multiarray_Vector_T (FILE* file, const int n_tab, const struct const_Multiarray_Vector_T* a) { const ptrdiff_t size = compute_size(a->order,a->extents); for (ptrdiff_t i = 0; i < size; ++i) fprint_const_Vector_T(file,n_tab,a->data[i]); }
G1BlockOffsetSharedArray::G1BlockOffsetSharedArray(MemRegion reserved, size_t init_word_size) : _reserved(reserved), _end(NULL) { size_t size = compute_size(reserved.word_size()); ReservedSpace rs(ReservedSpace::allocation_align_size_up(size)); if (!rs.is_reserved()) { vm_exit_during_initialization("Could not reserve enough space for heap offset array"); } if (!_vs.initialize(rs, 0)) { vm_exit_during_initialization("Could not reserve enough space for heap offset array"); } _offset_array = (u_char*)_vs.low_boundary(); resize(init_word_size); if (TraceBlockOffsetTable) { gclog_or_tty->print_cr("G1BlockOffsetSharedArray::G1BlockOffsetSharedArray: "); gclog_or_tty->print_cr(" " " rs.base(): " INTPTR_FORMAT " rs.size(): " INTPTR_FORMAT " rs end(): " INTPTR_FORMAT, rs.base(), rs.size(), rs.base() + rs.size()); gclog_or_tty->print_cr(" " " _vs.low_boundary(): " INTPTR_FORMAT " _vs.high_boundary(): " INTPTR_FORMAT, _vs.low_boundary(), _vs.high_boundary()); } }
OdClassInstCanvas::OdClassInstCanvas(BrowserClassInstance * bn, UmlCanvas * canvas, int x, int y, int id) : DiagramCanvas(0, canvas, x, y, CLASSINST_CANVAS_MIN_SIZE, 1, id), ClassInstCanvas() { browser_node = bn; itscolor = UmlDefaultColor; BasicData * d = bn->get_data(); connect(d, SIGNAL(changed()), this, SLOT(modified())); connect(d, SIGNAL(deleted()), this, SLOT(deleted())); connect(DrawingSettings::instance(), SIGNAL(changed()), this, SLOT(modified())); if (id == 0) { // not on read compute_size(); // update used_settings if (browser_node->get_type() != UmlClass) check_stereotypeproperties(); if (canvas->must_draw_all_relations()) draw_all_relations(); } }
void UcClassCanvas::history_load(QBuffer & b) { DiagramCanvas::history_load(b); connect(browser_node->get_data(), SIGNAL(changed()), this, SLOT(modified())); connect(browser_node->get_data(), SIGNAL(deleted()), this, SLOT(deleted())); connect(DrawingSettings::instance(), SIGNAL(changed()), this, SLOT(modified())); compute_size(); }
static void substitute_m_for_s (struct Multiarray_Vector_i*const f_ve, struct Periodic_Face_Info* pf_info[N_MS]) { const ptrdiff_t n_pf = pf_info[0]->n_pf; struct Periodic_Face_Info* pf_info_m = pf_info[0], * pf_info_s = pf_info[1]; // Form the list of pointers to the slave node_nums. struct Vector_i** f_ve_slave = malloc(n_pf * sizeof *f_ve_slave); // free const ptrdiff_t nitems = compute_size(f_ve->order,f_ve->extents); for (ptrdiff_t i = 0; i < n_pf; ++i) { struct Vector_i*const*const slave = bsearch(&pf_info_s->p_faces[i]->node_nums,f_ve->data,nitems,sizeof(f_ve->data[0]),cmp_Vector_i); if (slave == NULL) EXIT_ERROR("Did not find the slave periodic face in the list"); f_ve_slave[i] = *slave; } // Substitute into f_ve. // Note: this must not be done until all entries are found so that the list remains sorted. for (ptrdiff_t i = 0; i < n_pf; ++i) copy_data_Vector_i_Vector_i(pf_info_m->p_faces[i]->node_nums,f_ve_slave[i]); free(f_ve_slave); }
BlockOffsetSharedArray::BlockOffsetSharedArray(MemRegion reserved, size_t init_word_size): _reserved(reserved), _end(NULL) { size_t size = compute_size(reserved.word_size()); ReservedSpace rs(size); if (!rs.is_reserved()) { vm_exit_during_initialization("Could not reserve enough space for heap offset array"); } MemTracker::record_virtual_memory_type((address)rs.base(), mtGC); if (!_vs.initialize(rs, 0)) { vm_exit_during_initialization("Could not reserve enough space for heap offset array"); } _offset_array = (u_char*)_vs.low_boundary(); resize(init_word_size); if (TraceBlockOffsetTable) { gclog_or_tty->print_cr("BlockOffsetSharedArray::BlockOffsetSharedArray: "); gclog_or_tty->print_cr(" " " rs.base(): " INTPTR_FORMAT " rs.size(): " INTPTR_FORMAT " rs end(): " INTPTR_FORMAT, rs.base(), rs.size(), rs.base() + rs.size()); gclog_or_tty->print_cr(" " " _vs.low_boundary(): " INTPTR_FORMAT " _vs.high_boundary(): " INTPTR_FORMAT, _vs.low_boundary(), _vs.high_boundary()); } }
void UcClassCanvas::change_scale() { Q3CanvasRectangle::setVisible(FALSE); compute_size(); recenter(); if (templ != 0) templ->update(); Q3CanvasRectangle::setVisible(TRUE); }
void StateActionCanvas::change_scale() { QCanvasRectangle::setVisible(FALSE); double scale = the_canvas()->zoom(); setSize((int) (width_scale100*scale), (int) (height_scale100*scale)); compute_size(); recenter(); QCanvasRectangle::setVisible(TRUE); }
static ptrdiff_t compute_dof_volumes_test (const struct Simulation*const sim) { ptrdiff_t dof = 0; for (struct Intrusive_Link* curr = sim->volumes->first; curr; curr = curr->next) { struct Solver_Volume_T* s_vol = (struct Solver_Volume_T*) curr; dof += compute_size(s_vol->test_s_coef->order,s_vol->test_s_coef->extents); } return dof; }
unsigned long copy_from_user_fixup(void *to, const void __user *from, unsigned long size) { unsigned long offset; size = compute_size((unsigned long) from, size, &offset); if (likely(size)) memset(to + offset, 0, size); return size; }
struct Vector_i* constructor_nnz_opg_T (const struct Simulation* sim) { assert(get_set_has_1st_2nd_order(NULL)[1] == false); // Add support. const ptrdiff_t dof = compute_dof_test(sim); struct Vector_i* nnz = constructor_zero_Vector_i(dof); // returned // Volume contribution (Diagonal) for (struct Intrusive_Link* curr = sim->volumes->first; curr; curr = curr->next) { struct Solver_Volume_T* s_vol = (struct Solver_Volume_T*) curr; struct Multiarray_T* test_s_coef = s_vol->test_s_coef; const ptrdiff_t size = compute_size(test_s_coef->order,test_s_coef->extents); increment_nnz(nnz,s_vol->ind_dof_test,size,size); } // Face contributions (Off-diagonal) for (struct Intrusive_Link* curr = sim->faces->first; curr; curr = curr->next) { struct Face* face = (struct Face*) curr; if (face->boundary) continue; struct Solver_Volume_T* s_vol[2] = { (struct Solver_Volume_T*) face->neigh_info[0].volume, (struct Solver_Volume_T*) face->neigh_info[1].volume, }; struct Multiarray_T* test_s_coef[2] = { s_vol[0]->test_s_coef, s_vol[1]->test_s_coef, }; const ptrdiff_t size[2] = { compute_size(test_s_coef[0]->order,test_s_coef[0]->extents), compute_size(test_s_coef[1]->order,test_s_coef[1]->extents), }; increment_nnz(nnz,s_vol[0]->ind_dof_test,size[0],size[1]); increment_nnz(nnz,s_vol[1]->ind_dof_test,size[1],size[0]); } // Constraint - if applicable (Diagonal and Off-diagonal) if (test_case_explicitly_enforces_conservation(sim)) { EXIT_ADD_SUPPORT; } return nnz; }
static void init(grib_accessor* a, const long len , grib_arguments* arg ) { grib_accessor_bitmap* self = (grib_accessor_bitmap*)a; int n = 0; self->tableReference = grib_arguments_get_name(a->parent->h,arg,n++); self->missing_value = grib_arguments_get_name(a->parent->h,arg,n++); self->offsetbsec = grib_arguments_get_name(a->parent->h,arg,n++); self->sLength = grib_arguments_get_name(a->parent->h,arg,n++); compute_size(a); }
// -------------------------------------------------------- // button body // -------------------------------------------------------- t_button::t_button( t_cached_ptr<t_button_bitmaps>& bitmaps, t_screen_point point, t_window* parent, std::string const& text ) : t_window( k_no_transparency, parent ), m_bitmaps( bitmaps ) { m_pressed = false; m_disabled = false; m_highlighted = false; m_current_image = 0; if (bitmaps != 0) { if (bitmaps->get_up_bitmap() != 0) m_released_image = new t_bitmap_layer_window( bitmaps->get_up_bitmap(), t_screen_point(0,0), this ); m_released_rect = bitmaps->get_up_rect(); if (bitmaps->get_down_bitmap() != 0) m_pressed_image = new t_bitmap_layer_window( bitmaps->get_down_bitmap(), t_screen_point(0,0), this ); m_pressed_rect = bitmaps->get_down_rect(); if (bitmaps->get_highlighted_bitmap() != 0) m_highlighted_image = new t_bitmap_layer_window( bitmaps->get_highlighted_bitmap(), t_screen_point(0,0), this ); m_highlighted_rect = bitmaps->get_highlighted_rect(); if (bitmaps->get_highlighted_pressed_bitmap() != 0) m_highlighted_pressed_image = new t_bitmap_layer_window( bitmaps->get_highlighted_pressed_bitmap(), t_screen_point(0,0), this ); m_highlighted_pressed_rect = bitmaps->get_highlighted_pressed_rect(); if (bitmaps->get_disabled_bitmap() != 0) m_disabled_image = new t_bitmap_layer_window( bitmaps->get_disabled_bitmap(), t_screen_point(0,0), this ); m_disabled_rect = bitmaps->get_disabled_rect(); } t_screen_rect rect = compute_size(); update_transparency(); rect.left = 0; rect.top = 0; init( rect + point ); if (!text.empty()) add_text( text, get_font( rect.height() ) ); set_image(); };
inline vm::tuple* expand(const vm::predicate *pred, mem::node_allocator *alloc) { if (num_tuples == cap) { if (num_tuples == 0) init(1, pred, alloc); else { const size_t old_cap(cap); utils::byte *old((utils::byte *)data); init(cap * 2, pred, alloc); memcpy(data, old, compute_size(pred, old_cap)); delete_buffer(pred, old, old_cap, alloc); } } return add_next(pred); }
// -------------------------------------------------------- // draw this window // -------------------------------------------------------- // re-size the button to fit the child windows. void t_button::update_size() { if (!is_open()) return; // get our own screen rect, and force the origin of the rect to match. t_screen_rect rect = compute_size(); update_transparency(); // remap rectangle to parent's client coordinates, and change size. rect = get_parent()->to_client( rect ); move( rect, false ); }
void ArtifactCanvas::modified() { hide(); hide_lines(); compute_size(); show(); update_show_lines(); check_stereotypeproperties(); if (the_canvas()->must_draw_all_relations()) { draw_all_relations(); draw_all_simple_relations(); } canvas()->update(); package_modified(); }
static struct Mesh_Vertices_l set_up_mesh_vertices (const struct Mesh*const mesh, const struct const_Intrusive_List* elements) { struct Mesh_Vertices_l mesh_vert_l; const ptrdiff_t ind_v = mesh->mesh_data->ind_v, n_ve = mesh->mesh_data->nodes->ext_0; const struct const_Vector_i*const elem_types = mesh->mesh_data->elem_types, *const*const volume_nums = &mesh->mesh_data->node_nums->data[ind_v]; const struct const_Multiarray_Vector_i*const v_to_v = mesh->mesh_conn->v_to_v, *const v_to_lf = mesh->mesh_conn->v_to_lf; mesh_vert_l.ve_curved = constructor_empty_Vector_i(n_ve); // keep mesh_vert_l.ve_boundary = constructor_empty_Vector_i(n_ve); // keep mesh_vert_l.ve_bc = constructor_empty_Multiarray_Vector_i(true,1,&n_ve); // keep set_to_zero_Vector_i(mesh_vert_l.ve_curved); set_to_zero_Vector_i(mesh_vert_l.ve_boundary); const ptrdiff_t n_v = compute_size(v_to_lf->order,v_to_lf->extents); for (ptrdiff_t v = 0; v < n_v; ++v) { const struct const_Vector_i*const v_to_v_V = v_to_v->data[v], *const v_to_lf_V = v_to_lf->data[v]; const int lf_max = (int) v_to_v_V->ext_0; for (int lf = 0; lf < lf_max; ++lf) { const int v_to_lf_i = v_to_lf_V->data[lf]; if (v_to_lf_i < BC_STEP_SC) continue; const struct const_Element* element = get_element_by_type(elements,elem_types->data[ind_v+v]); const struct const_Vector_i*const f_ve = element->f_ve->data[lf]; const ptrdiff_t n_ve_f = f_ve->ext_0; for (int ve = 0; ve < n_ve_f; ++ve) { const int ind_ve = volume_nums[v]->data[f_ve->data[ve]]; mesh_vert_l.ve_boundary->data[ind_ve] = 1; push_back_Vector_i(mesh_vert_l.ve_bc->data[ind_ve],v_to_lf_i,true,true); if (v_to_lf_i > 2*BC_STEP_SC) mesh_vert_l.ve_curved->data[ind_ve] = 1; } } } return mesh_vert_l; }
void StateActionCanvas::modified() { hide(); hide_lines(); compute_size(); show(); update_show_lines(); force_self_rel_visible(); if (the_canvas()->must_draw_all_relations()) { //draw_all_simple_relations(); draw_all_transitions(); } check_stereotypeproperties(); canvas()->update(); package_modified(); }
void CodClassInstCanvas::modified() { if (visible()) { hide(); hide_lines(); compute_size(); show(); update_show_lines(); if (self_link) self_link->update_pos(); if (browser_node->get_type() != UmlClass) check_stereotypeproperties(); canvas()->update(); package_modified(); } }
void print_Multiarray_Vector_T (const struct Multiarray_Vector_T*const a) { print_Multiarray_extents(a->order,a->extents); const ptrdiff_t size = compute_size(a->order,a->extents); for (ptrdiff_t i = 0; i < size; i++) { printf("\nIndex: % 3td: ",i); if (a->data[i]) { printf("\n\n"); print_Vector_T(a->data[i]); } else { printf("*** NULL ***"); } } printf("\n"); }
void print_Multiarray_Matrix_T_tol (const struct Multiarray_Matrix_T*const a, const Real tol) { print_Multiarray_extents(a->order,a->extents); const ptrdiff_t size = compute_size(a->order,a->extents); for (ptrdiff_t i = 0; i < size; i++) { printf("\nIndex: % 3td: ",i); if (a->data[i]) { printf("\n\n"); print_Matrix_T_tol(a->data[i],tol); } else { printf("*** NULL ***"); } } printf("\n"); }
ArtifactCanvas::ArtifactCanvas(BrowserNode * bn, UmlCanvas * canvas, int x, int y) : DiagramCanvas(0, canvas, x, y, ARTIFACT_CANVAS_MIN_SIZE, 1, 0) { browser_node = bn; itscolor = UmlDefaultColor; compute_size(); check_stereotypeproperties(); connect(bn->get_data(), SIGNAL(changed()), this, SLOT(modified())); connect(bn->get_data(), SIGNAL(deleted()), this, SLOT(deleted())); connect(DrawingSettings::instance(), SIGNAL(changed()), this, SLOT(modified())); if (canvas->must_draw_all_relations()) { draw_all_relations(); draw_all_simple_relations(); } }
void UcClassCanvas::modified() { if (visible()) { hide(); hide_lines(); compute_size(); recenter(); show(); update_show_lines(); force_self_rel_visible(); if (the_canvas()->must_draw_all_relations()) { draw_all_depend_gene(); draw_all_simple_relations(); } check_stereotypeproperties(); canvas()->update(); package_modified(); } }
//_________________________________________________________________________ int graph_molloy_hash::alloc(degree_sequence °s) { n = degs.size(); a = degs.sum(); assert(a%2 == 0); deg = degs.seq(); compute_size(); deg = new int[n+size]; if(deg==NULL) return 0; int i; for(i=0; i<n; i++) deg[i]=degs[i]; links = deg+n; init(); neigh = new int*[n]; if(neigh==NULL) return 0; compute_neigh(); return sizeof(int *)*n + sizeof(int)*(n+size); }
void cb_validate_field (struct cb_field *f) { struct cb_field *c; if (validate_field_1 (f) != 0) { f->flag_invalid = 1; return; } /* RXW - Remove */ if (f->flag_item_78) { f->flag_is_verified = 1; return; } /* setup parameters */ if (f->storage == CB_STORAGE_LOCAL || f->storage == CB_STORAGE_LINKAGE || f->flag_item_based) { f->flag_local = 1; } if (f->storage == CB_STORAGE_LINKAGE || f->flag_item_based) { f->flag_base = 1; } setup_parameters (f); /* compute size */ compute_size (f); if (!f->redefines) { f->memory_size = f->size * f->occurs_max; } else if (f->redefines->memory_size < f->size * f->occurs_max) { f->redefines->memory_size = f->size * f->occurs_max; } validate_field_value (f); if (f->flag_is_global) { f->count++; for (c = f->children; c; c = c->sister) { c->flag_is_global = 1; c->count++; } } f->flag_is_verified = 1; }
void test_result(int ndim) { int k, den; int isize, tsize, csize; double iave, idev; double tave, tdev; double rez; isize = 1; tsize = 1; csize = 1; for (k = 0; k < ndim; k++) { isize *= idims[k]; tsize *= tdims[k]; cprod[k] = csize; csize *= cdims[k]; } for (k = 0; k < csize; k++) cdata[k] = 0; Normalize_nf(ndim,idims,idata,tdims,tdata,cdims,cdata); for (k = 0; k < csize; k++) { den = compute_size(ndim-1,k); iave = compute_iave(ndim-1,isize,k,idata)/den; idev = compute_idev(ndim-1,isize,k,idata,iave)/den; tave = compute_tave(ndim-1,tsize,k,tdata)/den; tdev = compute_tdev(ndim-1,tsize,k,tdata,tave)/den; if (tdev == 0. || idev == 0.) rez = 0.; else rez = -(den*iave*tave) / ((den-1)*sqrt(idev*tdev)); if (fabs(rez-cdata[k]) > 2e-5) printf("** DIFF %d: [%g %g %g %g] %g %g (%g)\n", k,iave,idev,tave,tdev,cdata[k],rez,fabs(rez-cdata[k])); } }
StateActionCanvas::StateActionCanvas(BrowserNode * bn, UmlCanvas * canvas, int x, int y) : DiagramCanvas(0, canvas, x, y, STATE_ACTION_CANVAS_MIN_SIZE, 1, 0) { browser_node = bn; itscolor = UmlDefaultColor; language = DefaultDrawingLanguage; show_stereotype_properties = UmlDefaultState; compute_size(); check_stereotypeproperties(); connect(bn->get_data(), SIGNAL(changed()), this, SLOT(modified())); connect(bn->get_data(), SIGNAL(deleted()), this, SLOT(deleted())); connect(DrawingSettings::instance(), SIGNAL(changed()), this, SLOT(modified())); if (canvas->must_draw_all_relations()) { //draw_all_simple_relations(); draw_all_transitions(); } }
TimeBar::TimeBar(HWND parent, HINSTANCE hinst, CDeskBand *deskband) : deskband(deskband) { init(hinst); bar_text[0] = 0; bar_max_value = 100; bar_value = 0; secondary_bar_max_value = 0; secondary_bar_value = 100; secondary_bar_color = ITimeBar::COLOR_ID_INACTIVE; bar_color = ITimeBar::COLOR_ID_ACTIVE; hwnd = CreateWindowEx(0, TIME_BAR_CLASS_NAME, "", WS_CHILD | WS_CLIPSIBLINGS, 0, 0, 56, 16, parent, NULL, hinst, (LPVOID)this ); paint_helper = new PaintHelper(hwnd); compute_size(width, height); SetWindowPos(hwnd, NULL, 0, 0, width, height, SWP_NOZORDER|SWP_NOMOVE|SWP_NOACTIVATE); }
CodClassInstCanvas::CodClassInstCanvas(BrowserNode * bn, UmlCanvas * canvas, int x, int y, int id) : CodObjCanvas(0, canvas, x, y, CLASSINST_CANVAS_MIN_SIZE, 1, id), ClassInstCanvas() { // bn may a class instance or a class browser_node = bn; itscolor = UmlDefaultColor; if (id == 0) { // not on read compute_size(); if (browser_node->get_type() != UmlClass) check_stereotypeproperties(); } BasicData * d = bn->get_data(); connect(d, SIGNAL(changed()), this, SLOT(modified())); connect(d, SIGNAL(deleted()), this, SLOT(deleted())); connect(DrawingSettings::instance(), SIGNAL(changed()), this, SLOT(modified())); }
static void hippo_person_renderer_get_size(GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *cell_area, gint *x_offset_p, gint *y_offset_p, gint *width_p, gint *height_p) { GdkRectangle content_rect; compute_size(cell, widget, cell_area, &content_rect, NULL, NULL, NULL, NULL, NULL); if (x_offset_p) *x_offset_p = content_rect.x; if (y_offset_p) *y_offset_p = content_rect.y; if (width_p) *width_p = content_rect.width; if (height_p) *height_p = content_rect.height; }