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}
(6) 
_{Dec}

2017 
_{Jan}
(3) 
_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 




1
(1) 
2
(2) 
3
(5) 
4

5

6
(1) 
7

8
(1) 
9
(1) 
10

11

12
(1) 
13
(1) 
14

15

16

17
(1) 
18

19

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

26

27

28
(2) 
29
(1) 
30
(1) 
31


From: Robert M Dorazio <bob_dorazio@us...>  20060330 19:15:08

Dear Dr. Cummings, The following suggestion is not meant as a criticism at all. I think page 40 of the updated documentation contains an error that has been present in several "versions" of the Blitz library. More specifically, the 1st syntax used for manual casting (i.e., type promotion) is obsolete; the 2nd syntax is currently implemented in Blitz. The current documentation indicates that the reverse is true. Will you please make this correction in the next revision of the online documentation? Thanks, Bob Dorazio USGS  Florida Integrated Science Center Department of Statistics University of Florida P.O. Box 110339 Gainesville, Florida 326110339 Phone: (352) 3923081 Web site: http://eval.gvcsitemaker.com/robert.dorazio Julian Cummings <cummings@...> Sent by: blitzsupportadmin@... 03/29/2006 01:38 PM Please respond to blitzsupport@... To blitzsupport@... cc Subject [Blitzsupport] online blitz documentation Blitz users, There was a problem with the automated script for updating the Blitz++ web page on the oonumerics.org site that has now been fixed. So I have replaced the online documentation there with current HTML documentation produced from the texinfo files in the blitz 0.9 doc/ subdirectory. Although the documentation remains somewhat incomplete, I hope this will reduce the confusion with the original online manual, which was out of date in certain places. As was recently reported here, there are still some online code examples such as where.cpp that need to be synched up with the current blitz release as well. I will continue to work on these as time permits. Regards, Julian C. On Fri, 20060324 at 10:38 0800, Julian Cummings wrote: > The online manual pages are circa 2001, but the downloadable PostScript > manual has been updated to version 0.9 of blitz and does contain the newer > information. I will see what I can do about getting the online information > updated also. (My control over that is only indirect at best.)  Dr. Julian C. Cummings Email: cummings@... California Institute of Technology Phone: 6263952543 1200 E. California Blvd., Mail Code 15879 Fax: 6265845917 Pasadena, CA 91125 Office: 125 PowellBooth  This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.asus.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Blitzsupport mailing list Blitzsupport@... https://lists.sourceforge.net/lists/listinfo/blitzsupport 
From: Julian Cummings <cummings@ca...>  20060329 18:38:18

Blitz users, There was a problem with the automated script for updating the Blitz++ web page on the oonumerics.org site that has now been fixed. So I have replaced the online documentation there with current HTML documentation produced from the texinfo files in the blitz 0.9 doc/ subdirectory. Although the documentation remains somewhat incomplete, I hope this will reduce the confusion with the original online manual, which was out of date in certain places. As was recently reported here, there are still some online code examples such as where.cpp that need to be synched up with the current blitz release as well. I will continue to work on these as time permits. Regards, Julian C. On Fri, 20060324 at 10:38 0800, Julian Cummings wrote: > The online manual pages are circa 2001, but the downloadable PostScript > manual has been updated to version 0.9 of blitz and does contain the newer > information. I will see what I can do about getting the online information > updated also. (My control over that is only indirect at best.)  Dr. Julian C. Cummings Email: cummings@... California Institute of Technology Phone: 6263952543 1200 E. California Blvd., Mail Code 15879 Fax: 6265845917 Pasadena, CA 91125 Office: 125 PowellBooth 
From: Julian Cummings <cummings@ca...>  20060328 18:46:14

Hello Victor, It appears that the example code you found on the website is slightly outofdate with respect to the current blitz release. The same example code can be found in the examples subdirectory of blitz 0.9. In that version of where.cpp, the code includes different header files: #include <blitz/vectoret.h> #include <blitz/vecwhere.h> If you include these two header files in where.cpp, it should compile correctly for you. The expression template support and where statement support for the Vector class were separated out from the main vector.h header file in a previous release of blitz, in order to reduce compile times in cases where these features are not needed. In general, the versions of the blitz example codes that come packaged with the blitz release should always be uptodate and compatible with that release. Some of the examples shown on the website have not been kept current because the oonumerics.org website is not directly managed by sourceforge or directly tied to the cvs repository for blitz. Sorry for any confusion. Regards, Julian C. On Mon, 20060327 at 18:38 0700, Victor Ochoa wrote: > /**********************************************************************= ******* > * > Hello all, > I=FFve been running some of the examples for Blitz++ under VS .NET 2= 005 an for most of the time > I had no trouble with the compilation after constructing the library. N= evertheless, I=FFve been trying > to compile the example code contained in where.cpp at http://www.oonume= rics.org/blitz/examples/Blitz++/where.cpp > and I keep receiving an error > =20 > * where.cpp Blitz++ Vector<T> example, illustrating where(X,Y,Z) > * expressions. > * > * $Id: where.cpp,v 1.1.1.1 2005/06/15 14:31:20 tveldhui Exp $ > * > * $Log: where.cpp,v $ > * Revision 1.1.1.1 2005/06/15 14:31:20 tveldhui > * > * > */ > =20 > #include <blitz/vector.h> > =20 > using namespace blitz; > =20 > int main () >=20 > {=20 >=20 > Vector<int> x =3D Range(3,+3); // [ 3 2 1 0 1 2 3 ] >=20 > =20 >=20 > // The where(X,Y,Z) function is similar to the X ? Y : Z operator. >=20 > // If X is logical true, then Y is returned; otherwise, Z is >=20 > // returned. >=20 > =20 >=20 > Vector<int> y =3D where(abs(x)>2, x+10, x10); >=20 > =20 >=20 > // The above statement is transformed into something resembling: >=20 > // >=20 > // for (unsigned i=3D0; i < 7; ++i) >=20 > // y[i] =3D (abs(x[i]) > 2) ? (x[i]+10) : (x[i]10); >=20 > // >=20 > // The first expression (abs(x) > 2) can involve the usual >=20 > // comparison and logical operators: < > <=3D >=3D =3D=3D !=3D && = =20 >=20 > =20 >=20 > cout << x << endl << y << endl; >=20 > =20 >=20 > =20 >=20 > return 0; >=20 > } >=20 > =20 >=20 > At compilation time I get >=20 > =20 >=20 > Compiling... >=20 > where.cpp >=20 > ..\..\examples\where.cpp(74) : error C2665: 'blitz::abs' : none of the > 5 overloads could convert all the argument types >=20 > D:\Microsoft Visual Studio\VC\include\stdlib.h(415): could be > 'int abs(int)' >=20 > D:\Microsoft Visual Studio\VC\include\math.h(485): or 'long > abs(long)' >=20 > D:\Microsoft Visual Studio\VC\include\math.h(487): or 'double > abs(double)' >=20 > D:\Microsoft Visual Studio\VC\include\math.h(491): or 'float > abs(float)' >=20 > D:\Microsoft Visual Studio\VC\include\math.h(539): or 'long > double abs(long double)' >=20 > while trying to match the argument list > '(blitz::Vector<P_numtype>)' >=20 > with >=20 > [ >=20 > P_numtype=3Dint >=20 > ] >=20 > ..\..\examples\where.cpp(74) : error C2679: binary '+' : no operator > found which takes a righthand operand of type 'int' (or there is no > acceptable conversion) >=20 > D:\Libraries\Blitz\blitz/meta/metaprog.h(39): could be 'T > blitz::operator +<blitz::Vector<P_numtype>>(const T > &,blitz::_bz_meta_nullOperand)' >=20 > with >=20 > [ >=20 > T=3Dblitz::Vector<int>, >=20 > P_numtype=3Dint >=20 > ] >=20 > while trying to match the argument list > '(blitz::Vector<P_numtype>, int)' >=20 > with >=20 > [ >=20 > P_numtype=3Dint >=20 > ] >=20 > ..\..\examples\where.cpp(74) : error C2676: binary '' : > 'blitz::Vector<P_numtype>' does not define this operator or a > conversion to a type acceptable to the predefined operator >=20 > with >=20 > [ >=20 > P_numtype=3Dint >=20 > ] >=20 > Build log was saved at "file://d:\Libraries\Blitz\BlitzExamples\where > \Release\BuildLog.htm" >=20 > where  3 error(s), 0 warning(s) >=20 > =20 >=20 > Does anybody have an idea of why none of the overloads declared in the > header file funcs.h seem not to be replacing the correspondent > arguments? >=20 > Thanks a lot >=20 > Victor Ochoa. >=20 > =20 >=20 > =20 >=20 >=20 =20 Dr. Julian C. Cummings Email: cummings@...= h.edu California Institute of Technology Phone: 6263952543 1200 E. California Blvd., Mail Code 15879 Fax: 6265845917 Pasadena, CA 91125 Office: 125 PowellBooth 
From: Victor Ochoa <victor@cs...>  20060328 01:39:09

/*************************************************************************** ** * Hello all, I've been running some of the examples for Blitz++ under VS .NET 2005 an for most of the time I had no trouble with the compilation after constructing the library. Nevertheless, I've been trying to compile the example code contained in where.cpp at http://www.oonumerics.org/blitz/examples/Blitz++/where.cpp and I keep receiving an error * where.cpp Blitz++ Vector<T> example, illustrating where(X,Y,Z) * expressions. * * $Id: where.cpp,v 1.1.1.1 2005/06/15 14:31:20 tveldhui Exp $ * * $Log: where.cpp,v $ * Revision 1.1.1.1 2005/06/15 14:31:20 tveldhui * * */ #include <blitz/vector.h> using namespace blitz; int main () { Vector<int> x = Range(3,+3); // [ 3 2 1 0 1 2 3 ] // The where(X,Y,Z) function is similar to the X ? Y : Z operator. // If X is logical true, then Y is returned; otherwise, Z is // returned. Vector<int> y = where(abs(x)>2, x+10, x10); // The above statement is transformed into something resembling: // // for (unsigned i=0; i < 7; ++i) // y[i] = (abs(x[i]) > 2) ? (x[i]+10) : (x[i]10); // // The first expression (abs(x) > 2) can involve the usual // comparison and logical operators: < > <= >= == != &&  cout << x << endl << y << endl; return 0; } At compilation time I get Compiling... where.cpp ..\..\examples\where.cpp(74) : error C2665: 'blitz::abs' : none of the 5 overloads could convert all the argument types D:\Microsoft Visual Studio\VC\include\stdlib.h(415): could be 'int abs(int)' D:\Microsoft Visual Studio\VC\include\math.h(485): or 'long abs(long)' D:\Microsoft Visual Studio\VC\include\math.h(487): or 'double abs(double)' D:\Microsoft Visual Studio\VC\include\math.h(491): or 'float abs(float)' D:\Microsoft Visual Studio\VC\include\math.h(539): or 'long double abs(long double)' while trying to match the argument list '(blitz::Vector<P_numtype>)' with [ P_numtype=int ] ..\..\examples\where.cpp(74) : error C2679: binary '+' : no operator found which takes a righthand operand of type 'int' (or there is no acceptable conversion) D:\Libraries\Blitz\blitz/meta/metaprog.h(39): could be 'T blitz::operator +<blitz::Vector<P_numtype>>(const T &,blitz::_bz_meta_nullOperand)' with [ T=blitz::Vector<int>, P_numtype=int ] while trying to match the argument list '(blitz::Vector<P_numtype>, int)' with [ P_numtype=int ] ..\..\examples\where.cpp(74) : error C2676: binary '' : 'blitz::Vector<P_numtype>' does not define this operator or a conversion to a type acceptable to the predefined operator with [ P_numtype=int ] Build log was saved at "file://d:\Libraries\Blitz\BlitzExamples\where\Release\BuildLog.htm"; where  3 error(s), 0 warning(s) Does anybody have an idea of why none of the overloads declared in the header file funcs.h seem not to be replacing the correspondent arguments? Thanks a lot Victor Ochoa. 
From: Geoffrey M. Romer <gromer@cs...>  20060324 22:28:42

At a minimum, perhaps the manual webpage could be modified to indicate that it's out of date. Thanks very much for your help. On Fri, 24 Mar 2006, Julian Cummings wrote: > The online manual pages are circa 2001, but the downloadable PostScript > manual has been updated to version 0.9 of blitz and does contain the newer > information. I will see what I can do about getting the online information > updated also. (My control over that is only indirect at best.) > > Regards, Julian C. > > Dr. Julian C. Cummings > Staff Scientist, CACR/Caltech > (626) 3952543 > cummings@... > > >> Original Message >> From: blitzsupportadmin@... >> [mailto:blitzsupportadmin@...] On Behalf >> Of Geoffrey M. Romer >> Sent: Friday, March 24, 2006 6:25 AM >> To: Julian Cummings >> Cc: blitzsupport@...; gromer@... >> Subject: RE: [Blitzsupport] Unable to compile simple stencil >> >> >> Thanks very much, that fixed it. >> >>> Two small changes will get this code working. First, you should >>> include <blitz/tinyvecet.h> rather than <blitz/tinyvec.h> >> in order to >>> obtain expression template support for TinyVector. (This change >>> occurred with >>> blitz0.7 and is noted in the updated manual, but many people still >>> overlook >>> it.) >> >> It doesn't seem to be in the chapters on stencils or >> TinyVectors (or array expressions, for that matter), which >> were the places I looked (I was using the online manual at >> oonumerics.org). Perhaps if it were mentioned in one or both >> places, fewer people would make my mistake. >> >> >> >>  >> This SF.Net email is sponsored by xPML, a groundbreaking >> scripting language that extends applications into web and >> mobile media. Attend the live webcast and join the prime >> developer group breaking into this new coding territory! >> http://sel.asus.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&; > dat=121642 >> _______________________________________________ >> Blitzsupport mailing list >> Blitzsupport@... >> https://lists.sourceforge.net/lists/listinfo/blitzsupport >> >> > > 
From: Tom Hilinski <tom.hilinski@co...>  20060324 19:35:02

Ignore my previous msg. My apologies. Just had a coworker point out to me a library header I had missed. Has some old msdos stuff in it, including macros for near, far, and huge... remember the good old days? I undef'd this and all is right with the world. ...Tom 
From: Tom Hilinski <tom.hilinski@co...>  20060324 19:23:36

re: blitz++ 0.8, 0.9 compiler: g++ 3.4.4, 4.0.2 OS: linux, cygwin I'm getting the following compilation error: blitz/numinquire.h:137: error: invalid function declaration This is due to the name of the function "huge" being removed by the preprocessor. Source: template<typename T> inline T huge(T) BZ_THROW { return numeric_limits<T>::max(); } Preprocessor output: template<typename T> inline T (T) { return numeric_limits<T>::max(); } Have you seen this? Any suggestions for a fix? Thanks... Tom Hilinski 
From: Julian Cummings <cummings@ca...>  20060324 18:38:51

The online manual pages are circa 2001, but the downloadable PostScript manual has been updated to version 0.9 of blitz and does contain the newer information. I will see what I can do about getting the online information updated also. (My control over that is only indirect at best.) Regards, Julian C. Dr. Julian C. Cummings Staff Scientist, CACR/Caltech (626) 3952543 cummings@... > Original Message > From: blitzsupportadmin@... > [mailto:blitzsupportadmin@...] On Behalf > Of Geoffrey M. Romer > Sent: Friday, March 24, 2006 6:25 AM > To: Julian Cummings > Cc: blitzsupport@...; gromer@... > Subject: RE: [Blitzsupport] Unable to compile simple stencil > > > Thanks very much, that fixed it. > > > Two small changes will get this code working. First, you should > > include <blitz/tinyvecet.h> rather than <blitz/tinyvec.h> > in order to > > obtain expression template support for TinyVector. (This change > > occurred with > > blitz0.7 and is noted in the updated manual, but many people still > > overlook > > it.) > > It doesn't seem to be in the chapters on stencils or > TinyVectors (or array expressions, for that matter), which > were the places I looked (I was using the online manual at > oonumerics.org). Perhaps if it were mentioned in one or both > places, fewer people would make my mistake. > > > >  > This SF.Net email is sponsored by xPML, a groundbreaking > scripting language that extends applications into web and > mobile media. Attend the live webcast and join the prime > developer group breaking into this new coding territory! > http://sel.asus.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&; dat=121642 > _______________________________________________ > Blitzsupport mailing list > Blitzsupport@... > https://lists.sourceforge.net/lists/listinfo/blitzsupport > > 
From: Geoffrey M. Romer <gromer@cs...>  20060324 14:25:37

Thanks very much, that fixed it. > Two small changes will get this code working. First, you should include > <blitz/tinyvecet.h> rather than <blitz/tinyvec.h> in order to obtain > expression template support for TinyVector. (This change occurred with > blitz0.7 and is noted in the updated manual, but many people still overlook > it.) It doesn't seem to be in the chapters on stencils or TinyVectors (or array expressions, for that matter), which were the places I looked (I was using the online manual at oonumerics.org). Perhaps if it were mentioned in one or both places, fewer people would make my mistake. 
From: John Burton <j.c.burton@ga...>  20060323 21:59:54

I normally hate to followup my own posts, but... The problem 2 I descirbed below does not happen when I declare the=20 EventVar to be double, i.e. EventVar<double,1> instead of=20 EventVar<float,1>. The problem 1 I described below still occurs=20 regardless of EventVar being float or double... Now I'm even more=20 confused... John  Original Message  Subject: Blitz++ weirdness... Date: Thu, 23 Mar 2006 16:01:49 0500 From: John Burton <j.c.burton@...> To: blitzsupport@... Greetings! I'm trying to create a templated class (EventVar) that is derived from=20 the blitz++ Array class. For the most part, I've been able to work=20 things out. There is one part that just doesn't want to work properly,=20 and it apparently has to do with expression templates. My derived class=20 adds several properties (Name, Description, Units) and eventually will=20 add some methods. I want to be able to use the same operations=20 (*,/,+,,etc) as the Array class. I have a short test program that=20 demonstrates the problem... Problem 1 is that while I can initialize an EventVar from an Array, I=20 can't initialize an EventVar from an expression. Note from the output=20 below that Array J1 is initialized properly, but EventVar J is not, it=20 initializes all elements of J to the first value (1). How can I get=20 EventVar to behave like Array for initializations? Problem 2 is a compile problem, once again with expressions. In the=20 program below "J =3D sqr(J) * 23.01;" throws a *bunch* of compile errors=20 (attached below). "J =3D sqr(J) * (float)23.01;" compiles and works fine. Any suggestions would be helpful... John Test Program: #include "EventVar.h" int main() { Array<float,1> J1(8); EventVar<float,1> J(8); J1 =3D 1,2,3,4,5,6,7,8; J =3D 1,2,3,4,5,6,7,8; cout << "J1 =3D " << J1 << endl; cout << "J =3D " << J << endl; J =3D J1; cout << "J =3D " << J << endl; J1 =3D J1 * 23.01; J =3D J * 23.01; cout << "J1 =3D " << J1 << endl; cout << "J =3D " << J << endl; J1 =3D sqr(J1) * 23.01; // J =3D sqr(J) * 23.01; // Major compile badness J =3D sqr(J) * (float)23.01; cout << "J1 =3D " << J1 << endl; cout << "J =3D " << J << endl; } EventVar.h: #ifndef _EVENTVARIABLE_H_ #define _EVENTVARIABLE_H_ #include <blitz/array.h> #include <blitz/vectoret.h> #include <blitz/vecwhere.h> #include <blitz/tinyvecet.h> #include <math.h> #include <string.h> #include <iostream> #include <fstream> using namespace blitz; template <typename T, int N_rank> class EventVar: public Array<T,N_rank> { private: char *Name; //!< Name of the Variable  will be used by Event object char *Description; //!< Long description of Variable  will be used for=20 plotting char *Units; //!< Units for the variable T AxisRange[2]; //!< Range of values to plot T FillValue; //!< Fill the data area with this value T MissingValue; //!< This value to be used for missing data elements void common_init() {Name =3D NULL; Description =3D NULL; Units =3D NULL;=20 FillValue =3D 0; MissingValue =3D 0;} public: EventVar() : Array<T,N_rank>() {common_init();} EventVar(int n1) : Array<T,N_rank>(n1) {Name =3D NULL;} EventVar(const TinyVector<int,N_rank>& dimvec, const T& val=3D0) :=20 Array<T,N_rank>(dimvec) {common_init();(*this)=3Dval;} EventVar(const EventVar<T,N_rank>& d) : Array<T,N_rank>(d) {common_init()= ;} EventVar(const Array<T,N_rank>& a) : Array<T,N_rank>(a) {common_init();} template<class T_expr> EventVar(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) : Array<T,N_rank>(expr)=20 {common_init();} EventVar<T,N_rank>& operator =3D (const EventVar<T,N_rank>& d)=20 {Array<T,N_rank>::operator=3D(d); return *this;} EventVar<T,N_rank>& operator =3D (const Array<T,N_rank>& a)=20 {Array<T,N_rank>::operator=3D(a); return *this;} EventVar<T,N_rank>& operator =3D (const T& val)=20 {Array<T,N_rank>::operator=3D(val); return *this;} template<class T_expr> inline EventVar<T,N_rank>& operator =3D (BZ_ETPARM(_bz_ArrayExpr<T_expr>)= =20 expr) { typedef _bz_typename T_expr::T_numtype T_numtype; evaluate(expr, _bz_update<T_numtype, _bz_typename T_expr::T_numtype>()); return *this; } EventVar<T,N_rank> operator + (const double v) const {return=20 EventVar<T,N_rank>(Array<T,N_rank>(*this)+(T)v);} EventVar<T,N_rank> operator  (const double v) const {return=20 EventVar<T,N_rank>(Array<T,N_rank>(*this)(T)v);} EventVar<T,N_rank> operator * (const double v) const {return=20 EventVar<T,N_rank>(Array<T,N_rank>(*this)*(T)v);} EventVar<T,N_rank> operator / (const double v) const {return=20 EventVar<T,N_rank>(Array<T,N_rank>(*this)/(T)v);} }; #endif Output from Test program: J1 =3D 8 [ 1 2 3 4 5 6 7 8 ] J =3D 8 [ 1 1 1 1 1 1 1 1 ] J =3D 8 [ 1 2 3 4 5 6 7 8 ] J1 =3D 8 [ 23.01 46.02 69.03 92.04 115.05 138.06 161.07 184.08 ] J =3D 8 [ 23.01 46.02 69.03 92.04 115.05 138.06 161.07 184.08 ] J1 =3D 8 [ 12182.9 48731.5 109646 194926 304572 438584 596961 779704 ] J =3D 8 [ 12182.9 48731.5 109646 194926 304572 438584 596961 779704 ] Major badness Compile Errors: /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithIndexTraversal1(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:171: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:670: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:681: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithIndexTraversalN(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:173: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:736: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithTiled2DTraversal(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:213: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:1179: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:1189: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:1196: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithStackTraversal1(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:221: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:277: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:317: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:356: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithStackTraversalN(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:223: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:558: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:563: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:600: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] 
From: Patrik Jonsson <patrik@uc...>  20060323 21:43:10

John Burton wrote: > Greetings! > > I'm trying to create a templated class (EventVar) that is derived from > the blitz++ Array class. For the most part, I've been able to work > things out. There is one part that just doesn't want to work properly, > and it apparently has to do with expression templates. My derived class > adds several properties (Name, Description, Units) and eventually will > add some methods. I want to be able to use the same operations > (*,/,+,,etc) as the Array class. I have a short test program that > demonstrates the problem... Hi, regardless of your specific problems getting your code to run, you probably don't want to do it this way. If I recall correctly, when you derive from the Array class you lose all expression template functionality unless you explicitly write it. (Since you redefine the operators for your derived class, they won't use the ETs.) Also, I'm not even sure if the Array can be derived from safely, ie does it declare a virtual destructor? cheers, /Patrik 
From: Julian Cummings <cummings@ca...>  20060323 21:27:36

Hello Geoffrey, > I'm a Blitz newbie, and I'm attempting to construct a stencil > for a simple operation (basically, subtract the gradient of a > scalar field from a vector field). I have code that I think > should work, but when I compile it I get a soup of compile > errors that seem to boil down to an inability to find the '' > operator. I've gone through the user guide several times, and > I can't figure out what I'm doing wrong. > > Below is a simplified version of the code that fails, along > with the compile errors it produces. I'm using Blitz++ 0.9 > with gcc 4.0.3. Any help would be much appreciated. > > snip > > #include <blitz/array.h> > #include <blitz/tinyvec.h> > > using namespace blitz; > > BZ_DECLARE_STENCIL3(project2D, u_out, u, q) > u_out = u  grad2D(q); > BZ_END_STENCIL_WITH_SHAPE(shape(1,1),shape(+1,+1)) > > [snip] Two small changes will get this code working. First, you should include <blitz/tinyvecet.h> rather than <blitz/tinyvec.h> in order to obtain expression template support for TinyVector. (This change occurred with blitz0.7 and is noted in the updated manual, but many people still overlook it.) Second, you need to change u to *u in your stencil definition. The way stencils are applied to Arrays is via "fast iterator" objects. The fast iterator has an implicit conversion operator that can convert the iterator to the element type of the Array (i.e., dereference the iterator). Unfortunately, the compiler is not always smart enough to see that such a conversion would result in a valid mathematical expression. In this case, the compiler knows that the result of grad2D is a 2D TinyVector of doubles, but it doesn't see that converting the FastArrayIterator u to its number type TinyVector<double,2> would produce a viable operation. So you need to nudge it along by explicitly dereferencing the FastArrayIterator u. There are examples similar to this to be found in the program blitz/examples/cfd.cpp. Regards, Julian C. Dr. Julian C. Cummings Staff Scientist, CACR/Caltech (626) 3952543 cummings@... 
From: John Burton <j.c.burton@ga...>  20060323 21:02:10

Greetings! I'm trying to create a templated class (EventVar) that is derived from=20 the blitz++ Array class. For the most part, I've been able to work=20 things out. There is one part that just doesn't want to work properly,=20 and it apparently has to do with expression templates. My derived class=20 adds several properties (Name, Description, Units) and eventually will=20 add some methods. I want to be able to use the same operations=20 (*,/,+,,etc) as the Array class. I have a short test program that=20 demonstrates the problem... Problem 1 is that while I can initialize an EventVar from an Array, I=20 can't initialize an EventVar from an expression. Note from the output=20 below that Array J1 is initialized properly, but EventVar J is not, it=20 initializes all elements of J to the first value (1). How can I get=20 EventVar to behave like Array for initializations? Problem 2 is a compile problem, once again with expressions. In the=20 program below "J =3D sqr(J) * 23.01;" throws a *bunch* of compile errors=20 (attached below). "J =3D sqr(J) * (float)23.01;" compiles and works fine. Any suggestions would be helpful... John Test Program: #include "EventVar.h" int main() { Array<float,1> J1(8); EventVar<float,1> J(8); J1 =3D 1,2,3,4,5,6,7,8; J =3D 1,2,3,4,5,6,7,8; cout << "J1 =3D " << J1 << endl; cout << "J =3D " << J << endl; J =3D J1; cout << "J =3D " << J << endl; J1 =3D J1 * 23.01; J =3D J * 23.01; cout << "J1 =3D " << J1 << endl; cout << "J =3D " << J << endl; J1 =3D sqr(J1) * 23.01; // J =3D sqr(J) * 23.01; // Major compile badness J =3D sqr(J) * (float)23.01; cout << "J1 =3D " << J1 << endl; cout << "J =3D " << J << endl; } EventVar.h: #ifndef _EVENTVARIABLE_H_ #define _EVENTVARIABLE_H_ #include <blitz/array.h> #include <blitz/vectoret.h> #include <blitz/vecwhere.h> #include <blitz/tinyvecet.h> #include <math.h> #include <string.h> #include <iostream> #include <fstream> using namespace blitz; template <typename T, int N_rank> class EventVar: public Array<T,N_rank> { private: char *Name; //!< Name of the Variable  will be used by Event object char *Description; //!< Long description of Variable  will be used for=20 plotting char *Units; //!< Units for the variable T AxisRange[2]; //!< Range of values to plot T FillValue; //!< Fill the data area with this value T MissingValue; //!< This value to be used for missing data elements void common_init() {Name =3D NULL; Description =3D NULL; Units =3D NULL;=20 FillValue =3D 0; MissingValue =3D 0;} public: EventVar() : Array<T,N_rank>() {common_init();} EventVar(int n1) : Array<T,N_rank>(n1) {Name =3D NULL;} EventVar(const TinyVector<int,N_rank>& dimvec, const T& val=3D0) :=20 Array<T,N_rank>(dimvec) {common_init();(*this)=3Dval;} EventVar(const EventVar<T,N_rank>& d) : Array<T,N_rank>(d) {common_init()= ;} EventVar(const Array<T,N_rank>& a) : Array<T,N_rank>(a) {common_init();} template<class T_expr> EventVar(BZ_ETPARM(_bz_ArrayExpr<T_expr>) expr) : Array<T,N_rank>(expr)=20 {common_init();} EventVar<T,N_rank>& operator =3D (const EventVar<T,N_rank>& d)=20 {Array<T,N_rank>::operator=3D(d); return *this;} EventVar<T,N_rank>& operator =3D (const Array<T,N_rank>& a)=20 {Array<T,N_rank>::operator=3D(a); return *this;} EventVar<T,N_rank>& operator =3D (const T& val)=20 {Array<T,N_rank>::operator=3D(val); return *this;} template<class T_expr> inline EventVar<T,N_rank>& operator =3D (BZ_ETPARM(_bz_ArrayExpr<T_expr>)= =20 expr) { typedef _bz_typename T_expr::T_numtype T_numtype; evaluate(expr, _bz_update<T_numtype, _bz_typename T_expr::T_numtype>()); return *this; } EventVar<T,N_rank> operator + (const double v) const {return=20 EventVar<T,N_rank>(Array<T,N_rank>(*this)+(T)v);} EventVar<T,N_rank> operator  (const double v) const {return=20 EventVar<T,N_rank>(Array<T,N_rank>(*this)(T)v);} EventVar<T,N_rank> operator * (const double v) const {return=20 EventVar<T,N_rank>(Array<T,N_rank>(*this)*(T)v);} EventVar<T,N_rank> operator / (const double v) const {return=20 EventVar<T,N_rank>(Array<T,N_rank>(*this)/(T)v);} }; #endif Output from Test program: J1 =3D 8 [ 1 2 3 4 5 6 7 8 ] J =3D 8 [ 1 1 1 1 1 1 1 1 ] J =3D 8 [ 1 2 3 4 5 6 7 8 ] J1 =3D 8 [ 23.01 46.02 69.03 92.04 115.05 138.06 161.07 184.08 ] J =3D 8 [ 23.01 46.02 69.03 92.04 115.05 138.06 161.07 184.08 ] J1 =3D 8 [ 12182.9 48731.5 109646 194926 304572 438584 596961 779704 ] J =3D 8 [ 12182.9 48731.5 109646 194926 304572 438584 596961 779704 ] Major badness Compile Errors: /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithIndexTraversal1(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:171: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:670: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:681: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithIndexTraversalN(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:173: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:736: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithTiled2DTraversal(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:213: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:1179: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:1189: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:1196: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithStackTraversal1(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:221: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:277: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:317: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:356: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc: In member function=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T,=20 N>::evaluateWithStackTraversalN(T_expr, T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92: /usr/local/include/blitz/array/eval.cc:223: instantiated from=20 =91blitz::Array<P_numtype, N_rank>& blitz::Array<T, N>::evaluate(T_expr,=20 T_update) [with T_expr =3D=20 blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<bl= itz::_bz_ArrayExprUnaryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> > >, T_update =3D blitz::_bz_update<double= ,=20 double>, P_numtype =3D float, int N_rank =3D 1]=92 EventVar.h:51: instantiated from =91EventVar<T, N_rank>& EventVar<T,=20 N_rank>::operator=3D(const blitz::_bz_ArrayExpr<T_expr>&) [with T_expr =3D= =20 blitz::_bz_ArrayExprBinaryOp<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprUna= ryOp<blitz::FastArrayIterator<float,=20 1>, blitz::Fn_sqr<float> > >, blitz::_bz_ArrayExprConstant<double>,=20 blitz::Multiply<float, double> >, T =3D float, int N_rank =3D 1]=92 testit.cpp:19: instantiated from here /usr/local/include/blitz/array/eval.cc:558: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:563: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] /usr/local/include/blitz/array/eval.cc:600: error: no matching function=20 for call to =91blitz::_bz_update<double, double>::update(float&, double)=92 /usr/local/include/blitz/update.h:49: note: candidates are: static void=20 blitz::_bz_update<X, Y>::update(X&, Y) [with X =3D double, Y =3D double] 
From: Geoffrey M. Romer <gromer@cs...>  20060323 19:02:21

I'm a Blitz newbie, and I'm attempting to construct a stencil for a simple operation (basically, subtract the gradient of a scalar field from a vector field). I have code that I think should work, but when I compile it I get a soup of compile errors that seem to boil down to an inability to find the '' operator. I've gone through the user guide several times, and I can't figure out what I'm doing wrong. Below is a simplified version of the code that fails, along with the compile errors it produces. I'm using Blitz++ 0.9 with gcc 4.0.3. Any help would be much appreciated. snip #include <blitz/array.h> #include <blitz/tinyvec.h> using namespace blitz; BZ_DECLARE_STENCIL3(project2D, u_out, u, q) u_out = u  grad2D(q); BZ_END_STENCIL_WITH_SHAPE(shape(1,1),shape(+1,+1)) int main() { Array<TinyVector<double, 2>, 2> vectors(50, 50); vectors = TinyVector<double,2>(0,0); Array<double, 2> scalars(vectors.shape()); scalars = 0; Array<TinyVector<double, 2>, 2> result(vectors.shape()); applyStencil(project2D(), result, vectors, scalars); } pins snip $ g++ temp.cpp temp.cpp: In static member function 'static void project2D::apply(T1&, T2&, T3&, T4, T5, T6, T7, T8, T9, T10, T11) [with T1 = blitz::FastArrayIterator<blitz::TinyVector<double, 2>, 2>, T2 = blitz::FastArrayIterator<blitz::TinyVector<double, 2>, 2>, T3 = blitz::FastArrayIterator<double, 2>, T4 = blitz::dummy<double>, T5 = blitz::dummy<double>, T6 = blitz::dummy<double>, T7 = blitz::dummy<double>, T8 = blitz::dummy<double>, T9 = blitz::dummy<double>, T10 = blitz::dummy<double>, T11 = blitz::dummy<double>]': /usr/include/blitz/array/stencils.cc:382: instantiated from 'void blitz::applyStencil_imp(const T_stencil&, blitz::Array<T_numtype1, 2>&, T_array2&, T_array3&, T_array4&, T_array5&, T_array6&, T_array7&, T_array8&, T_array9&, T_array10&, T_array11&) [with T_stencil = project2D, T_numtype1 = blitz::TinyVector<double, 2>, T_array2 = blitz::Array<blitz::TinyVector<double, 2>, 2>, T_array3 = blitz::Array<double, 2>, T_array4 = blitz::dummyArray, T_array5 = blitz::dummyArray, T_array6 = blitz::dummyArray, T_array7 = blitz::dummyArray, T_array8 = blitz::dummyArray, T_array9 = blitz::dummyArray, T_array10 = blitz::dummyArray, T_array11 = blitz::dummyArray]' /usr/include/blitz/array/stencils.cc:518: instantiated from 'void blitz::applyStencil(const T_stencil&, blitz::Array<T_numtype1, N_rank>&, T_array2&, T_array3&) [with T_stencil = project2D, T_numtype1 = blitz::TinyVector<double, 2>, int N_rank = 2, T_array2 = blitz::Array<blitz::TinyVector<double, 2>, 2>, T_array3 = blitz::Array<double, 2>]' temp.cpp:20: instantiated from here temp.cpp:7: error: no match for 'operator' in 'u  blitz::grad2D(T&) [with T = blitz::FastArrayIterator<double, 2>]()' /usr/include/blitz/vecexpr.h:249: note: candidates are: blitz::_bz_VecExpr<blitz::_bz_VecExprUnaryOp<blitz::Range, blitz::_bz_negate<int> > > blitz::operator(blitz::Range) pins 
From: Julian Cummings <cummings@ca...>  20060322 20:29:18

On Wed, 20060322 at 11:24 0800, Patrik Jonsson wrote: > L.Isella wrote: > > I agree, probably I need more background in C++. > > Sorry for the offtopic question which is about to follow: I'll soon be starting a project in aerosol science which will involve a lot of fluidodynamic simulations. > > Is it a good investment to abandon Fortran 90 for C++? > > Any idea of where I could get some (simple) code to modify in order to get an idea of the pros and cons of C++ programming? > > Many thanks in advance > > Well, I'm in astrophysics, and the people who do hydro around here still > use mostly Fortran90 or in some cases F77. No C++ in those circles for > as far as the eye can see... (And then a friend of mine wrote a hydro > code in lisp, but that was mostly to prove that it could be done... ;) > > /p. I am involved in a group here that simulates fluidstructure interaction, and the fluid part involves CFD with strong shocks. We use a C++ framework to manage our adaptive mesh refinement strategy, with the underlying patchbased Euler equation solvers being written in F77 or F90. But of course, with a nice Array class like blitz, that does not need to be the case, and any of our existing solvers could easily be written with blitz. Just a matter of what the particular physicist is used to. By the way, there is a cfd.cpp example code in blitz, but it is kind of rough around the edges and was mostly written to demonstrate the idea of using blitz stencil objects for complex finitedifference stencils to hopefully improve performance. Regards, Julian C.  Dr. Julian C. Cummings Email: cummings@... California Institute of Technology Phone: 6263952543 1200 E. California Blvd., Mail Code 15879 Fax: 6265845917 Pasadena, CA 91125 Office: 125 PowellBooth 
From: Patrik Jonsson <patrik@uc...>  20060322 19:24:53

L.Isella wrote: > I agree, probably I need more background in C++. > Sorry for the offtopic question which is about to follow: I'll soon be starting a project in aerosol science which will involve a lot of fluidodynamic simulations. > Is it a good investment to abandon Fortran 90 for C++? > Any idea of where I could get some (simple) code to modify in order to get an idea of the pros and cons of C++ programming? > Many thanks in advance Well, I'm in astrophysics, and the people who do hydro around here still use mostly Fortran90 or in some cases F77. No C++ in those circles for as far as the eye can see... (And then a friend of mine wrote a hydro code in lisp, but that was mostly to prove that it could be done... ;) /p. 
From: L.Isella <L.Isella@my...>  20060322 09:42:01

Hi Lorenzo, I don't think there were any severe errors in the code snippet i sent you, so you should be able to get it to work. (I don't mean to be blunt, but since you said you are trying to write some significant code using Blitz, I suspect that if you can't get it to work you'll need to spend more time learning about Blitz and C++ in general before embarking on your project.) I agree, probably I need more background in C++. Sorry for the offtopic question which is about to follow: I'll soon be sta= rting a project in aerosol science which will involve a lot of fluidodyna= mic simulations. Is it a good investment to abandon Fortran 90 for C++? Any idea of where I could get some (simple) code to modify in order to get = an idea of the pros and cons of C++ programming? Many thanks in advance Lorenzo 
From: Lukasz Dobrek <dobrek@gm...>  20060321 16:51:19

On 3/20/06, Patrik Jonsson <patrik@...> wrote: > > For a more general solution to the saving arrays problem, you can also > check out the Boost serialization library: > > http://www.boost.org/libs/serialization/doc/index.html I already asked once, but the post didn't pass the moderator. Does anybody have code which allows to serialize in the proper way the blitz arrays, usi= ng boost serialization library. I would be very interested in looking into something like that. The proper way I mean taking into account the reference counting semantics of blitz arrays. In principle this should be doable with boost::serialization, it has a support for shared pointers for instance. But I don't know how to serialize the pointer to the dynamically allocated C style vector. I asked once on boostusers list but never got any answer. I apologize in advance, I know it is not the best place to ask, it is slightly of topic. Regards Lukasz 
From: Julian Cummings <cummings@ca...>  20060320 20:06:05

Hello Lorenzo, > Dear All, > I finally found an FFT routine using Blitz++ > (http://www.oonumerics.org/blitz/examples/fft.cpp), but when > I tried compiling and running it, I bumped into a lot of errors: > > lorenzo@...:~/Temp$ g++ fftblitz++.cpp I > /home/lorenzo/Temp/blitz0.9/ In file included from > /usr/include/c++/4.0.2/backward/iostream.h:31, > from fftblitz++.cpp:25: > /usr/include/c++/4.0.2/backward/backward_warning.h:32:2: > warning: #warning This file includes at least one deprecated > or antiquated header. Please consider using one of the 32 > headers found in section 17.4.1.2 of the C++ standard. > Examples include substituting the <X> header for the <X.h> > header for C++ includes, or <iostream> instead of the > deprecated header <iostream.h>. To disable this warning use > Wnodeprecated. > fftblitz++.cpp:194: error: an explicit specialization must > be preceded by 'template <>' > [snip] > > I think I compiled the Blitz++ library correctly and I could > run other examples, but not this one and I do not understand > what is going wrong. First, please note that this FFT example code uses template metaprogramming techniques to produce inlined code for FFTs, but does not use Blitz at all and is completely independent of Blitz. Now this code was written some time ago before C++ compilers were fully enforcing a C++ ANSI standard. To make it standard compliant, you simply need to do as suggested by the error messages and insert "template <>" before each explicit template specialization. I just made these changes myself in the file and now it compiles properly under g++. I checked in the changes, but it may take some time to be reflected on the web site. > Furthermore, can anyone please come forward with a code to > save data arrays in a file? > I worked on the suggestions someone replied to me, but I have > not been able to fix those lines myself. > However, I cannot believe that nobody ever needed to save the > content of a Blitz++ array of numbers. > Many thanks for your cooperation. What was wrong with the suggestion that was posted earlier? Does it not work for you somehow? The blitz Array has a builtin operator<< method for output, but this does the output in a formatted style that is suitable for human reading. The suggestion from Patrik Jonsson showed how to dump raw Array data into a file in binary format. If you do dump the data out in this way, of course, you need to know what metadata is included so that you can read the data back in later and reconstruct the Array. It has been suggested that we could provide support for Boost serialization of blitz Arrays, but no one has stepped forward with an implementation of this as of yet. It is probably not hard to do, but I don't have time myself to investigate this right now. Regards, Julian C. Dr. Julian C. Cummings Staff Scientist, CACR/Caltech (626) 3952543 cummings@... 
From: Patrik Jonsson <patrik@uc...>  20060320 19:39:16

L.Isella wrote: > I think I compiled the Blitz++ library correctly and I could run other examples, but not this one and I do not understand what is going wrong. > Furthermore, can anyone please come forward with a code to save data arrays in a file? > I worked on the suggestions someone replied to me, but I have not been able to fix those lines myself. > However, I cannot believe that nobody ever needed to save the content of a Blitz++ array of numbers. > Many thanks for your cooperation. Hi Lorenzo, I don't think there were any severe errors in the code snippet i sent you, so you should be able to get it to work. (I don't mean to be blunt, but since you said you are trying to write some significant code using Blitz, I suspect that if you can't get it to work you'll need to spend more time learning about Blitz and C++ in general before embarking on your project.) For a more general solution to the saving arrays problem, you can also check out the Boost serialization library: http://www.boost.org/libs/serialization/doc/index.html cheers, /Patrik 
From: L.Isella <L.Isella@my...>  20060317 22:32:23

Dear All, I finally found an FFT routine using Blitz++ (http://www.oonumerics.org/bli= tz/examples/fft.cpp), but when I tried compiling and running it, I bumped= into a lot of errors: lorenzo@...:~/Temp$ g++ fftblitz++.cpp I /home/lorenzo/Temp/blitz0.9/ In file included from /usr/include/c++/4.0.2/backward/iostream.h:31, from fftblitz++.cpp:25: /usr/include/c++/4.0.2/backward/backward_warning.h:32:2: warning: #warning = This file includes at least one deprecated or antiquated header. Please c= onsider using one of the 32 headers found in section 17.4.1.2 of the C++ = standard. Examples include substituting the <X> header for the <X.h> head= er for C++ includes, or <iostream> instead of the deprecated header <iost= ream.h>. To disable this warning use Wnodeprecated. fftblitz++.cpp:194: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:195: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:196: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:197: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:198: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:199: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:200: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:201: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:202: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:203: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:204: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:205: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:206: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:207: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:208: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:209: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:255: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:293: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:314: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:335: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:375: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:409: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 fftblitz++.cpp:436: error: an explicit specialization must be preceded by = =E2=80=98template <>=E2=80=99 The first sequences of lines mentioned in the output, where the errors take= s place, correspond to the code lines: template<unsigned N> class bitNum { public: enum _b { nbits =3D 0 }; }; class bitNum<1U> { public: enum _b { nbits =3D 16 }; }; class bitNum<2U> { public: enum _b { nbits =3D 15 }; }; class bitNum<4U> { public: enum _b { nbits =3D 14 }; }; class bitNum<8U> { public: enum _b { nbits =3D 13 }; }; class bitNum<16U> { public: enum _b { nbits =3D 12 }; }; class bitNum<32U> { public: enum _b { nbits =3D 11 }; }; class bitNum<64U> { public: enum _b { nbits =3D 10 }; }; class bitNum<128U> { public: enum _b { nbits =3D 9 }; }; class bitNum<256U> { public: enum _b { nbits =3D 8 }; }; class bitNum<512U> { public: enum _b { nbits =3D 7 }; }; class bitNum<1024U> { public: enum _b { nbits =3D 6 }; }; class bitNum<2048U> { public: enum _b { nbits =3D 5 }; }; class bitNum<4096U> { public: enum _b { nbits =3D 4 }; }; class bitNum<8192U> { public: enum _b { nbits =3D 3 }; }; class bitNum<16384U> { public: enum _b { nbits =3D 2 }; }; class bitNum<32768U> { public: enum _b { nbits =3D 1 }; }; I think I compiled the Blitz++ library correctly and I could run other exam= ples, but not this one and I do not understand what is going wrong. Furthermore, can anyone please come forward with a code to save data arrays= in a file? I worked on the suggestions someone replied to me, but I have not been able= to fix those lines myself. However, I cannot believe that nobody ever needed to save the content of a = Blitz++ array of numbers. Many thanks for your cooperation. Lorenzo 
From: Patrik Jonsson <patrik@uc...>  20060313 18:21:40

Hi, L.Isella wrote: > Dear All, > I am fairly new to C and C++. I have some numerical experience (mainly based on nonlinear problems (e.g. GrossPitaevskii equation (GPE), which is a nonlinear Schroedinger equation)), multivariate statistics and eigenvalue problems. > I used to use Fortran as a programming language, but I am now delving into OOP and I bumped into blitz++ when looking for online resources for diffusive problems, improved performace etc... > I recently discovered how arrays are declared in C++ [at first I was a bit confused by the declaration Array<double,1> a(N+2)]. > As far as I understand, this array class should provide one with superior performance and it should also avoid the risk of overstepping the array boundaries. > But how do you save this array into a data file? > I found online codes to save a "classical" double a[NN] into a file, but I could not get them working with a blitz++ array. To save an array, you could do something like this (I'm writing this off the cuff so be prepared to experiment): void save(const Array<T,N>& a){ ofstream f("file"); // make sure array is contiguous a.reference(a.copy()); // first write size to file const TinyVector<int,N> s=a.shape(); f.write(reinterpret_cast<const char*>(&s[0]),sizeof(TinyVector<int,N>)); // and then the data pointed to f.write(reinterpret_cast<const char*>(a.dataFirst()),a.size()); } reading it back in is more complicated since you have to (re)allocate the memory, too: Array<T,N> read(){ ifstream f("file"); // read shape TinyVector<int,N> s; f.read(reinterpret_cast<const char*>(&s[0]),sizeof(TinyVector<int,N>)); // and data const int n=product(s); T* d=new T[n]; f.read(reinterpret_cast<const char*>(d),sizeof(T)*n); // and create array return Array<T,N>(d,s,deleteDataWhenDone); } Hope that provides some inspiration or leads for how to do it. Can't help you with problem 2. cheers, /Patrik 
From: L.Isella <L.Isella@my...>  20060312 11:34:23

Dear All, I am fairly new to C and C++. I have some numerical experience (mainly bas= ed on nonlinear problems (e.g. GrossPitaevskii equation (GPE), which is= a nonlinear Schroedinger equation)), multivariate statistics and eigenva= lue problems. I used to use Fortran as a programming language, but I am now delving into = OOP and I bumped into blitz++ when looking for online resources for diffu= sive problems, improved performace etc... I recently discovered how arrays are declared in C++ [at first I was a bit = confused by the declaration Array<double,1> a(N+2)]. As far as I understand, this array class should provide one with superior p= erformance and it should also avoid the risk of overstepping the array bo= undaries. But how do you save this array into a data file? I found online codes to save a "classical" double a[NN] into a file, but I = could not get them working with a blitz++ array. ***************************************************************************= ********** I implemented the Fourier SplitStep Method (FSSM) in order to solve the GP= E both in real and imaginary time using the GSL (GNU Scientific library). However, the implementation was a bit cumbersome as you do not have complex= arrays in "natural" C. I then found the blitz++ code (which I still have to look at in detail) htt= p://www.oonumerics.org/blitz/examples/fft.cpp I wonder if anyone else inside this mailing list has already used it in ord= er to implement the FSSM and if there is any particular caveat I should b= e aware of. Apologies for the long email mixing OOP and maths questions, but I am tryin= g to get started. Many thanks Lorenzo 
From: Jan Kuiken <jan.kuiken@ch...>  20060309 08:23:48

Hi Koen, see my previous posting on this topic: http://sourceforge.net/mailarchive/forum.php?thread_id=9797022&forum_id=45523 I have not used it extensively, but it works well. (besides a few compiler warnings) Regards, Jan Kuiken e jan.kuiken@... Koen Tanghe wrote: > Hi, > I read a few things recently about Visual Studio 2005 and Blitz++, and > was wondering: could anyone actually using this combination comment of > the current state? Does everything now really build as expected? Does > everything also work in practice? Experiences? > I'm just looking for firsthand experience before jumping into using > this combination. > Koen 
From: Koen Tanghe <Koen.Tanghe@UGent.be>  20060308 17:58:27

Hi, I read a few things recently about Visual Studio 2005 and Blitz++, and was wondering: could anyone actually using this combination comment of the current state? Does everything now really build as expected? Does everything also work in practice? Experiences? I'm just looking for firsthand experience before jumping into using this combination. Koen 