Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/double_util.c')
-rw-r--r--src/double_util.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/double_util.c b/src/double_util.c
new file mode 100644
index 0000000..a4b5949
--- /dev/null
+++ b/src/double_util.c
@@ -0,0 +1,30 @@
+/*
+Copyright 2016 Ian Jauslin
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+#include "double_util.h"
+#include <mpfr.h>
+
+// convert hh_params
+int hh_params_todouble(hh_params_double* params_double, hh_params params){
+ params_double->omega=params.omega;
+ params_double->t1=mpfr_get_ld(params.t1, MPFR_RNDN);
+ params_double->t2=mpfr_get_ld(params.t2, MPFR_RNDN);
+ params_double->lambda=mpfr_get_ld(params.lambda, MPFR_RNDN);
+ params_double->sinphi=mpfr_get_ld(params.sinphi, MPFR_RNDN);
+ params_double->phi=mpfr_get_ld(params.phi, MPFR_RNDN);
+ params_double->W=mpfr_get_ld(params.W, MPFR_RNDN);
+ return(0);
+}