mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove incomplete mpfr binding
This commit is contained in:
parent
05d3384216
commit
da0c77827f
@ -3,7 +3,6 @@ Poco/1.9.4@pocoproject/stable
|
||||
libsodium/1.0.18@bincrafters/stable
|
||||
boost/1.71.0@conan/stable
|
||||
gtest/1.8.1@bincrafters/stable
|
||||
mpfr/4.1.0
|
||||
|
||||
[generators]
|
||||
cmake
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
#include "DecayRate.h"
|
||||
|
||||
#include <gmp.h>
|
||||
#include <mpfr.h>
|
||||
|
||||
DecayRate::DecayRate()
|
||||
: mDecayRate(0.0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DecayRate::~DecayRate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DecayRate::calculateDecayRate(int daysPerYear/* = 356*/, Profiler* time/* = nullptr*/)
|
||||
{
|
||||
|
||||
mpfr_t capital_n_log; mpfr_init(capital_n_log);
|
||||
mpfr_t capital_0_log; mpfr_init(capital_0_log);
|
||||
mpfr_t capital_diff; mpfr_init(capital_diff);
|
||||
mpfr_t decay_rate_per_second; mpfr_init(decay_rate_per_second);
|
||||
mpfr_t seconds_per_year;
|
||||
mpfr_t days_per_year;
|
||||
mpfr_init_set_ui(days_per_year, daysPerYear, MPFR_RNDN);
|
||||
mpfr_init(seconds_per_year);
|
||||
/*
|
||||
typedef enum {
|
||||
MPFR_RNDN=0, // round to nearest, with ties to even
|
||||
MPFR_RNDZ, // round toward zero
|
||||
MPFR_RNDU, // round toward +Inf
|
||||
MPFR_RNDD, // round toward -Inf
|
||||
MPFR_RNDA, // round away from zero
|
||||
MPFR_RNDF, // faithful rounding
|
||||
MPFR_RNDNA = -1 // round to nearest, with ties away from zero (mpfr_round)
|
||||
} mpfr_rnd_t;
|
||||
|
||||
*/
|
||||
//mpfr_rnd_t
|
||||
// seconds per year = 60*60*24*daysPerYear
|
||||
mpfr_mul_ui(seconds_per_year, days_per_year, 60 * 60 * 24, MPFR_RNDN);
|
||||
|
||||
mpfr_log_ui(capital_n_log, 50, MPFR_RNDN);
|
||||
mpfr_log_ui(capital_0_log, 100, MPFR_RNDN);
|
||||
mpfr_sub(capital_diff, capital_n_log, capital_0_log, MPFR_RNDN);
|
||||
mpfr_div(decay_rate_per_second, capital_diff, seconds_per_year, MPFR_RNDN);
|
||||
mDecayRate = mpfr_get_d(decay_rate_per_second, MPFR_RNDN);
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
#ifndef __GRADIDO_LOGIN_SERVER_LIB_INTEREST_RATE_H
|
||||
#define __GRADIDO_LOGIN_SERVER_LIB_INTEREST_RATE_H
|
||||
|
||||
/*!
|
||||
* @author: Dario Rekowski
|
||||
*
|
||||
* @date: 2020-11-24
|
||||
*
|
||||
* @brief: to calculate interest rate for gradido and maybe also decay
|
||||
*/
|
||||
|
||||
#include "Poco/Types.h"
|
||||
#include "Profiler.h"
|
||||
|
||||
class DecayRate
|
||||
{
|
||||
public:
|
||||
DecayRate();
|
||||
~DecayRate();
|
||||
|
||||
void calculateDecayRate(int daysPerYear = 356, Profiler* time = nullptr);
|
||||
inline double getDecayRate() { return mDecayRate; }
|
||||
|
||||
protected:
|
||||
double mDecayRate;
|
||||
};
|
||||
|
||||
#endif //__GRADIDO_LOGIN_SERVER_LIB_INTEREST_RATE_H
|
||||
Loading…
x
Reference in New Issue
Block a user