By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 1,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

Any Blitz++ and TVMET experts out there?

P: n/a
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<double,3, 3mtr_type;
typedef blitz::Array<mtr_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<double,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
Share this Question
Share on Google+
2 Replies


P: n/a
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<double,3, 3mtr_type;
typedef blitz::Array<mtr_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<double,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<double,2mat(3,3);
};

This is legal

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

HTH

john
Mar 10 '07 #2

P: n/a
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<double,3, 3mtr_type;
typedef blitz::Array<mtr_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<double,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<double,2mat(3,3);
};

This is legal

class X
{
X() : mat(3,3) {}
blitz::Array<double,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 discussion thread is closed

Replies have been disabled for this discussion.