ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
multimin_function.hpp
Go to the documentation of this file.
1/*
2 * $Id: multimin_function.hpp 289 2012-12-04 15:32:17Z jdl3 $
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_MULTIMIN_FUNCTION_HPP
21#define CCGSL_MULTIMIN_FUNCTION_HPP
22
23#include<gsl/gsl_multimin.h>
24#include"vector.hpp"
25// For std::swap
26#if __cplusplus <= 199711L
27#include<algorithm>
28#else
29#include<utility>
30#endif
31
32namespace gsl {
33 namespace multimin {
64 class function : public gsl_multimin_function {
65#ifndef DOXYGEN_SKIP
66 private:
70 struct base_F {
74 typedef double (*function_t)(gsl_vector const*,void*);
78 virtual ~base_F(){};
83 virtual function_t function() = 0;
84 };
88 class Fuvcr : public base_F {
89 public:
94 Fuvcr( double (*const f)(gsl::vector const&) ) : f( f ){
95 xv.wrap_gsl_vector_without_ownership( 0 ); }
99 function_t function(){ return &fn; }
100 private:
104 double (*const f)(gsl::vector const&);
108 gsl::vector xv;
115 static double fn( gsl_vector const* x, void* params ){
116 Fuvcr* ft = reinterpret_cast<Fuvcr*>( params );
117 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
118 return ft->f( ft->xv ); }
119 };
123 class FuvCr : public base_F {
124 public:
129 FuvCr( double (*const f)(gsl::vector const volatile&) ) : f( f ){
130 xv.wrap_gsl_vector_without_ownership( 0 ); }
134 function_t function(){ return &fn; }
135 private:
139 double (*const f)(gsl::vector const volatile&);
143 gsl::vector xv;
150 static double fn( gsl_vector const* x, void* params ){
151 FuvCr* ft = reinterpret_cast<FuvCr*>( params );
152 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
153 return ft->f( ft->xv ); }
154 };
158 class Fcvcr : public base_F {
159 public:
164 Fcvcr( double const (*const f)(gsl::vector const&) ) : f( f ){
165 xv.wrap_gsl_vector_without_ownership( 0 ); }
169 function_t function(){ return &fn; }
170 private:
174 double const (*const f)(gsl::vector const&);
178 gsl::vector xv;
185 static double fn( gsl_vector const* x, void* params ){
186 Fcvcr* ft = reinterpret_cast<Fcvcr*>( params );
187 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
188 return ft->f( ft->xv ); }
189 };
193 class FcvCr : public base_F {
194 public:
199 FcvCr( double const (*const f)(gsl::vector const volatile&) ) : f( f ){
200 xv.wrap_gsl_vector_without_ownership( 0 ); }
204 function_t function(){ return &fn; }
205 private:
209 double const (*const f)(gsl::vector const volatile&);
213 gsl::vector xv;
220 static double fn( gsl_vector const* x, void* params ){
221 FcvCr* ft = reinterpret_cast<FcvCr*>( params );
222 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
223 return ft->f( ft->xv ); }
224 };
228 class Furcr : public base_F {
229 public:
234 Furcr( double& (*const f)(gsl::vector const&) ) : f( f ){
235 xv.wrap_gsl_vector_without_ownership( 0 ); }
239 function_t function(){ return &fn; }
240 private:
244 double& (*const f)(gsl::vector const&);
248 gsl::vector xv;
255 static double fn( gsl_vector const* x, void* params ){
256 Furcr* ft = reinterpret_cast<Furcr*>( params );
257 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
258 return ft->f( ft->xv ); }
259 };
263 class FurCr : public base_F {
264 public:
269 FurCr( double& (*const f)(gsl::vector const volatile&) ) : f( f ){
270 xv.wrap_gsl_vector_without_ownership( 0 ); }
274 function_t function(){ return &fn; }
275 private:
279 double& (*const f)(gsl::vector const volatile&);
283 gsl::vector xv;
290 static double fn( gsl_vector const* x, void* params ){
291 FurCr* ft = reinterpret_cast<FurCr*>( params );
292 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
293 return ft->f( ft->xv ); }
294 };
298 class Fcrcr : public base_F {
299 public:
304 Fcrcr( double const& (*const f)(gsl::vector const&) ) : f( f ){
305 xv.wrap_gsl_vector_without_ownership( 0 ); }
309 function_t function(){ return &fn; }
310 private:
314 double const& (*const f)(gsl::vector const&);
318 gsl::vector xv;
325 static double fn( gsl_vector const* x, void* params ){
326 Fcrcr* ft = reinterpret_cast<Fcrcr*>( params );
327 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
328 return ft->f( ft->xv ); }
329 };
333 class FcrCr : public base_F {
334 public:
339 FcrCr( double const& (*const f)(gsl::vector const volatile&) ) : f( f ){
340 xv.wrap_gsl_vector_without_ownership( 0 ); }
344 function_t function(){ return &fn; }
345 private:
349 double const& (*const f)(gsl::vector const volatile&);
353 gsl::vector xv;
360 static double fn( gsl_vector const* x, void* params ){
361 FcrCr* ft = reinterpret_cast<FcrCr*>( params );
362 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
363 return ft->f( ft->xv ); }
364 };
368 class FVrcr : public base_F {
369 public:
374 FVrcr( double volatile& (*const f)(gsl::vector const&) ) : f( f ){
375 xv.wrap_gsl_vector_without_ownership( 0 ); }
379 function_t function(){ return &fn; }
380 private:
384 double volatile& (*const f)(gsl::vector const&);
388 gsl::vector xv;
395 static double fn( gsl_vector const* x, void* params ){
396 FVrcr* ft = reinterpret_cast<FVrcr*>( params );
397 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
398 return ft->f( ft->xv ); }
399 };
403 class FVrCr : public base_F {
404 public:
409 FVrCr( double volatile& (*const f)(gsl::vector const volatile&) ) : f( f ){
410 xv.wrap_gsl_vector_without_ownership( 0 ); }
414 function_t function(){ return &fn; }
415 private:
419 double volatile& (*const f)(gsl::vector const volatile&);
423 gsl::vector xv;
430 static double fn( gsl_vector const* x, void* params ){
431 FVrCr* ft = reinterpret_cast<FVrCr*>( params );
432 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
433 return ft->f( ft->xv ); }
434 };
438 class FCrcr : public base_F {
439 public:
444 FCrcr( double const volatile& (*const f)(gsl::vector const&) ) : f( f ){
445 xv.wrap_gsl_vector_without_ownership( 0 ); }
449 function_t function(){ return &fn; }
450 private:
454 double const volatile& (*const f)(gsl::vector const&);
458 gsl::vector xv;
465 static double fn( gsl_vector const* x, void* params ){
466 FCrcr* ft = reinterpret_cast<FCrcr*>( params );
467 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
468 return ft->f( ft->xv ); }
469 };
473 class FCrCr : public base_F {
474 public:
479 FCrCr( double const volatile& (*const f)(gsl::vector const volatile&) ) : f( f ){
480 xv.wrap_gsl_vector_without_ownership( 0 ); }
484 function_t function(){ return &fn; }
485 private:
489 double const volatile& (*const f)(gsl::vector const volatile&);
493 gsl::vector xv;
500 static double fn( gsl_vector const* x, void* params ){
501 FCrCr* ft = reinterpret_cast<FCrCr*>( params );
502 ft->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
503 return ft->f( ft->xv ); }
504 };
509 template<typename T>
510 class Fuvcru : public base_F {
511 public:
519 Fuvcru( T& c, double (T::*f)(gsl::vector const&) )
520 : c( c ), f( f ){
521 xv.wrap_gsl_vector_without_ownership( 0 ); }
527 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
531 function_t function(){ return &function_s; }
532 private:
536 gsl::vector xv;
545 static double function_s( gsl_vector const* x, void* params ){
546 Fuvcru<T>* const cl = reinterpret_cast<Fuvcru<T>*>( params );
547 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
548 return (cl->c.*cl->f)( cl->xv ); }
552 T& c;
556 double (T::*f)(gsl::vector const&);
557 };
562 template<typename T>
563 class FuvCru : public base_F {
564 public:
572 FuvCru( T& c, double (T::*f)(gsl::vector const volatile&) )
573 : c( c ), f( f ){
574 xv.wrap_gsl_vector_without_ownership( 0 ); }
580 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
584 function_t function(){ return &function_s; }
585 private:
589 gsl::vector xv;
598 static double function_s( gsl_vector const* x, void* params ){
599 FuvCru<T>* const cl = reinterpret_cast<FuvCru<T>*>( params );
600 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
601 return (cl->c.*cl->f)( cl->xv ); }
605 T& c;
609 double (T::*f)(gsl::vector const volatile&);
610 };
615 template<typename T>
616 class Fcvcru : public base_F {
617 public:
625 Fcvcru( T& c, double const (T::*f)(gsl::vector const&) )
626 : c( c ), f( f ){
627 xv.wrap_gsl_vector_without_ownership( 0 ); }
633 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
637 function_t function(){ return &function_s; }
638 private:
642 gsl::vector xv;
651 static double function_s( gsl_vector const* x, void* params ){
652 Fcvcru<T>* const cl = reinterpret_cast<Fcvcru<T>*>( params );
653 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
654 return (cl->c.*cl->f)( cl->xv ); }
658 T& c;
662 double const (T::*f)(gsl::vector const&);
663 };
668 template<typename T>
669 class FcvCru : public base_F {
670 public:
678 FcvCru( T& c, double const (T::*f)(gsl::vector const volatile&) )
679 : c( c ), f( f ){
680 xv.wrap_gsl_vector_without_ownership( 0 ); }
686 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
690 function_t function(){ return &function_s; }
691 private:
695 gsl::vector xv;
704 static double function_s( gsl_vector const* x, void* params ){
705 FcvCru<T>* const cl = reinterpret_cast<FcvCru<T>*>( params );
706 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
707 return (cl->c.*cl->f)( cl->xv ); }
711 T& c;
715 double const (T::*f)(gsl::vector const volatile&);
716 };
721 template<typename T>
722 class Furcru : public base_F {
723 public:
731 Furcru( T& c, double& (T::*f)(gsl::vector const&) )
732 : c( c ), f( f ){
733 xv.wrap_gsl_vector_without_ownership( 0 ); }
739 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
743 function_t function(){ return &function_s; }
744 private:
748 gsl::vector xv;
757 static double function_s( gsl_vector const* x, void* params ){
758 Furcru<T>* const cl = reinterpret_cast<Furcru<T>*>( params );
759 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
760 return (cl->c.*cl->f)( cl->xv ); }
764 T& c;
768 double& (T::*f)(gsl::vector const&);
769 };
774 template<typename T>
775 class FurCru : public base_F {
776 public:
784 FurCru( T& c, double& (T::*f)(gsl::vector const volatile&) )
785 : c( c ), f( f ){
786 xv.wrap_gsl_vector_without_ownership( 0 ); }
792 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
796 function_t function(){ return &function_s; }
797 private:
801 gsl::vector xv;
810 static double function_s( gsl_vector const* x, void* params ){
811 FurCru<T>* const cl = reinterpret_cast<FurCru<T>*>( params );
812 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
813 return (cl->c.*cl->f)( cl->xv ); }
817 T& c;
821 double& (T::*f)(gsl::vector const volatile&);
822 };
827 template<typename T>
828 class Fcrcru : public base_F {
829 public:
837 Fcrcru( T& c, double const& (T::*f)(gsl::vector const&) )
838 : c( c ), f( f ){
839 xv.wrap_gsl_vector_without_ownership( 0 ); }
845 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
849 function_t function(){ return &function_s; }
850 private:
854 gsl::vector xv;
863 static double function_s( gsl_vector const* x, void* params ){
864 Fcrcru<T>* const cl = reinterpret_cast<Fcrcru<T>*>( params );
865 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
866 return (cl->c.*cl->f)( cl->xv ); }
870 T& c;
874 double const& (T::*f)(gsl::vector const&);
875 };
880 template<typename T>
881 class FcrCru : public base_F {
882 public:
890 FcrCru( T& c, double const& (T::*f)(gsl::vector const volatile&) )
891 : c( c ), f( f ){
892 xv.wrap_gsl_vector_without_ownership( 0 ); }
898 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
902 function_t function(){ return &function_s; }
903 private:
907 gsl::vector xv;
916 static double function_s( gsl_vector const* x, void* params ){
917 FcrCru<T>* const cl = reinterpret_cast<FcrCru<T>*>( params );
918 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
919 return (cl->c.*cl->f)( cl->xv ); }
923 T& c;
927 double const& (T::*f)(gsl::vector const volatile&);
928 };
933 template<typename T>
934 class FVrcru : public base_F {
935 public:
943 FVrcru( T& c, double volatile& (T::*f)(gsl::vector const&) )
944 : c( c ), f( f ){
945 xv.wrap_gsl_vector_without_ownership( 0 ); }
951 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
955 function_t function(){ return &function_s; }
956 private:
960 gsl::vector xv;
969 static double function_s( gsl_vector const* x, void* params ){
970 FVrcru<T>* const cl = reinterpret_cast<FVrcru<T>*>( params );
971 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
972 return (cl->c.*cl->f)( cl->xv ); }
976 T& c;
980 double volatile& (T::*f)(gsl::vector const&);
981 };
986 template<typename T>
987 class FVrCru : public base_F {
988 public:
996 FVrCru( T& c, double volatile& (T::*f)(gsl::vector const volatile&) )
997 : c( c ), f( f ){
998 xv.wrap_gsl_vector_without_ownership( 0 ); }
1004 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1008 function_t function(){ return &function_s; }
1009 private:
1013 gsl::vector xv;
1022 static double function_s( gsl_vector const* x, void* params ){
1023 FVrCru<T>* const cl = reinterpret_cast<FVrCru<T>*>( params );
1024 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1025 return (cl->c.*cl->f)( cl->xv ); }
1029 T& c;
1033 double volatile& (T::*f)(gsl::vector const volatile&);
1034 };
1039 template<typename T>
1040 class FCrcru : public base_F {
1041 public:
1049 FCrcru( T& c, double const volatile& (T::*f)(gsl::vector const&) )
1050 : c( c ), f( f ){
1051 xv.wrap_gsl_vector_without_ownership( 0 ); }
1057 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1061 function_t function(){ return &function_s; }
1062 private:
1066 gsl::vector xv;
1075 static double function_s( gsl_vector const* x, void* params ){
1076 FCrcru<T>* const cl = reinterpret_cast<FCrcru<T>*>( params );
1077 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1078 return (cl->c.*cl->f)( cl->xv ); }
1082 T& c;
1086 double const volatile& (T::*f)(gsl::vector const&);
1087 };
1092 template<typename T>
1093 class FCrCru : public base_F {
1094 public:
1102 FCrCru( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) )
1103 : c( c ), f( f ){
1104 xv.wrap_gsl_vector_without_ownership( 0 ); }
1110 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1114 function_t function(){ return &function_s; }
1115 private:
1119 gsl::vector xv;
1128 static double function_s( gsl_vector const* x, void* params ){
1129 FCrCru<T>* const cl = reinterpret_cast<FCrCru<T>*>( params );
1130 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1131 return (cl->c.*cl->f)( cl->xv ); }
1135 T& c;
1139 double const volatile& (T::*f)(gsl::vector const volatile&);
1140 };
1145 template<typename T>
1146 class Fuvcrc : public base_F {
1147 public:
1155 Fuvcrc( T& c, double (T::*f)(gsl::vector const&) const )
1156 : c( c ), f( f ){
1157 xv.wrap_gsl_vector_without_ownership( 0 ); }
1163 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1167 function_t function(){ return &function_s; }
1168 private:
1172 gsl::vector xv;
1181 static double function_s( gsl_vector const* x, void* params ){
1182 Fuvcrc<T>* const cl = reinterpret_cast<Fuvcrc<T>*>( params );
1183 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1184 return (cl->c.*cl->f)( cl->xv ); }
1188 T& c;
1192 double (T::*f)(gsl::vector const&) const;
1193 };
1198 template<typename T>
1199 class FuvCrc : public base_F {
1200 public:
1208 FuvCrc( T& c, double (T::*f)(gsl::vector const volatile&) const )
1209 : c( c ), f( f ){
1210 xv.wrap_gsl_vector_without_ownership( 0 ); }
1216 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1220 function_t function(){ return &function_s; }
1221 private:
1225 gsl::vector xv;
1234 static double function_s( gsl_vector const* x, void* params ){
1235 FuvCrc<T>* const cl = reinterpret_cast<FuvCrc<T>*>( params );
1236 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1237 return (cl->c.*cl->f)( cl->xv ); }
1241 T& c;
1245 double (T::*f)(gsl::vector const volatile&) const;
1246 };
1251 template<typename T>
1252 class Fcvcrc : public base_F {
1253 public:
1261 Fcvcrc( T& c, double const (T::*f)(gsl::vector const&) const )
1262 : c( c ), f( f ){
1263 xv.wrap_gsl_vector_without_ownership( 0 ); }
1269 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1273 function_t function(){ return &function_s; }
1274 private:
1278 gsl::vector xv;
1287 static double function_s( gsl_vector const* x, void* params ){
1288 Fcvcrc<T>* const cl = reinterpret_cast<Fcvcrc<T>*>( params );
1289 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1290 return (cl->c.*cl->f)( cl->xv ); }
1294 T& c;
1298 double const (T::*f)(gsl::vector const&) const;
1299 };
1304 template<typename T>
1305 class FcvCrc : public base_F {
1306 public:
1314 FcvCrc( T& c, double const (T::*f)(gsl::vector const volatile&) const )
1315 : c( c ), f( f ){
1316 xv.wrap_gsl_vector_without_ownership( 0 ); }
1322 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1326 function_t function(){ return &function_s; }
1327 private:
1331 gsl::vector xv;
1340 static double function_s( gsl_vector const* x, void* params ){
1341 FcvCrc<T>* const cl = reinterpret_cast<FcvCrc<T>*>( params );
1342 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1343 return (cl->c.*cl->f)( cl->xv ); }
1347 T& c;
1351 double const (T::*f)(gsl::vector const volatile&) const;
1352 };
1357 template<typename T>
1358 class Furcrc : public base_F {
1359 public:
1367 Furcrc( T& c, double& (T::*f)(gsl::vector const&) const )
1368 : c( c ), f( f ){
1369 xv.wrap_gsl_vector_without_ownership( 0 ); }
1375 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1379 function_t function(){ return &function_s; }
1380 private:
1384 gsl::vector xv;
1393 static double function_s( gsl_vector const* x, void* params ){
1394 Furcrc<T>* const cl = reinterpret_cast<Furcrc<T>*>( params );
1395 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1396 return (cl->c.*cl->f)( cl->xv ); }
1400 T& c;
1404 double& (T::*f)(gsl::vector const&) const;
1405 };
1410 template<typename T>
1411 class FurCrc : public base_F {
1412 public:
1420 FurCrc( T& c, double& (T::*f)(gsl::vector const volatile&) const )
1421 : c( c ), f( f ){
1422 xv.wrap_gsl_vector_without_ownership( 0 ); }
1428 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1432 function_t function(){ return &function_s; }
1433 private:
1437 gsl::vector xv;
1446 static double function_s( gsl_vector const* x, void* params ){
1447 FurCrc<T>* const cl = reinterpret_cast<FurCrc<T>*>( params );
1448 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1449 return (cl->c.*cl->f)( cl->xv ); }
1453 T& c;
1457 double& (T::*f)(gsl::vector const volatile&) const;
1458 };
1463 template<typename T>
1464 class Fcrcrc : public base_F {
1465 public:
1473 Fcrcrc( T& c, double const& (T::*f)(gsl::vector const&) const )
1474 : c( c ), f( f ){
1475 xv.wrap_gsl_vector_without_ownership( 0 ); }
1481 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1485 function_t function(){ return &function_s; }
1486 private:
1490 gsl::vector xv;
1499 static double function_s( gsl_vector const* x, void* params ){
1500 Fcrcrc<T>* const cl = reinterpret_cast<Fcrcrc<T>*>( params );
1501 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1502 return (cl->c.*cl->f)( cl->xv ); }
1506 T& c;
1510 double const& (T::*f)(gsl::vector const&) const;
1511 };
1516 template<typename T>
1517 class FcrCrc : public base_F {
1518 public:
1526 FcrCrc( T& c, double const& (T::*f)(gsl::vector const volatile&) const )
1527 : c( c ), f( f ){
1528 xv.wrap_gsl_vector_without_ownership( 0 ); }
1534 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1538 function_t function(){ return &function_s; }
1539 private:
1543 gsl::vector xv;
1552 static double function_s( gsl_vector const* x, void* params ){
1553 FcrCrc<T>* const cl = reinterpret_cast<FcrCrc<T>*>( params );
1554 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1555 return (cl->c.*cl->f)( cl->xv ); }
1559 T& c;
1563 double const& (T::*f)(gsl::vector const volatile&) const;
1564 };
1569 template<typename T>
1570 class FVrcrc : public base_F {
1571 public:
1579 FVrcrc( T& c, double volatile& (T::*f)(gsl::vector const&) const )
1580 : c( c ), f( f ){
1581 xv.wrap_gsl_vector_without_ownership( 0 ); }
1587 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1591 function_t function(){ return &function_s; }
1592 private:
1596 gsl::vector xv;
1605 static double function_s( gsl_vector const* x, void* params ){
1606 FVrcrc<T>* const cl = reinterpret_cast<FVrcrc<T>*>( params );
1607 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1608 return (cl->c.*cl->f)( cl->xv ); }
1612 T& c;
1616 double volatile& (T::*f)(gsl::vector const&) const;
1617 };
1622 template<typename T>
1623 class FVrCrc : public base_F {
1624 public:
1632 FVrCrc( T& c, double volatile& (T::*f)(gsl::vector const volatile&) const )
1633 : c( c ), f( f ){
1634 xv.wrap_gsl_vector_without_ownership( 0 ); }
1640 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1644 function_t function(){ return &function_s; }
1645 private:
1649 gsl::vector xv;
1658 static double function_s( gsl_vector const* x, void* params ){
1659 FVrCrc<T>* const cl = reinterpret_cast<FVrCrc<T>*>( params );
1660 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1661 return (cl->c.*cl->f)( cl->xv ); }
1665 T& c;
1669 double volatile& (T::*f)(gsl::vector const volatile&) const;
1670 };
1675 template<typename T>
1676 class FCrcrc : public base_F {
1677 public:
1685 FCrcrc( T& c, double const volatile& (T::*f)(gsl::vector const&) const )
1686 : c( c ), f( f ){
1687 xv.wrap_gsl_vector_without_ownership( 0 ); }
1693 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1697 function_t function(){ return &function_s; }
1698 private:
1702 gsl::vector xv;
1711 static double function_s( gsl_vector const* x, void* params ){
1712 FCrcrc<T>* const cl = reinterpret_cast<FCrcrc<T>*>( params );
1713 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1714 return (cl->c.*cl->f)( cl->xv ); }
1718 T& c;
1722 double const volatile& (T::*f)(gsl::vector const&) const;
1723 };
1728 template<typename T>
1729 class FCrCrc : public base_F {
1730 public:
1738 FCrCrc( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) const )
1739 : c( c ), f( f ){
1740 xv.wrap_gsl_vector_without_ownership( 0 ); }
1746 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1750 function_t function(){ return &function_s; }
1751 private:
1755 gsl::vector xv;
1764 static double function_s( gsl_vector const* x, void* params ){
1765 FCrCrc<T>* const cl = reinterpret_cast<FCrCrc<T>*>( params );
1766 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1767 return (cl->c.*cl->f)( cl->xv ); }
1771 T& c;
1775 double const volatile& (T::*f)(gsl::vector const volatile&) const;
1776 };
1781 template<typename T>
1782 class FuvcrV : public base_F {
1783 public:
1791 FuvcrV( T& c, double (T::*f)(gsl::vector const&) volatile )
1792 : c( c ), f( f ){
1793 xv.wrap_gsl_vector_without_ownership( 0 ); }
1799 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1803 function_t function(){ return &function_s; }
1804 private:
1808 gsl::vector xv;
1817 static double function_s( gsl_vector const* x, void* params ){
1818 FuvcrV<T>* const cl = reinterpret_cast<FuvcrV<T>*>( params );
1819 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1820 return (cl->c.*cl->f)( cl->xv ); }
1824 T& c;
1828 double (T::*f)(gsl::vector const&) volatile;
1829 };
1834 template<typename T>
1835 class FuvCrV : public base_F {
1836 public:
1844 FuvCrV( T& c, double (T::*f)(gsl::vector const volatile&) volatile )
1845 : c( c ), f( f ){
1846 xv.wrap_gsl_vector_without_ownership( 0 ); }
1852 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1856 function_t function(){ return &function_s; }
1857 private:
1861 gsl::vector xv;
1870 static double function_s( gsl_vector const* x, void* params ){
1871 FuvCrV<T>* const cl = reinterpret_cast<FuvCrV<T>*>( params );
1872 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1873 return (cl->c.*cl->f)( cl->xv ); }
1877 T& c;
1881 double (T::*f)(gsl::vector const volatile&) volatile;
1882 };
1887 template<typename T>
1888 class FcvcrV : public base_F {
1889 public:
1897 FcvcrV( T& c, double const (T::*f)(gsl::vector const&) volatile )
1898 : c( c ), f( f ){
1899 xv.wrap_gsl_vector_without_ownership( 0 ); }
1905 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1909 function_t function(){ return &function_s; }
1910 private:
1914 gsl::vector xv;
1923 static double function_s( gsl_vector const* x, void* params ){
1924 FcvcrV<T>* const cl = reinterpret_cast<FcvcrV<T>*>( params );
1925 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1926 return (cl->c.*cl->f)( cl->xv ); }
1930 T& c;
1934 double const (T::*f)(gsl::vector const&) volatile;
1935 };
1940 template<typename T>
1941 class FcvCrV : public base_F {
1942 public:
1950 FcvCrV( T& c, double const (T::*f)(gsl::vector const volatile&) volatile )
1951 : c( c ), f( f ){
1952 xv.wrap_gsl_vector_without_ownership( 0 ); }
1958 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
1962 function_t function(){ return &function_s; }
1963 private:
1967 gsl::vector xv;
1976 static double function_s( gsl_vector const* x, void* params ){
1977 FcvCrV<T>* const cl = reinterpret_cast<FcvCrV<T>*>( params );
1978 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
1979 return (cl->c.*cl->f)( cl->xv ); }
1983 T& c;
1987 double const (T::*f)(gsl::vector const volatile&) volatile;
1988 };
1993 template<typename T>
1994 class FurcrV : public base_F {
1995 public:
2003 FurcrV( T& c, double& (T::*f)(gsl::vector const&) volatile )
2004 : c( c ), f( f ){
2005 xv.wrap_gsl_vector_without_ownership( 0 ); }
2011 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2015 function_t function(){ return &function_s; }
2016 private:
2020 gsl::vector xv;
2029 static double function_s( gsl_vector const* x, void* params ){
2030 FurcrV<T>* const cl = reinterpret_cast<FurcrV<T>*>( params );
2031 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2032 return (cl->c.*cl->f)( cl->xv ); }
2036 T& c;
2040 double& (T::*f)(gsl::vector const&) volatile;
2041 };
2046 template<typename T>
2047 class FurCrV : public base_F {
2048 public:
2056 FurCrV( T& c, double& (T::*f)(gsl::vector const volatile&) volatile )
2057 : c( c ), f( f ){
2058 xv.wrap_gsl_vector_without_ownership( 0 ); }
2064 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2068 function_t function(){ return &function_s; }
2069 private:
2073 gsl::vector xv;
2082 static double function_s( gsl_vector const* x, void* params ){
2083 FurCrV<T>* const cl = reinterpret_cast<FurCrV<T>*>( params );
2084 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2085 return (cl->c.*cl->f)( cl->xv ); }
2089 T& c;
2093 double& (T::*f)(gsl::vector const volatile&) volatile;
2094 };
2099 template<typename T>
2100 class FcrcrV : public base_F {
2101 public:
2109 FcrcrV( T& c, double const& (T::*f)(gsl::vector const&) volatile )
2110 : c( c ), f( f ){
2111 xv.wrap_gsl_vector_without_ownership( 0 ); }
2117 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2121 function_t function(){ return &function_s; }
2122 private:
2126 gsl::vector xv;
2135 static double function_s( gsl_vector const* x, void* params ){
2136 FcrcrV<T>* const cl = reinterpret_cast<FcrcrV<T>*>( params );
2137 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2138 return (cl->c.*cl->f)( cl->xv ); }
2142 T& c;
2146 double const& (T::*f)(gsl::vector const&) volatile;
2147 };
2152 template<typename T>
2153 class FcrCrV : public base_F {
2154 public:
2162 FcrCrV( T& c, double const& (T::*f)(gsl::vector const volatile&) volatile )
2163 : c( c ), f( f ){
2164 xv.wrap_gsl_vector_without_ownership( 0 ); }
2170 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2174 function_t function(){ return &function_s; }
2175 private:
2179 gsl::vector xv;
2188 static double function_s( gsl_vector const* x, void* params ){
2189 FcrCrV<T>* const cl = reinterpret_cast<FcrCrV<T>*>( params );
2190 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2191 return (cl->c.*cl->f)( cl->xv ); }
2195 T& c;
2199 double const& (T::*f)(gsl::vector const volatile&) volatile;
2200 };
2205 template<typename T>
2206 class FVrcrV : public base_F {
2207 public:
2215 FVrcrV( T& c, double volatile& (T::*f)(gsl::vector const&) volatile )
2216 : c( c ), f( f ){
2217 xv.wrap_gsl_vector_without_ownership( 0 ); }
2223 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2227 function_t function(){ return &function_s; }
2228 private:
2232 gsl::vector xv;
2241 static double function_s( gsl_vector const* x, void* params ){
2242 FVrcrV<T>* const cl = reinterpret_cast<FVrcrV<T>*>( params );
2243 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2244 return (cl->c.*cl->f)( cl->xv ); }
2248 T& c;
2252 double volatile& (T::*f)(gsl::vector const&) volatile;
2253 };
2258 template<typename T>
2259 class FVrCrV : public base_F {
2260 public:
2268 FVrCrV( T& c, double volatile& (T::*f)(gsl::vector const volatile&) volatile )
2269 : c( c ), f( f ){
2270 xv.wrap_gsl_vector_without_ownership( 0 ); }
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( gsl_vector const* x, void* params ){
2295 FVrCrV<T>* const cl = reinterpret_cast<FVrCrV<T>*>( params );
2296 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2297 return (cl->c.*cl->f)( cl->xv ); }
2301 T& c;
2305 double volatile& (T::*f)(gsl::vector const volatile&) volatile;
2306 };
2311 template<typename T>
2312 class FCrcrV : public base_F {
2313 public:
2321 FCrcrV( T& c, double const volatile& (T::*f)(gsl::vector const&) volatile )
2322 : c( c ), f( f ){
2323 xv.wrap_gsl_vector_without_ownership( 0 ); }
2329 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2333 function_t function(){ return &function_s; }
2334 private:
2338 gsl::vector xv;
2347 static double function_s( gsl_vector const* x, void* params ){
2348 FCrcrV<T>* const cl = reinterpret_cast<FCrcrV<T>*>( params );
2349 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2350 return (cl->c.*cl->f)( cl->xv ); }
2354 T& c;
2358 double const volatile& (T::*f)(gsl::vector const&) volatile;
2359 };
2364 template<typename T>
2365 class FCrCrV : public base_F {
2366 public:
2374 FCrCrV( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) volatile )
2375 : c( c ), f( f ){
2376 xv.wrap_gsl_vector_without_ownership( 0 ); }
2382 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2386 function_t function(){ return &function_s; }
2387 private:
2391 gsl::vector xv;
2400 static double function_s( gsl_vector const* x, void* params ){
2401 FCrCrV<T>* const cl = reinterpret_cast<FCrCrV<T>*>( params );
2402 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2403 return (cl->c.*cl->f)( cl->xv ); }
2407 T& c;
2411 double const volatile& (T::*f)(gsl::vector const volatile&) volatile;
2412 };
2417 template<typename T>
2418 class FuvcrC : public base_F {
2419 public:
2427 FuvcrC( T& c, double (T::*f)(gsl::vector const&) const volatile )
2428 : c( c ), f( f ){
2429 xv.wrap_gsl_vector_without_ownership( 0 ); }
2435 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2439 function_t function(){ return &function_s; }
2440 private:
2444 gsl::vector xv;
2453 static double function_s( gsl_vector const* x, void* params ){
2454 FuvcrC<T>* const cl = reinterpret_cast<FuvcrC<T>*>( params );
2455 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2456 return (cl->c.*cl->f)( cl->xv ); }
2460 T& c;
2464 double (T::*f)(gsl::vector const&) const volatile;
2465 };
2470 template<typename T>
2471 class FuvCrC : public base_F {
2472 public:
2480 FuvCrC( T& c, double (T::*f)(gsl::vector const volatile&) const volatile )
2481 : c( c ), f( f ){
2482 xv.wrap_gsl_vector_without_ownership( 0 ); }
2488 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2492 function_t function(){ return &function_s; }
2493 private:
2497 gsl::vector xv;
2506 static double function_s( gsl_vector const* x, void* params ){
2507 FuvCrC<T>* const cl = reinterpret_cast<FuvCrC<T>*>( params );
2508 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2509 return (cl->c.*cl->f)( cl->xv ); }
2513 T& c;
2517 double (T::*f)(gsl::vector const volatile&) const volatile;
2518 };
2523 template<typename T>
2524 class FcvcrC : public base_F {
2525 public:
2533 FcvcrC( T& c, double const (T::*f)(gsl::vector const&) const volatile )
2534 : c( c ), f( f ){
2535 xv.wrap_gsl_vector_without_ownership( 0 ); }
2541 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2545 function_t function(){ return &function_s; }
2546 private:
2550 gsl::vector xv;
2559 static double function_s( gsl_vector const* x, void* params ){
2560 FcvcrC<T>* const cl = reinterpret_cast<FcvcrC<T>*>( params );
2561 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2562 return (cl->c.*cl->f)( cl->xv ); }
2566 T& c;
2570 double const (T::*f)(gsl::vector const&) const volatile;
2571 };
2576 template<typename T>
2577 class FcvCrC : public base_F {
2578 public:
2586 FcvCrC( T& c, double const (T::*f)(gsl::vector const volatile&) const volatile )
2587 : c( c ), f( f ){
2588 xv.wrap_gsl_vector_without_ownership( 0 ); }
2594 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2598 function_t function(){ return &function_s; }
2599 private:
2603 gsl::vector xv;
2612 static double function_s( gsl_vector const* x, void* params ){
2613 FcvCrC<T>* const cl = reinterpret_cast<FcvCrC<T>*>( params );
2614 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2615 return (cl->c.*cl->f)( cl->xv ); }
2619 T& c;
2623 double const (T::*f)(gsl::vector const volatile&) const volatile;
2624 };
2629 template<typename T>
2630 class FurcrC : public base_F {
2631 public:
2639 FurcrC( T& c, double& (T::*f)(gsl::vector const&) const volatile )
2640 : c( c ), f( f ){
2641 xv.wrap_gsl_vector_without_ownership( 0 ); }
2647 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2651 function_t function(){ return &function_s; }
2652 private:
2656 gsl::vector xv;
2665 static double function_s( gsl_vector const* x, void* params ){
2666 FurcrC<T>* const cl = reinterpret_cast<FurcrC<T>*>( params );
2667 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2668 return (cl->c.*cl->f)( cl->xv ); }
2672 T& c;
2676 double& (T::*f)(gsl::vector const&) const volatile;
2677 };
2682 template<typename T>
2683 class FurCrC : public base_F {
2684 public:
2692 FurCrC( T& c, double& (T::*f)(gsl::vector const volatile&) const volatile )
2693 : c( c ), f( f ){
2694 xv.wrap_gsl_vector_without_ownership( 0 ); }
2700 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2704 function_t function(){ return &function_s; }
2705 private:
2709 gsl::vector xv;
2718 static double function_s( gsl_vector const* x, void* params ){
2719 FurCrC<T>* const cl = reinterpret_cast<FurCrC<T>*>( params );
2720 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2721 return (cl->c.*cl->f)( cl->xv ); }
2725 T& c;
2729 double& (T::*f)(gsl::vector const volatile&) const volatile;
2730 };
2735 template<typename T>
2736 class FcrcrC : public base_F {
2737 public:
2745 FcrcrC( T& c, double const& (T::*f)(gsl::vector const&) const volatile )
2746 : c( c ), f( f ){
2747 xv.wrap_gsl_vector_without_ownership( 0 ); }
2753 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2757 function_t function(){ return &function_s; }
2758 private:
2762 gsl::vector xv;
2771 static double function_s( gsl_vector const* x, void* params ){
2772 FcrcrC<T>* const cl = reinterpret_cast<FcrcrC<T>*>( params );
2773 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2774 return (cl->c.*cl->f)( cl->xv ); }
2778 T& c;
2782 double const& (T::*f)(gsl::vector const&) const volatile;
2783 };
2788 template<typename T>
2789 class FcrCrC : public base_F {
2790 public:
2798 FcrCrC( T& c, double const& (T::*f)(gsl::vector const volatile&) const volatile )
2799 : c( c ), f( f ){
2800 xv.wrap_gsl_vector_without_ownership( 0 ); }
2806 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2810 function_t function(){ return &function_s; }
2811 private:
2815 gsl::vector xv;
2824 static double function_s( gsl_vector const* x, void* params ){
2825 FcrCrC<T>* const cl = reinterpret_cast<FcrCrC<T>*>( params );
2826 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2827 return (cl->c.*cl->f)( cl->xv ); }
2831 T& c;
2835 double const& (T::*f)(gsl::vector const volatile&) const volatile;
2836 };
2841 template<typename T>
2842 class FVrcrC : public base_F {
2843 public:
2851 FVrcrC( T& c, double volatile& (T::*f)(gsl::vector const&) const volatile )
2852 : c( c ), f( f ){
2853 xv.wrap_gsl_vector_without_ownership( 0 ); }
2859 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2863 function_t function(){ return &function_s; }
2864 private:
2868 gsl::vector xv;
2877 static double function_s( gsl_vector const* x, void* params ){
2878 FVrcrC<T>* const cl = reinterpret_cast<FVrcrC<T>*>( params );
2879 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2880 return (cl->c.*cl->f)( cl->xv ); }
2884 T& c;
2888 double volatile& (T::*f)(gsl::vector const&) const volatile;
2889 };
2894 template<typename T>
2895 class FVrCrC : public base_F {
2896 public:
2904 FVrCrC( T& c, double volatile& (T::*f)(gsl::vector const volatile&) const volatile )
2905 : c( c ), f( f ){
2906 xv.wrap_gsl_vector_without_ownership( 0 ); }
2912 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2916 function_t function(){ return &function_s; }
2917 private:
2921 gsl::vector xv;
2930 static double function_s( gsl_vector const* x, void* params ){
2931 FVrCrC<T>* const cl = reinterpret_cast<FVrCrC<T>*>( params );
2932 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2933 return (cl->c.*cl->f)( cl->xv ); }
2937 T& c;
2941 double volatile& (T::*f)(gsl::vector const volatile&) const volatile;
2942 };
2947 template<typename T>
2948 class FCrcrC : public base_F {
2949 public:
2957 FCrcrC( T& c, double const volatile& (T::*f)(gsl::vector const&) const volatile )
2958 : c( c ), f( f ){
2959 xv.wrap_gsl_vector_without_ownership( 0 ); }
2965 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
2969 function_t function(){ return &function_s; }
2970 private:
2974 gsl::vector xv;
2983 static double function_s( gsl_vector const* x, void* params ){
2984 FCrcrC<T>* const cl = reinterpret_cast<FCrcrC<T>*>( params );
2985 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
2986 return (cl->c.*cl->f)( cl->xv ); }
2990 T& c;
2994 double const volatile& (T::*f)(gsl::vector const&) const volatile;
2995 };
3000 template<typename T>
3001 class FCrCrC : public base_F {
3002 public:
3010 FCrCrC( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) const volatile )
3011 : c( c ), f( f ){
3012 xv.wrap_gsl_vector_without_ownership( 0 ); }
3018 double operator()( gsl::vector const& x ){ return (c.*f)( x ); }
3022 function_t function(){ return &function_s; }
3023 private:
3027 gsl::vector xv;
3036 static double function_s( gsl_vector const* x, void* params ){
3037 FCrCrC<T>* const cl = reinterpret_cast<FCrCrC<T>*>( params );
3038 cl->xv.ccgsl_pointer = const_cast<gsl_vector*>( x );
3039 return (cl->c.*cl->f)( cl->xv ); }
3043 T& c;
3047 double const volatile& (T::*f)(gsl::vector const volatile&) const volatile;
3048 };
3049#endif
3050 base_F* base_f;
3054 size_t* count;
3055 public:
3060 base_f = 0;
3061 f = 0;
3062 n = 0;
3063 params = 0;
3064 count = 0; // initially nullptr will do
3065 }
3071 explicit function( double (*const f)(gsl::vector const&), size_t const n ){
3072 base_f = 0;
3073 params = 0;
3074 base_f = new Fuvcr( f );
3075 params = base_f;
3076 this->f = &fn;
3077 this->n = n;
3078 // just plausibly we could fail to allocate count: no further action needed.
3079 count = new size_t;
3080 *count = 1; // initially there is just one reference to f
3081 }
3087 explicit function( double (*const f)(gsl::vector const volatile&), size_t const n ){
3088 base_f = 0;
3089 params = 0;
3090 base_f = new FuvCr( f );
3091 params = base_f;
3092 this->f = &fn;
3093 this->n = n;
3094 // just plausibly we could fail to allocate count: no further action needed.
3095 count = new size_t;
3096 *count = 1; // initially there is just one reference to f
3097 }
3098#ifndef DOXYGEN_SKIP
3104 explicit function( double const (*const f)(gsl::vector const&), size_t const n ){
3105 base_f = 0;
3106 params = 0;
3107 base_f = new Fcvcr( f );
3108 params = base_f;
3109 this->f = &fn;
3110 this->n = n;
3111 // just plausibly we could fail to allocate count: no further action needed.
3112 count = new size_t;
3113 *count = 1; // initially there is just one reference to f
3114 }
3120 explicit function( double const (*const f)(gsl::vector const volatile&), size_t const n ){
3121 base_f = 0;
3122 params = 0;
3123 base_f = new FcvCr( f );
3124 params = base_f;
3125 this->f = &fn;
3126 this->n = n;
3127 // just plausibly we could fail to allocate count: no further action needed.
3128 count = new size_t;
3129 *count = 1; // initially there is just one reference to f
3130 }
3131#endif
3132#ifndef DOXYGEN_SKIP
3138 explicit function( double& (*const f)(gsl::vector const&), size_t const n ){
3139 base_f = 0;
3140 params = 0;
3141 base_f = new Furcr( f );
3142 params = base_f;
3143 this->f = &fn;
3144 this->n = n;
3145 // just plausibly we could fail to allocate count: no further action needed.
3146 count = new size_t;
3147 *count = 1; // initially there is just one reference to f
3148 }
3154 explicit function( double& (*const f)(gsl::vector const volatile&), size_t const n ){
3155 base_f = 0;
3156 params = 0;
3157 base_f = new FurCr( f );
3158 params = base_f;
3159 this->f = &fn;
3160 this->n = n;
3161 // just plausibly we could fail to allocate count: no further action needed.
3162 count = new size_t;
3163 *count = 1; // initially there is just one reference to f
3164 }
3165#endif
3166#ifndef DOXYGEN_SKIP
3172 explicit function( double const& (*const f)(gsl::vector const&), size_t const n ){
3173 base_f = 0;
3174 params = 0;
3175 base_f = new Fcrcr( f );
3176 params = base_f;
3177 this->f = &fn;
3178 this->n = n;
3179 // just plausibly we could fail to allocate count: no further action needed.
3180 count = new size_t;
3181 *count = 1; // initially there is just one reference to f
3182 }
3188 explicit function( double const& (*const f)(gsl::vector const volatile&), size_t const n ){
3189 base_f = 0;
3190 params = 0;
3191 base_f = new FcrCr( f );
3192 params = base_f;
3193 this->f = &fn;
3194 this->n = n;
3195 // just plausibly we could fail to allocate count: no further action needed.
3196 count = new size_t;
3197 *count = 1; // initially there is just one reference to f
3198 }
3204 explicit function( double volatile& (*const f)(gsl::vector const&), size_t const n ){
3205 base_f = 0;
3206 params = 0;
3207 base_f = new FVrcr( f );
3208 params = base_f;
3209 this->f = &fn;
3210 this->n = n;
3211 // just plausibly we could fail to allocate count: no further action needed.
3212 count = new size_t;
3213 *count = 1; // initially there is just one reference to f
3214 }
3220 explicit function( double volatile& (*const f)(gsl::vector const volatile&), size_t const n ){
3221 base_f = 0;
3222 params = 0;
3223 base_f = new FVrCr( f );
3224 params = base_f;
3225 this->f = &fn;
3226 this->n = n;
3227 // just plausibly we could fail to allocate count: no further action needed.
3228 count = new size_t;
3229 *count = 1; // initially there is just one reference to f
3230 }
3231#endif
3232#ifndef DOXYGEN_SKIP
3238 explicit function( double const volatile& (*const f)(gsl::vector const&), size_t const n ){
3239 base_f = 0;
3240 params = 0;
3241 base_f = new FCrcr( f );
3242 params = base_f;
3243 this->f = &fn;
3244 this->n = n;
3245 // just plausibly we could fail to allocate count: no further action needed.
3246 count = new size_t;
3247 *count = 1; // initially there is just one reference to f
3248 }
3254 explicit function( double const volatile& (*const f)(gsl::vector const volatile&), size_t const n ){
3255 base_f = 0;
3256 params = 0;
3257 base_f = new FCrCr( f );
3258 params = base_f;
3259 this->f = &fn;
3260 this->n = n;
3261 // just plausibly we could fail to allocate count: no further action needed.
3262 count = new size_t;
3263 *count = 1; // initially there is just one reference to f
3264 }
3265#endif
3272 template<typename T> function( T& c, double (T::*f)(gsl::vector const&), size_t const n ){
3273 base_f = 0;
3274 params = 0;
3275 base_f = new Fuvcru<T>( c, f );
3276 params = base_f;
3277 this->f = &fn;
3278 this->n = n;
3279 // just plausibly we could fail to allocate count: no further action needed.
3280 count = new size_t;
3281 *count = 1; // initially there is just one reference to f
3282 }
3289 template<typename T> function( T& c, double (T::*f)(gsl::vector const volatile&), size_t const n ){
3290 base_f = 0;
3291 params = 0;
3292 base_f = new FuvCru<T>( c, f );
3293 params = base_f;
3294 this->f = &fn;
3295 this->n = n;
3296 // just plausibly we could fail to allocate count: no further action needed.
3297 count = new size_t;
3298 *count = 1; // initially there is just one reference to f
3299 }
3300#ifndef DOXYGEN_SKIP
3307 template<typename T> function( T& c, double const (T::*f)(gsl::vector const&), size_t const n ){
3308 base_f = 0;
3309 params = 0;
3310 base_f = new Fcvcru<T>( c, f );
3311 params = base_f;
3312 this->f = &fn;
3313 this->n = n;
3314 // just plausibly we could fail to allocate count: no further action needed.
3315 count = new size_t;
3316 *count = 1; // initially there is just one reference to f
3317 }
3324 template<typename T> function( T& c, double const (T::*f)(gsl::vector const volatile&), size_t const n ){
3325 base_f = 0;
3326 params = 0;
3327 base_f = new FcvCru<T>( c, f );
3328 params = base_f;
3329 this->f = &fn;
3330 this->n = n;
3331 // just plausibly we could fail to allocate count: no further action needed.
3332 count = new size_t;
3333 *count = 1; // initially there is just one reference to f
3334 }
3335#endif
3336#ifndef DOXYGEN_SKIP
3343 template<typename T> function( T& c, double& (T::*f)(gsl::vector const&), size_t const n ){
3344 base_f = 0;
3345 params = 0;
3346 base_f = new Furcru<T>( c, f );
3347 params = base_f;
3348 this->f = &fn;
3349 this->n = n;
3350 // just plausibly we could fail to allocate count: no further action needed.
3351 count = new size_t;
3352 *count = 1; // initially there is just one reference to f
3353 }
3360 template<typename T> function( T& c, double& (T::*f)(gsl::vector const volatile&), size_t const n ){
3361 base_f = 0;
3362 params = 0;
3363 base_f = new FurCru<T>( c, f );
3364 params = base_f;
3365 this->f = &fn;
3366 this->n = n;
3367 // just plausibly we could fail to allocate count: no further action needed.
3368 count = new size_t;
3369 *count = 1; // initially there is just one reference to f
3370 }
3371#endif
3372#ifndef DOXYGEN_SKIP
3379 template<typename T> function( T& c, double const& (T::*f)(gsl::vector const&), size_t const n ){
3380 base_f = 0;
3381 params = 0;
3382 base_f = new Fcrcru<T>( c, f );
3383 params = base_f;
3384 this->f = &fn;
3385 this->n = n;
3386 // just plausibly we could fail to allocate count: no further action needed.
3387 count = new size_t;
3388 *count = 1; // initially there is just one reference to f
3389 }
3396 template<typename T> function( T& c, double const& (T::*f)(gsl::vector const volatile&), size_t const n ){
3397 base_f = 0;
3398 params = 0;
3399 base_f = new FcrCru<T>( c, f );
3400 params = base_f;
3401 this->f = &fn;
3402 this->n = n;
3403 // just plausibly we could fail to allocate count: no further action needed.
3404 count = new size_t;
3405 *count = 1; // initially there is just one reference to f
3406 }
3407#endif
3408#ifndef DOXYGEN_SKIP
3415 template<typename T> function( T& c, double volatile& (T::*f)(gsl::vector const&), size_t const n ){
3416 base_f = 0;
3417 params = 0;
3418 base_f = new FVrcru<T>( c, f );
3419 params = base_f;
3420 this->f = &fn;
3421 this->n = n;
3422 // just plausibly we could fail to allocate count: no further action needed.
3423 count = new size_t;
3424 *count = 1; // initially there is just one reference to f
3425 }
3432 template<typename T> function( T& c, double volatile& (T::*f)(gsl::vector const volatile&), size_t const n ){
3433 base_f = 0;
3434 params = 0;
3435 base_f = new FVrCru<T>( c, f );
3436 params = base_f;
3437 this->f = &fn;
3438 this->n = n;
3439 // just plausibly we could fail to allocate count: no further action needed.
3440 count = new size_t;
3441 *count = 1; // initially there is just one reference to f
3442 }
3443#endif
3444#ifndef DOXYGEN_SKIP
3451 template<typename T> function( T& c, double const volatile& (T::*f)(gsl::vector const&), size_t const n ){
3452 base_f = 0;
3453 params = 0;
3454 base_f = new FCrcru<T>( c, f );
3455 params = base_f;
3456 this->f = &fn;
3457 this->n = n;
3458 // just plausibly we could fail to allocate count: no further action needed.
3459 count = new size_t;
3460 *count = 1; // initially there is just one reference to f
3461 }
3468 template<typename T> function( T& c, double const volatile& (T::*f)(gsl::vector const volatile&), size_t const n ){
3469 base_f = 0;
3470 params = 0;
3471 base_f = new FCrCru<T>( c, f );
3472 params = base_f;
3473 this->f = &fn;
3474 this->n = n;
3475 // just plausibly we could fail to allocate count: no further action needed.
3476 count = new size_t;
3477 *count = 1; // initially there is just one reference to f
3478 }
3479#endif
3480#ifndef DOXYGEN_SKIP
3487 template<typename T> function( T& c, double (T::*f)(gsl::vector const&) const, size_t const n ){
3488 base_f = 0;
3489 params = 0;
3490 base_f = new Fuvcrc<T>( c, f );
3491 params = base_f;
3492 this->f = &fn;
3493 this->n = n;
3494 // just plausibly we could fail to allocate count: no further action needed.
3495 count = new size_t;
3496 *count = 1; // initially there is just one reference to f
3497 }
3504 template<typename T> function( T& c, double (T::*f)(gsl::vector const volatile&) const, size_t const n ){
3505 base_f = 0;
3506 params = 0;
3507 base_f = new FuvCrc<T>( c, f );
3508 params = base_f;
3509 this->f = &fn;
3510 this->n = n;
3511 // just plausibly we could fail to allocate count: no further action needed.
3512 count = new size_t;
3513 *count = 1; // initially there is just one reference to f
3514 }
3515#endif
3516#ifndef DOXYGEN_SKIP
3523 template<typename T> function( T& c, double const (T::*f)(gsl::vector const&) const, size_t const n ){
3524 base_f = 0;
3525 params = 0;
3526 base_f = new Fcvcrc<T>( c, f );
3527 params = base_f;
3528 this->f = &fn;
3529 this->n = n;
3530 // just plausibly we could fail to allocate count: no further action needed.
3531 count = new size_t;
3532 *count = 1; // initially there is just one reference to f
3533 }
3540 template<typename T> function( T& c, double const (T::*f)(gsl::vector const volatile&) const, size_t const n ){
3541 base_f = 0;
3542 params = 0;
3543 base_f = new FcvCrc<T>( c, f );
3544 params = base_f;
3545 this->f = &fn;
3546 this->n = n;
3547 // just plausibly we could fail to allocate count: no further action needed.
3548 count = new size_t;
3549 *count = 1; // initially there is just one reference to f
3550 }
3551#endif
3552#ifndef DOXYGEN_SKIP
3559 template<typename T> function( T& c, double& (T::*f)(gsl::vector const&) const, size_t const n ){
3560 base_f = 0;
3561 params = 0;
3562 base_f = new Furcrc<T>( c, f );
3563 params = base_f;
3564 this->f = &fn;
3565 this->n = n;
3566 // just plausibly we could fail to allocate count: no further action needed.
3567 count = new size_t;
3568 *count = 1; // initially there is just one reference to f
3569 }
3576 template<typename T> function( T& c, double& (T::*f)(gsl::vector const volatile&) const, size_t const n ){
3577 base_f = 0;
3578 params = 0;
3579 base_f = new FurCrc<T>( c, f );
3580 params = base_f;
3581 this->f = &fn;
3582 this->n = n;
3583 // just plausibly we could fail to allocate count: no further action needed.
3584 count = new size_t;
3585 *count = 1; // initially there is just one reference to f
3586 }
3587#endif
3588#ifndef DOXYGEN_SKIP
3595 template<typename T> function( T& c, double const& (T::*f)(gsl::vector const&) const, size_t const n ){
3596 base_f = 0;
3597 params = 0;
3598 base_f = new Fcrcrc<T>( c, f );
3599 params = base_f;
3600 this->f = &fn;
3601 this->n = n;
3602 // just plausibly we could fail to allocate count: no further action needed.
3603 count = new size_t;
3604 *count = 1; // initially there is just one reference to f
3605 }
3612 template<typename T> function( T& c, double const& (T::*f)(gsl::vector const volatile&) const, size_t const n ){
3613 base_f = 0;
3614 params = 0;
3615 base_f = new FcrCrc<T>( c, f );
3616 params = base_f;
3617 this->f = &fn;
3618 this->n = n;
3619 // just plausibly we could fail to allocate count: no further action needed.
3620 count = new size_t;
3621 *count = 1; // initially there is just one reference to f
3622 }
3623#endif
3624#ifndef DOXYGEN_SKIP
3631 template<typename T> function( T& c, double volatile& (T::*f)(gsl::vector const&) const, size_t const n ){
3632 base_f = 0;
3633 params = 0;
3634 base_f = new FVrcrc<T>( c, f );
3635 params = base_f;
3636 this->f = &fn;
3637 this->n = n;
3638 // just plausibly we could fail to allocate count: no further action needed.
3639 count = new size_t;
3640 *count = 1; // initially there is just one reference to f
3641 }
3648 template<typename T> function( T& c, double volatile& (T::*f)(gsl::vector const volatile&) const, size_t const n ){
3649 base_f = 0;
3650 params = 0;
3651 base_f = new FVrCrc<T>( c, f );
3652 params = base_f;
3653 this->f = &fn;
3654 this->n = n;
3655 // just plausibly we could fail to allocate count: no further action needed.
3656 count = new size_t;
3657 *count = 1; // initially there is just one reference to f
3658 }
3659#endif
3660#ifndef DOXYGEN_SKIP
3667 template<typename T> function( T& c, double const volatile& (T::*f)(gsl::vector const&) const, size_t const n ){
3668 base_f = 0;
3669 params = 0;
3670 base_f = new FCrcrc<T>( c, f );
3671 params = base_f;
3672 this->f = &fn;
3673 this->n = n;
3674 // just plausibly we could fail to allocate count: no further action needed.
3675 count = new size_t;
3676 *count = 1; // initially there is just one reference to f
3677 }
3684 template<typename T> function( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) const, size_t const n ){
3685 base_f = 0;
3686 params = 0;
3687 base_f = new FCrCrc<T>( c, f );
3688 params = base_f;
3689 this->f = &fn;
3690 this->n = n;
3691 // just plausibly we could fail to allocate count: no further action needed.
3692 count = new size_t;
3693 *count = 1; // initially there is just one reference to f
3694 }
3695#endif
3696#ifndef DOXYGEN_SKIP
3703 template<typename T> function( T& c, double (T::*f)(gsl::vector const&) volatile, size_t const n ){
3704 base_f = 0;
3705 params = 0;
3706 base_f = new FuvcrV<T>( c, f );
3707 params = base_f;
3708 this->f = &fn;
3709 this->n = n;
3710 // just plausibly we could fail to allocate count: no further action needed.
3711 count = new size_t;
3712 *count = 1; // initially there is just one reference to f
3713 }
3720 template<typename T> function( T& c, double (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
3721 base_f = 0;
3722 params = 0;
3723 base_f = new FuvCrV<T>( c, f );
3724 params = base_f;
3725 this->f = &fn;
3726 this->n = n;
3727 // just plausibly we could fail to allocate count: no further action needed.
3728 count = new size_t;
3729 *count = 1; // initially there is just one reference to f
3730 }
3731#endif
3732#ifndef DOXYGEN_SKIP
3739 template<typename T> function( T& c, double const (T::*f)(gsl::vector const&) volatile, size_t const n ){
3740 base_f = 0;
3741 params = 0;
3742 base_f = new FcvcrV<T>( c, f );
3743 params = base_f;
3744 this->f = &fn;
3745 this->n = n;
3746 // just plausibly we could fail to allocate count: no further action needed.
3747 count = new size_t;
3748 *count = 1; // initially there is just one reference to f
3749 }
3756 template<typename T> function( T& c, double const (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
3757 base_f = 0;
3758 params = 0;
3759 base_f = new FcvCrV<T>( c, f );
3760 params = base_f;
3761 this->f = &fn;
3762 this->n = n;
3763 // just plausibly we could fail to allocate count: no further action needed.
3764 count = new size_t;
3765 *count = 1; // initially there is just one reference to f
3766 }
3767#endif
3768#ifndef DOXYGEN_SKIP
3775 template<typename T> function( T& c, double& (T::*f)(gsl::vector const&) volatile, size_t const n ){
3776 base_f = 0;
3777 params = 0;
3778 base_f = new FurcrV<T>( c, f );
3779 params = base_f;
3780 this->f = &fn;
3781 this->n = n;
3782 // just plausibly we could fail to allocate count: no further action needed.
3783 count = new size_t;
3784 *count = 1; // initially there is just one reference to f
3785 }
3792 template<typename T> function( T& c, double& (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
3793 base_f = 0;
3794 params = 0;
3795 base_f = new FurCrV<T>( c, f );
3796 params = base_f;
3797 this->f = &fn;
3798 this->n = n;
3799 // just plausibly we could fail to allocate count: no further action needed.
3800 count = new size_t;
3801 *count = 1; // initially there is just one reference to f
3802 }
3803#endif
3804#ifndef DOXYGEN_SKIP
3811 template<typename T> function( T& c, double const& (T::*f)(gsl::vector const&) volatile, size_t const n ){
3812 base_f = 0;
3813 params = 0;
3814 base_f = new FcrcrV<T>( c, f );
3815 params = base_f;
3816 this->f = &fn;
3817 this->n = n;
3818 // just plausibly we could fail to allocate count: no further action needed.
3819 count = new size_t;
3820 *count = 1; // initially there is just one reference to f
3821 }
3828 template<typename T> function( T& c, double const& (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
3829 base_f = 0;
3830 params = 0;
3831 base_f = new FcrCrV<T>( c, f );
3832 params = base_f;
3833 this->f = &fn;
3834 this->n = n;
3835 // just plausibly we could fail to allocate count: no further action needed.
3836 count = new size_t;
3837 *count = 1; // initially there is just one reference to f
3838 }
3839#endif
3840#ifndef DOXYGEN_SKIP
3847 template<typename T> function( T& c, double volatile& (T::*f)(gsl::vector const&) volatile, size_t const n ){
3848 base_f = 0;
3849 params = 0;
3850 base_f = new FVrcrV<T>( c, f );
3851 params = base_f;
3852 this->f = &fn;
3853 this->n = n;
3854 // just plausibly we could fail to allocate count: no further action needed.
3855 count = new size_t;
3856 *count = 1; // initially there is just one reference to f
3857 }
3864 template<typename T> function( T& c, double volatile& (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
3865 base_f = 0;
3866 params = 0;
3867 base_f = new FVrCrV<T>( c, f );
3868 params = base_f;
3869 this->f = &fn;
3870 this->n = n;
3871 // just plausibly we could fail to allocate count: no further action needed.
3872 count = new size_t;
3873 *count = 1; // initially there is just one reference to f
3874 }
3875#endif
3876#ifndef DOXYGEN_SKIP
3883 template<typename T> function( T& c, double const volatile& (T::*f)(gsl::vector const&) volatile, size_t const n ){
3884 base_f = 0;
3885 params = 0;
3886 base_f = new FCrcrV<T>( c, f );
3887 params = base_f;
3888 this->f = &fn;
3889 this->n = n;
3890 // just plausibly we could fail to allocate count: no further action needed.
3891 count = new size_t;
3892 *count = 1; // initially there is just one reference to f
3893 }
3900 template<typename T> function( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
3901 base_f = 0;
3902 params = 0;
3903 base_f = new FCrCrV<T>( c, f );
3904 params = base_f;
3905 this->f = &fn;
3906 this->n = n;
3907 // just plausibly we could fail to allocate count: no further action needed.
3908 count = new size_t;
3909 *count = 1; // initially there is just one reference to f
3910 }
3911#endif
3912#ifndef DOXYGEN_SKIP
3919 template<typename T> function( T& c, double (T::*f)(gsl::vector const&) const volatile, size_t const n ){
3920 base_f = 0;
3921 params = 0;
3922 base_f = new FuvcrC<T>( c, f );
3923 params = base_f;
3924 this->f = &fn;
3925 this->n = n;
3926 // just plausibly we could fail to allocate count: no further action needed.
3927 count = new size_t;
3928 *count = 1; // initially there is just one reference to f
3929 }
3936 template<typename T> function( T& c, double (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
3937 base_f = 0;
3938 params = 0;
3939 base_f = new FuvCrC<T>( c, f );
3940 params = base_f;
3941 this->f = &fn;
3942 this->n = n;
3943 // just plausibly we could fail to allocate count: no further action needed.
3944 count = new size_t;
3945 *count = 1; // initially there is just one reference to f
3946 }
3947#endif
3948#ifndef DOXYGEN_SKIP
3955 template<typename T> function( T& c, double const (T::*f)(gsl::vector const&) const volatile, size_t const n ){
3956 base_f = 0;
3957 params = 0;
3958 base_f = new FcvcrC<T>( c, f );
3959 params = base_f;
3960 this->f = &fn;
3961 this->n = n;
3962 // just plausibly we could fail to allocate count: no further action needed.
3963 count = new size_t;
3964 *count = 1; // initially there is just one reference to f
3965 }
3972 template<typename T> function( T& c, double const (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
3973 base_f = 0;
3974 params = 0;
3975 base_f = new FcvCrC<T>( c, f );
3976 params = base_f;
3977 this->f = &fn;
3978 this->n = n;
3979 // just plausibly we could fail to allocate count: no further action needed.
3980 count = new size_t;
3981 *count = 1; // initially there is just one reference to f
3982 }
3983#endif
3984#ifndef DOXYGEN_SKIP
3991 template<typename T> function( T& c, double& (T::*f)(gsl::vector const&) const volatile, size_t const n ){
3992 base_f = 0;
3993 params = 0;
3994 base_f = new FurcrC<T>( c, f );
3995 params = base_f;
3996 this->f = &fn;
3997 this->n = n;
3998 // just plausibly we could fail to allocate count: no further action needed.
3999 count = new size_t;
4000 *count = 1; // initially there is just one reference to f
4001 }
4008 template<typename T> function( T& c, double& (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4009 base_f = 0;
4010 params = 0;
4011 base_f = new FurCrC<T>( c, f );
4012 params = base_f;
4013 this->f = &fn;
4014 this->n = n;
4015 // just plausibly we could fail to allocate count: no further action needed.
4016 count = new size_t;
4017 *count = 1; // initially there is just one reference to f
4018 }
4019#endif
4020#ifndef DOXYGEN_SKIP
4027 template<typename T> function( T& c, double const& (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4028 base_f = 0;
4029 params = 0;
4030 base_f = new FcrcrC<T>( c, f );
4031 params = base_f;
4032 this->f = &fn;
4033 this->n = n;
4034 // just plausibly we could fail to allocate count: no further action needed.
4035 count = new size_t;
4036 *count = 1; // initially there is just one reference to f
4037 }
4044 template<typename T> function( T& c, double const& (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4045 base_f = 0;
4046 params = 0;
4047 base_f = new FcrCrC<T>( c, f );
4048 params = base_f;
4049 this->f = &fn;
4050 this->n = n;
4051 // just plausibly we could fail to allocate count: no further action needed.
4052 count = new size_t;
4053 *count = 1; // initially there is just one reference to f
4054 }
4055#endif
4056#ifndef DOXYGEN_SKIP
4063 template<typename T> function( T& c, double volatile& (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4064 base_f = 0;
4065 params = 0;
4066 base_f = new FVrcrC<T>( c, f );
4067 params = base_f;
4068 this->f = &fn;
4069 this->n = n;
4070 // just plausibly we could fail to allocate count: no further action needed.
4071 count = new size_t;
4072 *count = 1; // initially there is just one reference to f
4073 }
4080 template<typename T> function( T& c, double volatile& (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4081 base_f = 0;
4082 params = 0;
4083 base_f = new FVrCrC<T>( c, f );
4084 params = base_f;
4085 this->f = &fn;
4086 this->n = n;
4087 // just plausibly we could fail to allocate count: no further action needed.
4088 count = new size_t;
4089 *count = 1; // initially there is just one reference to f
4090 }
4091#endif
4092#ifndef DOXYGEN_SKIP
4099 template<typename T> function( T& c, double const volatile& (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4100 base_f = 0;
4101 params = 0;
4102 base_f = new FCrcrC<T>( c, f );
4103 params = base_f;
4104 this->f = &fn;
4105 this->n = n;
4106 // just plausibly we could fail to allocate count: no further action needed.
4107 count = new size_t;
4108 *count = 1; // initially there is just one reference to f
4109 }
4116 template<typename T> function( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4117 base_f = 0;
4118 params = 0;
4119 base_f = new FCrCrC<T>( c, f );
4120 params = base_f;
4121 this->f = &fn;
4122 this->n = n;
4123 // just plausibly we could fail to allocate count: no further action needed.
4124 count = new size_t;
4125 *count = 1; // initially there is just one reference to f
4126 }
4127#endif
4128 // Copy and move constructors
4129 // copy constructor
4134 function( function const& v ) : base_f( v.base_f ), count( v.count ){
4135 f = v.f;
4136 n = v.n;
4137 params = v.params;
4138 if( count != 0 ) ++*count; // function is now shared.
4139 }
4140 // assignment operator
4146 // first, possibly delete anything pointed to by this
4147 if( count == 0 or --*count == 0 ){
4148 delete base_f;
4149 delete count;
4150 }
4151 // Then copy
4152 base_f = v.base_f;
4153 f = v.f;
4154 n = v.n;
4155 params = v.params;
4156 count = v.count;
4157 if( count != 0 ) ++*count; // function is now shared.
4158 return *this;
4159 }
4160#ifdef __GXX_EXPERIMENTAL_CXX0X__
4165 function( function&& v ) : base_f( v.base_f ), count( nullptr ){
4166 std::swap( f, v.f );
4167 std::swap( n, v.n );
4168 std::swap( params, v.params );
4169 std::swap( count, v.count );
4170 v.base_f = nullptr;
4171 }
4178 std::swap( base_f, v.base_f );
4179 std::swap( f, v.f );
4180 std::swap( n, v.n );
4181 std::swap( params, v.params );
4182 std::swap( count, v.count );
4183 return *this;
4184 }
4185#endif
4190 // first, possibly delete anything pointed to by base_f
4191 if( count == 0 or --*count == 0 ){
4192 delete base_f;
4193 delete count;
4194 }
4195 }
4196 private:
4205 static double fn( gsl_vector const* x, void* params ){
4206 base_F* const b = reinterpret_cast<base_F*>( params );
4207 return b->function()( x, params );
4208 }
4209 };
4216 template<typename T>
4217 inline function make_function( T& c, double (T::*f)(gsl::vector const&) , size_t const n ){
4218 function fn( c, f, n );
4219#ifdef __GXX_EXPERIMENTAL_CXX0X__
4220 return std::move( fn );
4221#else
4222 return fn;
4223#endif
4224 }
4231 template<typename T>
4232 inline function make_function( T& c, double (T::*f)(gsl::vector const volatile&) , size_t const n ){
4233 function fn( c, f, n );
4234#ifdef __GXX_EXPERIMENTAL_CXX0X__
4235 return std::move( fn );
4236#else
4237 return fn;
4238#endif
4239 }
4240#ifndef DOXYGEN_SKIP
4247 template<typename T>
4248 inline function make_function( T& c, double const (T::*f)(gsl::vector const&) , size_t const n ){
4249 function fn( c, f, n );
4250#ifdef __GXX_EXPERIMENTAL_CXX0X__
4251 return std::move( fn );
4252#else
4253 return fn;
4254#endif
4255 }
4262 template<typename T>
4263 inline function make_function( T& c, double const (T::*f)(gsl::vector const volatile&) , size_t const n ){
4264 function fn( c, f, n );
4265#ifdef __GXX_EXPERIMENTAL_CXX0X__
4266 return std::move( fn );
4267#else
4268 return fn;
4269#endif
4270 }
4271#endif
4272#ifndef DOXYGEN_SKIP
4279 template<typename T>
4280 inline function make_function( T& c, double& (T::*f)(gsl::vector const&) , size_t const n ){
4281 function fn( c, f, n );
4282#ifdef __GXX_EXPERIMENTAL_CXX0X__
4283 return std::move( fn );
4284#else
4285 return fn;
4286#endif
4287 }
4294 template<typename T>
4295 inline function make_function( T& c, double& (T::*f)(gsl::vector const volatile&) , size_t const n ){
4296 function fn( c, f, n );
4297#ifdef __GXX_EXPERIMENTAL_CXX0X__
4298 return std::move( fn );
4299#else
4300 return fn;
4301#endif
4302 }
4303#endif
4304#ifndef DOXYGEN_SKIP
4311 template<typename T>
4312 inline function make_function( T& c, double const& (T::*f)(gsl::vector const&) , size_t const n ){
4313 function fn( c, f, n );
4314#ifdef __GXX_EXPERIMENTAL_CXX0X__
4315 return std::move( fn );
4316#else
4317 return fn;
4318#endif
4319 }
4326 template<typename T>
4327 inline function make_function( T& c, double const& (T::*f)(gsl::vector const volatile&) , size_t const n ){
4328 function fn( c, f, n );
4329#ifdef __GXX_EXPERIMENTAL_CXX0X__
4330 return std::move( fn );
4331#else
4332 return fn;
4333#endif
4334 }
4335#endif
4336#ifndef DOXYGEN_SKIP
4343 template<typename T>
4344 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const&) , size_t const n ){
4345 function fn( c, f, n );
4346#ifdef __GXX_EXPERIMENTAL_CXX0X__
4347 return std::move( fn );
4348#else
4349 return fn;
4350#endif
4351 }
4358 template<typename T>
4359 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const volatile&) , size_t const n ){
4360 function fn( c, f, n );
4361#ifdef __GXX_EXPERIMENTAL_CXX0X__
4362 return std::move( fn );
4363#else
4364 return fn;
4365#endif
4366 }
4367#endif
4368#ifndef DOXYGEN_SKIP
4375 template<typename T>
4376 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const&) , size_t const n ){
4377 function fn( c, f, n );
4378#ifdef __GXX_EXPERIMENTAL_CXX0X__
4379 return std::move( fn );
4380#else
4381 return fn;
4382#endif
4383 }
4390 template<typename T>
4391 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) , size_t const n ){
4392 function fn( c, f, n );
4393#ifdef __GXX_EXPERIMENTAL_CXX0X__
4394 return std::move( fn );
4395#else
4396 return fn;
4397#endif
4398 }
4399#endif
4400#ifndef DOXYGEN_SKIP
4407 template<typename T>
4408 inline function make_function( T& c, double (T::*f)(gsl::vector const&) const, size_t const n ){
4409 function fn( c, f, n );
4410#ifdef __GXX_EXPERIMENTAL_CXX0X__
4411 return std::move( fn );
4412#else
4413 return fn;
4414#endif
4415 }
4422 template<typename T>
4423 inline function make_function( T& c, double (T::*f)(gsl::vector const volatile&) const, size_t const n ){
4424 function fn( c, f, n );
4425#ifdef __GXX_EXPERIMENTAL_CXX0X__
4426 return std::move( fn );
4427#else
4428 return fn;
4429#endif
4430 }
4431#endif
4432#ifndef DOXYGEN_SKIP
4439 template<typename T>
4440 inline function make_function( T& c, double const (T::*f)(gsl::vector const&) const, size_t const n ){
4441 function fn( c, f, n );
4442#ifdef __GXX_EXPERIMENTAL_CXX0X__
4443 return std::move( fn );
4444#else
4445 return fn;
4446#endif
4447 }
4454 template<typename T>
4455 inline function make_function( T& c, double const (T::*f)(gsl::vector const volatile&) const, size_t const n ){
4456 function fn( c, f, n );
4457#ifdef __GXX_EXPERIMENTAL_CXX0X__
4458 return std::move( fn );
4459#else
4460 return fn;
4461#endif
4462 }
4463#endif
4464#ifndef DOXYGEN_SKIP
4471 template<typename T>
4472 inline function make_function( T& c, double& (T::*f)(gsl::vector const&) const, size_t const n ){
4473 function fn( c, f, n );
4474#ifdef __GXX_EXPERIMENTAL_CXX0X__
4475 return std::move( fn );
4476#else
4477 return fn;
4478#endif
4479 }
4486 template<typename T>
4487 inline function make_function( T& c, double& (T::*f)(gsl::vector const volatile&) const, size_t const n ){
4488 function fn( c, f, n );
4489#ifdef __GXX_EXPERIMENTAL_CXX0X__
4490 return std::move( fn );
4491#else
4492 return fn;
4493#endif
4494 }
4495#endif
4496#ifndef DOXYGEN_SKIP
4503 template<typename T>
4504 inline function make_function( T& c, double const& (T::*f)(gsl::vector const&) const, size_t const n ){
4505 function fn( c, f, n );
4506#ifdef __GXX_EXPERIMENTAL_CXX0X__
4507 return std::move( fn );
4508#else
4509 return fn;
4510#endif
4511 }
4518 template<typename T>
4519 inline function make_function( T& c, double const& (T::*f)(gsl::vector const volatile&) const, size_t const n ){
4520 function fn( c, f, n );
4521#ifdef __GXX_EXPERIMENTAL_CXX0X__
4522 return std::move( fn );
4523#else
4524 return fn;
4525#endif
4526 }
4527#endif
4528#ifndef DOXYGEN_SKIP
4535 template<typename T>
4536 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const&) const, size_t const n ){
4537 function fn( c, f, n );
4538#ifdef __GXX_EXPERIMENTAL_CXX0X__
4539 return std::move( fn );
4540#else
4541 return fn;
4542#endif
4543 }
4550 template<typename T>
4551 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const volatile&) const, size_t const n ){
4552 function fn( c, f, n );
4553#ifdef __GXX_EXPERIMENTAL_CXX0X__
4554 return std::move( fn );
4555#else
4556 return fn;
4557#endif
4558 }
4559#endif
4560#ifndef DOXYGEN_SKIP
4567 template<typename T>
4568 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const&) const, size_t const n ){
4569 function fn( c, f, n );
4570#ifdef __GXX_EXPERIMENTAL_CXX0X__
4571 return std::move( fn );
4572#else
4573 return fn;
4574#endif
4575 }
4582 template<typename T>
4583 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) const, size_t const n ){
4584 function fn( c, f, n );
4585#ifdef __GXX_EXPERIMENTAL_CXX0X__
4586 return std::move( fn );
4587#else
4588 return fn;
4589#endif
4590 }
4591#endif
4592#ifndef DOXYGEN_SKIP
4599 template<typename T>
4600 inline function make_function( T& c, double (T::*f)(gsl::vector const&) volatile, size_t const n ){
4601 function fn( c, f, n );
4602#ifdef __GXX_EXPERIMENTAL_CXX0X__
4603 return std::move( fn );
4604#else
4605 return fn;
4606#endif
4607 }
4614 template<typename T>
4615 inline function make_function( T& c, double (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
4616 function fn( c, f, n );
4617#ifdef __GXX_EXPERIMENTAL_CXX0X__
4618 return std::move( fn );
4619#else
4620 return fn;
4621#endif
4622 }
4623#endif
4624#ifndef DOXYGEN_SKIP
4631 template<typename T>
4632 inline function make_function( T& c, double const (T::*f)(gsl::vector const&) volatile, size_t const n ){
4633 function fn( c, f, n );
4634#ifdef __GXX_EXPERIMENTAL_CXX0X__
4635 return std::move( fn );
4636#else
4637 return fn;
4638#endif
4639 }
4646 template<typename T>
4647 inline function make_function( T& c, double const (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
4648 function fn( c, f, n );
4649#ifdef __GXX_EXPERIMENTAL_CXX0X__
4650 return std::move( fn );
4651#else
4652 return fn;
4653#endif
4654 }
4655#endif
4656#ifndef DOXYGEN_SKIP
4663 template<typename T>
4664 inline function make_function( T& c, double& (T::*f)(gsl::vector const&) volatile, size_t const n ){
4665 function fn( c, f, n );
4666#ifdef __GXX_EXPERIMENTAL_CXX0X__
4667 return std::move( fn );
4668#else
4669 return fn;
4670#endif
4671 }
4678 template<typename T>
4679 inline function make_function( T& c, double& (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
4680 function fn( c, f, n );
4681#ifdef __GXX_EXPERIMENTAL_CXX0X__
4682 return std::move( fn );
4683#else
4684 return fn;
4685#endif
4686 }
4687#endif
4688#ifndef DOXYGEN_SKIP
4695 template<typename T>
4696 inline function make_function( T& c, double const& (T::*f)(gsl::vector const&) volatile, size_t const n ){
4697 function fn( c, f, n );
4698#ifdef __GXX_EXPERIMENTAL_CXX0X__
4699 return std::move( fn );
4700#else
4701 return fn;
4702#endif
4703 }
4710 template<typename T>
4711 inline function make_function( T& c, double const& (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
4712 function fn( c, f, n );
4713#ifdef __GXX_EXPERIMENTAL_CXX0X__
4714 return std::move( fn );
4715#else
4716 return fn;
4717#endif
4718 }
4719#endif
4720#ifndef DOXYGEN_SKIP
4727 template<typename T>
4728 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const&) volatile, size_t const n ){
4729 function fn( c, f, n );
4730#ifdef __GXX_EXPERIMENTAL_CXX0X__
4731 return std::move( fn );
4732#else
4733 return fn;
4734#endif
4735 }
4742 template<typename T>
4743 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
4744 function fn( c, f, n );
4745#ifdef __GXX_EXPERIMENTAL_CXX0X__
4746 return std::move( fn );
4747#else
4748 return fn;
4749#endif
4750 }
4751#endif
4752#ifndef DOXYGEN_SKIP
4759 template<typename T>
4760 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const&) volatile, size_t const n ){
4761 function fn( c, f, n );
4762#ifdef __GXX_EXPERIMENTAL_CXX0X__
4763 return std::move( fn );
4764#else
4765 return fn;
4766#endif
4767 }
4774 template<typename T>
4775 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) volatile, size_t const n ){
4776 function fn( c, f, n );
4777#ifdef __GXX_EXPERIMENTAL_CXX0X__
4778 return std::move( fn );
4779#else
4780 return fn;
4781#endif
4782 }
4783#endif
4784#ifndef DOXYGEN_SKIP
4791 template<typename T>
4792 inline function make_function( T& c, double (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4793 function fn( c, f, n );
4794#ifdef __GXX_EXPERIMENTAL_CXX0X__
4795 return std::move( fn );
4796#else
4797 return fn;
4798#endif
4799 }
4806 template<typename T>
4807 inline function make_function( T& c, double (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4808 function fn( c, f, n );
4809#ifdef __GXX_EXPERIMENTAL_CXX0X__
4810 return std::move( fn );
4811#else
4812 return fn;
4813#endif
4814 }
4815#endif
4816#ifndef DOXYGEN_SKIP
4823 template<typename T>
4824 inline function make_function( T& c, double const (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4825 function fn( c, f, n );
4826#ifdef __GXX_EXPERIMENTAL_CXX0X__
4827 return std::move( fn );
4828#else
4829 return fn;
4830#endif
4831 }
4838 template<typename T>
4839 inline function make_function( T& c, double const (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4840 function fn( c, f, n );
4841#ifdef __GXX_EXPERIMENTAL_CXX0X__
4842 return std::move( fn );
4843#else
4844 return fn;
4845#endif
4846 }
4847#endif
4848#ifndef DOXYGEN_SKIP
4855 template<typename T>
4856 inline function make_function( T& c, double& (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4857 function fn( c, f, n );
4858#ifdef __GXX_EXPERIMENTAL_CXX0X__
4859 return std::move( fn );
4860#else
4861 return fn;
4862#endif
4863 }
4870 template<typename T>
4871 inline function make_function( T& c, double& (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4872 function fn( c, f, n );
4873#ifdef __GXX_EXPERIMENTAL_CXX0X__
4874 return std::move( fn );
4875#else
4876 return fn;
4877#endif
4878 }
4879#endif
4880#ifndef DOXYGEN_SKIP
4887 template<typename T>
4888 inline function make_function( T& c, double const& (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4889 function fn( c, f, n );
4890#ifdef __GXX_EXPERIMENTAL_CXX0X__
4891 return std::move( fn );
4892#else
4893 return fn;
4894#endif
4895 }
4902 template<typename T>
4903 inline function make_function( T& c, double const& (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4904 function fn( c, f, n );
4905#ifdef __GXX_EXPERIMENTAL_CXX0X__
4906 return std::move( fn );
4907#else
4908 return fn;
4909#endif
4910 }
4911#endif
4912#ifndef DOXYGEN_SKIP
4919 template<typename T>
4920 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4921 function fn( c, f, n );
4922#ifdef __GXX_EXPERIMENTAL_CXX0X__
4923 return std::move( fn );
4924#else
4925 return fn;
4926#endif
4927 }
4934 template<typename T>
4935 inline function make_function( T& c, double volatile& (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4936 function fn( c, f, n );
4937#ifdef __GXX_EXPERIMENTAL_CXX0X__
4938 return std::move( fn );
4939#else
4940 return fn;
4941#endif
4942 }
4943#endif
4944#ifndef DOXYGEN_SKIP
4951 template<typename T>
4952 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const&) const volatile, size_t const n ){
4953 function fn( c, f, n );
4954#ifdef __GXX_EXPERIMENTAL_CXX0X__
4955 return std::move( fn );
4956#else
4957 return fn;
4958#endif
4959 }
4966 template<typename T>
4967 inline function make_function( T& c, double const volatile& (T::*f)(gsl::vector const volatile&) const volatile, size_t const n ){
4968 function fn( c, f, n );
4969#ifdef __GXX_EXPERIMENTAL_CXX0X__
4970 return std::move( fn );
4971#else
4972 return fn;
4973#endif
4974 }
4975#endif
4976
4977 }
4978}
4979
4980#endif
Class that extends gsl_multimin_function so that it can be constructed from arbitrary function object...
function(double(*const f)(gsl::vector const volatile &), size_t const n)
Construct from a function.
function(T &c, double(T::*f)(gsl::vector const volatile &), size_t const n)
Construct from a function object and a suitable member function.
function & operator=(function const &v)
The assignment operator.
function(function &&v)
Move constructor.
function & operator=(function &&v)
Move operator.
function(double(*const f)(gsl::vector const &), size_t const n)
Construct from a function.
~function()
The destructor unshares any shared resource.
function()
The default constructor is only really useful for assigning to.
function(T &c, double(T::*f)(gsl::vector const &), size_t const n)
Construct from a function object and a suitable member function.
static double fn(gsl_vector const *x, void *params)
This is the function that gsl_multimin_function points to if function is constructed from a function ...
function(function const &v)
The copy constructor.
size_t * count
The shared reference count.
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 n)
Make a gsl::multimin::function from a function object and a suitable member function.
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
Definition: rstat.hpp:299
double b(int order, double qq)
C++ version of gsl_sf_mathieu_b().
Definition: sf_mathieu.hpp:298
The gsl package creates an interface to the GNU Scientific Library for C++.
Definition: blas.hpp:34