Metadata-Version: 1.1
Name: finitediff
Version: 0.2.4
Summary: Finite difference weights for any derivative order on arbitrarily spaced grids.
Home-page: https://github.com/bjodah/finitediff
Author: Björn Dahlgren
Author-email: bjodah@DELETEMEgmail.com
License: BSD
Download-URL: https://github.com/bjodah/finitediff/archive/v0.2.4.tar.gz
Description: finitediff
        ==========
        .. image:: http://hera.physchem.kth.se:9090/api/badges/bjodah/finitediff/status.svg
           :target: http://hera.physchem.kth.se:9090/bjodah/finitediff
           :alt: Build status
        .. image:: https://img.shields.io/pypi/v/finitediff.svg
           :target: https://pypi.python.org/pypi/finitediff
           :alt: PyPI version
        .. image:: https://img.shields.io/badge/python-2.7,3.4,3.5-blue.svg
           :target: https://www.python.org/
           :alt: Python version
        .. image:: https://img.shields.io/pypi/l/finitediff.svg
           :target: https://github.com/bjodah/finitediff/blob/master/LICENSE
           :alt: License
        .. image:: http://hera.physchem.kth.se/~finitediff/branches/master/htmlcov/coverage.svg
           :target: http://hera.physchem.kth.se/~finitediff/branches/master/htmlcov
           :alt: coverage
        
        ``finitediff`` containts two implementations (`Fortran 90
        <src/finitediff_fort.f90>`_ and `C++ <include/finitediff_templated.hpp>`_) version of Begnt Fornberg's
        formulae for generation of finite difference weights on aribtrarily
        spaced one dimensional grids. The finite difference weights can be
        used for optimized inter-/extrapolation data series for up to
        arbitrary derivative order. Python_ bindings are provided.
        
        .. _Python: https://www.python.org
        .. _finitediff: https://github.com/bjodah/finitediff
        
        
        Capabilities
        ============
        finitediff currently provides callbacks for estimation of derivatives
        or interpolation either at a single point or over an array (available 
        from the Python bindings). 
        
        The user may also manually generate the corresponding weights. (see
        ``populate_weights``) 
        
        
        Documentation
        -------------
        Autogenerated API documentation for latest stable release is found here:
        `<https://pythonhosted.org/finitediff>`_
        (and development docs for the current master branch are found here:
        `<http://hera.physchem.kth.se/~finitediff/branches/master/html>`_).
        
        Examples
        --------
        Generating finite difference weights is simple using C++11:
        
        .. code:: C++
        
          #include "finitediff_templated.hpp"
          #include <vector>
          #include <iostream>
        
          int main(){
            std::vector<double> x {-1, 0, 1};
            auto coeffs = finitediff::generate_weights(0.0, x3, 2);
            std::cout << "Zeroth order: " << coeffs[0] << " " << coeffs[1] << " " << coeffs[2] << std::endl;
            std::cout << "First order: "  << coeffs[3] << " " << coeffs[4] << " " << coeffs[5] << std::endl;
            std::cout << "Second order: " << coeffs[6] << " " << coeffs[7] << " " << coeffs[8] << std::endl;
          }
        
        ::
        
           $ cd examples/
           $ g++ -std=c++11 demo.cpp -I../include
           $ ./a.out
           Zeroth order: 0 1 -0
           First order: -0.5 0 0.5
           Second order: 1 -2 1
        
        and of course using the python bindings:
        
        .. code:: python
        
           >>> from finitediff import get_weights
           >>> import numpy as np
           >>> c = get_weights(np.array([-1., 0, 1]), 0, maxorder=1)
           >>> np.allclose(c[:, 1], [-.5, 0, .5])
           True
           
        
        see the ``examples/`` directory for more examples.
        
        Installation
        ------------
        Simplest way to install finitediff is to use the
        `Conda package manager <http://conda.pydata.org/docs/>`_:
        
        ::
        
           $ conda install -c bjodah finitediff pytest
        
        alternatively you may also use `pip`:
        
        ::
        
           $ python -m pip install --user finitediff
        
        (you can skip the ``--user`` flag if you have got root permissions), to run the
        tests you need ``pytest`` too:
        
        ::
        
           $ python -m pip install --user --upgrade pytest
           $ python -m pytest --pyargs finitediff
        
        
        Dependencies
        ============
        You need either a C++ or a Fortran 90 compiler. On a debian based linux system you can install it easily by typing::
        
            $ sudo apt-get install gfortran g++
        
        Optional dependencies (for Python bindings):
        
        - Python header files (``sudo apt-get install python-dev``)
        - Python
        - NumPy
        - Cython
        - pycompilation
        - pytest
        
        see CI scripts for examples.
        
        Notes
        =====
        There is a git subtree under finitediff, update through::
        
            git subtree pull --prefix finitediff/newton_interval newton_interval master --squash
        
        
        where the repo "newton_interval" is https://github.com/bjodah/newton_interval.git
        
        First time you need to add it::
        
            git subtree add --prefix finitediff/newton_interval git://github.com/bjodah/newton_interval master
        
        
        (Users of Ubuntu 12.04 who want to use git subtree, see http://stackoverflow.com/questions/17797328)
        
        References
        ==========
        The algortihm is a Fortran 90 rewrite of:
        
        http://dx.doi.org/10.1137/S0036144596322507
        
        ::
        
            @article{fornberg_classroom_1998,
              title={Classroom note: Calculation of weights in finite difference formulas},
              author={Fornberg, Bengt},
              journal={SIAM review},
              volume={40},
              number={3},
              pages={685--691},
              year={1998},
              publisher={SIAM}
              doi={10.1137/S0036144596322507}
            }
            
        
        Which is based on an article of the same author:
        
        http://dx.doi.org/10.1090/S0025-5718-1988-0935077-0
        
        ::
        
            @article{fornberg_generation_1988,
              title={Generation of finite difference formulas on arbitrarily spaced grids},
              author={Fornberg, Bengt},
              journal={Mathematics of computation},
              volume={51},
              number={184},
              pages={699--706},
              year={1988}
              doi={10.1090/S0025-5718-1988-0935077-0}
            }
        
        
        License
        =======
        Open Source. Released under the very permissive "simplified
        (2-clause) BSD license". See LICENSE.txt for further details.
        
        
        Authors
        =======
        See file `AUTHORS <AUTHORS>`_ in root.
        
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
