init.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /**
  2. * This file is part of Gomu.
  3. *
  4. * Copyright 2016 by Jean Fromentin <jean.fromentin@math.cnrs.fr>
  5. *
  6. * Gomu is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Gomu is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Gomu. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include "../../module.hpp"
  20. #include "flint.hpp"
  21. #include <sstream>
  22. using namespace std;
  23. //******************
  24. //* Global objects *
  25. //******************
  26. extern Gomu::Type* type_ZPoly;
  27. extern Gomu::Type* type_ZPolyFact;
  28. extern Gomu::Type* type_ZRatFrac;
  29. extern Gomu::Type* type_ZMatrix;
  30. extern Gomu::Type* type_ZPolyMat;
  31. string dispPoly(void*);
  32. void delPoly(void*);
  33. void* copyPoly(void*);
  34. int cmpPoly(void*,void*);
  35. string dispPolyFact(void*);
  36. void delPolyFact(void*);
  37. void* copyPolyFact(void*);
  38. int cmpPolyFact(void*,void*);
  39. string dispRat(void*);
  40. void delRat(void*);
  41. void* copyRat(void*);
  42. int cmpRat(void*,void*);
  43. string dispMatrix(void*);
  44. void delMatrix(void*);
  45. void* copyMatrix(void*);
  46. int cmpMatrix(void*,void*);
  47. string dispPolyMatrix(void*);
  48. void delPolyMatrix(void*);
  49. void* copyPolyMatrix(void*);
  50. int cmpPolyMatrix(void*,void*);
  51. //--- Matrix member functions ---//
  52. void* charpoly(void*);
  53. void* toSage(void*);
  54. void* toPolyMatrix(void*);
  55. //--- Polynomial member functions ---/
  56. void* factorize(void*);
  57. inline string dispPoly(void* P){return display((fmpz_poly_struct*)P);}
  58. inline void delPoly(void* v){fmpz_poly_clear((fmpz_poly_struct*)v);}
  59. inline int cmpPoly(void* v1,void* v2){return cmp((fmpz_poly_struct*)v1,(fmpz_poly_struct*)v2);}
  60. inline string dispPolyFact(void* P){return display((fmpz_poly_factor_struct*)P);}
  61. inline void delPolyFact(void* v){fmpz_poly_factor_clear((fmpz_poly_factor_struct*)v);}
  62. inline int cmpPolyFact(void* v1,void* v2){return cmp((fmpz_poly_factor_struct*)v1,(fmpz_poly_factor_struct*)v2);}
  63. inline string dispRat(void* R){return display((fmpz_poly_q_struct*)R);}
  64. inline void delRat(void* v){fmpz_poly_q_clear((fmpz_poly_q_struct*)v);}
  65. inline int cmpRat(void* v1,void* v2){return cmp((fmpz_poly_q_struct*)v1,(fmpz_poly_q_struct*)v2);}
  66. inline string dispMatrix(void* v){return display((fmpz_mat_struct*)v);}
  67. inline void delMatrix(void* v){fmpz_mat_clear((fmpz_mat_struct*)v);}
  68. inline int cmpMatrix(void* v1,void* v2){return cmp((fmpz_mat_struct*)v1,(fmpz_mat_struct*)v2);}
  69. inline string dispPolyMatrix(void* v){return display((fmpz_poly_mat_struct*)v);}
  70. inline void delPolyMatrix(void* v){fmpz_poly_mat_clear((fmpz_poly_mat_struct*)v);}
  71. inline int cmpPolyMatrix(void* v1,void* v2){return cmp((fmpz_poly_mat_struct*)v1,(fmpz_poly_mat_struct*)v2);}