行列反転にSuperLUを使用しようとしていますが、最終結果にアクセスできません。それは反転のためのいくつかの構造を使用し、私は答えが構造内にあることを知っているが、私はそれを参照することはできません。 STYPE店舗変化の構造に基づいて別の構造体の内部にある構造体内の要素にポインタとしてアクセスするにはどうすればよいですか?
typedef struct {
Stype_t Stype; /* Storage type: indicates the storage format of *Store. */
Dtype_t Dtype; /* Data type. */
Mtype_t Mtype; /* Mathematical type */
int nrow; /* number of rows */
int ncol; /* number of columns */
void *Store; /* pointer to the actual storage of the matrix */
} SuperMatrix;
:
Bされるフォーマットを有するsupermatrixとして定義しています。その結果
typedef struct {
int lda; /* leading dimension */
void *nzval; /* array of size lda-by-ncol to represent
a dense matrix */
} DNformat;
Bの最終的な構造は次のようになります。:構造体は、あるストア*のために使用さBの
B = { Stype = SLU_NC; Dtype = SLU_D; Mtype = SLU_GE; nrow = 5; ncol = 5;
*Store = { lda = 12;
nzval = [ 19.00, 12.00, 12.00, 21.00, 12.00, 12.00, 21.00,
16.00, 21.00, 5.00, 21.00, 18.00 ];
}
}
今私はnzvalから値をコピーしたいが、私はわかりませんの仕方。
私はB.Store.nzvalを実行しようとしましたが、エラーがある「何かのメンバーの要求「`nzvalない構造体または共用体」
またDNformat **g = B.Store;
int *r = *(g->nzval);
といくつか他のもののようにこれをどのようにするかはわかりません。
ありがとうございます!
他の質問にお答えします。オリは正しい情報を持っています。 – Suroot