Skip to content
Snippets Groups Projects
Commit f9be9e06 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

?

parent 4606ebdb
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,11 @@ Release
- new functionality:
- shift argument in resol() and conv() now optional
- convp to use primitive of theory function
- code refactored:
- Subclasses instead of switch statements in expression nodes (CTree->CNode..)
- bugfixes:
- autotools clean up => ld -l.. library list now fully created by configure
Release 2.1.4d of 1sep12, comes with fridalibs-120901:
......
......@@ -114,6 +114,7 @@ CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
......
......@@ -21,23 +21,38 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `floor' function. */
#undef HAVE_FLOOR
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <gsl/gsl_errno.h> header file. */
#undef HAVE_GSL_GSL_ERRNO_H
/* Define to 1 if you have the <gsl/gsl_integration.h> header file. */
#undef HAVE_GSL_GSL_INTEGRATION_H
/* Define to 1 if you have the <gsl/gsl_math.h> header file. */
#undef HAVE_GSL_GSL_MATH_H
/* Define to 1 if you have the <gsl/gsl_randist.h> header file. */
#undef HAVE_GSL_GSL_RANDIST_H
/* Define to 1 if you have the <gsl/gsl_rng.h> header file. */
#undef HAVE_GSL_GSL_RNG_H
/* Define to 1 if you have the `fftw3' library (-lfftw3). */
#undef HAVE_LIBFFTW3
/* Define to 1 if you have the <gsl/gsl_roots.h> header file. */
#undef HAVE_GSL_GSL_ROOTS_H
/* Define to 1 if you have the `gsl' library (-lgsl). */
#undef HAVE_LIBGSL
/* Define to 1 if you have the <gsl/gsl_sf_debye.h> header file. */
#undef HAVE_GSL_GSL_SF_DEBYE_H
/* Define to 1 if you have the `gslcblas' library (-lgslcblas). */
#undef HAVE_LIBGSLCBLAS
/* Define to 1 if you have the <gsl/gsl_sf.h> header file. */
#undef HAVE_GSL_GSL_SF_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <kww.h> header file. */
#undef HAVE_KWW_H
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
......@@ -48,11 +63,11 @@
/* Define to 1 if you have the `lmmin' library (-llmmin). */
#undef HAVE_LIBLMMIN
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the `read-plus' library (-lread-plus). */
#undef HAVE_LIBREAD_PLUS
/* Define to 1 if you have the `readline' library (-lreadline). */
#undef HAVE_LIBREADLINE
/* Define to 1 if you have the `yaml-cpp' library (-lyaml-cpp). */
#undef HAVE_LIBYAML_CPP
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
......@@ -61,6 +76,9 @@
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the <math.h> header file. */
#undef HAVE_MATH_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
......@@ -70,16 +88,10 @@
/* Define to 1 if you have the `mkfifo' function. */
#undef HAVE_MKFIFO
/* Define to 1 if you have the `pow' function. */
#undef HAVE_POW
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#undef HAVE_REALLOC
/* Define to 1 if you have the `sqrt' function. */
#undef HAVE_SQRT
/* Define to 1 if stdbool.h conforms to C99. */
#undef HAVE_STDBOOL_H
......
This diff is collapsed.
......@@ -26,10 +26,11 @@ AC_SUBST(AM_CXXFLAGS,"-pedantic -Wall")
AC_CONFIG_HEADERS([config.h])
###############################################################################
## Select compiler and related tools ##
## Select compiler and preprocessors ##
###############################################################################
AC_PROG_CXX
AC_PROG_LEX # LEX,LEXLIB = "flex","-lfl" or "lex","-ll"
if test "$LEX" = :; then
AC_MSG_ERROR([Cannot find lex. Aborting.])
......@@ -39,60 +40,17 @@ if test "$YACC" = "yacc"; then
AC_MSG_ERROR([Cannot find yacc. Aborting.])
fi
###############################################################################
## Check for libraries, headers, defs needed at build time ##
###############################################################################
# from standard packages
AC_CHECK_LIB([m], [cos], ,
[AC_MSG_ERROR(libm not found or corrupted)])
AC_CHECK_LIB([gslcblas], [cblas_dgemm], ,
[AC_MSG_ERROR(libgslcblas not found or out of sync)])
AC_CHECK_LIB([gsl], [gsl_blas_dgemm], ,
[AC_MSG_ERROR(libgsl not found or out of sync)])
AC_CHECK_LIB([fftw3], [fftw_plan_r2r_1d], ,
[AC_MSG_ERROR(libfftw not found or out of sync)])
AC_CHECK_LIB([readline], [rl_completion_matches],,
[AC_MSG_ERROR(libreadline not found or corrupted)])
# written or adapted by JWu
AC_CHECK_LIB([lmmin], [lmmin], ,
[AC_MSG_WARN(liblmmin not found or out of sync)])
AC_CHECK_LIB([kww], [kwwp], ,
[AC_MSG_WARN(libkww not found or out of sync)])
# no idea how to check for cpp libraries
#AC_CHECK_LIB([yaml-cpp], [?], ,
# [AC_MSG_ERROR(libyaml-cpp not found or out of sync)])
#AC_CHECK_LIB([read-plus], [?], , ..
# Checks for header files
## I put this one here only because qmake does: Make sure off_t is 64-bit in *nix, taken from http://www.google.com/search?q=cache:wlNJ8Qe4dBgJ:www.sfr-fresh.com/unix/privat/libfb-v0.18.4b-src.zip:a/src/rtlib/configure.ac+configure.ac+file+offset+bits&hl=de&ct=clnk&cd=5&gl=de&client=firefox-a
AC_DEFINE([_FILE_OFFSET_BITS],64,[File offset bits])
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h], ,AC_MSG_ERROR([Cannot find fcntl.h.]))
AC_CHECK_HEADERS([stdlib.h], ,AC_MSG_ERROR([Cannot find stdlib.h.]))
AC_CHECK_HEADERS([string.h], ,AC_MSG_ERROR([Cannot find string.h.]))
AC_CHECK_HEADERS([sys/time.h], ,AC_MSG_ERROR([Cannot find sys/time.h.]))
AC_CHECK_HEADERS([unistd.h], ,AC_MSG_ERROR([Cannot find unistd.h.]))
# does not work:
#AC_CHECK_HEADERS([boost/format.hpp],
# ,AC_MSG_ERROR([Cannot find boost/format.hpp.]))
#AC_CHECK_HEADERS([boost/shared_ptr.hpp],
# ,AC_MSG_ERROR([Cannot find boost/shared_ptr.hpp.]))
# the following are needed by yacc generated code:
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([inttypes.h], ,AC_MSG_ERROR([Cannot find inttypes.h.]))
AC_CHECK_HEADERS([libintl.h], ,AC_MSG_ERROR([Cannot find libintl.h.]))
AC_CHECK_HEADERS([stddef.h], ,AC_MSG_ERROR([Cannot find stddef.h.]))
AC_CHECK_HEADERS([malloc.h], ,AC_MSG_ERROR([Cannot find malloc.h.]))
###############################################################################
## Check for headers, defs needed at compile time ##
###############################################################################
# Checks for typedefs, structures, and compiler characteristics
AC_C_CONST
AC_C_INLINE
AC_HEADER_STDBOOL
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
......@@ -100,21 +58,59 @@ AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h], ,AC_MSG_ERROR([Cannot find fcntl.h.]))
AC_CHECK_HEADERS([sys/time.h], ,AC_MSG_ERROR([Cannot find sys/time.h.]))
AC_CHECK_HEADERS([unistd.h], ,AC_MSG_ERROR([Cannot find unistd.h.]))
AC_CHECK_HEADERS([inttypes.h], ,AC_MSG_ERROR([Cannot find inttypes.h.]))
AC_CHECK_HEADERS([libintl.h], ,AC_MSG_ERROR([Cannot find libintl.h.]))
AC_CHECK_HEADERS([stddef.h], ,AC_MSG_ERROR([Cannot find stddef.h.]))
AC_CHECK_HEADERS([malloc.h], ,AC_MSG_ERROR([Cannot find malloc.h.]))
AC_CHECK_HEADERS([math.h], ,AC_MSG_ERROR([Cannot find math.h.]))
AC_CHECK_HEADERS([gsl/gsl_rng.h gsl/gsl_randist.h gsl/gsl_math.h \
gsl/gsl_errno.h gsl/gsl_integration.h gsl/gsl_roots.h \
gsl/gsl_sf.h gsl/gsl_sf_debye.h],,
AC_MSG_ERROR([Cannot find required gsl headers.]))
AC_CHECK_HEADERS([kww.h],, AC_MSG_ERROR([Cannot find kww.h.]))
AC_FUNC_ALLOCA
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_MKTIME
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([floor], ,AC_MSG_ERROR([Cannot find floor.]))
AC_CHECK_FUNCS([gettimeofday],,AC_MSG_ERROR([Cannot find gettimeofday.]))
AC_CHECK_FUNCS([memset], ,AC_MSG_ERROR([Cannot find memset.]))
AC_CHECK_FUNCS([mkfifo], ,AC_MSG_ERROR([Cannot find mkfifo.]))
AC_CHECK_FUNCS([pow], ,AC_MSG_ERROR([Cannot find pow.]))
AC_CHECK_FUNCS([sqrt], ,AC_MSG_ERROR([Cannot find sqrt.]))
AC_CHECK_FUNCS([strchr], ,AC_MSG_ERROR([Cannot find strchr.]))
###############################################################################
## Check for libraries, needed at link time ##
###############################################################################
# from standard packages
AC_SEARCH_LIBS([cos], [m],, [AC_MSG_ERROR(libm not found or corrupted)])
AC_SEARCH_LIBS([cblas_dgemm], [gslcblas],,
[AC_MSG_ERROR(libgslcblas not found or out of sync)])
AC_SEARCH_LIBS([gsl_blas_dgemm], [gsl],,
[AC_MSG_ERROR(libgsl not found or out of sync)])
AC_SEARCH_LIBS([fftw_plan_r2r_1d], [fftw3],,
[AC_MSG_ERROR(libfftw not found or out of sync)])
AC_SEARCH_LIBS([rl_completion_matches], [readline],,
[AC_MSG_ERROR(libreadline not found or corrupted)])
# written or adapted by JWu
AC_CHECK_LIB([lmmin], [lmmin], ,
[AC_MSG_WARN(liblmmin not found or out of sync)])
AC_CHECK_LIB([kww], [kwwp], ,
[AC_MSG_WARN(libkww not found or out of sync)])
###############################################################################
## Check for facilities needed at run time ##
###############################################################################
......@@ -124,6 +120,28 @@ if test "$GNUPLOT" = :; then
AC_MSG_ERROR([Cannot find gnuplot. Aborting.])
fi
###############################################################################
## Checks in C++ ##
###############################################################################
AC_LANG(C++)
# headers:
AC_TRY_CPP([#include<boost/format.hpp>],,
AC_MSG_ERROR([Cannot find boost/format.hpp.]))
AC_TRY_CPP([#include<boost/shared_ptr.hpp>],,
AC_MSG_ERROR([Cannot find boost/shared_ptr.hpp.]))
AC_TRY_CPP([#include<readln.h>],,
AC_MSG_ERROR([Cannot find readln.h.]))
AC_TRY_CPP([#include<yaml-cpp/yaml.h>],,
AC_MSG_ERROR([Cannot find yaml-cpp/yaml.h.]))
# no idea how to check for cpp libraries
AC_CHECK_LIB([yaml-cpp], [main],,
[AC_MSG_ERROR(library yaml-cpp not found)])
AC_CHECK_LIB([read-plus], [main],,
[AC_MSG_ERROR(library read-plus not found)])
###############################################################################
## Execute ##
###############################################################################
......
......@@ -85,6 +85,7 @@ CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
......
......@@ -82,6 +82,7 @@ CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
......
......@@ -86,5 +86,4 @@ var.h \
var.cpp \
zentry.h \
zentry.cpp
# only libraries not included through configure.ac
AM_LDFLAGS = -lread-plus -lyaml-cpp
# AM_LDFLAGS = -l.. no longer needed, all is done by configure.ac
......@@ -106,6 +106,7 @@ CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
......@@ -263,8 +264,6 @@ var.cpp \
zentry.h \
zentry.cpp
# only libraries not included through configure.ac
AM_LDFLAGS = -lread-plus -lyaml-cpp
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
......@@ -605,6 +604,7 @@ uninstall-am: uninstall-binPROGRAMS
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS
# AM_LDFLAGS = -l.. no longer needed, all is done by configure.ac
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
......
......@@ -685,6 +685,12 @@ void globalEvaluate( const double* par, int m_dat, const void *data,
} catch ( string& s ) {
cerr << "\n" << s << "\n";
*info = -1;
} catch ( const char* s ) {
cerr << "\n" << s << "\n";
*info = -1;
} catch ( ... ) {
cerr << "BUG: globalEvaluate catched invalid exception\n";
*info = -1;
}
}
......
......@@ -927,6 +927,8 @@ void CNodePConv::copy_theory( CResult& ret, const CContext& ctx,
double theshift ) const
{
throw "non-convolution not implemented for pconv";
// to implement this efficiently, I would like to have CResult::operator+
// for which we should go to shared pointers ...
}
void CNodePConv::convolve( CResult& ret, const CContext& ctx,
......@@ -935,20 +937,20 @@ void CNodePConv::convolve( CResult& ret, const CContext& ctx,
{
uint n = ctx.vt->size();
uint nv = sv->size();
CResult res_theory;
CContext cv_ctx(ctx);
vector<double> tt;
cv_ctx.vt = &tt;
// Convolute theory with resolution.
if( conv_step ){ // accelerated version with equidistant grids
// precompute theory on unified grid
// precompute primitive on unified grid
int ntt = n + nv;
tt.resize(ntt);
double tt0 = (*(ctx.vt))[0] - sv->x[0] - theshift - (nv-0.5)*conv_step;
for ( int ii=0; ii<ntt; ++ii ) // ii=(nv-1)+i-iv
tt[ii] = tt0 + ii*conv_step;
CResult res_theory;
theory->tree_val( res_theory, cv_ctx );
// now convolve
// now convolve resolution with differential of primitive
for ( int i=0; i<n; ++i ){
ret.v[i] = 0;
for ( int iv=0; iv<nv; ++iv )
......@@ -957,25 +959,52 @@ void CNodePConv::convolve( CResult& ret, const CContext& ctx,
ret.v[i] *= conv_step / conv_norm;
}
} else { // simplest version: non-equidistant x_out and x_res.
throw "pconv non-eq conv not yet implemented";
/* DOES NOT WORK
double tt0;
CResult res_theory;
tt.resize(nv);
if( nv<2 )
throw "non-equidistant convolution requires nv>=2";
for ( int i=0; i<n; ++i ){
tt0 = (*(ctx.vt))[i] - theshift;
for ( int iv=0; iv<nv; ++iv )
tt[iv] = tt0 - sv->x[iv];
theory->tree_val( res_theory, cv_ctx );
ret.v[i] = 0;
for ( int iv=0; iv<nv-1; ++iv ) {
ret.v[i] += (sv->y[iv+1]+sv->y[iv])*
(sv->x[iv+1]-sv->x[iv])*
(res_theory.to_r(iv+1) - res_theory.to_r(iv) );
}
ret.v[i] /= 2*conv_norm;
}
*/
for ( int i=0; i<n; ++i )
ret.v[i] = 0;
tt.resize(n);
CResult res_theory_low, res_theory_hig;
double dx;
for ( int iv=0; iv<nv; ++iv ) {
double dx; // variable step
if ( iv==0 )
dx = sv->x[1] - sv->x[0];
else if ( iv==nv-1 )
dx = sv->x[nv-1] - sv->x[nv-2];
else
dx = ( sv->x[iv+1] - sv->x[iv-1] ) / 2;
for ( int i=0; i<n; ++i ) {
tt[i] = (*(ctx.vt))[i] - sv->x[iv] - theshift - dx/2;
theory->tree_val( res_theory_low, cv_ctx );
}
for ( int i=0; i<n; ++i ) {
tt[i] = (*(ctx.vt))[i] - sv->x[iv] - theshift + dx/2;
theory->tree_val( res_theory_hig, cv_ctx );
}
for ( int i=0; i<n; ++i )
tt[i] = (*(ctx.vt))[i] - sv->x[iv] - theshift;
theory->tree_val( res_theory, cv_ctx );
for ( int i=0; i<n; ++i )
ret.v[i] += res_theory.to_r(i) * sv->y[iv] *
dx / conv_norm;
ret.v[i] += (res_theory_hig.to_r(i)-res_theory_low.to_r(i)) *
sv->y[iv] * dx;
}
for ( int i=0; i<n; ++i )
ret.v[i] /= conv_norm;
}
}
......
fl dat-res
fl dat-qel
1 mpd= 1
1 cc p0+p1*resol+p2*conv(cauchy(t,p3))
1 cc p0+p1*resol+p2*pconv(atan(p3*t))
1 cc p0+p1*resol+p2*pi/2*pconv(atan(t/p3))
2,3 cv 0
2,3 cf
2,3 cfs
g2
0-3 p 1
2,3 cp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment