wilcrofter / gens.jl Goto Github PK
View Code? Open in Web Editor NEWA Julia package to generate the nonzero entries of a system matrix.
License: Other
A Julia package to generate the nonzero entries of a system matrix.
License: Other
I'm calling genS with incorrect parameters but at the entry for (5,6), that is xmitr 5 and rcvr 6, a zero for the row index appears. The following code calls probePos and genS (with incorrect parameters) and prints the xmitr,rcvr pairs followed by a list of values which are linear combinations of the i,j indices associated with the pairs. For (xmitr,rcvr)==(5,6) the first entry is 0.
using GenS
function zeroRow()
r2 = Float64[-.1 8.1; -.1 -0.1; 8.1 -0.1; 8.1 8.1]
grid = .5
width = 8
height = 8
xmitr,rcvr = probePos(8,r2)
data = genS(width,height,grid,xmitr,rcvr)
for (j in 1:height)
for (i in 1:width)
col = (data[i,j][1][:,1]-1)*width + data[i,j][1][:,2]
println(i," ",j," * ",col)
end #i
end #j
end #function
Installing GenS as a Julia package requires that git
be installed on your system. Then, from the Julia prompt, either of the following commands should work. (Let me know if they don't.)
julia> Pkg.clone("[email protected]:WilCrofter/GenS.jl.git")
or
julia> Pkg.clone("https://github.com/WilCrofter/GenS.jl.git")
(Alternatively, if you have a GitHub account, you can fork the repository and install from the fork, replacing WilCrofter
in the above commands with your own GitHub user name.)
Assuming the above commands work, GenS
will be installed in Julia's package directory. Its location can be found using Pkg.dir
:
julia> Pkg.dir("GenS")
To verify, package tests can be run as follows
julia> Pkg.build("GenS");Pkg.reload("GenS");Pkg.test("GenS")
which should result in output resembling:
WARNING: replacing module GenS
INFO: Testing GenS
INFO: Any["wCrossings (vert) OK" true
"wCrossings (hor) OK" true
"wCrossings (slant) OK" true
"gridCrossings OK" true
"gridCrossings time" 0.00023827
"segmentLengths OK" true
"segmentLenths time" 0.000338441221
"probePos probe 1 OK" true
"probePos probe 2 OK" true
"IO: width OK" true
"IO: height OK" true
"IO: gridsize OK" true
"IO: transmitters OK" true
"IO: receivers OK" true
"IO: data OK" true
"genS I/O consistency OK" true
"genS time (128 transducers)" 5.266795331]
INFO: GenS tests passed
The git GUI
may be useful if you are unfamiliar with git. It is fairly easy to update the package from the command line or Julia prompt, however. In either case you must first navigate to the package directory (as given by julia> Pkg.dir("GenS")
.) In Julia:
julia> cd(Pkg.dir("GenS"))
julia> ;git pull # the semicolon causes the command to be issued to the operating system
In a terminal
cd /path/to/GenS
git pull
To contribute code, bug fixes, etc., you must be a collaborator or must issue a pull request from a forked repository. For either purpose you must have a GitHub account.
Contributors will need some familiarity with git, with the commands git add
, git commit
, and git push
at a minimum.
GenS includes four m-files. The package directory is probably not the most convenient place for them. However, they are easily copied to another location. The following shows how I copy them to my desktop using the Julia function, cp
. Note that *
is Julia's string concatenation operator
julia> cp(Pkg.dir("GenS") * "/mfiles", "/home/wil/Desktop/mfiles")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.