Comments (8)
It will be fixed but I suspect that you have some misconceptions about a list matrix.
-
A list matrix has default value (by default it equals zero). You will get this value always when you access to non-existent element of the matrix. After creation a list matrix is empty, but we see it as filed by zero. When you assign to a cell default value you actually remove it. In this way, your code (if it works) does nothing.
-
If you want to fill your matrix fully or bigger part. To be better use a dense matrix.
Thanks for report, if @MohawkJohn will not be against I can fix up this bug.
from nmatrix.
For (2) most of the values I'm setting are 0. I'm using a sparse matrix as a vector space model.
For (1), I don't understand, "your code (if it works) does nothing". For example, this works fine:
matrix = NMatrix.new(:list, [2, 2], :float64)
matrix.pretty_print
Prints:
0.0 0.0
0.0 0.0
Then:
matrix[0, 0] = 1
matrix.pretty_print
Gives:
1.0 0.0
0.0 0.0
My code is doing the same thing as above, except inside loops.
from nmatrix.
(1) Sorry. I have understood what you fill a matrix by zero values. And from (2) I agree that your choice of type matrix is right.
Well.. we will fix it as soon as it possible. Thank you very mach for report again.
from nmatrix.
Forgot to mention: this is with 0.0.1 release. I will test with HEAD as soon as I can install it.
from nmatrix.
It's very important because 0.0.2 is very differ from 0.0.1 inwardly. Actually 0.0.2 is result of deep refactoring and a big part had been rewritten in C++.
I will check up it for 0.0.2.
from nmatrix.
For 0.0.2 this code works right:
m = NMatrix.new(:list, [3, 3], :float64)
[1.0,2.0,3.0].each_with_index do |x,i|
[1.0,2.0,3.0].each_with_index do |y,j|
m[i, j] = x+y
end
end
m.pretty_print
Pleas try it again when you will have installed 0.0.2 version.
from nmatrix.
Is this working for you now, @jpmckinney? Thanks, Aleksey, for working on this.
from nmatrix.
My code works with :list
now, thanks! And I'm able to cast it to :yale
after building it.
from nmatrix.
Related Issues (20)
- Fix travis-ci rdoc problem on mac osx builds
- MRI segmentation fault at unknown location in code HOT 15
- Calculate rank of matrix based on SVD HOT 1
- More user-friendly SVD interface HOT 8
- Update Travis CI for current Ruby options [critical]
- Concatenate matrices by specifying them in an Array HOT 3
- Boolean indexing
- Check equality with tolerance HOT 1
- More descriptive TypeError from #dot HOT 1
- Can we stop using ALLOCA_N in C++? HOT 3
- MKL support out-of-the-box? HOT 5
- Add Ruby 2.5 and 2.6 to travis configuration HOT 7
- Installation error for MaxOSX and Ubuntu HOT 4
- There is a method in nmatrix for matrix exponential? HOT 9
- puts or p on simple matrix crashes HOT 2
- lib/nmatrix/nmatrix.rb:47:in `require_relative': superclass mismatch for class NMatrix (TypeError) HOT 1
- Is there a 'argmax' method for NMatrix? HOT 1
- '10.2.1' < '4.3.0' is true
- Last argument as keyword parameters is deprecated in Ruby 2.7
- Dir.exists? removed in Ruby 3.2 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmatrix.