473,626 Members | 3,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any Blitz++ and TVMET experts out there?

dss
I'm trying to compile some code that I downloaded. The code uses
Blitz++ and tvmet to manipulate arrays. I have never worked with either
of these, and I am having trouble getting both of these to work. When I
compile the code, I get a compiler error in the tvmet files. Instead of
trying to figure out what is going on with tvmet, I decided to do
everything with blitz. Which is also not working out. I am hoping that
someone can provide some insight into what I am doing wrong.
For example, I removed the following code.

typedef tvmet::Matrix<d ouble,3, 3mtr_type;
typedef blitz::Array<mt r_type,2matrix;
..
..
..
mutable matrix mat;

If I correctly understand the above code then "mat" is a 3 by 3 array.
I replaced this code with

blitz::Array<do uble,2mat(3,3);

Which gave me the error message 'The text "3" is unexpected'.

Any insight into the problem would be appreciated.
Mar 9 '07 #1
2 1953
dss wrote:
I'm trying to compile some code that I downloaded. The code uses
Blitz++ and tvmet to manipulate arrays. I have never worked with either
of these, and I am having trouble getting both of these to work. When I
compile the code, I get a compiler error in the tvmet files. Instead of
trying to figure out what is going on with tvmet, I decided to do
everything with blitz. Which is also not working out. I am hoping that
someone can provide some insight into what I am doing wrong.
For example, I removed the following code.

typedef tvmet::Matrix<d ouble,3, 3mtr_type;
typedef blitz::Array<mt r_type,2matrix;
.
.
.
mutable matrix mat;

If I correctly understand the above code then "mat" is a 3 by 3 array.
I replaced this code with

blitz::Array<do uble,2mat(3,3);

Which gave me the error message 'The text "3" is unexpected'.

Any insight into the problem would be appreciated.
I would guess that mat exists in a class, right? I'm guessing this
because of the use of the keyword mutable.

If so then you do not construct class members where you declare them,
you do so in a constructor initalisation list instead.

This is illegal

class X
{
X() {}
blitz::Array<do uble,2mat(3,3);
};

This is legal

class X
{
X() : mat(3,3) {}
blitz::Array<do uble,2mat;
};

HTH

john
Mar 10 '07 #2
dss
John Harrison wrote:
dss wrote:
>I'm trying to compile some code that I downloaded. The code uses
Blitz++ and tvmet to manipulate arrays. I have never worked with either
of these, and I am having trouble getting both of these to work. When I
compile the code, I get a compiler error in the tvmet files. Instead of
trying to figure out what is going on with tvmet, I decided to do
everything with blitz. Which is also not working out. I am hoping that
someone can provide some insight into what I am doing wrong.
For example, I removed the following code.

typedef tvmet::Matrix<d ouble,3, 3mtr_type;
typedef blitz::Array<mt r_type,2matrix;
.
.
.
mutable matrix mat;

If I correctly understand the above code then "mat" is a 3 by 3 array.
I replaced this code with

blitz::Array<d ouble,2mat(3,3) ;

Which gave me the error message 'The text "3" is unexpected'.

Any insight into the problem would be appreciated.


I would guess that mat exists in a class, right? I'm guessing this
because of the use of the keyword mutable.

If so then you do not construct class members where you declare them,
you do so in a constructor initalisation list instead.

This is illegal

class X
{
X() {}
blitz::Array<do uble,2mat(3,3);
};

This is legal

class X
{
X() : mat(3,3) {}
blitz::Array<do uble,2mat;
};

HTH

john

Yes. You are correct. I guess my understanding of
"tvmet::Matrix< double,3, 3>" must be incorrect. Thanks John
Mar 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
961
by: blitz-dev-bounces | last post by:
Your mail to 'Blitz-dev' with the subject Re: Your archive Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list
6
4323
by: Steven T. Hatton | last post by:
I bought Josuttis's book on the repeated recommendations of people in this newsgroup. http://www.josuttis.com/libbook/ One of the first things I looked up was the std::valarray<>. And what I read is that he questions the worth of the valarray. http://www.cs.bsu.edu/homepages/peb/cplusplus/headers/valarray.htm
0
1308
by: Florian | last post by:
Hi, My first experiences with Blitz++ http://sourceforge.net/projects/blitz/ show both flexibility and high performance. But I also need a good Iterative solver library like Gmm++ for solving large sparse linear systems :
6
2733
by: Guch | last post by:
I'll swictch from Matlab to C++. So I want to find a matrix library of C++, Whitch can process images conveniently as Matlab does. I've googled, and found that Blitz++ and MTL are popular and powerful. I want to know whitch of them fit for image processing better. Or have other choices? Any suggestion whill be appreciated.
7
2840
by: Guch Wu | last post by:
Array<unsigned char,2> A(10,10); unsigned char* rawdata; rawdata = new (unsinged char); Can I extract data in A to rawdata without using for loop?
0
1547
by: monkeyboy | last post by:
Hello, I'm a new scipy user, and I'm trying to speed up some array code with weave. I'm running xp with gcc from cgywin, and scipy.weave.test() returns an OK status. I'm trying to speed up the code below. I've found a couple of examples of weave on the web, and I think it should be straight forward, but I keep getting the following error when calling weave.blitz(expr). It's complaining about the variable being assigned, I've tried...
4
1467
by: alexjcollins | last post by:
The following program demonstrates the problem: #include <vector> #include <iostream> #include <tvmet/Vector.h> typedef tvmet::Vector<double, 3Vector3d; class Mesh {
0
8269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8203
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8642
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7203
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5576
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2630
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1515
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.