multiarray 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -1
- data/TODO +7 -36
- data/lib/multiarray/bool.rb +14 -4
- data/lib/multiarray/complex.rb +467 -38
- data/lib/multiarray/composite.rb +44 -0
- data/lib/multiarray/diagonal.rb +10 -3
- data/lib/multiarray/element.rb +29 -3
- data/lib/multiarray/elementwise.rb +32 -3
- data/lib/multiarray/float.rb +120 -18
- data/lib/multiarray/gccfunction.rb +11 -21
- data/lib/multiarray/gcctype.rb +23 -17
- data/lib/multiarray/gccvalue.rb +25 -2
- data/lib/multiarray/histogram.rb +82 -0
- data/lib/multiarray/index.rb +23 -0
- data/lib/multiarray/inject.rb +13 -1
- data/lib/multiarray/int.rb +105 -9
- data/lib/multiarray/integral.rb +82 -0
- data/lib/multiarray/lambda.rb +58 -8
- data/lib/multiarray/list.rb +27 -1
- data/lib/multiarray/lookup.rb +60 -0
- data/lib/multiarray/lut.rb +102 -0
- data/lib/multiarray/malloc.rb +16 -0
- data/lib/multiarray/methods.rb +17 -0
- data/lib/multiarray/multiarray.rb +24 -2
- data/lib/multiarray/node.rb +115 -21
- data/lib/multiarray/object.rb +34 -4
- data/lib/multiarray/operations.rb +92 -100
- data/lib/multiarray/pointer.rb +74 -1
- data/lib/multiarray/rgb.rb +324 -2
- data/lib/multiarray/sequence.rb +69 -4
- data/lib/multiarray/shortcuts.rb +71 -0
- data/lib/multiarray/store.rb +72 -0
- data/lib/multiarray/variable.rb +25 -0
- data/lib/multiarray.rb +47 -5
- data/test/tc_int.rb +10 -0
- data/test/tc_multiarray.rb +47 -1
- data/test/tc_object.rb +10 -0
- data/test/tc_sequence.rb +237 -8
- metadata +9 -9
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'rake/packagetask'
|
|
6
6
|
require 'rbconfig'
|
7
7
|
|
8
8
|
PKG_NAME = 'multiarray'
|
9
|
-
PKG_VERSION = '0.
|
9
|
+
PKG_VERSION = '0.6.0'
|
10
10
|
RB_FILES = FileList[ 'lib/**/*.rb' ]
|
11
11
|
TC_FILES = FileList[ 'test/tc_*.rb' ]
|
12
12
|
TS_FILES = FileList[ 'test/ts_*.rb' ]
|
@@ -52,6 +52,7 @@ Rake::TestTask.new do |t|
|
|
52
52
|
end
|
53
53
|
|
54
54
|
begin
|
55
|
+
# For development just run it with "yard server --reload".
|
55
56
|
require 'yard'
|
56
57
|
YARD::Rake::YardocTask.new :yard do |y|
|
57
58
|
y.options << '--no-private'
|
data/TODO
CHANGED
@@ -1,46 +1,17 @@
|
|
1
|
-
#
|
1
|
+
# weighted histograms
|
2
|
+
# lut/warp, histogram: clipping, masks?
|
3
|
+
# lut, histogram with x and y coming from different tables?
|
2
4
|
# pointer-increments for better efficiency, optimize Node#diagonal
|
3
|
-
|
4
|
-
# histogram (implement using injection)
|
5
5
|
# random numbers
|
6
|
-
# Geometric Hashing? Bounded Hough Transform!!! RANSAC?
|
7
|
-
# each, multi_each, collect, multi_collect, zip?
|
8
|
-
# inject: n-d masks for warp
|
9
|
-
# block(var1,var2,...) with smart subst?
|
6
|
+
# Geometric Hashing? Bounded Hough Transform!!! RANSAC?
|
7
|
+
# each, each_with_index, multi_each, collect, multi_collect, zip?
|
10
8
|
|
11
9
|
# downsampling after correlation?
|
12
|
-
# YARD documentation with pictures, demo video
|
10
|
+
# YARD documentation with pictures, demo video, @group ..., @endgroup
|
13
11
|
# CK_Thesis.pdf: tensor voting
|
14
|
-
|
15
|
-
# f(g(i)) # g(i), f(g(i)) all can be vectors and all can be lazy
|
16
|
-
# lut(g(i))
|
17
|
-
# f(warp(i))
|
18
|
-
#class Node
|
19
|
-
# def map( lut, options = {} )
|
20
|
-
#
|
21
|
-
# end
|
22
|
-
#end
|
23
|
-
|
24
|
-
# cache <-> demand/get? what about store?
|
25
|
-
# allow creation of library for pre-loading cache
|
26
|
-
|
27
|
-
# use inject for n-d clips for warp
|
28
|
-
# block(var1,var2,...) with smart subst?
|
12
|
+
# maxint -> native_int
|
29
13
|
|
30
14
|
# downsampling after correlation?
|
31
|
-
# ruby -Ilib -rrubygems -rmultiarray -rtest test/tc_sequence.rb
|
32
|
-
# README.rdoc, demo video
|
33
|
-
|
34
|
-
# f(g(i)) # g(i), f(g(i)) all can be vectors and all can be lazy
|
35
|
-
# lut(g(i))
|
36
|
-
# f(warp(i))
|
37
|
-
#class Node
|
38
|
-
# def map( lut, options = {} ) # !!!
|
39
|
-
#
|
40
|
-
# end
|
41
|
-
#end
|
42
|
-
|
43
|
-
test type conversions
|
44
15
|
|
45
16
|
a = lazy( 16, 32 ) { |i,j| Sequence[ i, j ] } # ???
|
46
17
|
a = lazy( 8, 8 ) { |i,j| Sequence[ i, a[j] * sin( i + b[j] ) ] }.hist 8, 8
|
data/lib/multiarray/bool.rb
CHANGED
@@ -17,13 +17,14 @@
|
|
17
17
|
# Namespace of Hornetseye computer vision library
|
18
18
|
module Hornetseye
|
19
19
|
|
20
|
+
# Class for representing native booleans
|
20
21
|
class BOOL < Element
|
21
22
|
|
22
23
|
class << self
|
23
24
|
|
24
25
|
# Get string with information about this class
|
25
26
|
#
|
26
|
-
# @return [String] Returns
|
27
|
+
# @return [String] Returns 'BOOL'
|
27
28
|
def inspect
|
28
29
|
'BOOL'
|
29
30
|
end
|
@@ -45,7 +46,7 @@ module Hornetseye
|
|
45
46
|
#
|
46
47
|
# @see Malloc#load
|
47
48
|
#
|
48
|
-
|
49
|
+
# @return [BOOL] Result of fetch operation.
|
49
50
|
#
|
50
51
|
# @private
|
51
52
|
def fetch( ptr )
|
@@ -81,7 +82,7 @@ module Hornetseye
|
|
81
82
|
|
82
83
|
# Directive for packing/unpacking elements of this type
|
83
84
|
#
|
84
|
-
# @return [String] Returns
|
85
|
+
# @return [String] Returns 'c'.
|
85
86
|
#
|
86
87
|
# @private
|
87
88
|
def directive
|
@@ -114,7 +115,7 @@ module Hornetseye
|
|
114
115
|
# Method for matching elements of type BOOL
|
115
116
|
#
|
116
117
|
# @param [Array<Object>] *values Values to find matching native element
|
117
|
-
#
|
118
|
+
# type for.
|
118
119
|
#
|
119
120
|
# @return [Class] Native type fitting all values.
|
120
121
|
#
|
@@ -135,6 +136,15 @@ module Hornetseye
|
|
135
136
|
|
136
137
|
end
|
137
138
|
|
139
|
+
# Shortcut for constructor
|
140
|
+
#
|
141
|
+
# The method calls +BOOL.new+.
|
142
|
+
#
|
143
|
+
# @param [Boolean] value Boolean value.
|
144
|
+
#
|
145
|
+
# @return [BOOL] The wrapped boolean value.
|
146
|
+
#
|
147
|
+
# @private
|
138
148
|
def BOOL( value )
|
139
149
|
BOOL.new value
|
140
150
|
end
|