You can subscribe to this list here.
1998 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}
(1) 
_{Jul}

_{Aug}
(15) 
_{Sep}
(5) 
_{Oct}
(11) 
_{Nov}
(19) 
_{Dec}
(5) 

1999 
_{Jan}
(8) 
_{Feb}
(2) 
_{Mar}
(13) 
_{Apr}
(22) 
_{May}
(6) 
_{Jun}
(11) 
_{Jul}
(3) 
_{Aug}
(8) 
_{Sep}
(14) 
_{Oct}
(14) 
_{Nov}
(7) 
_{Dec}
(13) 
2000 
_{Jan}
(14) 
_{Feb}
(13) 
_{Mar}
(25) 
_{Apr}
(5) 
_{May}
(11) 
_{Jun}
(7) 
_{Jul}
(5) 
_{Aug}
(4) 
_{Sep}
(1) 
_{Oct}
(14) 
_{Nov}
(13) 
_{Dec}
(15) 
2001 
_{Jan}
(46) 
_{Feb}
(8) 
_{Mar}
(10) 
_{Apr}
(4) 
_{May}
(7) 
_{Jun}
(5) 
_{Jul}
(10) 
_{Aug}
(12) 
_{Sep}
(11) 
_{Oct}
(6) 
_{Nov}
(11) 
_{Dec}
(3) 
2002 
_{Jan}
(6) 
_{Feb}
(2) 
_{Mar}
(3) 
_{Apr}
(16) 
_{May}
(23) 
_{Jun}
(9) 
_{Jul}
(14) 
_{Aug}
(15) 
_{Sep}
(11) 
_{Oct}
(13) 
_{Nov}
(15) 
_{Dec}
(36) 
2003 
_{Jan}
(33) 
_{Feb}
(49) 
_{Mar}
(27) 
_{Apr}
(23) 
_{May}
(19) 
_{Jun}
(21) 
_{Jul}
(33) 
_{Aug}
(26) 
_{Sep}
(42) 
_{Oct}
(34) 
_{Nov}
(31) 
_{Dec}
(52) 
2004 
_{Jan}
(22) 
_{Feb}
(24) 
_{Mar}
(22) 
_{Apr}
(12) 
_{May}
(18) 
_{Jun}
(45) 
_{Jul}
(18) 
_{Aug}
(52) 
_{Sep}
(13) 
_{Oct}
(17) 
_{Nov}
(14) 
_{Dec}
(30) 
2005 
_{Jan}
(11) 
_{Feb}
(10) 
_{Mar}
(19) 
_{Apr}
(29) 
_{May}
(58) 
_{Jun}
(61) 
_{Jul}
(45) 
_{Aug}
(23) 
_{Sep}
(43) 
_{Oct}
(42) 
_{Nov}
(30) 
_{Dec}
(24) 
2006 
_{Jan}
(23) 
_{Feb}
(43) 
_{Mar}
(34) 
_{Apr}
(14) 
_{May}
(31) 
_{Jun}
(23) 
_{Jul}
(13) 
_{Aug}
(6) 
_{Sep}
(16) 
_{Oct}
(14) 
_{Nov}
(9) 
_{Dec}
(11) 
2007 
_{Jan}
(28) 
_{Feb}
(24) 
_{Mar}
(23) 
_{Apr}
(16) 
_{May}
(29) 
_{Jun}
(28) 
_{Jul}
(17) 
_{Aug}
(14) 
_{Sep}
(15) 
_{Oct}
(19) 
_{Nov}

_{Dec}
(12) 
2008 
_{Jan}
(30) 
_{Feb}
(21) 
_{Mar}
(24) 
_{Apr}
(22) 
_{May}
(38) 
_{Jun}
(21) 
_{Jul}
(24) 
_{Aug}
(31) 
_{Sep}
(9) 
_{Oct}
(23) 
_{Nov}
(18) 
_{Dec}
(1) 
2009 
_{Jan}
(12) 
_{Feb}
(17) 
_{Mar}
(20) 
_{Apr}
(6) 
_{May}
(6) 
_{Jun}
(11) 
_{Jul}
(27) 
_{Aug}
(5) 
_{Sep}
(5) 
_{Oct}
(16) 
_{Nov}
(2) 
_{Dec}
(6) 
2010 
_{Jan}
(18) 
_{Feb}
(23) 
_{Mar}
(5) 
_{Apr}
(6) 
_{May}
(2) 
_{Jun}
(10) 
_{Jul}
(24) 
_{Aug}
(6) 
_{Sep}
(7) 
_{Oct}
(8) 
_{Nov}
(11) 
_{Dec}
(1) 
2011 
_{Jan}
(15) 
_{Feb}
(1) 
_{Mar}
(1) 
_{Apr}
(4) 
_{May}
(7) 
_{Jun}
(2) 
_{Jul}
(36) 
_{Aug}
(10) 
_{Sep}
(2) 
_{Oct}
(10) 
_{Nov}
(3) 
_{Dec}
(12) 
2012 
_{Jan}
(10) 
_{Feb}
(29) 
_{Mar}
(6) 
_{Apr}
(47) 
_{May}
(11) 
_{Jun}
(11) 
_{Jul}
(14) 
_{Aug}
(13) 
_{Sep}
(3) 
_{Oct}

_{Nov}
(5) 
_{Dec}

2013 
_{Jan}
(7) 
_{Feb}
(6) 
_{Mar}
(5) 
_{Apr}

_{May}
(5) 
_{Jun}
(10) 
_{Jul}

_{Aug}
(1) 
_{Sep}
(6) 
_{Oct}
(3) 
_{Nov}
(1) 
_{Dec}
(7) 
2014 
_{Jan}

_{Feb}
(5) 
_{Mar}
(1) 
_{Apr}
(2) 
_{May}

_{Jun}
(6) 
_{Jul}

_{Aug}
(10) 
_{Sep}
(1) 
_{Oct}

_{Nov}
(5) 
_{Dec}

2015 
_{Jan}

_{Feb}
(1) 
_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}
(1) 
_{Aug}

_{Sep}
(1) 
_{Oct}

_{Nov}
(1) 
_{Dec}

2016 
_{Jan}
(6) 
_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 





1

2

3

4

5

6

7

8

9
(3) 
10
(1) 
11

12

13

14

15

16

17

18

19
(1) 
20
(2) 
21
(5) 
22
(3) 
23
(1) 
24
(3) 
25
(1) 
26

27

28

29
(4) 
30

31

From: Christopher Subich <csubich@ma...>  20100729 21:20:05

W.P. McNeill wrote: > The Blitz documentation says that transpose() works by adjusting strides > rather than copying memory, which is good, but from looking at the > source it appears that transpose() does not take a TinyVector argument, > so I'm back to needing to know the details of what I want to do at > compile time rather than run time. Well, so long as you know the number of dimensions in advance then you're still okay. You'll just have to unwrap the TinyVector by hand, as my_array.transpose(vec(0),vec(1),vec(2),...). Failing that, transpose doesn't do anything that the constructor doesn't repeat. You could construct a new array that references the old array's data, match the domain, and have a custom StorageOrder that uses the appropriate (transposed) ordering. The custom StorageOrder can be defined on the fly. 
From: W.P. McNeill <billmcn@gm...>  20100729 19:38:03

On Sat, Jul 24, 2010 at 1:26 AM, Patrik Jonsson <code@...>wrote: > It seems this is like trying to put a square peg in a round hole... > The whole point behind blitz is to use *compiletime* optimization > through the template metaprogramming technique. This is why the > indices are distinct types, because the expression needs to be > decodable at compile time. Since C++ is strictly typed, it's > impossible to do arbitrary index permutations at runtime. Won't an > attempt to handle arbitrary indices necessarily have to be done at > compile time using templates? (Or with an exponentially expanding > number of runtime switches to pick the correct form of the > expression.) > > cheers, > > That's the crux of the question I'm asking here. I wasn't sure whether the runtime flexibility I wanted was contrary to so some fundamental aspect of Blitz design. > /Patrik > > On Thu, Jul 22, 2010 at 2:37 AM, W.P. McNeill <billmcn@...> wrote: > > > > > > On Wed, Jul 21, 2010 at 2:24 PM, Tama Ma <pingnang@...> > wrote: > >> > >> Hi, > >> > >> Maybe you can make use of function pointers? I believe this should > >> resolve your problem. > >> > >> Best regards, > >> Tama Ma > >> > > I'm not sure how you would use function pointers here. Can you give an > > example? > > The one thing I can think of is to create a bunch of small functions with > > different permutations of indexes, e.g. > > Array<float, 2> mul1(Array<float, 2> A, Array<float, 1> B) { > > Array<float, 2> C(2, 2); > > C = A(tensor::i, tensor::j) * B(tensor::i); > > return C; > > } > > Array<float, 2> mul2(Array<float, 2> A, Array<float, 1> B) { > > Array<float, 2> C(2, 2); > > C = A(tensor::i, tensor::j) * B(tensor::j); > > return C; > > } > > and so on, and then pass pointers to these functions to my mul() > function. > > The problem is that if I want to do multiplications over Arrays of > arbitrary > > rank and arbitrary sets of indices to multiply over, I'll have to write a > > factorial number of these stub functions. Even if I limit my Arrays to > > small ranks (<5 say), this will be intractable. > > > > > > So far, I've been asking a simplified version of the question, but maybe > > it'll be clearer if I spell out everything I'm trying to do. I want to > > define an LabeledArray object that is an Array of arbitrary rank and > > dimensions. Every dimension in a LabeledArray has a corresponding label. > > It doesn't matter what these labels are as long as they define an > equality > > operator. For illustrative purposes here, say that they are letters. So > I > > might have a rank 2 LabeledArray that looks like this: > > LabeledArray<double, 2>(2,2) A = [2, 3  5 ,7], labels = (a,b) > > where "a" is the label of the first dimension of A and "b" is the label > of > > the second. > > Multiplication for LabeledArrays is defined as Array multiplication with > > shared tensor indices for all dimensions that share the same label. So, > for > > example, given > > LabeledArray<double, 1>(2) B = [10, 20], labels = (a) > > The product of A and B would be a A(i,j)*B(i) because the first > dimensions > > of A and B share the label "a". The labels of the product's dimensions > > would be (a,b) like so: > > LabeledArray<double, 2>(2,2) A(i,j)*B(i), labels = (a,b) > > As an example of a more complex product I might have > > LabeledArray<double, 3> C(3,5,2) = [...], labels = (a, b, c) > > LabeledArray<double, 3> D(5,2,4) = [...], labels = (b, c, x) > > Then the product would look like C(i,j,k)*D(j,k,l), and the product's > labels > > would be (a,b,c,x) like so: > > LabeledArray<double, 4>(3,5,2,4) C(i,j,k)*D(j,k,l), labels = (a, b, c, x) > > I'm not sure if Blitz is designed to handle this degree of flexibility > with > > index manipulation, or if it is how to go about doing it. > > Thanks for your help. I realize this question is somewhat involved. > >> > >> On Jul 21, 2010, at 1:14 PM, W.P. McNeill wrote: > >> > >> > > >> > > >> > On Tue, Jul 20, 2010 at 8:07 AM, Tama Ma <pingnang@...> > >> > wrote: > >> > Hi, > >> > > >> > If what you want is matrix product, then the following is the > >> > solution: > >> > > >> > > >> > typedef double valuetype; > >> > > >> > blitz::Array<valuetype, 2> A; > >> > blitz::Array<valuetype, 1> B; > >> > blitz::Array<valuetype, 1> C; > >> > > >> > A.resize(2,2); > >> > B.resize(2); > >> > C.resize(2); > >> > > >> > C = blitz::sum(A(blitz::tensor::i, blitz::tensor::j) * > >> > B(blitz::tensor::j)) , blitz::tensor::j); > >> > > >> > A.free(); > >> > B.free(); > >> > C.free(); > >> > > >> > > >> > Hope this works! > >> > > >> > > >> > Best regards, > >> > Tama Ma > >> > > >> > > >> > > >> > I'm actually trying to do something else. Instead of linear algebra > >> > matrix multiplication, I'm trying to do elementwise multiplication of > two > >> > arrays. For instance, if I have > >> > > >> > A= [2 3 > >> > 5 7] > >> > > >> > and > >> > > >> > B = [10 20] > >> > > >> > I want a function like > >> > > >> > mul(A, B, ...indexes to multiply over...) > >> > > >> > where A and B are arrays and indexes is a set of indexes to multiply > >> > over. So for example: > >> > > >> > mul(A, B, ...multiply over A's first index...) returns > >> > > >> > C = A(tensor::i, tensor::j) * B(tensor::i) > >> > 2 x 2 > >> > [ 20 30 > >> > 100 140 ] > >> > > >> > while > >> > > >> > mul(A, B, ...multiply over A's second index...) returns > >> > C = A(tensor::i, tensor::j) * B(tensor::j); > >> > 2 x 2 > >> > [ 20 60 > >> > 50 140 ] > >> > > >> > For this particular case I can write something like: > >> > > >> > Array<float, 2> mul(Array<float, 2> A, Array<float, 1> B, int i) { > >> > Array<float, 2> C(2, 2); > >> > if (i == 1) > >> > C = A(tensor::i, tensor::j) * B(tensor::i); > >> > else > >> > C = A(tensor::i, tensor::j) * B(tensor::j); > >> > return C; > >> > } > >> > > >> > But what I need is a general purpose way for mul() to handle Array > >> > arguments of arbitrary rank and arbitrary sets of indexes to multiply > over > >> > at runtime. > >> > > >> > > >> > > >> > On Jul 18, 2010, at 10:19 PM, W.P. McNeill wrote: > >> > > >> > > I want to do outer multiplication on two Arrays, a 2x2 called A and > a > >> > > 2x1 called B. If I want to multiply over the first index of A, I > can say > >> > > this: > >> > > > >> > > firstIndex i; > >> > > secondIndex j; > >> > > C = A(i,j) * B(i); > >> > > > >> > > If I want to multiply over the second index, I can say this: > >> > > > >> > > ... > >> > > C = A(i,j) * B(j); > >> > > > >> > > This requires me to decide which index I'm multiplying over when I > >> > > write the source code. Is there a way to make a decision about > which index > >> > > to multiply over at runtime? Is there a way to do this for > arbitrary > >> > > dimensions in a matrix? > >> > > > >> > > I don't see how to do this from looking at the header files. I > tried > >> > > calling A(...) and B(...) with TinyVectors of IndexPlaceholder > objects, but > >> > > that doesn't work. > >> > > > >> > > >  > >> > > This SF.net email is sponsored by Sprint > >> > > What will you do first with EVO, the first 4G phone? > >> > > Visit sprint.com/first  > >> > > > http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > >> > > Blitzsupport mailing list > >> > > Blitzsupport@... > >> > > https://lists.sourceforge.net/lists/listinfo/blitzsupport > >> > > >> >  > >> > ETH Zurich > >> > Tama Ma > >> > Institute for Theoretical Physics > >> > HIT K31.3 > >> > WolfgangPauliStr. 27 > >> > 8093 Zurich > >> > Switzerland > >> > > >> > pingnang@... > >> > http://www.phys.ethz.ch/~pingnang > >> > > >> > +41 44 633 76 55 Phone > >> > +41 44 633 11 15 Fax > >> > > >> > > >> > > >> > > >> > > >> > >  > >> > This SF.net email is sponsored by Sprint > >> > What will you do first with EVO, the first 4G phone? > >> > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > >> > _______________________________________________ > >> > Blitzsupport mailing list > >> > Blitzsupport@... > >> > https://lists.sourceforge.net/lists/listinfo/blitzsupport > >> > > >> > > >> > >  > >> > This SF.net email is sponsored by Sprint > >> > What will you do first with EVO, the first 4G phone? > >> > Visit sprint.com/first  > >> > > http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > >> > Blitzsupport mailing list > >> > Blitzsupport@... > >> > https://lists.sourceforge.net/lists/listinfo/blitzsupport > >> > >>  > >> ETH Zurich > >> Tama Ma > >> Institute for Theoretical Physics > >> HIT K31.3 > >> WolfgangPauliStr. 27 > >> 8093 Zurich > >> Switzerland > >> > >> pingnang@... > >> http://www.phys.ethz.ch/~pingnang > >> > >> +41 44 633 76 55 Phone > >> +41 44 633 11 15 Fax > >> > >> > >> > >> > >> > >> >  > >> This SF.net email is sponsored by Sprint > >> What will you do first with EVO, the first 4G phone? > >> Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > >> _______________________________________________ > >> Blitzsupport mailing list > >> Blitzsupport@... > >> https://lists.sourceforge.net/lists/listinfo/blitzsupport > > > > > > >  > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > > _______________________________________________ > > Blitzsupport mailing list > > Blitzsupport@... > > https://lists.sourceforge.net/lists/listinfo/blitzsupport > > > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport > 
From: W.P. McNeill <billmcn@gm...>  20100729 19:35:52

On Sat, Jul 24, 2010 at 3:51 PM, Christopher Subich < csubich@...> wrote: > Patrik Jonsson wrote: > > impossible to do arbitrary index permutations at runtime. Won't an > > attempt to handle arbitrary indices necessarily have to be done at > > compile time using templates? (Or with an exponentially expanding > > number of runtime switches to pick the correct form of the > > expression.) > > As a thought, it may be possible to do what the original poster wants > with array transposes. > Original poster here...I've already tried a strategy similar to this. I have implemented a version of LabeledArray in Python using the array() object in NumericPython. NumericPython's array() does what I want if all the dimensions to be multiplied over are at the front. So I transpose the dimensions to the front and get the result I'm looking for. For performance and integration with other components reasons, I'd like to write this in C++ instead of Python. I looked at the NumericPython source and saw that it was built on top of Blitz, which is what led me to start playing with this package and asking these questions here. The Blitz documentation says that transpose() works by adjusting strides rather than copying memory, which is good, but from looking at the source it appears that transpose() does not take a TinyVector argument, so I'm back to needing to know the details of what I want to do at compile time rather than run time. > > The problem is simplified if the OP knew, for example, that only the > last dimension would be multiplied over. That's a logical > consideration, and with Array<T>.transpose it should be possible to > create a view of the array that will always make the last dimension the > magic one. > > Hypothetical example (not tested, probably won't compile): > > blitz::firstIndex ii; > blitz::secondIndex jj; > blitz::thirdIndex kk; > > typedef whatever T; > void do_multiply(Array<T,3> & src, Array<T,3> & dst, Array<T,1> mulvec, > int dim) { > TinyVector<int,3> didx; > didx = ii; > didx(dim) = 2; > didx(2) = dim; > // Create transposed views of source, destination > Array<T,3> src_tmp = src.transpose(didx(0),didx(1),didx(2)); > Array<T,3> dst_tmp = dst.transpose(didx(0),didx(1),didx(2)); > > // Multiply views over last logical dimension. This will > // not necessarily use the same memory stride from call to call, > // since the "true" (memoryordered) dimension is variable as dim. > dst_tmp = src_tmp(ii,jj,kk)*mulvec(kk); > return; > } > > This could be extended as a template function to arbitrary type T and > probably arbitrary dimension numbers, although I'm not sure if > Array<T>.transpose supports a TinyVector<int> argument. I'd assume so > in order to allow for 12+ dimensions. > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport > 
From: Thibaut Lamadon <thibaut.lamadon@gm...>  20100729 17:32:08

Hi guys, I am trying to use maxIndex efficiently. My problem is that I don't know how to use the vector I get get from maxIndex, I would like to do: I = maxIndex( pow( H(i,j)  W(j) ,2) ,j) and then get the values of W that maximizes for each j from its index so I would like WM = W(I) is there any way to do this without having to write the for loops myself? thks a lot t. 
From: wateenellende <fpblists@gm...>  20100725 17:11:42

Hi, another Blitz++ / FFTW frontend is explained here: http://tech.unige.ch/cvmlcpp/source/doc/BlitzArray.html http://tech.unige.ch/cvmlcpp/source/doc/Fourier.html It supports float, double and long double in 1, 2 or 3 dimensions through templates. It can be downloaded from here: http://tech.unige.ch/cvmlcpp/ The idea behind this design was to provide an interface that could work with several types of matrices, not only blitz++, which is why there is a wrapper class for blitz++ Array, but apart from that the interface is as simple as I could make it. Currently, I'm developing code to support NVidia's cufft via the same interface, but this code is not complete yet, and not released. The code is licenced GPL v2 or higher. Best, Fokko Beekhof On 07/21/2010 11:26 PM, Tama Ma wrote: > Hi Thomas, > > Can you tell me more specifically what you want to do? I have successfully used FFTW in blitz some time ago. > > Best regards, > Tama Ma > > > > On Jul 21, 2010, at 8:53 AM, Thomas Markovich wrote: > > >> Hi, >> >> I am trying to implement Fomel's method for acoustic propagation and require a fast fourier transform. I have used the blitz++ library in the past and I love it for how easy it makes array operations. >> >> I found something from about 4 years ago (http://www.oonumerics.org/MailArchives/blitzsupport/2004/09/1206.php) on the blitz++ mailing list but I wasn't able to figure out how to use it in multiple dimensions. I googled around and I found http://www.stahlke.org/dan/fftwblitz/ but this appears to give me issues. >> >> Does anyone have any suggestions about the best way to go about this? >> >> Thomas >>  >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst >> _______________________________________________ >> Blitzsupport mailing list >> Blitzsupport@... >> https://lists.sourceforge.net/lists/listinfo/blitzsupport >> >> > 
From: Christopher Subich <csubich@ma...>  20100724 23:27:26

Patrik Jonsson wrote: > impossible to do arbitrary index permutations at runtime. Won't an > attempt to handle arbitrary indices necessarily have to be done at > compile time using templates? (Or with an exponentially expanding > number of runtime switches to pick the correct form of the > expression.) As a thought, it may be possible to do what the original poster wants with array transposes. The problem is simplified if the OP knew, for example, that only the last dimension would be multiplied over. That's a logical consideration, and with Array<T>.transpose it should be possible to create a view of the array that will always make the last dimension the magic one. Hypothetical example (not tested, probably won't compile): blitz::firstIndex ii; blitz::secondIndex jj; blitz::thirdIndex kk; typedef whatever T; void do_multiply(Array<T,3> & src, Array<T,3> & dst, Array<T,1> mulvec, int dim) { TinyVector<int,3> didx; didx = ii; didx(dim) = 2; didx(2) = dim; // Create transposed views of source, destination Array<T,3> src_tmp = src.transpose(didx(0),didx(1),didx(2)); Array<T,3> dst_tmp = dst.transpose(didx(0),didx(1),didx(2)); // Multiply views over last logical dimension. This will // not necessarily use the same memory stride from call to call, // since the "true" (memoryordered) dimension is variable as dim. dst_tmp = src_tmp(ii,jj,kk)*mulvec(kk); return; } This could be extended as a template function to arbitrary type T and probably arbitrary dimension numbers, although I'm not sure if Array<T>.transpose supports a TinyVector<int> argument. I'd assume so in order to allow for 12+ dimensions. 
From: Patrik Jonsson <code@fa...>  20100724 08:56:01

It seems this is like trying to put a square peg in a round hole... The whole point behind blitz is to use *compiletime* optimization through the template metaprogramming technique. This is why the indices are distinct types, because the expression needs to be decodable at compile time. Since C++ is strictly typed, it's impossible to do arbitrary index permutations at runtime. Won't an attempt to handle arbitrary indices necessarily have to be done at compile time using templates? (Or with an exponentially expanding number of runtime switches to pick the correct form of the expression.) cheers, /Patrik On Thu, Jul 22, 2010 at 2:37 AM, W.P. McNeill <billmcn@...> wrote: > > > On Wed, Jul 21, 2010 at 2:24 PM, Tama Ma <pingnang@...> wrote: >> >> Hi, >> >> Maybe you can make use of function pointers? I believe this should >> resolve your problem. >> >> Best regards, >> Tama Ma >> > I'm not sure how you would use function pointers here. Can you give an > example? > The one thing I can think of is to create a bunch of small functions with > different permutations of indexes, e.g. > Array<float, 2> mul1(Array<float, 2> A, Array<float, 1> B) { > Array<float, 2> C(2, 2); > C = A(tensor::i, tensor::j) * B(tensor::i); > return C; > } > Array<float, 2> mul2(Array<float, 2> A, Array<float, 1> B) { > Array<float, 2> C(2, 2); > C = A(tensor::i, tensor::j) * B(tensor::j); > return C; > } > and so on, and then pass pointers to these functions to my mul() function. > The problem is that if I want to do multiplications over Arrays of arbitrary > rank and arbitrary sets of indices to multiply over, I'll have to write a > factorial number of these stub functions. Even if I limit my Arrays to > small ranks (<5 say), this will be intractable. > > > So far, I've been asking a simplified version of the question, but maybe > it'll be clearer if I spell out everything I'm trying to do. I want to > define an LabeledArray object that is an Array of arbitrary rank and > dimensions. Every dimension in a LabeledArray has a corresponding label. > It doesn't matter what these labels are as long as they define an equality > operator. For illustrative purposes here, say that they are letters. So I > might have a rank 2 LabeledArray that looks like this: > LabeledArray<double, 2>(2,2) A = [2, 3  5 ,7], labels = (a,b) > where "a" is the label of the first dimension of A and "b" is the label of > the second. > Multiplication for LabeledArrays is defined as Array multiplication with > shared tensor indices for all dimensions that share the same label. So, for > example, given > LabeledArray<double, 1>(2) B = [10, 20], labels = (a) > The product of A and B would be a A(i,j)*B(i) because the first dimensions > of A and B share the label "a". The labels of the product's dimensions > would be (a,b) like so: > LabeledArray<double, 2>(2,2) A(i,j)*B(i), labels = (a,b) > As an example of a more complex product I might have > LabeledArray<double, 3> C(3,5,2) = [...], labels = (a, b, c) > LabeledArray<double, 3> D(5,2,4) = [...], labels = (b, c, x) > Then the product would look like C(i,j,k)*D(j,k,l), and the product's labels > would be (a,b,c,x) like so: > LabeledArray<double, 4>(3,5,2,4) C(i,j,k)*D(j,k,l), labels = (a, b, c, x) > I'm not sure if Blitz is designed to handle this degree of flexibility with > index manipulation, or if it is how to go about doing it. > Thanks for your help. I realize this question is somewhat involved. >> >> On Jul 21, 2010, at 1:14 PM, W.P. McNeill wrote: >> >> > >> > >> > On Tue, Jul 20, 2010 at 8:07 AM, Tama Ma <pingnang@...> >> > wrote: >> > Hi, >> > >> > If what you want is matrix product, then the following is the >> > solution: >> > >> > >> > typedef double valuetype; >> > >> > blitz::Array<valuetype, 2> A; >> > blitz::Array<valuetype, 1> B; >> > blitz::Array<valuetype, 1> C; >> > >> > A.resize(2,2); >> > B.resize(2); >> > C.resize(2); >> > >> > C = blitz::sum(A(blitz::tensor::i, blitz::tensor::j) * >> > B(blitz::tensor::j)) , blitz::tensor::j); >> > >> > A.free(); >> > B.free(); >> > C.free(); >> > >> > >> > Hope this works! >> > >> > >> > Best regards, >> > Tama Ma >> > >> > >> > >> > I'm actually trying to do something else. Instead of linear algebra >> > matrix multiplication, I'm trying to do elementwise multiplication of two >> > arrays. For instance, if I have >> > >> > A= [2 3 >> > 5 7] >> > >> > and >> > >> > B = [10 20] >> > >> > I want a function like >> > >> > mul(A, B, ...indexes to multiply over...) >> > >> > where A and B are arrays and indexes is a set of indexes to multiply >> > over. So for example: >> > >> > mul(A, B, ...multiply over A's first index...) returns >> > >> > C = A(tensor::i, tensor::j) * B(tensor::i) >> > 2 x 2 >> > [ 20 30 >> > 100 140 ] >> > >> > while >> > >> > mul(A, B, ...multiply over A's second index...) returns >> > C = A(tensor::i, tensor::j) * B(tensor::j); >> > 2 x 2 >> > [ 20 60 >> > 50 140 ] >> > >> > For this particular case I can write something like: >> > >> > Array<float, 2> mul(Array<float, 2> A, Array<float, 1> B, int i) { >> > Array<float, 2> C(2, 2); >> > if (i == 1) >> > C = A(tensor::i, tensor::j) * B(tensor::i); >> > else >> > C = A(tensor::i, tensor::j) * B(tensor::j); >> > return C; >> > } >> > >> > But what I need is a general purpose way for mul() to handle Array >> > arguments of arbitrary rank and arbitrary sets of indexes to multiply over >> > at runtime. >> > >> > >> > >> > On Jul 18, 2010, at 10:19 PM, W.P. McNeill wrote: >> > >> > > I want to do outer multiplication on two Arrays, a 2x2 called A and a >> > > 2x1 called B. If I want to multiply over the first index of A, I can say >> > > this: >> > > >> > > firstIndex i; >> > > secondIndex j; >> > > C = A(i,j) * B(i); >> > > >> > > If I want to multiply over the second index, I can say this: >> > > >> > > ... >> > > C = A(i,j) * B(j); >> > > >> > > This requires me to decide which index I'm multiplying over when I >> > > write the source code. Is there a way to make a decision about which index >> > > to multiply over at runtime? Is there a way to do this for arbitrary >> > > dimensions in a matrix? >> > > >> > > I don't see how to do this from looking at the header files. I tried >> > > calling A(...) and B(...) with TinyVectors of IndexPlaceholder objects, but >> > > that doesn't work. >> > > >> > >  >> > > This SF.net email is sponsored by Sprint >> > > What will you do first with EVO, the first 4G phone? >> > > Visit sprint.com/first  >> > > http://p.sf.net/sfu/sprintcomfirst_______________________________________________ >> > > Blitzsupport mailing list >> > > Blitzsupport@... >> > > https://lists.sourceforge.net/lists/listinfo/blitzsupport >> > >> >  >> > ETH Zurich >> > Tama Ma >> > Institute for Theoretical Physics >> > HIT K31.3 >> > WolfgangPauliStr. 27 >> > 8093 Zurich >> > Switzerland >> > >> > pingnang@... >> > http://www.phys.ethz.ch/~pingnang >> > >> > +41 44 633 76 55 Phone >> > +41 44 633 11 15 Fax >> > >> > >> > >> > >> > >> >  >> > This SF.net email is sponsored by Sprint >> > What will you do first with EVO, the first 4G phone? >> > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst >> > _______________________________________________ >> > Blitzsupport mailing list >> > Blitzsupport@... >> > https://lists.sourceforge.net/lists/listinfo/blitzsupport >> > >> > >> >  >> > This SF.net email is sponsored by Sprint >> > What will you do first with EVO, the first 4G phone? >> > Visit sprint.com/first  >> > http://p.sf.net/sfu/sprintcomfirst_______________________________________________ >> > Blitzsupport mailing list >> > Blitzsupport@... >> > https://lists.sourceforge.net/lists/listinfo/blitzsupport >> >>  >> ETH Zurich >> Tama Ma >> Institute for Theoretical Physics >> HIT K31.3 >> WolfgangPauliStr. 27 >> 8093 Zurich >> Switzerland >> >> pingnang@... >> http://www.phys.ethz.ch/~pingnang >> >> +41 44 633 76 55 Phone >> +41 44 633 11 15 Fax >> >> >> >> >> >>  >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst >> _______________________________________________ >> Blitzsupport mailing list >> Blitzsupport@... >> https://lists.sourceforge.net/lists/listinfo/blitzsupport > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport > > 
From: Julian Cummings <cummings@ca...>  20100724 00:00:20

[I am posting this reply on behalf of Mahendra K. Verma <mkv@...>. The original post was garbled.] > Date: Wed, 21 Jul 2010 09:53:02 0500 > From: Thomas Markovich <thomasmarkovich@...> > Subject: [Blitzsupport] Blitz++ And FFTW > To: blitzsupport@... > MessageID: <012B8A41C2B241C2A553217214EDCD1F@...> > ContentType: text/plain; charset=usascii > > Hi, > > I am trying to implement Fomel's method for acoustic propagation and > require a fast fourier transform. I have used the blitz++ library in > the past and I love it for how easy it makes array operations. > > I found something from about 4 years ago > (http://www.oonumerics.org/MailArchives/blitzsupport/2004/09/1206.php) on the blitz++ mailing list but I wasn't able to figure out how to use it in multiple dimensions. I googled around and I found http://www.stahlke.org/dan/fftwblitz/ but this appears to give me issues. > > Does anyone have any suggestions about the best way to go about this? > > Thomas > > >  > Dear Thomas I have a C++ code in which I use fftw with blitz++. It is quite easy.. Some snippets are given below. I hope it helps.. Pl use appropriate fftw functions for yourself.. best mahendra verma #include <blitz/array.h> #include <complex> #include <cmath> #include <mpi.h> #include <fftw3mpi.h> // #include <iostream> // #include <blitz/array.h> // #include <complex> // #include <cmath> // #include <fftw3_mpi.h> //#include "fourier.h" using namespace blitz; fftw_plan r2c_1d_plan, c2r_1d_plan; int main(int argc, char **argv) { const int N0 =8; Array<complex<double>,1> *A; A = new Array<complex<double>,1>(N0); r2c_1d_plan = fftw_plan_dft_r2c_1d(N0, (DP*)((*A).data()), (fftw_complex*)((*A).data()), FFTW_MEASURE); c2r_1d_plan = fftw_plan_dft_c2r_1d(N0,(fftw_complex*)((*A).data()), (DP*)((*A).data()), FFTW_MEASURE); *A = 0.0; real((*A)(1)) = 1.5; cout << *A << endl; fftw_execute_dft_c2r(c2r_1d_plan, reinterpret_cast<fftw_complex*>((*A).data()), reinterpret_cast<double*>((*A).data())); cout << *A << endl; fftw_execute_dft_r2c(r2c_1d_plan, reinterpret_cast<double*>((*A).data()), reinterpret_cast<fftw_complex*>((*A).data())); cout << "AFTER FFT, A " << (*A) << endl; } 
From: Felipe Montefuscolo <felipe.mt87@gm...>  20100723 15:31:27

Hello, I can't compile the file cfd.cpp. The error is huge, but the last lines are cfd.cpp:105: instantiated from here cfd.cpp:45: error: no match for ‘operator*’ in ‘eta * blitz::Laplacian3DVec4(T&, const blitz::UniformCubicGeometry<3, double>&) [with T = blitz::stencilExtent<3, blitz::TinyVector<double, 3> >](((const blitz::UniformCubicGeometry<3, double>&)((const blitz::UniformCubicGeometry<3, double>*)(& geom))))’ I have not changed anything in the original code. I get blitz sources from cvs. Using Ubuntu, g++ 4.4.3.  Felipe Montefuscolo 
From: Thibaut Lamadon <thibaut.lamadon@gm...>  20100722 19:25:45

Dear all, I am using the blitz++ library to solve dynamic programing in economics and it works very well. I was using Fortran before that. I have some deterministic law of motion on the right hand side and I have problems coding it up elegantly. In other words I have a mapping for the index holders: I,J nxn and I would like to do: for (i++,j++) A(i,j) = B(I(i,j),J(i,j)); I and J are not simple indexes but they are integers between 1 and n to work as an index (I can not use Range()). It would not be difficult to write this as a function, but I was thinking that there might be an elegant way of doing this in Blitz++. It would be even better if I could use it within a tensor expression, but I see how that could be difficult as I and J would need to indicate which dimension they represent. It would be neat though. I suspect this could be done by writing my own index holder, but I don't know how. Thank you tibo 
From: Mario Emmenlauer <mario@em...>  20100722 09:33:11

Hi Thomas, the Chair of Pattern Recognition and Image Processing of the University Freiburg has something that does exactly that. It is a library called "libBlitzFFTW", that nicely abstracts fftw with blitz. It is very simple to use: blitz::Array<double,2> data(baseSize, baseSize); blitz::Array<std::complex<double>,2> fft(baseSize, baseSize / 2 + 1); BlitzFFTW<double>* fftProc = BlitzFFTW<double>::instance(); fftProc>plan_forward(data, fft); fftProc>plan_backward(fft, data); fftProc>forward(data, fft); fftProc>backward(fft, data); The library is templated for the types float, double and long double for FFTW's standard types. It can work with 1D, 2D and 3D blitz arrays of these types, and detects and employs the correct dimensionality from your blitz array automatically. It can do unshuffeling of the FFTW shuffeling of values too. If you don't want to do planning beforehand, you don't have to, it will automatically use the simplest planning as a default unless you have a better plan prepared manually (so you just need to call "forward" or "backward", that's it!) Only drawback: I don't know the license of libBlitzFFTW, so I'm CCing two of the main contributors to libBlitzFFTW here. All the best, Mario Emmenlauer > Hi Thomas, > > Can you tell me more specifically what you want to do? I have > successfully used FFTW in blitz some time ago. > > Best regards, > Tama Ma > > > > On Jul 21, 2010, at 8:53 AM, Thomas Markovich wrote: > >> Hi, >> >> I am trying to implement Fomel's method for acoustic propagation and >> require a fast fourier transform. I have used the blitz++ library in the >> past and I love it for how easy it makes array operations. >> >> I found something from about 4 years ago >> (http://www.oonumerics.org/MailArchives/blitzsupport/2004/09/1206.php) >> on the blitz++ mailing list but I wasn't able to figure out how to use >> it in multiple dimensions. I googled around and I found >> http://www.stahlke.org/dan/fftwblitz/ but this appears to give me >> issues. >> >> Does anyone have any suggestions about the best way to go about this? >> >> Thomas >>  >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst >> _______________________________________________ >> Blitzsupport mailing list >> Blitzsupport@... >> https://lists.sourceforge.net/lists/listinfo/blitzsupport >> > >  > ETH Zurich > Tama Ma > Institute for Theoretical Physics > HIT K31.3 > WolfgangPauliStr. 27 > 8093 Zurich > Switzerland > > pingnang@... > http://www.phys.ethz.ch/~pingnang > > +41 44 633 76 55 Phone > +41 44 633 11 15 Fax > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport > > 
From: W.P. McNeill <billmcn@gm...>  20100722 00:38:05

On Wed, Jul 21, 2010 at 2:24 PM, Tama Ma <pingnang@...> wrote: > Hi, > > Maybe you can make use of function pointers? I believe this should > resolve your problem. > > Best regards, > Tama Ma > > I'm not sure how you would use function pointers here. Can you give an example? The one thing I can think of is to create a bunch of small functions with different permutations of indexes, e.g. Array<float, 2> mul1(Array<float, 2> A, Array<float, 1> B) { Array<float, 2> C(2, 2); C = A(tensor::i, tensor::j) * B(tensor::i); return C; } Array<float, 2> mul2(Array<float, 2> A, Array<float, 1> B) { Array<float, 2> C(2, 2); C = A(tensor::i, tensor::j) * B(tensor::j); return C; } and so on, and then pass pointers to these functions to my mul() function. The problem is that if I want to do multiplications over Arrays of arbitrary rank and arbitrary sets of indices to multiply over, I'll have to write a factorial number of these stub functions. Even if I limit my Arrays to small ranks (<5 say), this will be intractable. So far, I've been asking a simplified version of the question, but maybe it'll be clearer if I spell out everything I'm trying to do. I want to define an LabeledArray object that is an Array of arbitrary rank and dimensions. Every dimension in a LabeledArray has a corresponding label. It doesn't matter what these labels are as long as they define an equality operator. For illustrative purposes here, say that they are letters. So I might have a rank 2 LabeledArray that looks like this: LabeledArray<double, 2>(2,2) A = [2, 3  5 ,7], labels = (a,b) where "a" is the label of the first dimension of A and "b" is the label of the second. Multiplication for LabeledArrays is defined as Array multiplication with shared tensor indices for all dimensions that share the same label. So, for example, given LabeledArray<double, 1>(2) B = [10, 20], labels = (a) The product of A and B would be a A(i,j)*B(i) because the first dimensions of A and B share the label "a". The labels of the product's dimensions would be (a,b) like so: LabeledArray<double, 2>(2,2) A(i,j)*B(i), labels = (a,b) As an example of a more complex product I might have LabeledArray<double, 3> C(3,5,2) = [...], labels = (a, b, c) LabeledArray<double, 3> D(5,2,4) = [...], labels = (b, c, x) Then the product would look like C(i,j,k)*D(j,k,l), and the product's labels would be (a,b,c,x) like so: LabeledArray<double, 4>(3,5,2,4) C(i,j,k)*D(j,k,l), labels = (a, b, c, x) I'm not sure if Blitz is designed to handle this degree of flexibility with index manipulation, or if it is how to go about doing it. Thanks for your help. I realize this question is somewhat involved. > > > On Jul 21, 2010, at 1:14 PM, W.P. McNeill wrote: > > > > > > > On Tue, Jul 20, 2010 at 8:07 AM, Tama Ma <pingnang@...> > wrote: > > Hi, > > > > If what you want is matrix product, then the following is the > solution: > > > > > > typedef double valuetype; > > > > blitz::Array<valuetype, 2> A; > > blitz::Array<valuetype, 1> B; > > blitz::Array<valuetype, 1> C; > > > > A.resize(2,2); > > B.resize(2); > > C.resize(2); > > > > C = blitz::sum(A(blitz::tensor::i, blitz::tensor::j) * > B(blitz::tensor::j)) , blitz::tensor::j); > > > > A.free(); > > B.free(); > > C.free(); > > > > > > Hope this works! > > > > > > Best regards, > > Tama Ma > > > > > > > > I'm actually trying to do something else. Instead of linear algebra > matrix multiplication, I'm trying to do elementwise multiplication of two > arrays. For instance, if I have > > > > A= [2 3 > > 5 7] > > > > and > > > > B = [10 20] > > > > I want a function like > > > > mul(A, B, ...indexes to multiply over...) > > > > where A and B are arrays and indexes is a set of indexes to multiply > over. So for example: > > > > mul(A, B, ...multiply over A's first index...) returns > > > > C = A(tensor::i, tensor::j) * B(tensor::i) > > 2 x 2 > > [ 20 30 > > 100 140 ] > > > > while > > > > mul(A, B, ...multiply over A's second index...) returns > > C = A(tensor::i, tensor::j) * B(tensor::j); > > 2 x 2 > > [ 20 60 > > 50 140 ] > > > > For this particular case I can write something like: > > > > Array<float, 2> mul(Array<float, 2> A, Array<float, 1> B, int i) { > > Array<float, 2> C(2, 2); > > if (i == 1) > > C = A(tensor::i, tensor::j) * B(tensor::i); > > else > > C = A(tensor::i, tensor::j) * B(tensor::j); > > return C; > > } > > > > But what I need is a general purpose way for mul() to handle Array > arguments of arbitrary rank and arbitrary sets of indexes to multiply over > at runtime. > > > > > > > > On Jul 18, 2010, at 10:19 PM, W.P. McNeill wrote: > > > > > I want to do outer multiplication on two Arrays, a 2x2 called A and a > 2x1 called B. If I want to multiply over the first index of A, I can say > this: > > > > > > firstIndex i; > > > secondIndex j; > > > C = A(i,j) * B(i); > > > > > > If I want to multiply over the second index, I can say this: > > > > > > ... > > > C = A(i,j) * B(j); > > > > > > This requires me to decide which index I'm multiplying over when I > write the source code. Is there a way to make a decision about which index > to multiply over at runtime? Is there a way to do this for arbitrary > dimensions in a matrix? > > > > > > I don't see how to do this from looking at the header files. I tried > calling A(...) and B(...) with TinyVectors of IndexPlaceholder objects, but > that doesn't work. > > > >  > > > This SF.net email is sponsored by Sprint > > > What will you do first with EVO, the first 4G phone? > > > Visit sprint.com/first  > http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > > > Blitzsupport mailing list > > > Blitzsupport@... > > > https://lists.sourceforge.net/lists/listinfo/blitzsupport > > > >  > > ETH Zurich > > Tama Ma > > Institute for Theoretical Physics > > HIT K31.3 > > WolfgangPauliStr. 27 > > 8093 Zurich > > Switzerland > > > > pingnang@... > > http://www.phys.ethz.ch/~pingnang > > > > +41 44 633 76 55 Phone > > +41 44 633 11 15 Fax > > > > > > > > > > >  > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > > _______________________________________________ > > Blitzsupport mailing list > > Blitzsupport@... > > https://lists.sourceforge.net/lists/listinfo/blitzsupport > > > > >  > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first  > http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > > Blitzsupport mailing list > > Blitzsupport@... > > https://lists.sourceforge.net/lists/listinfo/blitzsupport > >  > ETH Zurich > Tama Ma > Institute for Theoretical Physics > HIT K31.3 > WolfgangPauliStr. 27 > 8093 Zurich > Switzerland > > pingnang@... > http://www.phys.ethz.ch/~pingnang > > +41 44 633 76 55 Phone > +41 44 633 11 15 Fax > > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport > 
From: Shekhar Chandra <Shekhar.C<handra@mo...>  20100721 23:44:32

Hi Guys, I have successfully used Blitz and FFTW. It is available as part of my DGV Blitz Array Visualisation package: <http://code.google.com/p/discretegeometryviewer/>; The class for Blitz FFTW is <http://code.google.com/p/discretegeometryviewer/source/browse/dgv/include/DGVFourierTransform.h>; To cast Blitz to VTK (Visualisation Toolkit) is the class <http://code.google.com/p/discretegeometryviewer/source/browse/dgv/include/DGVBlitzArrayCasterVTK.h>; HTH Cheers Shakes On 22/07/10 07:26, Tama Ma wrote: > Hi Thomas, > > Can you tell me more specifically what you want to do? I have successfully used FFTW in blitz some time ago. > > Best regards, > Tama Ma > > > > On Jul 21, 2010, at 8:53 AM, Thomas Markovich wrote: > >> Hi, >> >> I am trying to implement Fomel's method for acoustic propagation and require a fast fourier transform. I have used the blitz++ library in the past and I love it for how easy it makes array operations. >> >> I found something from about 4 years ago (http://www.oonumerics.org/MailArchives/blitzsupport/2004/09/1206.php) on the blitz++ mailing list but I wasn't able to figure out how to use it in multiple dimensions. I googled around and I found http://www.stahlke.org/dan/fftwblitz/ but this appears to give me issues. >> >> Does anyone have any suggestions about the best way to go about this? >> >> Thomas >>  >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst >> _______________________________________________ >> Blitzsupport mailing list >> Blitzsupport@... >> https://lists.sourceforge.net/lists/listinfo/blitzsupport >> > 
From: Tama Ma <pingnang@it...>  20100721 21:26:41

Hi Thomas, Can you tell me more specifically what you want to do? I have successfully used FFTW in blitz some time ago. Best regards, Tama Ma On Jul 21, 2010, at 8:53 AM, Thomas Markovich wrote: > Hi, > > I am trying to implement Fomel's method for acoustic propagation and require a fast fourier transform. I have used the blitz++ library in the past and I love it for how easy it makes array operations. > > I found something from about 4 years ago (http://www.oonumerics.org/MailArchives/blitzsupport/2004/09/1206.php) on the blitz++ mailing list but I wasn't able to figure out how to use it in multiple dimensions. I googled around and I found http://www.stahlke.org/dan/fftwblitz/ but this appears to give me issues. > > Does anyone have any suggestions about the best way to go about this? > > Thomas >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport >  ETH Zurich Tama Ma Institute for Theoretical Physics HIT K31.3 WolfgangPauliStr. 27 8093 Zurich Switzerland pingnang@... http://www.phys.ethz.ch/~pingnang +41 44 633 76 55 Phone +41 44 633 11 15 Fax 
From: Tama Ma <pingnang@it...>  20100721 21:24:32

Hi, Maybe you can make use of function pointers? I believe this should resolve your problem. Best regards, Tama Ma On Jul 21, 2010, at 1:14 PM, W.P. McNeill wrote: > > > On Tue, Jul 20, 2010 at 8:07 AM, Tama Ma <pingnang@...> wrote: > Hi, > > If what you want is matrix product, then the following is the solution: > > > typedef double valuetype; > > blitz::Array<valuetype, 2> A; > blitz::Array<valuetype, 1> B; > blitz::Array<valuetype, 1> C; > > A.resize(2,2); > B.resize(2); > C.resize(2); > > C = blitz::sum(A(blitz::tensor::i, blitz::tensor::j) * B(blitz::tensor::j)) , blitz::tensor::j); > > A.free(); > B.free(); > C.free(); > > > Hope this works! > > > Best regards, > Tama Ma > > > > I'm actually trying to do something else. Instead of linear algebra matrix multiplication, I'm trying to do elementwise multiplication of two arrays. For instance, if I have > > A= [2 3 > 5 7] > > and > > B = [10 20] > > I want a function like > > mul(A, B, ...indexes to multiply over...) > > where A and B are arrays and indexes is a set of indexes to multiply over. So for example: > > mul(A, B, ...multiply over A's first index...) returns > > C = A(tensor::i, tensor::j) * B(tensor::i) > 2 x 2 > [ 20 30 > 100 140 ] > > while > > mul(A, B, ...multiply over A's second index...) returns > C = A(tensor::i, tensor::j) * B(tensor::j); > 2 x 2 > [ 20 60 > 50 140 ] > > For this particular case I can write something like: > > Array<float, 2> mul(Array<float, 2> A, Array<float, 1> B, int i) { > Array<float, 2> C(2, 2); > if (i == 1) > C = A(tensor::i, tensor::j) * B(tensor::i); > else > C = A(tensor::i, tensor::j) * B(tensor::j); > return C; > } > > But what I need is a general purpose way for mul() to handle Array arguments of arbitrary rank and arbitrary sets of indexes to multiply over at runtime. > > > > On Jul 18, 2010, at 10:19 PM, W.P. McNeill wrote: > > > I want to do outer multiplication on two Arrays, a 2x2 called A and a 2x1 called B. If I want to multiply over the first index of A, I can say this: > > > > firstIndex i; > > secondIndex j; > > C = A(i,j) * B(i); > > > > If I want to multiply over the second index, I can say this: > > > > ... > > C = A(i,j) * B(j); > > > > This requires me to decide which index I'm multiplying over when I write the source code. Is there a way to make a decision about which index to multiply over at runtime? Is there a way to do this for arbitrary dimensions in a matrix? > > > > I don't see how to do this from looking at the header files. I tried calling A(...) and B(...) with TinyVectors of IndexPlaceholder objects, but that doesn't work. > >  > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > > Blitzsupport mailing list > > Blitzsupport@... > > https://lists.sourceforge.net/lists/listinfo/blitzsupport > >  > ETH Zurich > Tama Ma > Institute for Theoretical Physics > HIT K31.3 > WolfgangPauliStr. 27 > 8093 Zurich > Switzerland > > pingnang@... > http://www.phys.ethz.ch/~pingnang > > +41 44 633 76 55 Phone > +41 44 633 11 15 Fax > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport  ETH Zurich Tama Ma Institute for Theoretical Physics HIT K31.3 WolfgangPauliStr. 27 8093 Zurich Switzerland pingnang@... http://www.phys.ethz.ch/~pingnang +41 44 633 76 55 Phone +41 44 633 11 15 Fax 
From: W.P. McNeill <billmcn@gm...>  20100721 19:15:03

On Tue, Jul 20, 2010 at 8:07 AM, Tama Ma <pingnang@...> wrote: > Hi, > > If what you want is matrix product, then the following is the > solution: > > > typedef double valuetype; > > blitz::Array<valuetype, 2> A; > blitz::Array<valuetype, 1> B; > blitz::Array<valuetype, 1> C; > > A.resize(2,2); > B.resize(2); > C.resize(2); > > C = blitz::sum(A(blitz::tensor::i, blitz::tensor::j) * B(blitz::tensor::j)) > , blitz::tensor::j); > > A.free(); > B.free(); > C.free(); > > > Hope this works! > > > Best regards, > Tama Ma > > > I'm actually trying to do something else. Instead of linear algebra matrix multiplication, I'm trying to do elementwise multiplication of two arrays. For instance, if I have A= [2 3 5 7] and B = [10 20] I want a function like mul(A, B, ...indexes to multiply over...) where A and B are arrays and indexes is a set of indexes to multiply over. So for example: mul(A, B, ...multiply over A's first index...) returns C = A(tensor::i, tensor::j) * B(tensor::i) 2 x 2 [ 20 30 100 140 ] while mul(A, B, ...multiply over A's second index...) returns C = A(tensor::i, tensor::j) * B(tensor::j); 2 x 2 [ 20 60 50 140 ] For this particular case I can write something like: Array<float, 2> mul(Array<float, 2> A, Array<float, 1> B, int i) { Array<float, 2> C(2, 2); if (i == 1) C = A(tensor::i, tensor::j) * B(tensor::i); else C = A(tensor::i, tensor::j) * B(tensor::j); return C; } But what I need is a general purpose way for mul() to handle Array arguments of arbitrary rank and arbitrary sets of indexes to multiply over at runtime. > > On Jul 18, 2010, at 10:19 PM, W.P. McNeill wrote: > > > I want to do outer multiplication on two Arrays, a 2x2 called A and a 2x1 > called B. If I want to multiply over the first index of A, I can say this: > > > > firstIndex i; > > secondIndex j; > > C = A(i,j) * B(i); > > > > If I want to multiply over the second index, I can say this: > > > > ... > > C = A(i,j) * B(j); > > > > This requires me to decide which index I'm multiplying over when I write > the source code. Is there a way to make a decision about which index to > multiply over at runtime? Is there a way to do this for arbitrary > dimensions in a matrix? > > > > I don't see how to do this from looking at the header files. I tried > calling A(...) and B(...) with TinyVectors of IndexPlaceholder objects, but > that doesn't work. > > >  > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first  > http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > > Blitzsupport mailing list > > Blitzsupport@... > > https://lists.sourceforge.net/lists/listinfo/blitzsupport > >  > ETH Zurich > Tama Ma > Institute for Theoretical Physics > HIT K31.3 > WolfgangPauliStr. 27 > 8093 Zurich > Switzerland > > pingnang@... > http://www.phys.ethz.ch/~pingnang > > +41 44 633 76 55 Phone > +41 44 633 11 15 Fax > > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport > 
From: Thomas Markovich <thomasmarkovich@gm...>  20100721 14:53:16

Hi, I am trying to implement Fomel's method for acoustic propagation and require a fast fourier transform. I have used the blitz++ library in the past and I love it for how easy it makes array operations. I found something from about 4 years ago (http://www.oonumerics.org/MailArchives/blitzsupport/2004/09/1206.php) on the blitz++ mailing list but I wasn't able to figure out how to use it in multiple dimensions. I googled around and I found http://www.stahlke.org/dan/fftwblitz/ but this appears to give me issues. Does anyone have any suggestions about the best way to go about this? Thomas 
From: Julian Cummings <cummings@ca...>  20100720 15:16:24

 Original Message  Subject: blitz++ on visual studio 2010 From: "Seth Thompson" <thompson.seth@...> Date: Thu, July 15, 2010 4:27 pm To: blitzsupport@...  To Whom It May Concern, My name is Seth Thompson and I am a PhD student. I am writing a finite element code for my dissertation and ran across blitz++. I am learning c++, I have a good grasp of STL vectors however still learning the intricacies of c++, especially using other libraries. I was wondering if Blitz will work on visual studio 2010? It would be a really helpful package since I have to use some third and fourth order tensors and need them to work with the best speed possible. Thanks for the help, Seth Thompson  Dr. Julian C. Cummings California Institute of Technology Email: cummings@... Phone: 6263952543 
From: Tama Ma <pingnang@it...>  20100720 15:07:46

Hi, If what you want is matrix product, then the following is the solution: typedef double valuetype; blitz::Array<valuetype, 2> A; blitz::Array<valuetype, 1> B; blitz::Array<valuetype, 1> C; A.resize(2,2); B.resize(2); C.resize(2); C = blitz::sum(A(blitz::tensor::i, blitz::tensor::j) * B(blitz::tensor::j)) , blitz::tensor::j); A.free(); B.free(); C.free(); Hope this works! Best regards, Tama Ma On Jul 18, 2010, at 10:19 PM, W.P. McNeill wrote: > I want to do outer multiplication on two Arrays, a 2x2 called A and a 2x1 called B. If I want to multiply over the first index of A, I can say this: > > firstIndex i; > secondIndex j; > C = A(i,j) * B(i); > > If I want to multiply over the second index, I can say this: > > ... > C = A(i,j) * B(j); > > This requires me to decide which index I'm multiplying over when I write the source code. Is there a way to make a decision about which index to multiply over at runtime? Is there a way to do this for arbitrary dimensions in a matrix? > > I don't see how to do this from looking at the header files. I tried calling A(...) and B(...) with TinyVectors of IndexPlaceholder objects, but that doesn't work. >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport  ETH Zurich Tama Ma Institute for Theoretical Physics HIT K31.3 WolfgangPauliStr. 27 8093 Zurich Switzerland pingnang@... http://www.phys.ethz.ch/~pingnang +41 44 633 76 55 Phone +41 44 633 11 15 Fax 
From: W.P. McNeill <billmcn@gm...>  20100719 04:19:22

I want to do outer multiplication on two Arrays, a 2x2 called A and a 2x1 called B. If I want to multiply over the first index of A, I can say this: firstIndex i; secondIndex j; C = A(i,j) * B(i); If I want to multiply over the second index, I can say this: ... C = A(i,j) * B(j); This requires me to decide which index I'm multiplying over when I write the source code. Is there a way to make a decision about which index to multiply over at runtime? Is there a way to do this for arbitrary dimensions in a matrix? I don't see how to do this from looking at the header files. I tried calling A(...) and B(...) with TinyVectors of IndexPlaceholder objects, but that doesn't work. 
From: Felipe Montefuscolo <felipe.mt87@gm...>  20100710 15:36:34

Hello, I'm trying to do something like that: Array<double, 3> T(3,3,3); Array<double, 1> u(3), v(3); firstIndex i; secondIndex j; thirdIndex k; . . . v = sum( u(j) * T(1, i, j) , j ); // error I'd like to use T( "some number" , i, j) as a matrix without creating a temporary array. How can I do it ? Thanks (:  Felipe Montefuscolo 
From: Tama Ma <pingnang@it...>  20100709 18:38:07

Hi Mike, You may try: (a) for random numbers: std::generate(blitzRandomArray.begin(), blitzRandomArray.end(), ... < some boost random generator> ); (b) for sequences: using blitz::tensor i; blitzRandomArray = i; Hope that works. If not, I will give you the exact commands. Best regards, Tama Ma On Jul 8, 2010, at 7:44 PM, Michael King wrote: > Hello, > > I am very new to C++ and even newer to blitz. I have been attempting to refactor some R code using blitz and was wondering if anyone could suggest a more efficient method for initializing a blitz array with random values or as a sequence. > > Currently this is how I am doing it: > > > #include <iostream> > #include <blitz/array.h> > #include <random/uniform.h> > > using namespace ranlib; > using namespace std; > using namespace blitz; > > int main() { > > /*** fill blitz array with random numbers ***/ > > int size_ = 10; > Uniform<double> runif; > double initvec[size_]; > > for(int i = 0; i < size_; i++) > initvec[i] = runif.random(); > > Array<double,1> blitzRandomArray(initvec, shape(size_)); > > cout << blitzRandomArray << endl; > > /*** fill in array with 1..N ***/ > > for(int i = 0; i < size_; i++) > initvec[i] = i + 1; > > Array<double,1> blitzIndexArray(initvec, shape(size_)); > > cout << blitzIndexArray << endl; > > return 0; > } > > Thanks for any advice. > >  Mike King > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst_______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport  ETH Zurich Tama Ma Institute for Theoretical Physics HIT K31.3 WolfgangPauliStr. 27 8093 Zurich Switzerland pingnang@... http://www.phys.ethz.ch/~pingnang +41 44 633 76 55 Phone +41 44 633 11 15 Fax 
From: Felipe Montefuscolo <felipe.mt87@gm...>  20100709 12:59:12

Hello, I am a physics student and I use c + +. I tested the blitz + + and loved it. In some way, i think its better than boost::ublas. Please do not stop with the project. Hugs from Brazil,  Felipe Montefuscolo 
From: Michael King <wmichaelking1@gm...>  20100709 01:50:55

Hello, I am very new to C++ and even newer to blitz. I have been attempting to refactor some R code using blitz and was wondering if anyone could suggest a more efficient method for initializing a blitz array with random values or as a sequence. Currently this is how I am doing it: #include <iostream> #include <blitz/array.h> #include <random/uniform.h> using namespace ranlib; using namespace std; using namespace blitz; int main() { /*** fill blitz array with random numbers ***/ int size_ = 10; Uniform<double> runif; double initvec[size_]; for(int i = 0; i < size_; i++) initvec[i] = runif.random(); Array<double,1> blitzRandomArray(initvec, shape(size_)); cout << blitzRandomArray << endl; /*** fill in array with 1..N ***/ for(int i = 0; i < size_; i++) initvec[i] = i + 1; Array<double,1> blitzIndexArray(initvec, shape(size_)); cout << blitzIndexArray << endl; return 0; } Thanks for any advice.  Mike King 