2012-01-17 15 views
1

(二進数が2を法)マトリクス行に線形演算

[C1|C2|C3|C4|C5|C6|C7] 
R1: [1 |0 | 0| 0| 0| 0|1 ] 
R2: [1 |0 | 0| 0| 0| 0|1 ] 
R3: [1 |0 | 0| 0| 0| 0|1 ] 
R4: [1 |0 | 0| 0| 0| 0|1 ] 

1)R1、R2、R3、R4

2)R1 + R2、R1 + R3、R1 + R4、 R2 + R3、R2 + R4、 R3 + R4

3)R1 + R2 + R3、R1 + R2 + R4、 R1 + R3 + R4

4)R1 + R2 + R3 + R4

i)が...

bool Util::binomialTree(int start, int end, int depth, 
     int *tab_index, vector<YNumber*> resultatY, int size_factor, mpz_t n){ 
    int i; 
    // tab_index contains all the index of the 
    // matrix and depth contains the index numbers in tab_index 
    // computation here 
    for (i = start + 1; i < end; i++){ 
      if (binomialTree (i, end, depth + 1,tab_index, 
         resultatY, size_factor, n)){ 
       return true; 
      } 
    } 
    return false; 
} 

はあなたが効率的なアルゴリズムを提案することができます(約〜50000 * 50000)私は二項ツリーを使用しますが、マトリックスが巨大であるため、それは本当に遅いのですか?

+0

バイナリ行列(2^NumberOfRows)またはすべての線形結合のリストの行の線形結合の数を探していますか(これは非常に大きなNumberOfRowsビット数字と1桁の数字を印刷します)? – Kaganar

答えて

0

私は文字が行列の座標であるプレフィックスツリーを考えています。ツリーに追加するときに、次の座標の値を父ノードの値に追加します。この方法では、(R1 + R2 + R3 + R4)と(R1 + R2 + R3 + R4 + R5)に1回だけ(R1 + R2 + R3)を数える必要があります。

私はあなたが二項ツリーを選んだ理由を説明するために...これは理解できる

ケアを願っていますか?

関連する問題