search for: ifthen

Displaying 20 results from an estimated 40 matches for "ifthen".

2008 Sep 27
2
[LLVMdev] SwitchInstr::removeCase() doesn't remove PHINodes' predecessors
Hi, I've been writing an optimization pass (described on the ML previously). Sometimes this pass removes some case entries from switch instructions, which cause an abort because removeCase() doesn't fix the PHINodes predecessors when needed. e.g.: define i32 @foo() nounwind { ifthen: %call = call i32 @bar() switch i32 %call, label %myphi [ i32 0, label %ifelse i32 1, label %ifelse ] ifelse: br label %myphi myphi: %ret.0 = phi i32 [ 0, %ifthen ], [ 1, %ifelse ] ret i32 %ret.0 } Suppose I remove the default target (i.e. replace it with other target BB). I get the...
2010 Mar 04
1
ifthen() question
Hi All, I am using a specialized aggregation function to reduce a dataset with multiple rows per id down to 1 row per id. My function work perfect when there are >1 id but alters the 'var.g' in undesirable ways when this condition is not met, Therefore, I have been trying ifthen() statements to keep the original value when length of unique id == 1 but I cannot get it to work. e.g.: #function to aggregate effect sizes: aggs <- function(g, n.1, n.2, cor = .50) { n.1 <- mean(n.1) n.2 <- mean(n.2) N_ES <- length(g) corr.mat <- matrix (rep(cor, N_ES^2),...
2010 Mar 04
0
ifthen() question -- whoops--ifelse()
...gt; > I am using a specialized aggregation function to reduce a dataset with > multiple rows per id down to 1 row per id. My function work perfect when > there are >1 id but alters the 'var.g' in undesirable ways when this > condition is not met, Therefore, I have been trying ifthen() statements to > keep the original value when length of unique id == 1 but I cannot get it to > work. e.g.: > > #function to aggregate effect sizes: > aggs <- function(g, n.1, n.2, cor = .50) { > n.1 <- mean(n.1) > n.2 <- mean(n.2) > N_ES <- length(g) >...
2008 Oct 03
1
Error message in ifthen else
Hi, I came across the below error when I try to do ifelse condition:- Error in "[<-"(`*tmp*`, test, value = rep(yes, length = length(ans))[test]) : incompatible types What I am trying to accomplish is :- for(x in 1:ncol(filterpred)){ sumno<-sum(filterpred[no,x]) sumyes<-sum(filterpred[yes,x]) ifelse(sumno==0 && sumyes !=0,
2005 Sep 23
1
Minor idea - "Press any key to boot within 5 second" style of thing...
I like how some cds, such as the windows installer discs will skip booting from the disc if you accidentally left the drive because they require you to hit a key to make them actually boot from the disc. I've kind of tried to emulate this behavior using chain.c32, but, it requires me to specify which harddrive, and I'd rather see an independant setup. I've tried localboot -1, but, it
2008 Sep 27
0
[LLVMdev] SwitchInstr::removeCase() doesn't remove PHINodes' predecessors
Nuno Lopes wrote: > PHINode should have one entry for each predecessor of its parent basic > block! > %ret.0 = phi i32 [ 0, %ifthen ], [ 1, %ifelse ] ; <i32> > [#uses=1] > Broken module found, compilation aborted! > > This is because myphi is not reachable from ifthen anymore. My question is: > is this a bug (or missing feature) or do I need to take care of the PHI > Nodes myself? You get to...
2008 Aug 12
4
[LLVMdev] Eliminating gotos
...t; structured control flow, eg. If and while. What's the difference between an "if" and a conditional branch? [bg] Consider the LLVM code: define i32 @foo(i32 %x, i32 %y) { entry: %tobool = icmp eq i32 %x, 0 ; <i1> [#uses=1] br i1 %tobool, label %ifelse, label %ifthen ifthen: ; preds = %entry %add = add i32 %x, 10 ; <i32> [#uses=1] ret i32 %add ifelse: ; preds = %entry %call = tail call i32 (...)* @bar( ) ; <i32> [#uses=0] ret i32 %y } We cannot express this as it uses the conditional branch br but apply...
2008 Aug 12
0
[LLVMdev] Eliminating gotos
On Aug 11, 2008, at 2:02 PM, Benedict Gaster wrote: > We would like to develop a code generator using LLVM for a target > language that does not support conditional branches and in fact only > supports structured control flow, eg. If and while. What's the difference between an "if" and a conditional branch? > As far as I can tell that the problem with doing this in
2008 Aug 11
3
[LLVMdev] Eliminating gotos
We would like to develop a code generator using LLVM for a target language that does not support conditional branches and in fact only supports structured control flow, eg. If and while. As far as I can tell that the problem with doing this in LLVM today, is that it does not support these high-level constructs and instead all control flow is implemented as branches. It is ³fairly²
2008 Nov 10
2
[LLVMdev] Invalid comparison instruction generation
...lt, double addrspace(11)** %result.addr %tmp = load double* %x.addr ; <double> [#uses=1] %tmp1 = load double* %y.addr ; <double> [#uses=1] %cmp = fcmp ogt double %tmp, %tmp1 ; <i1> [#uses=1] br i1 %cmp, label %ifthen, label %ifend ifthen: ; preds = %entry %tmp2 = load double addrspace(11)** %result.addr ; <double addrspace(11)*> [#uses=1] %tmp3 = load double* %x.addr ; <double> [#uses=1] store double %tmp3, double addrspace(11)* %tmp2 br lab...
2009 Jun 26
0
Modifying Sweave.sty to allow escapes with fancyvrb package in LaTeX
...erly change Sweave.sty to allow it to use fancyvrb in this way? I am following the model in SweaveListingUtils for having Sweave use the listings package to do pretty-printing. Thanks very much Frank Sweavel.sty: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{Sweavel}{} \RequirePackage{listings,ifthen,graphicx,fancyvrb,relsize} \RequirePackage{ifthen} \newboolean{Sweave at gin} \setboolean{Sweave at gin}{true} \newboolean{Sweave at ae} \setboolean{Sweave at ae}{true} \DeclareOption{nogin}{\setboolean{Sweave at gin}{false}} \DeclareOption{noae}{\setboolean{Sweave at ae}{false}} \ProcessOptions...
2007 Jun 21
1
generating a new variable based on results of a by command
..."F","A") f <-data.frame(e,a,b) # Calculate sum by group sums <- by(f, e, function(x) sum(x$b)) ----------- Now I would like to assign each observation in f a new variable based on the results of the by(). I converted sums into a matrix and then tried using match() and ifthen() but could not get it to work. Thanks, EG [[alternative HTML version deleted]]
2008 Aug 12
0
[LLVMdev] Eliminating gotos
On Aug 12, 2008, at 2:39 AM, Benedict Gaster wrote: > [bg] Consider the LLVM code: > > define i32 @foo(i32 %x, i32 %y) { > entry: > %tobool = icmp eq i32 %x, 0 ; <i1> [#uses=1] > br i1 %tobool, label %ifelse, label %ifthen > > ifthen: ; preds = %entry > %add = add i32 %x, 10 ; <i32> [#uses=1] > ret i32 %add > > ifelse: ; preds = %entry > %call = tail call i32 (...)* @bar( ) ; <i32> [#uses=0] > ret i32 %y > } SNIP > define i32 @foo...
2012 Apr 04
3
Rgui maintains open file handles after Sweave error
...@ \caption{test figure one} \label{fig:one} \end{center} \end{figure} \end{document} Sweave command run: Sweave("test.Rnw", syntax="SweaveSyntaxNoweb") Sweave.sty: \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{Sweave}{} \RequirePackage{ifthen} \newboolean{Sweave at gin} \setboolean{Sweave at gin}{true} \newboolean{Sweave at ae} \setboolean{Sweave at ae}{true} \DeclareOption{nogin}{\setboolean{Sweave at gin}{false}} \DeclareOption{noae}{\setboolean{Sweave at ae}{false}} \ProcessOptions \RequirePackage{gr...
2000 Jun 28
1
Rd2dvi
...bel <v3.6k> and hyphenation patterns for american, french, german, ngerman, nohyphenation, loaded. (/usr/share/texmf/tex/latex/base/book.cls Document Class: book 1999/01/07 v1.4a Standard LaTeX document class (/usr/share/texmf/tex/latex/base/bk10.clo)) (Rd.sty (/usr/share/texmf/tex/latex/base/ifthen.sty) ... (/usr/share/texmf/tex/latex/base/makeidx.sty) Writing index file Rd2.idx No file Rd2.aux. (/usr/share/texmf/tex/latex/ae/t1aess.fd) ! Missing $ inserted. <inserted text> $ l.12 \Header{00General_Description}{Syskern} ? ! Extra }, or forgotten $. <recently read>...
2009 Mar 17
1
Combining Sweave and fancyvrb
I find Sweave very useful and I was trying to combine it with the latex package fancyvrb. I was trying to get line numbering and labels in order to reference the lines where particular commands occur. Unfortunately, I haven't been able to figure out how to do it. Maybe somebody can help me. The following is a sample Rnw file: the first part shows what I would like to get, the second what I
2002 Jul 17
2
Problems with make pdf (R-patched_2002-07-15.tar.gz)
...n patterns for american, french, german, ngerman, n ohyphenation, loaded. (refman.tex (/usr/share/texmf/tex/latex/base/book.cls Document Class: book 2000/05/19 v1.4b Standard LaTeX document class (/usr/share/texmf/tex/latex/base/bk10.clo)) (../../share/texmf/Rd.sty (/usr/share/texmf/tex/latex/base/ifthen.sty) (many other /usr/share/texmf/tex/latex/base/...) Implicit mode ON; LaTeX internals redefined (/usr/share/texmf/tex/latex/hyperref/backref.sty)) *hyperref using default driver hpdftex* (/usr/share/texmf/tex/latex/hyperref/hpdftex.def ... Writing index file refman.idx No file refman.aux. (/us...
2005 Jun 16
1
Sweave and sideways
...ubsection=\count81 \c at subsubsection=\count82 \c at paragraph=\count83 \c at subparagraph=\count84 \c at figure=\count85 \c at table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (C:\texmf\tex\latex\sweave\Sweave.sty Package: Sweave (C:\texmf\tex\latex\base\ifthen.sty Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC) ) (C:\texmf\tex\latex\base\fontenc.sty Package: fontenc 2004/02/22 v1.99f Standard LaTeX package (C:\texmf\tex\latex\base\t1enc.def File: t1enc.def 2004/02/22 v1.99f Standard LaTeX file LaTeX Font Info: Redeclaring font en...
2008 Jun 13
4
Sweave: looping over mixed R/LaTeX code
...to me. Is there a better way to do this? I have tried to do my homework, see below. Do I get partial credit ;-) ? Thank you all for your time! Stephan ######################################### I can't simply start a for loop within an R chunk and finish it in another one. whiledo in the ifthen.sty package doesn't like Sweave at all. And of course, it would simply reuse the R chunks if it did work, without changing things between loops. For the same reason, I cannot define a \newcommand{\loopcontent}{...} with the entire loop contents and then simply write \loopcontent \loopcontent .....
2013 Jan 29
1
Sweave files generating miktex errors
...bian, usengl ishmax, welsh, loaded. (c:\miktex2.9.4757\tex\latex\ base\article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (c:\miktex2.9.4757\tex\latex\base\size10.clo)) ("C:\Documents and Settings\v\My Documents\Sweave.sty" (c:\miktex2.9.4757\tex\latex\base\ifthen.sty) (c:\miktex2.9.4757\tex\latex\graphics\graphicx.sty (c:\miktex2.9.4757\tex\latex\graphics\keyval.sty) (c:\miktex2.9.4757\tex\latex\graphics\graphics.sty (c:\miktex2.9.4757\tex\latex\graphics\trig.sty) (c:\miktex2.9.4757\tex\latex\00miktex\graphics.cfg) (c:\miktex2.9.4757\tex\latex\pdftex-def\pd...