Permalink
Browse files

Update to 0.0.1, first alpha release. Mostly moved some files around …

…and fixed requires so they would work during gem building. Also so things would be a little more consistent for other contributors.
  • Loading branch information...
1 parent dfa760a commit 53da083c08d44f820ad3925e42055b8c0f10c35a @mohawkjohn mohawkjohn committed Apr 10, 2012
View
@@ -1,13 +1,16 @@
.idea
-a.out
-a.out.dSYM
-src/dtypes.h
-src/dtypes.c
-src/dfuncs.c
-src/*.o
-src/*.so
-src/Makefile
-src/nmatrix_config.h
-src/test.rb
Gemfile.lock
+ext/nmatrix/dense/daxpy.c
+ext/nmatrix/dense/dgeco.c
+ext/nmatrix/dense/dgefa.c
+ext/nmatrix/dense/dgemm.c
+ext/nmatrix/dense/dgemv.c
+ext/nmatrix/dense/dscal.c
+ext/nmatrix/dense/idamax.c
+ext/nmatrix/dense/467.c
+ext/nmatrix/dense/*.f
+ext/nmatrix/dense/transpose.txt
+ext/nmatrix/yale/aicm.tex
tmp/
+test.c
+spec/*.mtx
View
@@ -1,6 +1,6 @@
-=== 1.0.0 / 2011-12-24
+=== 0.0.1 / 2012-04-10
* 1 major enhancement
- * Birthday!
+ * Initial alpha release
View
@@ -1,16 +1,51 @@
.autotest
History.txt
Manifest.txt
-README.txt
+README.rdoc
+LICENSE.txt
Rakefile
-Gemspec
-bin/nmatrix
-lib/nmatrix.rb
-src/list.h
-src/list.c
-src/dense.h
-src/dense.c
-src/nmatrix.h
-src/nmatrix.c
+Gemfile
spec/nmatrix_spec.rb
+spec/nmatrix_yale_spec.rb
+spec/nvector_spec.rb
+spec/syntax_tree_spec.rb
+lib/array.rb
+lib/nmatrix.rb
+lib/string.rb
+ext/nmatrix/cblas.c
+ext/nmatrix/dense.c
+ext/nmatrix/depend
+ext/nmatrix/extconf.rb
+ext/nmatrix/generator.rb
+ext/nmatrix/list.c
+ext/nmatrix/nmatrix.c
+ext/nmatrix/nmatrix.h
+ext/nmatrix/rational.c
+ext/nmatrix/yale.c
+ext/nmatrix/generator/syntax_tree.rb
+ext/nmatrix/dense/blas_header.template.c
+ext/nmatrix/dense/elementwise.template.c
+ext/nmatrix/dense/gemm.template.c
+ext/nmatrix/dense/gemv.template.c
+ext/nmatrix/dense/rationalmath.template.c
+ext/nmatrix/yale/smmp1.template.c
+ext/nmatrix/yale/smmp2.template.c
+ext/nmatrix/yale/smmp1_header.template.c
+ext/nmatrix/yale/smmp2_header.template.c
+ext/nmatrix/yale/sort_columns.template.c
+ext/nmatrix/yale/symbmm.template.c
+ext/nmatrix/yale/numbmm.template.c
+ext/nmatrix/yale/transp.template.c
+ext/nmatrix/yale/complexmath.template.c
+ext/nmatrix/yale/elementwise.template.c
+ext/nmatrix/yale/elementwise_op.template.c
+
+
+
+
+
+
+
+
+
View
@@ -1,8 +1,6 @@
-= SciRuby: NMatrix
+= NMatrix
-A linear algebra library for scientific computing in Ruby. NMatrix is part of SciRuby.
-
-NMatrix was originally inspired by and derived from {NArray}[http://narray.rubyforge.org], by Masahiro Tanaka.
+http://sciruby.com
* {Project homepage: sciruby.com}[http://sciruby.com]
* {SciRuby on Google+}[https://plus.google.com/109304769076178160953/posts]
@@ -12,6 +10,8 @@ NMatrix was originally inspired by and derived from {NArray}[http://narray.rubyf
NMatrix is an experimental linear algebra library for Ruby, written mostly in C. It can be used with or without SciRuby, but is part of the SciRuby project.
+NMatrix was inspired by and based heavily upon {NArray}[http://narray.rubyforge.org], by Masahiro Tanaka.
+
{<img src=https://www.pledgie.com/campaigns/15783.png?skin_name=chrome>}[http://www.pledgie.com/campaigns/15783]
=== WARNING:
View
@@ -1,6 +1,16 @@
# -*- ruby -*-
require 'rubygems'
+
+# Fix for problem described here: https://github.com/jbarnette/isolate/pull/39
+module Gem
+ Deprecate = Module.new do
+ include Deprecate
+ end
+end
+require 'isolate/now'
+# End Fix
+
require 'hoe'
require 'pathname'
require 'rspec/core/rake_task'
View
@@ -3,9 +3,9 @@ dtypes.h dtypes.c smmp1.c smmp2.c blas.c: generator.rb
blas.o: blas.c
-smmp2.o: smmp1.c smmp2.c nmatrix.h smmp/smmp_header.template.c smmp/symbmm.template.c smmp/transp.template.c smmp/numbmm.template.c
+smmp2.o: smmp1.c smmp2.c nmatrix.h yale/smmp2_header.template.c yale/symbmm.template.c yale/transp.template.c yale/numbmm.template.c
-smmp1.o: smmp1.c nmatrix_config.h nmatrix.h
+smmp1.o: smmp1.c nmatrix_config.h nmatrix.h yale/smmp1_header.template.c
dfuncs.o: dfuncs.c $(hdrdir)/ruby.h
View
@@ -24,20 +24,25 @@
#
# Module for generating source files.
+$RELATIVE_PATH = nil
+
$IN_MAKEFILE = begin
dir_pwd_split = Dir.pwd.split('/')
- if dir_pwd_split.size >= 4 && dir_pwd_split[-4] == "tmp"
- require "../../../../lib/string.rb" # from the Makefile
- require "../../../../ext/nmatrix/generator/syntax_tree.rb"
+ if dir_pwd_split.size >= 4 && dir_pwd_split[-4] == "tmp" # when running make by hand
+ $RELATIVE_PATH = "../../../../"
+ true
+ elsif dir_pwd_split[-2] == "ext" # when building gem
+ $RELATIVE_PATH = File.join(File.dirname(__FILE__), "../..")
true
- else
- # STDERR.puts Dir.pwd
- require "./lib/string.rb" # from the console, for testing
- require "./ext/nmatrix/generator/syntax_tree.rb"
+ else # when building in development dir
+ $RELATIVE_PATH = File.dirname(__FILE__)
false
end
end
+require File.join($RELATIVE_PATH, "lib/string.rb") # from the Makefile
+require File.join($RELATIVE_PATH, "ext/nmatrix/generator/syntax_tree.rb")
+
class DTypeInfo < Struct.new(:enum, :sizeof, :sym, :id, :type)
def max_macro
typename = self.sizeof.to_s
@@ -415,25 +420,25 @@ def make_dfuncs_c
def make_templated_c relative_path, header_name, names, output_name, subs = {:TYPE => INDEX_DTYPES}
# First print the header once
- `cat #{Dir.pwd}/../../../../#{SRC_DIR}/#{relative_path}/#{header_name}.template.c > ./#{output_name}` unless header_name.nil?
+ `cat #{$RELATIVE_PATH}/#{SRC_DIR}/#{relative_path}/#{header_name}.template.c > ./#{output_name}` unless header_name.nil?
subs[:TYPE].each do |type|
if subs.has_key?(:INT)
subs[:INT].each do |int|
names.each do |name|
- template "#{Dir.pwd}/../../../../#{SRC_DIR}/#{relative_path}/#{name}.template.c", output_name, :TYPE => type, :INT => int
+ template "#{$RELATIVE_PATH}/#{SRC_DIR}/#{relative_path}/#{name}.template.c", output_name, :TYPE => type, :INT => int
end
end
else
names.each do |name|
- template "#{Dir.pwd}/../../../../#{SRC_DIR}/#{relative_path}/#{name}.template.c", output_name, :TYPE => type
+ template "#{$RELATIVE_PATH}/#{SRC_DIR}/#{relative_path}/#{name}.template.c", output_name, :TYPE => type
end
end
end
end
def sub_int_real relative_path, name, output_name, int_dtype, real_dtype
- cmd = ["#{Dir.pwd}/../../../../#{SRC_DIR}/#{relative_path}/#{name}.template.c",
+ cmd = ["#{$RELATIVE_PATH}/#{SRC_DIR}/#{relative_path}/#{name}.template.c",
"sed s/%%INT_ABBREV%%/#{int_dtype.id}/g",
"sed s/%%INT%%/#{int_dtype.sizeof}/g",
"sed s/%%INT_MAX%%/#{int_dtype.max_macro}/g",
@@ -447,7 +452,7 @@ def sub_int_real relative_path, name, output_name, int_dtype, real_dtype
def sub_int relative_path, name, output_name, dtype
- cmd = ["#{Dir.pwd}/../../../../#{SRC_DIR}/#{relative_path}/#{name}.template.c",
+ cmd = ["#{$RELATIVE_PATH}/#{SRC_DIR}/#{relative_path}/#{name}.template.c",
"sed s/%%INT_ABBREV%%/#{dtype.id}/g",
"sed s/%%INT%%/#{dtype.sizeof}/g",
"sed s/%%INT_MAX%%/#{dtype.max_macro}/g"]
@@ -574,16 +579,16 @@ def template template_filepath, output_filepath, types = {}
Generator.make_dtypes_h
Generator.make_dtypes_c
Generator.make_dfuncs_c
- Generator.make_templated_c './smmp', 'blas_header', %w{blas1}, 'smmp1.c', :TYPE => Generator::INDEX_DTYPES # 1-type interface functions for SMMP
- Generator.make_templated_c './smmp', nil, %w{blas2}, 'smmp1.c', :TYPE => Generator::ACTUAL_DTYPES, :INT => Generator::INDEX_DTYPES # 2-type interface functions for SMMP
- Generator.make_templated_c './smmp','smmp_header', %w{symbmm}, 'smmp2.c', :TYPE => Generator::INDEX_DTYPES # 1-type SMMP functions from Fortran
- Generator.make_templated_c './smmp', nil, %w{complexmath}, 'smmp2.c', :TYPE => Generator::COMPLEX_DTYPES
- Generator.make_templated_c './smmp', nil, %w{elementwise_op}, 'smmp2.c', :TYPE => Generator::ACTUAL_DTYPES
- Generator.make_templated_c './smmp', nil, %w{numbmm transp sort_columns elementwise}, 'smmp2.c', :TYPE => Generator::ACTUAL_DTYPES, :INT => Generator::INDEX_DTYPES # 2-type SMMP functions from Fortran and selection sort
- Generator.make_templated_c './blas', 'blas_header', %w{rationalmath}, 'blas.partial.c', :TYPE => Generator::RATIONAL_DTYPES
- Generator.make_templated_c './smmp', nil, %w{complexmath}, 'blas.partial.c', :TYPE => Generator::COMPLEX_DTYPES
- Generator.make_templated_c './blas', nil, %w{gemm gemv}, 'blas.partial.c', :TYPE => Generator::NONBLAS_DTYPES
- Generator.make_templated_c './blas', nil, %w{elementwise}, 'blas.partial.c', :TYPE=>Generator::ACTUAL_DTYPES
+ Generator.make_templated_c './yale', 'smmp1_header', %w{smmp1}, 'smmp1.c', :TYPE => Generator::INDEX_DTYPES # 1-type interface functions for SMMP
+ Generator.make_templated_c './yale', nil, %w{smmp2}, 'smmp1.c', :TYPE => Generator::ACTUAL_DTYPES, :INT => Generator::INDEX_DTYPES # 2-type interface functions for SMMP
+ Generator.make_templated_c './yale', 'smmp2_header', %w{symbmm}, 'smmp2.c', :TYPE => Generator::INDEX_DTYPES # 1-type SMMP functions from Fortran
+ Generator.make_templated_c './yale', nil, %w{complexmath}, 'smmp2.c', :TYPE => Generator::COMPLEX_DTYPES
+ Generator.make_templated_c './yale', nil, %w{elementwise_op}, 'smmp2.c', :TYPE => Generator::ACTUAL_DTYPES
+ Generator.make_templated_c './yale', nil, %w{numbmm transp sort_columns elementwise}, 'smmp2.c', :TYPE => Generator::ACTUAL_DTYPES, :INT => Generator::INDEX_DTYPES # 2-type SMMP functions from Fortran and selection sort
+ Generator.make_templated_c './dense', 'blas_header', %w{rationalmath}, 'blas.partial.c', :TYPE => Generator::RATIONAL_DTYPES
+ Generator.make_templated_c './yale', nil, %w{complexmath}, 'blas.partial.c', :TYPE => Generator::COMPLEX_DTYPES
+ Generator.make_templated_c './dense', nil, %w{gemm gemv}, 'blas.partial.c', :TYPE => Generator::NONBLAS_DTYPES
+ Generator.make_templated_c './dense', nil, %w{elementwise}, 'blas.partial.c', :TYPE=>Generator::ACTUAL_DTYPES
`cat blas.partial.c >> blas.c`
`rm blas.partial.c`
end
File renamed without changes.
File renamed without changes.
View
@@ -27,8 +27,12 @@
# Also provided is NVector, which represents a rank-1 NMatrix in
# vector operations.
-
-require File.join(File.dirname(__FILE__), "nmatrix/nmatrix.so")
+# For some reason nmatrix.so ends up in a different place during gem build
+if File.exist? "lib/nmatrix/nmatrix.so"
+ require File.join(File.dirname(__FILE__), "nmatrix/nmatrix.so") # development
+else
+ require File.join(File.dirname(__FILE__), "nmatrix.so") # gem
+end
require File.join(File.dirname(__FILE__), "array.rb") # Load Array extensions

0 comments on commit 53da083

Please sign in to comment.