Developing

Developing Laplacians.jl

Learn to use git

git checkout -b MyName
*~
*#
.ipynb_*
.DS_Store
*.cov
docs/build
docs/site

section of the Julia docs about building packages.

Tests

Every piece of code should have a test in the "tests" directory. Ideally, it should have enough tests to run every line of the code. To run all the tests from the command prompt, type

julia -e 'Pkg.test("Laplacians")'

Fast code?

Just go for it. Don't worry about writing fast code at first. Just get it to work. We can speed it up later.

Within some of the files, I am keeping old, unoptimized versions of code around for comparison (and for satisfaction). I will give them the name "XSlow"

Documentation

This documentation is still very rough. It is generated by a combination of Markdown and semi-automatic generation, using the Documenter.jl package. The one annoying feature of this package is that it will not allow the inclusion of a docstring on more than one page. I don't know why.

The steps to generate and improve the documentation are:

Parametric Types

A sparse matrix has two types associated with it: the types of its indices (some sort of integer) and the types of its values (some sort of number). Most of the code has been written so that once these types are fixed, the type of everything else in the function has been too. This is accomplished by putting curly braces after a function name, with the names of the types that we want to use in the braces. For example,

shortestPaths{Tv,Ti}(mat::SparseMatrixCSC{Tv,Ti}, start::Ti)

Tv, sometimes written Tval denotes the types of the values, and Ti or Tind denotes the types of the indices. This function will only be called if the node from which we compute the shortest paths, start is of type Ti. Inside the code, whenever we write something like pArray = zeros(Ti,n), it creates an array of zeros of type Ti. Using these parameteric types is much faster than leaving the types unfixed.

Data structures:

Interface issue:

There are many different sorts of things that our code could be passing around. For example, kruskal returns a graph as a sparse matrix. But, we could use a format that is more specialized for trees, like the RootedTree type. At some point, when we optimize code, we will need to figure out the right interfaces between routines. For example, some routines symmetrize at the end. This is slow, and should be skipped if not necessary. It also doubles storage.

Integration with other packages.

There are other graph packages that we might want to sometimes use.