Example #1
0
void AttrvLeakFunc::execute() {
  reset_stack();
  ComValue retval(AttributeValue::_leakchecker ? AttributeValue::_leakchecker->alive() : 0, ComValue::IntType);
  push_stack(retval);
}
time_t MythProgramInfo::RecStart()
{
    MythTimestamp time = cmyth_proginfo_rec_start(*m_proginfo_t);
    time_t retval(time.UnixTime());
    return retval;
}
Example #3
0
 // concatenation operator
 axis_transformation operator+(const axis_transformation& a) const {
   axis_transformation retval(*this);
   return retval+=a;
 }
Example #4
0
//! @brief Returns moment expressed in local coordinates.
XC::Vector XC::Beam2dUniformLoad::getLocalMoment(void) const
  {
    Vector retval(1);
    retval(0)= 0.0;
    return retval;
  }
Example #5
0
RectArray::operator std::vector<cv::Rect>() {
    std::vector<cv::Rect> retval(this->size);
    memcpy(retval.data(), this->data + 1, this->size * sizeof(RectWrapper));
    return retval;
}
Example #6
0
File: ID.cpp Project: lcpt/xc
//! @brief Return the reversed sequence.
XC::ID XC::ID::getReversed(void) const
  {
    XC::ID retval(*this);
    std::reverse(retval.begin(),retval.end());
    return retval;
  }
long long
search (int level)
{
  int depth;
  int max = 0;
  int pos = 0;
  long total = 0;
  int curr;

  depth = LEVELS;
  // find the maximum value in bottom row
  // by totally up the maximum for levels high
  int srch;
  for (srch = 1; srch <= depth; srch++)
    {
      fflush (stdout);
      int current = findmax (depth, level+10, srch);

      //printf ("s %d c %d \n", srch, current);
      if (current > max)
	{
	  max = current;
	  pos = srch;
	}
    }

  //report where we are
  total += retval(depth, pos);
  printf ("%d+", retval(depth,pos));

  for (depth-- ; depth >0 ; depth--) {
    long maxl, maxr;

    // which path do we travel?
    //search left
    if (pos == 1){
      maxl = 0;
      // position stays the same
      goto report;
    } else
      maxl = findmax (depth, level, pos-1);

    //search right
    if (pos == depth) {
      maxr = 0;
      pos -= 1;
      goto report;
    } else
      maxr = findmax (depth, level, pos);

    // now that we have a path, switch to it
    // stay in same position to travel right
    if (maxl > maxr ) 
      pos -= 1;

  report:
    //report where we are
    total += retval(depth, pos);
    printf ("%d+", retval(depth,pos));
    fflush (stdout);
  }

  return total;
}
 inline gmp_int operator--(int) {
   gmp_int retval(*this);
   --(*this);
   return retval;
 }
 inline gmp_int operator++(int) {
   gmp_int retval(*this);
   ++(*this);
   return retval;
 }
Example #10
0
void SelectFunc::execute() {
    static int all_symid = symbol_add("all");
    ComValue all_flagv(stack_key(all_symid));
    boolean all_flag = all_flagv.is_true();
    static int clear_symid = symbol_add("clear");
    ComValue clear_flagv(stack_key(clear_symid));
    boolean clear_flag = clear_flagv.is_true();

    Selection* sel = _ed->GetViewer()->GetSelection();
    if (clear_flag) {
      sel->Clear();
      unidraw->Update();
      reset_stack();
      return;
    }
      
    OverlaySelection* newSel = ((OverlayEditor*)_ed)->overlay_kit()->MakeSelection();
    
    Viewer* viewer = _ed->GetViewer();
    AttributeValueList* avl = new AttributeValueList();
    if (all_flag) {

      GraphicView* gv = ((OverlayEditor*)_ed)->GetFrame();
      Iterator i;
      int count=0;
      for (gv->First(i); !gv->Done(i); gv->Next(i)) {
	GraphicView* subgv = gv->GetView(i);
	newSel->Append(subgv);
	OverlayComp* comp = (OverlayComp*)subgv->GetGraphicComp();
	ComValue* compval = new ComValue(new OverlayViewRef(comp), comp->classid());
	avl->Append(compval);
      }

    } else if (nargs()==0) {
      Iterator i;
      int count=0;
      for (sel->First(i); !sel->Done(i); sel->Next(i)) {
	GraphicView* grview = sel->GetView(i);
	OverlayComp* comp = grview ? (OverlayComp*)grview->GetSubject() : nil;
	ComValue* compval = comp ? new ComValue(new OverlayViewRef(comp), comp->classid()) : nil;

	if (compval) {
	  avl->Append(compval);
	}
	delete newSel;
        newSel = nil;
      }

    } else {

      for (int i=0; i<nargsfixed(); i++) {
        ComValue& obj = stack_arg(i);
	if (obj.object_compview()) {
	  ComponentView* comview = (ComponentView*)obj.obj_val();
	  OverlayComp* comp = (OverlayComp*)comview->GetSubject();
	  if (comp) {
	    GraphicView* view = comp->FindView(viewer);
	    if (view) {
	      newSel->Append(view);
	      ComValue* compval = new ComValue(new OverlayViewRef(comp), comp->classid());
	      avl->Append(compval);
	    }
	  }
	} else if (obj.is_array()) {
	  Iterator it;
	  AttributeValueList* al = obj.array_val();
	  al->First(it);
	  while (!al->Done(it)) {
	    if (al->GetAttrVal(it)->object_compview()) {
	      ComponentView* comview = (ComponentView*)al->GetAttrVal(it)->obj_val();
	      OverlayComp* comp = (OverlayComp*)comview->GetSubject();
	      if (comp) {
		GraphicView* view = comp->FindView(viewer);
		if (view) {
		  newSel->Append(view);
		  ComValue* compval = new ComValue(new OverlayViewRef(comp), comp->classid());
		  avl->Append(compval);
		}
	      }
	    }
	    al->Next(it);
	  }
	}
      }
    }

    if (newSel){
      sel->Clear();
      delete sel;
      _ed->SetSelection(newSel);
      newSel->Update(viewer);
      unidraw->Update();
    }
    reset_stack();
    ComValue retval(avl);
    push_stack(retval);
}
Example #11
0
CRef<CScope> CBlastScopeSource::NewScope()
{
    CRef<CScope> retval(new CScope(*m_ObjMgr));
    AddDataLoaders(retval);
    return retval;
}
Example #12
0
void CommandLeakFunc::execute() {
  reset_stack();
  ComValue retval(Command::_leakchecker ? Command::_leakchecker->alive() : 0, ComValue::IntType);
  push_stack(retval);
}
Example #13
0
void GraphicLeakFunc::execute() {
  reset_stack();
  ComValue retval(Graphic::_leakchecker ? Graphic::_leakchecker->alive() : 0, ComValue::IntType);
  push_stack(retval);
}
Example #14
0
void MlineLeakFunc::execute() {
  reset_stack();
  ComValue retval(MultiLineObj::_leakchecker ? MultiLineObj::_leakchecker->alive() : 0, ComValue::IntType);
  push_stack(retval);
}
Example #15
0
  std::pair<double, Dynamics::TriangleIntersectingPart>
  DynGravity::getSphereTriangleEvent(const Particle& part, 
					    const Vector & A, 
					    const Vector & B, 
					    const Vector & C,
					    const double dist
					    ) const
  {
    //If the particle doesn't feel gravity, fall back to the standard function
    if (!part.testState(Particle::DYNAMIC)) 
      return DynNewtonian::getSphereTriangleEvent(part, A, B, C, dist);

    typedef std::pair<double, Dynamics::TriangleIntersectingPart> RetType;
    //The Origin, relative to the first vertex
    Vector T = part.getPosition() - A;
    //The ray direction
    Vector D = part.getVelocity();
    Sim->BCs->applyBC(T, D);

    //The edge vectors
    Vector E1 = B - A;
    Vector E2 = C - A;
  
    Vector N = E1 ^ E2;
    double nrm2 = N.nrm2();
#ifdef DYNAMO_DEBUG
    if (!nrm2) M_throw() << "Degenerate triangle detected!";
#endif
    N /= std::sqrt(nrm2);
  
    //First test for intersections with the triangle faces.
    double t1 = magnet::intersection::parabola_triangle(T, D, g, E1, E2, dist);

    M_throw() << "The next bit of code may be redundant now that the parabola triangle "
      "code takes a distance arg.";
    if (t1 < 0)
      {
	t1 = HUGE_VAL;
	if ((D | N) > 0)
	  if (magnet::overlap::point_prism(T - N * dist, E1, E2, N, dist)) t1 = 0;
      }
  
    RetType retval(t1, T_FACE);
  
    //Early jump out, to make sure that if we have zero time
    //interactions for the triangle faces, we take them.
    if (retval.first == 0) return retval;
  
    //Now test for intersections with the triangle corners
    double t = magnet::intersection::parabola_sphere(T, D, g, dist);
    if (t < retval.first) retval = RetType(t, T_A_CORNER);
    t = magnet::intersection::parabola_sphere(T - E1, D, g, dist);
    if (t < retval.first) retval = RetType(t, T_B_CORNER);
    t = magnet::intersection::parabola_sphere(T - E2, D, g, dist);
    if (t < retval.first) retval = RetType(t, T_C_CORNER);

    //Now for the edge collision detection
    t = magnet::intersection::parabola_rod(T, D, g, B - A, dist);
    if (t < retval.first) retval = RetType(t, T_AB_EDGE);
    t = magnet::intersection::parabola_rod(T, D, g, C - A, dist);
    if (t < retval.first) retval = RetType(t, T_AC_EDGE);
    t = magnet::intersection::parabola_rod(T - E2, D, g, B - C, dist);
    if (t < retval.first) retval = RetType(t, T_BC_EDGE);

    if (retval.first < 0) retval.first = 0;

    return retval;
  }
Example #16
0
 //! \brief Request a handle to a property, but this specialization always
 //!  returns a new instance of NumericProperty.
 //!  \sa getProperty(const std::string& name)
 inline Value getProperty(const double& name, const Property::Units& units)
 {
   Value retval(new NumericProperty(name, units));
   _numericProperties.push_back(retval);
   return retval;
 }
Example #17
0
std::vector<shared_ptr<UIElement>> ContainerFrame::getElements() const {
	std::vector<shared_ptr<UIElement>> retval(_elements);
	retval.push_back(_contArea);
	return retval;
}
std::pair<unsigned int, Real>
EigenSparseLinearSolver<T>::solve (SparseMatrix<T> &matrix_in,
				   NumericVector<T> &solution_in,
				   NumericVector<T> &rhs_in,
				   const double tol,
				   const unsigned int m_its)
{
  START_LOG("solve()", "EigenSparseLinearSolver");
  this->init ();

  // Make sure the data passed in are really Eigen types
  EigenSparseMatrix<T>& matrix   = libmesh_cast_ref<EigenSparseMatrix<T>&>(matrix_in);
  EigenSparseVector<T>& solution = libmesh_cast_ref<EigenSparseVector<T>&>(solution_in);
  EigenSparseVector<T>& rhs      = libmesh_cast_ref<EigenSparseVector<T>&>(rhs_in);

  // Close the matrix and vectors in case this wasn't already done.
  matrix.close();
  solution.close();
  rhs.close();

  std::pair<unsigned int, Real> retval(0,0.);

  // Solve the linear system
  switch (this->_solver_type)
    {
      // Conjugate-Gradient
    case CG:
      {
	Eigen::ConjugateGradient<EigenSM> solver (matrix._mat);
	solver.setMaxIterations(m_its);
	solver.setTolerance(tol);
	solution._vec = solver.solveWithGuess(rhs._vec,solution._vec);
	libMesh::out << "#iterations: " << solver.iterations() << std::endl;
	libMesh::out << "estimated error: " << solver.error() << std::endl;
	retval = std::make_pair(solver.iterations(), solver.error());
  	break;
      }

      // Bi-Conjugate Gradient Stabilized
    case BICGSTAB:
      {
	Eigen::BiCGSTAB<EigenSM> solver (matrix._mat);
	solver.setMaxIterations(m_its);
	solver.setTolerance(tol);
	solution._vec = solver.solveWithGuess(rhs._vec,solution._vec);
	libMesh::out << "#iterations: " << solver.iterations() << std::endl;
	libMesh::out << "estimated error: " << solver.error() << std::endl;
	retval = std::make_pair(solver.iterations(), solver.error());
  	break;
      }

    //   // Generalized Minimum Residual
    // case GMRES:
    //   {
    // 	libmesh_not_implemented();
    // 	break;
    //   }

      // Unknown solver, use BICGSTAB
    default:
      {
  	libMesh::err << "ERROR:  Unsupported Eigen Solver: "
		     << Utility::enum_to_string(this->_solver_type) << std::endl
		     << "Continuing with BICGSTAB" << std::endl;

  	this->_solver_type = BICGSTAB;

	STOP_LOG("solve()", "EigenSparseLinearSolver");

  	return this->solve (matrix,
  			    solution,
  			    rhs,
  			    tol,
  			    m_its);
      }
    }

  STOP_LOG("solve()", "EigenSparseLinearSolver");
  return retval;
}
void printval(int level, int pos){
  printf("%d ", retval(level, pos));
}
Example #20
0
BOOL CDDStatic::OnRenderGlobalData(LPFORMATETC lpFormatEtc, HGLOBAL* phGlobal)
{
  pws_os::Trace(L"CDDStatic::OnRenderGlobalData: %s; ci == %p\n",
          lpFormatEtc->cfFormat == CF_UNICODETEXT ? L"CF_UNICODETEXT" : L"CF_TEXT",
          m_pci);

  if (lpFormatEtc->cfFormat != CF_UNICODETEXT &&
      lpFormatEtc->cfFormat != CF_TEXT)
    return FALSE;

  if (m_hgDataTXT != NULL) {
    pws_os::Trace(L"CDDStatic::OnRenderGlobalData - Unlock/Free m_hgDataTXT\n");
    GlobalUnlock(m_hgDataTXT);
    GlobalFree(m_hgDataTXT);
    m_hgDataTXT = NULL;
  }

  if (m_hgDataUTXT != NULL) {
    pws_os::Trace(L"CDDStatic::OnRenderGlobalData - Unlock/Free m_hgDataUTXT\n");
    GlobalUnlock(m_hgDataUTXT);
    GlobalFree(m_hgDataUTXT);
    m_hgDataUTXT = NULL;
  }

  StringX cs_dragdata;
  if (m_pci == NULL) {
    if (m_groupname.empty()) {
      pws_os::Trace(L"CDDStatic::OnRenderGlobalData - mpci == NULL\n");
      return FALSE;
    } else {
      cs_dragdata = m_groupname;
    }
  } else { // m_pci != NULL
    const CItemData *pci(m_pci);

    // Handle shortcut or alias
    if ((m_nID == IDC_STATIC_DRAGPASSWORD && pci->IsAlias()) ||
        (pci->IsShortcut() && (m_nID != IDC_STATIC_DRAGGROUP &&
                               m_nID != IDC_STATIC_DRAGTITLE &&
                               m_nID != IDC_STATIC_DRAGUSER))) {
      pci = app.GetMainDlg()->GetBaseEntry(pci);
    }
    cs_dragdata = GetData(pci);
    if (cs_dragdata.empty() && m_nID != IDC_STATIC_DRAGAUTO)
      return FALSE;
  }

  const size_t ilen = cs_dragdata.length();
  if (ilen == 0 && m_nID != IDC_STATIC_DRAGAUTO) {
    // Nothing to do - why were we even called???
    return FALSE;
  }

  DWORD dwBufLen;
  LPSTR lpszA(NULL);
  LPWSTR lpszW(NULL);

  if (lpFormatEtc->cfFormat == CF_UNICODETEXT) {
    // So is requested data!
    dwBufLen = (DWORD)((ilen + 1) * sizeof(wchar_t));
    lpszW = new WCHAR[ilen + 1];
    //pws_os::Trace(L"lpszW allocated %p, size %d\n", lpszW, dwBufLen);
    if (ilen == 0) {
      lpszW[ilen] = L'\0';
    } else {
      (void) wcsncpy_s(lpszW, ilen + 1, cs_dragdata.c_str(), ilen);
    }
  } else {
    // They want it in ASCII - use lpszW temporarily
    if (ilen == 0) {
      dwBufLen = 1;
      lpszA = new char[dwBufLen];
      lpszA = '\0';
    } else {
      lpszW = const_cast<LPWSTR>(cs_dragdata.c_str());
      dwBufLen = WideCharToMultiByte(CP_ACP, 0, lpszW, -1, NULL, 0, NULL, NULL);
      ASSERT(dwBufLen != 0);
      lpszA = new char[dwBufLen];
      pws_os::Trace(L"lpszA allocated %p, size %d\n", lpszA, dwBufLen);
      WideCharToMultiByte(CP_ACP, 0, lpszW, -1, lpszA, dwBufLen, NULL, NULL);
      lpszW = NULL;
    }
  }

  LPVOID lpData(NULL);
  LPVOID lpDataBuffer;
  HGLOBAL *phgData;
  if (lpFormatEtc->cfFormat == CF_UNICODETEXT) {
    lpDataBuffer = (LPVOID)lpszW;
    phgData = &m_hgDataUTXT;
  } else {
    lpDataBuffer = (LPVOID)lpszA;
    phgData = &m_hgDataTXT;
  }

  BOOL retval(FALSE);
  if (*phGlobal == NULL) {
    //pws_os::Trace(L"CDDStatic::OnRenderGlobalData - Alloc global memory\n");
    *phgData = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, dwBufLen);
    ASSERT(*phgData != NULL);
    if (*phgData == NULL)
      goto bad_return;

    lpData = GlobalLock(*phgData);
    ASSERT(lpData != NULL);
    if (lpData == NULL)
      goto bad_return;

    // Copy data
    memcpy(lpData, lpDataBuffer, dwBufLen);
    *phGlobal = *phgData;
    retval = TRUE;
  } else {
    pws_os::Trace(L"CDDStatic::OnRenderGlobalData - *phGlobal NOT NULL!\n");
    SIZE_T inSize = GlobalSize(*phGlobal);
    SIZE_T ourSize = GlobalSize(*phgData);
    if (inSize < ourSize) {
      // Pre-allocated space too small.  Not allowed to increase it - FAIL
      pws_os::Trace(L"CDDStatic::OnRenderGlobalData - NOT enough room - FAIL\n");
    } else {
      // Enough room - copy our data into supplied area
      pws_os::Trace(L"CDDStatic::OnRenderGlobalData - enough room - copy our data\n");
      LPVOID pInGlobalLock = GlobalLock(*phGlobal);
      ASSERT(pInGlobalLock != NULL);
      if (pInGlobalLock == NULL)
        goto bad_return;

      memcpy(pInGlobalLock, lpDataBuffer, ourSize);
      GlobalUnlock(*phGlobal);
      retval = TRUE;
    }
  }

bad_return:
  // Finished with buffer - trash it
  trashMemory(lpDataBuffer, dwBufLen);
  // Free the strings (only one is actually in use)
  //pws_os::Trace(L"lpszA freed %p\n", lpszA);
  delete[] lpszA;
  //pws_os::Trace(L"lpszW freed %p\n", lpszW);
  delete[] lpszW;
  // Since lpDataBuffer pointed to one of the above - just zero the pointer
  lpDataBuffer = NULL;

  // If retval == TRUE, recipient is responsible for freeing the global memory
  // if D&D succeeds (see after StartDragging in OnMouseMove)
  if (retval == FALSE) {
    pws_os::Trace(L"CDDStatic::OnRenderGlobalData - returning FALSE!\n");
    if (lpData != NULL) {
      GlobalFree(*phgData);
      *phgData = NULL;
    }
  } else {
    pws_os::Trace(L"CDDStatic::OnRenderGlobalData - D&D Data:");
    if (lpFormatEtc->cfFormat == CF_UNICODETEXT) {
      pws_os::Trace(L"\"%ls\"\n", (LPWSTR)lpData);  // data is Unicode
    } else {
      pws_os::Trace(L"\"%hs\"\n", (LPSTR)lpData);  // data is NOT Unicode
    }
  }
  // Unlock our buffer
  if (lpData != NULL)
    GlobalUnlock(*phgData);

  return retval;
}
Example #21
0
const std::string DataRef::getSerStr() {
	changed = false;
	std::string retval(ser_code);
	return retval + getValStr() + '\n';
}
Example #22
0
  int
  run()
  {
    /** \brief return value
     *  A non-zero value is assigned when either NFD or RIB manager (running in a separate
     *  thread) fails.
     */
    std::atomic_int retval(0);

    boost::asio::io_service* const mainIo = &getGlobalIoService();
    boost::asio::io_service* nrdIo = nullptr;

    // Mutex and conditional variable to implement synchronization between main and RIB manager
    // threads:
    // - to block main thread until RIB manager thread starts and initializes nrdIo (to allow
    //   stopping it later)
    std::mutex m;
    std::condition_variable cv;

    std::string configFile = this->m_configFile; // c++11 lambda cannot capture member variables
    boost::thread nrdThread([configFile, &retval, &nrdIo, mainIo, &cv, &m] {
        {
          std::lock_guard<std::mutex> lock(m);
          nrdIo = &getGlobalIoService();
          BOOST_ASSERT(nrdIo != mainIo);
        }
        cv.notify_all(); // notify that nrdIo has been assigned

        try {
          ndn::KeyChain nrdKeyChain;
          // must be created inside a separate thread
          rib::Nrd nrd(configFile, nrdKeyChain);
          nrd.initialize();
          getGlobalIoService().run(); // nrdIo is not thread-safe to use here
        }
        catch (const std::exception& e) {
          NFD_LOG_FATAL(e.what());
          retval = 6;
          mainIo->stop();
        }

        {
          std::lock_guard<std::mutex> lock(m);
          nrdIo = nullptr;
        }
      });

    {
      // Wait to guarantee that nrdIo is properly initialized, so it can be used to terminate
      // RIB manager thread.
      std::unique_lock<std::mutex> lock(m);
      cv.wait(lock, [&nrdIo] { return nrdIo != nullptr; });
    }

    try {
      mainIo->run();
    }
    catch (const std::exception& e) {
      NFD_LOG_FATAL(e.what());
      retval = 4;
    }
    catch (const PrivilegeHelper::Error& e) {
      NFD_LOG_FATAL(e.what());
      retval = 5;
    }

    {
      // nrdIo is guaranteed to be alive at this point
      std::lock_guard<std::mutex> lock(m);
      if (nrdIo != nullptr) {
        nrdIo->stop();
        nrdIo = nullptr;
      }
    }
    nrdThread.join();

    return retval;
  }
Example #23
0
DMatchArray::operator std::vector<cv::DMatch>() {
    std::vector<cv::DMatch> retval(this->size);
    memcpy(retval.data(), this->data + 1, this->size * sizeof(DMatchWrapper));
    return retval;
}
Example #24
0
std::pair<double, Dynamics::TriangleIntersectingPart>
DynNewtonian::getSphereTriangleEvent(const Particle& part, const Vector & A, const Vector & B, const Vector & C, const double dist) const
{
    typedef std::pair<double, Dynamics::TriangleIntersectingPart> RetType;
    //The Origin, relative to the first vertex
    Vector T = part.getPosition() - A;
    //The ray direction
    Vector D = part.getVelocity();
    Sim->BCs->applyBC(T, D);

    //The edge vectors
    Vector E1 = B - A;
    Vector E2 = C - A;

    Vector N = E1 ^ E2;
    double nrm2 = N.nrm2();
#ifdef DYNAMO_DEBUG
    if (!nrm2) M_throw() << "Degenerate triangle detected!";
#endif
    N /= std::sqrt(nrm2);


    //First test for intersections with the triangle faces.
    double t1 = magnet::intersection::ray_triangle<true, true>(T - N * dist, D, E1, E2);

    if (t1 < 0)
    {
        t1 = HUGE_VAL;
        if (magnet::overlap::point_prism(T - N * dist, E1, E2, N, dist)) t1 = 0;
    }

    double t2 = magnet::intersection::ray_triangle<true, true>(T + N * dist, D, E2, E1);

    if (t2 < 0)
    {
        t2 = HUGE_VAL;
        if (magnet::overlap::point_prism(T + N * dist, E2, E1, -N, dist)) t2 = 0;
    }

    RetType retval(std::min(t1, t2), T_FACE);

    //Early jump out, to make sure that if we have zero time
    //interactions for the triangle faces, we take them.
    if (retval.first == 0) return retval;

    //Now test for intersections with the triangle corners
    double t = magnet::intersection::ray_sphere_bfc(T, D, dist);
    if (t < retval.first) retval = RetType(t, T_A_CORNER);
    t = magnet::intersection::ray_sphere_bfc(T - E1, D, dist);
    if (t < retval.first) retval = RetType(t, T_B_CORNER);
    t = magnet::intersection::ray_sphere_bfc(T - E2, D, dist);
    if (t < retval.first) retval = RetType(t, T_C_CORNER);

    //Now for the edge collision detection
    t = magnet::intersection::ray_rod_bfc(T, D, B - A, dist);
    if (t < retval.first) retval = RetType(t, T_AB_EDGE);
    t = magnet::intersection::ray_rod_bfc(T, D, C - A, dist);
    if (t < retval.first) retval = RetType(t, T_AC_EDGE);
    t = magnet::intersection::ray_rod_bfc(T - E2, D, B - C, dist);
    if (t < retval.first) retval = RetType(t, T_BC_EDGE);

    if (retval.first < 0) retval.first = 0;

    return retval;
}
time_t MythProgramInfo::EndTime()
{
    MythTimestamp time = cmyth_proginfo_end(*m_proginfo_t);
    time_t retval(time.UnixTime());
    return retval;
}
Example #26
0
std::string welded_beam::get_name() const
{
	std::string retval("Welded beam");
	return retval;
}
Example #27
0
vector<Point2f> CoordHomogenization::unhomogenize(const vector<Point2f>& pts) const {
	vector<Point2f> retval(pts.size());
    std::transform(begin(pts), end(pts), begin(retval), [this](const Point2f& _){return unhomogenize(_);} );
    return retval;
}
Example #28
0
std::string libMesh::get_io_compatibility_version ()
{
  std::string retval(LIBMESH_IO_COMPATIBILITY_VERSION);
  return retval;
}
Example #29
0
 // get the inverse axis_transformation of this
 axis_transformation inverse() const {
   axis_transformation retval(*this);
   return retval.invert();
 }
Example #30
0
void ViewLeakFunc::execute() {
  reset_stack();
  ComValue retval(OverlayView::_leakchecker->alive(), ComValue::IntType);
  push_stack(retval);
}