20#ifndef CCGSL_MONTE_HPP
21#define CCGSL_MONTE_HPP
23#include<gsl/gsl_monte.h>
69 typedef double (*function_t)(
double*,size_t,
void*);
83 class Fuvcr :
public base_F {
90 Fuvcr(
double (*
const f)(
gsl::vector const&),
size_t const dim ) : f( f ), xv( dim ){}
111 static double fn(
double* x,
size_t dim,
void* params ){
112 Fuvcr* ft =
reinterpret_cast<Fuvcr*
>( params );
113 if( dim != ft->xv.size() )
114 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
115 std::swap(ft->xv.get()->data, x);
116 double result = ft->f( ft->xv );
117 std::swap(ft->xv.get()->data, x);
124 class FuvCr :
public base_F {
131 FuvCr(
double (*
const f)(
gsl::vector const volatile&),
size_t const dim ) : f( f ), xv( dim ){}
152 static double fn(
double* x,
size_t dim,
void* params ){
153 FuvCr* ft =
reinterpret_cast<FuvCr*
>( params );
154 if( dim != ft->xv.size() )
155 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
156 std::swap(ft->xv.get()->data, x);
157 double result = ft->f( ft->xv );
158 std::swap(ft->xv.get()->data, x);
165 class Fcvcr :
public base_F {
172 Fcvcr(
double const (*
const f)(
gsl::vector const&),
size_t const dim ) : f( f ), xv( dim ){}
193 static double fn(
double* x,
size_t dim,
void* params ){
194 Fcvcr* ft =
reinterpret_cast<Fcvcr*
>( params );
195 if( dim != ft->xv.size() )
196 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
197 std::swap(ft->xv.get()->data, x);
198 double result = ft->f( ft->xv );
199 std::swap(ft->xv.get()->data, x);
206 class FcvCr :
public base_F {
213 FcvCr(
double const (*
const f)(
gsl::vector const volatile&),
size_t const dim ) : f( f ), xv( dim ){}
222 double const (*
const f)(
gsl::vector const volatile&);
234 static double fn(
double* x,
size_t dim,
void* params ){
235 FcvCr* ft =
reinterpret_cast<FcvCr*
>( params );
236 if( dim != ft->xv.size() )
237 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
238 std::swap(ft->xv.get()->data, x);
239 double result = ft->f( ft->xv );
240 std::swap(ft->xv.get()->data, x);
247 class Furcr :
public base_F {
254 Furcr(
double& (*
const f)(
gsl::vector const&),
size_t const dim ) : f( f ), xv( dim ){}
275 static double fn(
double* x,
size_t dim,
void* params ){
276 Furcr* ft =
reinterpret_cast<Furcr*
>( params );
277 if( dim != ft->xv.size() )
278 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
279 std::swap(ft->xv.get()->data, x);
280 double result = ft->f( ft->xv );
281 std::swap(ft->xv.get()->data, x);
288 class FurCr :
public base_F {
295 FurCr(
double& (*
const f)(
gsl::vector const volatile&),
size_t const dim ) : f( f ), xv( dim ){}
316 static double fn(
double* x,
size_t dim,
void* params ){
317 FurCr* ft =
reinterpret_cast<FurCr*
>( params );
318 if( dim != ft->xv.size() )
319 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
320 std::swap(ft->xv.get()->data, x);
321 double result = ft->f( ft->xv );
322 std::swap(ft->xv.get()->data, x);
329 class Fcrcr :
public base_F {
336 Fcrcr(
double const& (*
const f)(
gsl::vector const&),
size_t const dim ) : f( f ), xv( dim ){}
357 static double fn(
double* x,
size_t dim,
void* params ){
358 Fcrcr* ft =
reinterpret_cast<Fcrcr*
>( params );
359 if( dim != ft->xv.size() )
360 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
361 std::swap(ft->xv.get()->data, x);
362 double result = ft->f( ft->xv );
363 std::swap(ft->xv.get()->data, x);
370 class FcrCr :
public base_F {
377 FcrCr(
double const& (*
const f)(
gsl::vector const volatile&),
size_t const dim ) : f( f ), xv( dim ){}
386 double const& (*
const f)(
gsl::vector const volatile&);
398 static double fn(
double* x,
size_t dim,
void* params ){
399 FcrCr* ft =
reinterpret_cast<FcrCr*
>( params );
400 if( dim != ft->xv.size() )
401 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
402 std::swap(ft->xv.get()->data, x);
403 double result = ft->f( ft->xv );
404 std::swap(ft->xv.get()->data, x);
411 class FVrcr :
public base_F {
418 FVrcr(
double volatile& (*
const f)(
gsl::vector const&),
size_t const dim ) : f( f ), xv( dim ){}
439 static double fn(
double* x,
size_t dim,
void* params ){
440 FVrcr* ft =
reinterpret_cast<FVrcr*
>( params );
441 if( dim != ft->xv.size() )
442 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
443 std::swap(ft->xv.get()->data, x);
444 double result = ft->f( ft->xv );
445 std::swap(ft->xv.get()->data, x);
452 class FVrCr :
public base_F {
459 FVrCr(
double volatile& (*
const f)(
gsl::vector const volatile&),
size_t const dim ) : f( f ), xv( dim ){}
468 double volatile& (*
const f)(
gsl::vector const volatile&);
480 static double fn(
double* x,
size_t dim,
void* params ){
481 FVrCr* ft =
reinterpret_cast<FVrCr*
>( params );
482 if( dim != ft->xv.size() )
483 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
484 std::swap(ft->xv.get()->data, x);
485 double result = ft->f( ft->xv );
486 std::swap(ft->xv.get()->data, x);
493 class FCrcr :
public base_F {
500 FCrcr(
double const volatile& (*
const f)(
gsl::vector const&),
size_t const dim ) : f( f ), xv( dim ){}
509 double const volatile& (*
const f)(
gsl::vector const&);
521 static double fn(
double* x,
size_t dim,
void* params ){
522 FCrcr* ft =
reinterpret_cast<FCrcr*
>( params );
523 if( dim != ft->xv.size() )
524 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
525 std::swap(ft->xv.get()->data, x);
526 double result = ft->f( ft->xv );
527 std::swap(ft->xv.get()->data, x);
534 class FCrCr :
public base_F {
541 FCrCr(
double const volatile& (*
const f)(
gsl::vector const volatile&),
size_t const dim ) : f( f ), xv( dim ){}
550 double const volatile& (*
const f)(
gsl::vector const volatile&);
562 static double fn(
double* x,
size_t dim,
void* params ){
563 FCrCr* ft =
reinterpret_cast<FCrCr*
>( params );
564 if( dim != ft->xv.size() )
565 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
566 std::swap(ft->xv.get()->data, x);
567 double result = ft->f( ft->xv );
568 std::swap(ft->xv.get()->data, x);
577 class Fuvcru :
public base_F {
587 Fuvcru( T& c,
double (T::*f)(
gsl::vector const&),
size_t const dim )
588 : xv( dim ), c( c ), f( f ){}
594 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
598 function_t
function(){
return &function_s; }
612 static double function_s(
double* x,
size_t dim,
void* params ){
613 Fuvcru<T>*
const cl =
reinterpret_cast<Fuvcru<T>*
>( params );
614 if( dim != cl->xv.size() )
615 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
616 std::swap(cl->xv.get()->data,x);
617 double result = (cl->c.*cl->f)( cl->xv );
618 std::swap(cl->xv.get()->data,x);
635 class FuvCru :
public base_F {
645 FuvCru( T& c,
double (T::*f)(
gsl::vector const volatile&),
size_t const dim )
646 : xv( dim ), c( c ), f( f ){}
652 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
656 function_t
function(){
return &function_s; }
670 static double function_s(
double* x,
size_t dim,
void* params ){
671 FuvCru<T>*
const cl =
reinterpret_cast<FuvCru<T>*
>( params );
672 if( dim != cl->xv.size() )
673 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
674 std::swap(cl->xv.get()->data,x);
675 double result = (cl->c.*cl->f)( cl->xv );
676 std::swap(cl->xv.get()->data,x);
693 class Fcvcru :
public base_F {
703 Fcvcru( T& c,
double const (T::*f)(
gsl::vector const&),
size_t const dim )
704 : xv( dim ), c( c ), f( f ){}
710 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
714 function_t
function(){
return &function_s; }
728 static double function_s(
double* x,
size_t dim,
void* params ){
729 Fcvcru<T>*
const cl =
reinterpret_cast<Fcvcru<T>*
>( params );
730 if( dim != cl->xv.size() )
731 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
732 std::swap(cl->xv.get()->data,x);
733 double result = (cl->c.*cl->f)( cl->xv );
734 std::swap(cl->xv.get()->data,x);
751 class FcvCru :
public base_F {
761 FcvCru( T& c,
double const (T::*f)(
gsl::vector const volatile&),
size_t const dim )
762 : xv( dim ), c( c ), f( f ){}
768 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
772 function_t
function(){
return &function_s; }
786 static double function_s(
double* x,
size_t dim,
void* params ){
787 FcvCru<T>*
const cl =
reinterpret_cast<FcvCru<T>*
>( params );
788 if( dim != cl->xv.size() )
789 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
790 std::swap(cl->xv.get()->data,x);
791 double result = (cl->c.*cl->f)( cl->xv );
792 std::swap(cl->xv.get()->data,x);
809 class Furcru :
public base_F {
819 Furcru( T& c,
double& (T::*f)(
gsl::vector const&),
size_t const dim )
820 : xv( dim ), c( c ), f( f ){}
826 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
830 function_t
function(){
return &function_s; }
844 static double function_s(
double* x,
size_t dim,
void* params ){
845 Furcru<T>*
const cl =
reinterpret_cast<Furcru<T>*
>( params );
846 if( dim != cl->xv.size() )
847 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
848 std::swap(cl->xv.get()->data,x);
849 double result = (cl->c.*cl->f)( cl->xv );
850 std::swap(cl->xv.get()->data,x);
867 class FurCru :
public base_F {
877 FurCru( T& c,
double& (T::*f)(
gsl::vector const volatile&),
size_t const dim )
878 : xv( dim ), c( c ), f( f ){}
884 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
888 function_t
function(){
return &function_s; }
902 static double function_s(
double* x,
size_t dim,
void* params ){
903 FurCru<T>*
const cl =
reinterpret_cast<FurCru<T>*
>( params );
904 if( dim != cl->xv.size() )
905 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
906 std::swap(cl->xv.get()->data,x);
907 double result = (cl->c.*cl->f)( cl->xv );
908 std::swap(cl->xv.get()->data,x);
925 class Fcrcru :
public base_F {
935 Fcrcru( T& c,
double const& (T::*f)(
gsl::vector const&),
size_t const dim )
936 : xv( dim ), c( c ), f( f ){}
942 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
946 function_t
function(){
return &function_s; }
960 static double function_s(
double* x,
size_t dim,
void* params ){
961 Fcrcru<T>*
const cl =
reinterpret_cast<Fcrcru<T>*
>( params );
962 if( dim != cl->xv.size() )
963 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
964 std::swap(cl->xv.get()->data,x);
965 double result = (cl->c.*cl->f)( cl->xv );
966 std::swap(cl->xv.get()->data,x);
983 class FcrCru :
public base_F {
993 FcrCru( T& c,
double const& (T::*f)(
gsl::vector const volatile&),
size_t const dim )
994 : xv( dim ), c( c ), f( f ){}
1000 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1004 function_t
function(){
return &function_s; }
1018 static double function_s(
double* x,
size_t dim,
void* params ){
1019 FcrCru<T>*
const cl =
reinterpret_cast<FcrCru<T>*
>( params );
1020 if( dim != cl->xv.size() )
1021 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1022 std::swap(cl->xv.get()->data,x);
1023 double result = (cl->c.*cl->f)( cl->xv );
1024 std::swap(cl->xv.get()->data,x);
1034 double const& (T::*f)(
gsl::vector const volatile&);
1040 template<
typename T>
1041 class FVrcru :
public base_F {
1051 FVrcru( T& c,
double volatile& (T::*f)(
gsl::vector const&),
size_t const dim )
1052 : xv( dim ), c( c ), f( f ){}
1058 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1062 function_t
function(){
return &function_s; }
1076 static double function_s(
double* x,
size_t dim,
void* params ){
1077 FVrcru<T>*
const cl =
reinterpret_cast<FVrcru<T>*
>( params );
1078 if( dim != cl->xv.size() )
1079 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1080 std::swap(cl->xv.get()->data,x);
1081 double result = (cl->c.*cl->f)( cl->xv );
1082 std::swap(cl->xv.get()->data,x);
1098 template<
typename T>
1099 class FVrCru :
public base_F {
1109 FVrCru( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&),
size_t const dim )
1110 : xv( dim ), c( c ), f( f ){}
1116 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1120 function_t
function(){
return &function_s; }
1134 static double function_s(
double* x,
size_t dim,
void* params ){
1135 FVrCru<T>*
const cl =
reinterpret_cast<FVrCru<T>*
>( params );
1136 if( dim != cl->xv.size() )
1137 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1138 std::swap(cl->xv.get()->data,x);
1139 double result = (cl->c.*cl->f)( cl->xv );
1140 std::swap(cl->xv.get()->data,x);
1150 double volatile& (T::*f)(
gsl::vector const volatile&);
1156 template<
typename T>
1157 class FCrcru :
public base_F {
1167 FCrcru( T& c,
double const volatile& (T::*f)(
gsl::vector const&),
size_t const dim )
1168 : xv( dim ), c( c ), f( f ){}
1174 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1178 function_t
function(){
return &function_s; }
1192 static double function_s(
double* x,
size_t dim,
void* params ){
1193 FCrcru<T>*
const cl =
reinterpret_cast<FCrcru<T>*
>( params );
1194 if( dim != cl->xv.size() )
1195 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1196 std::swap(cl->xv.get()->data,x);
1197 double result = (cl->c.*cl->f)( cl->xv );
1198 std::swap(cl->xv.get()->data,x);
1208 double const volatile& (T::*f)(
gsl::vector const&);
1214 template<
typename T>
1215 class FCrCru :
public base_F {
1225 FCrCru( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&),
size_t const dim )
1226 : xv( dim ), c( c ), f( f ){}
1232 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1236 function_t
function(){
return &function_s; }
1250 static double function_s(
double* x,
size_t dim,
void* params ){
1251 FCrCru<T>*
const cl =
reinterpret_cast<FCrCru<T>*
>( params );
1252 if( dim != cl->xv.size() )
1253 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1254 std::swap(cl->xv.get()->data,x);
1255 double result = (cl->c.*cl->f)( cl->xv );
1256 std::swap(cl->xv.get()->data,x);
1266 double const volatile& (T::*f)(
gsl::vector const volatile&);
1272 template<
typename T>
1273 class Fuvcrc :
public base_F {
1283 Fuvcrc( T& c,
double (T::*f)(
gsl::vector const&)
const,
size_t const dim )
1284 : xv( dim ), c( c ), f( f ){}
1290 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1294 function_t
function(){
return &function_s; }
1308 static double function_s(
double* x,
size_t dim,
void* params ){
1309 Fuvcrc<T>*
const cl =
reinterpret_cast<Fuvcrc<T>*
>( params );
1310 if( dim != cl->xv.size() )
1311 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1312 std::swap(cl->xv.get()->data,x);
1313 double result = (cl->c.*cl->f)( cl->xv );
1314 std::swap(cl->xv.get()->data,x);
1330 template<
typename T>
1331 class FuvCrc :
public base_F {
1341 FuvCrc( T& c,
double (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim )
1342 : xv( dim ), c( c ), f( f ){}
1348 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1352 function_t
function(){
return &function_s; }
1366 static double function_s(
double* x,
size_t dim,
void* params ){
1367 FuvCrc<T>*
const cl =
reinterpret_cast<FuvCrc<T>*
>( params );
1368 if( dim != cl->xv.size() )
1369 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1370 std::swap(cl->xv.get()->data,x);
1371 double result = (cl->c.*cl->f)( cl->xv );
1372 std::swap(cl->xv.get()->data,x);
1382 double (T::*f)(
gsl::vector const volatile&)
const;
1388 template<
typename T>
1389 class Fcvcrc :
public base_F {
1399 Fcvcrc( T& c,
double const (T::*f)(
gsl::vector const&)
const,
size_t const dim )
1400 : xv( dim ), c( c ), f( f ){}
1406 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1410 function_t
function(){
return &function_s; }
1424 static double function_s(
double* x,
size_t dim,
void* params ){
1425 Fcvcrc<T>*
const cl =
reinterpret_cast<Fcvcrc<T>*
>( params );
1426 if( dim != cl->xv.size() )
1427 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1428 std::swap(cl->xv.get()->data,x);
1429 double result = (cl->c.*cl->f)( cl->xv );
1430 std::swap(cl->xv.get()->data,x);
1446 template<
typename T>
1447 class FcvCrc :
public base_F {
1457 FcvCrc( T& c,
double const (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim )
1458 : xv( dim ), c( c ), f( f ){}
1464 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1468 function_t
function(){
return &function_s; }
1482 static double function_s(
double* x,
size_t dim,
void* params ){
1483 FcvCrc<T>*
const cl =
reinterpret_cast<FcvCrc<T>*
>( params );
1484 if( dim != cl->xv.size() )
1485 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1486 std::swap(cl->xv.get()->data,x);
1487 double result = (cl->c.*cl->f)( cl->xv );
1488 std::swap(cl->xv.get()->data,x);
1498 double const (T::*f)(
gsl::vector const volatile&)
const;
1504 template<
typename T>
1505 class Furcrc :
public base_F {
1515 Furcrc( T& c,
double& (T::*f)(
gsl::vector const&)
const,
size_t const dim )
1516 : xv( dim ), c( c ), f( f ){}
1522 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1526 function_t
function(){
return &function_s; }
1540 static double function_s(
double* x,
size_t dim,
void* params ){
1541 Furcrc<T>*
const cl =
reinterpret_cast<Furcrc<T>*
>( params );
1542 if( dim != cl->xv.size() )
1543 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1544 std::swap(cl->xv.get()->data,x);
1545 double result = (cl->c.*cl->f)( cl->xv );
1546 std::swap(cl->xv.get()->data,x);
1562 template<
typename T>
1563 class FurCrc :
public base_F {
1573 FurCrc( T& c,
double& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim )
1574 : xv( dim ), c( c ), f( f ){}
1580 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1584 function_t
function(){
return &function_s; }
1598 static double function_s(
double* x,
size_t dim,
void* params ){
1599 FurCrc<T>*
const cl =
reinterpret_cast<FurCrc<T>*
>( params );
1600 if( dim != cl->xv.size() )
1601 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1602 std::swap(cl->xv.get()->data,x);
1603 double result = (cl->c.*cl->f)( cl->xv );
1604 std::swap(cl->xv.get()->data,x);
1614 double& (T::*f)(
gsl::vector const volatile&)
const;
1620 template<
typename T>
1621 class Fcrcrc :
public base_F {
1631 Fcrcrc( T& c,
double const& (T::*f)(
gsl::vector const&)
const,
size_t const dim )
1632 : xv( dim ), c( c ), f( f ){}
1638 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1642 function_t
function(){
return &function_s; }
1656 static double function_s(
double* x,
size_t dim,
void* params ){
1657 Fcrcrc<T>*
const cl =
reinterpret_cast<Fcrcrc<T>*
>( params );
1658 if( dim != cl->xv.size() )
1659 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1660 std::swap(cl->xv.get()->data,x);
1661 double result = (cl->c.*cl->f)( cl->xv );
1662 std::swap(cl->xv.get()->data,x);
1678 template<
typename T>
1679 class FcrCrc :
public base_F {
1689 FcrCrc( T& c,
double const& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim )
1690 : xv( dim ), c( c ), f( f ){}
1696 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1700 function_t
function(){
return &function_s; }
1714 static double function_s(
double* x,
size_t dim,
void* params ){
1715 FcrCrc<T>*
const cl =
reinterpret_cast<FcrCrc<T>*
>( params );
1716 if( dim != cl->xv.size() )
1717 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1718 std::swap(cl->xv.get()->data,x);
1719 double result = (cl->c.*cl->f)( cl->xv );
1720 std::swap(cl->xv.get()->data,x);
1730 double const& (T::*f)(
gsl::vector const volatile&)
const;
1736 template<
typename T>
1737 class FVrcrc :
public base_F {
1747 FVrcrc( T& c,
double volatile& (T::*f)(
gsl::vector const&)
const,
size_t const dim )
1748 : xv( dim ), c( c ), f( f ){}
1754 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1758 function_t
function(){
return &function_s; }
1772 static double function_s(
double* x,
size_t dim,
void* params ){
1773 FVrcrc<T>*
const cl =
reinterpret_cast<FVrcrc<T>*
>( params );
1774 if( dim != cl->xv.size() )
1775 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1776 std::swap(cl->xv.get()->data,x);
1777 double result = (cl->c.*cl->f)( cl->xv );
1778 std::swap(cl->xv.get()->data,x);
1788 double volatile& (T::*f)(
gsl::vector const&)
const;
1794 template<
typename T>
1795 class FVrCrc :
public base_F {
1805 FVrCrc( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim )
1806 : xv( dim ), c( c ), f( f ){}
1812 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1816 function_t
function(){
return &function_s; }
1830 static double function_s(
double* x,
size_t dim,
void* params ){
1831 FVrCrc<T>*
const cl =
reinterpret_cast<FVrCrc<T>*
>( params );
1832 if( dim != cl->xv.size() )
1833 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1834 std::swap(cl->xv.get()->data,x);
1835 double result = (cl->c.*cl->f)( cl->xv );
1836 std::swap(cl->xv.get()->data,x);
1846 double volatile& (T::*f)(
gsl::vector const volatile&)
const;
1852 template<
typename T>
1853 class FCrcrc :
public base_F {
1863 FCrcrc( T& c,
double const volatile& (T::*f)(
gsl::vector const&)
const,
size_t const dim )
1864 : xv( dim ), c( c ), f( f ){}
1870 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1874 function_t
function(){
return &function_s; }
1888 static double function_s(
double* x,
size_t dim,
void* params ){
1889 FCrcrc<T>*
const cl =
reinterpret_cast<FCrcrc<T>*
>( params );
1890 if( dim != cl->xv.size() )
1891 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1892 std::swap(cl->xv.get()->data,x);
1893 double result = (cl->c.*cl->f)( cl->xv );
1894 std::swap(cl->xv.get()->data,x);
1904 double const volatile& (T::*f)(
gsl::vector const&)
const;
1910 template<
typename T>
1911 class FCrCrc :
public base_F {
1921 FCrCrc( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim )
1922 : xv( dim ), c( c ), f( f ){}
1928 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1932 function_t
function(){
return &function_s; }
1946 static double function_s(
double* x,
size_t dim,
void* params ){
1947 FCrCrc<T>*
const cl =
reinterpret_cast<FCrCrc<T>*
>( params );
1948 if( dim != cl->xv.size() )
1949 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
1950 std::swap(cl->xv.get()->data,x);
1951 double result = (cl->c.*cl->f)( cl->xv );
1952 std::swap(cl->xv.get()->data,x);
1962 double const volatile& (T::*f)(
gsl::vector const volatile&)
const;
1968 template<
typename T>
1969 class FuvcrV :
public base_F {
1979 FuvcrV( T& c,
double (T::*f)(
gsl::vector const&)
volatile,
size_t const dim )
1980 : xv( dim ), c( c ), f( f ){}
1986 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
1990 function_t
function(){
return &function_s; }
2004 static double function_s(
double* x,
size_t dim,
void* params ){
2005 FuvcrV<T>*
const cl =
reinterpret_cast<FuvcrV<T>*
>( params );
2006 if( dim != cl->xv.size() )
2007 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2008 std::swap(cl->xv.get()->data,x);
2009 double result = (cl->c.*cl->f)( cl->xv );
2010 std::swap(cl->xv.get()->data,x);
2026 template<
typename T>
2027 class FuvCrV :
public base_F {
2037 FuvCrV( T& c,
double (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim )
2038 : xv( dim ), c( c ), f( f ){}
2044 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2048 function_t
function(){
return &function_s; }
2062 static double function_s(
double* x,
size_t dim,
void* params ){
2063 FuvCrV<T>*
const cl =
reinterpret_cast<FuvCrV<T>*
>( params );
2064 if( dim != cl->xv.size() )
2065 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2066 std::swap(cl->xv.get()->data,x);
2067 double result = (cl->c.*cl->f)( cl->xv );
2068 std::swap(cl->xv.get()->data,x);
2078 double (T::*f)(
gsl::vector const volatile&)
volatile;
2084 template<
typename T>
2085 class FcvcrV :
public base_F {
2095 FcvcrV( T& c,
double const (T::*f)(
gsl::vector const&)
volatile,
size_t const dim )
2096 : xv( dim ), c( c ), f( f ){}
2102 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2106 function_t
function(){
return &function_s; }
2120 static double function_s(
double* x,
size_t dim,
void* params ){
2121 FcvcrV<T>*
const cl =
reinterpret_cast<FcvcrV<T>*
>( params );
2122 if( dim != cl->xv.size() )
2123 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2124 std::swap(cl->xv.get()->data,x);
2125 double result = (cl->c.*cl->f)( cl->xv );
2126 std::swap(cl->xv.get()->data,x);
2136 double const (T::*f)(
gsl::vector const&)
volatile;
2142 template<
typename T>
2143 class FcvCrV :
public base_F {
2153 FcvCrV( T& c,
double const (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim )
2154 : xv( dim ), c( c ), f( f ){}
2160 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2164 function_t
function(){
return &function_s; }
2178 static double function_s(
double* x,
size_t dim,
void* params ){
2179 FcvCrV<T>*
const cl =
reinterpret_cast<FcvCrV<T>*
>( params );
2180 if( dim != cl->xv.size() )
2181 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2182 std::swap(cl->xv.get()->data,x);
2183 double result = (cl->c.*cl->f)( cl->xv );
2184 std::swap(cl->xv.get()->data,x);
2194 double const (T::*f)(
gsl::vector const volatile&)
volatile;
2200 template<
typename T>
2201 class FurcrV :
public base_F {
2211 FurcrV( T& c,
double& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim )
2212 : xv( dim ), c( c ), f( f ){}
2218 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2222 function_t
function(){
return &function_s; }
2236 static double function_s(
double* x,
size_t dim,
void* params ){
2237 FurcrV<T>*
const cl =
reinterpret_cast<FurcrV<T>*
>( params );
2238 if( dim != cl->xv.size() )
2239 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2240 std::swap(cl->xv.get()->data,x);
2241 double result = (cl->c.*cl->f)( cl->xv );
2242 std::swap(cl->xv.get()->data,x);
2258 template<
typename T>
2259 class FurCrV :
public base_F {
2269 FurCrV( T& c,
double& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim )
2270 : xv( dim ), c( c ), f( f ){}
2276 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2280 function_t
function(){
return &function_s; }
2294 static double function_s(
double* x,
size_t dim,
void* params ){
2295 FurCrV<T>*
const cl =
reinterpret_cast<FurCrV<T>*
>( params );
2296 if( dim != cl->xv.size() )
2297 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2298 std::swap(cl->xv.get()->data,x);
2299 double result = (cl->c.*cl->f)( cl->xv );
2300 std::swap(cl->xv.get()->data,x);
2310 double& (T::*f)(
gsl::vector const volatile&)
volatile;
2316 template<
typename T>
2317 class FcrcrV :
public base_F {
2327 FcrcrV( T& c,
double const& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim )
2328 : xv( dim ), c( c ), f( f ){}
2334 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2338 function_t
function(){
return &function_s; }
2352 static double function_s(
double* x,
size_t dim,
void* params ){
2353 FcrcrV<T>*
const cl =
reinterpret_cast<FcrcrV<T>*
>( params );
2354 if( dim != cl->xv.size() )
2355 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2356 std::swap(cl->xv.get()->data,x);
2357 double result = (cl->c.*cl->f)( cl->xv );
2358 std::swap(cl->xv.get()->data,x);
2368 double const& (T::*f)(
gsl::vector const&)
volatile;
2374 template<
typename T>
2375 class FcrCrV :
public base_F {
2385 FcrCrV( T& c,
double const& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim )
2386 : xv( dim ), c( c ), f( f ){}
2392 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2396 function_t
function(){
return &function_s; }
2410 static double function_s(
double* x,
size_t dim,
void* params ){
2411 FcrCrV<T>*
const cl =
reinterpret_cast<FcrCrV<T>*
>( params );
2412 if( dim != cl->xv.size() )
2413 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2414 std::swap(cl->xv.get()->data,x);
2415 double result = (cl->c.*cl->f)( cl->xv );
2416 std::swap(cl->xv.get()->data,x);
2426 double const& (T::*f)(
gsl::vector const volatile&)
volatile;
2432 template<
typename T>
2433 class FVrcrV :
public base_F {
2443 FVrcrV( T& c,
double volatile& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim )
2444 : xv( dim ), c( c ), f( f ){}
2450 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2454 function_t
function(){
return &function_s; }
2468 static double function_s(
double* x,
size_t dim,
void* params ){
2469 FVrcrV<T>*
const cl =
reinterpret_cast<FVrcrV<T>*
>( params );
2470 if( dim != cl->xv.size() )
2471 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2472 std::swap(cl->xv.get()->data,x);
2473 double result = (cl->c.*cl->f)( cl->xv );
2474 std::swap(cl->xv.get()->data,x);
2484 double volatile& (T::*f)(
gsl::vector const&)
volatile;
2490 template<
typename T>
2491 class FVrCrV :
public base_F {
2501 FVrCrV( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim )
2502 : xv( dim ), c( c ), f( f ){}
2508 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2512 function_t
function(){
return &function_s; }
2526 static double function_s(
double* x,
size_t dim,
void* params ){
2527 FVrCrV<T>*
const cl =
reinterpret_cast<FVrCrV<T>*
>( params );
2528 if( dim != cl->xv.size() )
2529 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2530 std::swap(cl->xv.get()->data,x);
2531 double result = (cl->c.*cl->f)( cl->xv );
2532 std::swap(cl->xv.get()->data,x);
2542 double volatile& (T::*f)(
gsl::vector const volatile&)
volatile;
2548 template<
typename T>
2549 class FCrcrV :
public base_F {
2559 FCrcrV( T& c,
double const volatile& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim )
2560 : xv( dim ), c( c ), f( f ){}
2566 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2570 function_t
function(){
return &function_s; }
2584 static double function_s(
double* x,
size_t dim,
void* params ){
2585 FCrcrV<T>*
const cl =
reinterpret_cast<FCrcrV<T>*
>( params );
2586 if( dim != cl->xv.size() )
2587 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2588 std::swap(cl->xv.get()->data,x);
2589 double result = (cl->c.*cl->f)( cl->xv );
2590 std::swap(cl->xv.get()->data,x);
2600 double const volatile& (T::*f)(
gsl::vector const&)
volatile;
2606 template<
typename T>
2607 class FCrCrV :
public base_F {
2617 FCrCrV( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim )
2618 : xv( dim ), c( c ), f( f ){}
2624 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2628 function_t
function(){
return &function_s; }
2642 static double function_s(
double* x,
size_t dim,
void* params ){
2643 FCrCrV<T>*
const cl =
reinterpret_cast<FCrCrV<T>*
>( params );
2644 if( dim != cl->xv.size() )
2645 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2646 std::swap(cl->xv.get()->data,x);
2647 double result = (cl->c.*cl->f)( cl->xv );
2648 std::swap(cl->xv.get()->data,x);
2658 double const volatile& (T::*f)(
gsl::vector const volatile&)
volatile;
2664 template<
typename T>
2665 class FuvcrC :
public base_F {
2675 FuvcrC( T& c,
double (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim )
2676 : xv( dim ), c( c ), f( f ){}
2682 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2686 function_t
function(){
return &function_s; }
2700 static double function_s(
double* x,
size_t dim,
void* params ){
2701 FuvcrC<T>*
const cl =
reinterpret_cast<FuvcrC<T>*
>( params );
2702 if( dim != cl->xv.size() )
2703 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2704 std::swap(cl->xv.get()->data,x);
2705 double result = (cl->c.*cl->f)( cl->xv );
2706 std::swap(cl->xv.get()->data,x);
2716 double (T::*f)(
gsl::vector const&)
const volatile;
2722 template<
typename T>
2723 class FuvCrC :
public base_F {
2733 FuvCrC( T& c,
double (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim )
2734 : xv( dim ), c( c ), f( f ){}
2740 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2744 function_t
function(){
return &function_s; }
2758 static double function_s(
double* x,
size_t dim,
void* params ){
2759 FuvCrC<T>*
const cl =
reinterpret_cast<FuvCrC<T>*
>( params );
2760 if( dim != cl->xv.size() )
2761 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2762 std::swap(cl->xv.get()->data,x);
2763 double result = (cl->c.*cl->f)( cl->xv );
2764 std::swap(cl->xv.get()->data,x);
2774 double (T::*f)(
gsl::vector const volatile&)
const volatile;
2780 template<
typename T>
2781 class FcvcrC :
public base_F {
2791 FcvcrC( T& c,
double const (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim )
2792 : xv( dim ), c( c ), f( f ){}
2798 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2802 function_t
function(){
return &function_s; }
2816 static double function_s(
double* x,
size_t dim,
void* params ){
2817 FcvcrC<T>*
const cl =
reinterpret_cast<FcvcrC<T>*
>( params );
2818 if( dim != cl->xv.size() )
2819 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2820 std::swap(cl->xv.get()->data,x);
2821 double result = (cl->c.*cl->f)( cl->xv );
2822 std::swap(cl->xv.get()->data,x);
2832 double const (T::*f)(
gsl::vector const&)
const volatile;
2838 template<
typename T>
2839 class FcvCrC :
public base_F {
2849 FcvCrC( T& c,
double const (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim )
2850 : xv( dim ), c( c ), f( f ){}
2856 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2860 function_t
function(){
return &function_s; }
2874 static double function_s(
double* x,
size_t dim,
void* params ){
2875 FcvCrC<T>*
const cl =
reinterpret_cast<FcvCrC<T>*
>( params );
2876 if( dim != cl->xv.size() )
2877 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2878 std::swap(cl->xv.get()->data,x);
2879 double result = (cl->c.*cl->f)( cl->xv );
2880 std::swap(cl->xv.get()->data,x);
2890 double const (T::*f)(
gsl::vector const volatile&)
const volatile;
2896 template<
typename T>
2897 class FurcrC :
public base_F {
2907 FurcrC( T& c,
double& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim )
2908 : xv( dim ), c( c ), f( f ){}
2914 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2918 function_t
function(){
return &function_s; }
2932 static double function_s(
double* x,
size_t dim,
void* params ){
2933 FurcrC<T>*
const cl =
reinterpret_cast<FurcrC<T>*
>( params );
2934 if( dim != cl->xv.size() )
2935 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2936 std::swap(cl->xv.get()->data,x);
2937 double result = (cl->c.*cl->f)( cl->xv );
2938 std::swap(cl->xv.get()->data,x);
2948 double& (T::*f)(
gsl::vector const&)
const volatile;
2954 template<
typename T>
2955 class FurCrC :
public base_F {
2965 FurCrC( T& c,
double& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim )
2966 : xv( dim ), c( c ), f( f ){}
2972 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
2976 function_t
function(){
return &function_s; }
2990 static double function_s(
double* x,
size_t dim,
void* params ){
2991 FurCrC<T>*
const cl =
reinterpret_cast<FurCrC<T>*
>( params );
2992 if( dim != cl->xv.size() )
2993 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
2994 std::swap(cl->xv.get()->data,x);
2995 double result = (cl->c.*cl->f)( cl->xv );
2996 std::swap(cl->xv.get()->data,x);
3006 double& (T::*f)(
gsl::vector const volatile&)
const volatile;
3012 template<
typename T>
3013 class FcrcrC :
public base_F {
3023 FcrcrC( T& c,
double const& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim )
3024 : xv( dim ), c( c ), f( f ){}
3030 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
3034 function_t
function(){
return &function_s; }
3048 static double function_s(
double* x,
size_t dim,
void* params ){
3049 FcrcrC<T>*
const cl =
reinterpret_cast<FcrcrC<T>*
>( params );
3050 if( dim != cl->xv.size() )
3051 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
3052 std::swap(cl->xv.get()->data,x);
3053 double result = (cl->c.*cl->f)( cl->xv );
3054 std::swap(cl->xv.get()->data,x);
3064 double const& (T::*f)(
gsl::vector const&)
const volatile;
3070 template<
typename T>
3071 class FcrCrC :
public base_F {
3081 FcrCrC( T& c,
double const& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim )
3082 : xv( dim ), c( c ), f( f ){}
3088 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
3092 function_t
function(){
return &function_s; }
3106 static double function_s(
double* x,
size_t dim,
void* params ){
3107 FcrCrC<T>*
const cl =
reinterpret_cast<FcrCrC<T>*
>( params );
3108 if( dim != cl->xv.size() )
3109 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
3110 std::swap(cl->xv.get()->data,x);
3111 double result = (cl->c.*cl->f)( cl->xv );
3112 std::swap(cl->xv.get()->data,x);
3122 double const& (T::*f)(
gsl::vector const volatile&)
const volatile;
3128 template<
typename T>
3129 class FVrcrC :
public base_F {
3139 FVrcrC( T& c,
double volatile& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim )
3140 : xv( dim ), c( c ), f( f ){}
3146 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
3150 function_t
function(){
return &function_s; }
3164 static double function_s(
double* x,
size_t dim,
void* params ){
3165 FVrcrC<T>*
const cl =
reinterpret_cast<FVrcrC<T>*
>( params );
3166 if( dim != cl->xv.size() )
3167 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
3168 std::swap(cl->xv.get()->data,x);
3169 double result = (cl->c.*cl->f)( cl->xv );
3170 std::swap(cl->xv.get()->data,x);
3180 double volatile& (T::*f)(
gsl::vector const&)
const volatile;
3186 template<
typename T>
3187 class FVrCrC :
public base_F {
3197 FVrCrC( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim )
3198 : xv( dim ), c( c ), f( f ){}
3204 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
3208 function_t
function(){
return &function_s; }
3222 static double function_s(
double* x,
size_t dim,
void* params ){
3223 FVrCrC<T>*
const cl =
reinterpret_cast<FVrCrC<T>*
>( params );
3224 if( dim != cl->xv.size() )
3225 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
3226 std::swap(cl->xv.get()->data,x);
3227 double result = (cl->c.*cl->f)( cl->xv );
3228 std::swap(cl->xv.get()->data,x);
3238 double volatile& (T::*f)(
gsl::vector const volatile&)
const volatile;
3244 template<
typename T>
3245 class FCrcrC :
public base_F {
3255 FCrcrC( T& c,
double const volatile& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim )
3256 : xv( dim ), c( c ), f( f ){}
3262 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
3266 function_t
function(){
return &function_s; }
3280 static double function_s(
double* x,
size_t dim,
void* params ){
3281 FCrcrC<T>*
const cl =
reinterpret_cast<FCrcrC<T>*
>( params );
3282 if( dim != cl->xv.size() )
3283 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
3284 std::swap(cl->xv.get()->data,x);
3285 double result = (cl->c.*cl->f)( cl->xv );
3286 std::swap(cl->xv.get()->data,x);
3296 double const volatile& (T::*f)(
gsl::vector const&)
const volatile;
3302 template<
typename T>
3303 class FCrCrC :
public base_F {
3313 FCrCrC( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim )
3314 : xv( dim ), c( c ), f( f ){}
3320 double operator()(
gsl::vector const& x ){
return (c.*f)( x ); }
3324 function_t
function(){
return &function_s; }
3338 static double function_s(
double* x,
size_t dim,
void* params ){
3339 FCrCrC<T>*
const cl =
reinterpret_cast<FCrCrC<T>*
>( params );
3340 if( dim != cl->xv.size() )
3341 GSL_ERROR(
"Number of arguments and dim do not match.", GSL_EBADLEN );
3342 std::swap(cl->xv.get()->data,x);
3343 double result = (cl->c.*cl->f)( cl->xv );
3344 std::swap(cl->xv.get()->data,x);
3354 double const volatile& (T::*f)(
gsl::vector const volatile&)
const volatile;
3379 base_f =
new Fuvcr( f, dim );
3381 this->f =
base_f->function();
3394 base_f =
new FuvCr( f, dim );
3396 this->f =
base_f->function();
3408 base_f =
new Fcvcr( f, dim );
3410 this->f =
base_f->function();
3421 explicit function(
double const (*
const f)(
gsl::vector const volatile&),
size_t const dim ){
3422 base_f =
new FcvCr( f, dim );
3424 this->f =
base_f->function();
3438 base_f =
new Furcr( f, dim );
3440 this->f =
base_f->function();
3452 base_f =
new FurCr( f, dim );
3454 this->f =
base_f->function();
3468 base_f =
new Fcrcr( f, dim );
3470 this->f =
base_f->function();
3481 explicit function(
double const& (*
const f)(
gsl::vector const volatile&),
size_t const dim ){
3482 base_f =
new FcrCr( f, dim );
3484 this->f =
base_f->function();
3498 base_f =
new FVrcr( f, dim );
3500 this->f =
base_f->function();
3511 explicit function(
double volatile& (*
const f)(
gsl::vector const volatile&),
size_t const dim ){
3512 base_f =
new FVrCr( f, dim );
3514 this->f =
base_f->function();
3527 explicit function(
double const volatile& (*
const f)(
gsl::vector const&),
size_t const dim ){
3528 base_f =
new FCrcr( f, dim );
3530 this->f =
base_f->function();
3541 explicit function(
double const volatile& (*
const f)(
gsl::vector const volatile&),
size_t const dim ){
3542 base_f =
new FCrCr( f, dim );
3544 this->f =
base_f->function();
3558 base_f =
new Fuvcru<T>( c, f, dim );
3560 this->f =
base_f->function();
3573 template<
typename T>
function( T& c,
double (T::*f)(
gsl::vector const volatile&),
size_t const dim ){
3574 base_f =
new FuvCru<T>( c, f, dim );
3576 this->f =
base_f->function();
3588 template<
typename T>
function( T& c,
double const (T::*f)(
gsl::vector const&),
size_t const dim ){
3589 base_f =
new Fcvcru<T>( c, f, dim );
3591 this->f =
base_f->function();
3603 template<
typename T>
function( T& c,
double const (T::*f)(
gsl::vector const volatile&),
size_t const dim ){
3604 base_f =
new FcvCru<T>( c, f, dim );
3606 this->f =
base_f->function();
3620 template<
typename T>
function( T& c,
double& (T::*f)(
gsl::vector const&),
size_t const dim ){
3621 base_f =
new Furcru<T>( c, f, dim );
3623 this->f =
base_f->function();
3635 template<
typename T>
function( T& c,
double& (T::*f)(
gsl::vector const volatile&),
size_t const dim ){
3636 base_f =
new FurCru<T>( c, f, dim );
3638 this->f =
base_f->function();
3652 template<
typename T>
function( T& c,
double const& (T::*f)(
gsl::vector const&),
size_t const dim ){
3653 base_f =
new Fcrcru<T>( c, f, dim );
3655 this->f =
base_f->function();
3667 template<
typename T>
function( T& c,
double const& (T::*f)(
gsl::vector const volatile&),
size_t const dim ){
3668 base_f =
new FcrCru<T>( c, f, dim );
3670 this->f =
base_f->function();
3684 template<
typename T>
function( T& c,
double volatile& (T::*f)(
gsl::vector const&),
size_t const dim ){
3685 base_f =
new FVrcru<T>( c, f, dim );
3687 this->f =
base_f->function();
3699 template<
typename T>
function( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&),
size_t const dim ){
3700 base_f =
new FVrCru<T>( c, f, dim );
3702 this->f =
base_f->function();
3716 template<
typename T>
function( T& c,
double const volatile& (T::*f)(
gsl::vector const&),
size_t const dim ){
3717 base_f =
new FCrcru<T>( c, f, dim );
3719 this->f =
base_f->function();
3731 template<
typename T>
function( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&),
size_t const dim ){
3732 base_f =
new FCrCru<T>( c, f, dim );
3734 this->f =
base_f->function();
3748 template<
typename T>
function( T& c,
double (T::*f)(
gsl::vector const&)
const,
size_t const dim ){
3749 base_f =
new Fuvcrc<T>( c, f, dim );
3751 this->f =
base_f->function();
3763 template<
typename T>
function( T& c,
double (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim ){
3764 base_f =
new FuvCrc<T>( c, f, dim );
3766 this->f =
base_f->function();
3780 template<
typename T>
function( T& c,
double const (T::*f)(
gsl::vector const&)
const,
size_t const dim ){
3781 base_f =
new Fcvcrc<T>( c, f, dim );
3783 this->f =
base_f->function();
3795 template<
typename T>
function( T& c,
double const (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim ){
3796 base_f =
new FcvCrc<T>( c, f, dim );
3798 this->f =
base_f->function();
3812 template<
typename T>
function( T& c,
double& (T::*f)(
gsl::vector const&)
const,
size_t const dim ){
3813 base_f =
new Furcrc<T>( c, f, dim );
3815 this->f =
base_f->function();
3827 template<
typename T>
function( T& c,
double& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim ){
3828 base_f =
new FurCrc<T>( c, f, dim );
3830 this->f =
base_f->function();
3844 template<
typename T>
function( T& c,
double const& (T::*f)(
gsl::vector const&)
const,
size_t const dim ){
3845 base_f =
new Fcrcrc<T>( c, f, dim );
3847 this->f =
base_f->function();
3859 template<
typename T>
function( T& c,
double const& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim ){
3860 base_f =
new FcrCrc<T>( c, f, dim );
3862 this->f =
base_f->function();
3876 template<
typename T>
function( T& c,
double volatile& (T::*f)(
gsl::vector const&)
const,
size_t const dim ){
3877 base_f =
new FVrcrc<T>( c, f, dim );
3879 this->f =
base_f->function();
3891 template<
typename T>
function( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim ){
3892 base_f =
new FVrCrc<T>( c, f, dim );
3894 this->f =
base_f->function();
3908 template<
typename T>
function( T& c,
double const volatile& (T::*f)(
gsl::vector const&)
const,
size_t const dim ){
3909 base_f =
new FCrcrc<T>( c, f, dim );
3911 this->f =
base_f->function();
3923 template<
typename T>
function( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim ){
3924 base_f =
new FCrCrc<T>( c, f, dim );
3926 this->f =
base_f->function();
3940 template<
typename T>
function( T& c,
double (T::*f)(
gsl::vector const&)
volatile,
size_t const dim ){
3941 base_f =
new FuvcrV<T>( c, f, dim );
3943 this->f =
base_f->function();
3955 template<
typename T>
function( T& c,
double (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
3956 base_f =
new FuvCrV<T>( c, f, dim );
3958 this->f =
base_f->function();
3972 template<
typename T>
function( T& c,
double const (T::*f)(
gsl::vector const&)
volatile,
size_t const dim ){
3973 base_f =
new FcvcrV<T>( c, f, dim );
3975 this->f =
base_f->function();
3987 template<
typename T>
function( T& c,
double const (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
3988 base_f =
new FcvCrV<T>( c, f, dim );
3990 this->f =
base_f->function();
4004 template<
typename T>
function( T& c,
double& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim ){
4005 base_f =
new FurcrV<T>( c, f, dim );
4007 this->f =
base_f->function();
4019 template<
typename T>
function( T& c,
double& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
4020 base_f =
new FurCrV<T>( c, f, dim );
4022 this->f =
base_f->function();
4036 template<
typename T>
function( T& c,
double const& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim ){
4037 base_f =
new FcrcrV<T>( c, f, dim );
4039 this->f =
base_f->function();
4051 template<
typename T>
function( T& c,
double const& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
4052 base_f =
new FcrCrV<T>( c, f, dim );
4054 this->f =
base_f->function();
4068 template<
typename T>
function( T& c,
double volatile& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim ){
4069 base_f =
new FVrcrV<T>( c, f, dim );
4071 this->f =
base_f->function();
4083 template<
typename T>
function( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
4084 base_f =
new FVrCrV<T>( c, f, dim );
4086 this->f =
base_f->function();
4100 template<
typename T>
function( T& c,
double const volatile& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim ){
4101 base_f =
new FCrcrV<T>( c, f, dim );
4103 this->f =
base_f->function();
4115 template<
typename T>
function( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
4116 base_f =
new FCrCrV<T>( c, f, dim );
4118 this->f =
base_f->function();
4132 template<
typename T>
function( T& c,
double (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim ){
4133 base_f =
new FuvcrC<T>( c, f, dim );
4135 this->f =
base_f->function();
4147 template<
typename T>
function( T& c,
double (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4148 base_f =
new FuvCrC<T>( c, f, dim );
4150 this->f =
base_f->function();
4164 template<
typename T>
function( T& c,
double const (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim ){
4165 base_f =
new FcvcrC<T>( c, f, dim );
4167 this->f =
base_f->function();
4179 template<
typename T>
function( T& c,
double const (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4180 base_f =
new FcvCrC<T>( c, f, dim );
4182 this->f =
base_f->function();
4196 template<
typename T>
function( T& c,
double& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim ){
4197 base_f =
new FurcrC<T>( c, f, dim );
4199 this->f =
base_f->function();
4211 template<
typename T>
function( T& c,
double& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4212 base_f =
new FurCrC<T>( c, f, dim );
4214 this->f =
base_f->function();
4228 template<
typename T>
function( T& c,
double const& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim ){
4229 base_f =
new FcrcrC<T>( c, f, dim );
4231 this->f =
base_f->function();
4243 template<
typename T>
function( T& c,
double const& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4244 base_f =
new FcrCrC<T>( c, f, dim );
4246 this->f =
base_f->function();
4260 template<
typename T>
function( T& c,
double volatile& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim ){
4261 base_f =
new FVrcrC<T>( c, f, dim );
4263 this->f =
base_f->function();
4275 template<
typename T>
function( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4276 base_f =
new FVrCrC<T>( c, f, dim );
4278 this->f =
base_f->function();
4292 template<
typename T>
function( T& c,
double const volatile& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim ){
4293 base_f =
new FCrcrC<T>( c, f, dim );
4295 this->f =
base_f->function();
4307 template<
typename T>
function( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4308 base_f =
new FCrCrC<T>( c, f, dim );
4310 this->f =
base_f->function();
4349#ifdef __GXX_EXPERIMENTAL_CXX0X__
4355 std::swap( f, v.f );
4356 std::swap( dim, v.dim );
4357 std::swap( params, v.params );
4358 std::swap(
count, v.count );
4367 std::swap(
base_f, v.base_f );
4368 std::swap( f, v.f );
4369 std::swap( dim, v.dim );
4370 std::swap( params, v.params );
4371 std::swap(
count, v.count );
4395 static double fn(
double* x,
size_t dim,
void* params ){
4396 base_F*
const b =
reinterpret_cast<base_F*
>( params );
4397 return b->function()( x, dim, params );
4406 template<
typename T>
4418 template<
typename T>
4420 function fn( c, f, dim );
4429 template<
typename T>
4431 function fn( c, f, dim );
4440 template<
typename T>
4442 function fn( c, f, dim );
4453 template<
typename T>
4455 function fn( c, f, dim );
4464 template<
typename T>
4466 function fn( c, f, dim );
4477 template<
typename T>
4479 function fn( c, f, dim );
4488 template<
typename T>
4490 function fn( c, f, dim );
4501 template<
typename T>
4503 function fn( c, f, dim );
4512 template<
typename T>
4514 function fn( c, f, dim );
4525 template<
typename T>
4527 function fn( c, f, dim );
4536 template<
typename T>
4537 inline function
make_function( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&) ,
size_t const dim ){
4538 function fn( c, f, dim );
4549 template<
typename T>
4551 function fn( c, f, dim );
4560 template<
typename T>
4562 function fn( c, f, dim );
4573 template<
typename T>
4575 function fn( c, f, dim );
4584 template<
typename T>
4586 function fn( c, f, dim );
4597 template<
typename T>
4599 function fn( c, f, dim );
4608 template<
typename T>
4610 function fn( c, f, dim );
4621 template<
typename T>
4623 function fn( c, f, dim );
4632 template<
typename T>
4634 function fn( c, f, dim );
4645 template<
typename T>
4647 function fn( c, f, dim );
4656 template<
typename T>
4657 inline function
make_function( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim ){
4658 function fn( c, f, dim );
4669 template<
typename T>
4671 function fn( c, f, dim );
4680 template<
typename T>
4681 inline function
make_function( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
const,
size_t const dim ){
4682 function fn( c, f, dim );
4693 template<
typename T>
4695 function fn( c, f, dim );
4704 template<
typename T>
4706 function fn( c, f, dim );
4717 template<
typename T>
4719 function fn( c, f, dim );
4728 template<
typename T>
4729 inline function
make_function( T& c,
double const (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
4730 function fn( c, f, dim );
4741 template<
typename T>
4743 function fn( c, f, dim );
4752 template<
typename T>
4754 function fn( c, f, dim );
4765 template<
typename T>
4767 function fn( c, f, dim );
4776 template<
typename T>
4777 inline function
make_function( T& c,
double const& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
4778 function fn( c, f, dim );
4789 template<
typename T>
4791 function fn( c, f, dim );
4800 template<
typename T>
4801 inline function
make_function( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
4802 function fn( c, f, dim );
4813 template<
typename T>
4814 inline function
make_function( T& c,
double const volatile& (T::*f)(
gsl::vector const&)
volatile,
size_t const dim ){
4815 function fn( c, f, dim );
4824 template<
typename T>
4825 inline function
make_function( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
volatile,
size_t const dim ){
4826 function fn( c, f, dim );
4837 template<
typename T>
4839 function fn( c, f, dim );
4848 template<
typename T>
4849 inline function
make_function( T& c,
double (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4850 function fn( c, f, dim );
4861 template<
typename T>
4863 function fn( c, f, dim );
4872 template<
typename T>
4873 inline function
make_function( T& c,
double const (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4874 function fn( c, f, dim );
4885 template<
typename T>
4887 function fn( c, f, dim );
4896 template<
typename T>
4897 inline function
make_function( T& c,
double& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4898 function fn( c, f, dim );
4909 template<
typename T>
4911 function fn( c, f, dim );
4920 template<
typename T>
4921 inline function
make_function( T& c,
double const& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4922 function fn( c, f, dim );
4933 template<
typename T>
4934 inline function
make_function( T& c,
double volatile& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim ){
4935 function fn( c, f, dim );
4944 template<
typename T>
4945 inline function
make_function( T& c,
double volatile& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4946 function fn( c, f, dim );
4957 template<
typename T>
4958 inline function
make_function( T& c,
double const volatile& (T::*f)(
gsl::vector const&)
const volatile,
size_t const dim ){
4959 function fn( c, f, dim );
4968 template<
typename T>
4969 inline function
make_function( T& c,
double const volatile& (T::*f)(
gsl::vector const volatile&)
const volatile,
size_t const dim ){
4970 function fn( c, f, dim );
Class that extends gsl_monte_function so that it can be constructed from arbitrary function objects.
function(function const &v)
The copy constructor.
function(T &c, double(T::*f)(gsl::vector const &), size_t const dim)
Construct from a function object and a suitable member function.
function(function &&v)
Move constructor.
~function()
The destructor unshares any shared resource.
static double fn(double *x, size_t dim, void *params)
This is the function that gsl_monte_function points to if function is constructed from a function obj...
function(double(*const f)(gsl::vector const &), size_t const dim)
Construct from a function.
function & operator=(function &&v)
Move operator.
size_t * count
The shared reference count.
function()
The default constructor is only really useful for assigning to.
function & operator=(function const &v)
The assignment operator.
This class handles vector objects as shared handles.
function make_function(T &c, double(T::*f)(gsl::vector const &), size_t const dim)
Make a gsl::monte::function from a function object and a suitable member function.
double b(int order, double qq)
C++ version of gsl_sf_mathieu_b().
gsl_sf_result result
Typedef for gsl_sf_result.
The gsl package creates an interface to the GNU Scientific Library for C++.