00001 /** 00002 * \file AttributeSingletonScore.h 00003 * \brief A score based on the unmodified value of an attribute. 00004 * 00005 * Copyright 2007-2010 IMP Inventors. All rights reserved. 00006 */ 00007 00008 #ifndef IMPCORE_ATTRIBUTE_SINGLETON_SCORE_H 00009 #define IMPCORE_ATTRIBUTE_SINGLETON_SCORE_H 00010 00011 #include "core_config.h" 00012 #include <IMP/SingletonScore.h> 00013 #include <IMP/Pointer.h> 00014 #include <IMP/UnaryFunction.h> 00015 00016 IMPCORE_BEGIN_NAMESPACE 00017 00018 //! Apply a function to an attribute. 00019 /** This Score scores a particle by passing an attribute value directly 00020 to a UnaryFunction. 00021 */ 00022 class IMPCOREEXPORT AttributeSingletonScore : public SingletonScore 00023 { 00024 IMP::internal::OwnerPointer<UnaryFunction> f_; 00025 FloatKey k_; 00026 public: 00027 //! Apply function f to attribete k 00028 AttributeSingletonScore(UnaryFunction *f, FloatKey k); 00029 IMP_SIMPLE_SINGLETON_SCORE(AttributeSingletonScore); 00030 }; 00031 00032 IMPCORE_END_NAMESPACE 00033 00034 #endif /* IMPCORE_ATTRIBUTE_SINGLETON_SCORE_H */