Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 243119 Details for
Bug 332915
dev-ruby/narray fails tests with ruby 1.9 (ruby BUG)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Build log
narray-0.5.9_p7:20100815-204121.log (text/plain), 46.04 KB, created by
Diego Elio Pettenò (RETIRED)
on 2010-08-15 22:21:03 UTC
(
hide
)
Description:
Build log
Filename:
MIME Type:
Creator:
Diego Elio Pettenò (RETIRED)
Created:
2010-08-15 22:21:03 UTC
Size:
46.04 KB
patch
obsolete
> * CPV: dev-ruby/narray-0.5.9_p7 > * REPO: gentoo > * USE: elibc_glibc kernel_linux ruby_targets_ruby18 ruby_targets_ruby19 test userland_GNU x86 >>>> Unpacking source... > * Running unpack phase for all ... >>>> Unpacking narray-0.5.9p7.tar.gz to /var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/all >>>> Source unpacked in /var/tmp/portage/dev-ruby/narray-0.5.9_p7/work >>>> Preparing source in /var/tmp/portage/dev-ruby/narray-0.5.9_p7/work ... > * Running prepare phase for all ... > * Running source copy phase for ruby18 ... > * Running source copy phase for ruby19 ... >>>> Source prepared. >>>> Configuring source in /var/tmp/portage/dev-ruby/narray-0.5.9_p7/work ... > * Running configure phase for ruby18 ... >checking for stdint.h... yes >checking for u_int8_t... yes >checking for uint8_t... yes >checking for int16_t... yes >checking for int32_t... yes >checking for u_int32_t... yes >checking for uint32_t... yes >creating narray_config.h >creating Makefile > * Running configure phase for ruby19 ... >checking for stdint.h... yes >checking for u_int8_t... yes >checking for uint8_t... yes >checking for int16_t... yes >checking for int32_t... yes >checking for u_int32_t... yes >checking for uint32_t... yes >creating narray_config.h >creating Makefile >>>> Source configured. >>>> Compiling source in /var/tmp/portage/dev-ruby/narray-0.5.9_p7/work ... > * Running compile phase for ruby18 ... >make -j14 'CFLAGS=-O2 -pipe -fPIC' 'archflag=-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu' >i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -c narray.c >i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -c na_array.c >i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -c na_func.c >i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -c na_index.c >i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -c na_random.c >/usr/bin/ruby18 -I. ./mkop.rb >/usr/bin/ruby18 -I. ./mkmath.rb >i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -c na_linalg.c >i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -c na_math.c >i686-pc-linux-gnu-gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -c na_op.c >i686-pc-linux-gnu-gcc -shared -o narray.so narray.o na_array.o na_func.o na_index.o na_random.o na_op.o na_math.o na_linalg.o -L. -L/usr/lib -Wl,-R/usr/lib -L. -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -rdynamic -Wl,-export-dynamic -Wl,--no-undefined -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,-R -Wl,/usr/lib -L/usr/lib -lruby18 -lrt -ldl -lcrypt -lm -lc > * Running compile phase for ruby19 ... >make -j14 'CFLAGS=-O2 -pipe -fPIC' 'archflag=-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu' >i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -o narray.o -c narray.c >i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -o na_array.o -c na_array.c >i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -o na_func.o -c na_func.c >i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -o na_index.o -c na_index.c >i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -o na_random.o -c na_random.c >/usr/bin/ruby19 -I. ./mkop.rb >/usr/bin/ruby19 -I. ./mkmath.rb >i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -o na_linalg.o -c na_linalg.c >i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -o na_math.o -c na_math.c >i686-pc-linux-gnu-gcc -I. -I/usr/include/ruby-1.9.1/i686-linux -I/usr/include/ruby-1.9.1/ruby/backward -I/usr/include/ruby-1.9.1 -I. -DHAVE_STDINT_H -DHAVE_U_INT8_T -DHAVE_UINT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -DHAVE_UINT32_T -D_FILE_OFFSET_BITS=64 -O2 -pipe -fPIC -o na_op.o -c na_op.c >i686-pc-linux-gnu-gcc -shared -o narray.so narray.o na_array.o na_func.o na_index.o na_random.o na_op.o na_math.o na_linalg.o -L. -L/usr/lib -Wl,-R/usr/lib -L. -Wl,-O1 -rdynamic -Wl,-export-dynamic -Wl,--no-undefined -Wl,-R -Wl,/usr/lib -L/usr/lib -lruby19 -lpthread -lrt -ldl -lcrypt -lm -lc > * Running compile phase for all ... >>>> Source compiled. > * Running test phase for ruby18 ... >x #=> NArray.int(12): >[ 65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71 ] >y #=> NArray.int(12): >[ 68, 66, 68, 65, 69, 66, 68, 65, 71, 67, 68, 70 ] >covariance(x,y) #=> 3.66666666666667 >x.stddev #=> 2.77434130866584 >x.sort #=> NArray.int(12): >[ 62, 63, 64, 65, 66, 67, 67, 68, 68, 69, 70, 71 ] >x.median #=> 67 >(x+y.newrank!(0)).median(0) #=> NArray.int(12): >[ 135, 133, 135, 132, 136, 133, 135, 132, 138, 134, 135, 137 ] >NArray.float(3,3,2): >[ [ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ], > [ [ 100.0, 0.0, 0.0 ], > [ 101.0, 0.0, 0.0 ], > [ 0.0, 0.0, 0.0 ] ] ] >NArray.float(3,3,2): >[ [ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ], > [ [ 100.0, 0.0, 0.0 ], > [ 101.0, 0.0, 0.0 ], > [ 0.0, 0.0, 0.0 ] ] ] >NArray.float(2,2,2,2): >[ [ [ [ 0.0, 0.0 ], > [ 1.0, 0.0 ] ], > [ [ 2.0, 0.0 ], > [ 3.0, 0.0 ] ] ], > [ [ [ 0.0, 1.0 ], > [ 2.0, 3.0 ] ], > [ [ 0.0, 0.0 ], > [ 0.0, 0.0 ] ] ] ] >NArray.float(2,2,2): >[ [ [ 0.0, 0.0 ], > [ 1.0, 0.0 ] ], > [ [ 0.0, 1.0 ], > [ 0.0, 0.0 ] ] ] >a #=> >NArray.byte(10): >[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] >a & 1 #=> >NArray.byte(10): >[ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 ] >a & 2 #=> >NArray.byte(10): >[ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0 ] >a & -1 #=> >NArray.byte(10): >[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] >a | 1 #=> >NArray.byte(10): >[ 1, 1, 3, 3, 5, 5, 7, 7, 9, 9 ] >a | 2 #=> >NArray.byte(10): >[ 2, 3, 2, 3, 6, 7, 6, 7, 10, 11 ] >a | -1 #=> >NArray.byte(10): >[ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ] >a ^ 1 #=> >NArray.byte(10): >[ 1, 0, 3, 2, 5, 4, 7, 6, 9, 8 ] >a ^ 2 #=> >NArray.byte(10): >[ 2, 3, 0, 1, 6, 7, 4, 5, 10, 11 ] >a ^ -1 #=> >NArray.byte(10): >[ 255, 254, 253, 252, 251, 250, 249, 248, 247, 246 ] >~a #=> >NArray.byte(10): >[ 255, 254, 253, 252, 251, 250, 249, 248, 247, 246 ] >a #=> >NArray.int(10): >[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] >~a #=> >NArray.int(10): >[ -1, -2, -3, -4, -5, -6, -7, -8, -9, -10 ] >a #=> NArray.int(3,3): >[ [ 0, 1, 2 ], > [ 3, 4, 5 ], > [ 6, 7, 8 ] ] >a+1.5 #=> NArray.int(3,3): >[ [ 1, 2, 3 ], > [ 4, 5, 6 ], > [ 7, 8, 9 ] ] >1.5+a #=> NArray.int(3,3): >[ [ 1, 2, 3 ], > [ 4, 5, 6 ], > [ 7, 8, 9 ] ] >a+NArray[1.2,3.4,5.6] #=> NArray.float(3,3): >[ [ 1.2, 4.4, 7.6 ], > [ 4.2, 7.4, 10.6 ], > [ 7.2, 10.4, 13.6 ] ] >a+NArray[Complex(0.5,1.5)] #=> NArray.complex(3,3): >[ [ 0.5+1.5i, 1.5+1.5i, 2.5+1.5i ], > [ 3.5+1.5i, 4.5+1.5i, 5.5+1.5i ], > [ 6.5+1.5i, 7.5+1.5i, 8.5+1.5i ] ] >a = NArray.complex(4,1): >[ [ 1.0+0.25i, 2.0+0.25i, 3.0+0.25i, 4.0+0.25i ] ] >b = NArray.complex(1,3): >[ [ -0.0-0.25i ], > [ 0.0+0.25i ], > [ 0.0+0.75i ] ] >a+b = NArray.complex(4,3): >[ [ 1.0+0.0i, 2.0+0.0i, 3.0+0.0i, 4.0+0.0i ], > [ 1.0+0.5i, 2.0+0.5i, 3.0+0.5i, 4.0+0.5i ], > [ 1.0+1.0i, 2.0+1.0i, 3.0+1.0i, 4.0+1.0i ] ] >a-b = NArray.complex(4,3): >[ [ 1.0+0.5i, 2.0+0.5i, 3.0+0.5i, 4.0+0.5i ], > [ 1.0+0.0i, 2.0+0.0i, 3.0+0.0i, 4.0+0.0i ], > [ 1.0-0.5i, 2.0-0.5i, 3.0-0.5i, 4.0-0.5i ] ] >a*b = NArray.complex(4,3): >[ [ 0.0625-0.25i, 0.0625-0.5i, 0.0625-0.75i, 0.0625-1.0i ], > [ -0.0625+0.25i, -0.0625+0.5i, -0.0625+0.75i, -0.0625+1.0i ], > [ -0.1875+0.75i, -0.1875+1.5i, -0.1875+2.25i, -0.1875+3.0i ] ] >a/b = NArray.complex(4,3): >[ [ -1.0+4.0i, -1.0+8.0i, -1.0+12.0i, -1.0+16.0i ], > [ 1.0-4.0i, 1.0-8.0i, 1.0-12.0i, 1.0-16.0i ], > [ 0.333333-1.33333i, 0.333333-2.66667i, 0.333333-4.0i, ... ] ] >a**b = NArray.complex(4,3): >[ [ 1.06313-0.00805662i, 1.01578-0.179834i, 0.982495-0.277759i, ... ], > [ 0.940566+0.00712782i, 0.954546+0.168993i, 0.942489+0.266449i, ... ], > [ 0.831942+0.0189168i, 0.78796+0.457112i, 0.636464+0.691133i, ... ] ] >a.real = NArray.float(4,1): >[ [ 1.0, 2.0, 3.0, 4.0 ] ] >a.imag = NArray.float(4,1): >[ [ 0.25, 0.25, 0.25, 0.25 ] ] >a.angle = NArray.float(4,1): >[ [ 0.244979, 0.124355, 0.0831412, 0.0624188 ] ] >a.conj = NArray.complex(4,1): >[ [ 1.0-0.25i, 2.0-0.25i, 3.0-0.25i, 4.0-0.25i ] ] >a #=> NArray.float(5,5): >[ [ 0.0, 1.0, 2.0, 3.0, 4.0 ], > [ 5.0, 6.0, 7.0, 8.0, 9.0 ], > [ 10.0, 11.0, 12.0, 13.0, 14.0 ], > [ 15.0, 16.0, 17.0, 18.0, 19.0 ], > [ 20.0, 21.0, 22.0, 23.0, 24.0 ] ] > >idx #=> [2, 0, 1] > >a[idx,idx] # Index Array > #=> NArray.float(3,3): >[ [ 12.0, 10.0, 11.0 ], > [ 2.0, 0.0, 1.0 ], > [ 7.0, 5.0, 6.0 ] ] > >idx #=> NArray.int(3): >[ 12, 10, 11 ] > >a[idx] #=> NArray.float(3): >[ 12.0, 10.0, 11.0 ] > >a[1,[]] # Empty Array > #=> NArray.float(): [] >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] >a[1, -1] #=> 7.0 >a[1, 2..0] #=> NArray.float(3): >[ 7.0, 4.0, 1.0 ] >a[1...2, 0..1] #=> NArray.float(1,2): >[ [ 1.0 ], > [ 4.0 ] ] >a[true, 0..1] #=> NArray.float(3,2): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ] ] >a[0..5] #=> NArray.float(6): >[ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[[]] = [] # Do nothing >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[1,1] = 0 # 1-element replace >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 0.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[0..-1, 1] = 0 # Range replace >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 0.0, 0.0, 0.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[1,2..0] = [100,101,102] # Array replace >a #=> NArray.float(3,3): >[ [ 0.0, 102.0, 2.0 ], > [ 3.0, 101.0, 5.0 ], > [ 6.0, 100.0, 8.0 ] ] > >a[0,1] = [100,101,102] # Specifing Starting point >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 100.0, 101.0, 102.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[1,0] = [[100],[101],[102]] # Specifing Starting point >a #=> NArray.float(3,3): >[ [ 0.0, 100.0, 2.0 ], > [ 3.0, 101.0, 5.0 ], > [ 6.0, 102.0, 8.0 ] ] > >a[true,1] = [100,101,102] # `true' means entire range >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 100.0, 101.0, 102.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[true,true] = [[100,101,102]] >a #=> NArray.float(3,3): >[ [ 100.0, 101.0, 102.0 ], > [ 100.0, 101.0, 102.0 ], > [ 100.0, 101.0, 102.0 ] ] >NArray >3 >7 >NArray -- Exception raised as expected. The message was: cannot count_true NArray except BYTE type > >--- test masking (float) --- >NArray.byte(5,3): >[ [ 0, 0, 0, 0, 0 ], > [ 1, 1, 1, 1, 1 ], > [ 1, 1, 1, 1, 1 ] ] >1 >NArray.float(5,3): >[ [ 0.0, 1.0, 2.0, 3.0, 4.0 ], > [ 5.0, 6.0, 7.0, 8.0, 9.0 ], > [ 10.0, 11.0, 12.0, 13.0, 14.0 ] ] >NArray.float(5,3): >[ [ -4.0, -2.0, 0.0, 2.0, 4.0 ], > [ 6.0, 8.0, 10.0, 12.0, 14.0 ], > [ 16.0, 18.0, 20.0, 22.0, 24.0 ] ] >NArray.float(10): >[ 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0 ] >NArray.float(10): >[ 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0 ] >NArray.float(5,3): >[ [ 0.0, 1.0, 2.0, 3.0, 4.0 ], > [ 10000.0, 10000.0, 10000.0, 10000.0, 10000.0 ], > [ 10000.0, 10000.0, 10000.0, 10000.0, 10000.0 ] ] > >--- test masking (complex) --- >NArray.complex(5): >[ 0.0+1.0i, 1.0+1.0i, 2.0+1.0i, 3.0+1.0i, 4.0+1.0i ] >NArray.complex(2): >[ 2.0+1.0i, 3.0+1.0i ] >NArray.complex(5): >[ 0.0+1.0i, 1.0+1.0i, 100.0+0.0i, 100.0+0.0i, 4.0+1.0i ] >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] > >### asin(sin(x)) ### >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] > >### acos(cos(x)) ### >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] > >### atan(tan(x)) ### >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] > >### asinh(sinh(x)) ### >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] > >### acosh(cosh(x)) ### >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] > >### atanh(tanh(x)) ### >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] > >### asec(sec(x)) ### >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] > >### asech(sech(x)) ### >NArray.complex(7): >[ 0.686801+0.290048i, 0.48903+0.342168i, 0.666804+0.206221i, ... ] >0.642092615934331 >x = 0.000 0.500 1.000 1.500 2.000 2.500 >sqrt(x) = 0.000 0.707 1.000 1.225 1.414 1.581 >sin(x) = 0.000 0.479 0.841 0.997 0.909 0.598 >cos(x) = 1.000 0.878 0.540 0.071 -0.416 -0.801 >tan(x) = 0.000 0.546 1.557 14.101 -2.185 -0.747 >sinh(x) = 0.000 0.521 1.175 2.129 3.627 6.050 >cosh(x) = 1.000 1.128 1.543 2.352 3.762 6.132 >tanh(x) = 0.000 0.462 0.762 0.905 0.964 0.987 >exp(x) = 1.000 1.649 2.718 4.482 7.389 12.182 >log(x) = -inf -0.693 0.000 0.405 0.693 0.916 >log10(x) = -inf -0.301 0.000 0.176 0.301 0.398 >atan(x) = 0.000 0.464 0.785 0.983 1.107 1.190 >atan(tan(x)) = 0.000 0.500 1.000 1.500 -1.142 -0.642 >x = 0.000 0.500 1.000 1.500 2.000 2.500 >sqrt(x) = 0.000 0.707 1.000 1.225 1.414 1.581 >sin(x) = 0.000 0.479 0.841 0.997 0.909 0.598 >cos(x) = 1.000 0.878 0.540 0.071 -0.416 -0.801 >tan(x) = 0.000 0.546 1.557 14.101 -2.185 -0.747 >sinh(x) = 0.000 0.521 1.175 2.129 3.627 6.050 >cosh(x) = 1.000 1.128 1.543 2.352 3.762 6.132 >tanh(x) = 0.000 0.462 0.762 0.905 0.964 0.987 >exp(x) = 1.000 1.649 2.718 4.482 7.389 12.182 >log(x) = -inf -0.693 0.000 0.405 0.693 0.916 >log10(x) = -inf -0.301 0.000 0.176 0.301 0.398 >atan(x) = 0.000 0.464 0.785 0.983 1.107 1.190 >atan(tan(x)) = 0.000 0.500 1.000 1.500 -1.142 -0.642 >x = -2.000-1.000i -1.500-1.000i -1.000-1.000i -0.500-1.000i 0.000-1.000i 0.500-1.000i >sqrt(x) = 0.344-1.455i 0.389-1.285i 0.455-1.099i 0.556-0.899i 0.707-0.707i 0.899-0.556i >sin(x) = -1.403+0.489i -1.539-0.083i -1.298-0.635i -0.740-1.031i 0.000-1.175i 0.740-1.031i >cos(x) = -0.642-1.069i 0.109-1.172i 0.834-0.989i 1.354-0.563i 1.543+0.000i 1.354+0.563i >tan(x) = 0.243-1.167i -0.051-1.308i -0.272-1.084i -0.196-0.843i 0.000-0.762i 0.196-0.843i >sinh(x) = -1.960-3.166i -1.150-1.979i -0.635-1.298i -0.282-0.949i 0.000-0.841i 0.282-0.949i >cosh(x) = 2.033+3.052i 1.271+1.792i 0.834+0.989i 0.609+0.438i 0.540+0.000i 0.609-0.438i >tanh(x) = -1.015-0.034i -1.038-0.094i -1.084-0.272i -1.043-0.807i 0.000-1.557i 1.043-0.807i >exp(x) = 0.073-0.114i 0.121-0.188i 0.199-0.310i 0.328-0.510i 0.540-0.841i 0.891-1.387i >log(x) = 0.805-2.678i 0.589-2.554i 0.347-2.356i 0.112-2.034i 0.000-1.571i 0.112-1.107i >log10(x) = 0.349-1.163i 0.256-1.109i 0.151-1.023i 0.048-0.884i 0.000-0.682i 0.048-0.481i >atan(x) = -1.178-0.173i -1.107-0.255i -1.017-0.402i -0.908-0.708i 0.000-infi 0.908-0.708i >atan(tan(x)) = 1.142-1.000i -1.500-1.000i -1.000-1.000i -0.500-1.000i 0.000-1.000i 0.500-1.000i >x = -0.500+0.000i -0.300+0.000i -0.100+0.000i 0.100+0.000i 0.300+0.000i 0.500+0.000i >sqrt(x) = 0.000+0.707i 0.000+0.548i 0.000+0.316i 0.316+0.000i 0.548+0.000i 0.707+0.000i >sin(x) = -0.479+0.000i -0.296+0.000i -0.100+0.000i 0.100+0.000i 0.296+0.000i 0.479+0.000i >cos(x) = 0.878+0.000i 0.955+0.000i 0.995+0.000i 0.995+0.000i 0.955+0.000i 0.878+0.000i >tan(x) = -0.546+0.000i -0.309+0.000i -0.100+0.000i 0.100+0.000i 0.309+0.000i 0.546+0.000i >sinh(x) = -0.521+0.000i -0.305+0.000i -0.100+0.000i 0.100+0.000i 0.305+0.000i 0.521+0.000i >cosh(x) = 1.128+0.000i 1.045+0.000i 1.005+0.000i 1.005+0.000i 1.045+0.000i 1.128+0.000i >tanh(x) = -0.462+0.000i -0.291+0.000i -0.100+0.000i 0.100+0.000i 0.291+0.000i 0.462+0.000i >exp(x) = 0.607+0.000i 0.741+0.000i 0.905+0.000i 1.105+0.000i 1.350+0.000i 1.649+0.000i >log(x) = -0.693+3.142i -1.204+3.142i -2.303+3.142i -2.303+0.000i -1.204+0.000i -0.693+0.000i >log10(x) = -0.301+1.364i -0.523+1.364i -1.000+1.364i -1.000+0.000i -0.523+0.000i -0.301+0.000i >atan(x) = -0.464+0.000i -0.291+0.000i -0.100+0.000i 0.100+0.000i 0.291+0.000i 0.464+0.000i >atan(tan(x)) = -0.500+0.000i -0.300+0.000i -0.100+0.000i 0.100+0.000i 0.300+0.000i 0.500+0.000i >$m1 #=> >NMatrix.float(2,2): >[ [ 0.0, 1.0 ], > [ 2.0, 3.0 ] ] > >$m1.inverse #=> >NMatrix.float(2,2): >[ [ -1.5, 0.5 ], > [ 1.0, 0.0 ] ] > >$m2 #=> >NMatrix.float(2,2): >[ [ 0.0, 1.2 ], > [ 1.5, 0.0 ] ] > >$m1*$m2 #=> >NMatrix.float(2,2): >[ [ 1.5, 0.0 ], > [ 4.5, 2.4 ] ] > >$m2*$m1 #=> >NMatrix.float(2,2): >[ [ 2.4, 3.6 ], > [ 0.0, 1.5 ] ] > >$m1+$m2 #=> >NMatrix.float(2,2): >[ [ 0.0, 2.2 ], > [ 3.5, 3.0 ] ] > >3.14*$m1 #=> >NMatrix.float(2,2): >[ [ 0.0, 3.14 ], > [ 6.28, 9.42 ] ] > >$m2*1.25 #=> >NMatrix.float(2,2): >[ [ 0.0, 1.5 ], > [ 1.875, 0.0 ] ] > >$v1 #=> >NVector.float(2): >[ 0.5, 1.5 ] > >$v2 #=> >NVector.float(2,2): >[ [ 0.0, 1.0 ], > [ 2.0, 3.0 ] ] > >1.25*$v1 #=> >NVector.float(2): >[ 0.625, 1.875 ] > >NMath.sqrt($v2**2) #=> >NArray.float(2): >[ 1.0, 3.60555 ] > >$v1*$v2 #=> >NArray.float(2): >[ 1.5, 5.5 ] > >$m1*$v1 #=> >NVector.float(2): >[ 1.5, 5.5 ] > >$v2*$m2 #=> >NVector.float(2,2): >[ [ 1.5, 0.0 ], > [ 4.5, 2.4 ] ] > >$m1.diagonal([98,99]) #=> >NMatrix.float(2,2): >[ [ 98.0, 1.0 ], > [ 2.0, 99.0 ] ] > >NMatrix.float(4,3).unit #=> >NMatrix.float(4,3): >[ [ 1.0, 0.0, 0.0, 0.0 ], > [ 0.0, 1.0, 0.0, 0.0 ], > [ 0.0, 0.0, 1.0, 0.0 ] ] > >m #=> >NMatrix.object(5,5): >[ [ Rational(5, 1), Rational(8, 1), Rational(9, 1), Rational(5, 1), ... ], > [ Rational(0, 1), Rational(1, 1), Rational(7, 1), Rational(6, 1), ... ], > [ Rational(2, 1), Rational(4, 1), Rational(5, 1), Rational(2, 1), ... ], > [ Rational(2, 1), Rational(4, 1), Rational(7, 1), Rational(7, 1), ... ], > [ Rational(1, 1), Rational(7, 1), Rational(0, 1), Rational(6, 1), ... ] ] >m/m #=> >NMatrix.object(5,5): >[ [ Rational(1, 1), Rational(0, 1), Rational(0, 1), Rational(0, 1), ... ], > [ Rational(0, 1), Rational(1, 1), Rational(0, 1), Rational(0, 1), ... ], > [ Rational(0, 1), Rational(0, 1), Rational(1, 1), Rational(0, 1), ... ], > [ Rational(0, 1), Rational(0, 1), Rational(0, 1), Rational(1, 1), ... ], > [ Rational(0, 1), Rational(0, 1), Rational(0, 1), Rational(0, 1), ... ] ] > >m #=> >NMatrix.float(3,3,3): >[ [ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ], > [ [ 9.0, 10.0, 11.0 ], > [ 12.0, 13.0, 14.0 ], > [ 15.0, 16.0, 17.0 ] ], > [ [ 18.0, 19.0, 20.0 ], > [ 21.0, 22.0, 23.0 ], > [ 24.0, 25.0, 26.0 ] ] ] > >m[1,1,true] #=> >NArray.float(3): >[ 4.0, 13.0, 22.0 ] > >m[0..1,2,true] #=> >NMatrix.float(2,1,3): >[ [ [ 6.0, 7.0 ] ], > [ [ 15.0, 16.0 ] ], > [ [ 24.0, 25.0 ] ] ] >a = NArray.float(5): >[ 0.0, 2.0, -2.5, 3.0, 1.4 ] >a.min = -2.5 >a.max = 3.0 >a.sum = 3.9 >a.mean = 0.78 >a.stddev = 2.13119684684451 >a = NArray.float(5,3): >[ [ 1.0, 2.0, 3.0, 4.0, 5.0 ], > [ 2.0, 4.0, 6.0, 8.0, 10.0 ], > [ 3.0, 6.0, 9.0, 12.0, 15.0 ] ] >a.min = 1.0 >a.max = 15.0 >a.sum = 90.0 >a.mean = 6.0 >a.stddev = 4.05321741688889 >a.min(0) = NArray.float(3): >[ 1.0, 2.0, 3.0 ] >a.max(0) = NArray.float(3): >[ 5.0, 10.0, 15.0 ] >a.min(1) = NArray.float(5): >[ 1.0, 2.0, 3.0, 4.0, 5.0 ] >a.max(1) = NArray.float(5): >[ 3.0, 6.0, 9.0, 12.0, 15.0 ] >a.sum(0) = NArray.float(3): >[ 15.0, 30.0, 45.0 ] >a.sum(1) = NArray.float(5): >[ 6.0, 12.0, 18.0, 24.0, 30.0 ] >a.mean(0) = NArray.float(3): >[ 3.0, 6.0, 9.0 ] >a.mean(1) = NArray.float(5): >[ 2.0, 4.0, 6.0, 8.0, 10.0 ] >a.stddev(0) = NArray.float(3): >[ 1.58114, 3.16228, 4.74342 ] >a.stddev(1) = NArray.float(5): >[ 1.0, 2.0, 3.0, 4.0, 5.0 ] >a #=> NArray.object(4,4): >[ [ Rational(1, 1), Rational(1, 1), Rational(1, 1), Rational(1, 1) ], > [ Rational(1, 1), Rational(1, 1), Rational(1, 1), Rational(1, 1) ], > [ Rational(1, 1), Rational(1, 1), Rational(1, 1), Rational(1, 1) ], > [ Rational(1, 1), Rational(1, 1), Rational(1, 1), Rational(1, 1) ] ] >b #=> NArray.object(4,4): >[ [ Rational(1, 1), Rational(2, 1), Rational(3, 1), Rational(4, 1) ], > [ Rational(5, 1), Rational(6, 1), Rational(7, 1), Rational(8, 1) ], > [ Rational(9, 1), Rational(10, 1), Rational(11, 1), Rational(12, 1) ], > [ Rational(13, 1), Rational(14, 1), Rational(15, 1), Rational(16, 1) ] ] >a+b #=> NArray.object(4,4): >[ [ 2, 3, 4, 5 ], > [ 6, 7, 8, 9 ], > [ 10, 11, 12, 13 ], > [ 14, 15, 16, 17 ] ] >a/b #=> NArray.object(4,4): >[ [ 1, 1/2, 1/3, 1/4 ], > [ 1/5, 1/6, 1/7, 1/8 ], > [ 1/9, 1/10, 1/11, 1/12 ], > [ 1/13, 1/14, 1/15, 1/16 ] ] >a/b - b #=> NArray.object(4,4): >[ [ 0, -3/2, -8/3, -15/4 ], > [ -24/5, -35/6, -48/7, -63/8 ], > [ -80/9, -99/10, -120/11, -143/12 ], > [ -168/13, -195/14, -224/15, -255/16 ] ] >a = >NArray.int(4): >[ -2, 0, 2, 4 ] >a**[[-3],[0],[7]] = >NArray.int(4,3): >[ [ 0, 0, 0, 0 ], > [ 1, 1, 1, 1 ], > [ -128, 0, 128, 16384 ] ] >a**[[-3.0],[0],[7.0]] = >NArray.float(4,3): >[ [ -0.125, inf, 0.125, 0.015625 ], > [ 1.0, 1.0, 1.0, 1.0 ], > [ -128.0, 0.0, 128.0, 16384.0 ] ] >a**(1+0.im) = >NArray.complex(4): >[ -2.0+2.44921e-16i, 0.0+0.0i, 2.0+0.0i, 4.0+0.0i ] >a**1.0 = >NArray.float(4): >[ -2.0, 0.0, 2.0, 4.0 ] > >a = >NArray.float(4): >[ -2.0, 0.0, 2.0, 4.0 ] >a**[[-3],[0],[7]] = >NArray.float(4,3): >[ [ -0.125, inf, 0.125, 0.015625 ], > [ 1.0, 1.0, 1.0, 1.0 ], > [ -128.0, 0.0, 128.0, 16384.0 ] ] >a**[[-3.0],[0],[7.0]] = >NArray.float(4,3): >[ [ -0.125, inf, 0.125, 0.015625 ], > [ 1.0, 1.0, 1.0, 1.0 ], > [ -128.0, 0.0, 128.0, 16384.0 ] ] >a**(1+0.im) = >NArray.complex(4): >[ -2.0+2.44921e-16i, 0.0+0.0i, 2.0+0.0i, 4.0+0.0i ] >a**1.0 = >NArray.float(4): >[ -2.0, 0.0, 2.0, 4.0 ] > >a = >NArray.complex(4): >[ -2.0+0.0i, 0.0+0.0i, 2.0+0.0i, 4.0+0.0i ] >a**[[-3],[0],[7]] = >NArray.complex(4,3): >[ [ -0.125-0.0i, -nan-nani, 0.125-0.0i, 0.015625-0.0i ], > [ 1.0+0.0i, 1.0+0.0i, 1.0+0.0i, 1.0+0.0i ], > [ -128.0+0.0i, 0.0+0.0i, 128.0+0.0i, 16384.0+0.0i ] ] >a**[[-3.0],[0],[7.0]] = >NArray.complex(4,3): >[ [ -0.125-4.59227e-17i, inf-nani, 0.125-0.0i, 0.015625-0.0i ], > [ 1.0+0.0i, 1.0+0.0i, 1.0+0.0i, 1.0+0.0i ], > [ -128.0+1.09725e-13i, 0.0+0.0i, 128.0+0.0i, 16384.0+0.0i ] ] >a**(1+0.im) = >NArray.complex(4): >[ -2.0+2.44921e-16i, 0.0+0.0i, 2.0+0.0i, 4.0+0.0i ] >a**1.0 = >NArray.complex(4): >[ -2.0+2.44921e-16i, 0.0+0.0i, 2.0+0.0i, 4.0+0.0i ] > >NArray.float(5).random(10) #=> NArray.float(5): >[ 1.36498, 3.80982, 2.03961, 7.89161, 4.32348 ] > >NArray.float(5).random #=> NArray.float(5): >[ 0.588533, 0.261474, 0.437633, 0.335849, 0.409373 ] > >NArray.int(5).random(10) #=> NArray.int(5): >[ 6, 3, 5, 0, 2 ] > >NArray.int(1000).random(10) #=> NArray.int(1000): >[ 4, 0, 2, 1, 4, 9, 3, 9, 0, 5, 7, 9, 4, 0, 1, 0, 8, 3, 9, 9, 5, 1, 0, 7, ... ] > >a.eq 0 :: n=86 >a.eq 10 :: NArray.int(): [] >a = NArray.float(4,2): >[ [ -2.0, -1.75, -1.5, -1.25 ], > [ -1.0, -0.75, -0.5, -0.25 ] ] >a.floor = NArray.int(4,2): >[ [ -2, -2, -2, -2 ], > [ -1, -1, -1, -1 ] ] >a.ceil = NArray.int(4,2): >[ [ -2, -1, -1, -1 ], > [ -1, 0, 0, 0 ] ] >a.round = NArray.int(4,2): >[ [ -2, -2, -2, -1 ], > [ -1, -1, -1, 0 ] ] > >a #=> NArray.int(16): >[ 10, 84, 58, 57, 43, 49, 70, 8, 90, 8, 70, 61, 14, 50, 25, 54 ] >a.sort #=> NArray.int(16): >[ 8, 8, 10, 14, 25, 43, 49, 50, 54, 57, 58, 61, 70, 70, 84, 90 ] > ># as string... >a #=> NArray.object(16): >[ "10", "84", "58", "57", "43", "49", "70", "8", "90", "8", "70", "61", ... ] >a.sort #=> NArray.object(16): >[ "10", "14", "25", "43", "49", "50", "54", "57", "58", "61", "70", "70", ... ] > ># up to 0-rank... >a #=> NArray.int(4,4): >[ [ 59, 70, 91, 29 ], > [ 18, 39, 73, 72 ], > [ 11, 90, 70, 68 ], > [ 38, 94, 86, 33 ] ] >a.sort(0) #=> NArray.int(4,4): >[ [ 29, 59, 70, 91 ], > [ 18, 39, 72, 73 ], > [ 11, 68, 70, 90 ], > [ 33, 38, 86, 94 ] ] > ># big array test... >a #=> NArray.int(10,10,10,10,10): >[ [ [ [ [ 83, 43, 45, 61, 3, 14, 39, 10, 90, 33 ], > [ 76, 41, 19, 27, 47, 90, 11, 47, 65, 2 ], > [ 77, 16, 42, 56, 88, 28, 35, 3, 93, 4 ], > [ 53, 33, 48, 5, 61, 77, 73, 17, 81, 62 ], > [ 48, 82, 88, 26, 11, 29, 54, 95, 25, 94 ], > [ 16, 57, 99, 3, 87, 23, 32, 31, 1, 90 ], > [ 27, 39, 9, 43, 30, 65, 71, 70, 14, 22 ], > [ 84, 34, 29, 90, 47, 4, 12, 90, 47, 82 ], > [ 31, 23, 7, 86, 26, 62, 39, 92, 99, 33 ], > [ 64, 19, 12, 14, 3, 73, 80, 3, 60, 37 ] ], > ... >a.sort(1) #=> NArray.int(10,10,10,10,10): >[ [ [ [ [ 1, 2, 3, 3, 3, 3, 3, 4, 4, 5 ], > [ 7, 9, 10, 11, 11, 12, 12, 14, 14, 14 ], > [ 16, 16, 17, 19, 19, 22, 23, 23, 25, 26 ], > [ 26, 27, 27, 28, 29, 29, 30, 31, 31, 32 ], > [ 33, 33, 33, 34, 35, 37, 39, 39, 39, 41 ], > [ 42, 43, 43, 45, 47, 47, 47, 47, 48, 48 ], > [ 53, 54, 56, 57, 60, 61, 61, 62, 62, 64 ], > [ 65, 65, 70, 71, 73, 73, 76, 77, 77, 80 ], > [ 81, 82, 82, 83, 84, 86, 87, 88, 88, 90 ], > [ 90, 90, 90, 90, 92, 93, 94, 95, 99, 99 ] ], > ... > ># test sort_index... >a #=> NArray.int(7,4): >[ [ 53, 26, 44, 94, 42, 47, 47 ], > [ 27, 42, 59, 18, 88, 66, 90 ], > [ 16, 53, 84, 92, 81, 51, 42 ], > [ 31, 0, 44, 93, 29, 85, 59 ] ] >a.sort_index(0) #=> NArray.int(7,4): >[ [ 1, 4, 2, 5, 6, 0, 3 ], > [ 10, 7, 8, 9, 12, 11, 13 ], > [ 14, 20, 19, 15, 18, 16, 17 ], > [ 22, 25, 21, 23, 27, 26, 24 ] ] >a[a.sort_index] #=> NArray.int(7,4): >[ [ 26, 42, 44, 47, 47, 53, 94 ], > [ 18, 27, 42, 59, 66, 88, 90 ], > [ 16, 42, 51, 53, 81, 84, 92 ], > [ 0, 29, 31, 44, 59, 85, 93 ] ] >NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] >NArray.object(3,3): >[ [ "0", "1", "2" ], > [ "3", "4", "5" ], > [ "6", "7", "8" ] ] >NArray.object(3,3): >[ [ "0+0i", "0.33333333+0i", "0.66666667+0i" ], > [ "1+0i", "1.3333333+0i", "1.6666667+0i" ], > [ "2+0i", "2.3333333+0i", "2.6666667+0i" ] ] >NArray.object(3,3): >[ [ "0+0i", "0.33333+0i", "0.66667+0i" ], > [ "1+0i", "1.3333+0i", "1.6667+0i" ], > [ "2+0i", "2.3333+0i", "2.6667+0i" ] ] >NArray.object(3): >[ " !\"", "\#$%", "&'(" ] >NArray.int(3,3): >[ [ 0, 1, 2 ], > [ 3, 4, 5 ], > [ 6, 7, 8 ] ] >NArray.object(3,3): >[ [ "0", "1", "2" ], > [ "3", "4", "5" ], > [ "6", "7", "8" ] ] >NArray.object(3,3): >[ [ "0", "1", "2" ], > [ "3", "4", "5" ], > [ "6", "7", "8" ] ] >a #=> NArray.int(4,3,2): >[ [ [ 0, 1, 2, 3 ], > [ 4, 5, 6, 7 ], > [ 8, 9, 10, 11 ] ], > [ [ 12, 13, 14, 15 ], > [ 16, 17, 18, 19 ], > [ 20, 21, 22, 23 ] ] ] > ># transpose first and second... >a.transpose(1,0) #=> NArray.int(3,4,2): >[ [ [ 0, 4, 8 ], > [ 1, 5, 9 ], > [ 2, 6, 10 ], > [ 3, 7, 11 ] ], > [ [ 12, 16, 20 ], > [ 13, 17, 21 ], > [ 14, 18, 22 ], > [ 15, 19, 23 ] ] ] > ># transpose first and last... >a.transpose(-1,1..-2,0) #=> NArray.int(2,3,4): >[ [ [ 0, 12 ], > [ 4, 16 ], > [ 8, 20 ] ], > [ [ 1, 13 ], > [ 5, 17 ], > [ 9, 21 ] ], > [ [ 2, 14 ], > [ 6, 18 ], > [ 10, 22 ] ], > [ [ 3, 15 ], > ... > ># transpose shift forward ... >a.transpose(1..-1,0) #=> NArray.int(3,2,4): >[ [ [ 0, 4, 8 ], > [ 12, 16, 20 ] ], > [ [ 1, 5, 9 ], > [ 13, 17, 21 ] ], > [ [ 2, 6, 10 ], > [ 14, 18, 22 ] ], > [ [ 3, 7, 11 ], > [ 15, 19, 23 ] ] ] >a = NArray.float(8): >[ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ] >t,f = ( (a>=5).or (a<2) ).where2 >t = NArray.int(5): >[ 0, 1, 5, 6, 7 ] >f = NArray.int(3): >[ 2, 3, 4 ] >t,f = ( (a>=5).and (a<2) ).where2 >t = NArray.int(): [] >f = NArray.int(8): >[ 0, 1, 2, 3, 4, 5, 6, 7 ] > > vvv no-meaning !! vvv >t,f = ( (a>=5) && (a<2) ).where2 >t = NArray.int(2): >[ 0, 1 ] >f = NArray.int(6): >[ 2, 3, 4, 5, 6, 7 ] >t,f = ( (a>=5) || (a<2) ).where2 >t = NArray.int(3): >[ 5, 6, 7 ] >f = NArray.int(5): >[ 0, 1, 2, 3, 4 ] > * Running test phase for ruby19 ... >x #=> NArray.int(12): >[ 65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71 ] >y #=> NArray.int(12): >[ 68, 66, 68, 65, 69, 66, 68, 65, 71, 67, 68, 70 ] >covariance(x,y) #=> 3.6666666666666674 >x.stddev #=> 2.774341308665842 >x.sort #=> NArray.int(12): >[ 62, 63, 64, 65, 66, 67, 67, 68, 68, 69, 70, 71 ] >x.median #=> 67 >(x+y.newrank!(0)).median(0) #=> NArray.int(12): >[ 135, 133, 135, 132, 136, 133, 135, 132, 138, 134, 135, 137 ] >NArray.float(3,3,2): >[ [ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ], > [ [ 100.0, 0.0, 0.0 ], > [ 101.0, 0.0, 0.0 ], > [ 0.0, 0.0, 0.0 ] ] ] >NArray.float(3,3,2): >[ [ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ], > [ [ 100.0, 0.0, 0.0 ], > [ 101.0, 0.0, 0.0 ], > [ 0.0, 0.0, 0.0 ] ] ] >NArray.float(2,2,2,2): >[ [ [ [ 0.0, 0.0 ], > [ 1.0, 0.0 ] ], > [ [ 2.0, 0.0 ], > [ 3.0, 0.0 ] ] ], > [ [ [ 0.0, 1.0 ], > [ 2.0, 3.0 ] ], > [ [ 0.0, 0.0 ], > [ 0.0, 0.0 ] ] ] ] >NArray.float(2,2,2): >[ [ [ 0.0, 0.0 ], > [ 1.0, 0.0 ] ], > [ [ 0.0, 1.0 ], > [ 0.0, 0.0 ] ] ] >a #=> >NArray.byte(10): >[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] >a & 1 #=> >NArray.byte(10): >[ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 ] >a & 2 #=> >NArray.byte(10): >[ 0, 0, 2, 2, 0, 0, 2, 2, 0, 0 ] >a & -1 #=> >NArray.byte(10): >[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] >a | 1 #=> >NArray.byte(10): >[ 1, 1, 3, 3, 5, 5, 7, 7, 9, 9 ] >a | 2 #=> >NArray.byte(10): >[ 2, 3, 2, 3, 6, 7, 6, 7, 10, 11 ] >a | -1 #=> >NArray.byte(10): >[ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 ] >a ^ 1 #=> >NArray.byte(10): >[ 1, 0, 3, 2, 5, 4, 7, 6, 9, 8 ] >a ^ 2 #=> >NArray.byte(10): >[ 2, 3, 0, 1, 6, 7, 4, 5, 10, 11 ] >a ^ -1 #=> >NArray.byte(10): >[ 255, 254, 253, 252, 251, 250, 249, 248, 247, 246 ] >~a #=> >NArray.byte(10): >[ 255, 254, 253, 252, 251, 250, 249, 248, 247, 246 ] >a #=> >NArray.int(10): >[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] >~a #=> >NArray.int(10): >[ -1, -2, -3, -4, -5, -6, -7, -8, -9, -10 ] >a #=> NArray.int(3,3): >[ [ 0, 1, 2 ], > [ 3, 4, 5 ], > [ 6, 7, 8 ] ] >a+1.5 #=> NArray.int(3,3): >[ [ 1, 2, 3 ], > [ 4, 5, 6 ], > [ 7, 8, 9 ] ] >1.5+a #=> NArray.int(3,3): >[ [ 1, 2, 3 ], > [ 4, 5, 6 ], > [ 7, 8, 9 ] ] >a+NArray[1.2,3.4,5.6] #=> NArray.float(3,3): >[ [ 1.2, 4.4, 7.6 ], > [ 4.2, 7.4, 10.6 ], > [ 7.2, 10.4, 13.6 ] ] >a+NArray[Complex(0.5,1.5)] #=> NArray.complex(3,3): >[ [ 0.5+1.5i, 1.5+1.5i, 2.5+1.5i ], > [ 3.5+1.5i, 4.5+1.5i, 5.5+1.5i ], > [ 6.5+1.5i, 7.5+1.5i, 8.5+1.5i ] ] >a = NArray.complex(4,1): >[ [ 1.0+0.25i, 2.0+0.25i, 3.0+0.25i, 4.0+0.25i ] ] >b = NArray.complex(1,3): >[ [ -0.0-0.25i ], > [ 0.0+0.25i ], > [ 0.0+0.75i ] ] >a+b = NArray.complex(4,3): >[ [ 1.0+0.0i, 2.0+0.0i, 3.0+0.0i, 4.0+0.0i ], > [ 1.0+0.5i, 2.0+0.5i, 3.0+0.5i, 4.0+0.5i ], > [ 1.0+1.0i, 2.0+1.0i, 3.0+1.0i, 4.0+1.0i ] ] >a-b = NArray.complex(4,3): >[ [ 1.0+0.5i, 2.0+0.5i, 3.0+0.5i, 4.0+0.5i ], > [ 1.0+0.0i, 2.0+0.0i, 3.0+0.0i, 4.0+0.0i ], > [ 1.0-0.5i, 2.0-0.5i, 3.0-0.5i, 4.0-0.5i ] ] >a*b = NArray.complex(4,3): >[ [ 0.0625-0.25i, 0.0625-0.5i, 0.0625-0.75i, 0.0625-1.0i ], > [ -0.0625+0.25i, -0.0625+0.5i, -0.0625+0.75i, -0.0625+1.0i ], > [ -0.1875+0.75i, -0.1875+1.5i, -0.1875+2.25i, -0.1875+3.0i ] ] >a/b = NArray.complex(4,3): >[ [ -1.0+4.0i, -1.0+8.0i, -1.0+12.0i, -1.0+16.0i ], > [ 1.0-4.0i, 1.0-8.0i, 1.0-12.0i, 1.0-16.0i ], > [ 0.333333-1.33333i, 0.333333-2.66667i, 0.333333-4.0i, ... ] ] >a**b = NArray.complex(4,3): >[ [ 1.06313-0.00805662i, 1.01578-0.179834i, 0.982495-0.277759i, ... ], > [ 0.940566+0.00712782i, 0.954546+0.168993i, 0.942489+0.266449i, ... ], > [ 0.831942+0.0189168i, 0.78796+0.457112i, 0.636464+0.691133i, ... ] ] >a.real = NArray.float(4,1): >[ [ 1.0, 2.0, 3.0, 4.0 ] ] >a.imag = NArray.float(4,1): >[ [ 0.25, 0.25, 0.25, 0.25 ] ] >a.angle = NArray.float(4,1): >[ [ 0.244979, 0.124355, 0.0831412, 0.0624188 ] ] >a.conj = NArray.complex(4,1): >[ [ 1.0-0.25i, 2.0-0.25i, 3.0-0.25i, 4.0-0.25i ] ] >a #=> NArray.float(5,5): >[ [ 0.0, 1.0, 2.0, 3.0, 4.0 ], > [ 5.0, 6.0, 7.0, 8.0, 9.0 ], > [ 10.0, 11.0, 12.0, 13.0, 14.0 ], > [ 15.0, 16.0, 17.0, 18.0, 19.0 ], > [ 20.0, 21.0, 22.0, 23.0, 24.0 ] ] > >idx #=> [2, 0, 1] > >a[idx,idx] # Index Array > #=> NArray.float(3,3): >[ [ 12.0, 10.0, 11.0 ], > [ 2.0, 0.0, 1.0 ], > [ 7.0, 5.0, 6.0 ] ] > >idx #=> NArray.int(3): >[ 12, 10, 11 ] > >a[idx] #=> NArray.float(3): >[ 12.0, 10.0, 11.0 ] > >a[1,[]] # Empty Array > #=> NArray.float(): [] >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] >a[1, -1] #=> 7.0 >a[1, 2..0] #=> NArray.float(3): >[ 7.0, 4.0, 1.0 ] >a[1...2, 0..1] #=> NArray.float(1,2): >[ [ 1.0 ], > [ 4.0 ] ] >a[true, 0..1] #=> NArray.float(3,2): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ] ] >a[0..5] #=> NArray.float(6): >[ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0 ] >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[[]] = [] # Do nothing >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 4.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[1,1] = 0 # 1-element replace >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 3.0, 0.0, 5.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[0..-1, 1] = 0 # Range replace >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 0.0, 0.0, 0.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[1,2..0] = [100,101,102] # Array replace >a #=> NArray.float(3,3): >[ [ 0.0, 102.0, 2.0 ], > [ 3.0, 101.0, 5.0 ], > [ 6.0, 100.0, 8.0 ] ] > >a[0,1] = [100,101,102] # Specifing Starting point >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 100.0, 101.0, 102.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[1,0] = [[100],[101],[102]] # Specifing Starting point >a #=> NArray.float(3,3): >[ [ 0.0, 100.0, 2.0 ], > [ 3.0, 101.0, 5.0 ], > [ 6.0, 102.0, 8.0 ] ] > >a[true,1] = [100,101,102] # `true' means entire range >a #=> NArray.float(3,3): >[ [ 0.0, 1.0, 2.0 ], > [ 100.0, 101.0, 102.0 ], > [ 6.0, 7.0, 8.0 ] ] > >a[true,true] = [[100,101,102]] >a #=> NArray.float(3,3): >[ [ 100.0, 101.0, 102.0 ], > [ 100.0, 101.0, 102.0 ], > [ 100.0, 101.0, 102.0 ] ] >NArray >3 >7 >NArray -- Exception raised as expected. The message was: cannot count_true NArray except BYTE type > >--- test masking (float) --- >NArray.byte(5,3): >[ [ 0, 0, 0, 0, 0 ], > [ 1, 1, 1, 1, 1 ], > [ 1, 1, 1, 1, 1 ] ] >1 >NArray.float(5,3): >[ [ 0.0, 1.0, 2.0, 3.0, 4.0 ], > [ 5.0, 6.0, 7.0, 8.0, 9.0 ], > [ 10.0, 11.0, 12.0, 13.0, 14.0 ] ] >NArray.float(5,3): >[ [ -4.0, -2.0, 0.0, 2.0, 4.0 ], > [ 6.0, 8.0, 10.0, 12.0, 14.0 ], > [ 16.0, 18.0, 20.0, 22.0, 24.0 ] ] >NArray.float(10): >[ 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0 ] >NArray.float(10): >[ 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0 ] >NArray.float(5,3): >[ [ 0.0, 1.0, 2.0, 3.0, 4.0 ], > [ 10000.0, 10000.0, 10000.0, 10000.0, 10000.0 ], > [ 10000.0, 10000.0, 10000.0, 10000.0, 10000.0 ] ] > >--- test masking (complex) --- >NArray.complex(5): >[ 0.0+1.0i, 1.0+1.0i, 2.0+1.0i, 3.0+1.0i, 4.0+1.0i ] >NArray.complex(2): >[ 2.0+1.0i, 3.0+1.0i ] >NArray.complex(5): >[ 0.0+1.0i, 1.0+1.0i, 100.0+0.0i, 100.0+0.0i, 4.0+1.0i ] >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] > >### asin(sin(x)) ### >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] > >### acos(cos(x)) ### >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] > >### atan(tan(x)) ### >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] > >### asinh(sinh(x)) ### >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] > >### acosh(cosh(x)) ### >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] > >### atanh(tanh(x)) ### >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] > >### asec(sec(x)) ### >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] > >### asech(sech(x)) ### >NArray.complex(7): >[ 0.0675233+0.13997i, 0.0514441+0.171833i, 0.457594+0.808277i, ... ] >0.6420926159343306 >x = 0.000 0.500 1.000 1.500 2.000 2.500 >sqrt(x) = 0.000 0.707 1.000 1.225 1.414 1.581 >sin(x) = 0.000 0.479 0.841 0.997 0.909 0.598 >cos(x) = 1.000 0.878 0.540 0.071 -0.416 -0.801 >tan(x) = 0.000 0.546 1.557 14.101 -2.185 -0.747 >sinh(x) = 0.000 0.521 1.175 2.129 3.627 6.050 >cosh(x) = 1.000 1.128 1.543 2.352 3.762 6.132 >tanh(x) = 0.000 0.462 0.762 0.905 0.964 0.987 >exp(x) = 1.000 1.649 2.718 4.482 7.389 12.182 >log(x) = -Inf -0.693 0.000 0.405 0.693 0.916 >log10(x) = -Inf -0.301 0.000 0.176 0.301 0.398 >atan(x) = 0.000 0.464 0.785 0.983 1.107 1.190 >atan(tan(x)) = 0.000 0.500 1.000 1.500 -1.142 -0.642 >x = 0.000 0.500 1.000 1.500 2.000 2.500 >sqrt(x) = 0.000 0.707 1.000 1.225 1.414 1.581 >sin(x) = 0.000 0.479 0.841 0.997 0.909 0.598 >cos(x) = 1.000 0.878 0.540 0.071 -0.416 -0.801 >tan(x) = 0.000 0.546 1.557 14.101 -2.185 -0.747 >sinh(x) = 0.000 0.521 1.175 2.129 3.627 6.050 >cosh(x) = 1.000 1.128 1.543 2.352 3.762 6.132 >tanh(x) = 0.000 0.462 0.762 0.905 0.964 0.987 >exp(x) = 1.000 1.649 2.718 4.482 7.389 12.182 >log(x) = -Inf -0.693 0.000 0.405 0.693 0.916 >log10(x) = -Inf -0.301 0.000 0.176 0.301 0.398 >atan(x) = 0.000 0.464 0.785 0.983 1.107 1.190 >atan(tan(x)) = 0.000 0.500 1.000 1.500 -1.142 -0.642 >x = -2.000-1.000i -1.500-1.000i -1.000-1.000i -0.500-1.000i 0.000-1.000i 0.500-1.000i >sqrt(x) = 0.344-1.455i 0.389-1.285i 0.455-1.099i 0.556-0.899i 0.707-0.707i 0.899-0.556i >sin(x) = -1.403+0.489i -1.539-0.083i -1.298-0.635i -0.740-1.031i 0.000-1.175i 0.740-1.031i >cos(x) = -0.642-1.069i 0.109-1.172i 0.834-0.989i 1.354-0.563i 1.543+0.000i 1.354+0.563i >tan(x) = 0.243-1.167i -0.051-1.308i -0.272-1.084i -0.196-0.843i 0.000-0.762i 0.196-0.843i >sinh(x) = -1.960-3.166i -1.150-1.979i -0.635-1.298i -0.282-0.949i 0.000-0.841i 0.282-0.949i >cosh(x) = 2.033+3.052i 1.271+1.792i 0.834+0.989i 0.609+0.438i 0.540-0.000i 0.609-0.438i >tanh(x) = -1.015-0.034i -1.038-0.094i -1.084-0.272i -1.043-0.807i 0.000-1.557i 1.043-0.807i >exp(x) = 0.073-0.114i 0.121-0.188i 0.199-0.310i 0.328-0.510i 0.540-0.841i 0.891-1.387i >log(x) = 0.805-2.678i 0.589-2.554i 0.347-2.356i 0.112-2.034i 0.000-1.571i 0.112-1.107i >log10(x) = 0.349-1.163i 0.256-1.109i 0.151-1.023i 0.048-0.884i 0.000-0.682i 0.048-0.481i >atan(x) = -1.178-0.173i -1.107-0.255i -1.017-0.402i -0.908-0.708i 0.000-Infi 0.908-0.708i >atan(tan(x)) = 1.142-1.000i -1.500-1.000i -1.000-1.000i -0.500-1.000i 0.000-1.000i 0.500-1.000i >x = -0.500+0.000i -0.300+0.000i -0.100+0.000i 0.100+0.000i 0.300+0.000i 0.500+0.000i >sqrt(x) = 0.000+0.707i 0.000+0.548i 0.000+0.316i 0.316+0.000i 0.548+0.000i 0.707+0.000i >sin(x) = -0.479+0.000i -0.296+0.000i -0.100+0.000i 0.100+0.000i 0.296+0.000i 0.479+0.000i >cos(x) = 0.878+0.000i 0.955+0.000i 0.995+0.000i 0.995-0.000i 0.955-0.000i 0.878-0.000i >tan(x) = -0.546+0.000i -0.309+0.000i -0.100+0.000i 0.100+0.000i 0.309+0.000i 0.546+0.000i >sinh(x) = -0.521+0.000i -0.305+0.000i -0.100+0.000i 0.100+0.000i 0.305+0.000i 0.521+0.000i >cosh(x) = 1.128-0.000i 1.045-0.000i 1.005-0.000i 1.005+0.000i 1.045+0.000i 1.128+0.000i >tanh(x) = -0.462+0.000i -0.291+0.000i -0.100+0.000i 0.100+0.000i 0.291+0.000i 0.462+0.000i >exp(x) = 0.607+0.000i 0.741+0.000i 0.905+0.000i 1.105+0.000i 1.350+0.000i 1.649+0.000i >log(x) = -0.693+3.142i -1.204+3.142i -2.303+3.142i -2.303+0.000i -1.204+0.000i -0.693+0.000i >log10(x) = -0.301+1.364i -0.523+1.364i -1.000+1.364i -1.000+0.000i -0.523+0.000i -0.301+0.000i >atan(x) = -0.464+0.000i -0.291+0.000i -0.100+0.000i 0.100+0.000i 0.291+0.000i 0.464+0.000i >atan(tan(x)) = -0.500+0.000i -0.300+0.000i -0.100+0.000i 0.100+0.000i 0.300+0.000i 0.500+0.000i >$m1 #=> >NMatrix.float(2,2): >[ [ 0.0, 1.0 ], > [ 2.0, 3.0 ] ] > >$m1.inverse #=> >NMatrix.float(2,2): >[ [ -1.5, 0.5 ], > [ 1.0, 0.0 ] ] > >$m2 #=> >NMatrix.float(2,2): >[ [ 0.0, 1.2 ], > [ 1.5, 0.0 ] ] > >$m1*$m2 #=> >NMatrix.float(2,2): >[ [ 1.5, 0.0 ], > [ 4.5, 2.4 ] ] > >$m2*$m1 #=> >NMatrix.float(2,2): >[ [ 2.4, 3.6 ], > [ 0.0, 1.5 ] ] > >$m1+$m2 #=> >NMatrix.float(2,2): >[ [ 0.0, 2.2 ], > [ 3.5, 3.0 ] ] > >3.14*$m1 #=> >NMatrix.float(2,2): >[ [ 0.0, 3.14 ], > [ 6.28, 9.42 ] ] > >$m2*1.25 #=> >NMatrix.float(2,2): >[ [ 0.0, 1.5 ], > [ 1.875, 0.0 ] ] > >$v1 #=> >NVector.float(2): >[ 0.5, 1.5 ] > >$v2 #=> >NVector.float(2,2): >[ [ 0.0, 1.0 ], > [ 2.0, 3.0 ] ] > >1.25*$v1 #=> >NVector.float(2): >[ 0.625, 1.875 ] > >NMath.sqrt($v2**2) #=> >NArray.float(2): >[ 1.0, 3.60555 ] > >$v1*$v2 #=> >NArray.float(2): >[ 1.5, 5.5 ] > >$m1*$v1 #=> >NVector.float(2): >[ 1.5, 5.5 ] > >$v2*$m2 #=> >NVector.float(2,2): >[ [ 1.5, 0.0 ], > [ 4.5, 2.4 ] ] > >$m1.diagonal([98,99]) #=> >NMatrix.float(2,2): >[ [ 98.0, 1.0 ], > [ 2.0, 99.0 ] ] > >NMatrix.float(4,3).unit #=> >NMatrix.float(4,3): >[ [ 1.0, 0.0, 0.0, 0.0 ], > [ 0.0, 1.0, 0.0, 0.0 ], > [ 0.0, 0.0, 1.0, 0.0 ] ] > >m #=> >NMatrix.object(5,5): >[ [ (5/1), (8/1), (9/1), (5/1), (0/1) ], > [ (0/1), (1/1), (7/1), (6/1), (9/1) ], > [ (2/1), (4/1), (5/1), (2/1), (4/1) ], > [ (2/1), (4/1), (7/1), (7/1), (9/1) ], > [ (1/1), (7/1), (0/1), (6/1), (9/1) ] ] >m/m #=> >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/nmatrix.rb:62: [BUG] Segmentation fault >ruby 1.9.2dev (2010-07-11 revision 28618) [i686-linux] > >-- control frame ---------- >c:0005 p:---- s:0017 b:0017 l:000016 d:000016 CFUNC :solve >c:0004 p:0140 s:0013 b:0013 l:000012 d:000012 METHOD /var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/nmatrix.rb:62 >c:0003 p:0121 s:0009 b:0008 l:001da4 d:002424 EVAL test/testmatrix3.rb:19 >c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH >c:0001 p:0000 s:0002 b:0002 l:001da4 d:001da4 TOP >--------------------------- >-- Ruby level backtrace information ---------------------------------------- >test/testmatrix3.rb:19:in `<main>' >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/nmatrix.rb:62:in `/' >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/nmatrix.rb:62:in `solve' > >-- C level backtrace information ------------------------------------------- >/usr/lib/libruby19.so.1.9(rb_vm_bugreport+0x72) [0xf7703402] >/usr/lib/libruby19.so.1.9(+0x51019) [0xf75f8019] >/usr/lib/libruby19.so.1.9(rb_bug+0x3a) [0xf75f862a] >/usr/lib/libruby19.so.1.9(+0xf6b6c) [0xf769db6c] >[0xf7788410] >/usr/lib/libruby19.so.1.9(+0x145d9e) [0xf76ecd9e] >/usr/lib/libruby19.so.1.9(rb_method_entry_get_without_cache+0x27) [0xf76eeee7] >/usr/lib/libruby19.so.1.9(rb_method_entry+0x3e) [0xf76eef9e] >/usr/lib/libruby19.so.1.9(rb_funcall+0x1af) [0xf76f924f] >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/narray.so(+0x18151) [0xf707c151] >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/narray.so(+0x1de43) [0xf7081e43] >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/narray.so(+0x1e07f) [0xf708207f] >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/narray.so(+0x1ee98) [0xf7082e98] >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7/lib/narray.so(+0x1f3ef) [0xf70833ef] >/usr/lib/libruby19.so.1.9(+0x1469a3) [0xf76ed9a3] >/usr/lib/libruby19.so.1.9(+0x15592a) [0xf76fc92a] >/usr/lib/libruby19.so.1.9(+0x14a739) [0xf76f1739] >/usr/lib/libruby19.so.1.9(+0x150916) [0xf76f7916] >/usr/lib/libruby19.so.1.9(rb_iseq_eval_main+0xab) [0xf76ff41b] >/usr/lib/libruby19.so.1.9(+0x54fda) [0xf75fbfda] >/usr/lib/libruby19.so.1.9(ruby_exec_node+0x25) [0xf75fc535] >/usr/lib/libruby19.so.1.9(ruby_run_node+0x35) [0xf75fdeb5] >/usr/bin/ruby19(main+0x68) [0x8048838] >/lib/libc.so.6(__libc_start_main+0xe6) [0xf73cfcc6] >/usr/bin/ruby19() [0x8048711] > >[NOTE] >You may have encountered a bug in the Ruby interpreter or extension libraries. >Bug reports are welcome. >For details: http://www.ruby-lang.org/bugreport.html > >/var/tmp/portage/dev-ruby/narray-0.5.9_p7/temp/environment: line 1021: 16254 Aborted ${RUBY} -Ilib ${unit} > * ERROR: dev-ruby/narray-0.5.9_p7 failed: > * test test/testmatrix3.rb failed > * > * Call stack: > * ebuild.sh, line 54: Called src_test > * environment, line 2981: Called ruby-ng_src_test > * environment, line 2731: Called _ruby_each_implementation 'each_ruby_test' > * environment, line 434: Called _ruby_invoke_environment 'ruby19' 'each_ruby_test' > * environment, line 463: Called each_ruby_test > * environment, line 1024: Called die > * The specific snippet of code: > * ${RUBY} -Ilib ${unit} || die "test ${unit} failed"; > * > * If you need support, post the output of 'emerge --info =dev-ruby/narray-0.5.9_p7', > * the complete build log and the output of 'emerge -pqv =dev-ruby/narray-0.5.9_p7'. > * The complete build log is located at '/var/log/portage/build/dev-ruby/narray-0.5.9_p7:20100815-204121.log'. > * The ebuild environment file is located at '/var/tmp/portage/dev-ruby/narray-0.5.9_p7/temp/environment'. > * S: '/var/tmp/portage/dev-ruby/narray-0.5.9_p7/work/ruby19/narray-0.5.9p7' > >>>> Install narray-0.5.9_p7 into /var/tmp/portage/dev-ruby/narray-0.5.9_p7/image/ category dev-ruby > * Running install phase for ruby18 ... > * Running install phase for ruby19 ... > * Running install phase for all ... > * Running check install phase for ruby18 ... > * Running check install phase for ruby19 ... >>>> Completed installing narray-0.5.9_p7 into /var/tmp/portage/dev-ruby/narray-0.5.9_p7/image/ > >strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment > usr/lib/ruby/gems/1.9.1/gems/narray-0.5.9.7/lib/narray.so > usr/lib/ruby/gems/1.8/gems/narray-0.5.9.7/lib/narray.so > > * QA Notice: Files built without respecting LDFLAGS have been detected > * Please include the following list of files in your report: > * /usr/lib/ruby/gems/1.9.1/gems/narray-0.5.9.7/lib/narray.so > > * Gentoo contact information ... >herds: > ruby >maintainers: >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 332915
: 243119