Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
840 changes: 76 additions & 764 deletions Makefile.in

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions src/flintxx/evaluation_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@

// This file contains helpers for evaluating expression templates.

#ifndef CXX_EVALUATION_TOOLS_H
#define CXX_EVALUATION_TOOLS_H
#ifndef EVALUATION_TOOLS_H
#define EVALUATION_TOOLS_H

#include <iostream>
#include <type_traits>
#include <utility>

#include "../flint.h" // FLINT_MAX and FLINT_MIN
#include <flint/flint.h> // FLINT_MAX and FLINT_MIN
#include <flint/fmpz.h> // fmpz_t

#include "expression_traits.h"
#include "mp.h"
#include "rules.h"
#include "tuple.h"
#include <expression_traits.h>
#include <mp.h>
#include <rules.h>
#include <tuple.h>
#include <flint_exception.h>

namespace flint {
namespace mp {
Expand Down
2 changes: 1 addition & 1 deletion src/flintxx/flint_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Contrary to other parts of this library, they are tailored very
// specifically towards FLINT.

#include "../flint.h"
#include <flint/flint.h>
#include "mp.h"
#include "expression.h"
#include "expression_traits.h"
Expand Down
13 changes: 10 additions & 3 deletions src/flintxx/frandxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#ifndef CXX_FRANDXX_H
#define CXX_FRANDXX_H
#ifndef FRANDXX_H
#define FRANDXX_H

#include "../flint.h"
#include <stdexcept>

#include <flint/flint.h>
#include <flint/fmpz.h>
#include <gmp.h>

#include <flint_exception.h>
#include <mp.h>

// This class contains a first-class wrapper of flint_rand_t.
// Note that frandxx is not copyable.
Expand Down
22 changes: 18 additions & 4 deletions src/flintxx/test/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,30 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#ifndef CXX_TEST_HELPERS_H
#define CXX_TEST_HELPERS_H
#ifndef HELPERS_H
#define HELPERS_H

#include <iostream>
#include <fstream>
#include <string>
#include <streambuf>
#include <cstdlib>

#include "flintxx/flint_classes.h"
#include <vector>
#include <set>
#include <sstream>

#include <flintxx.h>
#include <fmpzxx.h>
#include <fmpqxx.h>
#include <nmod_polyxx.h>
#include <fmpz_mod_polyxx.h>
#include <fmpq_polyxx.h>
#include <fmpz_polyxx.h>
#include <padicxx.h>
#include <qadicxx.h>
#include <flint_classes.h>

#include "myint.h"

#ifndef EXIT_STATEMENT
#define EXIT_STATEMENT std::exit(1)
Expand Down
26 changes: 17 additions & 9 deletions src/flintxx/test/t-codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <string>
#include <sstream>
#include <vector>
#include <set>


// whether or not the compiler suppors __attribute__(__optimize__(..))
Expand Down Expand Up @@ -58,17 +59,24 @@ class skippable_exception
skippable_exception(const std::string& n) : std::runtime_error(n) {}
};

#include "flintxx/test/helpers.h"
#include <flintxx.h>
#include <fmpzxx.h>
#include <fmpqxx.h>
#include <nmod_polyxx.h>
#include <fmpz_mod_polyxx.h>
#include <fmpq_polyxx.h>
#include <fmpz_polyxx.h>
#include <fmpz_matxx.h>
#include <nmod_matxx.h>
#include <nmod_vecxx.h>

#include "fmpz_matxx.h"
#include "fmpz_polyxx.h"
#include "fmpzxx.h"
#include "nmod_matxx.h"
#include "nmod_polyxx.h"
#include "nmod_vecxx.h"
#include "helpers.h"

#include "flintxx/tuple.h"
#include "flintxx/vector.h"
#include <rules.h>
#include <expression_traits.h>

#include <tuple.h>
#include <vector.h>

// Run a command and recver the output.
std::string exec(const std::string& cmd)
Expand Down
7 changes: 0 additions & 7 deletions src/flintxx/test/t-dummy.c

This file was deleted.

8 changes: 6 additions & 2 deletions src/flintxx/test/t-expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include<sstream>
#include <iostream>
#include <sstream>

#include <expression.h>
#include <fmpzxx.h>
#include <tuple.h>

#include "flintxx/expression.h"
#include "flintxx/tuple.h"

#include "flintxx/test/helpers.h"
Expand Down
9 changes: 7 additions & 2 deletions src/flintxx/test/t-flint_classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
*/

#include <iostream>
#include "flintxx/test/helpers.h"
#include "fmpzxx.h"
#include <vector>
#include <set>

#include "helpers.h"

#include <fmpzxx.h>
#include <flint_classes.h>

using namespace flint;

Expand Down
10 changes: 7 additions & 3 deletions src/flintxx/test/t-forwarding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
// test file.

#include <iostream>
#include <vector>
#include <set>
#include <sstream>

#include "flintxx/forwarding.h"
#include <forwarding.h>
#include <fmpzxx.h>
#include <fmpqxx.h>

#include "flintxx/test/myint.h"
#include "flintxx/test/helpers.h"
#include "helpers.h"
#include "myint.h"

using namespace flint;

Expand Down
10 changes: 6 additions & 4 deletions src/flintxx/test/t-ltuple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include "flintxx/ltuple.h"
#include "fmpzxx.h"
#include <iostream>

#include "flintxx/test/helpers.h"
#include "flintxx/test/myint.h"
#include <ltuple.h>
#include <fmpzxx.h>

#include "helpers.h"
#include "myint.h"

using namespace flint;

Expand Down
7 changes: 5 additions & 2 deletions src/flintxx/test/t-mp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include "flintxx/test/helpers.h"
#include "flintxx/mp.h"
#include <iostream>

#include "helpers.h"
#include <mp.h>
#include "myint.h"

using namespace flint;
using namespace mp;
Expand Down
8 changes: 6 additions & 2 deletions src/flintxx/test/t-permxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
*/

#include <iostream>
#include <vector>
#include <set>

#include "permxx.h"
#include "flintxx/test/helpers.h"
#include <permxx.h>
#include <fmpzxx.h>

#include "helpers.h"

using namespace flint;

Expand Down
17 changes: 14 additions & 3 deletions src/flintxx/test/t-traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include "flintxx/test/helpers.h"
#include "flintxx/traits.h"
#include "flintxx/mp.h"
#include <flintxx.h>
#include <fmpzxx.h>
#include <fmpqxx.h>
#include <nmod_polyxx.h>
#include <fmpz_mod_polyxx.h>
#include <fmpq_polyxx.h>
#include <fmpz_polyxx.h>
#include <padicxx.h>
#include <qadicxx.h>

#include "helpers.h"

#include <traits.h>
#include <mp.h>

using namespace flint;
using namespace traits;
Expand Down
15 changes: 12 additions & 3 deletions src/flintxx/test/t-tuple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include <iostream>
#include <vector>
#include <set>

#include "flintxx/test/helpers.h"
#include "flintxx/tuple.h"
#include "flintxx/mp.h"
#include <flintxx.h>
#include <fmpzxx.h>
#include <fmpqxx.h>
#include <nmod_polyxx.h>

#include "helpers.h"

#include <tuple.h>
#include <ltuple.h>
#include <mp.h>

using namespace flint;
using namespace mp;
Expand Down
12 changes: 6 additions & 6 deletions src/flintxx/test/t-vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include <sstream>
#include <iostream>
#include <vector>
#include <set>

#include "flintxx/vector.h"

#include "flintxx/test/helpers.h"
#include "flintxx/test/myint.h"
#include "fmpz_vecxx.h"
#include <vector.h>
#include <fmpz_vecxx.h>
#include "helpers.h"

using namespace flint;

Expand Down
21 changes: 13 additions & 8 deletions src/flintxx_public/arithxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@
#ifndef ARITHXX_H
#define ARITHXX_H

#include "arith.h"

#include "fmpq_polyxx.h"
#include "fmpqxx.h"
#include "fmpz_matxx.h"
#include "fmpz_vecxx.h"
#include "fmpzxx.h"
#include "nmod_vecxx.h"
#include <iostream>

#include <flint/flint.h>
#include <flint/arith.h>
#include <flint/fmpz.h>

#include <flintxx.h>
#include <fmpzxx.h>
#include <fmpqxx.h>
#include <fmpq_polyxx.h>
#include <fmpz_matxx.h>
#include <fmpz_vecxx.h>
#include <nmod_vecxx.h>

// TODO namespace arith?
// TODO arith_hrr_expsum_factored
Expand Down
16 changes: 10 additions & 6 deletions src/flintxx_public/fmpq_matxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@
*/

#ifndef FMPQ_MATXX_H
#define FMPQ_MATXX_H FMPQ_MATXX_H
#define FMPQ_MATXX_H

#include "fmpq_mat.h"
#include <flint/fmpq_mat.h>

#include "fmpqxx.h"
#include "fmpz_matxx.h"
#include "fmpz_vecxx.h"
#include <flintxx.h>
#include <fmpqxx.h>
#include <fmpz_matxx.h>
#include <fmpz_vecxx.h>
#include <ltuple.h>
#include <matrix.h>

#include <vector>

#include "flintxx/ltuple.h"
#include "flintxx/matrix.h"

// TODO wrap entry_num, entry_den?
// TODO numden_rowwise_2
Expand Down
15 changes: 9 additions & 6 deletions src/flintxx_public/fmpq_polyxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#ifndef FMPQ_POLYXX_H
#define FMPQ_POLYXX_H

#include <cstdlib>
#include <string>

#include "flint.h"
#include "fmpq_poly.h"
#include "flint/flint.h"
#include "flint/fmpq_poly.h"

#include "flintxx.h"
#include "fmpqxx.h"
#include "fmpz_polyxx.h"
#include "fmpzxx.h"
#include "fmpq_matxx.h"

#include <vector>
#include <stdexcept>

#include "flintxx/expression.h"
#include "flintxx/flint_classes.h"
Expand Down
Loading