Skip to content

Commit

Permalink
updated documentation and toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ebertolazzi committed Apr 1, 2021
1 parent 02239ae commit c59e5ca
Show file tree
Hide file tree
Showing 882 changed files with 61,518 additions and 95,265 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,15 @@ toolbox/license.txt
docs_build/xml
docs_build/sphinx/api
docs_build/sphinx/_build
docs_build/sphinx/api-c
docs_build/sphinx/api-cpp
docs_build/sphinx/api-matlab
docs_build/sphinx_c/_build
docs_build/sphinx_c/api-c
docs_build/sphinx_cpp/_build
docs_build/sphinx_cpp/api-cpp
docs_build/sphinx_matlab/_build
docs_build/sphinx_matlab/api-matlab
docs_build/xml-c
docs_build/xml-cpp
docs_build/xml-matlab
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ FOREACH (F ${S})
FILE( RELATIVE_PATH RF ${CMAKE_CURRENT_SOURCE_DIR} "${F}" )
LIST( APPEND HEADERS ${RF} )
ENDFOREACH (F ${S})
FILE( GLOB S ./src/*.hxx )
FOREACH (F ${S})
FILE( RELATIVE_PATH RF ${CMAKE_CURRENT_SOURCE_DIR} "${F}" )
LIST( APPEND HEADERS ${RF} )
ENDFOREACH (F ${S})

INCLUDE_DIRECTORIES( src lib3rd/include )

Expand Down
143 changes: 143 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
Splines |Build Status| |View Splines on File Exchange|
======================================================

Introduction
------------

``Splines`` is a set of C++ classes (with MATLAB mex interface) which
implements varios spline interpolation.

Matlab Toolbox
--------------

To use in MATLAB install the toolbox ``Splines.mltbx`` then compile the
files running ``CompileSplinesLib`` (available at the
`link <https://github.com/ebertolazzi/Splines/releases>`__)

C++ Usage
---------

The usage is simple:

.. code:: cpp
#include "Splines.hh"
using namespace SplinesLoad;
// ....
CubicSpline spline;
double x[] = {1,2,3,4};
double y[] = {3,1,1,3};
spline.build(x,y,4); // build a cubic spline with 4 points
cout << spline(1.1) << '\n'; // spline at x = 1.1
cout << spline.D(1.1) << '\n'; // spline first derivative at x = 1.1
cout << spline.DD(1.1) << '\n'; // spline second derivative at x = 1.1
cout << spline.DDD(1.1) << '\n'; // spline third derivative at x = 1.1
splines can be built incrementally

.. code:: cpp
#include "Splines.hh"
using namespace SplinesLoad;
// ....
CubicSpline spline;
spline . pushBack( 1, 3 );
spline . pushBack( 2, 1 );
spline . pushBack( 3, 1 );
spline . pushBack( 4, 3 );
spline . build();
cout << spline(1.1) << '\n'; // spline at x = 1.1
cout << spline.D(1.1) << '\n'; // spline first derivative at x = 1.1
cout << spline.DD(1.1) << '\n'; // spline second derivative at x = 1.1
cout << spline.DDD(1.1) << '\n'; // spline third derivative at x = 1.1
or by using standard vector

.. code:: cpp
#include "Splines.hh"
#include <vector>
using namespace SplinesLoad;
using namespace std;
// ....
CubicSpline spline;
std::vector x, y;
x.push_back(1); y.push_back(3);
x.push_back(2); y.push_back(1);
x.push_back(3); y.push_back(1);
x.push_back(4); y.push_back(3);
spline . build(x,y);
cout << spline(1.1) << '\n'; // spline at x = 1.1
cout << spline.D(1.1) << '\n'; // spline first derivative at x = 1.1
cout << spline.DD(1.1) << '\n'; // spline second derivative at x = 1.1
cout << spline.DDD(1.1) << '\n'; // spline third derivative at x = 1.1
Compile and tests
-----------------

**Using makefile**

Edit makefile file to match compiler of your OS and do:

.. code:: sh
make
**Using rakefile**

.. code:: sh
rake build_win # on windows
rake build_linux # on linux
rake build_osx # on mac
To run the test

.. code:: sh
make run # using makefile
rake run # using rake on linux and osx
rake run_win # using rake on windows
Online Documentation
--------------------

Available at: http://ebertolazzi.github.io/Splines

Developer
---------

| Enrico Bertolazzi
| Dipartimento di Ingegneria Industriale
| Università degli Studi di Trento
| email: [email protected]
References
----------

- **F.N. Fritsch and R.E. Carlson**,
*Monotone Piecewise Cubic Interpolation*,
SIAM Journal of Numerical Analysis, Vol.17, No. 2, pp. 238-246, 1980.

- **Hiroshi Akima**,
*Journal of the ACM*,
Vol.17, No. 4, 589-602, 1970.

- **Hiroshi Akima**,
*A Method of Bivariate Interpolation and Smooth Surface Fitting for Irregularly Distributed Data Points*.
ACM Transactions on Mathematical Software, Vol.4, 148-164, 1978.

.. |Build Status| image:: https://travis-ci.org/ebertolazzi/Splines.svg?branch=master
:target: https://travis-ci.org/ebertolazzi/Splines
.. |View Splines on File Exchange| image:: https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg
:target: https://www.mathworks.com/matlabcentral/fileexchange/54481-splines
64 changes: 29 additions & 35 deletions README.md → README_OLD.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,25 @@ Splines
[![Build Status](https://travis-ci.org/ebertolazzi/Splines.svg?branch=master)](https://travis-ci.org/ebertolazzi/Splines)
[![View Splines on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/54481-splines)

<br>
### Introduction

[Splines](https://github.com/ebertolazzi/Splines)
is a set of C++ classes (with MATLAB mex interface) which
``Splines`` is a set of C++ classes (with MATLAB mex interface) which
implements varios spline interpolation.
The classes are the following:

- ConstantSpline, for piecewise constants functions
- LinearSpline, for piecewise linear interpolation
- CubicSpline, for classical cubic spline interpolation
- AkimaSpline, for Akima "non oscillatory" spline interpolation
- BesselSpline, for Bessel "non oscillatory" spline interpolation
- PchipSpline,
- QuinticSpline, Simple quintic spline based on PCHIP

### References

- F.N. Fritsch and R.E. Carlson,
Monotone Piecewise Cubic Interpolation,<br>
SIAM Journal of Numerical Analysis, Vol. 17, No. 2, pp. 238-246,
April 1980.

### Matlab

To use in MATLAB install the toolbox `Splines.mltbx` then compile the files running `CompileSplinesLib` (available at [releases](https://github.com/ebertolazzi/Splines/releases))
### Matlab Toolbox

To use in MATLAB install the toolbox `Splines.mltbx` then compile the files running `CompileSplinesLib` (available at the [link](https://github.com/ebertolazzi/Splines/releases))

### C++ Usage

The usage is simple:

~~~~~~~~~~~~~
```cpp
#include "Splines.hh"
using namespace SplinesLoad;

....
// ....

CubicSpline spline;
double x[] = {1,2,3,4};
Expand All @@ -50,15 +33,15 @@ cout << spline(1.1) << '\n'; // spline at x = 1.1
cout << spline.D(1.1) << '\n'; // spline first derivative at x = 1.1
cout << spline.DD(1.1) << '\n'; // spline second derivative at x = 1.1
cout << spline.DDD(1.1) << '\n'; // spline third derivative at x = 1.1
~~~~~~~~~~~~~
```
splines can be built incrementally
~~~~~~~~~~~~~
```cpp
#include "Splines.hh"
using namespace SplinesLoad;
....
// ....
CubicSpline spline;
Expand All @@ -72,17 +55,17 @@ cout << spline(1.1) << '\n'; // spline at x = 1.1
cout << spline.D(1.1) << '\n'; // spline first derivative at x = 1.1
cout << spline.DD(1.1) << '\n'; // spline second derivative at x = 1.1
cout << spline.DDD(1.1) << '\n'; // spline third derivative at x = 1.1
~~~~~~~~~~~~~
```

or by using standard vector

~~~~~~~~~~~~~
```cpp
#include "Splines.hh"
#include <vector>
using namespace SplinesLoad;
using namespace std;

....
// ....

CubicSpline spline;
std::vector x, y;
Expand All @@ -96,7 +79,7 @@ cout << spline(1.1) << '\n'; // spline at x = 1.1
cout << spline.D(1.1) << '\n'; // spline first derivative at x = 1.1
cout << spline.DD(1.1) << '\n'; // spline second derivative at x = 1.1
cout << spline.DDD(1.1) << '\n'; // spline third derivative at x = 1.1
~~~~~~~~~~~~~
```

### Compile and tests

Expand Down Expand Up @@ -128,11 +111,22 @@ To run the test

Available at: [http://ebertolazzi.github.io/Splines](http://ebertolazzi.github.io/Splines)

* * *
### Developer

Enrico Bertolazzi<br>
Dipartimento di Ingegneria Industriale<br>
Universita` degli Studi di Trento<br>
Enrico Bertolazzi
Dipartimento di Ingegneria Industriale
Università degli Studi di Trento
email: [email protected]

* * *
### References

- *F.N. Fritsch and R.E. Carlson*,
Monotone Piecewise Cubic Interpolation,
SIAM Journal of Numerical Analysis,
Vol.17, No. 2, pp. 238-246, 1980.

- *Hiroshi Akima*, Journal of the ACM,
Vol.17, No. 4, 589-602, 1970.

- *Hiroshi Akima*, A Method of Bivariate Interpolation and Smooth Surface Fitting for Irregularly Distributed Data Points.
ACM Transactions on Mathematical Software, Vol.4, 148-164, 1978.
2 changes: 1 addition & 1 deletion Splines.prj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<deployment-project plugin="plugin.toolbox" plugin-version="1.0">
<configuration build-checksum="2141474772" file="/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines/Splines.prj" location="/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines" name="Splines" target="target.toolbox" target-name="Package Toolbox">
<configuration build-checksum="1526834762" file="/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines/Splines.prj" location="/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines" name="Splines" target="target.toolbox" target-name="Package Toolbox">
<param.appname>Splines</param.appname>
<param.authnamewatermark>Enrico Bertolazzi</param.authnamewatermark>
<param.email>[email protected]</param.email>
Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 56f7eb05eb27aab67f3439712c87a36f
config: 3d34a6afae63f155f41ce9d9a844bfb3
tags: 645f666f9bcd5a90fca523b33c5a78b7
19 changes: 19 additions & 0 deletions docs/_sources/api-c/class_view_hierarchy.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Class Hierarchy
---------------


.. raw:: html

<div id="class-treeView"></div>
<script type="text/javascript">
function getClassHierarchyTree() {
return [
]
}
</script><!-- end getClassHierarchyTree() function -->

.. end raw html for treeView
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _dir__Users_enrico_Ricerca_develop_C++_pins-mechatronix_LibSources_submodules_Splines_src:


Directory src
=============


*Directory path:* ``/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines/src``


Files
-----

- :ref:`file__Users_enrico_Ricerca_develop_C++_pins-mechatronix_LibSources_submodules_Splines_src_SplinesCinterface.h`


Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ File SplinesCinterface.cc
|exhale_lsh| :ref:`Parent directory <dir__Users_enrico_Ricerca_develop_C++_pins-mechatronix_LibSources_submodules_Splines_src>` (``/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines/src``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

.. contents:: Contents
:local:
:backlinks: none

Definition (``/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines/src/SplinesCinterface.cc``)
--------------------------------------------------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ File SplinesCinterface.h
|exhale_lsh| :ref:`Parent directory <dir__Users_enrico_Ricerca_develop_C++_pins-mechatronix_LibSources_submodules_Splines_src>` (``/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines/src``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

.. contents:: Contents
:local:
:backlinks: none

Definition (``/Users/enrico/Ricerca/develop/C++/pins-mechatronix/LibSources/submodules/Splines/src/SplinesCinterface.h``)
-------------------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -35,17 +40,17 @@ Functions

- :ref:`exhale_function__splines_cinterface_8h_1af29f47a6ce8296c7fb0f4021b35997df`

- :ref:`exhale_function__splines_cinterface_8h_1aa94fa6a76750597218338b0ff491b817`
- :ref:`exhale_function__splines_cinterface_8h_1a60354e5e10bea276df88937a859e36a4`

- :ref:`exhale_function__splines_cinterface_8h_1a26c975e5c90f743ea58c64d4cd55fec1`
- :ref:`exhale_function__splines_cinterface_8h_1a5eb493ea98ed5f24685c240c5bcfb390`

- :ref:`exhale_function__splines_cinterface_8h_1ace3792c09b43ee557ad553f7c385fb9f`
- :ref:`exhale_function__splines_cinterface_8h_1aa9a0988e747d636bd7a48b7dfb2b697e`

- :ref:`exhale_function__splines_cinterface_8h_1a38c100aef53f216e97558c861963ef64`
- :ref:`exhale_function__splines_cinterface_8h_1a9352cde120110961745d3cd48d67de8f`

- :ref:`exhale_function__splines_cinterface_8h_1a1b0aae40600c1c5485508d2f9350c9e4`
- :ref:`exhale_function__splines_cinterface_8h_1a91da53c00f32c7e4f4aeaf8cdc8c4f70`

- :ref:`exhale_function__splines_cinterface_8h_1a17ad351f7572c6eb7f8fbc1cdc5068bc`
- :ref:`exhale_function__splines_cinterface_8h_1ac15f1700b8ccf2d2e5266992cf38c132`

- :ref:`exhale_function__splines_cinterface_8h_1a9b683ceadd58baaadaa58ca28268360a`

Expand Down
Loading

0 comments on commit c59e5ca

Please sign in to comment.