Questions tagged [nmatrix]

NMatrix is the most powerful numeric linear algebra library for Ruby.

NMatrix is a library for numeric linear algebra built on top of ATLAS and LAPACK, providing various other features (e.g. sparse matrices) implemented in C++. It is part of the SciRuby project.

14 questions
3
votes
2 answers

NoMethodError: private method `pp' for NMatrix

I am using NMatrix in my project and now when I run the follwing command in console to see whether it is creating a matrix or not rails c 1.9.3p194 :001 > require 'nmatrix' => false 1.9.3p194 :002 > m = NMatrix.new([2, 3], [0, 1, 2, 3, 4, 5],…
2
votes
3 answers

NMatrix division of arrays with different shapes

I have an NMatrix array like this x = NMatrix.new([3, 2], [3, 5, 5, 1, 10, 2], dtype: :float64) I want to divide each column by maximum value along the column. Using numpy this is achieved like this Y = np.array(([3,5], [5,1], [10,2]),…
prajwaldp
  • 178
  • 1
  • 14
2
votes
2 answers

Install SciRuby failed on OS X

I have gcc6.1 installed on OS X via brew, when I tried to install sciruby-full on my Mac, always got this Error: >Fetching: nmatrix-0.1.0.gem (100%) Building native extensions. This could take a while... ERROR: Error installing sciruby-full: …
Kane Blueriver
  • 4,170
  • 4
  • 29
  • 48
2
votes
1 answer

Doing git pull in Engine Yard

I am deploying my rails app to Engine Yard. What i had so far: 1. created SSH hey 2. Install public key to Engine Yard app. 3. ssh deploy@my.server.ip.address I was put at home/deploy, which is not a right place to perform git pull. The reason I…
VHanded
  • 2,079
  • 4
  • 30
  • 55
1
vote
1 answer

Reading files into Ruby Numo::NArray

I have given number of files, which all have the same size. What I'm trying to do is to load those files into Numo::Narray in a way that every file needs to be in a different row of this array. Number of files and their size is known before creating…
railsmk
  • 23
  • 4
1
vote
0 answers

Horizontal concatenation of NMatrix matrices is incorrect in the second column

I am generating an LDPC parity check matrix compliant with the CCSDS standard with the help of Ruby and the NMatrix module from SciRuby. Generating the matrix involves creating submatrices that you concatenate together to form the final parity check…
Sydney Hauke
  • 171
  • 1
  • 6
1
vote
1 answer

solve function of gem NMatrix

When I tried to use the function "solve" in gem NMatrix, I find wrong result... I am trying to solve the linear system a*x = b where a = [[1, 0, 0], [4, -5, 1], [0, 0, 1]] and b = [0, 0, 729] Which should give the answer x = [0,…
M. S.
  • 33
  • 1
  • 6
1
vote
0 answers

Where do I find documentation and examples of the sciruby nmatrix C/C++ api?

I am trying to write ruby interfaces to a piece scientific computation library I wrote. This library itself uses other open-source libraries like OpenCV, boost etc. The primary data structure my library operates on, and that is being returned by my…
Vineet
  • 150
  • 1
  • 7
0
votes
0 answers

install error for nmatrix gem in windows 8

I am trying to install the nmatrix gem. i have the gcc compiler installed: C:\dev\DNA>gcc --version gcc (GCC) 4.9.3 Copyright (C) 2015 Free Software Foundation, Inc. then I have the following error on install: C:\dev\DNA>gem install…
Thrabbit
  • 193
  • 2
  • 12
0
votes
0 answers

Error in nmatrix installation: suffix or operands invalid for `movq'

I tried installing using gem install nmatrix on osx, using gcc 5.2.0. In file included from nmatrix.cpp:283:0: [some warnings ...] /var/folders/sc/2zd_v0qn76gdq5sdg63_jx4r0000gn/T//cc1KmZTQ.s:13579:suffix or operands invalid for `movq' make: ***…
dimid
  • 7,285
  • 1
  • 46
  • 85
0
votes
1 answer

Improving Performance of Element Wise Math Operations

I was profiling an application that does a lot of math operations on NMatrix matrices. The application spends most of it's time in in the code below. {add: :+, sub: :-, mul: :*, div: :/, pow: :**, mod: :%}.each_pair do |ewop,…
Henry Chinner
  • 429
  • 3
  • 9
0
votes
1 answer

How to call a ruby extension method when using ruby built in classes

To follow up a question I asked already and kind of solved as far as I got the answer to my question despite the fact a new problem was borne from the solved one which is this: The problem in using the Complex API is that it doesn't recognise the…
Magpie
  • 607
  • 2
  • 7
  • 26
0
votes
2 answers

Return transformed nmatrix array with fftw3

I am creating a ruby wrapper for the fftw3 library for the Scientific Ruby Foundation which uses nmatrix objects instead of regular ruby arrays. I have a curious problem in returning the transformed array in that I am not sure how to do this so I…
Magpie
  • 607
  • 2
  • 7
  • 26
-1
votes
2 answers

Ruby group non-zero numbers and sequential times

I have an array of items like so: [DateTime, value]. I want to group the items which satisfy the following conditions: A sequence of 3 or more items Items contain values which are > 0 times are sequential (increasing by 1 second) I want to get…
richflow
  • 1,902
  • 3
  • 14
  • 21