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 / Qsource / libQnormaliz / Qnormaliz_exception.h
Views: 418384/*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 <libQnormaliz/libQnormaliz.h>30#include <libQnormaliz/Qcone_property.h>3132namespace libQnormaliz {3334class NormalizException: public std::exception {35public:36virtual const char* what() const throw() = 0;37};3839class ArithmeticException: public NormalizException {40public:41ArithmeticException() : msg("Arithmetic Overflow detected, try a bigger integer type!") {}42~ArithmeticException() throw() {}4344template<typename Number>45ArithmeticException(const Number& convert_number){46std::stringstream stream;47stream << "Could not convert " << convert_number << ".\n";48stream << "Arithmetic Overflow detected, try a bigger integer type!";49msg = stream.str();50}5152virtual const char* what() const throw() {53return msg.c_str();54}5556private:57std::string msg;58};5960class NonpointedException: public NormalizException {61public:62virtual const char* what() const throw() {63return "Cone is not pointed.";64}65};6667class NotIntegrallyClosedException: public NormalizException {68public:69virtual const char* what() const throw() {70return "Original monoid is not integrally closed.";71}72};7374class BadInputException: public NormalizException {75public:76BadInputException(const std::string& message) :77msg("Some error in the normaliz input data detected: " + message)78{}79~BadInputException() throw() {}8081virtual const char* what() const throw() {82return msg.c_str();83}8485private:86std::string msg;87};8889class NotComputableException: public NormalizException {90public:91NotComputableException(const std::string& message) : msg("Could not compute: " + message) {}92NotComputableException(const ConeProperties& missing) {93std::stringstream stream;94stream << "Could not compute: " << missing << "!";95msg = stream.str();96}97~NotComputableException() throw() {}9899virtual const char* what() const throw() {100return msg.c_str();101}102103private:104std::string msg;105};106107class FatalException: public NormalizException {108public:109FatalException(const std::string& message) :110msg("Fatal error: " + message +"\nThis should not happen, please contact the developers!")111{}112~FatalException() throw() {}113114virtual const char* what() const throw() {115return msg.c_str();116}117118private:119std::string msg;120};121122123} /* end namespace */124125#endif /* LIBNORMALIZ_H_ */126127128