1 /* tests/test-givaropoly.C
2  * Copyright (C) 2014 Gavin Harrison,
3  *
4  * Written by Gavin Harrison <gmh33@drexel.edu>,
5  *
6  * ========LICENCE========
7  * This file is part of the library LinBox.
8  *
9  * LinBox is free software: you can redistribute it and/or modify
10  * it under the terms of the  GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22  * ========LICENCE========
23  *.
24  */
25 
26 
27 /*! @file  tests/test-gf2.C
28  * @ingroup tests
29  * @brief  no doc
30  * @test NO DOC
31  */
32 
33 
34 
35 #include "linbox/linbox-config.h"
36 
37 #include <iostream>
38 #include <fstream>
39 #include <sstream>
40 
41 #include <queue>
42 
43 #include "givaro/givpoly1.h"
44 #include "givaro/gfq.h"
45 
46 #include "test-field.h"
47 
48 using namespace LinBox;
49 
main(int argc,char ** argv)50 int main (int argc, char **argv)
51 {
52 	static int p = 13;
53 	static int e = 1;
54 
55 	static Argument args[] = {
56 		{ 'p', "-p P", "Set the base field prime.", TYPE_INT, &p },
57 		{ 'e', "-e E", "Set the base field exponent.", TYPE_INT, &e },
58 		END_OF_ARGUMENTS
59 	};
60 
61 	parseArguments (argc, argv, args);
62 
63 	commentator().start("GivaroPoly field test suite", "GivaroPoly");
64 	bool pass = true;
65 
66 	typedef Givaro::GFqDom<int64_t> BaseDom;
67 	typedef typename Givaro::Poly1Dom<BaseDom, Givaro::Dense> PolyDom;
68 	typedef typename Givaro::Poly1Dom<PolyDom, Givaro::Dense> Bivariate;
69 
70 	BaseDom GFq(p, e);
71 	PolyDom Poly(GFq);
72 	Bivariate F(Poly);
73 
74 	// Make sure some more detailed messages get printed
75 	commentator().getMessageClass (INTERNAL_DESCRIPTION).setMaxDepth (4);
76 	commentator().getMessageClass (INTERNAL_DESCRIPTION).setMaxDetailLevel (Commentator::LEVEL_UNIMPORTANT);
77 
78 	commentator().start ("Testing GivaroPoly", "main", 10);
79 
80 	if ( not testRing (F, "GivaroPoly"))
81 		pass = false;
82 	commentator().progress ();
83 
84 	commentator().stop("GivaroPoly field test suite");
85 	return pass ? 0 : -1;
86 }
87 
88 // Local Variables:
89 // mode: C++
90 // tab-width: 4
91 // indent-tabs-mode: nil
92 // c-basic-offset: 4
93 // End:
94 // vim:sts=4:sw=4:ts=4:et:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
95