Skip to content

Commit

Permalink
Merge branch 'fix/ros2_installation'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gonzalo-Mier committed Jun 17, 2024
2 parents 485988e + a72ac58 commit 9465455
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 955 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Credits and more info
---------------------

This library is only possible thanks to `GDAL <https://gdal.org/index.html>`_ who provides the basic types of this library.
Other great libraries that made Fields2Cover possible are `OR-tools <https://developers.google.com/optimization>`__, `hbanzhaf/steering_functions <https://github.com/hbanzhaf/steering_functions>`_, `nlohmann/json <https://github.com/nlohmann/json/>`_, `leethomason/tinyxml2 <https://github.com/leethomason/tinyxml2>`_, `ttk592/spline <https://github.com/ttk592/spline>`_ and `alandefreitas/matplotplusplus <https://github.com/alandefreitas/matplotplusplus>`_
Other great libraries that made Fields2Cover possible are `OR-tools <https://developers.google.com/optimization>`__, `hbanzhaf/steering_functions <https://github.com/hbanzhaf/steering_functions>`_, `nlohmann/json <https://github.com/nlohmann/json/>`_, `leethomason/tinyxml2 <https://github.com/leethomason/tinyxml2>`_, `joshhooker/CubicSplineClass <https://github.com/joshhooker/CubicSplineClass>`_ and `alandefreitas/matplotplusplus <https://github.com/alandefreitas/matplotplusplus>`_


This code repository is part of the project Fields2Cover which is (partly) financed by the Dutch Research Council (NWO).
Expand Down
1 change: 1 addition & 0 deletions include/fields2cover.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


#include "fields2cover/utils/random.h"
#include "fields2cover/utils/spline.h"
#include "fields2cover/utils/transformation.h"
#include "fields2cover/utils/parser.h"
#include "fields2cover/utils/visualizer.h"
Expand Down
74 changes: 74 additions & 0 deletions include/fields2cover/utils/spline.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* spline.h
*
* The original version of this file can be found at with:
* https://github.com/joshhooker/CubicSplineClass
*
* This file has MIT license.
*
* Actual version is modified to adapt to Fields2Cover requirements.
*
* ---------------------------------------------------------------------
* Copyright (c) 2017 Joshua Hooker
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ---------------------------------------------------------------------
*
*/


#ifndef FIELDS2COVER_UTILS_SPLINE_H_
#define FIELDS2COVER_UTILS_SPLINE_H_

#include <vector>
#include <string>

namespace f2c {

class CubicSpline {
public:
CubicSpline();
CubicSpline(const std::vector<double> &x, const std::vector<double> &y,
bool monotonic = false);

~CubicSpline();

void SetPoints(const std::vector<double> &x, const std::vector<double> &y,
bool monotonic = false);

double operator()(double x) const;


private:
size_t size_{0};
std::vector<double> x_vec_, y_vec_;
std::vector<double> b_vec_, c_vec_, d_vec_;

bool monotonic_{false};

void SetSpline();

void SetSplineCubic();

void check_error(bool cond, const std::string& msg) const;
};

} // namespace f2c

#endif // FIELDS2COVER_UTILS_SPLINE_H_
Loading

0 comments on commit 9465455

Please sign in to comment.