Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FuncFactory.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/scoring/constraints/FuncFactory.cc
11 /// @brief Factory for creating various types of constraints.
12 /// @author Greg Taylor <gktaylor@u.washington.edu>
13 
14 // Unit headers
17 
18 // Package headers
42 
43 #include <utility/exit.hh>
44 #include <utility/pointer/owning_ptr.hh>
45 #include <utility/pointer/ReferenceCount.hh>
46 #include <utility/vector1.hh>
47 
48 using namespace core::scoring::constraints;
49 
50 void FuncFactory::add_type( std::string type_name, FuncOP new_func ) {
51  func_types_[ type_name ] = new_func;
52 }
53 
55  FuncTypes::const_iterator iter = func_types_.find( type );
56  if ( iter != func_types_.end() ) {
57  return iter->second->clone();
58  } else {
59  utility_exit_with_message("FuncFactory: unknown constraint function type: " + type );
60  return NULL;
61  }
62 }
63 
64 // initialization of functions which this factory knows how to instantiate
66  FuncFactory::add_type( "HARMONIC", new HarmonicFunc(0,0) );
67  FuncFactory::add_type( "SIGMOID", new SigmoidFunc(0,1) );
68  FuncFactory::add_type( "CIRCULARHARMONIC", new CircularHarmonicFunc(0,0) );
69  FuncFactory::add_type( "MIXTUREFUNC", new MixtureFunc(0,0,0,0,0,0) );
70  FuncFactory::add_type( "SCALARWEIGHTEDFUNC", new ScalarWeightedFunc(0,0) );
71  FuncFactory::add_type( "COUNTVIOLFUNC", new CountViolFunc(0,0) );
72  FuncFactory::add_type( "SKIPVIOLFUNC", new SkipViolFunc(0,0) );
73  FuncFactory::add_type( "GAUSSIANFUNC", new GaussianFunc(0,0) );
74  FuncFactory::add_type( "CONSTANTFUNC", new ConstantFunc(0.) );
75  FuncFactory::add_type( "BOUNDED", new BoundFunc(0,0,0,"dummy") );
76  FuncFactory::add_type( "PERIODICBOUNDED", new PeriodicBoundFunc(0,0,0,"dummy",6.28) );
77  FuncFactory::add_type( "OFFSETPERIODICBOUNDED", new OffsetPeriodicBoundFunc(0,0,0,"dummy",6.28,0.0) );
78  FuncFactory::add_type( "SUMFUNC", new SumFunc() );
79  FuncFactory::add_type( "SOGFUNC", new SOGFunc() );
80  FuncFactory::add_type( "USOGFUNC", new USOGFunc() );
81  FuncFactory::add_type( "SOEDINGFUNC", new SoedingFunc() );
82  FuncFactory::add_type( "SPLINE", new SplineFunc() );
83  FuncFactory::add_type( "SQUARE_WELL", new SquareWellFunc(0,0) );
84  FuncFactory::add_type( "SQUARE_WELL2", new SquareWell2Func(0,0,0) );
85  FuncFactory::add_type( "FADE", new FadeFunc(0,0,0) );
86  FuncFactory::add_type( "LINEAR_PENALTY", new LinearPenaltyFunction(0,0,0,0) );
87  FuncFactory::add_type( "KARPLUS", new KarplusFunc(6.98,-1.38,1.72,-1.05,0,0,0));
88  FuncFactory::add_type( "IDENTITY", new IdentityFunc() );
89  FuncFactory::add_type( "FLAT_HARMONIC", new FlatHarmonicFunc( 0, 0, 0 ) );
90  FuncFactory::add_type( "TOPOUT", new TopOutFunc( 0, 0, 0 ) );
91 }