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

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

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

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

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

示例1: transferStraightConstraintChoose

 /*  * @param target1 the first of two possible target segments for the transfer  * @param target2 the second of two possible target segments for the  * transfer  * @param ignore the constraint which, in being satisfied, caused this  * transfer and which should therefore not be transfered.  */ transferStraightConstraintChoose(Segment* target1, Segment* target2,         StraightConstraint* ignore)     : ignore(ignore)  {     vpsc::Dim dim = ignore->scanDim;     double min1=min(target1->start->pos(vpsc::conjugate(dim)),target1->end->pos(vpsc::conjugate(dim)));     double max1=max(target1->start->pos(vpsc::conjugate(dim)),target1->end->pos(vpsc::conjugate(dim)));     double min2=min(target2->start->pos(vpsc::conjugate(dim)),target2->end->pos(vpsc::conjugate(dim)));     double max2=max(target2->start->pos(vpsc::conjugate(dim)),target2->end->pos(vpsc::conjugate(dim)));     if(min1<max2) {         COLA_ASSERT(max1==min2);         lSeg = target1;         rSeg = target2;         lMin = min1;         mid = max1;         rMax = max2;     } else {         COLA_ASSERT(max2==min1);         lSeg = target2;         rSeg = target1;         lMin = min2;         mid = max2;         rMax = max1;     } }
开发者ID:mjwybrow,项目名称:adaptagrams,代码行数:32,


示例2: hRule8

static double hRule8(vpsc::Dim dim, const EdgePoint* u, const EdgePoint* v,        const EdgePoint* w, const EdgePoint* a, const EdgePoint* b,        const EdgePoint* c){    double dxuv, dyuv, dxuv2, dyuv2;    double luv=dim==vpsc::HORIZONTAL?        len(u,v,dxuv,dyuv,dxuv2,dyuv2):        len(u,v,dyuv,dxuv,dyuv2,dxuv2);    COLA_ASSERT(luv!=0);    double dxvw, dyvw, dxvw2, dyvw2;    double lvw=dim==vpsc::HORIZONTAL?        len(v,w,dxvw,dyvw,dxvw2,dyvw2):        len(v,w,dyvw,dxvw,dyvw2,dxvw2);    COLA_ASSERT(lvw!=0);    double dxab, dyab, dxab2, dyab2;    double lab=dim==vpsc::HORIZONTAL?        len(a,b,dxab,dyab,dxab2,dyab2):        len(a,b,dyab,dxab,dyab2,dxab2);    COLA_ASSERT(lab!=0);    double dxbc, dybc, dxbc2, dybc2;    double lbc=dim==vpsc::HORIZONTAL?        len(b,c,dxbc,dybc,dxbc2,dybc2):        len(b,c,dybc,dxbc,dybc2,dxbc2);    COLA_ASSERT(lbc!=0);    return (dxuv/luv - dxvw/lvw) * (dxab/lab - dxbc/lbc);}
开发者ID:MALCOLM-REVENGE,项目名称:adaptagrams,代码行数:26,


示例3: rotationalAngle

// Returns the rotationalAngle, between 0 and 360, of this point from (0,0).//double rotationalAngle(const Point& p){    if (p.y == 0)    {        return ((p.x < 0) ? 180 : 0);    }    else if (p.x == 0)    {        return ((p.y < 0) ? 270 : 90);    }        double ang = atan(p.y / p.x);    ang = (ang * 180) / M_PI;    if (p.x < 0)    {        ang += 180;    }    else if (p.y < 0)    {        ang += 360;    }    COLA_ASSERT(ang >= 0);    COLA_ASSERT(ang <= 360);    return ang;}
开发者ID:cmears,项目名称:adaptagrams,代码行数:29,


示例4: COLA_ASSERT

Obstacle::~Obstacle(){    COLA_ASSERT(!m_router->objectIsInQueuedActionList(this));    if (m_active)    {        makeInactive();        m_router->processTransaction();    }    COLA_ASSERT(m_first_vert != NULL);        VertInf *it = m_first_vert;    do    {        VertInf *tmp = it;        it = it->shNext;        delete tmp;    }    while (it != m_first_vert);    m_first_vert = m_last_vert = NULL;    // Free and clear any connection pins.    while (!m_connection_pins.empty())    {        delete *(m_connection_pins.begin());    }}
开发者ID:TheProjecter,项目名称:pockemul,代码行数:29,


示例5: COLA_ASSERT

void Obstacle::setNewPoly(const Polygon& poly){    COLA_ASSERT(m_first_vert != NULL);    COLA_ASSERT(m_polygon.size() == poly.size());    m_polygon = poly;    Polygon routingPoly = routingPolygon();    VertInf *curr = m_first_vert;    for (size_t pt_i = 0; pt_i < routingPoly.size(); ++pt_i)    {        COLA_ASSERT(curr->visListSize == 0);        COLA_ASSERT(curr->invisListSize == 0);        // Reset with the new polygon point.        curr->Reset(routingPoly.ps[pt_i]);        curr->pathNext = NULL;        curr = curr->shNext;    }    COLA_ASSERT(curr == m_first_vert);    // It may be that the polygon for the obstacle has been updated after    // creating the shape.  These events may have been combined for a single    // transaction, so update pin positions.    for (ShapeConnectionPinSet::iterator curr =                m_connection_pins.begin(); curr != m_connection_pins.end(); ++curr)    {        ShapeConnectionPin *pin = *curr;        pin->updatePosition(m_polygon);    }}
开发者ID:jtiai,项目名称:adaptagrams,代码行数:32,


示例6: floyd_warshall

void floyd_warshall(        unsigned const n,        T** D,         vector<Edge> const & es,        valarray<T> const * eweights) {    COLA_ASSERT(!eweights||eweights->size()==es.size());    for(unsigned i=0;i<n;i++) {        for(unsigned j=0;j<n;j++) {            if(i==j) D[i][j]=0;            else D[i][j]=numeric_limits<T>::max();        }    }    for(unsigned i=0;i<es.size();i++) {        unsigned u=es[i].first, v=es[i].second;        COLA_ASSERT(u<n&&v<n);        D[u][v]=D[v][u]=eweights?(*eweights)[i]:1;    }    for(unsigned k=0; k<n; k++) {        for(unsigned i=0; i<n; i++) {            for(unsigned j=0; j<n; j++) {                D[i][j]=min(D[i][j],D[i][k]+D[k][j]);            }        }    }}
开发者ID:amolenaar,项目名称:adaptagrams,代码行数:26,


示例7: PolygonInterface

ReferencingPolygon::ReferencingPolygon(const Polygon& poly, const Router *router)    : PolygonInterface(),      _id(poly._id),      psRef(poly.size()),      psPoints(poly.size()){    COLA_ASSERT(router != NULL);    for (size_t i = 0; i < poly.size(); ++i)    {        if (poly.ps[i].id == 0)        {            // Can't be referenced, so just make a copy of the point.            psRef[i] = std::make_pair((Polygon *) NULL,                     kUnassignedVertexNumber);            psPoints[i] = poly.ps[i];        }        else        {            const Polygon *polyPtr = NULL;            for (ObstacleList::const_iterator sh = router->m_obstacles.begin();                    sh != router->m_obstacles.end(); ++sh)             {                if ((*sh)->id() == poly.ps[i].id)                {                    const Polygon& poly = (*sh)->polygon();                    polyPtr = &poly;                    break;                }            }            COLA_ASSERT(polyPtr != NULL);            psRef[i] = std::make_pair(polyPtr, poly.ps[i].vn);        }    }}
开发者ID:pockemul,项目名称:PockEmul,代码行数:34,


示例8: checkVertInfListConditions

void VertInfList::addVertex(VertInf *vert){    checkVertInfListConditions();    COLA_ASSERT(vert->lstPrev == NULL);    COLA_ASSERT(vert->lstNext == NULL);    if (vert->id.isConnPt())    {        // A Connector vertex        if (_firstConnVert)        {            // Join with previous front            vert->lstNext = _firstConnVert;            _firstConnVert->lstPrev = vert;            // Make front            _firstConnVert = vert;        }        else        {            // Make front and back            _firstConnVert = vert;            _lastConnVert = vert;            // Link to front of shapes list            vert->lstNext = _firstShapeVert;        }        _connVertices++;    }    else // if (vert->id.shape > 0)    {        // A Shape vertex        if (_lastShapeVert)        {            // Join with previous back            vert->lstPrev = _lastShapeVert;            _lastShapeVert->lstNext = vert;            // Make back            _lastShapeVert = vert;        }        else        {            // Make first and last            _firstShapeVert = vert;            _lastShapeVert = vert;            // Join with conns list            if (_lastConnVert)            {                COLA_ASSERT(_lastConnVert->lstNext == NULL);                _lastConnVert->lstNext = vert;            }        }        _shapeVertices++;    }    checkVertInfListConditions();}
开发者ID:amolenaar,项目名称:adaptagrams,代码行数:59,


示例9: COLA_ASSERT

// Creates the connection between a connector and a shape/junction.void ConnEnd::connect(ConnRef *conn){    COLA_ASSERT(isPinConnection());    COLA_ASSERT(m_anchor_obj);    COLA_ASSERT(m_conn_ref == NULL);    m_anchor_obj->addFollowingConnEnd(this);    m_conn_ref = conn;}
开发者ID:cmears,项目名称:adaptagrams,代码行数:10,


示例10: fprintf

void HyperedgeTreeNode::validateHyperedge(const HyperedgeTreeEdge *ignored,         const size_t dist) const {    size_t newDist = dist;#ifdef MAJOR_HYPEREDGE_IMPROVEMENT_DEBUG    if (junction)    {        if (newDist == 0)        {            fprintf(stderr,"/nHyperedge topology:/n");        }        else        {            ++newDist;        }        for (size_t d = 0; d < newDist; ++d)        {            fprintf(stderr,"  ");        }        fprintf(stderr, "j(%d)/n", junction->id());        ++newDist;    }    else if (edges.size() == 1)    {        ++newDist;        for (size_t d = 0; d < newDist; ++d)        {            fprintf(stderr, "  ");        }        fprintf(stderr, "t()/n");        ++newDist;    }#endif    for (std::list<HyperedgeTreeEdge *>::const_iterator curr = edges.begin();            curr != edges.end(); ++curr)    {        HyperedgeTreeEdge *edge = *curr;        std::pair<ConnEnd, ConnEnd> connEnds = edge->conn->endpointConnEnds();        if (junction)        {            COLA_ASSERT((connEnds.first.junction() == junction) ||                        (connEnds.second.junction() == junction));            COLA_ASSERT(connEnds.first.junction() != connEnds.second.junction());        }        else if (edges.size() == 1)        {            COLA_ASSERT(!connEnds.first.junction() ||                         !connEnds.second.junction());        }                if (edge != ignored)        {            edge->validateHyperedge(this, newDist);        }    }}
开发者ID:riccardo-gallini,项目名称:NAvoidLib,代码行数:57,


示例11: COLA_ASSERT

// This method disconnects the hyperedge tree edge nodes that it's attached to.//void HyperEdgeTreeEdge::disconnectEdge(void){    COLA_ASSERT(ends.first != NULL);    COLA_ASSERT(ends.second != NULL);    ends.first->disconnectEdge(this);    ends.second->disconnectEdge(this);    ends.first = NULL;    ends.second = NULL;}
开发者ID:SiteView,项目名称:NNMQT,代码行数:12,


示例12: dijkstra

void dijkstra(        unsigned const s,        unsigned const n,        T* d,        vector<Edge> const & es,        valarray<T> const * eweights){    COLA_ASSERT(!eweights||es.size()==eweights->size());    COLA_ASSERT(s<n);    vector<Node<T> > vs(n);    dijkstra_init(vs,es,eweights);    dijkstra(s,vs,d);}
开发者ID:amolenaar,项目名称:adaptagrams,代码行数:13,


示例13: COLA_ASSERT

// Populate the deleted-object vectors with all the connectors and junctions// that form the registered hyperedges.  Then return the set of all these// connectors so they can be ignored for individual rerouting.ConnRefSet HyperedgeRerouter::calcHyperedgeConnectors(void){    COLA_ASSERT(m_router != NULL);    ConnRefSet allRegisteredHyperedgeConns;    // Clear the deleted-object vectors.  We populate them here if necessary.    m_deleted_junctions_vector.clear();    m_deleted_junctions_vector.resize(count());    m_deleted_connectors_vector.clear();    m_deleted_connectors_vector.resize(count());    m_terminal_vertices_vector.clear();    m_terminal_vertices_vector.resize(count());    m_added_vertices.clear();    // Populate the deleted-object vectors.    const size_t num_hyperedges = count();    for (size_t i = 0; i < num_hyperedges; ++i)    {        if (m_root_junction_vector[i])        {            // Follow objects attached to junction to find the hyperedge.            findAttachedObjects(i, m_root_junction_vector[i], NULL,                    allRegisteredHyperedgeConns);            continue;        }        // Alternatively, we have a set of ConnEnds, so store the        // corresponding terminals        std::pair<bool, VertInf *> maybeNewVertex;        for (ConnEndList::const_iterator it = m_terminals_vector[i].begin();                it != m_terminals_vector[i].end(); ++it)        {            maybeNewVertex = it->getHyperedgeVertex(m_router);            COLA_ASSERT(maybeNewVertex.second != NULL);            m_terminal_vertices_vector[i].insert(maybeNewVertex.second);            if (maybeNewVertex.first)            {                // This is a newly created vertex.  Remember it so we can                // free it and it's visibility edges later.                m_added_vertices.push_back(maybeNewVertex.second);            }        }    }    // Return these connectors that don't require rerouting.    return allRegisteredHyperedgeConns;}
开发者ID:SynthiNet,项目名称:Qumulus,代码行数:53,


示例14: hRule4

static double hRule4(vpsc::Dim dim, const EdgePoint* a, const EdgePoint* b,        const EdgePoint* c, const EdgePoint* d){    double dxab, dyab, dxab2, dyab2;    double lab=dim==vpsc::HORIZONTAL?        len(a,b,dxab,dyab,dxab2,dyab2):        len(a,b,dyab,dxab,dyab2,dxab2);    COLA_ASSERT(lab!=0);    double dxcd, dycd, dxcd2, dycd2;    double lcd=dim==vpsc::HORIZONTAL?        len(c,d,dxcd,dycd,dxcd2,dycd2):        len(c,d,dycd,dxcd,dycd2,dxcd2);    COLA_ASSERT(lcd!=0);    return -dxab*dxcd/(lab*lcd);}
开发者ID:MALCOLM-REVENGE,项目名称:adaptagrams,代码行数:15,


示例15: m_type

ConnEnd::ConnEnd(ShapeRef *shapeRef, const unsigned int connectionPinClassID)    : m_type(ConnEndShapePin),      m_point(Point(0,0)),      m_directions(ConnDirAll),      m_connection_pin_class_id(connectionPinClassID),      m_anchor_obj(shapeRef),      m_conn_ref(NULL),      m_active_pin(NULL){    COLA_ASSERT(m_anchor_obj != NULL);    COLA_ASSERT(m_connection_pin_class_id > 0);    m_point = m_anchor_obj->position();    COLA_ASSERT(m_connection_pin_class_id != CONNECTIONPIN_UNSET);}
开发者ID:cmears,项目名称:adaptagrams,代码行数:15,


示例16: gRule2

static double gRule2(vpsc::Dim dim, const EdgePoint* a, const EdgePoint* b,        const EdgePoint* c){    double dxab, dyab, dxab2, dyab2;    double lab=dim==vpsc::HORIZONTAL?        len(a,b,dxab,dyab,dxab2,dyab2):        len(a,b,dyab,dxab,dyab2,dxab2);    COLA_ASSERT(lab!=0);    double dxbc, dybc, dxbc2, dybc2;    double lbc=dim==vpsc::HORIZONTAL?        len(b,c,dxbc,dybc,dxbc2,dybc2):        len(b,c,dybc,dxbc,dybc2,dxbc2);    COLA_ASSERT(lbc!=0);    return dxab/lab - dxbc/lbc;}
开发者ID:MALCOLM-REVENGE,项目名称:adaptagrams,代码行数:15,


示例17: COLA_ASSERT

double GradientProjection::computeSteepestDescentVector(        valarray<double> const &b,        valarray<double> const &x,        valarray<double> &g) const {    // find steepest descent direction    //  g = 2 ( b - A x )    //    where: A = denseQ + sparseQ    //  g = 2 ( b - denseQ x) - 2 sparseQ x    //    //  except the 2s don't matter because we compute     //  the optimal stepsize anyway    COLA_ASSERT(x.size()==b.size() && b.size()==g.size());    g = b;    for (unsigned i=0; i<denseSize; i++) {        for (unsigned j=0; j<denseSize; j++) {            g[i] -= (*denseQ)[i*denseSize+j]*x[j];        }    }    // sparse part:    if(sparseQ) {        valarray<double> r(x.size());        sparseQ->rightMultiply(x,r);        g-=r;    }    return computeStepSize(g,g);}
开发者ID:mjwybrow,项目名称:adaptagrams,代码行数:26,


示例18: zagzig

bool zagzig(const EdgePoint* a, const Segment* s) {    COLA_UNUSED(a);    if(s!=nullptr) {        COLA_ASSERT(!sameCorner(a,s->start));    }    return false;}
开发者ID:mjwybrow,项目名称:adaptagrams,代码行数:7,


示例19: sameCorner

bool sameCorner(const EdgePoint* a, const EdgePoint* b) {    COLA_UNUSED(a);    COLA_UNUSED(b);    COLA_ASSERT( !(a->node->id==b->node->id                &&a->rectIntersect==b->rectIntersect));    return false;}
开发者ID:mjwybrow,项目名称:adaptagrams,代码行数:7,


示例20: m_shape

ShapeConnectionPin::ShapeConnectionPin(JunctionRef *junction,         const unsigned int classId, const ConnDirFlags visDirs)    : m_shape(NULL),      m_junction(junction),      m_class_id(classId),      m_x_portion_offset(0.0),      m_y_portion_offset(0.0),      m_inside_offset(0.0),      m_visibility_directions(visDirs),      m_exclusive(true),      m_connection_cost(0.0),      m_vertex(NULL){    COLA_ASSERT(m_junction != NULL);    m_router = m_junction->router();    m_junction->addConnectionPin(this);        // Create a visibility vertex for this ShapeConnectionPin.    VertID id(m_junction->id(), kShapeConnectionPin,             VertID::PROP_ConnPoint | VertID::PROP_ConnectionPin);    m_vertex = new VertInf(m_router, id, m_junction->position());    m_vertex->visDirections = visDirs;    if (m_router->_polyLineRouting)    {        vertexVisibility(m_vertex, NULL, true, true);    }}
开发者ID:TheProjecter,项目名称:pockemul,代码行数:28,


示例21: COLA_ASSERT

void VertInf::removeFromGraph(const bool isConnVert){    if (isConnVert)    {        COLA_ASSERT(id.isConnPt());    }    // For each vertex.    EdgeInfList::const_iterator finish = visList.end();    EdgeInfList::const_iterator edge;    while ((edge = visList.begin()) != finish)    {        // Remove each visibility edge        (*edge)->alertConns();        delete (*edge);    }    finish = orthogVisList.end();    while ((edge = orthogVisList.begin()) != finish)    {        // Remove each orthogonal visibility edge.        (*edge)->alertConns();        delete (*edge);    }    finish = invisList.end();    while ((edge = invisList.begin()) != finish)    {        // Remove each invisibility edge        delete (*edge);    }}
开发者ID:amolenaar,项目名称:adaptagrams,代码行数:32,


示例22: zigzag

bool zigzag(const EdgePoint* a, const Segment* s) {    COLA_UNUSED(a);    if(s!=NULL) {        COLA_ASSERT(!sameCorner(a,s->end));    }    return false;}
开发者ID:AidanDelaney,项目名称:adaptagrams,代码行数:7,


示例23: FILE_LOG

void ColaTopologyAddon::handleResizes(const cola::Resizes& resizeList,        unsigned n, std::valarray<double>& X, std::valarray<double>& Y,         cola::CompoundConstraints& ccs, vpsc::Rectangles& boundingBoxes,        cola::RootCluster* clusterHierarchy){    FILE_LOG(cola::logDEBUG) << "ColaTopologyAddon::handleResizes()...";    if(topologyNodes.empty()) {        COLA_ASSERT(topologyRoutes.empty());        return;    }    // all shapes to be resized are wrapped in a ResizeInfo and    // placed in a lookup table, resizes, indexed by id    ResizeMap resizes;    for(cola::Resizes::const_iterator r=resizeList.begin();r!=resizeList.end();++r) {        topology::ResizeInfo ri(topologyNodes[r->getID()],r->getTarget());        resizes.insert(std::make_pair(r->getID(),ri));    }    vpsc::Variables xvs, yvs;    vpsc::Constraints xcs, ycs;    cola::setupVarsAndConstraints(n, ccs, vpsc::HORIZONTAL, boundingBoxes,            clusterHierarchy, xvs, xcs, X);    cola::setupVarsAndConstraints(n, ccs, vpsc::VERTICAL, boundingBoxes,            clusterHierarchy, yvs, ycs, Y);    topology::applyResizes(topologyNodes, topologyRoutes, clusterHierarchy,            resizes, xvs, xcs, yvs, ycs);    for_each(xvs.begin(), xvs.end(), delete_object());    for_each(yvs.begin(), yvs.end(), delete_object());    for_each(xcs.begin(), xcs.end(), delete_object());    for_each(ycs.begin(), ycs.end(), delete_object());    FILE_LOG(cola::logDEBUG) << "ColaTopologyAddon::handleResizes()... done.";}
开发者ID:atis--,项目名称:adaptagrams,代码行数:31,


示例24: COLA_ASSERT

// Follow connected junctions and connectors from the given junction to// determine the hyperedge topology, saving objects to the deleted-objects// vectors as we go.bool HyperedgeRerouter::findAttachedObjects(size_t index,        JunctionRef *junction, ConnRef *ignore, ConnRefSet& hyperedgeConns){    bool validHyperedge = false;    m_deleted_junctions_vector[index].push_back(junction);    ConnRefList connectors = junction->attachedConnectors();    if (connectors.size() > 2)    {        // A valid hyperedge must have at least one junction with three        // connectors attached, i.e., more than two endpoints.        validHyperedge |= true;    }    for (ConnRefList::iterator curr  = connectors.begin();            curr != connectors.end(); ++curr)    {        if (*curr == ignore)        {            continue;        }        COLA_ASSERT(*curr != NULL);        validHyperedge |= findAttachedObjects(index, (*curr), junction, hyperedgeConns);    }    return validHyperedge;}
开发者ID:P-N-L,项目名称:adaptagrams,代码行数:32,



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


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