Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Path: gap4r8 / pkg / NormalizInterface-1.0.2 / Normaliz.git / DST / include / libnormaliz / nmz_integrate.h
Views: 418423/*1* nmzIntegrate2* Copyright (C) 2012-2014 Winfried Bruns, Christof Soeger3* This program is free software: you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation, either version 3 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program. If not, see <http://www.gnu.org/licenses/>.15*16* As an exception, when this program is distributed through (i) the App Store17* by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or (iii) Google Play18* by Google Inc., then that store may impose any digital rights management,19* device limits and/or redistribution restrictions that are required by its20* terms of service.21*/2223#ifndef NMZ_INTEGRATE_H24#define NMZ_INTEGRATE_H2526#ifdef NMZ_COCOA2728#include "CoCoA/library.H"29using namespace CoCoA;3031#include <fstream>32#include <sstream>33#include<string>34#include <gmpxx.h>3536#include <boost/dynamic_bitset.hpp>3738#include "libnormaliz/libnormaliz.h"39#include "libnormaliz/HilbertSeries.h"40#include "libnormaliz/matrix.h"4142#include "libnormaliz/my_omp.h"4344using namespace std;4546namespace libnormaliz {4748typedef unsigned int key_type;4950bool verbose_INT;5152struct SIMPLINEXDATA_INT{ // local data of excluded faces53boost::dynamic_bitset<> GenInFace; // indicator for generators of simplex in face54long mult; // multiplicity of this face55size_t card; // the cardinality of the face56bool done; // indicates that this face has been done for a given offset57vector<long> denom;58vector<long> degrees;59vector<long> key;60};6162class ourFactorization{63public:6465vector<RingElem> myFactors;66vector<long> myMultiplicities;67RingElem myRemainingFactor;6869ourFactorization(const vector<RingElem>& myFactors,70const vector<long>& myMultiplicities, const RingElem& myRemainingFactor);71ourFactorization(const factorization<RingElem>& FF);7273};74// end class7576class CyclRatFunct {77// class for rational functions whose denominator is a product78// of cyclotomic polynomials79// We work with denominators that are products of factors 1-t^i80// which is of course equivalent81// the numerator is a polynomial in its ring82// the denominator is an integer vector that at index i83// gives the multiplicity of 1-t^i in the denominator84// (the entry at index 0 is not used and must always be equal to 0)85public:8687RingElem num;88vector<long> denom;8990void extendDenom(const vector<long>& target);91void addCRF(const CyclRatFunct& r);92void multCRF(const CyclRatFunct& r);93void simplifyCRF();94void set2(const RingElem& f, const vector<long>& d);95void set2(const RingElem& f);96void showCRF();97void showCoprimeCRF();98CyclRatFunct(const RingElem& c);99CyclRatFunct(const RingElem& c,const vector<long>& d);100101};102//class end *****************************************************************103104// manipulation of denominators105vector<long> lcmDenom(const vector<long>& df, const vector<long>& dg);106vector<long> prodDenom(const vector<long>& df, const vector<long>& dg);107vector<long> degrees2denom(const vector<long>& d);108vector<long> denom2degrees(const vector<long>& d);109RingElem denom2poly(const SparsePolyRing& P, const vector<long>& d);110vector<long> makeDenom(long k,long n);111112113RingElem processInputPolynomial(const string& poly_as_string, const SparsePolyRing& R, const SparsePolyRing& RZZ,114vector<RingElem>& resPrimeFactors, vector<RingElem>& resPrimeFactorsNonhom, vector<long>& resMultiplicities,115RingElem& remainingFactor, bool& homogeneous,const bool& do_leadCoeff);116117// conversion from CoCoA types to GMP118mpz_class mpz(const BigInt& B) {119return(mpz_class(mpzref(B)));120}121122mpq_class mpq(const BigRat& B) {123return(mpq_class(mpqref(B)));124}125126mpz_class ourFactorial(const long& n){127mpz_class fact=1;128for(long i=1;i<=n;++i)129fact*=i;130return(fact);131}132133} //end namespace libnormaliz134135#endif //NMZ_COCOA136137#endif // NMZ_INTEGRATE_H138139140141