Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
interpolate.hh
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 numeric/interpolate.hh
11 /// @author Christopher Miles (cmiles@uw.edu)
12 
13 #ifndef INCLUDED_NUMERIC_INTERPOLATE_hh
14 #define INCLUDED_NUMERIC_INTERPOLATE_hh
15 
16 namespace numeric {
17 
18 /// @brief Linearly interpolates a quantity from start to stop over (num_stages + 1) stages
19 template <class Value>
20 double linear_interpolate(Value start, Value stop, unsigned curr_stage, unsigned num_stages) {
21  return start + curr_stage * (stop - start) / num_stages;
22 }
23 
24 } // namespace numeric
25 
26 #endif // INCLUDED_NUMERIC_PROB_UTIL_hh
double linear_interpolate(Value start, Value stop, unsigned curr_stage, unsigned num_stages)
Linearly interpolates a quantity from start to stop over (num_stages + 1) stages. ...
Definition: interpolate.hh:20
Config::Value_type Value