diff --git a/conanfile.txt b/conanfile.txt index e2763c275..703260a39 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -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 diff --git a/src/cpp/lib/DecayRate.cpp b/src/cpp/lib/DecayRate.cpp deleted file mode 100644 index 3e5603d21..000000000 --- a/src/cpp/lib/DecayRate.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "DecayRate.h" - -#include -#include - -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); -} \ No newline at end of file diff --git a/src/cpp/lib/DecayRate.h b/src/cpp/lib/DecayRate.h deleted file mode 100644 index a66a68486..000000000 --- a/src/cpp/lib/DecayRate.h +++ /dev/null @@ -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 \ No newline at end of file