複数の blitz++ 配列を含む構造体が必要です。このプログラムはそのような構造体を作成しますが、オブジェクトを適切に割り当てることができません。構造体の外部に割り当てられた blitz++ 配列へのポインターを使用して構造体を定式化する唯一の代替手段はありますか?
#include <iostream>
#include <blitz/array.h>
using namespace std;
using namespace blitz;
struct Bstruct{
Array<double,1> B;
};
int main(){
Bstruct str;
Array<double,1> x(10);
x = 1.0;
str.B = x;
cout << "x = " << x << endl;
cout << "str.B = " << str.B << endl;
return 0;
}
➜ blitz_struct git:(master) ✗ ./struct
x = (0,9)
[ 1 1 1 1 1 1 1 1 1 1 ]
str.B = (0,-1)
[ ]