This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/jayemerson/big.data.frame/blob/master/inst/Jaks.R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> a <- c(1,2,3) + c(4,5,6) | |
> print(a) | |
5 7 9 | |
> b <- c(1,2,3) + 99 | |
> print(b) | |
100 101 102 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub mean2(*@args) { | |
# This works, but is Resizable: | |
#my $vec := pir::new("ResizableFloatArray"); | |
# This works, but... argh. | |
my $vec := Q:PIR { %r = new ["FixedFloatArray"], 2 }; | |
#my $vec := pir::new("FixedFloatArray", 2); | |
# Generates: "init_pmc() not implemented in class 'FixedFloatArray'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Line indicated below is generating the error: "get_number() not implemented in class 'FixedFloatArray'" | |
.sub '' :anon :load | |
..... | |
# Documented http://www.gnu.org/software/gsl/manual/html_node/Mean-and-standard-deviation-and-variance.html if you want to check the signature... | |
dlfunc nci, lib, 'gsl_stats_mean', 'dpll' | |
set_global ['GSL'], 'gsl_stats_mean', nci | |
...... | |
.end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NQR/src/nqr.pir | |
.sub '' :anon :load | |
load_bytecode 'HLL.pbc' | |
... # OMITTED STANDARD squaak STUFF | |
# ATTEMPTED LIBRARY LOADING UP FRONT? | |
.local pmc lib, nci | |
loadlib lib, 'libgsl.so' | |
dlfunc nci, lib, 'gsl_ran_gaussian_pdf', 'ddd' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub test(*@args) { | |
my $ans; | |
ans := Q:PIR { | |
.local pmc libgsl, gsl_ran_gaussian_pdf | |
.local num ans, xval, sigma | |
xval = 0.0 | |
sigma = 1.0 | |
libgsl = loadlib "libgsl" | |
if libgsl goto HAVELIBRARY | |
say 'Could not load the library' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub rexp(*@args) { | |
return Q:PIR { | |
$P0 = find_lex '@args' | |
.local num arg1 | |
arg1 = $P0[0] | |
.local pmc libRmath, rexp | |
.local num ans | |
libRmath = loadlib "libRmath" | |
rexp = dlfunc libRmath, "rexp", "dd" | |
ans = rexp(arg1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jay@bayesman:~/Desktop/NQR$ ./installable_nqr | |
Not Quite R for Parrot VM. | |
> setseeds(1,2) | |
Seeds have been set. | |
> a = rexp(1) | |
Your exponential: 1.41192912698369 | |
> print(a) | |
1.41192912698369 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Not Quite R for Parrot VM. | |
> i <- 99 | |
> myfor(i in c(1,2,3)) { print(c(i, i*i)) } | |
99 9801 | |
99 9801 | |
99 9801 | |
> | |
rule statement:sym<myfor> { |