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 / normaliz_exception.h
Views: 418426/*1* Normaliz2* Copyright (C) 2007-2014 Winfried Bruns, Bogdan Ichim, 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 NORMALIZ_EXEPTION_H_24#define NORMALIZ_EXEPTION_H_2526#include <exception>27#include <string>28#include <sstream>29#include <libnormaliz/libnormaliz.h>30#include <libnormaliz/cone_property.h>3132namespace libnormaliz {3334class NormalizException: public std::exception {35public:36virtual const char* what() const throw() = 0;37};3839class ArithmeticException: public NormalizException {40public:41ArithmeticException() : msg("Overflow detected. A fatal size excess or a computation overflow.\n If Normaliz has terminated and you are using LongLong, rerun without it.") {}42~ArithmeticException() throw() {}4344template<typename Integer>45ArithmeticException(const Integer& convert_number){4647static int CCCCCCC=0;4849CCCCCCC++;50/* if(CCCCCCC>=3)51assert(false);*/52std::stringstream stream;53stream << "Could not convert " << convert_number << ".\n";54stream << "Overflow detected. A fatal size excess or a computation overflow.\n If Normaliz has terminated and you are using LongLong, rerun without it.";55msg = stream.str();56}5758virtual const char* what() const throw() {59return msg.c_str();60}6162private:63std::string msg;64};6566class NonpointedException: public NormalizException {67public:68virtual const char* what() const throw() {69return "Cone is not pointed.";70}71};7273class NotIntegrallyClosedException: public NormalizException {74public:75virtual const char* what() const throw() {76return "Original monoid is not integrally closed.";77}78};7980class BadInputException: public NormalizException {81public:82BadInputException(const std::string& message) :83msg("Some error in the normaliz input data detected: " + message)84{}85~BadInputException() throw() {}8687virtual const char* what() const throw() {88return msg.c_str();89}9091private:92std::string msg;93};9495class NmzCoCoAException: public NormalizException {96public:97NmzCoCoAException(const std::string& message) :98msg(message)99{}100~NmzCoCoAException() throw() {}101102virtual const char* what() const throw() {103return msg.c_str();104}105106private:107std::string msg;108};109110class NotComputableException: public NormalizException {111public:112NotComputableException(const std::string& message) : msg("Could not compute: " + message) {}113NotComputableException(const ConeProperties& missing) {114std::stringstream stream;115stream << "Could not compute: " << missing << "!";116msg = stream.str();117}118~NotComputableException() throw() {}119120virtual const char* what() const throw() {121return msg.c_str();122}123124private:125std::string msg;126};127128class FatalException: public NormalizException {129public:130FatalException(const std::string& message) :131msg("Fatal error: " + message +"\nThis should not happen, please contact the developers!")132{}133~FatalException() throw() {}134135virtual const char* what() const throw() {136return msg.c_str();137}138139private:140std::string msg;141};142143class InterruptException: public NormalizException {144public:145InterruptException(const std::string& message ):146msg("Interrupted: " + message )147{}148~InterruptException() throw() {}149150virtual const char* what() const throw() {151return msg.c_str();152}153154private:155std::string msg;156157};158159160} /* end namespace */161162#endif /* LIBNORMALIZ_H_ */163164165