Displaying 20 results from an estimated 10000 matches similar to: "Assigning value to a vector from within a function"
2008 Sep 04
2
using complete.cases() with nested factors
Hello,
This maybe a newbie question. I have a dataframe that looks like the sample
at the bottom of the email. I have monthly precipitation data from several
sites over several years. For each site, I need to extract years that have
a complete series of 12 monthly precipitation values, while excluding that
year for sites with incomplete data. I can't figure out how to do this
gracefully
2016 Feb 07
3
Assignment in environment
Dear all,
I have a function "fn" with its own environment, i.e.
env <- environment(fn)
and env is not .GlobalEnv. And another function
getValue <- function(x) environment(x)$mylist
which returns the list object "mylist" which is in "env". If I want to
modify "mylist", I could write
'getValue<-' <- function(x, value) {
2016 Feb 07
1
Assignment in environment
> On 07 Feb 2016, at 14:46 , Duncan Murdoch <murdoch.duncan at gmail.com> wrot8[e:
>
[snippage]
>
> but in fact, this doesn't work:
>
> getValue(fn)[[1]] <- 3
> Error in getValue(fn)[[1]] <- 3 : could not find function "getValue"
>
> I suspect this is a parser problem.
Umm, no...
The canonical semantics are that
foo(x)[[....]] <- bar
2008 Feb 09
4
[LLVMdev] tblgen and sign-extended constants too large for type
Question: How hard should tblgen try to fit constants into a particular
type?
My case is an xor with i8 immediate where I'm using 0xff in as the
immediate value. 0xff should fit into i8 if treated as unsigned, but
CodeGenDAGPatterns.cpp assumes that any and all integers less than
32-bits are signed.
Should tblgen try to see if the sign-extended version of the constant
could fit into the
2013 Jun 25
4
[LLVMdev] get value
Hi Cristianno,
Thank you, it works :)
with an extra cast:
Value *v ......
ConstantInt* RR = (ConstantInt *)v;
uint64_t VV = (RR->getValue()).getLimitedValue();
errs()<<"\nRR "<<VV<<"\n";
2008 Sep 09
2
isolate elements in vector that match one of many possible values
Hi all,
I want to get the index numbers of all elements of a vector which match any
of a long series of possible values. Say x <- c(1,2,3,4) and I want to know
which values are equal to 1, 2 or 4. I could do
which(x == 1 | x==2 | x==4)
[1] 1 2 4
This gets really ugly though, when the list of values of interest is really
long. Is there a nicer way to do this? Something akin to the MySQL
2008 Sep 12
3
[LLVMdev] Difficulty with reusing DAG nodes.
I'm trying to implement *MUL_LOHI for my processor.
My processor has mulxss (e.g.) that gives the 32 high bits of a 64 bit
multiply.
I tried this in ios2ISelDAGToDAG.cpp:
/// Mul/Div with two results
case ISD::SMUL_LOHI:
case ISD::UMUL_LOHI: {
SDValue Op1 = Node->getOperand(0);
SDValue Op2 = Node->getOperand(1);
AddToISelQueue(Op1);
2011 Nov 19
0
[LLVMdev] How to make Polly ignore some non-affine memory accesses
On 11/18/2011 01:34 PM, Marcello Maggioni wrote:
> Ok , this is what I believe is the final patch that adds the
> non-affine accept functionality to Polly, this should have no issues.
>
> I added three tests, two in ScopInfo (two simple tests, one expected
> fail and one success based on the same source) and one in CodeGen that
> verifies that the code is generated.
>
> The
2005 Jan 31
2
coercing a list to a data frame, lists in foreloops
I have a set of time-series climate data with missing entries. I need to add
rows for these missing entries to this data set. The only way I know to do
this is unsing a foreloop, but this won't work on a list. I've tried to
convert the list to a data frame, but that won't happen, either.
I want to fill rows in this table:
> newtest[10:15,]
yrmos yearmo snow.sum snow.mean
2011 Dec 20
4
[LLVMdev] Proposal for -filetype=obj full big endian support
Proposal for ELF text and data big endian support for direct object generation
Unless I am mistaken, currently big endian support in the MC layer for ELF
direct object generation is limited to ELF headers and tables like relocations.
Text and data section contents are still generated as individual bytes.
It looks as if the effort was started, but never completed.
The proposal is to extend the
2013 Jun 25
0
[LLVMdev] get value
Oops, that's true: I forgot about that XD sorry =)
Glad I could help,
--
Cristianno Martins
PhD Student of Computer Science
University of Campinas
cmartins at ic.unicamp.br
<cristiannomartins at hotmail.com>
On Tue, Jun 25, 2013 at 4:38 AM, Alexandru Ionut Diaconescu <
cyrusthevirus001x at yahoo.com> wrote:
> Hi Cristianno,
>
> Thank you, it works :)
>
> with
2011 Jul 13
2
[LLVMdev] overflow check
Hi,
I have three constants (B, C and V) and V = B + C. I want to find out if B +
C wraps around. The way I'll do it is, assuming B and C are both positive,
to check if V < B or C.
For this I need the values of B, C and V. I tried using APInt as below.
***
If (isa<Constant> (B) && isa<Constant> (C) && isa<Constant>(V)) {
ConstantInt *CV =
2005 May 22
3
comparison operator, decimals, and signif()
Hi, I recently spent quite a bit of time trouble
shooting a function that I had written only to
discover that the problem I was having was with the
comparison operator. I assumed that the following
would return TRUE:
> testMean <- 82.8 + 0.1
> testMean
[1] 82.9
> testMean == 82.9
[1] FALSE
Apparently this has to do with deciml places. Look:
> newTest <- 82.0
> newTest
[1]
2013 Jun 26
0
[LLVMdev] get value
Alexandru Ionut Diaconescu wrote:
> Hi Cristianno,
>
> Thank you, it works :)
>
> with an extra cast:
> Value *v ......
> ConstantInt* RR = (ConstantInt *)v;
Please use "cast<ConstantInt>(v)" instead. See
http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates
.
Nick
> uint64_t VV = (RR->getValue()).getLimitedValue();
>
2011 Dec 20
0
[LLVMdev] Proposal for -filetype=obj full big endian support
Hi Jack,
Everything should be already using the sized Emit* routines directly rather than outputting individual bytes of larger entities piecemeal. Have you found that not to be the case?
The Emit* routines handle endianness for you, so you shouldn't have to do much beyond that. For example, here's the EmitInvValue() implementation that underlies things and does the endianness transform:
2007 Aug 10
1
[Fwd: Re: How to apply functions over rows of multiple matrices]
[Apologies to Gabor, who I sent a personal copy of the reply
erroneously instead of posting to List directly]
[...]
> Perhaps what you really intend is to
> take the average over those elements in each row of the first matrix
which correspond to 1's in the second in the corresponding
> row of the second. In that case its just:
>
> rowSums(newtest * goldstandard) /
2005 May 03
2
[LLVMdev] VC++ build broken
The recently added code:
static Constant *Div(const ConstantClass *V1, const ConstantClass *V2) {
if (V2->isExactlyValue(0.0)) return ConstantClass::get(*Ty, INFINITY);
if (V2->isExactlyValue(-0.0)) return ConstantClass::get(*Ty, -INFINITY);
if (V2->isNullValue()) return 0;
BuiltinType R = (BuiltinType)V1->getValue() /
(BuiltinType)V2->getValue();
return
2011 Dec 20
2
[LLVMdev] Proposal for -filetype=obj full big endian support
Jim,
I see routines that are already available to do the endianizing, but the data and text section contents don't have sizing for the individual elements as far as I can see so that I can endianize them. That is the part I am trying to solve, not the bit twiddling algorithm.
Did I miss something?
Jack
________________________________________
From: Jim Grosbach [grosbach at apple.com]
Sent:
2009 Jan 30
1
problem using identify() after plot()
I can't seem to use the point-and-click identify() function properly.
I'm running R 2.5.1 (I know, I need to get around to upgrading) under
Win XP. The problem is, when I click on a point on the graph, I get an
error, "no point within 0.25 inches." But in some areas, I can click
where there is no visible point anywhere close, and an identify() label
will pop up. The troublesome
[llvm] r322838 - [ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
2018 Jan 24
2
[llvm] r322838 - [ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
Hey Ben,
This change broke some clangd code (no failing test, mea culpa), because it
changed the move semantics.
Previously: a moved-from llvm::Optional was None (for all types).
Now: a moved-from llvm::Optional is None (for non-trivial types), and has
the old value (for trivial types).
FWIW, a moved-from std::optional is *not* nullopt, and contains the
moved-from value.
This seems sad to me,