stick 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +3 -4
- data/README +1 -1
- data/lib/stick/constants/cgs.rb +112 -110
- data/lib/stick/constants/mks.rb +6 -4
- data/lib/stick/constants/number.rb +3 -2
- data/lib/stick/constants/typeless_cgs.rb +105 -106
- data/lib/stick/constants/typeless_mks.rb +106 -107
- data/lib/stick/currency.rb +2 -0
- data/lib/stick/mapcar.rb +36 -23
- data/lib/stick/matrix.rb +10 -395
- data/lib/stick/matrix/core.rb +1408 -0
- data/lib/stick/matrix/exception.rb +23 -0
- data/lib/stick/matrix/givens.rb +59 -0
- data/lib/stick/matrix/hessenberg.rb +63 -0
- data/lib/stick/matrix/householder.rb +106 -0
- data/lib/stick/matrix/jacobi.rb +106 -0
- data/lib/stick/matrix/lu.rb +60 -0
- data/lib/stick/quaternion.rb +10 -6
- data/lib/stick/units.rb +2 -0
- data/lib/stick/units/base.rb +75 -72
- data/lib/stick/units/currency.rb +8 -8
- data/lib/stick/units/loaders.rb +3 -2
- data/lib/stick/units/units.rb +2 -0
- data/lib/stick/vector.rb +20 -0
- data/meta/MANIFEST +23 -3
- data/meta/stick.roll +1 -1
- data/task/tests/solo +293 -0
- data/test/spec_matrix.rb +3 -0
- data/test/test_constants.rb +4 -0
- data/test/test_currency.rb +2 -2
- data/test/test_matrix.rb +7 -1
- data/test/test_units.rb +2 -2
- metadata +15 -2
data/test/spec_matrix.rb
CHANGED
data/test/test_currency.rb
CHANGED
@@ -3,9 +3,9 @@ $:.unshift(File.dirname(__FILE__) + '../lib')
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'stick/currency'
|
5
5
|
|
6
|
-
class
|
6
|
+
class TestUnitsCurrency < Test::Unit::TestCase
|
7
7
|
|
8
|
-
include ::Units
|
8
|
+
include Stick::Units
|
9
9
|
|
10
10
|
def test_typerror
|
11
11
|
assert_raises(TypeError) do
|
data/test/test_matrix.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
-
#>ruby tests/
|
1
|
+
#>ruby tests/test_matrix.rb
|
2
2
|
|
3
3
|
require 'test/unit' unless defined? $ZENTEST and $ZENTEST
|
4
4
|
require 'stick/matrix'
|
5
5
|
|
6
6
|
class TestVector < Test::Unit::TestCase
|
7
|
+
|
8
|
+
include Stick
|
9
|
+
|
7
10
|
@@v = Vector.[](1, 2, 3, 4)
|
8
11
|
|
9
12
|
def test_setvalue
|
@@ -73,8 +76,11 @@ class TestVector < Test::Unit::TestCase
|
|
73
76
|
end
|
74
77
|
end
|
75
78
|
|
79
|
+
|
76
80
|
class TestMatrix < Test::Unit::TestCase
|
77
81
|
|
82
|
+
include Stick
|
83
|
+
|
78
84
|
def test_id
|
79
85
|
m = Matrix.new(4, 3){|i, j| i * 3 + j}
|
80
86
|
assert_equal 5, m[1, 2]
|
data/test/test_units.rb
CHANGED
@@ -5,12 +5,12 @@ require 'stick/units'
|
|
5
5
|
|
6
6
|
class TestUnits < Test::Unit::TestCase
|
7
7
|
|
8
|
+
include Stick::Units
|
9
|
+
|
8
10
|
def assert_in_unit_delta(v1, v2, d)
|
9
11
|
assert( v2 * (1 - d) <= v1 && v1 <= v2 * (1 + d), "<#{v1}> expected but was\n<#{v2}>" )
|
10
12
|
end
|
11
13
|
|
12
|
-
include ::Units
|
13
|
-
|
14
14
|
def test_bit_and_bytes
|
15
15
|
assert_equal( 65.bit/s, 1.bit/s + 8.bytes/s )
|
16
16
|
assert_equal( 0.125.byte/s, ((1.bit/s).to(byte/s)) )
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4.6
|
|
3
3
|
specification_version: 2
|
4
4
|
name: stick
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.3.
|
7
|
-
date: 2007-12-
|
6
|
+
version: 1.3.3
|
7
|
+
date: 2007-12-22 00:00:00 -05:00
|
8
8
|
summary: Stick is an comprehensive science library including a units system providing bot
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -43,6 +43,7 @@ files:
|
|
43
43
|
- test/test_matrix.rb
|
44
44
|
- test/unit
|
45
45
|
- test/spec_matrix.rb
|
46
|
+
- test/test_constants.rb
|
46
47
|
- task
|
47
48
|
- task/setup
|
48
49
|
- task/clobber
|
@@ -50,8 +51,18 @@ files:
|
|
50
51
|
- task/publish
|
51
52
|
- task/test
|
52
53
|
- task/release
|
54
|
+
- task/tests
|
55
|
+
- task/tests/solo
|
53
56
|
- lib
|
54
57
|
- lib/stick
|
58
|
+
- lib/stick/matrix
|
59
|
+
- lib/stick/matrix/hessenberg.rb
|
60
|
+
- lib/stick/matrix/jacobi.rb
|
61
|
+
- lib/stick/matrix/householder.rb
|
62
|
+
- lib/stick/matrix/givens.rb
|
63
|
+
- lib/stick/matrix/exception.rb
|
64
|
+
- lib/stick/matrix/lu.rb
|
65
|
+
- lib/stick/matrix/core.rb
|
55
66
|
- lib/stick/units.rb
|
56
67
|
- lib/stick/quaternion.rb
|
57
68
|
- lib/stick/constants.rb
|
@@ -98,6 +109,7 @@ files:
|
|
98
109
|
- lib/stick/units/base.rb
|
99
110
|
- lib/stick/matrix.rb
|
100
111
|
- lib/stick/mapcar.rb
|
112
|
+
- lib/stick/vector.rb
|
101
113
|
- CHANGES
|
102
114
|
- COPYING
|
103
115
|
- meta
|
@@ -113,6 +125,7 @@ test_files:
|
|
113
125
|
- test/test_matrix.rb
|
114
126
|
- test/unit
|
115
127
|
- test/spec_matrix.rb
|
128
|
+
- test/test_constants.rb
|
116
129
|
rdoc_options: []
|
117
130
|
|
118
131
|
extra_rdoc_files: []
|