# Summer of Code - Getting Started

The following is distilled from the Projects page for the benefit of potential Summer of Code students. Although students are welcome to attempt any of the projects in that page or any of their own choosing, here we offer some suggestions on what good student projects might be.

## Contents

- 1 General Guidelines
- 2 Suggested projects
- 2.1 Numerical
- 2.1.1 Incomplete sparse factorizations ichol, ilu
- 2.1.2 General purpose library for Finite Element methods
- 2.1.3 Improve logm, sqrtm, funm
- 2.1.4 Generalised eigenvalue problem
- 2.1.5 Various sparse matrix improvements
- 2.1.6 Implement solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D

- 2.2 GUI
- 2.3 Graphics
- 2.4 Interpreter
- 2.5 Infrastructure
- 2.6 Octave-Forge packages

- 2.1 Numerical

# General Guidelines

Octave is mostly written in (sadly, mostly undocumented) C++ and its own scripting language (m-scripts), which includes (or should include) most of the Matlab language as a subset. We generally prefer a different Octave house style to the usual Matlab style for m-scripts, but it's primarily a superficial stylistic difference. Additionally, there are bits and pieces of Fortran, Perl, C, awk, and Unix shell scripts here and there. In addition to being familiar with C++ and/or Octave or Matlab's scripting languages, you should probably be familiar or learn about Octave's infrastructure:

- The GNU build system is used to build Octave. While you generally don't need to understand too much unless you actually want to change how Octave is built, you should be able to understand enough to get a general idea of how to build Octave. If you've ever done a
`configure && make && make install`series of commands, you have already used the GNU build system. - Mercurial (abbreviated hg) is the distributed version control system (DVCS) we use for managing our source code. You should have some basic understanding of how a DVCS works, but hg is pretty easy to pick up, especially if you already know a VCS like git or svn.
- You should also read the same contributing guidelines we have for everyone.
- We primarily use mailing lists for communication. You should follow basic mailing list etiquette. For us, this mostly means "do not top post".
- We also have an IRC channel. The atmosphere is more relaxed, and we may talk about things that are not at all related to Octave.
- Octave-Forge is a project closely related to Octave where packages reside. They are somewhat analogous to Matlab's toolboxes.
- In addition, you probably should know
**some**mathematics, engineering, or experimental science or something of the sort. If you've used Matlab before, you probably have already been exposed to the kinds of problems that Octave is used for.

# Suggested projects

The following projects are broadly grouped by category and probable skills required to tackle each. Remember to check Projects for more ideas if none of these suit you, and your own ideas are always welcome.

## Numerical

These projects involve implementing certain mathematical functions in Octave.

**Required skills**: You should understand quite a bit of mathematics. Words like "eigenvalue", "analytic", and "Taylor series" shouldn't scare you at all. There is probably little C++ experience required, and probably many of these problems can be solved with m-scripts.

**Difficulty**: Mid-to-hard depending how much mathematics you know and how well you can read numerical analysis journal articles.

**Potential mentor**: Carlo de Falco, Nir Krakauer, Fotios Kasolis, Luis Gustavo Lira

### Incomplete sparse factorizations ichol, ilu

Implement incomplete Cholesky and LU factorization for sparse matrices. These functions are available in Matlab as cholinc/ichol and luinc/ilu. Incomplete factorizations are useful as preconditioners for iterative solvers such as gmres and gmres or pcg. The classic book Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods has a chapter describing the ILU algorithm in detail, though the algorithm described there should be adapted to Octave's internal Sparse Matrix file format which is CCS rather than CRS. The implementation of ILU in Octave has been recently discussed in the maintainers list and initial implementations were posted in this thread. In another thread it was suggested to implement the ILU by interfacing Octave to ITSOL. Compared to other projects in this section this one might require more knowledge of C++.

### General purpose library for Finite Element methods

Octave-Forge already has a set of packages for discretizing Partial Differential operators by Finite Elements and/or Finite Volumes, namely the Bim package which relies on the [1]

### Improve logm, sqrtm, funm

The goal here is to implement some missing Matlab functions related to matrix functions like the matrix exponential. There is a general discussion of the problem.

### Generalised eigenvalue problem

Certain calling forms of the `eig` function are missing. The problem is to understand what those missing forms are and implement them.

### Various sparse matrix improvements

The implementation of sparse matrices in Octave needs several improvements. Any of these would be good. The paper by Bateman & Adler is good reading for understanding the sparse matrix implementation.

### Implement solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D

The project will deliver a solver for initial-boundary value problems for parabolic-elliptic PDEs in 1D similar to Matlab's function `pdepe`. A good starting point is the method of lines for which you can find more details here and here, whereas an example implementation can be found here. In addition, this page provides some useful material.

## GUI

Octave is currently working on a new native GUI. It is written in Qt, but it is still not ready for production. There are various ways in which it could be improved.

**Required skills**: C++ and Qt. Whatever tools you want to use to write Qt code are fine, but Qt Creator is a popular choice nowadays.

**Difficulty**: Mostly medium, depending if you've had Qt or GUI development experience before.

**Potential mentor**: Jordi Gutiérrez Hermoso, Michael Goffioul, Torsten

### Finish the Octave GUI

The GUI is currently on its own branch in hg. It is not stable enough and its design is still in flux. It is in a very alpha stage and needs to be turned into a real usable product. At the moment, it consists of the basic building blocks (terminal window, editor, variable browser, history, file browser) that are put together into a main interface. The GUI uses the Qt library. Among the things to improve are:

- improve integration with octave: variable browser/editor, debugger, profiler...
- define and implement an option/preferences dialog
- improve additional components like the documentation browser

### Implement a Qt widget for manipulating plots

Octave has had for some time a native OpenGL plotter. The plotter requires some user interaction for manipulating the plots, and it's been using fltk for quite some time. We want to replace this with Qt, so it fits better with the overall GUI look-and-feel and is easier to extend in the future.

QtHandles is a current work in progress integrating the octave OpenGL renderer plus good support for GUI elements (uicontrol, uimenu, uitoolbar...). This project may initially consists of integrating the existing QtHandles code base into Octave. Then if time permits, further improvements can be made to QtHandles.

### Create a better (G)UI for the profiler

During GSoC 2011, Daniel Kraft successfully implemented a profiler for Octave. It needs a better interface and a way to generate reports. This may be done with Qt, but not necessarily, and HTML reports might also be good.

### Create a graphical design tool for tuning closed loop control system (control pkg)

When tuning a SISO feedback system it is very helpful to be able to grab a pole or a zero and move them by dragging them with the mouse. As they are moving the software must update all the plotted lines. There should be the ability to display various graphs rlocuse, bode, step, impulse etc. and have them all change dynamically as the mouse is moving. The parameters of the compensator must be displayed and updated. Potential mentor: Doug Stewart

## Graphics

Octave has a new native OpenGL plotter (currently via fltk, but we want to move away from that). There are several possible projects involved with it.

**Required skills**: C++ and OpenGL. General understanding of computer graphics.

**Difficulty**: Medium, depending on your previous understanding of the topic.

**Potential mentor**: Michael Goffioul

### Lighting

Implement transparency and lighting in OpenGL backend(s). A basic implementation is available in JHandles. This needs to be ported/re-implement/re-engineered/optimized in the C++ OpenGL renderer of Octave.

### Object selection in OpenGL renderer

This project is about the implementation of a selection method of graphics elements within the OpenGL renderer [2]

### Non-OpenGL renderer

Besides the original gnuplot backend, Octave also contains an OpenGL-based renderer for advanced and more powerful 3D plots. However, OpenGL is not perfectly suited for 2D-only plots where other methods could result in better graphics. The purpose of this project is to implement an alternate graphics renderer for 2D only plots (although 3D is definitely not the focus, extending the new graphics renderer to support basic 3D features should also be taken into account). There is no particular toolkit/library that must be used, but natural candidates are:

- Qt: the GUI is currently written in Qt and work is also in progress to provide a Qt/OpenGL based backend [3]
- Cairo: this library is widely used and known to provides high-quality graphics with support for PS/PDF/SVG output.

### TeX/LaTeX markup

Text objects in plots (like titles, labels, texts...) in the OpenGL renderer only support plain text mode without any formatting possibility. Support for TeX and/or LaTeX formatting needs to be added.

The TeX formatting support actually only consists of a very limited subset of the TeX language. This can be implemented directly in C++ into Octave by extending the existing text engine, avoiding to add a dependency on a full TeX system.

On the other hand, the LaTeX formatting support is expected to provide full LaTeX capabilities. This will require to use an external LaTeX system to produce text graphics in some format (to be specified) that is then integrated into Octave plots.

The matplotlib project has already done this in Python and might be used as an example of how to do this in Octave. Mediawiki has also also done something similar.

## Interpreter

The interpreter is written in C++, undocumented. There are many possible projects associated with it.

**Required skills**: *Very good* C and C++ knowledge, possibly also understanding of GNU bison and flex. Understanding how compilers and interpreters are made plus being able to understand how to use a profiler and a debugger will probably be essential skills.

**Difficulty**: Mid hard to very hard. Some of the biggest problems will probably be the interpreter.

**Potential mentors**: John W. Eaton, Jordi Gutiérrez Hermoso

### Improve JIT compiling

Octave's interpreter is *very* slow on some loops. Last year, thanks to Max Brister's work, an initial implement of a just-in-time compiler (JITC) in LLVM for GSoC 2012. This project consists in understanding Max's current implementation and extending it so that functions and exponents (e.g. 2^z) compile with the JITC. This requires knowledge of compilers, C++, LLVM, and the Octave or Matlab languages. A capable student who demonstrates the ability to acquire this knowledge quickly may also be considered. Max himself will mentor this project.

### Improve memory management

From profiling the interpreter, it appears that a lot of time is spending allocating and deallocating memory. A better memory management algorithm might provide some improvement.

### Implement classdef classes

Matlab has two kinds of classes: old style @classes and new style classdef. Octave has only fully implemented the old style. There is partial support for new classes in our classdef branch. There is irregular work here, and classdef is a very complicated thing to fully implement. A successful project would be to implement enough of classdef for most basic usages. Familiarity with Matlab's current classdef support would be a huge plus. Michael Goffioul and jwe can mentor this.

## Infrastructure

There are several projects closely related to Octave but not exactly core Octave that could be worked on. They are mostly infrastructure around Octave, stuff that would help a lot.

**Required skills**: Various. See below.

**Difficulty**: Various. See below.

**Potential mentor**: Jordi Gutiérrez Hermoso, Carlo de Falco

### Finish the Agora website

In 2009, the Mathworks decided to restrict the terms of use Matlab Central, a place dedicated to Matlab collaboration. The Mathworks forbade copyleft licenses and using the "free" code found in Matlab central on anything other than Mathworks products (e.g. forbidding from using it on Octave, even if the authors of the code wanted to allow this). Thus Octave users have no place to centrally, quickly, and conveniently share Octave code. See the FAQ for more details.

In response to this, a website started to form, Agora Octave.

This should be relatively easy webdev in Python using Django.

Things to be considered when working on this:

- discussion of Agora during OctConf2012
- Scipy Central - a website with the same objective as Agora for Scipy. Their code is released under a BSD license. Might be useful to reuse some parts.

Most of the basic functionality of Agora is already in, but there are many ways in which it could be improved, such as implementing comment threads, giving it an email interface, or a ReSTful API which could be used from Octave for package management.

### Update the Emacs octave mode

Emacs has an octave-mode that requires a lot of updating and maintenance. This should also be an easy project if you already use Emacs and elisp.

### Improve binary packaging

We would like to be able to easily generate binary packages for Windows and Mac OS X. Right now, it's difficult and tedious to do so. Any way to help us do this in a faster way would be appreciated. Required knowledge is understanding how building binaries in Windows and Mac OS X works. Medium difficulty.

### Installation of packages

We would like to enhance the management of Octave-forge packages from within Octave environment. Currently there is a working (but rather monolithic) function that is used to do the job. The work would be to improve the way Octave interacts with the package server. Since the functionality is already sketched by the current function, the most important skill is software design.

**Minimum requirements**: Ability to read and write Octave code. Minimal FTP/HTTP knowledge.

**Difficulty**: Easy

## Octave-Forge packages

### Rewrite symbolic package

Octave's current symbolic package for symbolic computation is outdated, fragile and limited in its capabilities. The new symbolic package should offer better Matlab compatibility, for example handling of symbolic matrices. Like the current symbolic package, the new package could use the proven GiNaC library for symbolic computations.

The work would be to integrate GiNaC by using Octave's objects and classes. This can be done in C++ in a way similar to Michele Martone's new sparsersb package.

**Required skills**: C++. Ability to understand Octave and GiNaC API documentation.

**Difficulty**: medium.

**Potential mentor**: Lukas Reichlin

### Improvements to n-dimensional image processing

The image package has partial functionality for n-dimensional images. These images do exist in practice for example in medical imaging where slices from scans are assembled to form medical 3d images, or even exposures taken over time can result in 4d images. All of the base functions should be modified so that they can handle n-dimensional images, and corresponding Matlab functions such as `bwconncomp`

or n-dimensional version of `bwdist`

should be implemented.

**Required skills**: Mostly m-file scripting, perhaps some C++. Familiarity with common CS algorithms would be useful.

**Difficulty**: medium.

**Potential mentor**: Jordi Gutiérrez Hermoso