Skip to content
Snippets Groups Projects
Select Git revision
  • a64ec3b15659df24e892c03bac16d9bec5561e5c
  • master default
  • nlf-fixes
  • newton-quadratic-equation-solver
  • nlf-fixes-r
  • nls-fixes
  • sep-fixes
  • sep
  • use-dprior
  • ep-sparse
  • rebase-1
  • parfor
  • reset-seed-in-unit-tests
  • remove-persistent-variables
  • nonlinear-filter-fixes
  • pac-mce-with-composite-target
  • 6.x
  • dprior
  • covariance-quadratic-approximation
  • benchmark-ec
  • kalman_mex
  • 5.5
  • 5.4
  • 5.3
  • 5.2
  • 5.1
  • 5.0
  • 5.0-rc1
  • 4.7-beta3
  • 4.7-beta2
  • 4.7-beta1
  • 4.6.4
  • 4.6.3
  • 4.6.2
  • 4.6.1
  • 4.6.0
  • 4.6.0-rc2
  • 4.6.0-rc1
  • 4.6-beta1
  • 4.5.7
  • 4.5.6
41 results

ExternalFunctionsTable.hh

Blame
  • Forked from Dynare / dynare
    Source project has a limited visibility.
    dynare_exception.h 1.00 KiB
    // Copyright (C) 2006, Ondra Kamenik
    
    // $Id: dynare_exception.h 853 2006-08-01 08:42:42Z kamenik $
    
    #ifndef DYNARE_EXCEPTION_H
    #define DYNARE_EXCEPTION_H
    
    #include <string>
    
    class DynareException {
    	char* mes;
    public:
    	DynareException(const char* m, const char* fname, int line, int col)
    		{
    			mes = new char[strlen(m) + strlen(fname) + 100];
    			sprintf(mes, "Parse error at %s, line %d, column %d: %s", fname, line, col, m);
    		}
    	DynareException(const char* fname, int line, const std::string& m)
    		{
    			mes = new char[m.size() + strlen(fname) + 50];
    			sprintf(mes, "%s:%d: %s", fname, line, m.c_str());
    		}
    	DynareException(const char* m, int offset)
    		{
    			mes = new char[strlen(m) + 100];
    			sprintf(mes, "Parse error in provided string at offset %d: %s", offset, m);
    		}
    	DynareException(const DynareException& e)
    		: mes(new char[strlen(e.mes)+1])
    		{strcpy(mes, e.mes);}
    	virtual ~DynareException()
    		{delete [] mes;}
    	const char* message() const
    		{return mes;}
    };
    
    #endif
    
    // Local Variables:
    // mode:C++
    // End: