00001
00002
00003
00004
00005
00006
00007 #ifndef IMPCORE_LINEAR_H
00008 #define IMPCORE_LINEAR_H
00009
00010 #include "core_config.h"
00011 #include <IMP/UnaryFunction.h>
00012
00013 IMPCORE_BEGIN_NAMESPACE
00014
00015
00016
00017
00018
00019 class Linear : public UnaryFunction
00020 {
00021 public:
00022
00023 Linear(double offset, double slope) : slope_(slope), offset_(offset) {}
00024
00025 IMP_UNARY_FUNCTION_INLINE(Linear,
00026 (feature-offset_)*slope_,
00027 slope_,
00028 "Linear: " << slope_ << ", " << offset_
00029 << std::endl);
00030 void set_slope(double f) {
00031 slope_=f;
00032 }
00033
00034 void set_offset(double f) {
00035 offset_=f;
00036 }
00037
00038 private:
00039 double slope_, offset_;
00040 };
00041
00042 IMPCORE_END_NAMESPACE
00043
00044 #endif