camfr3
======

camfr3 is a Python 3 port of CAMFR (CAvity Modelling FRamework). It is
distributed under the name "camfr3" because the PyPI name "camfr" belongs to
the original author. The Python module is still imported as "camfr".

CAMFR was written by Peter Bienstman at the Photonics Research Group,
Department of Information Technology (INTEC), Ghent University, Belgium,
with contributions from the people listed in AUTHORS.

    Copyright (C) 1998-2007 Peter Bienstman - Ghent University

Original project:  http://camfr.sourceforge.net/
Upstream fork:     https://github.com/demisjohn/CAMFR

The Python 3 port (branch python3-port) is maintained by
Abdelfettah Hadij-ElHouati. Every change made for the port is documented in
PORTING_JOURNAL.md.

If you use this software in published work, please cite:

    P. Bienstman and R. Baets, "Optical modelling of photonic crystals and
    VCSELs using eigenmode expansion and perfectly matched layers",
    Optical and Quantum Electronics 33, 327-341 (2001).
    doi:10.1023/A:1010882531238

Licensing
---------

CAMFR is released under the GNU General Public License, version 2 (LICENSE).
The older permissive notice in COPYRIGHT is kept as distributed.

camfr/math/ contains third-party numerical code:

- The SLATEC Bessel routines (camfr/math/bessel/slatec/): US government
  work, public domain. Some of them were also published as ACM algorithms
  (e.g. D. E. Amos, TOMS Algorithm 644); the copies here are SLATEC's.
  SLATEC's machine constants (d1mach) come from Fortran intrinsics; the
  MACHAR routine (W. J. Cody, ACM TOMS 14, 1988) that computed them was
  removed (PORTING_JOURNAL.md, entry 58).

- Brent's root finder and minimiser (camfr/math/calculus/root/,
  minimum/): adapted from Oleg Kiselyov's Numerical Math Class Library,
  which its author placed in the public domain ("All the code is in Public
  Domain", https://okmij.org/ftp/NumMath.html).

- The Patterson quadrature (camfr/math/calculus/quadrature/ and
  camfr/math/calculus/croot/patterson_z_n.cpp): the formulas of
  T. N. L. Patterson (Math. Comp. 22, 1968) in the representation of
  F. T. Krogh and W. V. Snyder. The coefficients and the index scheme come
  from dinta.f of the JPL MATH77 library (https://www.netlib.org/math/),
  under this licence:

    Copyright (c) 1996 California Institute of Technology, Pasadena,
    California.  ALL RIGHTS RESERVED.  Based on Government Sponsored
    Research NAS7-03001.  Redistribution and use in source and binary
    forms, with or without modification, are permitted provided that the
    following conditions are met: Redistributions of source code must
    retain this copyright notice, this list of conditions and the
    following disclaimer.  Redistributions in binary form must reproduce
    the above copyright notice, this list of conditions and the following
    disclaimer in the documentation and/or other materials provided with
    the distribution.  Neither the name of the California Institute of
    Technology (Caltech) nor the names of its contributors may be used to
    endorse or promote products derived from this software without
    specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE
    COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
    WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
    BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
    IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

  Until camfr3 3.0.0a3 this code was a C++ translation of ACM TOMS
  Algorithm 699 (Krogh and Snyder, 1991), which falls under ACM's software
  licence (non-commercial use only). It was rewritten on the basis of
  MATH77 (PORTING_JOURNAL.md, entry 64); the results are bit-identical.

Two vendored Python modules come with permissive licences, reproduced
here as they require:

- camfr/gifmaker.py, from the Python Imaging Library (PIL):

    Copyright (c) 1997-2011 by Secret Labs AB
    Copyright (c) 1995-2011 by Fredrik Lundh

    By obtaining, using, and/or copying this software and/or its
    associated documentation, you agree that you have read, understood,
    and will comply with the following terms and conditions:

    Permission to use, copy, modify and distribute this software and its
    documentation for any purpose and without fee is hereby granted,
    provided that the above copyright notice appears in all copies, and
    that both that copyright notice and this permission notice appear in
    supporting documentation, and that the name of Secret Labs AB or the
    author not be used in advertising or publicity pertaining to
    distribution of the software without specific, written prior
    permission.

    SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
    ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
    OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

- camfr/TkPlotCanvas.py, from ScientificPython 2.4 (Konrad Hinsen; later
  ScientificPython releases changed to CeCILL, but this copy predates
  them):

    Copyright 1997-2001 by Konrad Hinsen, except as noted below.

    Permission to use, copy, modify, and distribute this software and its
    documentation for any purpose and without fee is hereby granted,
    provided that the above copyright notice appear in all copies and
    that both that copyright notice and this permission notice appear in
    supporting documentation.

    THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
    INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
    EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
    CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
    USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.

The Jenkins-Traub polynomial root finder (ACM Algorithm 419, under ACM's
software licence) was removed in camfr3 and replaced by an eigenvalue
method (PORTING_JOURNAL.md, entry 56). No code under ACM's software licence
remains.
