Skip to content

Commit d05c72e

Browse files
author
Nikolaj
committed
Merge pull request #24 from Funartech/develop
Develop
2 parents 5997d0d + 2e34ce8 commit d05c72e

76 files changed

Lines changed: 84919 additions & 1976 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/build/*
2+
/.idea/*
3+
/doc/build/*

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# sparse_lib
2-
Python/Cython library to replace PySparse (temporary name)
2+
Python/Cython library to replace PySparse.
3+
4+
SparseLib is a temporary name. Probably, we'll call it *CySparse*.

benchmarks/todo.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Benchmarks:
2+
3+
compare to:
4+
- PySparse
5+
- Scipy sparse matrices
6+
- with the use of BLAS via Tokyo

clean.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import os
2+
import shutil
3+
4+
# ad hoc script to clean repository
5+
directories = ['build']
6+
directories_to_skip = ['.git', '.idea', 'tests', 'benchmarks', 'doc']
7+
8+
files_exts = ['.c', '.so', '.pyc']
9+
10+
11+
def scandirs(path):
12+
for root, dirs, files in os.walk(path):
13+
if any(root.endswith(name) for name in directories_to_skip):
14+
continue
15+
for currentFile in files:
16+
#print "processing file: " + currentFile
17+
if any(currentFile.lower().endswith(ext) for ext in files_exts):
18+
os.remove(os.path.join(root, currentFile))
19+
20+
########################################################################################################################
21+
# main
22+
########################################################################################################################
23+
24+
current_path = os.path.curdir
25+
26+
try:
27+
for dir in directories:
28+
shutil.rmtree(os.path.join(current_path, dir))
29+
except:
30+
pass
31+
32+
try:
33+
scandirs(current_path)
34+
except:
35+
pass
36+

doc/Makefile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
9+
# Internal variables.
10+
PAPEROPT_a4 = -D latex_paper_size=a4
11+
PAPEROPT_letter = -D latex_paper_size=letter
12+
ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
13+
14+
.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
15+
16+
help:
17+
@echo "Please use \`make <target>' where <target> is one of"
18+
@echo " html to make standalone HTML files"
19+
@echo " pickle to make pickle files (usable by e.g. sphinx-web)"
20+
@echo " htmlhelp to make HTML files and a HTML help project"
21+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
22+
@echo " changes to make an overview over all changed/added/deprecated items"
23+
@echo " linkcheck to check all external links for integrity"
24+
25+
clean:
26+
-rm -rf build/*
27+
28+
html:
29+
mkdir -p build/html build/doctrees
30+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html
31+
@echo
32+
@echo "Build finished. The HTML pages are in build/html."
33+
34+
pickle:
35+
mkdir -p build/pickle build/doctrees
36+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle
37+
@echo
38+
@echo "Build finished; now you can process the pickle files or run"
39+
@echo " sphinx-web build/pickle"
40+
@echo "to start the sphinx-web server."
41+
42+
web: pickle
43+
44+
htmlhelp:
45+
mkdir -p build/htmlhelp build/doctrees
46+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp
47+
@echo
48+
@echo "Build finished; now you can run HTML Help Workshop with the" \
49+
".hhp project file in build/htmlhelp."
50+
51+
latex:
52+
mkdir -p build/latex build/doctrees
53+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex
54+
@echo
55+
@echo "Build finished; the LaTeX files are in build/latex."
56+
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
57+
"run these through (pdf)latex."
58+
59+
changes:
60+
mkdir -p build/changes build/doctrees
61+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes
62+
@echo
63+
@echo "The overview file is in build/changes."
64+
65+
linkcheck:
66+
mkdir -p build/linkcheck build/doctrees
67+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck
68+
@echo
69+
@echo "Link check complete; look for any errors in the above output " \
70+
"or in build/linkcheck/output.txt."

doc/source/conf.py

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Pysparse documentation build configuration file, created by
4+
# sphinx-quickstart on Sat Nov 8 00:17:09 2008.
5+
#
6+
# This file is execfile()d with the current directory set to its containing dir.
7+
#
8+
# The contents of this file are pickled, so don't put values in the namespace
9+
# that aren't pickleable (module imports are okay, they're removed automatically).
10+
#
11+
# All configuration values have a default; values that are commented out
12+
# serve to show the default.
13+
14+
import sys, os
15+
16+
# If your extensions are in another directory, add it here. If the directory
17+
# is relative to the documentation root, use os.path.abspath to make it
18+
# absolute, like shown here.
19+
#sys.path.append(os.path.abspath('../../../Lib'))
20+
sys.path.append('sphinxext')
21+
22+
# Import support for ipython console session syntax highlighting (lives
23+
# in the sphinxext directory defined above)
24+
import ipython_console_highlighting
25+
import mathjax
26+
27+
import sphinx_bootstrap_theme
28+
29+
# General configuration
30+
# ---------------------
31+
32+
# Add any Sphinx extension module names here, as strings. They can be extensions
33+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
34+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
35+
extensions += ['sphinx.ext.todo']
36+
extensions += ['sphinx.ext.inheritance_diagram']
37+
extensions += ['ipython_console_highlighting']
38+
extensions += ['mathjax']
39+
mathjax_path = 'https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
40+
41+
graphviz_output_format = 'svg'
42+
inheritance_node_attrs = dict(shape='box', fontsize=12,
43+
color='gray70', style='rounded')
44+
inheritance_graph_attrs = dict(rankdir="TB", size='""', bgcolor="transparent")
45+
46+
# Add any paths that contain templates here, relative to this directory.
47+
templates_path = ['.templates']
48+
49+
# The suffix of source filenames.
50+
source_suffix = '.rst'
51+
52+
# The encoding of source files.
53+
#source_encoding = 'utf-8'
54+
55+
# The master toctree document.
56+
master_doc = 'contents'
57+
58+
# General information about the project.
59+
project = u'SparseLib'
60+
copyright = u'2015, Dominique Orban and Nikolaj van Omme'
61+
62+
# The version info for the project you're documenting, acts as replacement for
63+
# |version| and |release|, also used in various other places throughout the
64+
# built documents.
65+
#
66+
# The short X.Y version.
67+
version = '0.0'
68+
# The full version, including alpha/beta/rc tags.
69+
release = '0.0.1'
70+
71+
# The language for content autogenerated by Sphinx. Refer to documentation
72+
# for a list of supported languages.
73+
#language = None
74+
75+
# There are two options for replacing |today|: either, you set today to some
76+
# non-false value, then it is used:
77+
#today = ''
78+
# Else, today_fmt is used as the format for a strftime call.
79+
#today_fmt = '%B %d, %Y'
80+
81+
# List of documents that shouldn't be included in the build.
82+
#unused_docs = []
83+
84+
# List of directories, relative to source directory, that shouldn't be searched
85+
# for source files.
86+
exclude_trees = []
87+
88+
# The reST default role (used for this markup: `text`) to use for all documents.
89+
#default_role = None
90+
91+
# If true, '()' will be appended to :func: etc. cross-reference text.
92+
#add_function_parentheses = True
93+
94+
# If true, the current module name will be prepended to all description
95+
# unit titles (such as .. function::).
96+
#add_module_names = True
97+
98+
# If true, sectionauthor and moduleauthor directives will be shown in the
99+
# output. They are ignored by default.
100+
#show_authors = False
101+
102+
# The name of the Pygments (syntax highlighting) style to use.
103+
pygments_style = 'sphinx'
104+
105+
# TODO list
106+
todo_include_todos = False
107+
108+
109+
# Options for HTML output
110+
# -----------------------
111+
112+
# The style sheet to use for HTML and HTML Help pages. A file of that name
113+
# must exist either in Sphinx' static/ path, or in one of the custom paths
114+
# given in html_static_path.
115+
html_theme = "bootstrap"
116+
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
117+
html_theme_options = {
118+
'source_link_position': "footer",
119+
# Bootswatch (http://bootswatch.com/) theme.
120+
'bootswatch_theme': "spacelab",
121+
}
122+
123+
# The name for this set of Sphinx documents. If None, it defaults to
124+
# "<project> v<release> documentation".
125+
#html_title = None
126+
127+
# A shorter title for the navigation bar. Default is the same as html_title.
128+
#html_short_title = None
129+
130+
# The name of an image file (relative to this directory) to place at the top
131+
# of the sidebar.
132+
#html_logo = 'spmatrix-logo.png'
133+
134+
# The name of an image file (within the static path) to use as favicon of the
135+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
136+
# pixels large.
137+
#html_favicon = None
138+
139+
# Add any paths that contain custom static files (such as style sheets) here,
140+
# relative to this directory. They are copied after the builtin static files,
141+
# so a file named "default.css" will overwrite the builtin "default.css".
142+
html_static_path = ['static']
143+
144+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
145+
# using the given strftime format.
146+
#html_last_updated_fmt = '%b %d, %Y'
147+
148+
# If true, SmartyPants will be used to convert quotes and dashes to
149+
# typographically correct entities.
150+
#html_use_smartypants = True
151+
152+
html_index = 'index.html'
153+
154+
# Custom sidebar templates, maps document names to template names.
155+
#html_sidebars = {'index' : 'indexsidebar.html'}
156+
157+
# Additional templates that should be rendered to pages, maps page names to
158+
# template names.
159+
#html_additional_pages = {'index' : 'index.html'}
160+
161+
# If false, no module index is generated.
162+
#html_use_modindex = True
163+
164+
# If false, no index is generated.
165+
#html_use_index = True
166+
167+
# If true, the index is split into individual pages for each letter.
168+
#html_split_index = False
169+
170+
# If true, the reST sources are included in the HTML build as _sources/<name>.
171+
#html_copy_source = True
172+
173+
# If true, an OpenSearch description file will be output, and all pages will
174+
# contain a <link> tag referring to it. The value of this option must be the
175+
# base URL from which the finished HTML is served.
176+
#html_use_opensearch = ''
177+
178+
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
179+
#html_file_suffix = ''
180+
181+
# Output file base name for HTML help builder.
182+
htmlhelp_basename = 'CySparseDoc'
183+
184+
185+
# Options for LaTeX output
186+
# ------------------------
187+
188+
# The paper size ('letter' or 'a4').
189+
#latex_paper_size = 'letter'
190+
191+
# The font size ('10pt', '11pt' or '12pt').
192+
#latex_font_size = '10pt'
193+
194+
# Grouping the document tree into LaTeX files. List of tuples
195+
# (source start file, target name, title, author, document class [howto/manual]).
196+
latex_documents = [
197+
('contents', 'Pysparse.tex', ur'Pysparse Documentation',
198+
ur'Roman Geus, Daniel Wheeler and Dominique Orban', 'manual'),
199+
]
200+
201+
# The name of an image file (relative to this directory) to place at the top of
202+
# the title page.
203+
latex_logo = 'spmatrix-logo.png'
204+
205+
# For "manual" documents, if this is true, then toplevel headings are parts,
206+
# not chapters.
207+
#latex_use_parts = False
208+
209+
# Additional stuff for the LaTeX preamble.
210+
latex_preamble = '\usepackage{amsfonts,amsmath}'
211+
212+
# Documents to append as an appendix to all manuals.
213+
#latex_appendices = []
214+
215+
# If false, no module index is generated.
216+
#latex_use_modindex = True

doc/source/contents.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
=======================
3+
CySparse documentation
4+
=======================
5+
6+
:Release: |version|
7+
:Date: |today|
8+
9+
.. module:: sparse_lib
10+
11+
.. toctree::
12+
:maxdepth: 2
13+
14+
introduction
15+
installation
16+
sparse_matrix_formats
17+
sparse_mat_hierarchy
18+
ll_mat
19+
cysparse_cython_users
20+
21+
.. #Sparse Matrix Formats <formats>
22+
#Low-Level Sparse Matrix Types <spmatrix>
23+
#Preconditioners <precon>
24+
#Iterative Solvers <itsolvers>
25+
#Direct Solvers <fact>
26+
#Eigenvalue Solver <jdsym>
27+
#Higher-Level Sparse Matrix Classes <pysparsematrix>
28+
#Other Sparse Matrix Packages <other>
29+
#License <license>
30+
31+
Some pages of this documentation display equations via the `jsMath
32+
<http://www.math.union.edu/~dpvc/jsMath/welcome.html>`_ package. They should
33+
look reasonably good with most setups but the best rendering is obtained by
34+
installing the TeX fonts. Please refer to
35+
`http://www.math.union.edu/~dpvc/jsMath/users/welcome.html
36+
<http://www.math.union.edu/~dpvc/jsMath/users/welcome.html>`_.
37+
38+
39+
Indices and Tables
40+
==================
41+
42+
* :ref:`genindex`
43+
* :ref:`modindex`
44+
* :ref:`search`
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.. cysparse_for_cython_users:
2+
3+
=========================================================
4+
:program:`CySparse` for :program:`Cython` users
5+
=========================================================
6+
7+
I efficiency is a major concern to you, we strongly encourage you to use :program:`Cython` to
8+
compile your own Python extension.
9+
10+
Accessing matrix elements
11+
==========================

0 commit comments

Comments
 (0)