Permalink
Browse files

Fixed #48 (requires new packable-1.3.5), dense double matrix MATLAB .…

…mat v5 loading. Added spec to confirm.

Updated README and History.
  • Loading branch information...
1 parent 4c4a064 commit 5727559414a75eb76b52ef5bbd9d255e908b860b @mohawkjohn mohawkjohn committed Nov 1, 2012
Showing with 50 additions and 13 deletions.
  1. +1 −1 Gemfile
  2. +27 −2 History.txt
  3. +9 −3 README.rdoc
  4. +6 −6 lib/nmatrix/io/mat_reader.rb
  5. BIN spec/2x2_dense_double.mat
  6. +7 −1 spec/io_spec.rb
View
@@ -2,4 +2,4 @@
source "http://rubygems.org"
gemspec
-gem 'packable' # for Matlab IO
+gem 'packable', ">= 1.3.5" # for Matlab IO
View
@@ -14,7 +14,7 @@
* Added preliminary C API
- * Slicing and referencing support for dense and list matrices
+ * Slicing and referencing support for dense and list matrices (by @flipback)
* BLAS level-3 xTRSM algorithm added for rationals and BLAS types
@@ -36,4 +36,29 @@
* Sped up list storage item deletion, fixed bugs
-* Note: Element-wise list operations current disabled
+ * List matrix-to-hash conversion with `to_h`
+
+* Note: Element-wise list operations current disabled
+
+=== 0.0.3 / 2012-??-??
+
+* Numerous major enhancements
+
+ * Matrix-scalar operations (dense, list)
+
+ * Shortcuts for matrix creation (by @agarie)
+
+ * Access to most ATLAS-implemented LAPACK functions for those with ATLAS' clapack interface: xGETRF, xGETRI, xGETRS, xGESV, xPOTRF, xPOTRI, xPOTRS, xPOSV, xLASWP, xSCAL
+
+ * Non-ATLAS versions of clapack functions: xLASWP, xSCAL
+
+ * Matrix inversion (LU and Cholesky; requires LAPACK)
+
+ * LU factoring with and without LAPACK
+
+* Bug fixes:
+
+ * Yale-to-list casting
+
+ * Now requires packable-1.3.5 or higher, fixing a problem with MATLAB .mat v5 file I/O (specific to doubles)
+
View
@@ -43,19 +43,22 @@ The following features exist in the current version of NMatrix (0.0.2):
* xGEMM
* xTRSM
* LAPACK ATLAS access:
- * xGETRF (experimental)
+ * xGETRF, xGETRI, xGETRS, xGESV (Gaussian elimination)
+ * xPOTRF, xPOTRI, xPOTRS, xPOSV (Cholesky factorization)
+ * xLASWP, xSCAL
* LAPACK internal implementations (no library needed):
* xGETRF
+ * xLASWP, xSCAL
* LU decomposition
+* Matrix inversions (requires LAPACK)
=== Planned Features (Short-to-Medium Term)
These are features planned for NMatrix 0.1.0, our first beta.
* calculation of determinant, trace, and eigenvalues (characteristic polynomial) (0.1.0)
-* Gaussian elimination
* exponentials and square roots
-* matrix inversions
+* matrix inversions (LAPACK-free)
* matrix decomposition/factorization
* calculation of norms
* tensor products
@@ -87,6 +90,8 @@ If you get errors about clapack.h or cblas.h, figure out where your ATLAS header
locate clapack.h
+If you're a Mac user, we recommend you search for cblas.h instead.
+
Then, tell your system:
export C_INCLUDE_PATH=/usr/local/atlas/include
@@ -99,6 +104,7 @@ Finally, try compiling again.
* ATLAS and LAPACK, probably
* GCC 4.3
* Ruby 1.9
+* {packable}[http://github.com/marcandre/packable] 1.3.5 (used for I/O)
== INSTALLATION:
@@ -42,8 +42,8 @@ class MatReader
:miUINT16 => [Integer, {:signed => false, :bytes => 2}],
:miINT32 => [Integer, {:signed => true, :bytes => 4}],
:miUINT32 => [Integer, {:signed => false, :bytes => 4}],
- :miSINGLE => [Float, {:precision => :single, :bytes => 4}],
- :miDOUBLE => [Float, {:precision => :double, :bytes => 8}],
+ :miSINGLE => [Float, {:precision => :single, :bytes => 4, :endian => :native}],
+ :miDOUBLE => [Float, {:precision => :double, :bytes => 4, :endian => :native}],
:miINT64 => [Integer, {:signed => true, :bytes => 8}],
:miUINT64 => [Integer, {:signed => false, :bytes => 8}]
}
@@ -54,10 +54,10 @@ class MatReader
:int16 => [Integer, {:signed => true, :bytes => 2}],
:int32 => [Integer, {:signed => true, :bytes => 4}],
:int64 => [Integer, {:signed => true, :bytes => 8}],
- :float32 => [Float, {:precision => :single, :bytes => 4}],
- :float64 => [Float, {:precision => :double, :bytes => 8}],
- :complex64 => [Float, {:precision => :single, :bytes => 4}], #2x
- :complex128 => [Float, {:precision => :double, :bytes => 8}]
+ :float32 => [Float, {:precision => :single, :bytes => 4, :endian => :native}],
+ :float64 => [Float, {:precision => :double, :bytes => 8, :endian => :native}],
+ :complex64 => [Float, {:precision => :single, :bytes => 4, :endian => :native}], #2x
+ :complex128 => [Float, {:precision => :double, :bytes => 8, :endian => :native}]
}
ITYPE_PACK_ARGS = {
View
Binary file not shown.
View
@@ -52,9 +52,15 @@
n[3,3].should == 0
end
- it "reads MATLAB .mat file containing a single dense matrix" do
+ it "reads MATLAB .mat file containing a single dense integer matrix" do
n = NMatrix::IO::Matlab.load_mat("spec/4x5_dense.mat")
m = NMatrix.new(:dense, [4,5], [16,17,18,19,20,15,14,13,12,11,6,7,8,9,10,5,4,3,2,1])
n.should == m
end
+
+ it "reads MATLAB .mat file containing a single dense double matrix" do
+ n = NMatrix::IO::Matlab.load_mat("spec/2x2_dense_double.mat")
+ m = NMatrix.new(:dense, 2, [1.1, 2.0, 3.0, 4.0], :float64)
+ n.should == m
+ end
end

0 comments on commit 5727559

Please sign in to comment.