Displaying 20 results from an estimated 52 matches for "twos".
Did you mean:
two
2010 Feb 18
2
Funny result from rep(...) procedure
...ni = 5 on 1st pass
[1] 5 1 1 1 1 1 # five values - 1 1 1 1 1 - OK
# second pass through loop
[1] 6 7 8 9 10 11 # branches[2] + iInd - 1 content
[1] 2 # i value to repeat 6 times
[1] 6 # ni = 6 on 2nd pass
[1] 6 2 2 2 2 2 # 6 'twos' but only shows 5 'twos'
print(c(ni,rep(i,times=ni))) - why not 6?
--
View this message in context: http://n4.nabble.com/Funny-result-from-rep-procedure-tp1560547p1560547.html
Sent from the R help mailing list archive at Nabble.com.
2001 Jun 12
2
a problem with rep() ?
Colleagues
----------------------------------
System info:
Version 1.2.3 (2001-04-26) on NT
ESS v. 5.1.18 using emacs ver. 20.4
----------------------------------
I am wondering if there is a problem with the function rep(). Both the
commands using rep() below were expected to produce 8 twos, but only
the second did.
x <- rep(2,40*(1-0.8))
length(x)
y <- rep(2,40*0.2)
length(y)
Have I misused the function? Should the second argument of rep() be
limited to a single number or a vector of the same length as the first
argument as it documents in the help? Or is this a bug?...
2009 Jul 23
3
Counter
Hi everyone,
Is there any counter function in R for the following purpose:
x <- matrix(c(1,1,0,2,1,0,0,2,0,1,2,1,2,1,0,1),nrow=4)
As I would like to know how many zeros, ones, and twos in each row of x?
Many thank in advance,
Amor
[[alternative HTML version deleted]]
2018 Sep 17
1
Re: [PATCH nbdkit v2] common: Introduce round up, down; and divide round up functions.
...*/
> +#define ROUND_DOWN(i, n) ({ \
> + assert (is_power_of_2 (n)); \
> + (i) & ~((n) - 1); \
> +})
And again.
Also, ~((n)-1) is identical to -(n), if you want less typing (well, as
long as you assume twos-complements signed numbers, but that's pretty
safe to assume these days).
> +
> +/* Return n / d, rounding the result up to the next integer. */
> +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
This one should be okay, though.
> +++ b/filters/truncate/truncate.c
> @@ -46...
2015 Feb 05
7
[LLVMdev] i1 Values
...an
assert in APInt to catch what I think is the source of the problem:
int64_t getSExtValue() const {
// An i1 -1 is unrepresentable.
assert(BitWidth != 1 && "Signed i1 value is not representable!");
To me an i1 -1 makes no sense whatsoever. It is not representable in
twos-complement form. It cannot be distinguished from unsigned i1 1.
It turns out this assert triggers all over the place. Before I dive
into this rat hole I'd like to confirm with others my sense that we
shouldn't be creating i1 -1 values. Is there some legitimate reason to
do so?...
2008 Aug 22
0
[LLVMdev] Dependence Analysis [was: Flow-Sensitive AA]
...ple, the compiler will
assume that an expression like "i + 10 > i" will always be
true for signed "i". This
assumption is only valid if signed overflow is undefined,
as the expression is false
if "i + 10" overflows when using twos complement
arithmetic. When this option is in
effect any attempt to determine whether an operation on
signed numbers will overflow
must be written carefully to not actually involve overflow.
See also the -fwrapv option. Using -fwrapv means that
signed ov...
2009 Nov 16
3
Sum over indexed value
I am sure this is easy but I am not finding a function to do this.
I have two columns in a matrix. The first column contains multiple entries
of numbers from 1 to 100 (i.e. 10 ones, 8 twos etc.). The second column
contains unique numbers. I want to sum the numbers in column two based on
the indexed values in column one (e.g. sum of all values in column two
associated with the value 1 in column one). I would like two columns in
return - the indexed value in column one (i.e. this time...
2010 Apr 07
2
Creating two lines of best fit on a scatter plot
...on a scatter plot.
I'm plotting number of visits (y) against personality (x), half the
plots are blue for patchchoice one and the other plots are red for
patchchoice two (these options come from one factor, see below) . So i
need a line for the patch ones and another line for the patch twos.
How would i go about doing this? I know i may need to use the subset
command, but I'm not entirely sure how to do this as I am relatively
new to R
example of data
birdid timetaken numvisits ptachchoice time bold
1087 8 10 1 AM 0
1087 28...
2017 Aug 24
2
How do set 'nest' addribute in an indirect call?
...ibute::AttrKind attr);
Is 'i' the number of the parameter that gets the attribute? This matters for 'nest'.
Is it zero-origin numbering, left-to-right?
I have an out-of-tree binding already for a small set of things not in Core.h,
and it's not hard to add things in ones & twos.
>
> Cheers.
>
> Tim.
>
--
Rodney Bates
rodney.m.bates at acm.org
2011 Feb 14
2
Is there a way to force counters to be treated as "unsigned?"
...the counters to (unsigned) before calculating the difference, then casts
the result as (int). Subject to the constraint that this trick only
works if the system doing the calculation has the same size "int" as the
target system, and assumes that negative numbers are represented in
"twos-complement" form, it works well enough.
[E.g., suppose we are using 4-bit counters, 0 .. 15]. If a counter
at T0 is (say) 14 and the value of the counter at T1 is (say) 3,
the usual arithmetic would say that the difference is
3 - 14 => -11
But if we (instead) calculate
(int)((unsigne...
2012 Aug 05
1
trouble with looping for effect of sampling interval increase
...to it, that contains counters. Those
counters will look something like 1,2,1,2,.. for the first one,
1,2,3,1,2,3.. for the next one. I have a lot of them, like say a thousand...
Then for each column in the index my loops should start in the first column,
run only the ones, store that, then run the twos, and store that in the same
column of output in a different row. Then move to the next column run the
ones, store in the next column of output, run the twos, store in the next
row of that column, run the threes, etc on out until there is no more. I
want to use this index for a number of reasons. Th...
2013 Nov 25
2
[LLVMdev] How do downcast signed integers?
I was looking at "trunc" to downcast a signed integer, say sint32 to
sint16, but it seems to handle unsigned integers only. How do you downcast
a signed integer?
P.S. This question is for my "Mapping High-Level Constructs to LLVM IR"
document :-)
-- Mikael
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2013 Nov 25
0
[LLVMdev] How do downcast signed integers?
Hello
> I was looking at "trunc" to downcast a signed integer, say sint32 to sint16,
> but it seems to handle unsigned integers only.
No. In twos-complement notation (which LLVM assumes) there no
difference between signed and unsigned truncation - you just throw out
the spare sign bits and that's all.
Please note that that the "numbers" in LLVM IR is neither signed nor
unsigned. They are just raw bits. It's up to the instr...
2006 May 26
2
question about coding
John Miles wrote:
> You'll definitely have to encode in little-endian form. PCM audio is always
> little-endian, to the best of my knowledge. I have never seen any
> big-endian audio data files.
Try AIFF, AU and IFF just for starters. They are definietly not the
only ones.
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
2008 Feb 21
1
Permutation Test
...ut how many possible
permutations there can be in this instance is: N! / (n1!) (n2!) (n3!)...
(ni!). Where N is the number of taxa (14) and (for character 2) n1 could be
'number of state zeros' (i.e., 2), n2 could be 'number of state ones' (i.e.,
2), n3 could be 'number of state twos (i.e., 1) etc?
Any help would be greatly appreciated. Thanks a lot.
Steve
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Steven Worthington
PhD Candidate
New York Consortium
in Evolutionary Primatology
New York, NY 10003
USA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
View this message in context: http://www....
2016 Feb 27
0
[isocpp-parallel] Proposal for new memory_order_consume definition
...cKenney" <paulmck at linux.vnet.ibm.com>
wrote:
>
>
> But we do already have something very similar with signed integer
> overflow. If the compiler can see a way to generate faster code that
> does not handle the overflow case, then the semantics suddenly change
> from twos-complement arithmetic to something very strange. The standard
> does not specify all the ways that the implementation might deduce that
> faster code can be generated by ignoring the overflow case, it instead
> simply says that signed integer overflow invoked undefined behavior.
>
>...
2003 Feb 25
1
summary(polr.object)
...roups, and is the p-value for the two-sided test thus
2* (1-pt(5.8936612, df=shade.polr$df.residual))
Why is the p-value not reported? Is there a special reason that would be
good to know?
Furthermore is t = -8.6500 in
2|3 -2.2975 0.2656 -8.6500
for a test of difference in the proportion of twos and threes between the
two levels of the independet factor?
Is the p-value: 2* (1-pt(8.6500, df=shade.polr$df.residual))?
Thanks in advance!
Sincerely,
Tord Sn?ll
-----------------------------------------------------------------------
Tord Sn?ll
Avd. f v?xtekologi, Evolutionsbiologiskt centru...
2016 Feb 27
4
[isocpp-parallel] Proposal for new memory_order_consume definition
...antics change>" is, in my opinion, not
> acceptable standards text.
Hmmm...
But we do already have something very similar with signed integer
overflow. If the compiler can see a way to generate faster code that
does not handle the overflow case, then the semantics suddenly change
from twos-complement arithmetic to something very strange. The standard
does not specify all the ways that the implementation might deduce that
faster code can be generated by ignoring the overflow case, it instead
simply says that signed integer overflow invoked undefined behavior.
And if that is a proble...
2008 Aug 22
5
[LLVMdev] Dependence Analysis [was: Flow-Sensitive AA]
On Aug 22, 2008, at 9:30 AM, Vikram S. Adve wrote:
> In the general case, I think you have to be conservative about this
> because programmers may deliberately want this kind of "wraparound"
> behavior, e.g., with periodic boundary conditions. But 99.9% of
> programs probably don't need that so it would be bad to penalize them
> for this corner case. In such a
2016 Feb 27
2
[isocpp-parallel] Proposal for new memory_order_consume definition
...vnet.ibm.com>
> wrote:
> >
> >
> > But we do already have something very similar with signed integer
> > overflow. If the compiler can see a way to generate faster code that
> > does not handle the overflow case, then the semantics suddenly change
> > from twos-complement arithmetic to something very strange. The standard
> > does not specify all the ways that the implementation might deduce that
> > faster code can be generated by ignoring the overflow case, it instead
> > simply says that signed integer overflow invoked undefined beha...