コード例 #1
0
ファイル: MatrixTest.c プロジェクト: JamesHirschorn/QFCL
NTL_CLIENT

int main()
{
   mat_ZZ B, X;
   vec_ZZ v, w;

   cin >> B;
   cin >> v;

   ZZ d;

   double t;
   cerr << "matrix inverse...";
   t = GetTime();
   inv(d, X, B);
   cerr << (GetTime()-t) << "\n";

   cout << d << "\n";
   cout << X << "\n";

   cout << "\n\n\n";

   cerr << "hensel solve...";
   t = GetTime();
   HenselSolve1(d, w, B, v);
   cerr << (GetTime()-t) << "\n";

   cout << d << "\n";
   cout << w << "\n";

   cout << "\n\n\n";

   ZZX f;

   cerr << "char poly...";
   t = GetTime();
   CharPoly(f, B);
   cerr << (GetTime()-t) << "\n";

   cout << f << "\n";

   cout << "\n\n\n";

   cerr << "HNF...";
   t = GetTime();
   HNF(X, B, d);
   cerr << (GetTime()-t) << "\n";

   cout << X;

   return 0;
}
コード例 #2
0
ファイル: ntlwrap.cpp プロジェクト: saraedum/sage-renamed
static CYTHON_INLINE mat_ZZ* mat_ZZ_HNF(const mat_ZZ* A, const struct ZZ* D)
{
    mat_ZZ* W = new mat_ZZ();
    HNF(*W, *A, *D);
    return W;
}