Skip to content

Commit 5cf682c

Browse files
v0droJohn Woods
authored andcommitted
Update history, manifest. Clean up CONTRIBUTING guides.
1 parent 626b6d0 commit 5cf682c

File tree

5 files changed

+181
-91
lines changed

5 files changed

+181
-91
lines changed

CONTRIBUTING.md

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
1-
NMatrix is part of SciRuby, a collaborative effort to bring scientific computation to Ruby. If you want to help, please
2-
do so!
1+
NMatrix is part of SciRuby, a collaborative effort to bring scientific
2+
computation to Ruby. If you want to help, please do so!
33

4-
This guide covers ways in which you can contribute to the development of SciRuby and, more specifically, NMatrix.
4+
This guide covers ways in which you can contribute to the development
5+
of SciRuby and, more specifically, NMatrix.
56

67
## How to help
78

8-
There are various ways to help NMatrix: bug reports, coding and documentation. All of them are important.
9+
There are various ways to help NMatrix: bug reports, coding and
10+
documentation. All of them are important.
911

10-
First, you can help implement new features or bug fixes. To do that, visit our
11-
[roadmap](https://github.com/SciRuby/nmatrix/wiki/Roadmap) or our [issue tracker][2]. If you find something that you
12-
want to work on, post it in the issue or on our [mailing list][1].
12+
First, you can help implement new features or bug fixes. To do that,
13+
visit our [roadmap](https://github.com/SciRuby/nmatrix/wiki/Roadmap)
14+
or our [issue tracker][2]. If you find something that you want to work
15+
on, post it in the issue or on our [mailing list][1].
1316

14-
You need to send tests together with your code. No exceptions. You can ask for our opinion, but we won't accept patches
15-
without good spec coverage.
17+
You need to send tests together with your code. No exceptions. You can
18+
ask for our opinion, but we won't accept patches without good spec
19+
coverage.
1620

17-
We use RSpec for testing. If you aren't familiar with it, there's a good
18-
[guide to better specs with RSpec](http://betterspecs.org/) that shows a bit of the syntax and how to use it properly.
19-
However, the best resource is probably the specs that already exist -- so just read them.
21+
We use RSpec for testing. If you aren't familiar with it, there's a
22+
good [guide to better specs with RSpec](http://betterspecs.org/) that
23+
shows a bit of the syntax and how to use it properly. However, the
24+
best resource is probably the specs that already exist -- so just read
25+
them.
2026

21-
And don't forget to write documentation (we use RDoc). It's necessary to allow others to know what's available in the
22-
library. There's a section on it later in this guide.
27+
And don't forget to write documentation (we use rdoc). It's necessary
28+
to allow others to know what's available in the library. There's a
29+
section on it later in this guide.
2330

24-
We only accept bug reports and pull requests in GitHub. You'll need to create a new (free) account if you don't have one
25-
already. To learn how to create a pull request, please see
31+
We only accept bug reports and pull requests in GitHub. You'll need to
32+
create a new (free) account if you don't have one already. To learn
33+
how to create a pull request, please see
2634
[this guide on collaborating](https://help.github.com/categories/63/articles).
2735

28-
If you have a question about how to use NMatrix or SciRuby in general or a feature/change in mind, please ask the
36+
If you have a question about how to use NMatrix or SciRuby in general
37+
or a feature/change in mind, please ask the
2938
[sciruby-dev mailing list][1].
3039

3140
Thanks!
@@ -34,11 +43,11 @@ Thanks!
3443

3544
To start helping with the code, you need to have all the dependencies in place:
3645

37-
- ATLAS and LAPACK
3846
- GCC 4.3+
3947
- git
4048
- Ruby 1.9+
4149
- `bundler` gem
50+
- ATLAS/LAPACKE/FFTW dependending on the plugin you want to change.
4251

4352
Now, you need to clone the git repository:
4453

@@ -50,9 +59,11 @@ $ rake compile
5059
$ rake spec
5160
```
5261

53-
This will install all dependencies, compile the extension and run the specs.
62+
This will install all dependencies, compile the extension and run the
63+
specs.
5464

55-
If everything's fine until now, you can create a new branch to work on your feature:
65+
If everything's fine until now, you can create a new branch to work on
66+
your feature:
5667

5768
```bash
5869
$ git branch new-feature
@@ -64,46 +75,62 @@ Before commiting any code, please read our
6475

6576
### Guidelines for interfacing with C/C++
6677

67-
NMatrix uses a lot of C/C++ to speed up execution of processes and give more control over data types, storage types, etc. Since we are interfacing between two very different languages, things can get out of hand pretty fast.
78+
NMatrix uses a lot of C/C++ to speed up execution of processes and
79+
give more control over data types, storage types, etc. Since we are
80+
interfacing between two very different languages, things can get out
81+
of hand pretty fast.
6882

6983
Please go thorough this before you create any C accessors:
7084

71-
* Perform all pre-computation error checking in Ruby.
72-
- Since this is (mostly) a trivial computation, doing this in Ruby before calling the actual C code will save immensely on time needed to read and write code. Plus, one won't need to write obscure code for accessing NMatrix attributes in C code (`NM_SHAPE0(obj)` for example), saving both the readers' and writers' time.
85+
* Perform all pre-computation error checking in Ruby.
7386
* Curate any extra data (cloned objects, trivial computations, etc.) in Ruby.
74-
* The corresponding extern "C" exposed function should have a name format `nm_#{function_name}`, this function should call a C++ function which should follow a convention `nm_#{sub_namespace}_#{function_name}` and the C++ templated function that is called by this function should be inside a namespace `nm::#{sub_namespace}`.
75-
* Do _NOT_ resolve VALUE into constituent elements unless they reach the function where the elements are needed or it is absolutely necessary. Passing around a VALUE in the C/C++ core is much more convienient than passing around `void*` pointers which point to an array of matrix elements.
76-
- If you'll look at [this line](https://github.com/v0dro/nmatrix/commit/b957c5fdbcef0bf1ebe78922f84f9ea37938b247#diff-55f2ba27400bce950282e78db97bfbcfR1791), you'll notice that matrix elements aren't resolved until the final step i.e. passing the elements into the `nm::math::solve` function for the actual computation.
87+
* Do _NOT_ resolve VALUE into constituent elements unless they reach
88+
the function where the elements are needed or it is absolutely
89+
necessary. Passing around a VALUE in the C/C++ core is much more
90+
convienient than passing around `void*` pointers which point to an
91+
array of matrix elements.
7792

7893
Basically, follow a practice of 'once you enter C, never look back!'.
7994

80-
If you have something more in mind, discuss it in the issue tracker or on [this](https://groups.google.com/forum/#!topic/sciruby-dev/OJxhrGG309o) thread.
95+
If you have something more in mind, discuss it in the issue tracker or
96+
on
97+
[this](https://groups.google.com/forum/#!topic/sciruby-dev/OJxhrGG309o)
98+
thread.
8199

82100
## C/C++ style guide
83101

84102
This section is a work in progress.
85103

86-
* Single statements following a `if`/`while`/`for` etc. should be preferably on the same line and _enclosed within braces_.
87104
* Use camel_case notation for arguments. No upper case.
88-
* Write a brief description of the arguments that your function receives in the comments directly above the function.
89-
* Explicitly state in the comments any anomalies that your function might have. For example, that it does not work with a certain storage or data type.
105+
* Write a brief description of the arguments that your function
106+
receives in the comments directly above the function.
107+
* Explicitly state in the comments any anomalies that your function
108+
might have. For example, that it does not work with a certain
109+
storage or data type.
90110

91111
## Documentation
92112

93-
There are two ways in which NMatrix is being documented: guides and comments, which are converted with RDoc into the
94-
documentation seen in [sciruby.com](http://sciruby.com).
113+
There are two ways in which NMatrix is being documented: guides and
114+
comments, which are converted with RDoc into the documentation seen in
115+
[sciruby.com](http://sciruby.com).
95116

96-
If you want to write a guide on how to use NMatrix to solve some problem or simply showing how to use one of its
97-
features, write it as a wiki page and send an e-mail on the [mailing list][1]. We're working to improve this process.
117+
If you want to write a guide on how to use NMatrix to solve some
118+
problem or simply showing how to use one of its features, write it as
119+
a wiki page and send an e-mail on the [mailing list][1]. We're working
120+
to improve this process.
98121

99122
If you aren't familiar with RDoc syntax,
100123
[this is the official documentation](http://docs.seattlerb.org/rdoc/RDoc/Markup.html).
101124

102125
## Making new nmatrix extensions
103126

104-
From version 0.2, nmatrix supports extensions, all of which can be hosted from the main nmatrix repo.
127+
From version 0.2, NMatrix supports extensions, all of which can be
128+
hosted from the main nmatrix repo.
105129

106-
Refer to [this blog post ](http://wlevine.github.io/2015/06/15/releasing-multiple-gems-with-c-extensions-from-the-same-repository.html) to see how to do that in case you want to write your own extension for nmatrix.
130+
Refer to
131+
[this blog post ](http://wlevine.github.io/2015/06/15/releasing-multiple-gems-with-c-extensions-from-the-same-repository.html)
132+
to see how to do that in case you want to write your own extension for
133+
nmatrix.
107134

108135
## Conclusion
109136

History.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,3 +739,43 @@
739739
* Fixed bug where Array#to_nm would alter the array (by
740740
@andrewcsmith)
741741

742+
=== 0.2.1 / 2016-01-18
743+
744+
* 3 major enhancements:
745+
746+
* New plugin nmatrix-fftw for wrapping over FFTW (by
747+
@v0dro)
748+
749+
* Change Ruby Array C pointer references to be compatible
750+
with Ruby 2.3.0 (by @mrkn)
751+
752+
* NMatrix can now be compiled with clang (by @mrkn)
753+
754+
* 4 minor enhancements:
755+
756+
* Improved Travis configs to test on Linux and OSX with
757+
and without plugins (by @mrkn)
758+
759+
* Added non-abbreviated versions to the options of
760+
NMatrix#solve; added more docs (by @agisga)
761+
762+
* Added several specialized algorithms to NMatrix#solve
763+
for more efficient solving of linear systems with upper
764+
or lower triangular matrices (by @agisga)
765+
766+
* Remove redundant C implementation of
767+
NMatrix#complex_conjugate (by @yoongkang)
768+
769+
* 4 bug fixes:
770+
771+
* Fixed memory leak in math.cpp (inverse()) (by @lokeshh)
772+
773+
* Check if optional permute parameter in NMatrix#transpose
774+
is an Array to prevent unexpected disappearing-parameter
775+
behavior (by @firemind)
776+
777+
* Moved rubyobj_from_cval function into `nm` namespace
778+
from C-linkage to fix a C compile time error (by @mrkn)
779+
780+
* Fixed undefined variable 'idefaults' in lapacke extconf
781+
(by @agisga)

Manifest.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ Gemfile
88
nmatrix.gemspec
99
nmatrix-atlas.gemspec
1010
nmatrix-lapacke.gemspec
11+
nmatrix-fftw.gemspec
12+
travis.sh
1113
.travis.yml
1214
lib/nmatrix.rb
1315
lib/nmatrix/atlas.rb
16+
lib/nmatrix/fftw.rb
1417
lib/nmatrix/lapack_core.rb
1518
lib/nmatrix/lapack_ext_common.rb
1619
lib/nmatrix/lapack_plugin.rb
@@ -207,5 +210,5 @@ ext/nmatrix/ruby_nmatrix.c
207210
ext/nmatrix/types.h
208211
ext/nmatrix/nm_memory.h
209212
ext/nmatrix/extconf.rb
210-
211-
213+
ext/nmatrix_fftw/extconf.rb
214+
ext/nmatrix_fftw/nmatrix_fftw.cpp

0 commit comments

Comments
 (0)