[pynfft] 01/03: Imported Upstream version 1.2

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sat Jan 18 17:55:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository pynfft.

commit 850688fb06e7ebb5a9a78270cdd1164121da9f9b
Author: Ghislain Vaillant <ghisvail at gmail.com>
Date:   Sat Jan 18 17:46:58 2014 +0000

    Imported Upstream version 1.2
---
 CHANGELOG.txt                        | 119 ++++++
 CONTRIBUTING.rst                     |  19 +
 COPYING.txt                          | 675 +++++++++++++++++++++++++++++++++
 PKG-INFO                             |  34 ++
 README.rst                           | 100 +++++
 doc/Makefile                         | 153 ++++++++
 doc/source/api.rst                   |   7 +
 doc/source/api/nfft.rst              |  59 +++
 doc/source/api/util.rst              |  24 ++
 doc/source/conf.py                   | 242 ++++++++++++
 doc/source/index.rst                 |  54 +++
 doc/source/tutorial.rst              | 216 +++++++++++
 pyNFFT.egg-info/PKG-INFO             |  34 ++
 pyNFFT.egg-info/SOURCES.txt          |  28 ++
 pyNFFT.egg-info/dependency_links.txt |   1 +
 pyNFFT.egg-info/requires.txt         |   2 +
 pyNFFT.egg-info/top_level.txt        |   1 +
 pynfft/__init__.py                   |  20 +
 pynfft/cnfft3.pxd                    | 154 ++++++++
 pynfft/cnfft3util.pxd                |  34 ++
 pynfft/nfft.pyx                      | 707 +++++++++++++++++++++++++++++++++++
 pynfft/util.pyx                      |  83 ++++
 requirements.txt                     |   3 +
 setup.cfg                            |  13 +
 setup.py                             | 154 ++++++++
 tests/__init__.py                    |   0
 tests/test_nfft.py                   | 209 +++++++++++
 27 files changed, 3145 insertions(+)

diff --git a/CHANGELOG.txt b/CHANGELOG.txt
new file mode 100644
index 0000000..b7d6292
--- /dev/null
+++ b/CHANGELOG.txt
@@ -0,0 +1,119 @@
+Changelog
+=========
+
+Changes in version 1.2
+----------------------
+
+    * code refactoring, prepare for move to multi-precision version of NFFT
+    * break support for old 1.0.x API
+    * add option to precompute at construct time
+
+Changes in version 1.1.1
+------------------------
+
+    * simplify build system
+    * add support for pip dependencies
+    * simplify documentation tree
+    * add option for generating documentation in build system
+    * source distribution is now embedding the documentation
+
+Changes in version 1.1
+----------------------
+
+    * PEP 440 compliant version string
+    * more pythonic API, breaks compatibility with 1.0.x
+    * documentation update
+
+
+Changes in version 1.0.1
+------------------------
+
+    * update installation instructions
+    * change registration of cleanup routine to use Py_AtExit
+
+
+Changes in version 1.0
+----------------------
+
+    * simplify code base
+    * pynfft.nfft and pynfft.solver moved to pynfft
+    * revert support for multiple floating precision 
+    * fix missing documentation for the solver
+
+
+Changes in version 0.6
+----------------------
+
+    * pynfft.nfft: enable openmp support
+
+Changes in version 0.5
+----------------------
+
+    * pynfft.nfft: rewrite NFFT class internals to support multiple floating 
+      point precision, coming in a future version of libnfft3
+    * Documentation: first draft of the tutorial section
+
+Changes in version 0.4.1
+------------------------
+
+    * New simplified test suite.
+
+Changes in version 0.4
+----------------------
+
+    * Improved flag management: NFFT now only accepts the list of supported 
+      flags listed in its documentaton.
+    * pynfft.util: utility functions listed in nfft3util.h. Only, the random
+      initializers and Voronoi weights computation functions have been wrapped.
+    * Changelog is no longer part of the sphinx tree.
+
+Changes in version 0.3.1
+------------------------
+
+    * Fixed issue #1: crash in test_nfft due to use of MALLOC flags
+
+Changes in version 0.3
+----------------------
+
+    * Improve precomputation flag management in NFFT and Solver classes
+    * Various code improvements
+    * Update documentation for all modules
+
+Changes in version 0.2.4
+------------------------
+
+    * Add sphinx documentation
+
+Changes in version 0.2.3
+------------------------
+
+    * Level-up Solver class with the improvement made on NFFT
+    * Update test suite for pynfft.nfft
+
+Changes in version 0.2.2
+------------------------
+
+    * Completed switch to non-malloc'd arrays for x, f and f_hat. These are now managed by internal or external numpy arrays
+    * Remove management of obsolete MALLOC flags
+    * Fix broken test for non-contiguousness for external arrays
+
+Changes in version 0.2.1
+------------------------
+
+    * Added experimental support for external python arrays, which can replace the internal malloc'd x, f and f_hat
+
+Changes in version 0.2
+------------------------
+
+    * Added support for the solver component of the NFFT library
+
+Changes in version 0.1.1
+------------------------
+
+    * Added non-complete test coverage for pynfft.nfft
+
+Version 0.1
+-----------
+
+    * Initial release. Experimental support for the nfft component of the NFFT library
+
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
new file mode 100644
index 0000000..74601fe
--- /dev/null
+++ b/CONTRIBUTING.rst
@@ -0,0 +1,19 @@
+How to contribute to pyNFFT
+===========================
+
+Please feel free to [open issues][] and send pull requests on GitHub. When sending a pull request, please create a new feature branch, and send your pull
+request from that branch. Please do *not* send pull requests from your `master`
+branch because to avoid potential merge conflicts.
+
+Improving features
+-----------------
+
+The NFFT library contains a lot more features than the pyNFFT wrapper supports
+at the moment. If you are interested in developping one of these features, feel
+free to get coding and send me your contribution for inclusion to the project.
+
+Coding style
+------------
+
+This project follows the PEP8 coding guidelines. Please make sure your code has been tested with a code analysis tool such as `pyflakes <https://pypi.python.org/pypi/pyflakes>`_ and `pep8 <https://pypi.python.org/pypi/pep8>`_ before submitting it.
+
diff --git a/COPYING.txt b/COPYING.txt
new file mode 100644
index 0000000..10926e8
--- /dev/null
+++ b/COPYING.txt
@@ -0,0 +1,675 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..2985b06
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,34 @@
+Metadata-Version: 1.1
+Name: pyNFFT
+Version: 1.2
+Summary: A pythonic wrapper around NFFT
+Home-page: https://github.com/ghisvail/pyNFFT.git
+Author: Ghislain Vaillant
+Author-email: ghisvail at gmail.com
+License: UNKNOWN
+Description: "The NFFT is a C subroutine library for computing the
+        nonequispaced discrete Fourier transform (NDFT) in one or more dimensions, of
+        arbitrary input size, and of complex data."
+        
+        The NFFT library is licensed under GPLv2 and available at:
+            http://www-user.tu-chemnitz.de/~potts/nfft/index.php
+        
+        This wrapper provides a somewhat Pythonic access to some of the core NFFT
+        library functionalities and is largely inspired from the pyFFTW project
+        developped by Henry Gomersall (http://hgomersall.github.io/pyFFTW/).
+        
+        This project is still work in progress and is still considered beta quality. In
+        particular, the API is not yet frozen and is likely to change as the
+        development continues. Please consult the documentation and changelog for more
+        information.
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 3
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
+Classifier: Operating System :: POSIX :: Linux
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: Science/Research
+Classifier: Topic :: Scientific/Engineering
+Classifier: Topic :: Scientific/Engineering :: Mathematics
+Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..b5e3010
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,100 @@
+pyNFFT - a Pythonic wrapper around the NFFT library
+===================================================
+
+"The NFFT is a C subroutine library for computing the nonequispaced discrete
+Fourier transform (NDFT) in one or more dimensions, of arbitrary input size,
+and of complex data."
+
+The `NFFT library <http://www-user.tu-chemnitz.de/~potts/nfft/index.php>`_ 
+is licensed under GPLv2.
+
+This wrapper provides a somewhat Pythonic access to some of the core NFFT 
+library functionalities and is largely inspired from the pyFFTW project 
+developped by Henry Gomersall (http://hgomersall.github.io/pyFFTW/).
+
+The documentation is hosted on 
+`pythonhosted <http://pythonhosted.org/pyNFFT/>`_, the source code is 
+available on `github <https://github.com/ghisvail/pyNFFT>`_ and the 
+Python package index page is 
+`here <https://pypi.python.org/pypi/pyNFFT>`_.
+
+Usage
+-----
+
+See the `tutorial <http://pythonhosted.org/pyNFFT/tutorial.html>`_ 
+section of the documentation.
+
+Installation
+------------
+
+Support for pip/easy_install has been added via the `Python Package Index
+<http://pypi.python.org/pypi/>`_. The pyNFFT package can be installed via::
+        
+    pip install pynfft
+
+or::
+
+    easy_install pynfft
+
+Installation will fail if the NFFT library is not installed in a system-aware
+location. A workaround for this is to first call pip with::
+
+    pip install --no-install pynfft
+
+cd to where pip downloaded the package, then build with `setup.py`::
+
+    python setup.py build_ext -I <path_to_include> -L <path_to_lib>
+    -R <path_to_lib>
+
+and do a final call to pip::
+
+    pip install --no-download pynfft
+
+Building
+--------
+
+The pyNFFT package can be built from the cloned git repository by calling::
+
+    python setup.py build
+
+and then installed with::
+
+    python setup.py install
+
+The build process requires Cython in order to generate the cythonized 
+c-files and use them for creating the shared object.::
+
+    python setup.py build_ext --inplace
+
+If you installed the NFFT library in a non system-aware location, use 
+the `-I`, `-L` and `-R` flags. For instance, if your NFFT library is 
+installed in $HOME/local::
+
+    $python setup.py build_ext --inplace -I <path_to_include>
+    -L <path_to_lib> -R <path_to_lib>
+
+Build info
+----------
+
+The NFFT library has to be compiled with the --enable-openmp flag to 
+allow for the generation of the threaded version of the library. 
+Without it, any attempt to building the project will fail.
+
+Requirements
+------------
+
+- Python 2.7 or greater
+- Numpy 1.6 or greater
+- NFFT library 3.2 or greater, compiled with openMP support
+- Cython 0.12 or greater
+
+Contributing
+------------
+
+See the CONTRIBUTING file.
+
+License
+-------
+
+The pyNFFT project is licensed under the GPLv3. 
+See the bundled COPYING file for more details.
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..dda5b4a
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pyNFFT.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pyNFFT.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/pyNFFT"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pyNFFT"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/doc/source/api.rst b/doc/source/api.rst
new file mode 100644
index 0000000..3b53eb2
--- /dev/null
+++ b/doc/source/api.rst
@@ -0,0 +1,7 @@
+API Reference
+*************
+
+.. toctree::
+   
+   /api/nfft
+   /api/util
diff --git a/doc/source/api/nfft.rst b/doc/source/api/nfft.rst
new file mode 100644
index 0000000..d58a5d1
--- /dev/null
+++ b/doc/source/api/nfft.rst
@@ -0,0 +1,59 @@
+``pynfft`` - The core NFFT functionalities
+==========================================
+
+.. automodule:: pynfft
+
+NFFT Class
+----------
+
+.. autoclass:: pynfft.NFFT(f, f_hat, x=None, n=None, m=12, flags=None, *args, **kwargs)
+
+   .. autoattribute:: pynfft.NFFT.f
+
+   .. autoattribute:: pynfft.NFFT.f_hat
+
+   .. autoattribute:: pynfft.NFFT.x
+
+   .. autoattribute:: pynfft.NFFT.M
+
+   .. autoattribute:: pynfft.NFFT.d
+
+   .. autoattribute:: pynfft.NFFT.N
+
+   .. autoattribute:: pynfft.NFFT.N_total
+   
+   .. autoattribute:: pynfft.NFFT.n
+   
+   .. autoattribute:: pynfft.NFFT.m
+
+   .. autoattribute:: pynfft.NFFT.dtype
+
+   .. autoattribute:: pynfft.NFFT.flags
+
+   .. automethod:: pynfft.NFFT.precompute
+
+   .. automethod:: pynfft.NFFT.forward
+
+   .. automethod:: pynfft.NFFT.adjoint
+
+
+Solver Class
+------------
+
+.. autoclass:: pynfft.Solver(nfft_plan, flags=None)
+
+   .. autoattribute:: pynfft.Solver.w
+   
+   .. autoattribute:: pynfft.Solver.w_hat
+   
+   .. autoattribute:: pynfft.Solver.y
+
+   .. autoattribute:: pynfft.Solver.f_hat_iter
+
+   .. autoattribute:: pynfft.Solver.r_iter
+
+   .. autoattribute:: pynfft.Solver.flags
+
+   .. automethod:: pynfft.Solver.before_loop
+
+   .. automethod:: pynfft.Solver.loop_one_step
diff --git a/doc/source/api/util.rst b/doc/source/api/util.rst
new file mode 100644
index 0000000..b27326d
--- /dev/null
+++ b/doc/source/api/util.rst
@@ -0,0 +1,24 @@
+``pynfft.util`` - Utility functions
+===================================
+
+.. automodule:: pynfft.util
+
+Functions used for initialization of :class:`pynfft.NFFT` attributes in test
+scripts. For instance::
+
+   >>> from pynfft.util import vrand_unit_complex, vrand_shifted_unit_double
+   >>> x = np.empty(20, dtype=np.float64)
+   >>> vrand_shifted_unit_double(x)
+   >>> f_hat = np.empty(16, dtype=np.complex128)
+   >>> vrand_unit_complex(f_hat)
+
+.. autofunction:: pynfft.util.vrand_unit_complex(x)
+
+.. autofunction:: pynfft.util.vrand_shifted_unit_double(x)
+
+Functions used for computing the density compensation weights necessary for the
+iterative solver and adjoint NFFT.
+
+.. autofunction:: pynfft.util.voronoi_weights_1d(w, x)
+
+.. autofunction:: pynfft.util.voronoi_weights_S2(w, xi)
diff --git a/doc/source/conf.py b/doc/source/conf.py
new file mode 100644
index 0000000..8000861
--- /dev/null
+++ b/doc/source/conf.py
@@ -0,0 +1,242 @@
+# -*- coding: utf-8 -*-
+#
+# pyNFFT documentation build configuration file, created by
+# sphinx-quickstart on Fri Nov  8 19:44:07 2013.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.insert(0, os.path.abspath('../..'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'pyNFFT'
+copyright = u'2013, Ghislain Vaillant'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '1.2'
+# The full version, including alpha/beta/rc tags.
+release = '1.2'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+#html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'pyNFFTdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'pyNFFT.tex', u'pyNFFT Documentation',
+   u'Ghislain Vaillant', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', 'pynfft', u'pyNFFT Documentation',
+     [u'Ghislain Vaillant'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+  ('index', 'pyNFFT', u'pyNFFT Documentation',
+   u'Ghislain Vaillant', 'pyNFFT', 'One line description of project.',
+   'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
diff --git a/doc/source/index.rst b/doc/source/index.rst
new file mode 100644
index 0000000..d4a63e4
--- /dev/null
+++ b/doc/source/index.rst
@@ -0,0 +1,54 @@
+.. pyNFFT documentation master file, created by
+   sphinx-quickstart on Thu May 30 19:37:18 2013.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to pyNFFT's documentation!
+==================================
+
+Introduction
+------------
+
+**pyNFFT** is a set of Pythonic wrapper classes around the `NFFT library 
+<http://www-user.tu-chemnitz.de/~potts/nfft/>`_. The aim is to provide access 
+to the core functionalities of the library using a more straightforward 
+instantiation through Python classes, while keeping similar naming 
+conventions to the C-library structures and routines.
+
+Right now, only the NFFT and solver components of the library are supported.
+Support for other components `may` come in the future, but is conditionned 
+by the author's need for them. If you're interested in getting these components
+wrapped as well, please feel free to contribute.
+
+The design of the pyNFFT package assumes that the NFFT has been **compiled with
+OpenMP support**.
+
+The core interface of the NFFT is provided by the unified class, 
+:class:`pynfft.NFFT`. The solver interface is in 
+:class:`pynfft.Solver`.
+
+A comprehensive unittest suite is included with the source on the repository.
+The suite will be updated as more functionalities get introducted.
+
+Content
+-------
+
+.. toctree::
+   :maxdepth: 2
+
+   tutorial.rst
+   api.rst
+
+About this documentation
+------------------------
+
+This documentation is generated using the `Sphinx
+<http://sphinx.pocoo.org/>`_ documentation generator.
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst
new file mode 100644
index 0000000..a523865
--- /dev/null
+++ b/doc/source/tutorial.rst
@@ -0,0 +1,216 @@
+Using the NFFT
+==============
+
+In this tutorial, we assume that you are already familiar with the 
+`non-uniform discrete Fourier transform 
+<http://en.wikipedia.org/wiki/Non-uniform_discrete_Fourier_transform>`_ 
+and the `NFFT library <http://www-user.tu-chemnitz.de/~potts/nfft/>`_ 
+used for fast computation of NDFTs. 
+
+Like the `FFTW library <http://www.fftw.org/>`_, the NFFT library relies 
+on a specific data structure, called a plan, which stores all the data 
+required for efficient computation and re-use of the NDFT. Each plan is 
+tailored for a specific transform, depending on the geometry, level of 
+precomputation and design parameters. The `NFFT manual 
+<http://www-user.tu-chemnitz.de/~potts/nfft/guide3/html/index.html>`_ 
+contains comprehensive explanation on the NFFT implementation.
+
+The pyNFFT package provides a set of Pythonic wrappers around the main 
+data structures of the NFFT library. Use of Python wrappers allows to 
+simplify the manipulation of the library, whilst benefiting from the 
+significant speedup provided by its C-implementation. Although the NFFT 
+library supports many more applications, only the NFFT and iterative 
+solver components have been wrapped so far. 
+
+This tutorial is split into three main sections. In the first one, the 
+general workflow for using the core of the 
+:class:`pynfft.NFFT` class will be explained. Then, the 
+:class:`pynfft.NFFT` class API will be detailed and illustrated with 
+examples for the univariate and multivariate cases. Finally, the 
+:class:`pynfft.Solver` iterative solver class will be briefly presented. 
+
+.. _workflow:
+ 
+Workflow
+--------
+
+For users already familiar with the NFFT C-library, the workflow is 
+basically the same. It consists in the following three steps:
+
+    #. instantiation
+
+    #. precomputation
+
+    #. execution
+
+In step 1, information such as the geometry of the transform or the 
+desired level of precomputation is provided to the constructor, which 
+takes care of allocating the internal arrays of the plan.
+
+Precomputation (step 2) can be started once the location of the 
+non-uniform nodes have been set to the plan. Depending on the size of 
+the transform and level of precomputation, this step may take some time.
+
+Finally (step 3), the forward or adjoint NFFT is computed by first 
+setting the input data in either `f_hat` (forward) or `f` (adjoint), 
+calling the corresponding function, and reading the output in `f` 
+(forward) or `f_hat` (adjoint).
+
+.. _using_nfft:
+
+Using the NFFT
+--------------
+
+The core of this library is provided through the 
+:class:`pyfftw.NFFT class`. All nfft components provided by the NFFT 
+library are fully encapsulated within this class.
+
+In its simplest form, a pyfftw.NFFT object is created with a pair of 
+complementary numpy arrays: the `f` and `f_hat` arrays, which can both 
+act as input or output depending on the chosen transform, forward or 
+adjoint.
+
+These arrays must be C-contiguous and of `numpy.complex128` type. 
+Support for other floating precision could be coming later, when the 
+NFFT library starts supporting multiple floating precision builds, 
+like the FFTW does.
+
+**instantiation**
+
+The bare minimum to instantiate a new :class:`pynfft.NFFT` object is to 
+specify the data arrays `f` and `f_hat`. The constructor will attempt to 
+guess the geometry parameters from these arrays: `M`, the number of 
+non-uniform nodes, and `N`, the shape of the uniform data.
+
+    >>> from pynfft import NFFT
+    >>> f = np.empty(96, dtype=np.complex128)
+    >>> f_hat = np.empty([16, 16], dtype=np.complex128)
+    >>> this_nfft = NFFT(f=f, f_hat=f_hat)
+    >>> print this_nfft.M
+    96
+    >>> print this_nfft.N
+    (16, 16)
+
+More control over the precision, storage and speed of the NFFT can be 
+gained by overriding the default design parameters `m`, `n` and 
+`flags`. For more information, please consult the `NFFT manual 
+<http://www-user.tu-chemnitz.de/~potts/nfft/guide3/html/index.html>`_.
+
+**precomputation**
+
+Precomputation *must* be performed before calling any of the 
+transforms. The user can manually set the nodes of the NFFT object 
+using the :attr:`pynfft.NFFT.x` property before calling the 
+:meth:`pynfft.NFFT.precompute` method.
+
+    >>> this_nfft = NFFT(f=f, f_hat=f_hat)
+    >>> this_nfft.x = some_x
+    >>> this_nfft.precompute()  
+
+Alternatively, precomputation can be performed at construct time:
+
+	>>> this_nfft = NFFT(f=f, f_hat=f_hat, x=x, precompute=True)
+
+**execution**
+
+The actual forward and adjoint NFFT are performed by calling the 
+:meth:`pynfft.NFFT.forward` and :meth:`pynfft.NFFT.adjoint` methods.
+
+	>>> # forward transform
+	>>> ret = this_nfft.forward()
+	>>> # adjoint transform
+	>>> ret = this_nfft.adjoint()
+
+.. _using_solver:
+
+Using the iterative solver
+--------------------------
+
+**instantiation**
+
+The instantiation of a :class:`pynfft.Solver` object requires an 
+instance of :class:`pynfft.NFFT`. The following code shows you a 
+simple example:
+
+    >>> from pynfft import NFFT, Solver
+    >>> this_nfft = NFFT(f=some_f, f_hat=some_F, x=some_x, precompute=True)
+    >>> this_solver = Solver(this_nfft)
+
+It is strongly recommended to use an already *precomputed* 
+:class:`pynfft.NFFT` object to instantiate a :class:`pynfft.Solver` 
+object, or at the very least, make sure to call its precompute method 
+before carrying on with the solver.
+
+Since the solver will typically run several iterations before 
+converging to a stable solution, it is also strongly encourage to use 
+the maximum level of precomputation to speed-up each call to the NFFT. 
+Please check the paragraph regarding the choice of precomputation flags 
+for the :class:`pynfft.NFFT`. 
+
+By default, the :class:`pynfft.Solver` class uses the Conjugate 
+Gradient of the first kind method (CGNR flag). This may be overriden in 
+the constructor:
+
+    >>> this_solver = Solver(this_nfft, flags='CGNE')
+
+Convergence to a stable solution can be significantly speed-up using the 
+right pre-conditioning weights. These can be specified by the flags 
+'PRECOMPUTE_WEIGHT' and 'PRECOMPUTE_DAMP' and accessed by the 
+:attr:`pynfft.Solver.w` and :attr:`pynfft.Solver.w_hat` attributes. By 
+default, these weights are set to 1.
+
+    >>> this_solver = Solver(this_nfft, flags=('PRECOMPUTE_WEIGHT'))
+    >>> this_solver.w = some_w
+
+**using the solver**
+
+Before iterating, the solver has to be intialized. As a reminder, make 
+sure the :class:`pynfft.NFFT` object used to instantiate the solver has 
+been *precomputed*. Otherwise, the solver will be in an undefined state 
+and will not behave properly.
+
+Initialization of the solver is performed first setting the non-uniform 
+samples :attr:`pynfft.Solver.y` and initial guess of the solution 
+:attr:`pynfft.Solver.f_hat_iter` and then calling the 
+:meth:`pynfft.Solver.before_loop` method.
+
+    >>> this_solver.y = some_y
+    >>> this_solver.f_hat_iter = some_f_hat_iter
+    >>> this_solver.before_loop()
+
+By default, the initial guess of the solution is set to 0, which makes 
+the first iteration of the solver essentially behave like a standard 
+call to the adjoint NFFT.
+
+After initialization of the solver, a single iteration can be performed 
+by calling the :meth:`pynfft.Solver.loop_one_step` method. With each 
+iteration, the current solution is written in the 
+:attr:`pynfft.Solver.f_hat_iter` attribute.
+
+    >>> this_solver.loop_one_step()
+    >>> print this_solver.f_hat_iter
+    >>> this_solver.loop_one_step()
+    >>> print this_solver.f_hat_iter
+
+The :class:`pynfft.Solver` class only supports one iteration at a time. 
+It is at the discretion to implement the desired stopping condition, 
+based for instance on a maximum iteration count or a threshold value on 
+the residuals. The residuals can be read in the 
+:attr:`pynfft.Solver.r_iter` attribute. Below are two simple examples:
+
+    - with a maximum number of iterations:
+
+    >>> niter = 10  # set number of iterations to 10
+    >>> for iiter in range(niter):
+    >>>	    this_solver.loop_one_step()
+
+    - with a threshold value:
+
+    >>> threshold = 1e-3
+    >>> try:
+    >>>	    while True:
+    >>>		this_solver.loop_one_step()
+    >>>		if(np.all(this_solver.r_iter < threshold)):
+    >>>		    raise StopCondition
+    >>> except StopCondition:
+    >>>	    # rest of the algorithm
diff --git a/pyNFFT.egg-info/PKG-INFO b/pyNFFT.egg-info/PKG-INFO
new file mode 100644
index 0000000..2985b06
--- /dev/null
+++ b/pyNFFT.egg-info/PKG-INFO
@@ -0,0 +1,34 @@
+Metadata-Version: 1.1
+Name: pyNFFT
+Version: 1.2
+Summary: A pythonic wrapper around NFFT
+Home-page: https://github.com/ghisvail/pyNFFT.git
+Author: Ghislain Vaillant
+Author-email: ghisvail at gmail.com
+License: UNKNOWN
+Description: "The NFFT is a C subroutine library for computing the
+        nonequispaced discrete Fourier transform (NDFT) in one or more dimensions, of
+        arbitrary input size, and of complex data."
+        
+        The NFFT library is licensed under GPLv2 and available at:
+            http://www-user.tu-chemnitz.de/~potts/nfft/index.php
+        
+        This wrapper provides a somewhat Pythonic access to some of the core NFFT
+        library functionalities and is largely inspired from the pyFFTW project
+        developped by Henry Gomersall (http://hgomersall.github.io/pyFFTW/).
+        
+        This project is still work in progress and is still considered beta quality. In
+        particular, the API is not yet frozen and is likely to change as the
+        development continues. Please consult the documentation and changelog for more
+        information.
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 3
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
+Classifier: Operating System :: POSIX :: Linux
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: Science/Research
+Classifier: Topic :: Scientific/Engineering
+Classifier: Topic :: Scientific/Engineering :: Mathematics
+Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
diff --git a/pyNFFT.egg-info/SOURCES.txt b/pyNFFT.egg-info/SOURCES.txt
new file mode 100644
index 0000000..64629ee
--- /dev/null
+++ b/pyNFFT.egg-info/SOURCES.txt
@@ -0,0 +1,28 @@
+CHANGELOG.txt
+CONTRIBUTING.rst
+COPYING.txt
+README.rst
+requirements.txt
+setup.cfg
+setup.py
+/home/gv10-jessie/workspace/pyNFFT/pynfft/nfft.pyx
+/home/gv10-jessie/workspace/pyNFFT/pynfft/util.pyx
+doc/Makefile
+doc/source/api.rst
+doc/source/conf.py
+doc/source/index.rst
+doc/source/tutorial.rst
+doc/source/api/nfft.rst
+doc/source/api/util.rst
+pyNFFT.egg-info/PKG-INFO
+pyNFFT.egg-info/SOURCES.txt
+pyNFFT.egg-info/dependency_links.txt
+pyNFFT.egg-info/requires.txt
+pyNFFT.egg-info/top_level.txt
+pynfft/__init__.py
+pynfft/cnfft3.pxd
+pynfft/cnfft3util.pxd
+pynfft/nfft.pyx
+pynfft/util.pyx
+tests/__init__.py
+tests/test_nfft.py
\ No newline at end of file
diff --git a/pyNFFT.egg-info/dependency_links.txt b/pyNFFT.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/pyNFFT.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/pyNFFT.egg-info/requires.txt b/pyNFFT.egg-info/requires.txt
new file mode 100644
index 0000000..513352a
--- /dev/null
+++ b/pyNFFT.egg-info/requires.txt
@@ -0,0 +1,2 @@
+numpy
+cython
\ No newline at end of file
diff --git a/pyNFFT.egg-info/top_level.txt b/pyNFFT.egg-info/top_level.txt
new file mode 100644
index 0000000..bf62d41
--- /dev/null
+++ b/pyNFFT.egg-info/top_level.txt
@@ -0,0 +1 @@
+pynfft
diff --git a/pynfft/__init__.py b/pynfft/__init__.py
new file mode 100644
index 0000000..7711a72
--- /dev/null
+++ b/pynfft/__init__.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013  Ghislain Vaillant
+#
+# 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/>.
+
+from .nfft import NFFT, Solver
+import util
diff --git a/pynfft/cnfft3.pxd b/pynfft/cnfft3.pxd
new file mode 100644
index 0000000..3e2424d
--- /dev/null
+++ b/pynfft/cnfft3.pxd
@@ -0,0 +1,154 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013  Ghislain Vaillant
+#
+# 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/>.
+
+cdef extern from "nfft3.h":
+
+    # precomputation flags for the NFFT component
+    ctypedef enum:
+        PRE_PHI_HUT      #(1U<< 0)
+        FG_PSI           #(1U<< 1)
+        PRE_LIN_PSI      #(1U<< 2)
+        PRE_FG_PSI       #(1U<< 3)
+        PRE_PSI          #(1U<< 4)
+        PRE_FULL_PSI     #(1U<< 5)
+        MALLOC_X         #(1U<< 6)
+        MALLOC_F_HAT     #(1U<< 7)
+        MALLOC_F         #(1U<< 8)
+        FFT_OUT_OF_PLACE #(1U<< 9)
+        FFTW_INIT        #(1U<< 10)
+        NFFT_SORT_NODES  #(1U<< 11)
+        NFFT_OMP_BLOCKWISE_ADJOINT #(1U<<12)
+        PRE_ONE_PSI #(PRE_LIN_PSI| PRE_FG_PSI| PRE_PSI| PRE_FULL_PSI)
+
+    # precomputation flags for the FFTW component
+    ctypedef enum:
+        FFTW_ESTIMATE
+        FFTW_DESTROY_INPUT
+
+    # double precision complex type
+    ctypedef double fftw_complex[2]
+
+    # double precision NFFT plan
+    ctypedef struct nfft_plan:
+        fftw_complex *f_hat
+            # Vector of Fourier coefficients, size is N_total float_types.
+        fftw_complex *f
+            # Vector of samples, size is M_total float types.
+        double *x
+            # Nodes in time/spatial domain, size is $dM$ doubles.
+
+    void nfft_trafo_direct (nfft_plan *ths) nogil
+        # Computes a NDFT.
+
+    void nfft_adjoint_direct (nfft_plan *ths) nogil
+        # Computes an adjoint NDFT.
+
+    void nfft_trafo (nfft_plan *ths) nogil
+        # Computes a NFFT, see the definition.
+
+    void nfft_adjoint (nfft_plan *ths) nogil
+        # Computes an adjoint NFFT, see the definition.
+
+    void nfft_init_guru (nfft_plan *ths, int d, int *N, int M, int *n, int m,
+                         unsigned nfft_flags, unsigned fftw_flags)
+        # Initialisation of a transform plan, guru.
+
+    void nfft_precompute_one_psi (nfft_plan *ths) nogil
+        # Precomputation for a transform plan.
+
+    void nfft_finalize (nfft_plan *ths)
+        # Destroys a transform plan.
+
+
+    ctypedef enum:
+        # precomputation flags for solver
+        LANDWEBER             #(1U<< 0)
+        STEEPEST_DESCENT      #(1U<< 1)
+        CGNR                  #(1U<< 2)
+        CGNE                  #(1U<< 3)
+        NORMS_FOR_LANDWEBER   #(1U<< 4)
+        PRECOMPUTE_WEIGHT     #(1U<< 5)
+        PRECOMPUTE_DAMP       #(1U<< 6)
+
+    # stripped down alias of a NFFT plan used by solver
+    ctypedef struct nfft_mv_plan_complex:
+        pass
+
+    # complex solver plan
+    ctypedef struct solver_plan_complex:
+        nfft_mv_plan_complex *mv
+            # matrix vector multiplication.
+        unsigned flags
+            # iteration type
+        double *w
+            # weighting factors
+        double *w_hat
+            # damping factors
+        fftw_complex *y
+            # right hand side, samples
+        fftw_complex *f_hat_iter
+            # iterative solution
+        fftw_complex *r_iter
+            # iterated residual vector
+        fftw_complex *z_hat_iter
+            # residual of normal equation of \ first kind
+        fftw_complex *p_hat_iter
+            # search direction.
+        fftw_complex *v_iter
+            # residual vector update
+        double alpha_iter
+            #  step size for search direction
+        double beta_iter
+            #  step size for search correction
+        double dot_r_iter
+            #  weighted dotproduct of r_iter
+        double dot_r_iter_old
+            #  previous dot_r_iter
+        double dot_z_hat_iter
+            #  weighted dotproduct of \ z_hat_iter
+        double dot_z_hat_iter_old
+            #  previous dot_z_hat_iter
+        double dot_p_hat_iter
+            #  weighted dotproduct of \ p_hat_iter
+        double dot_v_iter
+            # weighted dotproduct of v_iter
+
+    void solver_init_advanced_complex(solver_plan_complex *ths,
+                                      nfft_mv_plan_complex *mv,
+                                      unsigned flags)
+        # Advanced initialisation.
+
+    void solver_before_loop_complex(solver_plan_complex *ths) nogil
+        # Setting up residuals before the actual iteration.
+
+    void solver_loop_one_step_complex(solver_plan_complex *ths) nogil
+        # Doing one step in the iteration.
+
+    void solver_finalize_complex(solver_plan_complex *ths)
+        # Destroys the plan for the inverse transform.
+
+
+cdef extern from "fftw3.h":
+    
+    void fftw_cleanup()
+        # cleanup routines
+        
+    void fftw_init_threads()
+        # threading routines
+
+    void fftw_cleanup_threads()
+        # cleanup routines
diff --git a/pynfft/cnfft3util.pxd b/pynfft/cnfft3util.pxd
new file mode 100644
index 0000000..5dbdd18
--- /dev/null
+++ b/pynfft/cnfft3util.pxd
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013  Ghislain Vaillant
+#
+# 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/>.
+
+from cnfft3 cimport fftw_complex
+
+cdef extern from "nfft3util.h":
+
+    void nfft_vrand_unit_complex (fftw_complex *x, int n)
+ 	    # Inits a vector of random complex numbers in \
+        # $[0,1]\times[0,1]{\rm i}$ .
+
+    void nfft_vrand_shifted_unit_double (double *x, int n)
+        # Inits a vector of random double numbers in $[-1/2,1/2]$ .
+
+    void nfft_voronoi_weights_1d (double *w, double *x, int M)
+ 	    # Computes non periodic voronoi weights, \
+        # assumes ordered nodes $x_j$.
+
+    void nfft_voronoi_weights_S2(double *w, double *xi, int M)
+        # Computes voronoi weights for nodes on the sphere S^2. */
diff --git a/pynfft/nfft.pyx b/pynfft/nfft.pyx
new file mode 100644
index 0000000..2a131bf
--- /dev/null
+++ b/pynfft/nfft.pyx
@@ -0,0 +1,707 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013  Ghislain Vaillant
+#
+# 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/>.
+
+import numpy as np
+cimport numpy as np
+from libc.stdlib cimport malloc, free
+from libc cimport limits
+from cnfft3 cimport *
+
+cdef extern from *:
+    int Py_AtExit(void (*callback)()) 
+
+# Initialize module
+# Numpy must be initialized. When using numpy from C or Cython you must
+# _always_ do that, or you will have segfaults
+np.import_array()
+
+# initialize FFTW threads
+fftw_init_threads()
+
+# register cleanup callbacks
+cdef void _cleanup():
+    fftw_cleanup()
+    fftw_cleanup_threads()
+
+Py_AtExit(_cleanup)
+
+
+########
+# NFFT #
+########
+
+cdef object nfft_supported_flags_tuple
+nfft_supported_flags_tuple = (
+    'PRE_PHI_HUT',
+    'FG_PSI',
+    'PRE_LIN_PSI',
+    'PRE_FG_PSI',
+    'PRE_PSI',
+    'PRE_FULL_PSI',
+    )
+nfft_supported_flags = nfft_supported_flags_tuple
+
+cdef object nfft_flags_dict
+nfft_flags_dict = {
+    'PRE_PHI_HUT':PRE_PHI_HUT,
+    'FG_PSI':FG_PSI,
+    'PRE_LIN_PSI':PRE_LIN_PSI,
+    'PRE_FG_PSI':PRE_FG_PSI,
+    'PRE_PSI':PRE_PSI,
+    'PRE_FULL_PSI':PRE_FULL_PSI,
+    'MALLOC_X':MALLOC_X,
+    'MALLOC_F_HAT':MALLOC_F_HAT,
+    'MALLOC_F':MALLOC_F,
+    'FFT_OUT_OF_PLACE':FFT_OUT_OF_PLACE,
+    'FFTW_INIT':FFTW_INIT,
+    'NFFT_SORT_NODES':NFFT_SORT_NODES,
+    'NFFT_OMP_BLOCKWISE_ADJOINT':NFFT_OMP_BLOCKWISE_ADJOINT,
+    'PRE_ONE_PSI':PRE_ONE_PSI,
+    }
+nfft_flags = nfft_flags_dict.copy()
+
+cdef object fftw_flags_dict
+fftw_flags_dict = {
+    'FFTW_ESTIMATE':FFTW_ESTIMATE,
+    'FFTW_DESTROY_INPUT':FFTW_DESTROY_INPUT,
+    }
+fftw_flags = fftw_flags_dict.copy()
+
+
+cdef class NFFT(object):
+    '''
+    NFFT is a class for computing the multivariate Non-uniform Discrete
+    Fourier (NDFT) transform using the NFFT library. The interface is
+    designed to be somewhat pythonic, whilst preserving the workflow of the 
+    original C-library. Computation of the NFFT is achieved in 3 steps : 
+    instantiation, precomputation and execution.
+    
+    On instantiation, the geometry of the transform is guessed from the shape 
+    of the input arrays :attr:`f` and :attr:`f_hat`. The node array :attr:`x` 
+    can be optionally provided, otherwise it will be created internally.
+    
+    Precomputation initializes the internals of the transform prior to 
+    execution, and is called with the :meth:`precompute` method.
+    
+    The forward and adjoint NFFT can be called with :meth:`forward` and 
+    :meth:`adjoint` respectively. Each of these methods support internal array 
+    update and coercion to the right internal dtype.
+    '''
+    cdef nfft_plan _plan
+    cdef int _d
+    cdef int _M
+    cdef int _m
+    cdef object _N
+    cdef object _n
+    cdef object _dtype
+    cdef object _flags
+    cdef object __f   
+    cdef object __f_hat
+    cdef object __x
+
+    # where the C-related content of the class is being initialized
+    def __cinit__(self, f, f_hat, x=None, n=None, m=12, flags=None,
+                  precompute=False, *args, **kwargs):
+
+        # support only double / double complex NFFT
+        # TODO: if support for multiple floating precision lands in the
+        # NFFT library, adapt this section to dynamically figure the
+        # real and complex dtypes
+        dtype_real = np.dtype('float64')
+        dtype_complex = np.dtype('complex128')
+
+        # precompute at construct time possible if x is provided
+        precompute =  precompute and (x is not None)
+
+        # sanity checks on input arrays
+        if not isinstance(f, np.ndarray):
+            raise ValueError('f must be an instance of numpy.ndarray')
+
+        if not f.flags.c_contiguous:
+            raise ValueError('f must be C-contiguous')        
+
+        if f.dtype != dtype_complex:
+            raise ValueError('f must be of type %s'%(dtype_complex))                     
+
+        if not isinstance(f_hat, np.ndarray):
+            raise ValueError('f_hat: must be an instance of numpy.ndarray')                    
+
+        if not f_hat.flags.c_contiguous:
+            raise ValueError('f_hat must be C-contiguous')        
+
+        if f_hat.dtype != dtype_complex:
+            raise ValueError('f_hat must be of type %s'%(dtype_complex))
+
+        # guess geometry from input array if missing from optional inputs
+        M = f.size
+        N = f_hat.shape
+        d = f_hat.ndim
+        n = n if n is not None else [2 * Nt for Nt in N]
+        if len(n) != d:
+            raise ValueError('n should be of same length as N')       
+        N_total = np.prod(N)
+        n_total = np.prod(n)
+
+        # check geometry is compatible with C-class internals
+        int_max = <Py_ssize_t>limits.INT_MAX
+        if not all([Nt > 0 for Nt in N]):
+            raise ValueError('N must be strictly positive')
+        if not all([Nt < int_max for Nt in N]):
+            raise ValueError('N exceeds integer limit value')
+        if not N_total < int_max:
+            raise ValueError('product of N exceeds integer limit value')
+        if not all([nt > 0 for nt in n]):
+            raise ValueError('n must be strictly positive')
+        if not all([nt < int_max for nt in n]):
+            raise ValueError('n exceeds integer limit value')        
+        if not n_total < int_max:
+            raise ValueError('product of n exceeds integer limit value')
+        if not M > 0:
+            raise ValueError('M must be strictly positive')
+        if not M < int_max:
+            raise ValueError('M exceeds integer limit value')
+        if not m > 0:
+            raise ValueError('m must be strictly positive')
+        if not m < int_max:
+            raise ValueError('m exceeds integer limit value')
+
+        # sanity check on optional x array
+        if x is not None:
+            if not isinstance(x, np.ndarray):
+                raise ValueError('x must be an instance of numpy.ndarray')
+    
+            if not x.flags.c_contiguous:
+                raise ValueError('x must be C-contiguous')        
+    
+            if x.dtype != dtype_real:
+                raise ValueError('x must be of type %s'%(dtype_real))
+            
+            try:
+                x = x.reshape([M, d])
+            except ValueError:
+                raise ValueError('x is incompatible with geometry')
+        else:
+            x = np.empty([M, d], dtype=dtype_real)
+
+        # convert tuple of litteral precomputation flags to its expected
+        # C-compatible value. Each flag is a power of 2, which allows to compute
+        # this value using BITOR operations.
+        cdef unsigned int _nfft_flags = 0
+        cdef unsigned int _fftw_flags = 0
+        flags_used = ()
+
+        # sanity checks on user specified flags if any,
+        # else use default ones:
+        if flags is not None:
+            try:
+                flags = tuple(flags)
+            except:
+                flags = (flags,)
+            finally:
+                for each_flag in flags:
+                    if each_flag not in nfft_supported_flags_tuple:
+                        raise ValueError('Unsupported flag: %s'%(each_flag))
+                flags_used += flags
+        else:
+            flags_used += ('PRE_PHI_HUT', 'PRE_PSI',)
+
+        # set specific flags, for which we don't want the user to have a say
+        # on:
+        # FFTW specific flags
+        flags_used += ('FFTW_INIT', 'FFT_OUT_OF_PLACE', 'FFTW_ESTIMATE',
+                'FFTW_DESTROY_INPUT',)
+
+        # Parallel computation flag
+        flags_used += ('NFFT_SORT_NODES',)
+
+        # Parallel computation flag, set only if multivariate transform
+        if d > 1:
+            flags_used += ('NFFT_OMP_BLOCKWISE_ADJOINT',)
+
+        # Calculate the flag code for the guru interface used for
+        # initialization
+        for each_flag in flags_used:
+            try:
+                _nfft_flags |= nfft_flags_dict[each_flag]
+            except KeyError:
+                try:
+                    _fftw_flags |= fftw_flags_dict[each_flag]
+                except KeyError:
+                    raise ValueError('Invalid flag: ' + '\'' +
+                        each_flag + '\' is not a valid flag.')
+
+        # initialize plan
+        cdef int *p_N = <int *>malloc(sizeof(int) * d)
+        if p_N == NULL:
+            raise MemoryError
+        for t in range(d):
+            p_N[t] = N[t]
+
+        cdef int *p_n = <int *>malloc(sizeof(int) * d)
+        if p_n == NULL:
+            raise MemoryError
+        for t in range(d):
+            p_n[t] = n[t]
+
+        try:
+            nfft_init_guru(&self._plan, d, p_N, M, p_n, m,
+                    _nfft_flags, _fftw_flags)
+        except:
+            raise MemoryError
+        finally:
+            free(p_N)
+            free(p_n)
+
+        self.__x = x
+        self.__f = f
+        self.__f_hat = f_hat
+        self._d = d
+        self._M = M
+        self._m = m
+        self._N = N
+        self._n = n
+        self._dtype = dtype_complex
+        self._flags = flags_used
+
+        # connect Python arrays to plan internals
+        self._update_f()
+        self._update_f_hat()
+        self._update_x()
+
+        # optional precomputation
+        if precompute:
+            self.execute_precomputation()
+
+    # here, just holds the documentation of the class constructor
+    def __init__(self, f, f_hat, x=None, n=None, m=12, flags=None,
+                 *args, **kwargs):
+        '''
+        :param f: external array holding the non-uniform samples.
+        :type f: ndarray
+        :param f_hat: external array holding the Fourier coefficients.
+        :type f_hat: ndarray
+        :param x: optional array holding the nodes.
+        :type x: ndarray
+        :param n: oversampled multi-bandwith, default to 2 * N.
+        :type n: tuple of int
+        :param m: Cut-off parameter of the window function.
+        :type m: int
+        :param flags: list of precomputation flags, see note below.
+        :type flags: tuple
+        
+        **Precomputation flags**
+
+        This table lists the supported precomputation flags for the NFFT.
+
+        +----------------------------+--------------------------------------------------+
+        | Flag                       | Description                                      |
+        +============================+==================================================+
+        | PRE_PHI_HUT                | Precompute the roll-off correction coefficients. |
+        +----------------------------+--------------------------------------------------+
+        | FG_PSI                     | Convolution uses Fast Gaussian properties.       |
+        +----------------------------+--------------------------------------------------+
+        | PRE_LIN_PSI                | Convolution uses a precomputed look-up table.    |
+        +----------------------------+--------------------------------------------------+
+        | PRE_FG_PSI                 | Precompute Fast Gaussian.                        |
+        +----------------------------+--------------------------------------------------+
+        | PRE_PSI                    | Standard precomputation, uses M*(2m+2)*d values. |
+        +----------------------------+--------------------------------------------------+
+        | PRE_FULL_PSI               | Full precomputation, uses M*(2m+2)^d values.     |
+        +----------------------------+--------------------------------------------------+
+
+        Default value is ``flags = ('PRE_PHI_HUT', 'PRE_PSI')``.
+        '''
+        pass
+
+    def __dealloc__(self):
+        nfft_finalize(&self._plan)
+
+    def forward(self, use_dft=False):
+        '''Performs the forward NFFT.
+
+        :param use_dft: whether to use the DFT instead of the fast algorithm.
+        :type use_dft: boolean
+        :returns: the updated f array.
+        :rtype: ndarray
+
+        '''
+        if use_dft:
+            self.execute_trafo_direct()
+        else:
+            self.execute_trafo()
+        return self.f
+    
+    def adjoint(self, use_dft=False):
+        '''Performs the adjoint NFFT.
+
+        :param use_dft: whether to use the DFT instead of the fast algorithm.
+        :type use_dft: boolean
+        :returns: the updated f_hat array.
+        :rtype: ndarray
+
+        '''
+        if use_dft:
+            self.execute_adjoint_direct()
+        else:
+            self.execute_adjoint()
+        return self.f_hat
+
+    def precompute(self):
+        '''Precomputes the NFFT plan internals.'''
+        self.execute_precomputation()
+
+    cdef execute_precomputation(self):
+        with nogil:
+            nfft_precompute_one_psi(&self._plan)
+
+    cdef execute_trafo(self):
+        with nogil:
+            nfft_trafo(&self._plan)
+
+    cdef execute_trafo_direct(self):
+        with nogil:
+            nfft_trafo_direct(&self._plan)
+
+    cpdef execute_adjoint(self):
+        with nogil:
+            nfft_adjoint(&self._plan)
+
+    cpdef execute_adjoint_direct(self):
+        with nogil:
+            nfft_adjoint_direct(&self._plan)
+
+    @property
+    def f(self):
+        '''The vector of non-uniform samples.'''
+        return self.__f
+
+    @f.setter
+    def f(self, new_f):
+        if not isinstance(new_f, np.ndarray):
+            raise ValueError('array is not an instance of numpy.ndarray')     
+        if not new_f.flags.c_contiguous:
+            raise ValueError('array is not C-contiguous')
+        if new_f.dtype != self.__f.dtype:
+            raise ValueError('array dtype is not compatible')
+        try:
+            new_f = new_f.reshape(self.M)
+        except ValueError:
+            raise ValueError('array shape is not compatible')
+        self.__f = new_f
+        self._update_f()
+
+    cdef _update_f(self):
+        '''C-level array updater.''' 
+        self._plan.f = <fftw_complex *>np.PyArray_DATA(self.__f)        
+
+    @property
+    def f_hat(self):
+        '''The vector of Fourier coefficients.'''
+        return self.__f_hat
+
+    @f_hat.setter
+    def f_hat(self, new_f_hat):
+        if not isinstance(new_f_hat, np.ndarray):
+            raise ValueError('array is not an instance of numpy.ndarray')  
+        if not new_f_hat.flags.c_contiguous:
+            raise ValueError('array is not C-contiguous')
+        if new_f_hat.dtype != self.__f_hat.dtype:
+            raise ValueError('array dtype is not compatible')
+        try:
+            new_f_hat = new_f_hat.reshape(self.N)
+        except ValueError:
+            raise ValueError('array shape is not compatible')
+        self.__f_hat = new_f_hat
+        self._update_f_hat()
+
+    cdef _update_f_hat(self):
+        '''C-level array updater.'''
+        self._plan.f_hat = <fftw_complex *>np.PyArray_DATA(self.__f_hat)       
+
+    @property
+    def x(self):
+        '''The nodes in time/spatial domain.'''
+        return self.__x
+
+    @x.setter
+    def x(self, new_x):
+        if not isinstance(new_x, np.ndarray):
+            raise ValueError('array is not an instance of numpy.ndarray')                    
+        if not new_x.flags.c_contiguous:
+            raise ValueError('array is not C-contiguous')
+        if new_x.dtype != self.__x.dtype:
+            raise ValueError('array dtype is not compatible')
+        try:
+            new_x = new_x.reshape([self.M, self.d])
+        except ValueError:
+            raise ValueError('array shape is not compatible')
+        self.__x = new_x
+        self._update_x()
+        
+    cdef _update_x(self):
+        '''C-level array updater.'''        
+        self._plan.x = <double *>np.PyArray_DATA(self.__x)
+
+    @property
+    def d(self):
+        '''The dimensionality of the NFFT.'''
+        return self._d
+
+    @property
+    def m(self):
+        '''The cut-off parameter of the window function.'''
+        return self._m
+
+    @property
+    def M(self):
+        '''The total number of samples.'''
+        return self._M
+
+    @property
+    def N_total(self):
+        '''The total number of Fourier coefficients.'''
+        return np.prod(self.N)
+
+    @property
+    def N(self):
+        '''The multi-bandwith size.'''
+        return self._N
+
+    @property
+    def n(self):
+        '''The oversampled multi-bandwith size.'''
+        return self._n
+
+    @property
+    def dtype(self):
+        '''The dtype of the NFFT.'''
+        return self._dtype
+
+    @property
+    def flags(self):
+        '''The precomputation flags.'''
+        return self._flags
+
+
+##########
+# Solver #
+##########
+
+cdef object solver_flags_dict
+solver_flags_dict = {
+    'LANDWEBER':LANDWEBER,
+    'STEEPEST_DESCENT':STEEPEST_DESCENT,
+    'CGNR':CGNR,
+    'CGNE':CGNE,
+    'NORMS_FOR_LANDWEBER':NORMS_FOR_LANDWEBER,
+    'PRECOMPUTE_WEIGHT':PRECOMPUTE_WEIGHT,
+    'PRECOMPUTE_DAMP':PRECOMPUTE_DAMP,
+    }
+solver_flags = solver_flags_dict.copy()
+
+cdef class Solver:
+    '''
+    Solver is a class for computing the adjoint NFFT iteratively..
+
+    The instantiation requires a NFFT object used internally for the multiple
+    forward and adjoint NFFT performed. The class uses conjugate-gradient as
+    the default solver but alternative solvers can be specified.
+
+    Because the stopping conidition of the iterative computation may change
+    from one application to another, the implementation only let you carry
+    one iteration at a time with a call to :meth:`loop_one_step`. 
+    Initialization of the solver is done by calling the :meth:`before_loop` 
+    method.
+
+    The class exposes the internals of the solver through call to their
+    respective properties.
+    '''
+    cdef solver_plan_complex _plan
+    cdef NFFT _nfft_plan
+    cdef object _w
+    cdef object _w_hat
+    cdef object _y
+    cdef object _f_hat_iter
+    cdef object _r_iter
+    cdef object _dtype
+    cdef object _flags
+
+    def __cinit__(self, NFFT nfft_plan, flags=None):
+
+        # support only double / double complex NFFT
+        # TODO: if support for multiple floating precision lands in the
+        # NFFT library, adapt this section to dynamically figure the
+        # real and complex dtypes
+        dtype_real = np.dtype('float64')
+        dtype_complex = np.dtype('complex128')
+
+        # convert tuple of litteral precomputation flags to its expected
+        # C-compatible value. Each flag is a power of 2, which allows to compute
+        # this value using BITOR operations.
+        cdef unsigned int _flags = 0
+        flags_used = ()
+
+        # sanity checks on user specified flags if any,
+        # else use default ones:
+        if flags is not None:
+            try:
+                flags = tuple(flags)
+            except:
+                flags = (flags,)
+            finally:
+                flags_used += flags
+        else:
+            flags_used += ('CGNR',)
+
+        for each_flag in flags_used:
+            try:
+                _flags |= solver_flags_dict[each_flag]
+            except KeyError:
+                raise ValueError('Invalid flag: ' + '\'' +
+                        each_flag + '\' is not a valid flag.')
+
+        # initialize plan
+        try:
+            solver_init_advanced_complex(&self._plan,
+                <nfft_mv_plan_complex*>&(nfft_plan._plan), _flags)
+        except:
+            raise MemoryError
+
+        self._nfft_plan = nfft_plan
+        d = nfft_plan.d
+        M = nfft_plan.M
+        N = nfft_plan.N
+
+        cdef np.npy_intp shape_M[1]
+        shape_M[0] = M
+
+        self._r_iter = np.PyArray_SimpleNewFromData(1, shape_M,
+            np.NPY_COMPLEX128, <void *>(self._plan.r_iter))
+
+        self._y = np.PyArray_SimpleNewFromData(1, shape_M,
+            np.NPY_COMPLEX128, <void *>(self._plan.y))
+
+        if 'PRECOMPUTE_WEIGHT' in flags_used:
+            self._w = np.PyArray_SimpleNewFromData(1, shape_M,
+                np.NPY_FLOAT64, <void *>(self._plan.w))
+            self._w[:] = 1  # make sure weights are initialized
+        else:
+            self._w = None
+
+        cdef np.npy_intp *shape_N
+        try:
+            shape_N = <np.npy_intp*>malloc(d*sizeof(np.npy_intp))
+        except:
+            raise MemoryError
+        for dt in range(d):
+            shape_N[dt] = N[dt]
+
+        self._f_hat_iter = np.PyArray_SimpleNewFromData(d, shape_N,
+            np.NPY_COMPLEX128, <void *>(self._plan.f_hat_iter))
+        self._f_hat_iter[:] = 0  # default initial guess
+
+        if 'PRECOMPUTE_DAMP' in flags_used:
+            self._w_hat = np.PyArray_SimpleNewFromData(d, shape_N,
+                np.NPY_FLOAT64, <void *>(self._plan.w_hat))
+            self._w_hat[:] = 1  # make sure weights are initialized
+        else:
+            self._w_hat = None
+
+        free(shape_N)
+
+        self._dtype = dtype_complex
+        self._flags = flags_used
+
+
+    def __init__(self, nfft_plan, flags=None):
+        '''
+        :param plan: instance of NFFT.
+        :type plan: :class:`NFFT`
+        :param flags: list of instantiation flags, see below.
+        :type flags: tuple
+
+        **Instantiation flags**
+
+        +---------------------+-----------------------------------------------------------------------------+
+        | Flag                | Description                                                                 |
+        +=====================+=============================================================================+
+        | LANDWEBER           | Use Landweber (Richardson) iteration.                                       |
+        +---------------------+-----------------------------------------------------------------------------+
+        | STEEPEST_DESCENT    | Use steepest descent iteration.                                             |
+        +---------------------+-----------------------------------------------------------------------------+
+        | CGNR                | Use conjugate gradient (normal equation of the 1st kind).                   |
+        +---------------------+-----------------------------------------------------------------------------+
+        | CGNE                | Use conjugate gradient (normal equation of the 2nd kind).                   |
+        +---------------------+-----------------------------------------------------------------------------+
+        | NORMS_FOR_LANDWEBER | Use Landweber iteration to compute the residual norm.                       |
+        +---------------------+-----------------------------------------------------------------------------+
+        | PRECOMPUTE_WEIGHT   | Weight the samples, e.g. to cope with varying sampling density.             |
+        +---------------------+-----------------------------------------------------------------------------+
+        | PRECOMPUTE_DAMP     | Weight the Fourier coefficients, e.g. to favour fast decaying coefficients. |
+        +---------------------+-----------------------------------------------------------------------------+
+
+        Default value is ``flags = ('CGNR',)``.
+        '''
+        pass
+
+    def __dealloc__(self):
+        solver_finalize_complex(&self._plan)
+
+    cpdef before_loop(self):
+        '''Initialize solver internals.'''
+        with nogil:
+            solver_before_loop_complex(&self._plan)
+
+    cpdef loop_one_step(self):
+        '''Perform one iteration.'''
+        with nogil:
+            solver_loop_one_step_complex(&self._plan)
+
+    @property
+    def w(self):
+        '''Weighting factors.'''
+        return self._w
+
+    @property
+    def w_hat(self):
+        '''Damping factors.'''
+        return self._w_hat
+
+    @property
+    def y(self):
+        '''Right hand side, samples.'''
+        return self._y
+
+    @property
+    def f_hat_iter(self):
+        '''Iterative solution.'''
+        return self._f_hat_iter
+
+    @property
+    def r_iter(self):
+        '''Residual vector.'''
+        return self._r_iter
+
+    @property
+    def dtype(self):
+        '''The dtype of the solver.'''
+        return self._dtype
+
+    @property
+    def flags(self):
+        '''The precomputation flags.'''
+        return self._flags
diff --git a/pynfft/util.pyx b/pynfft/util.pyx
new file mode 100644
index 0000000..e03cf56
--- /dev/null
+++ b/pynfft/util.pyx
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013  Ghislain Vaillant
+#
+# 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/>.
+
+import numpy as np
+cimport numpy as np
+from cnfft3util cimport *
+
+
+# Numpy must be initialized. When using numpy from C or Cython you must
+# _always_ do that, or you will have segfaults
+np.import_array()
+
+def vrand_unit_complex (object[np.complex128_t, mode='c'] x not None):
+    '''
+    Utilitary function for initializing a vector of knots to random
+    values within the range [-0.5, 0.5).
+
+    Used for testing :attr:`pynfft.NFFT.x`.
+
+    :param x: pre-allocated array
+    :type x: ndarray <complex128>
+    '''
+    nfft_vrand_unit_complex(<fftw_complex *>&x[0], x.size)
+
+def vrand_shifted_unit_double (object[np.float64_t, mode='c'] x not None):
+    '''
+    Utilitary function for initializing a vector of data to random
+    complex values within the range [0, 1).
+
+    Used for testing :attr:`pynfft.NFFT.f` and
+    :attr:`pynfft.NFFT.f_hat`.
+
+    :param x: pre-allocated array
+    :type x: ndarray <float64>
+    '''
+    nfft_vrand_shifted_unit_double(<double *>&x[0], x.size)
+
+def voronoi_weights_1d (object[np.float64_t, mode='c'] w not None,
+                        object[np.float64_t, mode='c'] x not None):
+    '''
+    Utilitary function for computing density compensation weights from 1D knots.
+
+    :param w: pre-allocated array
+    :type w: ndarray <float64>
+    :param x: ordered 1D knots
+    :type x: ndarray <float64>
+    '''
+    if x.size != w.size:
+        raise ValueError('Incompatible size between weights and nodes \
+                         (%d, %d)'%(w.size, x.size))
+    nfft_voronoi_weights_1d(<double *>&w[0], <double *>&x[0], w.size)
+
+def voronoi_weights_S2 (object[np.float64_t, mode='c'] w not None,
+                        object[np.float64_t, mode='c'] xi not None):
+    '''
+    Utilitary function for computing density compensation weights from knots
+    located on the surface of a sphere.
+
+    Useful for reconstruction of 3D radial data.
+
+    :param w: pre-allocated array
+    :type w: ndarray <float64>
+    :param xi: angular locations (2D) on the unit sphere
+    :type xi: ndarray <float64>
+    '''
+    if xi.size != 2 * w.size:
+        raise ValueError('Incompatible size between weights and nodes \
+                         (%d, %d)'%(w.size, xi.size))
+    nfft_voronoi_weights_S2(<double *>&w[0], <double *>&xi[0], w.size)
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..2cf777e
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,3 @@
+cython>=0.12
+numpy>=1.6
+
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..811f979
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,13 @@
+[build_sphinx]
+source-dir = doc/source
+build-dir = doc/build
+all_files = 1
+
+[upload_sphinx]
+upload-dir = doc/build/html
+
+[egg_info]
+tag_build = 
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..673b34b
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,154 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013  Ghislain Vaillant
+#
+# 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/>.
+
+try:
+    from setuptools import setup, Command, Extension
+except ImportError:
+    from distutils.core import setup, Command, Extension
+from Cython.Distutils import build_ext as build_ext
+
+import os
+import os.path
+import numpy
+import shutil
+
+setup_dir = dir = os.path.dirname(os.path.abspath(__file__))
+package_name = 'pynfft'
+package_dir = os.path.join(setup_dir, package_name)
+
+include_dirs = [numpy.get_include()]
+library_dirs = []
+package_data = {}
+libraries = ['nfft3_threads', 'nfft3', 'fftw3_threads', 'fftw3', 'm']
+
+ext_modules = [
+    Extension(
+        name=package_name+'.nfft',
+        sources=[os.path.join(package_dir, 'nfft.pyx')],
+        libraries=libraries,
+        library_dirs=library_dirs,
+        include_dirs=include_dirs,
+        extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
+                           '-fstrict-aliasing -ffast-math'.split(),
+    ),
+    Extension(
+        name=package_name+'.util',
+        sources=[os.path.join(package_dir, 'util.pyx')],
+        libraries=libraries,
+        library_dirs=library_dirs,
+        include_dirs=include_dirs,
+        extra_compile_args='-O3 -fomit-frame-pointer -malign-double '
+                           '-fstrict-aliasing -ffast-math'.split(),
+    ),
+]
+
+
+class CleanCommand(Command):
+
+    description = "Force clean of build files and directories."
+    user_options = []
+
+    def initialize_options(self):
+        self.all = None
+
+    def finalize_options(self):
+        pass
+
+    def run(self):
+        for _dir in [os.path.join(setup_dir, d)
+                for d in ('build', 'dist', 'doc/build', 'pyNFFT.egg-info')]:
+            if os.path.exists(_dir):
+                shutil.rmtree(_dir)
+        for root, _, files in os.walk(package_dir):
+            for _file in files:
+                if not _file.endswith(('.py', '.pyx', '.pxd', '.pxi')):
+                    os.remove(os.path.join(package_dir, _file))
+
+
+class TestCommand(Command):
+    user_options = []
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
+    def run(self):
+        import sys
+        import subprocess
+        errno = subprocess.call(
+                [sys.executable, '-m', 'unittest', 'discover'])
+        raise SystemExit(errno)
+
+
+version = '1.2'
+release = True
+if not release:
+    version += '-dev'
+
+long_description = '''"The NFFT is a C subroutine library for computing the
+nonequispaced discrete Fourier transform (NDFT) in one or more dimensions, of
+arbitrary input size, and of complex data."
+
+The NFFT library is licensed under GPLv2 and available at:
+    http://www-user.tu-chemnitz.de/~potts/nfft/index.php
+
+This wrapper provides a somewhat Pythonic access to some of the core NFFT
+library functionalities and is largely inspired from the pyFFTW project
+developped by Henry Gomersall (http://hgomersall.github.io/pyFFTW/).
+
+This project is still work in progress and is still considered beta quality. In
+particular, the API is not yet frozen and is likely to change as the
+development continues. Please consult the documentation and changelog for more
+information.'''
+
+classifiers = [
+    'Programming Language :: Python',
+    'Programming Language :: Python :: 3',
+    'Development Status :: 5 - Production/Stable',
+    'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
+    'Operating System :: POSIX :: Linux',
+    'Intended Audience :: Developers',
+    'Intended Audience :: Science/Research',
+    'Topic :: Scientific/Engineering',
+    'Topic :: Scientific/Engineering :: Mathematics',
+    'Topic :: Multimedia :: Sound/Audio :: Analysis',
+]
+
+setup_args = {
+    'name': 'pyNFFT',
+    'version': version,
+    'author': 'Ghislain Vaillant',
+    'author_email': 'ghisvail at gmail.com',
+    'description': 'A pythonic wrapper around NFFT',
+    'long_description': long_description,
+    'url': 'https://github.com/ghisvail/pyNFFT.git',
+    'classifiers': classifiers,
+    'packages': [package_name],
+    'ext_modules': ext_modules,
+    'include_dirs': include_dirs,
+    'package_data': package_data,
+    'cmdclass': {'build_ext': build_ext,
+                 'clean': CleanCommand,
+                 'test': TestCommand},
+    'install_requires': ['numpy', 'cython'],
+}
+
+if __name__ == '__main__':
+    setup(**setup_args)
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/test_nfft.py b/tests/test_nfft.py
new file mode 100644
index 0000000..327493a
--- /dev/null
+++ b/tests/test_nfft.py
@@ -0,0 +1,209 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013  Ghislain Vaillant
+#
+# 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/>.
+
+from __future__ import division
+import numpy
+import unittest
+from numpy import pi
+from numpy.testing import assert_allclose
+from pynfft import NFFT
+from pynfft.nfft import fftw_flags, nfft_flags, nfft_supported_flags
+from pynfft.util import vrand_unit_complex, vrand_shifted_unit_double
+
+
+class Test_NFFT_init(unittest.TestCase):
+
+    def __init__(self, *args, **kwargs):
+        super(Test_NFFT_init, self).__init__(*args, **kwargs)
+        M, N = 32, (12, 12)        
+        self.x = numpy.ones(len(N) * M, dtype=numpy.float64)
+        self.f = numpy.empty(M, dtype=numpy.complex128)
+        self.f_hat = numpy.empty(N, dtype=numpy.complex128) 
+        self.m = 6
+        self.flags = ('PRE_PHI_HUT', 'FG_PSI', 'PRE_FG_PSI')
+
+    def test_default_args(self):
+        Nfft = NFFT(self.f, self.f_hat, self.x)
+        default_m = 12
+        default_flags = ('PRE_PHI_HUT', 'PRE_PSI')        
+        self.assertEqual(Nfft.m, default_m)        
+        for each_flag in default_flags:
+            self.assertIn(each_flag, Nfft.flags)
+
+    def test_user_specified_args(self):
+        Nfft = NFFT(self.f, self.f_hat, self.x, m=self.m, flags=self.flags)
+        self.assertEqual(Nfft.d, self.f_hat.ndim)
+        self.assertEqual(Nfft.N, self.f_hat.shape)
+        self.assertEqual(Nfft.N_total, self.f_hat.size)
+        self.assertEqual(Nfft.M, self.f.size)
+        self.assertEqual(Nfft.m, self.m)
+        for each_flag in self.flags:
+            self.assertIn(each_flag, Nfft.flags)
+    
+
+class Test_NFFT_runtime(unittest.TestCase):
+
+    N = (32, 32)
+    M = 1280
+
+    def fdft(self, f_hat):
+        N = self.N
+        k = numpy.mgrid[slice(N[0]), slice(N[1])]
+        k = k.reshape([2, -1]) - numpy.asarray(N).reshape([2, 1]) / 2
+        x = self.x.reshape([-1, 2])
+        F = numpy.exp(-2j * pi * numpy.dot(x, k))
+        f_dft = numpy.dot(F, f_hat.ravel())
+        return f_dft
+        
+    def idft(self, f):
+        N = self.N
+        k = numpy.mgrid[slice(N[0]), slice(N[1])]
+        k = k.reshape([2, -1]) - numpy.asarray(N).reshape([2, 1]) / 2
+        x = self.x.reshape([-1, 2])
+        F = numpy.exp(-2j * pi * numpy.dot(x, k))
+        f_hat_dft = numpy.dot(numpy.conjugate(F).T, f)
+        return f_hat_dft        
+
+    def generate_new_arrays(self, init_f=False, init_f_hat=False):
+        f = numpy.empty(self.M, dtype=numpy.complex128)
+        f_hat = numpy.empty(self.N, dtype=numpy.complex128)
+        if init_f:
+            vrand_unit_complex(f.ravel())
+        if init_f_hat:
+            vrand_unit_complex(f_hat.ravel())
+        return f, f_hat
+
+    def generate_nfft_plan(self):
+        Nfft = NFFT(f=self.f, f_hat=self.f_hat, x=self.x, precompute=True)
+        return Nfft
+
+    def __init__(self, *args, **kwargs):
+        super(Test_NFFT_runtime, self).__init__(*args, **kwargs)
+        self.x = numpy.empty(self.M*len(self.N), dtype=numpy.float64)
+        vrand_shifted_unit_double(self.x.ravel())
+        self.f, self.f_hat = self.generate_new_arrays()
+
+    def test_trafo(self):
+        Nfft = self.generate_nfft_plan()
+        vrand_unit_complex(self.f_hat.ravel())
+        f = Nfft.forward(use_dft=False)
+        assert_allclose(f, self.fdft(self.f_hat), rtol=1e-3)
+
+    def test_trafo_direct(self):
+        Nfft = self.generate_nfft_plan()
+        vrand_unit_complex(self.f_hat.ravel())
+        f = Nfft.forward(use_dft=True)
+        assert_allclose(f, self.fdft(self.f_hat), rtol=1e-3)
+
+    def test_adjoint(self):
+        Nfft = self.generate_nfft_plan()
+        vrand_unit_complex(self.f)
+        f_hat = Nfft.adjoint(use_dft=False)
+        assert_allclose(f_hat.ravel(), self.idft(self.f), rtol=1e-3)
+
+    def test_adjoint_direct(self):
+        Nfft = self.generate_nfft_plan()
+        vrand_unit_complex(self.f)
+        f_hat = Nfft.adjoint(use_dft=True)
+        assert_allclose(f_hat.ravel(), self.idft(self.f), rtol=1e-3)
+
+
+class Test_NFFT_errors(unittest.TestCase):
+
+    def __init__(self, *args, **kwargs):
+        super(Test_NFFT_errors, self).__init__(*args, **kwargs)
+
+    def test_for_invalid_m(self):
+        M, N = 20, 32
+        f = numpy.empty(M, dtype=numpy.complex128)
+        f_hat = numpy.empty(N, dtype=numpy.complex128)
+        
+        failing_m = (-1, 1+numpy.iinfo(numpy.int32).max)
+        for some_m in failing_m:
+            self.assertRaises(ValueError,
+                              lambda: NFFT(f=f, f_hat=f_hat, m=some_m))
+
+    def test_for_invalid_n(self):
+        M, N = 20, 32
+        f = numpy.empty(M, dtype=numpy.complex128)
+        f_hat = numpy.empty(N, dtype=numpy.complex128)
+        
+        failing_n = (-1, 1+numpy.iinfo(numpy.int32).max,
+                    (4, numpy.iinfo(numpy.int32).max / 2))
+        for some_n in failing_n:
+            self.assertRaises(ValueError,
+                              lambda: NFFT(f=f, f_hat=f_hat, n=(some_n,)))
+
+    def test_for_invalid_x(self):
+        M, N = 20, 32
+        x = numpy.empty(M, dtype=numpy.float64)
+        f = numpy.empty(M, dtype=numpy.complex128)
+        f_hat = numpy.empty(N, dtype=numpy.complex128)
+        # array must be contigous
+        self.assertRaises(ValueError,
+                          lambda: NFFT(f=f, f_hat=f_hat, x=x[::2]))
+        # array must be of the right size
+        self.assertRaises(ValueError,
+                          lambda: NFFT(f=f, f_hat=f_hat, x=x[:-2]))
+        # array must be of the right type
+        self.assertRaises(ValueError,
+                          lambda: NFFT(f=f, f_hat=f_hat,
+                                       x=x.astype(numpy.float32)))
+
+    def test_for_invalid_f(self):
+        M, N = 20, 32
+        x = numpy.empty(M, dtype=numpy.float64)
+        f = numpy.empty(M, dtype=numpy.complex128)
+        f_hat = numpy.empty(N, dtype=numpy.complex128)
+        # array must be contigous
+        self.assertRaises(ValueError,
+                          lambda: NFFT(f=f[::2], f_hat=f_hat))
+        # array must be of the right type
+        self.assertRaises(ValueError,
+                          lambda: NFFT(f=f.astype(numpy.complex64), f_hat=f_hat))
+
+    def test_for_invalid_f_hat(self):
+        M, N = 20, 32
+        x = numpy.empty(M, dtype=numpy.float64)
+        f = numpy.empty(M, dtype=numpy.complex128)
+        f_hat = numpy.empty(N, dtype=numpy.complex128)
+        # array must be contigous
+        self.assertRaises(ValueError,
+                          lambda: NFFT(f=f, f_hat=f_hat[::2]))
+        # array must be of the right type
+        self.assertRaises(ValueError,
+                          lambda: NFFT(f=f, f_hat=f_hat.astype(numpy.complex64)))
+
+    def test_for_invalid_flags(self):
+        M, N = 20, 32
+        x = numpy.empty(M, dtype=numpy.float64)
+        f = numpy.empty(M, dtype=numpy.complex128)
+        f_hat = numpy.empty(N, dtype=numpy.complex128)
+        # non existing flags
+        invalid_flags = ('PRE_PHI_HOT', 'PRE_FOOL_PSI', 'FG_RADIO_PSI')
+        for flag in invalid_flags:
+            self.assertRaises(ValueError,
+                              lambda: NFFT(f=f, f_hat=f_hat, flags=(flag,)))
+        # managed flags
+        managed_flags = []
+        managed_flags.append([flag for flag in nfft_flags.keys()
+                              if flag not in nfft_supported_flags])
+        managed_flags.append([flag for flag in fftw_flags.keys()
+                              if flag not in nfft_supported_flags])
+        for flag in managed_flags:
+            self.assertRaises(ValueError,
+                              lambda: NFFT(f=f, f_hat=f_hat, flags=(flag,)))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pynfft.git



More information about the debian-science-commits mailing list