Displaying 20 results from an estimated 36 matches for "sqr".
Did you mean:
shr
2009 Mar 23
3
Replacing a few variable values within a DataFrame...
...the dataframe below (contrived) I would like to replace the current housesize value only if the Location is HSV. However, I would like to leave the other values intact.
I tried "ifelse", but I don't really need the else condition.
test_data2_df<-data.frame(Variables=c("SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage","SQR Footage&quo...
2008 Oct 20
2
R Newbie Question
...ere's my rookie code - please feel free to comment on
anything :-)
Kind regards,
Johannes
star1center = vector("numeric", 2)
star1center[1] = -0.5
star1center[2] = 0
star1mass = 30
star2center = vector("numeric", 2)
star2center[1] = 0.5
star2center[2] = 0
star2mass = 1
sqr = function(x) {
return(x * x)
}
distance = function(a, b) {
return(sqrt(sqr(a[1] - b[1]) + sqr(a[2] - b[2])))
}
len = function(x) {
return(sqrt(sqr(x[1]) + sqr(x[2])))
}
norm = function(x) {
return(x / len(x))
}
gravitation = function(invecx, invecy) {
invec = vector("numeric", 2...
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
...efined in the app, with C linkage).
I add a declaration for the function to my IR, and when I use MCJIT, it finds it and all is well, But when I use ORC JIT (I *think* correctly, at least it closely matches what I see in the tutorial), I get an LLVM error, "Program used external function 'sqr' which could not be resolved."
(Excuse my coming to the ORC party late, I've been stuck on an older LLVM for my DSL, and am only now jumping forward several versions at once, with some growing pains.)
I've boiled it down to the minimal example below. When I build with orc=0, thus...
2009 Mar 17
1
R freeze when loading dll with dyn.load
Good morning,
I am investigating dll import in R under Windows XP. Using examples I found on the internet, I started with a very simple dll, e.g. including only the basic function:
void
{
*x2 = x*x;
}sqr(doublex, double*x2)
I compiled it as a dll with Eclipse and Cygwin's gcc. It works when I call it with another simple .exe C program, compile with Eclipse and gcc as well. I can do what I want with x2 after I have called the function.
However, R freezes when I try to load it with the followin...
2016 May 19
2
External function resolution: MCJIT vs ORC JIT
...a couple of subtle issues:
>
> (1) On both platforms you'll want to call llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr) at program startup. This makes exported symbols in the main program searchable by RTDyldMemoryManager::getSymbolAddressInProcess (important for making 'sqr' findable on any platform).
>
> (2) On Linux (if I understand correctly) symbols aren't exported from the main process by default, so even if you've called DynamicLibrary::LoadLibraryPermanently, sqr won't show up. To fix this you can add -Wl,export-dynamic to your link line....
2010 Nov 08
1
Exponent of sqr symmetric matrix
...is a square symmetric matrix. The exponent of X is defined by the
matrix limit as following:
exp(X) = lim (I + X/n)^n, note: the limit is from n to infinite.
How can I write R function for the above?
Thank you very much
--
View this message in context: http://r.789695.n4.nabble.com/Exponent-of-sqr-symmetric-matrix-tp3031436p3031436.html
Sent from the R help mailing list archive at Nabble.com.
2016 May 20
0
External function resolution: MCJIT vs ORC JIT
...ubtle issues:
>
> (1) On both platforms you'll want to call
> llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr) at program
> startup. This makes exported symbols in the main program searchable by
> RTDyldMemoryManager::getSymbolAddressInProcess (important for making 'sqr'
> findable on any platform).
>
> (2) On Linux (if I understand correctly) symbols aren't exported from the
> main process by default, so even if you've called
> DynamicLibrary::LoadLibraryPermanently, sqr won't show up. To fix this you
> can add -Wl,export-dynamic...
2016 May 22
1
External function resolution: MCJIT vs ORC JIT
...e of subtle issues:
>>
>> (1) On both platforms you'll want to call llvm::sys::DynamicLibrary::LoadLibraryPermanently(nullptr) at program startup. This makes exported symbols in the main program searchable by RTDyldMemoryManager::getSymbolAddressInProcess (important for making 'sqr' findable on any platform).
>>
>> (2) On Linux (if I understand correctly) symbols aren't exported from the main process by default, so even if you've called DynamicLibrary::LoadLibraryPermanently, sqr won't show up. To fix this you can add -Wl,export-dynamic to your li...
2002 Apr 03
1
optim()
I was having some problems persuading optim() to give me the answers I
wanted,
& simplified down to:
sqr<-function(x){(x+1)^2}
optim(1,sqr)
I accept this is a hammer to crack a nut, but was still expecting the
answer -1.
I got:
$par
[1] -0.8
$value
[1] 0.04
$counts
function gradient
12 NA
$convergence
[1] 0
$message
NULL
so I've obviously misu...
2009 Feb 26
2
[LLVMdev] Impressive performance result for LLVM: complex arithmetic
...gcc on a 2.1GHz Opteron 2352 running
Debian:
gcc: 5.727s
llvm-gcc: 1.393s
There is still 20% room for improvement but LLVM is >4x faster than gcc here.
Sweet.
Here's the code:
#include <stdio.h>
#include <stdlib.h>
#include <complex.h>
int max_i = 65536;
double sqr(double x) { return x*x; }
double cnorm2(complex z) { return sqr(creal(z)) + sqr(cimag(z)); }
int loop(complex c) {
complex z=c;
int i=1;
while (cnorm2(z) <= 4.0 && i++ < max_i)
z = z*z + c;
return i;
}
int main() {
for (int j = -39; j < 39; ++j) {...
2005 Jun 15
0
coding to generate a matrix to prepare for chi-sqr test for text mining
Hi, there:
I have a dataset like the following:
1412|WINDOW|SHATTER|TORN|SOFT|TOP|WATER|RAIN|LAB|AI|BOLL|CAMP|0
1413|PARK|IV|STRUCK|PARK|PUSH|COD|POLICI|CIA|TB|SIC|0
2412|ACCID|REAREND|MULTI|EH|IV|MIDDL|FAN|DUAL|LOSS|CALM|1
2414|IV|REAREND|CD|COG|LAB|ADVERS|1
2415|ACCID|SINGL|VEHICL|IV|SWERV|AVOID|OBJECT|STRUCK|PHONE|POLE|FAN|0
2417|ACCID|SINGL|VEHICL|ROLL|DUE|FATAL|FAN|DUAL|LOSS|CALM|1
2011 Jun 16
0
Update: Is there an implementation of loess with more than 3 parametric predictors or a trick to a similar effect?
...| !D) stop("invalid 'x'")
if(!length(y)) stop("invalid 'y'")
x <- as.matrix(x)
max.kd <- max(N, 200)
robust <- rep(1, N)
divisor<- rep(1, D)
if(normalize && D > 1L) {
trim <- ceiling(0.1 * N)
divisor <-
sqrt(apply(apply(x, 2L, sort)[seq(trim+1, N-trim), , drop = FALSE],
2L, var))
x <- x/rep(divisor, rep(N, D))
}
sum.drop.sqr <- sum(drop.square)
sum.parametric <- sum(parametric)
nonparametric <- sum(!parametric)
order.parametric <- order(parametric)
x &l...
2005 Jun 15
1
coding to generate a matrix to prepare for chi-sqr test f or text mining
...convenient.
Reid Huntsinger
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Weiwei Shi
Sent: Wednesday, June 15, 2005 5:10 PM
To: R-help at stat.math.ethz.ch
Subject: [R] coding to generate a matrix to prepare for chi-sqr test for
text mining
Hi, there:
I have a dataset like the following:
1412|WINDOW|SHATTER|TORN|SOFT|TOP|WATER|RAIN|LAB|AI|BOLL|CAMP|0
1413|PARK|IV|STRUCK|PARK|PUSH|COD|POLICI|CIA|TB|SIC|0
2412|ACCID|REAREND|MULTI|EH|IV|MIDDL|FAN|DUAL|LOSS|CALM|1
2414|IV|REAREND|CD|COG|LAB|ADVERS|1
2415|ACCID|SING...
2009 Feb 27
0
[LLVMdev] Impressive performance result for LLVM: complex arithmetic
...> llvm-gcc: 1.393s
>
> There is still 20% room for improvement but LLVM is >4x faster than gcc here.
> Sweet.
>
> Here's the code:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <complex.h>
>
> int max_i = 65536;
>
> double sqr(double x) { return x*x; }
>
> double cnorm2(complex z) { return sqr(creal(z)) + sqr(cimag(z)); }
>
> int loop(complex c) {
> complex z=c;
> int i=1;
> while (cnorm2(z) <= 4.0 && i++ < max_i)
> z = z*z + c;
> return i;
> }
>
> int...
2003 Aug 12
1
Programme Maxstat
Sirs,
I have recently been interested in your Maxstat. I have computed with my own programme the ranks (by using the Kaplan-Meier method and the log-rank test) with the formula (Observed-Expected)/(SQR Var). The results are similar but not exact to the M value obtained with the Maxstat. I would like to know whether you are using some correction or adjustment in computing the different ranks. Thank you very much for your help.
Dr. C. Rozman
Professor of Medicine, Emeritus
University of Barcelona,...
2008 Jul 08
1
R crash with ATLAS precompiled Rblas.dll on Windows XP Core2 Duo
...curs on the
first iteration of the line:
z <- .C(R_loess_raw, as.double(y), as.double(x),
as.double(weights), as.double(robust), as.integer(D),
as.integer(N), as.double(span), as.integer(degree),
as.integer(nonparametric), as.integer(order.drop.sqr),
as.integer(sum.drop.sqr), as.double(span * cell),
as.character(surf.stat), fitted.values = double(N),
parameter = integer(7), a = integer(max.kd),
xi = double(max.kd), vert = double(2 * D), vval = double((D
+
1...
2004 Aug 06
1
streaming with crossfade
Hi list,
I am just wondering if anyone knows a way to stream with automated
crossfading under Linux.
I know that you can stream to icecast from windows using something like
otsjuke, or WinAmp with the SQR crossfading plugin, but am not aware of
anything for Linux that will allow me to stream with gapless output.
Any suggestions greatly appreciated as always.
2013 Mar 28
2
[LLVMdev] LLVM Execution engine: Native call vs LLVM IR function call
...1 = phi i64 [ 0, %entry ], [ %res, %cont ]
%2 = icmp ugt i64 %0, 1000000001
br i1 %2, label %exit, label %cont
exit: ; preds = %bb1
ret i64 %1
cont: ; preds = %bb1
%3 = add i64 %0, 1
%res = call i64 @sqr(i64 %0)
br label %bb1
}
define i64 @sqr(i64 %arg1) {
entry:
%0 = mul i64 %arg1, %arg1
ret i64 %0
}
=============================================
define i64 @bnative() {
entry:
br label %bb1
bb1: ; preds = %cont, %entry
%0 = phi i64 [ 0, %e...
2004 Jan 20
1
evaluation of discriminant functions+multivariate homosce dasticity
...function [MBox] = BoxMTest(X,alpha)
##
## Inputs:
## X - data matrix (Size of matrix must be n-by-(1+p); sample=column
1,
## variables=column 2:p).
## alpha - significance level (default = 0.05).
## Output:
## MBox - the Box's M statistic.
## Chi-sqr. or F - the approximation statistic test.
## df's - degrees' of freedom of the approximation statistic test.
## P - observed significance level.
##
## If the groups sample-size is at least 20 (sufficiently large),
## Box's M test takes a Chi-square approximation; other...
2000 Apr 28
2
Dumping functions to RCS
To keep track of an ongoing programming project, I would like to dump
all my functions to individual ASCII files named xxx.R, yyy.R, etc.
Presently I do so manually in order to use RCS (on a Linux machine),
so I can keep track of all versions, differences, snapshots, etc.
Is there any easy way to dump all functions in the workspace to
individually named files? Thank you very much for