您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ upper函数代码示例

51自学网 2021-06-03 09:16:24
  C++
这篇教程C++ upper函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中upper函数的典型用法代码示例。如果您正苦于以下问题:C++ upper函数的具体用法?C++ upper怎么用?C++ upper使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了upper函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: upper

void TextCanvas::apply_shortcut(const QString & s){    if (s == "Upper")        upper();    else if (s == "Lower")        lower();    else if (s == "Go up")        z_up();    else if (s == "Go down")        z_down();    else if (s == "Edit") {        open();  // call package_modified        return;    }    else        return;    // force son reaffichage    hide();    show();    canvas()->update();    package_modified();}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:24,


示例2: z

void SdLifeLineCanvas::exec_menu(int rank) {  double old_z = z();    switch (rank) {  case 0:    SdDurationCanvas::propag_visible(durations, FALSE);    upper();    SdDurationCanvas::propag_visible(durations, TRUE);    break;  case 1:    lower();    break;  case 2:    SdDurationCanvas::propag_visible(durations, FALSE);    z_up();    SdDurationCanvas::propag_visible(durations, TRUE);    break;  case 3:    z_down();    break;  default:    return;  }    double dz = z() - old_z;    if (dz != 0) {    SdDurationCanvas::propag_dz(durations, dz);      // force son reaffichage    hide();    show();    canvas()->update();    package_modified();  }}
开发者ID:kralf,项目名称:bouml,代码行数:36,


示例3: upper

void NoteCanvas::apply_shortcut(QString s){    if (s == "Upper")        upper();    else if (s == "Lower")        lower();    else if (s == "Go up")        z_up();    else if (s == "Go down")        z_down();    else if (s == "Edit drawing settings") {        edit_drawing_settings();        return;    }    else if (s == "Edit") {        open();  // call modified then package_modified        return;    }    else        return;    modified();    package_modified();}
开发者ID:harmegnies,项目名称:douml,代码行数:24,


示例4: clear

MultiMooseEnum &MultiMooseEnum::assign(InputIterator first, InputIterator last, bool append){  if (!append)    clear();  std::copy(first, last, std::back_inserter(_current_names_preserved));  for (InputIterator it = first; it != last; ++it)  {    std::string upper(*it);    std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);    checkDeprecatedBase(upper);    _current_names.insert(upper);    if (std::find(_names.begin(), _names.end(), upper) == _names.end())    {      if (_out_of_range_index == 0)     // Are out of range values allowed?        mooseError("Invalid option /"" << upper << "/" in MultiMooseEnum.  Valid options (not case-sensitive) are /"" << _raw_names << "/".");      else      {        // Allow values assigned outside of the enumeration range        _names.push_back(upper);        int current_id = _out_of_range_index++;        _name_to_id[upper] = current_id;        _current_ids.push_back(current_id);      }    }    else      _current_ids.push_back(_name_to_id[upper]);  }  return *this;}
开发者ID:Liuux,项目名称:moose,代码行数:36,


示例5: LCD_PutCmd

void LCD_PutCmd ( unsigned int c ){	GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_RS;/* this subroutine works specifically for 4-bit Port A */	upper ( c ); /* send high nibble */	delay(1);	LCD_PulseEnable();	//delay(2);	lower ( c ); /* send low nibble */	LCD_PulseEnable();	//delay(2);//		if(c & 0x80) GPIO->P[COM_PORT].DOUTSET = 1 << LCD_D7; else GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_D7;//		if(c & 0x40) GPIO->P[COM_PORT].DOUTSET = 1 << LCD_D6; else GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_D6;//		if(c & 0x20) GPIO->P[COM_PORT].DOUTSET = 1 << LCD_D5; else GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_D5;//		if(c & 0x10) GPIO->P[COM_PORT].DOUTSET = 1 << LCD_D4; else GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_D4;////		if(c & 0x08) GPIO->P[COM_PORT].DOUTSET = 1 << LCD_D3; else GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_D3;//		if(c & 0x04) GPIO->P[COM_PORT].DOUTSET = 1 << LCD_D2; else GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_D2;//		if(c & 0x02) GPIO->P[COM_PORT].DOUTSET = 1 << LCD_D1; else GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_D1;//		if(c & 0x01) GPIO->P[COM_PORT].DOUTSET = 1 << LCD_D0; else GPIO->P[COM_PORT].DOUTCLR = 1 << LCD_D0;}
开发者ID:ilirlikalla,项目名称:src,代码行数:24,


示例6: bptr

    void TripleBandLinearOp::axpyb(const Array& a,                                   const TripleBandLinearOp& x,                                   const TripleBandLinearOp& y,                                   const Array& b) {        const Size size = mesher_->layout()->size();        Real *diag(diag_.get());        Real *lower(lower_.get());        Real *upper(upper_.get());        const Real *y_diag (y.diag_.get());        const Real *y_lower(y.lower_.get());        const Real *y_upper(y.upper_.get());        if (a.empty()) {            if (b.empty()) {                //#pragma omp parallel for                for (Size i=0; i < size; ++i) {                    diag[i]  = y_diag[i];                    lower[i] = y_lower[i];                    upper[i] = y_upper[i];                }            }            else {                Array::const_iterator bptr(b.begin());                const Size binc = (b.size() > 1) ? 1 : 0;                //#pragma omp parallel for                for (Size i=0; i < size; ++i) {                    diag[i]  = y_diag[i] + bptr[i*binc];                    lower[i] = y_lower[i];                    upper[i] = y_upper[i];                }            }        }        else if (b.empty()) {            Array::const_iterator aptr(a.begin());            const Size ainc = (a.size() > 1) ? 1 : 0;            const Real *x_diag (x.diag_.get());            const Real *x_lower(x.lower_.get());            const Real *x_upper(x.upper_.get());            //#pragma omp parallel for            for (Size i=0; i < size; ++i) {                const Real s = aptr[i*ainc];                diag[i]  = y_diag[i]  + s*x_diag[i];                lower[i] = y_lower[i] + s*x_lower[i];                upper[i] = y_upper[i] + s*x_upper[i];            }        }        else {            Array::const_iterator bptr(b.begin());            const Size binc = (b.size() > 1) ? 1 : 0;            Array::const_iterator aptr(a.begin());            const Size ainc = (a.size() > 1) ? 1 : 0;            const Real *x_diag (x.diag_.get());            const Real *x_lower(x.lower_.get());            const Real *x_upper(x.upper_.get());            //#pragma omp parallel for            for (Size i=0; i < size; ++i) {                const Real s = aptr[i*ainc];                diag[i]  = y_diag[i]  + s*x_diag[i] + bptr[i*binc];                lower[i] = y_lower[i] + s*x_lower[i];                upper[i] = y_upper[i] + s*x_upper[i];            }        }    }
开发者ID:21hub,项目名称:QuantLib,代码行数:70,


示例7: textedit_trigger

//.........这里部分代码省略.........                    self->in->div->r.y -                    DATA->thumb_top;                v_top = (v_height * DATA->thumb_top) / DATA->height;                /* Round to full screen lines */                DATA->fd->lib->getmetrics(DATA->fd,&m);                if (v_top % m.lineheight) {                    v_top = (v_top  - v_top % m.lineheight) +                                              m.lineheight;                }                if (v_top != DATA->v_y_top) {                    DATA->scroll_lock = 1;                      text_backend_set_v_top(DATA, v_top);                    DATA->scroll_lock = 0;                  }                div_rebuild(self->in->div->div);                update(NULL,1);            }        }        break;    case PG_TRIGGER_KEYUP:        if (GET_FLAG(DATA->flags, TEXT_WIDGET_READONLY) ||            !GET_FLAG(DATA->flags, TEXT_WIDGET_FOCUS))            return;        param->kbd.consume++;        return;    case PG_TRIGGER_KEYDOWN:        if (GET_FLAG(DATA->flags, TEXT_WIDGET_READONLY) ||            !GET_FLAG(DATA->flags, TEXT_WIDGET_FOCUS))            return;        param->kbd.consume++;        key = param->kbd.key;        switch(key) {#ifdef DEBUG_TEXTEDIT         case PGKEY_F1:            print_data(DATA);            break;        case PGKEY_F2:            print_tree(DATA);            break;        case PGKEY_F3:            print_block(DATA, DATA->current);            break;#endif /* DEBUG_TEXTEDIT */        case PGKEY_RETURN:            text_backend_insert_char(DATA, '/n');            break;        case PGKEY_BACKSPACE:        case PGKEY_DELETE:            /* Screw "backspace" vs. "delete". This is my widget, and             * I say they're going to be the same thing. So, there. */            text_backend_delete_char(DATA);            break;        case PGKEY_TAB:            if (param->kbd.mods & PGMOD_SHIFT) {                /* Post event to app */                post_event(PG_WE_ACTIVATE,self,0,0,NULL);                param->kbd.consume--;                return;            } else {                text_backend_insert_char(DATA, '/t');            }            break;        case PGKEY_UP:        case PGKEY_DOWN:        case PGKEY_RIGHT:        case PGKEY_LEFT:         case PGKEY_HOME:        case PGKEY_END:        case PGKEY_PAGEUP:        case PGKEY_PAGEDOWN:             /* CURSOR_UP etc. match the PGKEY_UP etc. values */            if (param->kbd.mods & PGMOD_SHIFT)                text_backend_selection_dir(DATA, key);            else                text_backend_cursor_move_dir(DATA, key);            break;        default:            if ((key >= PGKEY_SPACE) && (key <= PGKEY_WORLD_95)) {                if (param->kbd.mods & (PGMOD_SHIFT | PGMOD_CAPS)) {                    key = upper(key);                }		/* if ctrl key is pressed*/		if (param->kbd.mods & PGMOD_CTRL) {		  text_backend_cut_copy_paste(DATA, key);		}                else {		  text_backend_insert_char(DATA, key);		}            } else {                /* Post key to app */                post_event(PG_WE_ACTIVATE,self,0,0,NULL);                param->kbd.consume--;                return;            }        }    }    textedit_draw_update(self);    //update(NULL,1);}
开发者ID:scanlime,项目名称:picogui,代码行数:101,


示例8: SciPlotReadDataFile

/* * Process a text input stream for plot commands */voidSciPlotReadDataFile(Widget parent, FILE * fd){  int count;  PlotDialogData *working;  float xlist[10], ylist[10];  int line[256], linecount = 0;  Boolean readnext;  int num, i;  working = NULL;  count = getfields(fd);  while (count > 0) {    if (count > 0) {      readnext = True;      upper(field[0]);      if (strcmp(field[0], "TITLE") == 0 || strcmp(field[0], "NEW") == 0 ) {          /* Pop up the last dialog if it exists */        if (working) SciPlotDialogInternalPopup(working);        	working = SciPlotDialogInternal(parent, field[1]);	for (i = 0; i < NUM_COLORS; i++) {	  colors_list[i].num = SciPlotAllocNamedColor(working->plot, colors_list[i].text);	}	linecount = 0;      }      else if (strcmp(field[0], "POLAR") == 0) {	Boolean degflag;	degflag = True;	if (count > 1) {	  upper(field[1]);	  if (strncmp(field[1], "RAD", 3) == 0)	    degflag = False;	}	XtVaSetValues(working->plot,	  XtNchartType, XtPOLAR,	  XtNdegrees, degflag,	  NULL);      }      else if (strcmp(field[0], "XAXIS") == 0) {	if (working) {            if (count > 1) XtVaSetValues(working->plot, XtNxLabel, field[1], NULL);            if (count>2) {                for (i=2; i<count; i++) {                    upper(field[i]);                    if (strcmp(field[i], "LOG") == 0)                        XtVaSetValues(working->plot, XtNxLog, True, NULL);                    else if (strcmp(field[i], "NOZERO") == 0)                        XtVaSetValues(working->plot, XtNxOrigin, False, NULL);                }            }        }      }      else if (strcmp(field[0], "YAXIS") == 0) {	if (working) {            if (count > 1) XtVaSetValues(working->plot, XtNyLabel, field[1], NULL);            if (count>2) {                for (i=2; i<count; i++) {                    upper(field[i]);                    if (strcmp(field[i], "LOG") == 0)                        XtVaSetValues(working->plot, XtNyLog, True, NULL);                    else if (strcmp(field[i], "NOZERO") == 0)                        XtVaSetValues(working->plot, XtNyOrigin, False, NULL);                }            }        }      }      else if (strcmp(field[0], "LEGEND") == 0) {	int colorcount, markercount, linestyle;	if (working && count > 1) {	  if (count >= 4) {	    XtVaSetValues(working->plot,	      XtNxLabel, field[2],	      XtNyLabel, field[3],	      NULL);	  }	  line[0] = SciPlotListCreateFromFloat(working->plot, 0, NULL, NULL, field[1]);	  do {	    count = getfields(fd);	    readnext = False;	    num = checkfloat(0);	    if (count > 0 && num) {	      tofloat(count);	      xlist[0] = ffield[0];	      ylist[0] = ffield[1];	      SciPlotListAddFloat(working->plot, line[0], 1, xlist, ylist);	    }	  } while (count > 0 && num);	  colorcount = linecount % NUM_COLORS;	  markercount = linecount % NUM_MARKERS;	  linestyle = -1;	  SciPlotListSetStyle(working->plot, line[0],	    colors_list[colorcount].num, marker_list[markercount].num,//.........这里部分代码省略.........
开发者ID:idunham,项目名称:dtextra,代码行数:101,


示例9: TestCaBasedSquareMonolayer

    void TestCaBasedSquareMonolayer()    {        PottsMeshGenerator<2> generator(10, 0, 0, 10, 0, 0);        PottsMesh<2>* p_mesh = generator.GetMesh();        // Scale so cells are on top of those in the above centre based tests        p_mesh->Scale(1.0,sqrt(3.0)*0.5);        // Specify where cells lie        std::vector<unsigned> location_indices;        for (unsigned i=0; i<100; i++)        {            location_indices.push_back(i);        }        std::vector<CellPtr> cells;        MAKE_PTR(DifferentiatedCellProliferativeType, p_differentiated_type);        CellsGenerator<UniformCellCycleModel, 2> cells_generator;        cells_generator.GenerateBasicRandom(cells, location_indices.size(), p_differentiated_type);        // Make cells with x<5.0 apoptotic (so no source term)        boost::shared_ptr<AbstractCellProperty> p_apoptotic_property =            cells[0]->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<ApoptoticCellProperty>();        for (unsigned i=0; i<cells.size(); i++)        {            c_vector<double,2> cell_location;            cell_location = p_mesh->GetNode(i)->rGetLocation();            if (cell_location(0) < 5.0)            {                cells[i]->AddCellProperty(p_apoptotic_property);            }            // Set initial condition for PDE            cells[i]->GetCellData()->SetItem("variable",1.0);        }        TS_ASSERT_EQUALS(p_apoptotic_property->GetCellCount(), 50u);        CaBasedCellPopulation<2> cell_population(*p_mesh, cells, location_indices);        // Set up simulation time for file output        SimulationTime::Instance()->SetEndTimeAndNumberOfTimeSteps(1.0, 10);        // Create PDE and boundary condition objects        MAKE_PTR_ARGS(AveragedSourceParabolicPde<2>, p_pde, (cell_population, 0.1, 1.0, -1.0));        MAKE_PTR_ARGS(ConstBoundaryCondition<2>, p_bc, (1.0));        // Create a ChasteCuboid on which to base the finite element mesh used to solve the PDE        ChastePoint<2> lower(-5.0, -5.0);        ChastePoint<2> upper(15.0, 15.0);        MAKE_PTR_ARGS(ChasteCuboid<2>, p_cuboid, (lower, upper));        // Create a PDE modifier and set the name of the dependent variable in the PDE        MAKE_PTR_ARGS(ParabolicBoxDomainPdeModifier<2>, p_pde_modifier, (p_pde, p_bc, false, p_cuboid));        p_pde_modifier->SetDependentVariableName("variable");        // For coverage, output the solution gradient        p_pde_modifier->SetOutputGradient(true);        p_pde_modifier->SetupSolve(cell_population,"TestAveragedParabolicPdeWithNodeOnSquare");        // Run for 10 time steps        for (unsigned i=0; i<10; i++)        {            SimulationTime::Instance()->IncrementTimeOneStep();            p_pde_modifier->UpdateAtEndOfTimeStep(cell_population);            p_pde_modifier->UpdateAtEndOfOutputTimeStep(cell_population);        }        // Test the solution at some fixed points to compare with other cell populations        CellPtr p_cell_0 = cell_population.GetCellUsingLocationIndex(0);        TS_ASSERT_DELTA(cell_population.GetLocationOfCellCentre(p_cell_0)[0], 0, 1e-4);        TS_ASSERT_DELTA(cell_population.GetLocationOfCellCentre(p_cell_0)[1], 0.0, 1e-4);        TS_ASSERT_DELTA( p_cell_0->GetCellData()->GetItem("variable"), 0.8513, 2e-2); // Low tolerance as mesh is slightly larger than for off-lattice models        // Checking it doesn't change for this cell population        TS_ASSERT_DELTA(p_cell_0->GetCellData()->GetItem("variable"), 0.8343, 1e-4);    }
开发者ID:Chaste,项目名称:Chaste,代码行数:75,


示例10: TestArchiveParabolicBoxDomainPdeModifier

    void TestArchiveParabolicBoxDomainPdeModifier()    {        // Create a file for archiving        OutputFileHandler handler("archive", false);        handler.SetArchiveDirectory();        std::string archive_filename = handler.GetOutputDirectoryFullPath() + "ParabolicBoxDomainPdeModifier.arch";        // Separate scope to write the archive        {            // Create PDE and boundary condition objects            MAKE_PTR_ARGS(UniformSourceParabolicPde<2>, p_pde, (-0.1));            MAKE_PTR_ARGS(ConstBoundaryCondition<2>, p_bc, (1.0));            // Create a ChasteCuboid on which to base the finite element mesh used to solve the PDE            ChastePoint<2> lower(-10.0, -10.0);            ChastePoint<2> upper(10.0, 10.0);            MAKE_PTR_ARGS(ChasteCuboid<2>, p_cuboid, (lower, upper));            // Create a PDE modifier and set the name of the dependent variable in the PDE            std::vector<double> data(10);            for (unsigned i=0; i<10; i++)            {                data[i] = i + 0.45;            }            Vec vector = PetscTools::CreateVec(data);            ParabolicBoxDomainPdeModifier<2> modifier(p_pde, p_bc, false, p_cuboid, 2.0, vector);            modifier.SetDependentVariableName("averaged quantity");            // Create an output archive            std::ofstream ofs(archive_filename.c_str());            boost::archive::text_oarchive output_arch(ofs);            // Serialize via pointer            AbstractCellBasedSimulationModifier<2,2>* const p_modifier = &modifier;            output_arch << p_modifier;        }        // Separate scope to read the archive        {            AbstractCellBasedSimulationModifier<2,2>* p_modifier2;            // Restore the modifier            std::ifstream ifs(archive_filename.c_str());            boost::archive::text_iarchive input_arch(ifs);            input_arch >> p_modifier2;            // Test that member variables are correct            TS_ASSERT_EQUALS((static_cast<ParabolicBoxDomainPdeModifier<2>*>(p_modifier2))->rGetDependentVariableName(), "averaged quantity");            TS_ASSERT_DELTA((static_cast<ParabolicBoxDomainPdeModifier<2>*>(p_modifier2))->GetStepSize(), 2.0, 1e-5);            TS_ASSERT_EQUALS((static_cast<ParabolicBoxDomainPdeModifier<2>*>(p_modifier2))->AreBcsSetOnBoxBoundary(), true);            Vec solution = (static_cast<ParabolicBoxDomainPdeModifier<2>*>(p_modifier2))->GetSolution();            ReplicatableVector solution_repl(solution);            TS_ASSERT_EQUALS(solution_repl.GetSize(), 10u);            for (unsigned i=0; i<10; i++)            {                TS_ASSERT_DELTA(solution_repl[i], i + 0.45, 1e-6);            }            delete p_modifier2;        }    }
开发者ID:Chaste,项目名称:Chaste,代码行数:64,


示例11: b2Assert

void b2VoronoiDiagram::Generate(float32 radius){	b2Assert(m_diagram == NULL);	float32 inverseRadius = 1 / radius;	b2Vec2 lower(+b2_maxFloat, +b2_maxFloat);	b2Vec2 upper(-b2_maxFloat, -b2_maxFloat);	for (int32 k = 0; k < m_generatorCount; k++)	{		Generator& g = m_generatorBuffer[k];		lower = b2Min(lower, g.center);		upper = b2Max(upper, g.center);	}	m_countX = 1 + (int32) (inverseRadius * (upper.x - lower.x));	m_countY = 1 + (int32) (inverseRadius * (upper.y - lower.y));	m_diagram = (Generator**)		m_allocator->Allocate(sizeof(Generator*) * m_countX * m_countY);	for (int32 i = 0; i < m_countX * m_countY; i++)	{		m_diagram[i] = NULL;	}	b2StackQueue<b2VoronoiDiagramTask> queue(		m_allocator, 4 * m_countX * m_countX);	for (int32 k = 0; k < m_generatorCount; k++)	{		Generator& g = m_generatorBuffer[k];		g.center = inverseRadius * (g.center - lower);		int32 x = b2Max(0, b2Min((int32) g.center.x, m_countX - 1));		int32 y = b2Max(0, b2Min((int32) g.center.y, m_countY - 1));		queue.Push(b2VoronoiDiagramTask(x, y, x + y * m_countX, &g));	}	while (!queue.Empty())	{		int32 x = queue.Front().m_x;		int32 y = queue.Front().m_y;		int32 i = queue.Front().m_i;		Generator* g = queue.Front().m_generator;		queue.Pop();		if (!m_diagram[i])		{			m_diagram[i] = g;			if (x > 0)			{				queue.Push(b2VoronoiDiagramTask(x - 1, y, i - 1, g));			}			if (y > 0)			{				queue.Push(b2VoronoiDiagramTask(x, y - 1, i - m_countX, g));			}			if (x < m_countX - 1)			{				queue.Push(b2VoronoiDiagramTask(x + 1, y, i + 1, g));			}			if (y < m_countY - 1)			{				queue.Push(b2VoronoiDiagramTask(x, y + 1, i + m_countX, g));			}		}	}	int32 maxIteration = m_countX + m_countY;	for (int32 iteration = 0; iteration < maxIteration; iteration++)	{		for (int32 y = 0; y < m_countY; y++)		{			for (int32 x = 0; x < m_countX - 1; x++)			{				int32 i = x + y * m_countX;				Generator* a = m_diagram[i];				Generator* b = m_diagram[i + 1];				if (a != b)				{					queue.Push(b2VoronoiDiagramTask(x, y, i, b));					queue.Push(b2VoronoiDiagramTask(x + 1, y, i + 1, a));				}			}		}		for (int32 y = 0; y < m_countY - 1; y++)		{			for (int32 x = 0; x < m_countX; x++)			{				int32 i = x + y * m_countX;				Generator* a = m_diagram[i];				Generator* b = m_diagram[i + m_countX];				if (a != b)				{					queue.Push(b2VoronoiDiagramTask(x, y, i, b));					queue.Push(b2VoronoiDiagramTask(x, y + 1, i + m_countX, a));				}			}		}		bool updated = false;		while (!queue.Empty())		{			int32 x = queue.Front().m_x;			int32 y = queue.Front().m_y;			int32 i = queue.Front().m_i;			Generator* k = queue.Front().m_generator;			queue.Pop();			Generator* a = m_diagram[i];			Generator* b = k;			if (a != b)//.........这里部分代码省略.........
开发者ID:Downfy,项目名称:liquidfun,代码行数:101,


示例12: diag

void Foam::lduMatrix::operator-=(const lduMatrix& A){    if (A.diagPtr_)    {        diag() -= A.diag();    }    if (symmetric() && A.symmetric())    {        upper() -= A.upper();    }    else if (symmetric() && A.asymmetric())    {        if (upperPtr_)        {            lower();        }        else        {            upper();        }        upper() -= A.upper();        lower() -= A.lower();    }    else if (asymmetric() && A.symmetric())    {        if (A.upperPtr_)        {            lower() -= A.upper();            upper() -= A.upper();        }        else        {            lower() -= A.lower();            upper() -= A.lower();        }    }    else if (asymmetric() && A.asymmetric())    {        lower() -= A.lower();        upper() -= A.upper();    }    else if (diagonal())    {        if (A.upperPtr_)        {            upper() = -A.upper();        }        if (A.lowerPtr_)        {            lower() = -A.lower();        }    }    else if (A.diagonal())    {    }    else    {        if (debug > 1)        {            WarningIn("lduMatrix::operator-=(const lduMatrix& A)")                << "Unknown matrix type combination" << nl                << "    this :"                << " diagonal:" << diagonal()                << " symmetric:" << symmetric()                << " asymmetric:" << asymmetric() << nl                << "    A    :"                << " diagonal:" << A.diagonal()                << " symmetric:" << A.symmetric()                << " asymmetric:" << A.asymmetric()                << endl;        }    }}
开发者ID:CFD-worker,项目名称:OpenFOAM-2.3.x,代码行数:77,


示例13: lduAddr

void Foam::BlockLduMatrix<Type>::segregateB(    TypeField& sMul,    const TypeField& x) const{    typedef typename TypeCoeffField::linearType linearType;    typedef typename TypeCoeffField::squareType squareType;    typedef typename TypeCoeffField::linearTypeField linearTypeField;    typedef typename TypeCoeffField::squareTypeField squareTypeField;    const unallocLabelList& u = lduAddr().upperAddr();    const unallocLabelList& l = lduAddr().lowerAddr();    // Diagonal multiplication    if (thereIsDiag())    {        if (diag().activeType() == blockCoeffBase::SQUARE)        {            const squareTypeField& activeDiag = this->diag().asSquare();            linearTypeField lf(activeDiag.size());            squareTypeField sf(activeDiag.size());            // Expand and contract            contractLinear(lf, activeDiag);            expandLinear(sf, lf);            sMul -= (activeDiag - sf) & x;        }    }    // Lower multiplication    if (thereIsLower())    {        if (lower().activeType() == blockCoeffBase::SQUARE)        {            const squareTypeField& activeLower = this->lower().asSquare();            // Auxiliary variables used in expand/contract            linearType lt;            squareType st;            for (register label coeffI = 0; coeffI < u.size(); coeffI++)            {                contractLinear(lt, activeLower[coeffI]);                expandLinear(st, lt);                sMul[u[coeffI]] -= (activeLower[coeffI] - st) & x[l[coeffI]];            }        }    }    // Upper multiplication    if (thereIsUpper())    {        if (upper().activeType() == blockCoeffBase::SQUARE)        {            const squareTypeField& activeUpper = this->upper().asSquare();            // Auxiliary variables used in expand/contract            linearType lt;            squareType st;            for (register label coeffI = 0; coeffI < u.size(); coeffI++)            {                contractLinear(lt, activeUpper[coeffI]);                expandLinear(st, lt);                sMul[l[coeffI]] -= (activeUpper[coeffI] - st) & x[u[coeffI]];            }            // If the matrix is symmetric, the lower triangular product            // is also needed            if (symmetric())            {                for (register label coeffI = 0; coeffI < u.size(); coeffI++)                {                    // Use transpose upper coefficient                    contractLinear(lt, activeUpper[coeffI]);                    expandLinear(st, lt);                    sMul[u[coeffI]] -=                        (activeUpper[coeffI].T() - st) & x[l[coeffI]];                }            }        }    }}
开发者ID:CFMS,项目名称:foam-extend-foam-extend-3.2,代码行数:90,


示例14: PrepareDiskPath

// Косметические преобразования строки пути.// CheckFullPath используется в FCTL_SET[ANOTHER]PANELDIRvoid PrepareDiskPath(string &strPath, bool CheckFullPath){	// elevation not required during cosmetic operation	SCOPED_ACTION(elevation::suppress);	if (!strPath.empty())	{		if (strPath.size() > 1 && (strPath[1]==L':' || (IsSlash(strPath[0]) && IsSlash(strPath[1]))))		{			ReplaceSlashToBackslash(strPath);			bool DoubleSlash = strPath[1]==L'//';			while(ReplaceStrings(strPath, L"////"sv, L"//"sv))				;			if(DoubleSlash)			{				strPath = L'//' + strPath;			}			if (CheckFullPath)			{				strPath = ConvertNameToFull(strPath);				size_t DirOffset = 0;				const auto Type = ParsePath(strPath, &DirOffset);				if (Type == root_type::unknown && HasPathPrefix(strPath))				{					DirOffset = 4;				}				size_t StartPos = DirOffset;				if (StartPos < strPath.size())				{					string TmpStr;					TmpStr.reserve(strPath.size());					size_t LastPos = StartPos;					const auto EndsWithSlash = IsSlash(strPath.back());					for (size_t i = StartPos; i <= strPath.size(); ++i)					{						if ((i < strPath.size() && IsSlash(strPath[i])) || (i == strPath.size() && !EndsWithSlash))						{							TmpStr.assign(strPath, 0, i);							os::fs::find_data fd;							if (os::fs::get_find_data(TmpStr, fd))							{								strPath.replace(LastPos, i - LastPos, fd.FileName);								i += fd.FileName.size() - (i - LastPos);							}							if (i != strPath.size())							{								LastPos = i + 1;							}						}					}				}			}			if (ParsePath(strPath) == root_type::drive_letter)			{				strPath[0] = upper(strPath[0]);			}		}	}}
开发者ID:johnd0e,项目名称:farmanager,代码行数:69,


示例15: do_menu

//.........这里部分代码省略.........        visible=min(height,numlist);        currenty=0;        /* print the entries */        for (i=0; i<visible; i++)        {            menuw->xpos=DLOGX;            menuw->ypos=i+1;            wprint_str(list[i]);        }k:        if (visible)            light_line(currenty,(word)(currentx+1),(word)(width-currentx-1));        else            light_line(currenty,1,(word)(width-1));        ev=get_event(&key,&mx,&my);        if (visible)            light_line(currenty,(word)(currentx+1),(word)(width-currentx-1));        else            light_line(currenty,1,(word)(width-1));        if (ev&EV_CLICK)        {            word w;            ubyte edge;            if (visible)            {                w=which_window(&mx,&my,&edge);                if ( (w==num) && (edge==0) && (my<=visible) )                {                    if (key)                    {   /* a double-click */                        key=KEY_RETURN;                        break;                    }                    currenty=--my;                    goto k;                }            }        }        if (ev&EV_KEY)        {            if ( (key==KEY_UP) && (currenty) && visible )            {                currenty--;                goto k;            }            if ( (key==KEY_DOWN) && visible && (currenty<(visible-1)) )            {                currenty++;                goto k;            }            if ( (key==KEY_RETURN) || (key==KEY_ENTER) || (key==KEY_ESC) )                break;            if (reload)            {                if (key==KEY_BACKSPACE)                {                    if (currentx)                        menu_so_far[--currentx]=0;                }                else if (key==KEY_CLEAR)                {                    menu_so_far[currentx=0]=0;                }                else if (key&0xFF)                {                    if (currentx<MAXMENUWIDTH)                        menu_so_far[currentx++]=upper((char)key);                    menu_so_far[currentx]=0;                }                else                    goto k;                if ( (reload)(menu_so_far,&numlist) )                {                    window_cls(menuw);                    update_contents(menuw);                    goto p;                }                else                    goto k;            }        }        goto k;    }    /* like close_dialog */    remove_wlist(menuw);    menuw->open=FALSE;    /* restore correct view of world */    recalc_frontback();    /* and redraw this new place */    update_rectangle(menuw->x, menuw->y, (word)(menuw->x+menuw->w),                     (word)(menuw->y+menuw->h) );    *result=( (key==KEY_ESC) || (visible==0) )            ? -2 : currenty;    return 0;}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:101,


示例16: dpb_list_add_item

void	dpb_list_add_item(DPB_list *list,char *description, char *ident, DPB_type *dpb){	DPB_list_entry *entry = (DPB_list_entry *)malloc(sizeof(DPB_list_entry));	if (entry!=NULL)	{		if (description==NULL)		{			entry->description = NULL;		}		else		{			entry->description = (char *)malloc(strlen(description)+1);			if (entry->description!=NULL)			{				strcpy(entry->description, description);			}		}		if (ident==NULL)		{			entry->ident = NULL;		}		else		{			entry->ident = (char *)malloc(strlen(ident)+1);			if (entry->ident!=NULL)			{				strcpy(entry->ident, ident);				upper(entry->ident);			}		}		/* copy dpb */		memcpy(&entry->dpb, dpb, sizeof(DPB_type));		/* if cylinders is 40, but used in a 80 track drive, then the drive		head is automatically double stepped */		/* want to use cylinders from .def because this is good for discs		where only 60 tracks are used */#if 0		/* The 22disk definition uses CYLINDERS to define, from what I can		see the physical number of tracks on the disc media. So, you can		have a 80 track 5.25" drive reading a 40 track format with		or without double step - calculate a decent TRKS from DSM		which specifies the total number of blocks on the disc. */		{			DPB_type *dpb = &entry->dpb;			dpb->BLS  = 1 << (dpb->BSH + 7); /* or 2^BSH*128 */			/* calculate the number of tracks from DSM */			dpb->TRKS = (((dpb->DSM+1)*dpb->BLS)+(dpb->OFS*dpb->SECS*dpb->BPS) + ((dpb->DRM+1)<<5))/(dpb->SECS*dpb->BPS*dpb->HDS);		}#endif		entry->next = NULL;	}	dpb_list_add_entry(list, entry);}
开发者ID:mp-lee,项目名称:HxCFloppyEmulator,代码行数:64,


示例17: Aabb

	Aabb(const Point<> &llo, const Point<> &uup) {		lower(llo);		upper(uup);	}
开发者ID:institution,项目名称:_qq,代码行数:4,


示例18: TBOX_ASSERT

voidStokes::V_Coarsen_Patch_Strategy::postprocessCoarsen_2D(SAMRAI::hier::Patch& coarse, const SAMRAI::hier::Patch& fine, const SAMRAI::hier::Box& , const SAMRAI::hier::IntVector& ){  /* Fix up the boundary elements by iterating through the boundary     boxes */  /* We only care about edges, not corners, so we only iterate over     edge boundary boxes. */  const std::vector<SAMRAI::hier::BoundaryBox>    &boundaries=coarse_fine[fine.getPatchLevelNumber()]->getEdgeBoundaries(coarse.getGlobalId());       boost::shared_ptr<SAMRAI::pdat::SideData<double> > v_fine =    boost::dynamic_pointer_cast<SAMRAI::pdat::SideData<double> >    (fine.getPatchData(v_id));  boost::shared_ptr<SAMRAI::pdat::SideData<double> > v =    boost::dynamic_pointer_cast<SAMRAI::pdat::SideData<double> >    (coarse.getPatchData(v_id));  TBOX_ASSERT(v);  TBOX_ASSERT(v_fine);  TBOX_ASSERT(v_fine->getDepth() == v->getDepth());  TBOX_ASSERT(v->getDepth() == 1);  SAMRAI::hier::Box gbox(v_fine->getGhostBox());  SAMRAI::hier::Index ip(1,0), jp(0,1);  for(size_t mm=0; mm<boundaries.size(); ++mm)    {      SAMRAI::hier::Box bbox=boundaries[mm].getBox();      int location_index=boundaries[mm].getLocationIndex();      SAMRAI::hier::Index        lower=SAMRAI::hier::Index::coarsen(bbox.lower(),                                           SAMRAI::hier::Index(2,2)),        upper=SAMRAI::hier::Index::coarsen(bbox.upper(),                                           SAMRAI::hier::Index(2,2));      for(int j=lower(1); j<=upper(1); ++j)        for(int i=lower(0); i<=upper(0); ++i)          {            /* Fix vx */            if(location_index==0)              {                SAMRAI::pdat::SideIndex coarse(SAMRAI::hier::Index(i,j),0,                                               SAMRAI::pdat::SideIndex::Upper);                SAMRAI::pdat::SideIndex center(coarse*2);                if(center[1]>=gbox.lower(1) && center[1]<gbox.upper(1))                  {                    (*v)(coarse)=((*v_fine)(center) + (*v_fine)(center+jp))/2;                  }              }            else if(location_index==1)              {                SAMRAI::pdat::SideIndex coarse(SAMRAI::hier::Index(i,j),0,                                               SAMRAI::pdat::SideIndex::Lower);                SAMRAI::pdat::SideIndex center(coarse*2);                if(center[1]>=gbox.lower(1) && center[1]<gbox.upper(1))                  {                    (*v)(coarse)=((*v_fine)(center) + (*v_fine)(center+jp))/2;                  }              }            /* Fix vy */            else if(location_index==2)              {                SAMRAI::pdat::SideIndex coarse(SAMRAI::hier::Index(i,j),1,                                               SAMRAI::pdat::SideIndex::Upper);                SAMRAI::pdat::SideIndex center(coarse*2);                if(center[0]>=gbox.lower(0) && center[0]<gbox.upper(0))                  {                    (*v)(coarse)=((*v_fine)(center) + (*v_fine)(center+ip))/2;                  }              }            else if(location_index==3)              {                SAMRAI::pdat::SideIndex coarse(SAMRAI::hier::Index(i,j),1,                                               SAMRAI::pdat::SideIndex::Lower);                SAMRAI::pdat::SideIndex center(coarse*2);                if(center[0]>=gbox.lower(0) && center[0]<gbox.upper(0))                  {                    (*v)(coarse)=((*v_fine)(center) + (*v_fine)(center+ip))/2;                  }              }            else              {                abort();              }          }    }}
开发者ID:cageo,项目名称:Landry-2016,代码行数:92,


示例19: searchRange

 vector<int> searchRange(vector<int> &A, int target) {     return {lower(A, target), upper(A, target)}; }
开发者ID:WeikangChen,项目名称:algorithm,代码行数:3,


示例20: TestNodeBasedSquareMonolayer

    void TestNodeBasedSquareMonolayer()    {        HoneycombMeshGenerator generator(10,10,0);        MutableMesh<2,2>* p_generating_mesh = generator.GetMesh();        NodesOnlyMesh<2>* p_mesh = new NodesOnlyMesh<2>;        p_mesh->ConstructNodesWithoutMesh(*p_generating_mesh, 1.5);        std::vector<CellPtr> cells;        MAKE_PTR(DifferentiatedCellProliferativeType, p_differentiated_type);        CellsGenerator<UniformCellCycleModel, 2> cells_generator;        cells_generator.GenerateBasicRandom(cells, p_mesh->GetNumNodes(), p_differentiated_type);        // Make cells with x<5.0 apoptotic (so no source term)        boost::shared_ptr<AbstractCellProperty> p_apoptotic_property =                        cells[0]->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<ApoptoticCellProperty>();        for (unsigned i=0; i<cells.size(); i++)        {            c_vector<double,2> cell_location;            cell_location = p_mesh->GetNode(i)->rGetLocation();            if (cell_location(0) < 5.0)            {                cells[i]->AddCellProperty(p_apoptotic_property);            }            // Set initial condition for PDE            cells[i]->GetCellData()->SetItem("variable",1.0);        }        TS_ASSERT_EQUALS(p_apoptotic_property->GetCellCount(), 50u);        NodeBasedCellPopulation<2> cell_population(*p_mesh, cells);        // Set up simulation time for file output        SimulationTime::Instance()->SetEndTimeAndNumberOfTimeSteps(1.0, 10);        // Create PDE and boundary condition objects        MAKE_PTR_ARGS(AveragedSourceParabolicPde<2>, p_pde, (cell_population, 0.1, 1.0, -1.0));        MAKE_PTR_ARGS(ConstBoundaryCondition<2>, p_bc, (1.0));        // Create a ChasteCuboid on which to base the finite element mesh used to solve the PDE        ChastePoint<2> lower(-5.0, -5.0);        ChastePoint<2> upper(15.0, 15.0);        MAKE_PTR_ARGS(ChasteCuboid<2>, p_cuboid, (lower, upper));        // Create a PDE modifier and set the name of the dependent variable in the PDE        MAKE_PTR_ARGS(ParabolicBoxDomainPdeModifier<2>, p_pde_modifier, (p_pde, p_bc, false, p_cuboid));        p_pde_modifier->SetDependentVariableName("variable");        // For coverage, output the solution gradient        p_pde_modifier->SetOutputGradient(true);        p_pde_modifier->SetupSolve(cell_population,"TestAveragedParabolicPdeWithNodeOnSquare");        // Run for 10 time steps        for (unsigned i=0; i<10; i++)        {            SimulationTime::Instance()->IncrementTimeOneStep();            p_pde_modifier->UpdateAtEndOfTimeStep(cell_population);            p_pde_modifier->UpdateAtEndOfOutputTimeStep(cell_population);        }        // Test the solution at some fixed points to compare with other cell populations        CellPtr p_cell_0 = cell_population.GetCellUsingLocationIndex(0);        TS_ASSERT_DELTA(cell_population.GetLocationOfCellCentre(p_cell_0)[0], 0, 1e-4);        TS_ASSERT_DELTA(cell_population.GetLocationOfCellCentre(p_cell_0)[1], 0.0, 1e-4);        TS_ASSERT_DELTA( p_cell_0->GetCellData()->GetItem("variable"), 0.8513, 1e-4);        // Clear memory        delete p_mesh;    }
开发者ID:Chaste,项目名称:Chaste,代码行数:67,


示例21: call21h

void call21h(){	/*	 * 对21h 中的功能号进行测试	 */	while(1)	{		cls();		print("/r/n         Now, you can run some commands to test the 21h:/n/n/r");		print("        1.ouch  -- to ouch          2.upper -- change the letter to upper/n/r");		print("        3.lower         -- change the letter to lower/n/r"); 		print("        4.to_digit      -- change the string to digit/r/n"); 		print("        5.to_string     -- change the digit to string/r/n"); 		print("        6.display_where -- you can assign where to display/r/n");		print("        7.to_deci      -- change the Hex to a decimal digit/r/n"); 		print("        8.reverse      -- to reverse your string/r/n"); 		print("        9.strlen      --  get the length of your string/r/n"); 		print("        10.quit          -- just to quit/r/n/r/n"); 		print("Please input your choice:"); 		getline(input,20);	    if(strcmp(input,"1") || strcmp(input,"ouch"))		{			/*			 * 测试 0 号功能			 */			to_OUCH();		}	    else if(strcmp(input,"2") || strcmp(input,"upper"))		{			/*			 * 测试 1 号功能			 */			while(1)			{				print("/r/nPlease input a sentence or quit to back:");				getline(input,30);				if(strcmp(input,"quit")) break;				upper(input);				print("/r/nThe upper case is:");				print(input);				print("/r/n");			}		}	    else if(strcmp(input,"3") || strcmp(input,"lower"))		{			/*			 * 测试 2 号功能			 */		    while(1)			{				print("/r/nPlease input a sentence or quit to back:");				getline(input,30);				if(strcmp(input,"quit")) break;				lower(input);				print("/r/nThe lower case is:");				print(input);				print("/r/n");			}		}	    else if(strcmp(input,"4") || strcmp(input,"to_digit"))		{			/*			 * 测试 3 号功能			 */			print("/r/nDo you want to continue? Y | N :");			getline(input,2);			while(1)			{				int t1,t2,t3;				t1 = 0;t2 = 0;				if(strcmp(input,"n") || strcmp(input,"N")) break;				print("/r/nPlease input the first digit:");				getline(input,4);				if(isDigit(input))				{				    t1 = digital(input);				}				else 				{					print("/r/nInvalid digit!We assume it is 12/n/r");					t1 = 12;				}				print("/r/nPlease input the second digit:");				getline(input,4);				if(isDigit(input))				{					t2 = digital(input);				}				else 				{					print("/r/nInvalid digit!We assume it is 21/n/r");					t2 = 21;				}				print("/r/nThe sum of the them is:");				t3 = t1 + t2;				printInt(t3);				print("/r/n");				print("/r/nDo you want to continue? Y | N :");				getline(input,2);			}//.........这里部分代码省略.........
开发者ID:AngryHacker,项目名称:OS_Lab,代码行数:101,


示例22: parse_symbol

/* takes care with symbols ending in .bwl or .bb/ww/ll */word parse_symbol(void *result,bool getaddr, byte *etype){char *p;void *value;byte ssize;word err;ubyte len; char size;/*	if (!isalpha(*ev))		already done for us		return ERRM_INVALIDSYM;	*/	p=ev++;	while (issym(*ev))		ev++;	if (issymend(*ev))		ev++;	len=(ubyte)(ev-p);		if ( (len>2) && (*(ev-2)=='.') )		{		size=upper(*(ev-1));		if ( (size=='B') || (size=='W') || (size=='L') )			{			ev-=2;			len-=2;			}		}	else if ( (len>3) && (*(ev-3)=='.') )		{		size=upper(*(ev-1));		if (			( (size=='B') || (size=='W') || (size=='L') ) &&				(upper(*(ev-2))==size)		   )			{			ev-=3;			len-=3;			}		}	/* try general table */	if (!checking)		{		must( find_general_sym(p,len,&value,&ssize,getaddr) );		#if DOUBLES		if (ssize<EXPR_NOTINT)			{			must( coerce_value(value,ssize,result,EXPR_LONG) );			*etype=E_NUMBER;			}		else			{			*(double*)result=				ssize==EXPR_DOUBLE ?					*(double*)value : *(float*)value;		/* cope with singles & doubles */			*etype=E_DBLNUMBER;			}		#else		must( coerce_value(value,ssize,result,EXPR_LONG) );		*etype=E_NUMBER;		#endif		}	else		{		*etype=E_NUMBER;		}	return 0;}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:66,


示例23: oracle_set_key

static void oracle_set_key(char *key, int index) {	key_length = 0;	while( (cur_key[key_length] = upper(key[key_length]) ENDIAN_SHIFT_L ))		key_length++;	key_length <<= 1;}
开发者ID:earthquake,项目名称:GI-John,代码行数:6,


示例24: fix

BOOST_AUTO_TEST_CASE_TEMPLATE( test_mapping_upper_bound, Tp, quad_maps ){  { // find the smallest element that is greater than key    Tp fix(100, randomize(-2, 2));    quad lower (-3, -3, -3, -3);    quad in (-1, -1, -1, -1);    quad upper (1, 1, 1, 1);    for (dimension_type mapping_dim = 0; mapping_dim < 4;         ++mapping_dim)      {        mapping_iterator<typename Tp::container_type>          iter (mapping_upper_bound(fix.container, mapping_dim, in));        BOOST_CHECK(iter == mapping_end(fix.container, mapping_dim)                    || quad_less()(mapping_dim, in, iter->first));        BOOST_CHECK(iter == mapping_begin(fix.container, mapping_dim)                    || !quad_less()(mapping_dim, (--iter)->first, in));        iter = mapping_upper_bound(fix.container, mapping_dim, lower);        BOOST_CHECK(iter == mapping_begin(fix.container, mapping_dim));        iter = mapping_upper_bound(fix.container, mapping_dim, upper);        BOOST_CHECK(iter == mapping_end(fix.container, mapping_dim));      }  }  { // same test with a tree filled with similar values    Tp fix(100, same());    quad lower (99, 99, 99, 99);    quad in (100, 100, 100, 100);    quad upper (101, 101, 101, 101);    for (dimension_type mapping_dim = 0; mapping_dim < 4;         ++mapping_dim)      {        mapping_iterator<typename Tp::container_type>          iter (mapping_upper_bound(fix.container, mapping_dim, lower));        BOOST_CHECK(iter == mapping_begin(fix.container, mapping_dim));        iter = mapping_upper_bound(fix.container, mapping_dim, in);        BOOST_CHECK(iter == mapping_end(fix.container, mapping_dim));        iter = mapping_upper_bound(fix.container, mapping_dim, upper);        BOOST_CHECK(iter == mapping_end(fix.container, mapping_dim));      }  }  { // test at the limit: tree with 1 value    Tp fix(1, same());    quad lower (0, 0, 0, 0);    quad in (1, 1, 1, 1);    quad upper (2, 2, 2, 2);    for (dimension_type mapping_dim = 0; mapping_dim < 4;         ++mapping_dim)      {        mapping_iterator<const typename Tp::container_type>          iter (mapping_cupper_bound(fix.container, mapping_dim, lower));        BOOST_CHECK(iter == mapping_cbegin(fix.container, mapping_dim));        iter = mapping_cupper_bound(fix.container, mapping_dim, in);        BOOST_CHECK(iter == mapping_cend(fix.container, mapping_dim));        iter = mapping_cupper_bound(fix.container, mapping_dim, upper);        BOOST_CHECK(iter == mapping_cend(fix.container, mapping_dim));      }  }  { // test at the limit: tree filled with decreasing values    Tp fix(100, decrease()); // first (100, 100, 100, 100), last (1, 1, 1, 1)    quad lower(0, 0, 0, 0);    quad in (99, 99, 99, 99);    quad upper(100, 100, 100, 100);    for (dimension_type mapping_dim = 0; mapping_dim < 4;         ++mapping_dim)      {        mapping_iterator<typename Tp::container_type>          iter (mapping_upper_bound(fix.container, mapping_dim, lower));        BOOST_CHECK(iter == mapping_begin(fix.container, mapping_dim));        iter = mapping_upper_bound(fix.container, mapping_dim, in);        BOOST_CHECK(iter != mapping_end(fix.container, mapping_dim)                    && ++iter == mapping_end(fix.container, mapping_dim));        iter = mapping_upper_bound(fix.container, mapping_dim, upper);        BOOST_CHECK(iter == mapping_end(fix.container, mapping_dim));      }  }  { // test at the limit: tree filled with increasing values    Tp fix(100, increase()); // first (0, 0, 0, 0), last (99, 99, 99, 99)    quad lower(-1, -1, -1, -1);    quad in(98, 98, 98, 98);    quad upper (99, 99, 99, 99);    for (dimension_type mapping_dim = 0; mapping_dim < 4;         ++mapping_dim)      {        mapping_iterator<typename Tp::container_type>          iter (mapping_upper_bound(fix.container, mapping_dim, lower));        BOOST_CHECK(iter == mapping_begin(fix.container, mapping_dim));        iter = mapping_upper_bound(fix.container, mapping_dim, in);        BOOST_CHECK(iter != mapping_end(fix.container, mapping_dim)                    && ++iter == mapping_end(fix.container, mapping_dim));        iter = mapping_upper_bound(fix.container, mapping_dim, upper);        BOOST_CHECK(iter == mapping_end(fix.container, mapping_dim));      }  }}
开发者ID:sbougerel,项目名称:spatial,代码行数:94,


示例25: diag

void Foam::lduMatrix::operator-=(const lduMatrix& A){    if (A.diagPtr_)    {        diag() -= A.diag();    }    if (symmetric() && A.symmetric())    {        upper() -= A.upper();    }    else if (symmetric() && A.asymmetric())    {        if (upperPtr_)        {            lower();        }        else        {            upper();        }        upper() -= A.upper();        lower() -= A.lower();    }    else if (asymmetric() && A.symmetric())    {        if (A.upperPtr_)        {            lower() -= A.upper();            upper() -= A.upper();        }        else        {            lower() -= A.lower();            upper() -= A.lower();        }    }    else if (asymmetric() && A.asymmetric())    {        lower() -= A.lower();        upper() -= A.upper();    }    else if (diagonal())    {        if (A.upperPtr_)        {            upper() = -A.upper();        }        if (A.lowerPtr_)        {            lower() = -A.lower();        }    }    else if (A.diagonal())    {    }    else    {        FatalErrorIn("lduMatrix::operator-=(const lduMatrix& A)")            << "Unknown matrix type combination"            << abort(FatalError);    }}
开发者ID:Brzous,项目名称:WindFOAM,代码行数:66,


示例26: m

void IconCanvas::menu(const QPoint&) {  Q3PopupMenu m(0);    m.insertItem(new MenuTitle(browser_node->get_name() + TR("/nshort cut"), m.font()), -1);  m.insertSeparator();  m.insertItem(TR("Upper"), 0);  m.insertItem(TR("Lower"), 1);  m.insertItem(TR("Go up"), 6);  m.insertItem(TR("Go down"), 7);  m.insertSeparator();  if (! browser_node->deletedp()) {    m.insertItem(TR("Open"), 2);    m.insertSeparator();  }  m.insertItem(TR("Select diagram in browser"), 3);  m.insertItem(TR("Select linked items"), 4);  m.insertSeparator();  m.insertItem(TR("Remove from diagram"),5);  switch (m.exec(QCursor::pos())) {  case 0:    upper();    // force son reaffichage    hide();    show();    canvas()->update();    break;  case 1:    lower();    // force son reaffichage    hide();    show();    canvas()->update();    break;  case 6:    z_up();    // force son reaffichage    hide();    show();    canvas()->update();    break;  case 7:    z_down();    // force son reaffichage    hide();    show();    canvas()->update();    break;  case 2:    browser_node->open(FALSE);    return;  case 3:    browser_node->select_in_browser();    return;  case 4:    the_canvas()->unselect_all();    select_associated();    return;  case 5:    // delete    delete_it();    break;  default:    return;  }    package_modified();}
开发者ID:kralf,项目名称:bouml,代码行数:68,


示例27: ConnNetInfo_Create

EIO_Status CConnTest::ServiceOkay(string* reason){    static const char kService[] = "bounce";    SConnNetInfo* net_info = ConnNetInfo_Create(kService, m_DebugPrintout);    if (net_info)        net_info->lb_disable = 1/*no local LB to use even if available*/;    PreCheck(eStatelessService, 0/*main*/,             "Checking whether NCBI services operational");    CConn_ServiceStream svc(kService, fSERV_Stateless, net_info,                            0/*extra*/, m_Timeout);    svc.SetCanceledCallback(m_Canceled);    svc << kTest << NcbiEndl;    string temp;    svc >> temp;    bool responded = temp.size() > 0 ? true : false;    EIO_Status status = ConnStatus(NStr::Compare(temp, kTest) != 0, &svc);    if (status == eIO_Interrupt)        temp = kCanceled;    else if (status == eIO_Success)        temp = "OK";    else {        char* str = net_info ? SERV_ServiceName(kService) : 0;        if (str  &&  NStr::CompareNocase(str, kService) == 0) {            free(str);            str = 0;        }        SERV_ITER iter = SERV_OpenSimple(kService);        if (!iter  ||  !SERV_GetNextInfo(iter)) {            // Service not found            SERV_Close(iter);            iter = SERV_OpenSimple(kTest);            if (!iter  ||  !SERV_GetNextInfo(iter)                ||  NStr::CompareNocase(SERV_MapperName(iter), "DISPD") != 0) {                // Make sure there will be a mapper error printed                SERV_Close(iter);                temp.clear();                iter = 0;            } else {                // kTest service can be located but not kService                temp = str ? "Substituted service" : "Service";                temp += " cannot be located";            }        } else {            temp = responded ? "Unrecognized" : "No";            temp += " response from ";            temp += str ? "substituted service" : "service";        }        if (!temp.empty()) {            if (str) {                temp += "; please remove [";                string upper(kService);                temp += NStr::ToUpper(upper);                temp += "]CONN_SERVICE_NAME=/"";                temp += str;                temp += "/" from your configuration/n";            } else if (status != eIO_Timeout  ||  m_Timeout > kTimeout)                temp += "; please contact " + HELP_EMAIL + '/n';        }        if (status != eIO_Timeout) {            const char* mapper = SERV_MapperName(iter);            if (!mapper  ||  NStr::CompareNocase(mapper, "DISPD") != 0) {                temp += "Network dispatcher is not enabled as a service"                    " locator;  please review your configuration to purge any"                    " occurrences of [CONN]DISPD_DISABLE off your settings/n";            }        } else            temp += x_TimeoutMsg();        SERV_Close(iter);        if (str)            free(str);    }    PostCheck(eStatelessService, 0/*main*/, status, temp);    ConnNetInfo_Destroy(net_info);    if (reason)        reason->swap(temp);    return status;}
开发者ID:DmitrySigaev,项目名称:ncbi,代码行数:84,



注:本文中的upper函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ upper_32_bits函数代码示例
C++ upmu_set_rg_bc11_ipu_en函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。