diff options
-rw-r--r-- | example/Makefile | 21 | ||||
-rw-r--r-- | vmodels/nfw.hpp | 50 |
2 files changed, 62 insertions, 9 deletions
diff --git a/example/Makefile b/example/Makefile index c14fb22..9f2203b 100644 --- a/example/Makefile +++ b/example/Makefile @@ -16,6 +16,9 @@ SUFFIXES = .SUFFIXES: .hpux_make_needs_suffix_list +# Produce verbose output by default. +VERBOSE = 1 + # Suppress display of executed commands. $(VERBOSE).SILENT: @@ -42,7 +45,7 @@ CMAKE_EDIT_COMMAND = /usr/bin/ccmake CMAKE_SOURCE_DIR = /home/astrojhgu/src/opt_utilities # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/astrojhgu/src/opt_utilities +CMAKE_BINARY_DIR = /home/public/src/opt_utilities #============================================================================= # Targets provided globally by CMake. @@ -69,14 +72,14 @@ rebuild_cache/fast: rebuild_cache # The main all target all: cmake_check_build_system - cd /home/astrojhgu/src/opt_utilities && $(CMAKE_COMMAND) -E cmake_progress_start /home/astrojhgu/src/opt_utilities/CMakeFiles /home/astrojhgu/src/opt_utilities/example/CMakeFiles/progress.make - cd /home/astrojhgu/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/astrojhgu/src/opt_utilities/CMakeFiles 0 + cd /home/public/src/opt_utilities && $(CMAKE_COMMAND) -E cmake_progress_start /home/public/src/opt_utilities/CMakeFiles /home/public/src/opt_utilities/example/CMakeFiles/progress.make + cd /home/public/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/public/src/opt_utilities/CMakeFiles 0 .PHONY : all # The main clean target clean: - cd /home/astrojhgu/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/clean + cd /home/public/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/clean .PHONY : clean # The main clean target @@ -85,17 +88,17 @@ clean/fast: clean # Prepare targets for installation. preinstall: all - cd /home/astrojhgu/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/preinstall + cd /home/public/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/preinstall .PHONY : preinstall # Prepare targets for installation. preinstall/fast: - cd /home/astrojhgu/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/preinstall + cd /home/public/src/opt_utilities && $(MAKE) -f CMakeFiles/Makefile2 example/preinstall .PHONY : preinstall/fast # clear depends depend: - cd /home/astrojhgu/src/opt_utilities && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 + cd /home/public/src/opt_utilities && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 .PHONY : depend # Help Target @@ -117,6 +120,6 @@ help: # No rule that depends on this can have commands that come from listfiles # because they might be regenerated. cmake_check_build_system: - cd /home/astrojhgu/src/opt_utilities && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 + cd /home/public/src/opt_utilities && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 .PHONY : cmake_check_build_system diff --git a/vmodels/nfw.hpp b/vmodels/nfw.hpp new file mode 100644 index 0000000..3e4264f --- /dev/null +++ b/vmodels/nfw.hpp @@ -0,0 +1,50 @@ +#ifndef NFW_MODEL_H_ +#define NFW_MODEL_H_ +#define OPT_HEADER +#include <core/fitter.hpp> +#include <cmath> +#include <misc/optvec.hpp> + +namespace opt_utilities +{ + template <typename T> + class nfw + :public model<optvec<T>,optvec<T>,optvec<T>,std::string> + { + private: + nfw* do_clone()const + { + return new nfw<T>(*this); + } + + const char* do_get_type_name()const + { + return "nfw mass profile"; + } + public: + nfw() + { + this->push_param_info(param_info<optvec<T> >("rho0",1)); + this->push_param_info(param_info<optvec<T> >("rs",1)); + } + + optvec<T> do_eval(const optvec<T>& x,const optvec<T>& param) + { + T rho0=get_element(param,0); + T rs=get_element(param,1); + return rho0/(x/rs*(x/rs+T(1))*(x/rs+T(1))); + } + + private: + std::string do_get_information()const + { + return "NFW mass profile\n" + "y=rho0/(x/rs*(1+x/rs)^2)\n"; + } + }; +} + + + +#endif +//EOF |