Displaying 20 results from an estimated 25 matches for "subarrays".
Did you mean:
subarray
2005 Apr 29
2
Subarrays
Define an array
> v<-1:256
> dim(v)<-rep(4,4)
Subarrays can be obtained as follows:
> v[3,2,,2]
[1] 71 87 103 119
> v[3,,,2]
[,1] [,2] [,3] [,4]
[1,] 67 83 99 115
[2,] 71 87 103 119
[3,] 75 91 107 123
[4,] 79 95 111 127
In the general case this procedure is very tedious.
Given an array
A, dim(A)=(dim_1,dim_2,.....
2006 Oct 19
2
arraytake for extracting subarrays from multidimensional arrays
...intermediates, which were not
memory efficient enough for me. apltake in the magic package was the closest
but it only allowed subsetting of contiguous indices from either the first
or last element in any given dimension. It was certainly possible to call
apltake multiple times to extract arbitrary subarrays via combinations of
index intervals for each dimension, and then combine them with abind as
necessary, but this did not seem elegant.
Anyway, I then decided to simply generate code with parse and eval. I found
this post by Henrik Bengtsson which had the same idea:
http://tolstoy.newcastle.edu.au/...
2010 Dec 16
1
Subarray specification problem
Hi. I'm new to R, and I'm still learning R's system for addressing
subsets of data structures. I'm particularly interested in the
problem of selecting subarrays based on complex criteria involving the
dimnames (as opposed to the values of the cells) of the array. Here's
an example of such a problem.
Suppose I have an array x of unknown dimensions (it may have been
passed as the argument to a function I'm coding), but I know that one
of its dimens...
2010 Mar 18
2
how to take multiple subsets from a matrix
...16,23)
> dat[miss] <- NA
> mat <- matrix(dat,5,5)
> mat
[,1] [,2] [,3] [,4] [,5]
[1,] 3 9 3 NA 2
[2,] NA 2 13 4 7
[3,] 1 NA 1 6 NA
[4,] 9 6 4 10 5
[5,] 12 NA 8 11 10
I define a multidimensional array to hold the 9 subarrays I want:
> subarray <- array(0,dim=c(3,3,9))
I want to populate each 3x3 array within subarray with the value from mat,
taking the values from mat to be the center values of each array,
respectively. so, excluding the edges of mat, there are 9 values to build
3x3 arrays from: 2,13,4,NA,1,6,6...
2010 Mar 16
2
Help running a Fortran subroutine from R
useR's,
I need help getting a Fortran DLL successfully returning the correct output.
The attached fortran source code (filter2d.f) and DLL (filter2d.dll) are
attached. Also, I attached a text file for which I want to apply the filter
to (time702.txt).
Here is what I am doing...
> dyn.load("C:/f/NEW/filter2d.dll")
> is.loaded("filter2d")
[1] TRUE
Then I pass the
2008 Jun 18
1
subarray
Hello everyone,
I am trying to subset a matrix with the following code:
dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt",header=T,row.names=1)
file.show(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt")
Z.matrix<-as.matrix(dat)
Y<-array(dat,dim(,[46:63])
but I keep getting the error message: error in dim
2004 Aug 23
3
idea for "virtual matrix/array" class
...the object on disk could
possibly be the standard serialized binary format as used in .RData
files. Of course, if the object was larger than would fit in memory, then
trying to extract too large a subarray would exhaust memory, but it should
be possible to efficiently extract reasonably sized subarrays. To be more
useful, one would want want apply() to work with such arrays. That would
be doable, either by creating a new method for apply, or possibly just for
aperm.
Some difficulties that might arise could have to do with functions like
"typeof" and "mode" and "sto...
2006 Aug 01
2
Indexing issue
Hi,
R is having the following weird behavior and I am not sure if that is a
feature or a bug:
I am working on the following "3D" array:
> bIm
, , 1
[,1]
[1,] TRUE
[2,] TRUE
[3,] TRUE
[4,] TRUE
[5,] TRUE
> class(bIm)
[1] "array"
> dim(bIm)
[1] 5 1 1
When I try to get the first 2D subarray, the whole thing folds into a
vector:
> bIm[,,1]
[1] TRUE TRUE TRUE
2007 Nov 24
1
ragged array with append
I wonder what's the right way in R to do the following -- placing
objects of the same kind together in subarrays of varying length.
Here's what I mean:
> word <- c("a","b","c","d","e","f","g","h","i","j")
> kind <- c(1,1,1,2,3,4,5,5,7,7)
> d <- data.frame(word,kind)
> d
word...
2006 Aug 11
2
Array#chunk method, maybe someone will find this useful
...rying to loop through an activerecord
result array and determine how to handle displaying a specific # of
items per row and what to do when you have an odd number of elements
on the last row? it can get ugly.
Array.chunk might be for you.
this method takes an array and breaks it out into smaller subarrays of
a specified size.
@photos = Photo.find(:all).
say you had 12 photos returned...chunk would break your array of
photos up into ''chunks'' of 5 elements each adding nil objects to fill
in the empty elements, so you would end up with
[[p1, p2, p3, p4, p5], [p6, p7, p8, p9, p10],...
2009 Feb 01
1
[LLVMdev] Aliasing (was Performance vs other VMs)
...because I consider it to
represent how fast my LLVM-based VM might be compared to other garbage
collected VMs.
However, LLVM has a serious disadvantage compared to the other VMs here
because it does not have aliasing assurances. For example, it does not know
about array aliasing, e.g. that the subarrays in the successive
over-relaxation test cannot overlap.
The LLVM 2.1 release notes say that llvm-gcc got alias analysis and understood
the "restrict" keyword but when I add it to the C code for SciMark2 it makes
no difference. Can anyone else get this to work?
--
Dr Jon Harrop, Flyin...
2012 May 19
0
Re: [RFC PATCH 0/7] bcache: md conversion
Dan Williams wrote:
> The consensus from LSF was that bcache need not invent a new interface
> when md and dm can both do the job. As mentioned in patch 7 this series
> aims to be a minimal conversion. Other refactoring items like
> deprecating register_lock for mddev->reconfig_mutex are deferred.
>
> This supports assembly of an already established cache array:
>
>
2010 Dec 18
0
What's wrong with these mail headers?
When moderating this message just now I forwarded it to
r-help-owner, for discussion.
In reply to Roy's question, there is indeed nothing obvious
which should "match a filter rule". However, the ETHZ spam
filter is somewhat sensitive about gmail, regardless of true
content, and there are 4 occurrences of "gmail.com", which
may have been responsible for it.
Looking at the
2009 Feb 01
0
[LLVMdev] Performance vs other VMs
This is not a quite fair comparison. Other virtual machines must be
doing garbage collection, while LLVM, as it is using C code, it is
taking advantage of memory allocation by hand.
On Fri, Jan 30, 2009 at 9:56 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
>
> The release of a new code generator in Mono 2.2 prompted me to benchmark the
> performance of various VMs using the
2004 Sep 15
2
efficient submatrix extraction
Hi,
I have a matrix of say 1024x1024 and I want to look at it in chunks.
That is I'd like to divide into a series of submatrices of order 2x2.
| 1 2 3 4 5 6 7 8 ... |
| 1 2 3 4 5 6 7 8 ... |
| 1 2 3 4 5 6 7 8 ... |
| 1 2 3 4 5 6 7 8 ... |
...
So the first submatrix would be
| 1 2 |
| 1 2 |
the second one would be
| 3 4 |
| 3 4 |
and so on. That is I want the matrix to be evenly divided
2019 Jul 21
6
[RFC] A new multidimensional array indexing intrinsic
Hello,
We would like to begin discussions around a new set of intrinsics, to
better express
multi-dimensional array indexing within LLVM. The motivations and a
possible design
are sketched out below.
Rendered RFC link here
<https://github.com/bollu/llvm-multidim-array-indexing-proposal/blob/master/RFC.md>
Raw markdown:
# Introducing a new multidimensional array indexing intrinsic
## The
2009 Jan 30
5
[LLVMdev] Performance vs other VMs
The release of a new code generator in Mono 2.2 prompted me to benchmark the
performance of various VMs using the SciMark2 benchmark on an 8x 2.1GHz
64-bit Opteron and I have published the results here:
http://flyingfrogblog.blogspot.com/2009/01/mono-22.html
The LLVM results were generated using llvm-gcc 4.2.1 on the C version of
SciMark2 with the following command-line options:
llvm-gcc
2019 Jul 22
2
[RFC] A new multidimensional array indexing intrinsic
> It seems that the main advantage of your proposal is that it would allow for non-constant strides (i.e. variable length arrays) in dimensions other than the first one. Do these appear frequently enough in the programs that you're interested in to be worth optimizing for?
Yes - at least in Chapel (which is one of the motivating languages)
these are very common.
In other words, typical
2019 Jul 22
2
[RFC] A new multidimensional array indexing intrinsic
We could also simply extend the existing inrange mechanism to
non-constantexpr GEPs. It would remove an inconsistency in the
semantics, be relatively straight forward, and solve the motivating
example.
(I didn't read the proposal in full, so there may be other examples it
doesn't solve.)
Philip
On 7/22/19 10:01 AM, Peter Collingbourne via llvm-dev wrote:
> The restrictions of
2019 Jul 25
0
[RFC] A new multidimensional array indexing intrinsic
It's also very common in Fortran.
-David
Michael Ferguson via llvm-dev <llvm-dev at lists.llvm.org> writes:
>> It seems that the main advantage of your proposal is that it would
>> allow for non-constant strides (i.e. variable length arrays) in
>> dimensions other than the first one. Do these appear frequently
>> enough in the programs