当前位置: 首页>>代码示例>>C++>>正文


C++ IntervalObject类代码示例

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


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

示例1: intersectionIsEmpty

bool intersectionIsEmpty(const IntervalObject & v, const IntervalObject &w){

   typename IntervalObject::const_iterator iv = v.begin(), iw = w.begin(), endv = v.end();
   while(iv != endv){
     if((iv->leftBound() > iw->rightBound()) || (iw->leftBound() > iv->rightBound()))
       return true;
     ++iv; ++iw;
   }
   return false;
 }
开发者ID:caosuomo,项目名称:rads,代码行数:10,代码来源:iobject.hpp

示例2: rightObject

void rightObject(const IntervalObject &v, ResultType& result)
{
  typename ResultType::iterator i = result.begin();
  typename IntervalObject::const_iterator b = v.begin(), e=v.end();

  while(b!=e)
  {
    *i = b->rightBound();
    ++i;
    ++b;
  }
}
开发者ID:dreal-deps,项目名称:capdDynSys-4.0,代码行数:12,代码来源:iobject.hpp

示例3: containsZero

bool containsZero(const IntervalObject& v)
{

  typename IntervalObject::const_iterator b = v.begin(), e=v.end();
  while(b!=e)
  {
    if(!(isSingular(*b)))
      return false;
    ++b;
  }
  return true;
}
开发者ID:dreal-deps,项目名称:capdDynSys-4.0,代码行数:12,代码来源:iobject.hpp

示例4: size

typename IntervalObject::ScalarType size(const IntervalObject& v)
{
  typedef typename IntervalObject::ScalarType ScalarType;
  ScalarType result(0.);
  typename IntervalObject::const_iterator b=v.begin(), e=v.end();
  while(b!=e)
  {
     result = chomp::max(result,diam(*b));
     ++b;
  }
  return ScalarType(result.rightBound());
}
开发者ID:caosuomo,项目名称:rads,代码行数:12,代码来源:iobject.hpp

示例5: split

void split(IntervalObject& v, IntervalObject& rv)
{
  if(v.dimension()!=rv.dimension())
    throw std::range_error("Unequal dimensions in function chomp::vectalg::split");
  typename IntervalObject::iterator b = v.begin(),e=v.end(), i=rv.begin();
  while(b!=e)
  {
    b->split(*i);
    ++b;
    ++i;
  }
}
开发者ID:caosuomo,项目名称:rads,代码行数:12,代码来源:iobject.hpp

示例6: leftObject

void leftObject(const IntervalObject &v, ResultType& result)
{
  typename ResultType::iterator i = result.begin();
  typename IntervalObject::const_iterator b = v.begin(), e=v.end();

  while(b!=e)
  {
    *i = b->leftBound();
    ++i;
    ++b;
  }
 // std::transform(v.begin(), v.end(), result.begin(), leftBound<ScalarType> );
}
开发者ID:dreal-deps,项目名称:capdDynSys-4.0,代码行数:13,代码来源:iobject.hpp

示例7: subsetInterior

bool subsetInterior(const IntervalObject& v1, const IntervalObject& v2)
{
  if(v1.dimension()!=v2.dimension())
    throw std::range_error("Unequal dimensions in function capd::vectalg::subsetInterior");
  typename IntervalObject::const_iterator b = v1.begin(), e=v1.end(), i=v2.begin();
  while(b!=e)
  {
    if(!(b->subsetInterior(*i))) return false;
    ++b;
    ++i;
  }
  return true;
}
开发者ID:dreal-deps,项目名称:capdDynSys-4.0,代码行数:13,代码来源:iobject.hpp

示例8: mid

void mid(const IntervalObject& v, ResultType& result)
{
  if(v.dimension()!=result.dimension())
    throw std::range_error("Unequal dimensions in function capd::vectalg::mid");
  typename ResultType::iterator i = result.begin();
  typename IntervalObject::const_iterator b = v.begin(), e=v.end();

  while(b!=e)
  {
    *i = mid(*b);
    ++i;
    ++b;
  }
}
开发者ID:dreal-deps,项目名称:capdDynSys-4.0,代码行数:14,代码来源:iobject.hpp

示例9: diameter

void diameter(const IntervalObject &v, ResultContainer &result)
{
  if(v.dimension()!=result.dimension())
    throw std::range_error("Unequal dimensions in function capd::vectalg::diameter");
  typename ResultContainer::iterator i = result.begin();
  typename IntervalObject::const_iterator b = v.begin(), e=v.end();

  while(b!=e)
  {
    *i = diam(*b);
    ++i;
    ++b;
  }
}
开发者ID:dreal-deps,项目名称:capdDynSys-4.0,代码行数:14,代码来源:iobject.hpp

示例10: midObject

ResultType midObject(const IntervalObject &v)
{
  ResultType result(v.dimension());
  typedef typename ResultType::ScalarType ScalarType;
  typename ResultType::iterator i = result.begin();
  typename IntervalObject::const_iterator b = v.begin(), e=v.end();

  while(b!=e)
  {
    *i = (b->leftBound()+b->rightBound())/ScalarType(2.0);
    ++i;
    ++b;
  }
  return result;
}
开发者ID:dreal-deps,项目名称:capdDynSys-4.0,代码行数:15,代码来源:iobject.hpp

示例11: mid

void mid(const IntervalObject &v, IntervalObject &result)
{
  if(v.dimension()!=result.dimension())
    throw std::range_error("Unequal dimensions in function chomp::vectalg::mid");
  typedef typename IntervalObject::ScalarType ScalarType;
  typename IntervalObject::iterator i = result.begin();
  typename IntervalObject::const_iterator b = v.begin(), e=v.end();

  while(b!=e)
  {
    *i = b->mid();
    ++i;
    ++b;
  }
}
开发者ID:caosuomo,项目名称:rads,代码行数:15,代码来源:iobject.hpp

示例12: diameter

void diameter(const IntervalObject &v, ResultContainer &result)
{
  if(v.dimension()!=result.dimension())
    throw std::range_error("Unequal dimensions in function chomp::vectalg::diameter");
  typedef typename IntervalObject::ScalarType ScalarType;
  typename ResultContainer::iterator i = result.begin();
  typename IntervalObject::const_iterator b = v.begin(), e=v.end();

  while(b!=e)
  {
    *i = (ScalarType(b->rightBound()) - ScalarType(b->leftBound())).rightBound();
    ++i;
    ++b;
  }
}
开发者ID:caosuomo,项目名称:rads,代码行数:15,代码来源:iobject.hpp

示例13: intervalHull

void intervalHull(const IntervalObject &v1, const IntervalObject &v2, IntervalObject &result)
{
  if(v1.dimension()!=v2.dimension())
    throw std::range_error("Unequal dimensions in function capd::vectalg::intervalHull");
  if(v1.dimension()!=result.dimension())
    throw std::range_error("Unequal dimensions in function capd::vectalg::intervalHull");
  typedef typename IntervalObject::ContainerType ContainerType;
  typename ContainerType::const_iterator b1 = v1.ContainerType::begin(), b2=v2.ContainerType::begin();
  typename ContainerType::iterator b = result.ContainerType::begin(), e=result.ContainerType::end();

  while(b!=e)
  {
    *b = intervalHull(*b1,*b2);
    ++b;
    ++b1;
    ++b2;
  }
}
开发者ID:dreal-deps,项目名称:capdDynSys-4.0,代码行数:18,代码来源:iobject.hpp

示例14: intersection

bool intersection(const IntervalObject &v1, const IntervalObject &v2, IntervalObject &result)
{
  if(v1.dimension()!=v2.dimension())
    throw std::range_error("Unequal dimensions in function chomp::vectalg::intersection");
  if(v1.dimension()!=result.dimension())
    throw std::range_error("Unequal dimensions in function chomp::vectalg::intersection");
  typename IntervalObject::const_iterator b1 = v1.begin(), b2=v2.begin();
  typename IntervalObject::iterator b = result.begin(), e=result.end();

  while(b!=e)
  {
    if( !intersection(*b1,*b2,*b))
      return false;
    ++b;
    ++b1;
    ++b2;
  }
  return true;
}
开发者ID:caosuomo,项目名称:rads,代码行数:19,代码来源:iobject.hpp


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