ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
monte.hpp
Go to the documentation of this file.
1/*
2 * $Id$
3 * Copyright (C) 2010, 2011, 2012, 2020 John D Lamb
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20#ifndef CCGSL_MONTE_HPP
21#define CCGSL_MONTE_HPP
22
23#include<gsl/gsl_monte.h>
24#include"vector.hpp"
25#include"rng.hpp"
26
27namespace gsl {
28 namespace monte {
59 class function : public gsl_monte_function {
60#ifndef DOXYGEN_SKIP
61 private:
65 struct base_F {
69 typedef double (*function_t)(double*,size_t,void*);
73 virtual ~base_F(){};
78 virtual function_t function() = 0;
79 };
83 class Fuvcr : public base_F {
84 public:
90 Fuvcr( double (*const f)(gsl::vector const&), size_t const dim ) : f( f ), xv( dim ){}
94 function_t function(){ return &fn; }
95 private:
99 double (*const f)(gsl::vector const&);
103 gsl::vector xv;
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);
118 return result;
119 }
120 };
124 class FuvCr : public base_F {
125 public:
131 FuvCr( double (*const f)(gsl::vector const volatile&), size_t const dim ) : f( f ), xv( dim ){}
135 function_t function(){ return &fn; }
136 private:
140 double (*const f)(gsl::vector const volatile&);
144 gsl::vector xv;
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);
159 return result;
160 }
161 };
165 class Fcvcr : public base_F {
166 public:
172 Fcvcr( double const (*const f)(gsl::vector const&), size_t const dim ) : f( f ), xv( dim ){}
176 function_t function(){ return &fn; }
177 private:
181 double const (*const f)(gsl::vector const&);
185 gsl::vector xv;
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);
200 return result;
201 }
202 };
206 class FcvCr : public base_F {
207 public:
213 FcvCr( double const (*const f)(gsl::vector const volatile&), size_t const dim ) : f( f ), xv( dim ){}
217 function_t function(){ return &fn; }
218 private:
222 double const (*const f)(gsl::vector const volatile&);
226 gsl::vector xv;
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);
241 return result;
242 }
243 };
247 class Furcr : public base_F {
248 public:
254 Furcr( double& (*const f)(gsl::vector const&), size_t const dim ) : f( f ), xv( dim ){}
258 function_t function(){ return &fn; }
259 private:
263 double& (*const f)(gsl::vector const&);
267 gsl::vector xv;
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);
282 return result;
283 }
284 };
288 class FurCr : public base_F {
289 public:
295 FurCr( double& (*const f)(gsl::vector const volatile&), size_t const dim ) : f( f ), xv( dim ){}
299 function_t function(){ return &fn; }
300 private:
304 double& (*const f)(gsl::vector const volatile&);
308 gsl::vector xv;
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);
323 return result;
324 }
325 };
329 class Fcrcr : public base_F {
330 public:
336 Fcrcr( double const& (*const f)(gsl::vector const&), size_t const dim ) : f( f ), xv( dim ){}
340 function_t function(){ return &fn; }
341 private:
345 double const& (*const f)(gsl::vector const&);
349 gsl::vector xv;
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);
364 return result;
365 }
366 };
370 class FcrCr : public base_F {
371 public:
377 FcrCr( double const& (*const f)(gsl::vector const volatile&), size_t const dim ) : f( f ), xv( dim ){}
381 function_t function(){ return &fn; }
382 private:
386 double const& (*const f)(gsl::vector const volatile&);
390 gsl::vector xv;
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);
405 return result;
406 }
407 };
411 class FVrcr : public base_F {
412 public:
418 FVrcr( double volatile& (*const f)(gsl::vector const&), size_t const dim ) : f( f ), xv( dim ){}
422 function_t function(){ return &fn; }
423 private:
427 double volatile& (*const f)(gsl::vector const&);
431 gsl::vector xv;
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);
446 return result;
447 }
448 };
452 class FVrCr : public base_F {
453 public:
459 FVrCr( double volatile& (*const f)(gsl::vector const volatile&), size_t const dim ) : f( f ), xv( dim ){}
463 function_t function(){ return &fn; }
464 private:
468 double volatile& (*const f)(gsl::vector const volatile&);
472 gsl::vector xv;
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);
487 return result;
488 }
489 };
493 class FCrcr : public base_F {
494 public:
500 FCrcr( double const volatile& (*const f)(gsl::vector const&), size_t const dim ) : f( f ), xv( dim ){}
504 function_t function(){ return &fn; }
505 private:
509 double const volatile& (*const f)(gsl::vector const&);
513 gsl::vector xv;
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);
528 return result;
529 }
530 };
534 class FCrCr : public base_F {
535 public:
541 FCrCr( double const volatile& (*const f)(gsl::vector const volatile&), size_t const dim ) : f( f ), xv( dim ){}
545 function_t function(){ return &fn; }
546 private:
550 double const volatile& (*const f)(gsl::vector const volatile&);
554 gsl::vector xv;
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);
569 return result;
570 }
571 };
576 template<typename T>
577 class Fuvcru : public base_F {
578 public:
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; }
599 private:
603 gsl::vector xv;
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);
619 return result;
620 }
624 T& c;
628 double (T::*f)(gsl::vector const&);
629 };
634 template<typename T>
635 class FuvCru : public base_F {
636 public:
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; }
657 private:
661 gsl::vector xv;
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);
677 return result;
678 }
682 T& c;
686 double (T::*f)(gsl::vector const volatile&);
687 };
692 template<typename T>
693 class Fcvcru : public base_F {
694 public:
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; }
715 private:
719 gsl::vector xv;
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);
735 return result;
736 }
740 T& c;
744 double const (T::*f)(gsl::vector const&);
745 };
750 template<typename T>
751 class FcvCru : public base_F {
752 public:
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; }
773 private:
777 gsl::vector xv;
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);
793 return result;
794 }
798 T& c;
802 double const (T::*f)(gsl::vector const volatile&);
803 };
808 template<typename T>
809 class Furcru : public base_F {
810 public:
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; }
831 private:
835 gsl::vector xv;
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);
851 return result;
852 }
856 T& c;
860 double& (T::*f)(gsl::vector const&);
861 };
866 template<typename T>
867 class FurCru : public base_F {
868 public:
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; }
889 private:
893 gsl::vector xv;
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);
909 return result;
910 }
914 T& c;
918 double& (T::*f)(gsl::vector const volatile&);
919 };
924 template<typename T>
925 class Fcrcru : public base_F {
926 public:
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; }
947 private:
951 gsl::vector xv;
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);
967 return result;
968 }
972 T& c;
976 double const& (T::*f)(gsl::vector const&);
977 };
982 template<typename T>
983 class FcrCru : public base_F {
984 public:
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; }
1005 private:
1009 gsl::vector xv;
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);
1025 return result;
1026 }
1030 T& c;
1034 double const& (T::*f)(gsl::vector const volatile&);
1035 };
1040 template<typename T>
1041 class FVrcru : public base_F {
1042 public:
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; }
1063 private:
1067 gsl::vector xv;
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);
1083 return result;
1084 }
1088 T& c;
1092 double volatile& (T::*f)(gsl::vector const&);
1093 };
1098 template<typename T>
1099 class FVrCru : public base_F {
1100 public:
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; }
1121 private:
1125 gsl::vector xv;
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);
1141 return result;
1142 }
1146 T& c;
1150 double volatile& (T::*f)(gsl::vector const volatile&);
1151 };
1156 template<typename T>
1157 class FCrcru : public base_F {
1158 public:
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; }
1179 private:
1183 gsl::vector xv;
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);
1199 return result;
1200 }
1204 T& c;
1208 double const volatile& (T::*f)(gsl::vector const&);
1209 };
1214 template<typename T>
1215 class FCrCru : public base_F {
1216 public:
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; }
1237 private:
1241 gsl::vector xv;
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);
1257 return result;
1258 }
1262 T& c;
1266 double const volatile& (T::*f)(gsl::vector const volatile&);
1267 };
1272 template<typename T>
1273 class Fuvcrc : public base_F {
1274 public:
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; }
1295 private:
1299 gsl::vector xv;
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);
1315 return result;
1316 }
1320 T& c;
1324 double (T::*f)(gsl::vector const&) const;
1325 };
1330 template<typename T>
1331 class FuvCrc : public base_F {
1332 public:
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; }
1353 private:
1357 gsl::vector xv;
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);
1373 return result;
1374 }
1378 T& c;
1382 double (T::*f)(gsl::vector const volatile&) const;
1383 };
1388 template<typename T>
1389 class Fcvcrc : public base_F {
1390 public:
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; }
1411 private:
1415 gsl::vector xv;
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);
1431 return result;
1432 }
1436 T& c;
1440 double const (T::*f)(gsl::vector const&) const;
1441 };
1446 template<typename T>
1447 class FcvCrc : public base_F {
1448 public:
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; }
1469 private:
1473 gsl::vector xv;
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);
1489 return result;
1490 }
1494 T& c;
1498 double const (T::*f)(gsl::vector const volatile&) const;
1499 };
1504 template<typename T>
1505 class Furcrc : public base_F {
1506 public:
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; }
1527 private:
1531 gsl::vector xv;
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);
1547 return result;
1548 }
1552 T& c;
1556 double& (T::*f)(gsl::vector const&) const;
1557 };
1562 template<typename T>
1563 class FurCrc : public base_F {
1564 public:
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; }
1585 private:
1589 gsl::vector xv;
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);
1605 return result;
1606 }
1610 T& c;
1614 double& (T::*f)(gsl::vector const volatile&) const;
1615 };
1620 template<typename T>
1621 class Fcrcrc : public base_F {
1622 public:
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; }
1643 private:
1647 gsl::vector xv;
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);
1663 return result;
1664 }
1668 T& c;
1672 double const& (T::*f)(gsl::vector const&) const;
1673 };
1678 template<typename T>
1679 class FcrCrc : public base_F {
1680 public:
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; }
1701 private:
1705 gsl::vector xv;
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);
1721 return result;
1722 }
1726 T& c;
1730 double const& (T::*f)(gsl::vector const volatile&) const;
1731 };
1736 template<typename T>
1737 class FVrcrc : public base_F {
1738 public:
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; }
1759 private:
1763 gsl::vector xv;
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);
1779 return result;
1780 }
1784 T& c;
1788 double volatile& (T::*f)(gsl::vector const&) const;
1789 };
1794 template<typename T>
1795 class FVrCrc : public base_F {
1796 public:
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; }
1817 private:
1821 gsl::vector xv;
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);
1837 return result;
1838 }
1842 T& c;
1846 double volatile& (T::*f)(gsl::vector const volatile&) const;
1847 };
1852 template<typename T>
1853 class FCrcrc : public base_F {
1854 public:
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; }
1875 private:
1879 gsl::vector xv;
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);
1895 return result;
1896 }
1900 T& c;
1904 double const volatile& (T::*f)(gsl::vector const&) const;
1905 };
1910 template<typename T>
1911 class FCrCrc : public base_F {
1912 public:
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; }
1933 private:
1937 gsl::vector xv;
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);
1953 return result;
1954 }
1958 T& c;
1962 double const volatile& (T::*f)(gsl::vector const volatile&) const;
1963 };
1968 template<typename T>
1969 class FuvcrV : public base_F {
1970 public:
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; }
1991 private:
1995 gsl::vector xv;
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);
2011 return result;
2012 }
2016 T& c;
2020 double (T::*f)(gsl::vector const&) volatile;
2021 };
2026 template<typename T>
2027 class FuvCrV : public base_F {
2028 public:
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; }
2049 private:
2053 gsl::vector xv;
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);
2069 return result;
2070 }
2074 T& c;
2078 double (T::*f)(gsl::vector const volatile&) volatile;
2079 };
2084 template<typename T>
2085 class FcvcrV : public base_F {
2086 public:
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; }
2107 private:
2111 gsl::vector xv;
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);
2127 return result;
2128 }
2132 T& c;
2136 double const (T::*f)(gsl::vector const&) volatile;
2137 };
2142 template<typename T>
2143 class FcvCrV : public base_F {
2144 public:
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; }
2165 private:
2169 gsl::vector xv;
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);
2185 return result;
2186 }
2190 T& c;
2194 double const (T::*f)(gsl::vector const volatile&) volatile;
2195 };
2200 template<typename T>
2201 class FurcrV : public base_F {
2202 public:
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; }
2223 private:
2227 gsl::vector xv;
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);
2243 return result;
2244 }
2248 T& c;
2252 double& (T::*f)(gsl::vector const&) volatile;
2253 };
2258 template<typename T>
2259 class FurCrV : public base_F {
2260 public:
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; }
2281 private:
2285 gsl::vector xv;
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);
2301 return result;
2302 }
2306 T& c;
2310 double& (T::*f)(gsl::vector const volatile&) volatile;
2311 };
2316 template<typename T>
2317 class FcrcrV : public base_F {
2318 public:
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; }
2339 private:
2343 gsl::vector xv;
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);
2359 return result;
2360 }
2364 T& c;
2368 double const& (T::*f)(gsl::vector const&) volatile;
2369 };
2374 template<typename T>
2375 class FcrCrV : public base_F {
2376 public:
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; }
2397 private:
2401 gsl::vector xv;
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);
2417 return result;
2418 }
2422 T& c;
2426 double const& (T::*f)(gsl::vector const volatile&) volatile;
2427 };
2432 template<typename T>
2433 class FVrcrV : public base_F {
2434 public:
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; }
2455 private:
2459 gsl::vector xv;
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);
2475 return result;
2476 }
2480 T& c;
2484 double volatile& (T::*f)(gsl::vector const&) volatile;
2485 };
2490 template<typename T>
2491 class FVrCrV : public base_F {
2492 public:
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; }
2513 private:
2517 gsl::vector xv;
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);
2533 return result;
2534 }
2538 T& c;
2542 double volatile& (T::*f)(gsl::vector const volatile&) volatile;
2543 };
2548 template<typename T>
2549 class FCrcrV : public base_F {
2550 public:
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; }
2571 private:
2575 gsl::vector xv;
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);
2591 return result;
2592 }
2596 T& c;
2600 double const volatile& (T::*f)(gsl::vector const&) volatile;
2601 };
2606 template<typename T>
2607 class FCrCrV : public base_F {
2608 public:
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; }
2629 private:
2633 gsl::vector xv;
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);
2649 return result;
2650 }
2654 T& c;
2658 double const volatile& (T::*f)(gsl::vector const volatile&) volatile;
2659 };
2664 template<typename T>
2665 class FuvcrC : public base_F {
2666 public:
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; }
2687 private:
2691 gsl::vector xv;
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);
2707 return result;
2708 }
2712 T& c;
2716 double (T::*f)(gsl::vector const&) const volatile;
2717 };
2722 template<typename T>
2723 class FuvCrC : public base_F {
2724 public:
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; }
2745 private:
2749 gsl::vector xv;
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);
2765 return result;
2766 }
2770 T& c;
2774 double (T::*f)(gsl::vector const volatile&) const volatile;
2775 };
2780 template<typename T>
2781 class FcvcrC : public base_F {
2782 public:
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; }
2803 private:
2807 gsl::vector xv;
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);
2823 return result;
2824 }
2828 T& c;
2832 double const (T::*f)(gsl::vector const&) const volatile;
2833 };
2838 template<typename T>
2839 class FcvCrC : public base_F {
2840 public:
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; }
2861 private:
2865 gsl::vector xv;
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);
2881 return result;
2882 }
2886 T& c;
2890 double const (T::*f)(gsl::vector const volatile&) const volatile;
2891 };
2896 template<typename T>
2897 class FurcrC : public base_F {
2898 public:
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; }
2919 private:
2923 gsl::vector xv;
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);
2939 return result;
2940 }
2944 T& c;
2948 double& (T::*f)(gsl::vector const&) const volatile;
2949 };
2954 template<typename T>
2955 class FurCrC : public base_F {
2956 public:
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; }
2977 private:
2981 gsl::vector xv;
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);
2997 return result;
2998 }
3002 T& c;
3006 double& (T::*f)(gsl::vector const volatile&) const volatile;
3007 };
3012 template<typename T>
3013 class FcrcrC : public base_F {
3014 public:
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; }
3035 private:
3039 gsl::vector xv;
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);
3055 return result;
3056 }
3060 T& c;
3064 double const& (T::*f)(gsl::vector const&) const volatile;
3065 };
3070 template<typename T>
3071 class FcrCrC : public base_F {
3072 public:
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; }
3093 private:
3097 gsl::vector xv;
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);
3113 return result;
3114 }
3118 T& c;
3122 double const& (T::*f)(gsl::vector const volatile&) const volatile;
3123 };
3128 template<typename T>
3129 class FVrcrC : public base_F {
3130 public:
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; }
3151 private:
3155 gsl::vector xv;
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);
3171 return result;
3172 }
3176 T& c;
3180 double volatile& (T::*f)(gsl::vector const&) const volatile;
3181 };
3186 template<typename T>
3187 class FVrCrC : public base_F {
3188 public:
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; }
3209 private:
3213 gsl::vector xv;
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);
3229 return result;
3230 }
3234 T& c;
3238 double volatile& (T::*f)(gsl::vector const volatile&) const volatile;
3239 };
3244 template<typename T>
3245 class FCrcrC : public base_F {
3246 public:
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; }
3267 private:
3271 gsl::vector xv;
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);
3287 return result;
3288 }
3292 T& c;
3296 double const volatile& (T::*f)(gsl::vector const&) const volatile;
3297 };
3302 template<typename T>
3303 class FCrCrC : public base_F {
3304 public:
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; }
3325 private:
3329 gsl::vector xv;
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);
3345 return result;
3346 }
3350 T& c;
3354 double const volatile& (T::*f)(gsl::vector const volatile&) const volatile;
3355 };
3356#endif
3357 base_F* base_f;
3361 size_t* count;
3362 public:
3367 base_f = 0;
3368 f = 0;
3369 dim = 0;
3370 params = 0;
3371 count = 0; // initially nullptr will do
3372 }
3378 explicit function( double (*const f)(gsl::vector const&), size_t const dim ){
3379 base_f = new Fuvcr( f, dim );
3380 params = base_f;
3381 this->f = base_f->function();
3382 this->dim = dim;
3383 // just plausibly we could fail to allocate count: no further action needed.
3384 count = new size_t;
3385 *count = 1; // initially there is just one reference to f
3386 }
3387#ifndef DOXYGEN_SKIP
3393 explicit function( double (*const f)(gsl::vector const volatile&), size_t const dim ){
3394 base_f = new FuvCr( f, dim );
3395 params = base_f;
3396 this->f = base_f->function();
3397 this->dim = dim;
3398 // just plausibly we could fail to allocate count: no further action needed.
3399 count = new size_t;
3400 *count = 1; // initially there is just one reference to f
3401 }
3407 explicit function( double const (*const f)(gsl::vector const&), size_t const dim ){
3408 base_f = new Fcvcr( f, dim );
3409 params = base_f;
3410 this->f = base_f->function();
3411 this->dim = dim;
3412 // just plausibly we could fail to allocate count: no further action needed.
3413 count = new size_t;
3414 *count = 1; // initially there is just one reference to f
3415 }
3421 explicit function( double const (*const f)(gsl::vector const volatile&), size_t const dim ){
3422 base_f = new FcvCr( f, dim );
3423 params = base_f;
3424 this->f = base_f->function();
3425 this->dim = dim;
3426 // just plausibly we could fail to allocate count: no further action needed.
3427 count = new size_t;
3428 *count = 1; // initially there is just one reference to f
3429 }
3430#endif
3431#ifndef DOXYGEN_SKIP
3437 explicit function( double& (*const f)(gsl::vector const&), size_t const dim ){
3438 base_f = new Furcr( f, dim );
3439 params = base_f;
3440 this->f = base_f->function();
3441 this->dim = dim;
3442 // just plausibly we could fail to allocate count: no further action needed.
3443 count = new size_t;
3444 *count = 1; // initially there is just one reference to f
3445 }
3451 explicit function( double& (*const f)(gsl::vector const volatile&), size_t const dim ){
3452 base_f = new FurCr( f, dim );
3453 params = base_f;
3454 this->f = base_f->function();
3455 this->dim = dim;
3456 // just plausibly we could fail to allocate count: no further action needed.
3457 count = new size_t;
3458 *count = 1; // initially there is just one reference to f
3459 }
3460#endif
3461#ifndef DOXYGEN_SKIP
3467 explicit function( double const& (*const f)(gsl::vector const&), size_t const dim ){
3468 base_f = new Fcrcr( f, dim );
3469 params = base_f;
3470 this->f = base_f->function();
3471 this->dim = dim;
3472 // just plausibly we could fail to allocate count: no further action needed.
3473 count = new size_t;
3474 *count = 1; // initially there is just one reference to f
3475 }
3481 explicit function( double const& (*const f)(gsl::vector const volatile&), size_t const dim ){
3482 base_f = new FcrCr( f, dim );
3483 params = base_f;
3484 this->f = base_f->function();
3485 this->dim = dim;
3486 // just plausibly we could fail to allocate count: no further action needed.
3487 count = new size_t;
3488 *count = 1; // initially there is just one reference to f
3489 }
3490#endif
3491#ifndef DOXYGEN_SKIP
3497 explicit function( double volatile& (*const f)(gsl::vector const&), size_t const dim ){
3498 base_f = new FVrcr( f, dim );
3499 params = base_f;
3500 this->f = base_f->function();
3501 this->dim = dim;
3502 // just plausibly we could fail to allocate count: no further action needed.
3503 count = new size_t;
3504 *count = 1; // initially there is just one reference to f
3505 }
3511 explicit function( double volatile& (*const f)(gsl::vector const volatile&), size_t const dim ){
3512 base_f = new FVrCr( f, dim );
3513 params = base_f;
3514 this->f = base_f->function();
3515 this->dim = dim;
3516 // just plausibly we could fail to allocate count: no further action needed.
3517 count = new size_t;
3518 *count = 1; // initially there is just one reference to f
3519 }
3520#endif
3521#ifndef DOXYGEN_SKIP
3527 explicit function( double const volatile& (*const f)(gsl::vector const&), size_t const dim ){
3528 base_f = new FCrcr( f, dim );
3529 params = base_f;
3530 this->f = base_f->function();
3531 this->dim = dim;
3532 // just plausibly we could fail to allocate count: no further action needed.
3533 count = new size_t;
3534 *count = 1; // initially there is just one reference to f
3535 }
3541 explicit function( double const volatile& (*const f)(gsl::vector const volatile&), size_t const dim ){
3542 base_f = new FCrCr( f, dim );
3543 params = base_f;
3544 this->f = base_f->function();
3545 this->dim = dim;
3546 // just plausibly we could fail to allocate count: no further action needed.
3547 count = new size_t;
3548 *count = 1; // initially there is just one reference to f
3549 }
3550#endif
3557 template<typename T> function( T& c, double (T::*f)(gsl::vector const&), size_t const dim ){
3558 base_f = new Fuvcru<T>( c, f, dim );
3559 params = base_f;
3560 this->f = base_f->function();
3561 this->dim = dim;
3562 // just plausibly we could fail to allocate count: no further action needed.
3563 count = new size_t;
3564 *count = 1; // initially there is just one reference to f
3565 }
3566#ifndef DOXYGEN_SKIP
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 );
3575 params = base_f;
3576 this->f = base_f->function();
3577 this->dim = dim;
3578 // just plausibly we could fail to allocate count: no further action needed.
3579 count = new size_t;
3580 *count = 1; // initially there is just one reference to f
3581 }
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 );
3590 params = base_f;
3591 this->f = base_f->function();
3592 this->dim = dim;
3593 // just plausibly we could fail to allocate count: no further action needed.
3594 count = new size_t;
3595 *count = 1; // initially there is just one reference to f
3596 }
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 );
3605 params = base_f;
3606 this->f = base_f->function();
3607 this->dim = dim;
3608 // just plausibly we could fail to allocate count: no further action needed.
3609 count = new size_t;
3610 *count = 1; // initially there is just one reference to f
3611 }
3612#endif
3613#ifndef DOXYGEN_SKIP
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 );
3622 params = base_f;
3623 this->f = base_f->function();
3624 this->dim = dim;
3625 // just plausibly we could fail to allocate count: no further action needed.
3626 count = new size_t;
3627 *count = 1; // initially there is just one reference to f
3628 }
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 );
3637 params = base_f;
3638 this->f = base_f->function();
3639 this->dim = dim;
3640 // just plausibly we could fail to allocate count: no further action needed.
3641 count = new size_t;
3642 *count = 1; // initially there is just one reference to f
3643 }
3644#endif
3645#ifndef DOXYGEN_SKIP
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 );
3654 params = base_f;
3655 this->f = base_f->function();
3656 this->dim = dim;
3657 // just plausibly we could fail to allocate count: no further action needed.
3658 count = new size_t;
3659 *count = 1; // initially there is just one reference to f
3660 }
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 );
3669 params = base_f;
3670 this->f = base_f->function();
3671 this->dim = dim;
3672 // just plausibly we could fail to allocate count: no further action needed.
3673 count = new size_t;
3674 *count = 1; // initially there is just one reference to f
3675 }
3676#endif
3677#ifndef DOXYGEN_SKIP
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 );
3686 params = base_f;
3687 this->f = base_f->function();
3688 this->dim = dim;
3689 // just plausibly we could fail to allocate count: no further action needed.
3690 count = new size_t;
3691 *count = 1; // initially there is just one reference to f
3692 }
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 );
3701 params = base_f;
3702 this->f = base_f->function();
3703 this->dim = dim;
3704 // just plausibly we could fail to allocate count: no further action needed.
3705 count = new size_t;
3706 *count = 1; // initially there is just one reference to f
3707 }
3708#endif
3709#ifndef DOXYGEN_SKIP
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 );
3718 params = base_f;
3719 this->f = base_f->function();
3720 this->dim = dim;
3721 // just plausibly we could fail to allocate count: no further action needed.
3722 count = new size_t;
3723 *count = 1; // initially there is just one reference to f
3724 }
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 );
3733 params = base_f;
3734 this->f = base_f->function();
3735 this->dim = dim;
3736 // just plausibly we could fail to allocate count: no further action needed.
3737 count = new size_t;
3738 *count = 1; // initially there is just one reference to f
3739 }
3740#endif
3741#ifndef DOXYGEN_SKIP
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 );
3750 params = base_f;
3751 this->f = base_f->function();
3752 this->dim = dim;
3753 // just plausibly we could fail to allocate count: no further action needed.
3754 count = new size_t;
3755 *count = 1; // initially there is just one reference to f
3756 }
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 );
3765 params = base_f;
3766 this->f = base_f->function();
3767 this->dim = dim;
3768 // just plausibly we could fail to allocate count: no further action needed.
3769 count = new size_t;
3770 *count = 1; // initially there is just one reference to f
3771 }
3772#endif
3773#ifndef DOXYGEN_SKIP
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 );
3782 params = base_f;
3783 this->f = base_f->function();
3784 this->dim = dim;
3785 // just plausibly we could fail to allocate count: no further action needed.
3786 count = new size_t;
3787 *count = 1; // initially there is just one reference to f
3788 }
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 );
3797 params = base_f;
3798 this->f = base_f->function();
3799 this->dim = dim;
3800 // just plausibly we could fail to allocate count: no further action needed.
3801 count = new size_t;
3802 *count = 1; // initially there is just one reference to f
3803 }
3804#endif
3805#ifndef DOXYGEN_SKIP
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 );
3814 params = base_f;
3815 this->f = base_f->function();
3816 this->dim = dim;
3817 // just plausibly we could fail to allocate count: no further action needed.
3818 count = new size_t;
3819 *count = 1; // initially there is just one reference to f
3820 }
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 );
3829 params = base_f;
3830 this->f = base_f->function();
3831 this->dim = dim;
3832 // just plausibly we could fail to allocate count: no further action needed.
3833 count = new size_t;
3834 *count = 1; // initially there is just one reference to f
3835 }
3836#endif
3837#ifndef DOXYGEN_SKIP
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 );
3846 params = base_f;
3847 this->f = base_f->function();
3848 this->dim = dim;
3849 // just plausibly we could fail to allocate count: no further action needed.
3850 count = new size_t;
3851 *count = 1; // initially there is just one reference to f
3852 }
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 );
3861 params = base_f;
3862 this->f = base_f->function();
3863 this->dim = dim;
3864 // just plausibly we could fail to allocate count: no further action needed.
3865 count = new size_t;
3866 *count = 1; // initially there is just one reference to f
3867 }
3868#endif
3869#ifndef DOXYGEN_SKIP
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 );
3878 params = base_f;
3879 this->f = base_f->function();
3880 this->dim = dim;
3881 // just plausibly we could fail to allocate count: no further action needed.
3882 count = new size_t;
3883 *count = 1; // initially there is just one reference to f
3884 }
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 );
3893 params = base_f;
3894 this->f = base_f->function();
3895 this->dim = dim;
3896 // just plausibly we could fail to allocate count: no further action needed.
3897 count = new size_t;
3898 *count = 1; // initially there is just one reference to f
3899 }
3900#endif
3901#ifndef DOXYGEN_SKIP
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 );
3910 params = base_f;
3911 this->f = base_f->function();
3912 this->dim = dim;
3913 // just plausibly we could fail to allocate count: no further action needed.
3914 count = new size_t;
3915 *count = 1; // initially there is just one reference to f
3916 }
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 );
3925 params = base_f;
3926 this->f = base_f->function();
3927 this->dim = dim;
3928 // just plausibly we could fail to allocate count: no further action needed.
3929 count = new size_t;
3930 *count = 1; // initially there is just one reference to f
3931 }
3932#endif
3933#ifndef DOXYGEN_SKIP
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 );
3942 params = base_f;
3943 this->f = base_f->function();
3944 this->dim = dim;
3945 // just plausibly we could fail to allocate count: no further action needed.
3946 count = new size_t;
3947 *count = 1; // initially there is just one reference to f
3948 }
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 );
3957 params = base_f;
3958 this->f = base_f->function();
3959 this->dim = dim;
3960 // just plausibly we could fail to allocate count: no further action needed.
3961 count = new size_t;
3962 *count = 1; // initially there is just one reference to f
3963 }
3964#endif
3965#ifndef DOXYGEN_SKIP
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 );
3974 params = base_f;
3975 this->f = base_f->function();
3976 this->dim = dim;
3977 // just plausibly we could fail to allocate count: no further action needed.
3978 count = new size_t;
3979 *count = 1; // initially there is just one reference to f
3980 }
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 );
3989 params = base_f;
3990 this->f = base_f->function();
3991 this->dim = dim;
3992 // just plausibly we could fail to allocate count: no further action needed.
3993 count = new size_t;
3994 *count = 1; // initially there is just one reference to f
3995 }
3996#endif
3997#ifndef DOXYGEN_SKIP
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 );
4006 params = base_f;
4007 this->f = base_f->function();
4008 this->dim = dim;
4009 // just plausibly we could fail to allocate count: no further action needed.
4010 count = new size_t;
4011 *count = 1; // initially there is just one reference to f
4012 }
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 );
4021 params = base_f;
4022 this->f = base_f->function();
4023 this->dim = dim;
4024 // just plausibly we could fail to allocate count: no further action needed.
4025 count = new size_t;
4026 *count = 1; // initially there is just one reference to f
4027 }
4028#endif
4029#ifndef DOXYGEN_SKIP
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 );
4038 params = base_f;
4039 this->f = base_f->function();
4040 this->dim = dim;
4041 // just plausibly we could fail to allocate count: no further action needed.
4042 count = new size_t;
4043 *count = 1; // initially there is just one reference to f
4044 }
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 );
4053 params = base_f;
4054 this->f = base_f->function();
4055 this->dim = dim;
4056 // just plausibly we could fail to allocate count: no further action needed.
4057 count = new size_t;
4058 *count = 1; // initially there is just one reference to f
4059 }
4060#endif
4061#ifndef DOXYGEN_SKIP
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 );
4070 params = base_f;
4071 this->f = base_f->function();
4072 this->dim = dim;
4073 // just plausibly we could fail to allocate count: no further action needed.
4074 count = new size_t;
4075 *count = 1; // initially there is just one reference to f
4076 }
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 );
4085 params = base_f;
4086 this->f = base_f->function();
4087 this->dim = dim;
4088 // just plausibly we could fail to allocate count: no further action needed.
4089 count = new size_t;
4090 *count = 1; // initially there is just one reference to f
4091 }
4092#endif
4093#ifndef DOXYGEN_SKIP
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 );
4102 params = base_f;
4103 this->f = base_f->function();
4104 this->dim = dim;
4105 // just plausibly we could fail to allocate count: no further action needed.
4106 count = new size_t;
4107 *count = 1; // initially there is just one reference to f
4108 }
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 );
4117 params = base_f;
4118 this->f = base_f->function();
4119 this->dim = dim;
4120 // just plausibly we could fail to allocate count: no further action needed.
4121 count = new size_t;
4122 *count = 1; // initially there is just one reference to f
4123 }
4124#endif
4125#ifndef DOXYGEN_SKIP
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 );
4134 params = base_f;
4135 this->f = base_f->function();
4136 this->dim = dim;
4137 // just plausibly we could fail to allocate count: no further action needed.
4138 count = new size_t;
4139 *count = 1; // initially there is just one reference to f
4140 }
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 );
4149 params = base_f;
4150 this->f = base_f->function();
4151 this->dim = dim;
4152 // just plausibly we could fail to allocate count: no further action needed.
4153 count = new size_t;
4154 *count = 1; // initially there is just one reference to f
4155 }
4156#endif
4157#ifndef DOXYGEN_SKIP
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 );
4166 params = base_f;
4167 this->f = base_f->function();
4168 this->dim = dim;
4169 // just plausibly we could fail to allocate count: no further action needed.
4170 count = new size_t;
4171 *count = 1; // initially there is just one reference to f
4172 }
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 );
4181 params = base_f;
4182 this->f = base_f->function();
4183 this->dim = dim;
4184 // just plausibly we could fail to allocate count: no further action needed.
4185 count = new size_t;
4186 *count = 1; // initially there is just one reference to f
4187 }
4188#endif
4189#ifndef DOXYGEN_SKIP
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 );
4198 params = base_f;
4199 this->f = base_f->function();
4200 this->dim = dim;
4201 // just plausibly we could fail to allocate count: no further action needed.
4202 count = new size_t;
4203 *count = 1; // initially there is just one reference to f
4204 }
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 );
4213 params = base_f;
4214 this->f = base_f->function();
4215 this->dim = dim;
4216 // just plausibly we could fail to allocate count: no further action needed.
4217 count = new size_t;
4218 *count = 1; // initially there is just one reference to f
4219 }
4220#endif
4221#ifndef DOXYGEN_SKIP
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 );
4230 params = base_f;
4231 this->f = base_f->function();
4232 this->dim = dim;
4233 // just plausibly we could fail to allocate count: no further action needed.
4234 count = new size_t;
4235 *count = 1; // initially there is just one reference to f
4236 }
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 );
4245 params = base_f;
4246 this->f = base_f->function();
4247 this->dim = dim;
4248 // just plausibly we could fail to allocate count: no further action needed.
4249 count = new size_t;
4250 *count = 1; // initially there is just one reference to f
4251 }
4252#endif
4253#ifndef DOXYGEN_SKIP
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 );
4262 params = base_f;
4263 this->f = base_f->function();
4264 this->dim = dim;
4265 // just plausibly we could fail to allocate count: no further action needed.
4266 count = new size_t;
4267 *count = 1; // initially there is just one reference to f
4268 }
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 );
4277 params = base_f;
4278 this->f = base_f->function();
4279 this->dim = dim;
4280 // just plausibly we could fail to allocate count: no further action needed.
4281 count = new size_t;
4282 *count = 1; // initially there is just one reference to f
4283 }
4284#endif
4285#ifndef DOXYGEN_SKIP
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 );
4294 params = base_f;
4295 this->f = base_f->function();
4296 this->dim = dim;
4297 // just plausibly we could fail to allocate count: no further action needed.
4298 count = new size_t;
4299 *count = 1; // initially there is just one reference to f
4300 }
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 );
4309 params = base_f;
4310 this->f = base_f->function();
4311 this->dim = dim;
4312 // just plausibly we could fail to allocate count: no further action needed.
4313 count = new size_t;
4314 *count = 1; // initially there is just one reference to f
4315 }
4316#endif
4317 // Copy and move constructors
4318 // copy constructor
4323 function( function const& v ) : base_f( v.base_f ), count( v.count ){
4324 f = v.f;
4325 dim = v.dim;
4326 params = v.params;
4327 if( count != 0 ) ++*count; // function is now shared.
4328 }
4329 // assignment operator
4335 // first, possibly delete anything pointed to by this
4336 if( count == 0 or --*count == 0 ){
4337 delete base_f;
4338 delete count;
4339 }
4340 // Then copy
4341 base_f = v.base_f;
4342 f = v.f;
4343 dim = v.dim;
4344 params = v.params;
4345 count = v.count;
4346 if( count != 0 ) ++*count; // function is now shared.
4347 return *this;
4348 }
4349#ifdef __GXX_EXPERIMENTAL_CXX0X__
4354 function( function&& v ) : base_f( v.base_f ), count( nullptr ){
4355 std::swap( f, v.f );
4356 std::swap( dim, v.dim );
4357 std::swap( params, v.params );
4358 std::swap( count, v.count );
4359 v.base_f = nullptr;
4360 }
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 );
4372 return *this;
4373 }
4374#endif
4379 // first, possibly delete anything pointed to by base_f
4380 if( count == 0 or --*count == 0 ){
4381 delete base_f;
4382 delete count;
4383 }
4384 }
4385 private:
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 );
4398 }
4399 };
4406 template<typename T>
4407 inline function make_function( T& c, double (T::*f)(gsl::vector const&) , size_t const dim ){
4408 function fn( c, f, dim );
4409 return fn;
4410 }
4411#ifndef DOXYGEN_SKIP
4418 template<typename T>
4419 inline function make_function( T& c, double (T::*f)(gsl::vector const volatile&) , size_t const dim ){
4420 function fn( c, f, dim );
4421 return fn;
4422 }
4429 template<typename T>
4430 inline function make_function( T& c, double const (T::*f)(gsl::vector const&) , size_t const dim ){
4431 function fn( c, f, dim );
4432 return fn;
4433 }
4440 template<typename T>
4441 inline function make_function( T& c, double const (T::*f)(gsl::vector const volatile&) , size_t const dim ){
4442 function fn( c, f, dim );
4443 return fn;
4444 }
4445#endif
4446#ifndef DOXYGEN_SKIP
4453 template<typename T>
4454 inline function make_function( T& c, double& (T::*f)(gsl::vector const&) , size_t const dim ){
4455 function fn( c, f, dim );
4456 return fn;
4457 }
4464 template<typename T>
4465 inline function make_function( T& c, double& (T::*f)(gsl::vector const volatile&) , size_t const dim ){
4466 function fn( c, f, dim );
4467 return fn;
4468 }
4469#endif
4470#ifndef DOXYGEN_SKIP
4477 template<typename T>
4478 inline function make_function( T& c, double const& (T::*f)(gsl::vector const&) , size_t const dim ){
4479 function fn( c, f, dim );
4480 return fn;
4481 }
4488 template<typename T>
4489 inline function make_function( T& c, double const& (T::*f)(gsl::vector const volatile&) , size_t const dim ){
4490 function fn( c, f, dim );
4491 return fn;
4492 }
4493#endif
4494#ifndef DOXYGEN_SKIP
4501 template<typename T>
4502 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const&) , size_t const dim ){
4503 function fn( c, f, dim );
4504 return fn;
4505 }
4512 template<typename T>
4513 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const volatile&) , size_t const dim ){
4514 function fn( c, f, dim );
4515 return fn;
4516 }
4517#endif
4518#ifndef DOXYGEN_SKIP
4525 template<typename T>
4526 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const&) , size_t const dim ){
4527 function fn( c, f, dim );
4528 return fn;
4529 }
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 );
4539 return fn;
4540 }
4541#endif
4542#ifndef DOXYGEN_SKIP
4549 template<typename T>
4550 inline function make_function( T& c, double (T::*f)(gsl::vector const&) const, size_t const dim ){
4551 function fn( c, f, dim );
4552 return fn;
4553 }
4560 template<typename T>
4561 inline function make_function( T& c, double (T::*f)(gsl::vector const volatile&) const, size_t const dim ){
4562 function fn( c, f, dim );
4563 return fn;
4564 }
4565#endif
4566#ifndef DOXYGEN_SKIP
4573 template<typename T>
4574 inline function make_function( T& c, double const (T::*f)(gsl::vector const&) const, size_t const dim ){
4575 function fn( c, f, dim );
4576 return fn;
4577 }
4584 template<typename T>
4585 inline function make_function( T& c, double const (T::*f)(gsl::vector const volatile&) const, size_t const dim ){
4586 function fn( c, f, dim );
4587 return fn;
4588 }
4589#endif
4590#ifndef DOXYGEN_SKIP
4597 template<typename T>
4598 inline function make_function( T& c, double& (T::*f)(gsl::vector const&) const, size_t const dim ){
4599 function fn( c, f, dim );
4600 return fn;
4601 }
4608 template<typename T>
4609 inline function make_function( T& c, double& (T::*f)(gsl::vector const volatile&) const, size_t const dim ){
4610 function fn( c, f, dim );
4611 return fn;
4612 }
4613#endif
4614#ifndef DOXYGEN_SKIP
4621 template<typename T>
4622 inline function make_function( T& c, double const& (T::*f)(gsl::vector const&) const, size_t const dim ){
4623 function fn( c, f, dim );
4624 return fn;
4625 }
4632 template<typename T>
4633 inline function make_function( T& c, double const& (T::*f)(gsl::vector const volatile&) const, size_t const dim ){
4634 function fn( c, f, dim );
4635 return fn;
4636 }
4637#endif
4638#ifndef DOXYGEN_SKIP
4645 template<typename T>
4646 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const&) const, size_t const dim ){
4647 function fn( c, f, dim );
4648 return fn;
4649 }
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 );
4659 return fn;
4660 }
4661#endif
4662#ifndef DOXYGEN_SKIP
4669 template<typename T>
4670 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const&) const, size_t const dim ){
4671 function fn( c, f, dim );
4672 return fn;
4673 }
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 );
4683 return fn;
4684 }
4685#endif
4686#ifndef DOXYGEN_SKIP
4693 template<typename T>
4694 inline function make_function( T& c, double (T::*f)(gsl::vector const&) volatile, size_t const dim ){
4695 function fn( c, f, dim );
4696 return fn;
4697 }
4704 template<typename T>
4705 inline function make_function( T& c, double (T::*f)(gsl::vector const volatile&) volatile, size_t const dim ){
4706 function fn( c, f, dim );
4707 return fn;
4708 }
4709#endif
4710#ifndef DOXYGEN_SKIP
4717 template<typename T>
4718 inline function make_function( T& c, double const (T::*f)(gsl::vector const&) volatile, size_t const dim ){
4719 function fn( c, f, dim );
4720 return fn;
4721 }
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 );
4731 return fn;
4732 }
4733#endif
4734#ifndef DOXYGEN_SKIP
4741 template<typename T>
4742 inline function make_function( T& c, double& (T::*f)(gsl::vector const&) volatile, size_t const dim ){
4743 function fn( c, f, dim );
4744 return fn;
4745 }
4752 template<typename T>
4753 inline function make_function( T& c, double& (T::*f)(gsl::vector const volatile&) volatile, size_t const dim ){
4754 function fn( c, f, dim );
4755 return fn;
4756 }
4757#endif
4758#ifndef DOXYGEN_SKIP
4765 template<typename T>
4766 inline function make_function( T& c, double const& (T::*f)(gsl::vector const&) volatile, size_t const dim ){
4767 function fn( c, f, dim );
4768 return fn;
4769 }
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 );
4779 return fn;
4780 }
4781#endif
4782#ifndef DOXYGEN_SKIP
4789 template<typename T>
4790 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const&) volatile, size_t const dim ){
4791 function fn( c, f, dim );
4792 return fn;
4793 }
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 );
4803 return fn;
4804 }
4805#endif
4806#ifndef DOXYGEN_SKIP
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 );
4816 return fn;
4817 }
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 );
4827 return fn;
4828 }
4829#endif
4830#ifndef DOXYGEN_SKIP
4837 template<typename T>
4838 inline function make_function( T& c, double (T::*f)(gsl::vector const&) const volatile, size_t const dim ){
4839 function fn( c, f, dim );
4840 return fn;
4841 }
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 );
4851 return fn;
4852 }
4853#endif
4854#ifndef DOXYGEN_SKIP
4861 template<typename T>
4862 inline function make_function( T& c, double const (T::*f)(gsl::vector const&) const volatile, size_t const dim ){
4863 function fn( c, f, dim );
4864 return fn;
4865 }
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 );
4875 return fn;
4876 }
4877#endif
4878#ifndef DOXYGEN_SKIP
4885 template<typename T>
4886 inline function make_function( T& c, double& (T::*f)(gsl::vector const&) const volatile, size_t const dim ){
4887 function fn( c, f, dim );
4888 return fn;
4889 }
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 );
4899 return fn;
4900 }
4901#endif
4902#ifndef DOXYGEN_SKIP
4909 template<typename T>
4910 inline function make_function( T& c, double const& (T::*f)(gsl::vector const&) const volatile, size_t const dim ){
4911 function fn( c, f, dim );
4912 return fn;
4913 }
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 );
4923 return fn;
4924 }
4925#endif
4926#ifndef DOXYGEN_SKIP
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 );
4936 return fn;
4937 }
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 );
4947 return fn;
4948 }
4949#endif
4950#ifndef DOXYGEN_SKIP
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 );
4960 return fn;
4961 }
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 );
4971 return fn;
4972 }
4973#endif
4974
4975 }
4976}
4977
4978#endif
Class that extends gsl_monte_function so that it can be constructed from arbitrary function objects.
Definition: monte.hpp:59
function(function const &v)
The copy constructor.
Definition: monte.hpp:4323
function(T &c, double(T::*f)(gsl::vector const &), size_t const dim)
Construct from a function object and a suitable member function.
Definition: monte.hpp:3557
function(function &&v)
Move constructor.
Definition: monte.hpp:4354
~function()
The destructor unshares any shared resource.
Definition: monte.hpp:4378
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...
Definition: monte.hpp:4395
function(double(*const f)(gsl::vector const &), size_t const dim)
Construct from a function.
Definition: monte.hpp:3378
function & operator=(function &&v)
Move operator.
Definition: monte.hpp:4366
size_t * count
The shared reference count.
Definition: monte.hpp:3361
function()
The default constructor is only really useful for assigning to.
Definition: monte.hpp:3366
function & operator=(function const &v)
The assignment operator.
Definition: monte.hpp:4334
This class handles vector objects as shared handles.
Definition: vector.hpp:74
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.
Definition: monte.hpp:4407
double b(int order, double qq)
C++ version of gsl_sf_mathieu_b().
Definition: sf_mathieu.hpp:298
gsl_sf_result result
Typedef for gsl_sf_result.
Definition: sf_result.hpp:30
The gsl package creates an interface to the GNU Scientific Library for C++.
Definition: blas.hpp:34