Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 1f7801656c9e30ee4b174b6dede619f383555b5f authored by IuricichF on 14 May 2016, 20:29:04 UTC, committed by IuricichF on 14 May 2016, 20:29:04 UTC
Automatically set the absolute paths for the .pvsm files in dist/ folder
1 parent 1077952
  • Files
  • Changes
  • 681957e
  • /
  • source
  • /
  • LibMesh
  • /
  • Edge.h
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:1f7801656c9e30ee4b174b6dede619f383555b5f
directory badge
swh:1:dir:26da26f21e20c537231a6a2a775ea0e14c30ac05
content badge
swh:1:cnt:0f166863c3db334834e7afef7555c7ae100d057b

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Edge.h
#ifndef EDGE_H
#define EDGE_H
#include "Vertex3D.h"
#include <algorithm>

using namespace std;

    // Class for represeting edges explicitly
    class Edge{
    private:
         int vertexes[2]; // Indices of the endpoints
    public:

        // Constructor
        inline Edge(){}
        inline Edge(int vi1, int vi2){
            vertexes[0]=min(vi1,vi2);
            vertexes[1]=max(vi1,vi2);
        }

        // Smaller-index endpoint getter
        inline int minindex() const{return vertexes[0];}

        // Bigger-index endpoint getter
        inline int maxindex() const{return vertexes[1];}

        inline int EV(int vPos) const
        {
            return vertexes[vPos];
        }

        //index of vertex v inside the edge
        inline short vertexindex(int v){
            if(vertexes[0]==v) return 0;
            if(vertexes[1]==v) return 1;
            return -1;
        }

        // Operators --------
        inline bool operator==(Edge edge){
            if(minindex()!=edge.minindex()) return false;
            if(maxindex()!=edge.maxindex()) return false;
            return true;
        }

        inline bool operator!=(Edge edge){
            return !((*this)==(edge));
        }

        inline bool operator<(Edge edge) const{
            if(maxindex() < edge.maxindex()) return true;
            else if(maxindex() == edge.maxindex() && minindex() < edge.minindex()) return true;
            else return false;
        }

        inline bool operator>(Edge edge) const{
            if(maxindex() > edge.maxindex()) return true;
            else if(maxindex() == edge.maxindex() && minindex() > edge.minindex()) return true;
            else return false;
        }


    };

#endif // EDGE_H
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API