/// /// This file is part of ILNumerics Community Edition. /// /// ILNumerics Community Edition - high performance computing for applications. /// Copyright (C) 2006 - 2012 Haymo Kutschbach, http://ilnumerics.net /// /// ILNumerics Community Edition is free software: you can redistribute it and/or modify /// it under the terms of the GNU General Public License version 3 as published by /// the Free Software Foundation. /// /// ILNumerics Community Edition is distributed in the hope that it will be useful, /// but WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /// GNU General Public License for more details. /// /// You should have received a copy of the GNU General Public License /// along with ILNumerics Community Edition. See the file License.txt in the root /// of your distribution package. If not, see . /// /// In addition this software uses the following components and/or licenses: /// /// ================================================================================= /// The Open Toolkit Library License /// /// Copyright (c) 2006 - 2009 the Open Toolkit library. /// /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights to /// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of /// the Software, and to permit persons to whom the Software is furnished to do /// so, subject to the following conditions: /// /// The above copyright notice and this permission notice shall be included in all /// copies or substantial portions of the Software. /// /// ================================================================================= /// using System; namespace ILNumerics.Exceptions { /// /// Generic exception, base class for all exceptions thrown by ILNumerics /// public class ILException : System.Exception { /// /// Constructor /// /// Additional message to be included public ILException(String message) : base(message) { } /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILException(String message, Exception innerException) : base(message, innerException) { } } /// /// Base class for mathematical exceptions. Needed e.g. in interpreter for proper error /// messages /// public class ILMathException : ILException { /// /// Constructor /// /// Additional message to be included public ILMathException(String message) : base(message) { } /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILMathException(String message, Exception innerException) : base(message, innerException) { } } /// /// One of the most common exceptions: The matrix sizes do not match /// public class ILDimensionMismatchException : ILMathException { /// /// Constructor /// public ILDimensionMismatchException() : base("Matrix dimensions must match") { } /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILDimensionMismatchException(String message, Exception innerException) : base(message, innerException) { } /// /// Constructor /// /// Additional message to be included public ILDimensionMismatchException(string message) : base(message) { } } /// /// Something was wrong with the arguments supplied /// public class ILArgumentException : ILException { /// /// Constructor /// /// Additional message to be included public ILArgumentException(String message) : base(message) {} /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILArgumentException(String message, Exception innerException) : base(message, innerException) { } } /// /// A function was called with the wrong number of arguments /// public class ILArgumentNumberException : ILArgumentException { /// /// Constructor /// /// Additional message to be included public ILArgumentNumberException(String message) : base(message) { } /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILArgumentNumberException(String message, Exception innerException) : base(message, innerException) { } } /// /// A function argument has the wrong size /// public class ILArgumentSizeException : ILArgumentException { /// /// Constructor /// /// Additional message to be included public ILArgumentSizeException(String message) : base(message) { } /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILArgumentSizeException(String message, Exception innerException) : base(message, innerException) { } } /// /// A function was called with a wrong argument type /// /// This exception might be thrown if the size or inner /// type of a argument is invalid. (e.g. matrix expected, but 3D array found) /// public class ILArgumentTypeException : ILArgumentException { /// /// Constructor /// /// Additional message to be included public ILArgumentTypeException(String message) : base(message) {} /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILArgumentTypeException(String message, Exception innerException) : base(message, innerException) { } } /// /// A request could not be completed due to not enough memory available /// public class ILMemoryException : ILException { /// /// Constructor /// /// Additional message to be included public ILMemoryException(String message) : base(message) {} /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILMemoryException(String message, Exception innerException) : base(message, innerException) { } } /// /// Thrown on illegal casting attempts /// public class ILCastException : ILException { /// /// Costructor /// /// Addditional message to be included into the exception public ILCastException(String message) : base(message) { } /// /// Costructor /// /// Additional message to be included into the exception /// On cascaded exception handling, the exception catched before public ILCastException(String message, Exception innerException) : base(message, innerException) { } } /// /// ILOutputException, thrown if an I/O attempt fails /// public class ILOutputException : ILException { /// /// Constructor /// /// Additional message to be included public ILOutputException(String message) : base(message) { } /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILOutputException(String message, Exception innerException) : base(message, innerException) { } } /// /// Exception thrown if an operation could not completed /// public class ILInvalidOperationException : ILException { /// /// Constructor /// /// Additional message to be included public ILInvalidOperationException(String message) : base(message) {} /// /// Constructor /// /// Additional message to be included /// Inner Exception public ILInvalidOperationException(String message, Exception innerException) : base(message, innerException) { } } /// /// No valid license could be found /// public class ILInvalidLicenseException : ILException { /// /// Create a new ILInvalidLicenseException /// /// Additional message to be included public ILInvalidLicenseException(String message, Exception innerExc) : base(message, innerExc) {} } }