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 fba30097ae6ca68f2e397f176863fb3d3edd301c authored by Jonas on 04 October 2023, 14:52:00 UTC, committed by Jonas on 04 October 2023, 14:52:00 UTC
Add ref HAL
1 parent 384285f
  • Files
  • Changes
  • e3f3ace
  • /
  • ccvt_mod
  • /
  • ccvt_point.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:fba30097ae6ca68f2e397f176863fb3d3edd301c
directory badge
swh:1:dir:e8991d1fe9e0261371ab75c2a29fbe09ca322f5b
content badge
swh:1:cnt:e1e5dcdf2a025f2c9d1635c453762dcc2e5f8218

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 ...
ccvt_point.h
/*
  Copyright (C) 2009 Michael Balzer (michael.balzer@gmail.com)

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CCVT_POINT_H
#define CCVT_POINT_H

#include <assert.h>
#include <list>
#include <vector>

namespace ccvt {

  struct Point2 {

    typedef std::list<Point2>     List;
    typedef std::vector<Point2>   Vector;

    Point2() 
      : x(0), y(0) {
    }

    Point2(const double x, const double y)
      :x(x), y(y) {
    }

    Point2(const Point2& p) 
      : x(p.x), y(p.y) {
    }

    inline const double operator[](const int i) const {
      assert(i == 0 || i == 1);
      if (i == 0) {
        return x;
      }
      return y;
    }

    inline double operator[](const int i) {
      assert(i == 0 || i == 1);
      if (i == 0) {
        return x;
      }
      return y;
    }

    double  x;
    double  y;

    static const int D = 2;

  };

  struct Point3 {

    typedef std::list<Point3>   List;
    typedef std::vector<Point3> Vector;

    Point3() 
      : x(0), y(0), z(0) {
    }

    Point3(const double x, const double y, const double z)
      : x(x), y(y), z(z) {
    }

    Point3(const Point3& p) 
      : x(p.x), y(p.y), z(p.z) {
    }

    inline const double operator[](const int i) const {
      assert(i == 0 || i == 1 || i == 2);
      if (i == 0) {
        return x;
      }
      if (i == 1) {
        return y;
      }
      return z;
    }

    inline double operator[](const int i) {
      assert(i == 0 || i == 1 || i == 2);
      if (i == 0) {
        return x;
      }
      if (i == 1) {
        return y;
      }
      return z;
    }

    double  x;
    double  y;
    double  z;

    static const int D = 3;

  };

  template<int d>
  struct Point {

    typedef std::list<Point>   List;
    typedef std::vector<Point> Vector;

    Point() {
      for (int i = 0; i < d; ++i) {
        coordinates[i] = 0.0;
      }
    }

    Point(const double coordinates[d]) {
      for (int i = 0; i < d; ++i) {
        this->coordinates[i] = coordinates[i];
      }
    }

    Point(const Point& p) {
      for (int i = 0; i < d; ++i) {
        coordinates[i] = p.coordinates[i];
      }
    }

    inline const double operator[](const int i) const {
      assert(i >= 0 && i < d);
      return coordinates[i];
    }

    inline double operator[](const int i) {
      assert(i >= 0 && i < d);
      return coordinates[i];
    }

    static const int D = d;

  private:

    double coordinates[d];

  };

}

#endif  // CCVT_POINT_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