📜 ⬆️ ⬇️

My open source bike

“The warrior will not abandon what he has begun.”
Master Shifu, mf Kung Fu Panda

You can consider this topic not as a technical, but as an art. There will be no pieces of code, class diagrams, and other nonsense. There will be a story of one java open source project, which I have been developing for about a year.

Start


It all started when I was in the fourth year at a provincial Russian university. From the semester, about which there were legends in my specialty, as a “semester-killer” with his 55th laboratory works on graphics, compilers and computational mathematics (hereinafter referred to as VM).

When at the beginning of the semester you think about the upcoming big and boring (and in universities, as a rule, everything is boring) work, it is not uncommon to lose heart. Fortunately, I already had a time-tested recipe for “endless enutizism”. Its meaning was “the infinite knowledge of the unknown” (c) the Strugatskys, Monday begins on Saturday . Simply put, every time I tried to distort the standard educational process at least somehow, so that it became a little more interesting for me. A large number of ways were tried - Linux on a working machine (with ATI drivers), languages ​​unpopular in university circles (read not C # and C ++) and development environments (read not VS2008), bug trackers for tasks, local code repositories for labs etc.
')
Then I decided to start writing my open source project, which is an aggregation of laboratory work on a VM course in the form of a java library with a transparent and familiar API for java programmers.

I created a project on Google Code , came up with the name of the library and the work began. Each of the following laboratories at the rate of VM was a bundle of commits to the library repository. It was something new for me and helped me maintain enthusiasm throughout the course.

At the end of the course, la4j (Linear Algebra for Java) has grown to version 0.0.7 and already knew how to work with vectors and matrices, solve linear equation systems in 6th different ways and find the eigenvalues ​​and vectors of matrices.

The middle


After completing the VM course, I almost didn’t work on the project, the course was over - my enthusiasm dried up. Everything changed when a new course began - Design Patterns.

I was incredibly interested in this course, I even started writing a series of articles on Habrahabr about this. But the main thing here is that I realized all the mistakes that I once made in la4j. I couldn’t tolerate this and, having armed myself with convenient Eclipse refactoring tools, I began to shred the code. This is version 0.1.0. A version that was not ashamed to show anyone. She had a nice OOP design, a small but sufficient functionality. And most importantly - it was the result of a fairly large work from which I felt satisfaction.

I can not say that before this stage I positioned la4j as an open source project. I perceived it as my hobby, as a platform for sharpening my knowledge and skills. I just did it just for fun.

Then for some time I forgot about la4j again and began to work hard on work, combining study and work. By the will of fate, I began to study the performance of the Java platform at work, and this fact forced me to take a fresh look at the computational algorithms inside la4j.

I tried to apply the experience of performance analysis and optimization in la4j. So the article “The Story of One Optimization” was born, which aroused great interest among my users in my project. At that moment I received a large number of reviews, and most importantly - offers of assistance. Several people have expressed a desire to help me further develop the project.

Then it seemed to me that now everything will change. People will start writing code and fly a bunch of commits to my repository. But that did not happen.

At least a couple of people I added to the project, told about future plans and even hung an issue on each of them with an approximate task. I myself was looking forward to the reaction of the new participants. Unfortunately, I did not wait. People disappeared, I decided to freeze the project indefinitely.

Then, I graduated from university and got a permanent job. Let me just say that I liked working much more than studying. I had a lot of free time, which I wasted trying to take a break from defending a diploma and a marathon 5 years long.

In September, all students begin to learn, and a conditioned reflex worked out of me, like Pavlov's dog - I need to write laboratory tests, learn functional analysis, etc. Then I remembered la4j and decided that I should finish it. Finish not because “the solution of the LU systems is a very important and urgent problem of the present”, but simply because I started it and did not finish it.

First of all, I transferred the project to Maven, and started writing tests, deciding to use the TDD methodology. As it turned out, my choice was successful - firstly, you can see progress, and secondly, you feel when the product is ready for release.

I completely revised the whole architecture, rewrote a large amount of code and wrote a new one. Added functionality (sparse matrices, expansions, input / output , etc.). I even fixed a few bugs that I could not notice without unit testing.

And ...

Almost end


A few days ago, I finished work on version 0.2.0 . A lot of work was done, a lot of technical and non-very solutions were made, 55 classes were designed and implemented, 6,700 lines of code and about 80 jUnit tests were written. I hope my work will not be wasted, and will become another convenient tool in the portfolio of any java-developer.

the end


I beg you, reader. Before writing a comment, pay attention to the list of ready questions and answers.

Q: “Nobody writes calculations to Java, bury!”
A: “They write. Moreover, they still do not want to use wrappers over BLAS due to binding to the native platform. ”

Q: “There’s JAMA, why another bike?”
O: a) Because he is his. b) JAMA does not support sparse matrices. c) JAMA does not support input / output. c) JAMA has a terrible API. d) JAMA has terrible performance.

Resources



UPD : Version 0.4.0 has recently become available (06/03/2013)

UPD : Version 0.4.5 has been quietly and quietly released (10/02/2013)

Source: https://habr.com/ru/post/132642/


All Articles