Commit 65298e8b authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Merge to keep history for both parts of C/Fortran glue code.

parents f821c41e e961f96f
......@@ -56,6 +56,7 @@ libscalesppm_la_SOURCES=ppm/scales_ppm.f90 \
ppm/ppm_set_partition_base.f90 \
ppm/ppm_set_partition_base.h \
ppm/ppm_set_partition_base_c.c \
ppm/ppm_set_partition_base_cf.c \
solver/solver_public.f90 \
solver/solver_internal.f90 \
solver/solver_config.f90 \
......@@ -83,7 +84,9 @@ libscalesppm_la_SOURCES=ppm/scales_ppm.f90 \
core/ppm_math_extensions.f90 \
core/ppm_real_sp_dp_edit_descriptor.f90 \
core/ppm_math_extensions_c.c \
core/ppm_math_extensions_cf.c \
core/ppm_math_extensions_ddp_c.c \
core/ppm_math_extensions_ddp_cf.c \
core/ppm_math_extensions.h \
core/ppm_math_extensions_internal.f90 \
core/ppm_fpu_underflow.h \
......@@ -95,8 +98,10 @@ libscalesppm_la_SOURCES=ppm/scales_ppm.f90 \
core/ppm_irand_internal.f90 \
core/ppm_random.f90 \
core/ppm_random.h \
core/ppm_random_cf.c \
core/ppm_random_c.c \
core/ppm_omp_assign.h \
core/ppm_random_mt_cf.c \
core/ppm_random_mt_c.c \
core/ppm_f90_io_lun.f90 \
core/ppm_strio.f90 \
......@@ -162,6 +167,7 @@ EXTRA_libscalesppm_la_SOURCES = ppm/ppm_graph_partition_mpi.f90 \
core/ppm_extents_mp.f90 \
core/ppm_ncdf_dump.f90 core/ppm_ncdf_dump_wrappers.f90 \
core/errhandler.c core/errhandler.h \
core/errhandler_cf.c \
crypto/md5.c crypto/md5.h \
core/ppm_std_type_kinds_mp_c.c \
core/ppm_std_type_kinds_mp.h \
......@@ -279,13 +285,16 @@ endif
libscalesppm_la_SOURCES += \
core/errhandler.c \
core/errhandler_cf.c \
core/errhandler.h \
core/ppm_xmpi.c \
core/ppm_extents_mp.f90 \
core/ppm_extents_mp_c.c \
core/ppm_extents_mp_cf.c \
core/ppm_extents_mp.h \
core/ppm_std_type_kinds_mp.f90 \
core/ppm_std_type_kinds_mp_c.c \
core/ppm_std_type_kinds_mp_cf.c \
core/ppm_std_type_kinds_mp.h \
core/ppm_math_extensions_ddp_mp_c.c \
\
......
/**
* errhandler_cf.c --- install abort(2) as MPI error handler to yield a
* core file which can be inspected with a
* debugger, Fortran wrapper function
*
*
* Copyright (C) 2021 Thomas Jahns <jahns@dkrz.de>
*
* Version: 1.0
* Keywords:
* Author: Thomas Jahns <jahns@dkrz.de>
* Maintainer: Thomas Jahns <jahns@dkrz.de>
* URL: https://www.dkrz.de/redmine/projects/scales-ppm
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the DKRZ GmbH nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <mpi.h>
#include "errhandler.h"
#include "cfortran.h"
static void
PPM_set_mpi_abort_handler_f(MPI_Fint *comm_f)
{
#ifdef USE_MPI
MPI_Comm comm_c = MPI_Comm_f2c((MPI_Fint)*comm_f);
#else
MPI_Comm comm_c = *comm_f;
#endif
PPM_set_mpi_abort_handler(comm_c);
}
FCALLSCSUB1(PPM_set_mpi_abort_handler_f, PPM_SET_MPI_ABORT_HANDLER,
ppm_set_mpi_abort_handler, PVOID)
/*
* Local Variables:
* license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm"
* license-default: "bsd"
* End:
*/
/**
* @file ppm_extents_mp_cf.c --- build MPI datatype for PPM_extent
* struct, Fortran wrapper
*
* @copyright (C) 2021 Thomas Jahns <jahns@dkrz.de>
*
* @author Thomas Jahns <jahns@dkrz.de>
*/
/*
* Maintainer: Thomas Jahns <jahns@dkrz.de>
* URL: https://www.dkrz.de/redmine/projects/scales-ppm
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the DKRZ GmbH nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define FCALLSC_QUALIFIER PPM_DSO_INTERNAL
#include "cfortran.h"
#include "core/ppm_visibility.h"
#include "core/ppm_extents_mp.h"
FCALLSCSUB0(PPM_create_extents_mp,PPM_CREATE_EXTENTS_MP,ppm_create_extents_mp)
FCALLSCSUB0(PPM_destroy_extents_mp,PPM_DESTROY_EXTENTS_MP,
ppm_destroy_extents_mp)
/*
* Local Variables:
* license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm"
* license-default: "bsd"
* End:
*/
/*
* @file ppm_math_extensions_cf.c
* @brief Fortran wrapper for ppm_math_extensions
*
* Copyright (C) 2012 Thomas Jahns <jahns@dkrz.de>
*
* @version 1.0
* Keywords:
* @author Thomas Jahns <jahns@dkrz.de>
* Maintainer: Thomas Jahns <jahns@dkrz.de>
* URL: https://www.dkrz.de/redmine/projects/scales-ppm
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the DKRZ GmbH nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Commentary:
*
*
*
* Code:
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <inttypes.h>
#include <math.h>
#include "ppm_math_extensions.h"
#include "cfortran.h"
static inline void
PPM_fpu_save_cw_f(int *fpu_cw)
{
PPM_fpu_save_cw((uint32_t *)fpu_cw);
}
FCALLSCSUB1(PPM_fpu_save_cw_f,PPM_FPU_SAVE_CW,ppm_fpu_save_cw,PINT)
static inline void
PPM_fpu_set_precision_f(int fpu_precision, int *old_fpu_cw)
{
PPM_fpu_set_precision((enum precision)fpu_precision, (uint32_t *)old_fpu_cw);
}
FCALLSCSUB2(PPM_fpu_set_precision_f,PPM_FPU_SET_PRECISION_C,ppm_fpu_set_precision_c,INT,PINT)
static inline void
PPM_fpu_restore_cw_f(const int fpu_cw)
{
PPM_fpu_restore_cw((uint32_t)fpu_cw);
}
FCALLSCSUB1(PPM_fpu_restore_cw_f,PPM_FPU_RESTORE_CW,ppm_fpu_restore_cw,INT)
static inline void
PPM_fpu_set_abrupt_underflow_f(int *old_mxcsr, int abrupt_underflow)
{
PPM_fpu_set_abrupt_underflow((uint32_t *)old_mxcsr, abrupt_underflow);
}
FCALLSCSUB2(PPM_fpu_set_abrupt_underflow_f,PPM_FPU_SET_APRUPT_UNDERFLOW_C,
ppm_fpu_set_abrupt_underflow_c,PINT,LOGICAL)
static inline void
PPM_fpu_save_mxcsr_f(int *old_mxcsr)
{
PPM_fpu_save_mxcsr((uint32_t *)old_mxcsr);
}
FCALLSCSUB1(PPM_fpu_save_mxcsr_f,PPM_FPU_SAVE_MXCSR,
ppm_fpu_save_mxcsr,PINT)
static inline void
PPM_fpu_restore_mxcsr_f(int old_mxcsr)
{
PPM_fpu_restore_mxcsr((uint32_t)old_mxcsr);
}
FCALLSCSUB1(PPM_fpu_restore_mxcsr_f,PPM_FPU_RESTORE_MXCSR,
ppm_fpu_restore_mxcsr,INT)
static inline void
PPM_assign_nan_dp(double *v)
{
*v = NAN;
}
FCALLSCSUB1(PPM_assign_nan_dp,PPM_PPM_ASSIGN_NAN_DP,
ppm_assign_nan_dp,PDOUBLE)
static inline void
PPM_assign_nan_sp(float *v)
{
*v = NAN;
}
FCALLSCSUB1(PPM_assign_nan_sp,PPM_PPM_ASSIGN_NAN_SP,
ppm_assign_nan_sp,PFLOAT)
/*
* Local Variables:
* license-markup: "doxygen"
* license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm"
* license-default: "bsd"
* End:
*/
/**
* @file ppm_math_extensions_cf.c
* @brief Fortran wrappers for ppm_math_extensions
* DDP summation functionality
*
* Copyright (C) 2012 Thomas Jahns <jahns@dkrz.de>
*
* @version 1.0
* Keywords:
* @author Thomas Jahns <jahns@dkrz.de>
* Maintainer: Thomas Jahns <jahns@dkrz.de>
* URL: https://www.dkrz.de/redmine/projects/scales-ppm
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the DKRZ GmbH nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <inttypes.h>
#include <complex.h>
#include "ppm_math_extensions.h"
#include "cfortran.h"
static inline void
PPM_ddp_sum_dp_f2c(int n, const double *a, double *s)
{
*(double complex *)s = PPM_ddp_sum_dp((size_t)n, a);
}
FCALLSCSUB3(PPM_ddp_sum_dp_f2c,PPM_DDP_SUM_DP,ppm_ddp_sum_dp,
INT,DOUBLEV,DOUBLEV)
static inline void
PPM_ddp_add_dp_dp_f2c(double a, double b, double *s)
{
*(double complex *)s = PPM_ddp_add_dp_dp(a, b);
}
FCALLSCSUB3(PPM_ddp_add_dp_dp_f2c,PPM_DDP_ADD_DP_DP,ppm_ddp_add_dp_dp,
DOUBLE,DOUBLE,DOUBLEV)
static inline void
PPM_ddp_add_ddp_ddp_f2c(const double *a, const double *b, double *s)
{
*(double complex *)s
= PPM_ddp_add_ddp_ddp(*(double complex *)a, *(double complex *)b);
}
FCALLSCSUB3(PPM_ddp_add_ddp_ddp_f2c,PPM_DDP_ADD_DDP_DDP,ppm_ddp_add_ddp_ddp,
DOUBLEV,DOUBLEV,DOUBLEV)
/*
* Local Variables:
* license-markup: "doxygen"
* license-project-url: "https://www.dkrz.de/redmine/projects/scales-ppm"
* license-default: "bsd"
* End:
*/
/**
* @file ppm_random_cf.c
* @brief Fortran wrapper code for PRNG
*
* @copyright Copyright (C) 2021 Thomas Jahns <jahns@dkrz.de>
*
* @version 1.0
* @author Thomas Jahns <jahns@dkrz.de>
*/
/*
* Keywords:
* Maintainer: Thomas Jahns <jahns@dkrz.de>
* URL: https://www.dkrz.de/redmine/projects/scales-ppm
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the DKRZ GmbH nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <assert.h>
#include "cfortran.h"
#ifdef INT64_T_IS_LONG_LONG
#define INT64 LONGLONG
#define INT64V LONGLONGV
#define INT64VV LONGLONGVV
#define INT64VVV LONGLONGVVV
#elif defined INT64_T_IS_LONG
#define INT64 LONG
#define INT64V LONGV
#define INT64VV LONGVV
#define INT64VVV LONGVVV
#endif
#include "ppm_random.h"
FCALLSCFUN0(INT,PPM_irand,PPM_IRAND,ppm_irand)
FCALLSCFUN0(INT,PPM_irandp,PPM_IRANDP,ppm_irandp)
static inline int
PPM_irandr_f(struct PPM_iinterval *range)
{
return PPM_irandr(*range);
}
FCALLSCFUN1(INT,PPM_irandr_f,PPM_IRANDR,ppm_irandr,PVOID)
static inline void
PPM_irand_a_f(int *a, int n)
{
assert(n >= 0);
PPM_irand_a(a, (size_t)n);
}
FCALLSCSUB2(PPM_irand_a_f,PPM_IRAND_A,ppm_irand_a,INTV,INT)
FCALLSCSUB2(PPM_irand_a_f,PPM_IRAND_A_2D,ppm_irand_a_2d,INTVV,INT)
FCALLSCSUB2(PPM_irand_a_f,PPM_IRAND_A_3D,ppm_irand_a_3d,INTVVV,INT)
static inline void
PPM_irandp_a_f(int *a, int n)
{
assert(n >= 0);
PPM_irandp_a(a, (size_t)n);
}
FCALLSCSUB2(PPM_irandp_a_f,PPM_IRANDP_A,ppm_irandp_a,INTV,INT)
FCALLSCSUB2(PPM_irandp_a_f,PPM_IRANDP_A_2D,ppm_irandp_a_2d,INTVV,INT)
FCALLSCSUB2(PPM_irandp_a_f,PPM_IRANDP_A_3D,ppm_irandp_a_3d,INTVVV,INT)
static inline void
PPM_irandr_a_f(int *a, int n, struct PPM_iinterval *range)
{
assert(n >= 0);
PPM_irandr_a(a, (size_t)n, *range);
}
FCALLSCSUB3(PPM_irandr_a_f,PPM_IRANDR_A,ppm_irandr_a,INTV,INT,PVOID)
FCALLSCSUB3(PPM_irandr_a_f,PPM_IRANDR_A_2D,ppm_irandr_a_2d,INTVV,INT,PVOID)
FCALLSCSUB3(PPM_irandr_a_f,PPM_IRANDR_A_3D,ppm_irandr_a_3d,INTVVV,INT,PVOID)
FCALLSCFUN0(INT64,PPM_irand8,PPM_IRAND8,ppm_irand8)
FCALLSCFUN0(INT64,PPM_irandp8,PPM_IRANDP8,ppm_irandp8)
static inline int64_t
PPM_irandr8_f(struct PPM_iinterval64 *range)
{
return PPM_irandr8(*range);
}
FCALLSCFUN1(INT64,PPM_irandr8_f,PPM_IRANDR8,ppm_irandr8,PVOID)
static inline void
PPM_irand8_a_f(int64_t *a, int n)
{
assert(n >= 0);
PPM_irand8_a(a, (size_t)n);
}
FCALLSCSUB2(PPM_irand8_a_f,PPM_IRAND8_A,ppm_irand8_a,INT64V,INT)
FCALLSCSUB2(PPM_irand8_a_f,PPM_IRAND8_A_2D,ppm_irand8_a_2d,INT64VV,INT)
FCALLSCSUB2(PPM_irand8_a_f,PPM_IRAND8_A_3D,ppm_irand8_a_3d,INT64VVV,INT)
static inline void
PPM_irandp8_a_f(int64_t *a, int n)
{
assert(n >= 0);
PPM_irandp8_a(a, (size_t)n);
}
FCALLSCSUB2(PPM_irandp8_a_f,PPM_IRANDP8_A,ppm_irandp8_a,INT64V,INT)
FCALLSCSUB2(PPM_irandp8_a_f,PPM_IRANDP8_A_2D,ppm_irandp8_a_2d,INT64VV,INT)
FCALLSCSUB2(PPM_irandp8_a_f,PPM_IRANDP8_A_3D,ppm_irandp8_a_3d,INT64VVV,INT)
static inline void
PPM_irandr8_a_f(int64_t *a, int n, struct PPM_iinterval64 *range)
{
assert(n >= 0);
PPM_irandr8_a(a, (size_t)n, *range);
}
FCALLSCSUB3(PPM_irandr8_a_f,PPM_IRANDR8_A,ppm_irandr8_a,INT64V,INT,PVOID)
FCALLSCSUB3(PPM_irandr8_a_f,PPM_IRANDR8_A_2D,ppm_irandr8_a_2d,INT64VV,INT,PVOID)
FCALLSCSUB3(PPM_irandr8_a_f,PPM_IRANDR8_A_3D,ppm_irandr8_a_3d,INT64VVV,INT,PVOID)
FCALLSCFUN0(DOUBLE,PPM_ya_fsgrandom,PPM_DRAND,ppm_drand)
FCALLSCFUN0(DOUBLE,PPM_ya_frandom,PPM_DRANDP,ppm_drandp)
static inline double
PPM_drandr_f(struct PPM_iinterval_dp *range)
{
return PPM_drandr(*range);
}
FCALLSCFUN1(DOUBLE,PPM_drandr_f,PPM_DRANDR,ppm_drandr,PVOID)
static inline void
PPM_drand_a_f(double *a, int n)
{
assert(n >= 0);
PPM_drand_a(a, (size_t)n);
}
FCALLSCSUB2(PPM_drand_a_f,PPM_DRAND_A,ppm_drand_a,DOUBLEV,INT)
FCALLSCSUB2(PPM_drand_a_f,PPM_DRAND_A_2D,ppm_drand_a_2d,DOUBLEVV,INT)
FCALLSCSUB2(PPM_drand_a_f,PPM_DRAND_A_3D,ppm_drand_a_3d,DOUBLEVVV,INT)
static inline void
PPM_drandp_a_f(double *a, int n)
{
assert(n >= 0);
PPM_drandp_a(a, (size_t)n);
}
FCALLSCSUB2(PPM_drandp_a_f,PPM_DRANDP_A,ppm_drandp_a,DOUBLEV,INT)
FCALLSCSUB2(PPM_drandp_a_f,PPM_DRANDP_A_2D,ppm_drandp_a_2d,DOUBLEVV,INT)
FCALLSCSUB2(PPM_drandp_a_f,PPM_DRANDP_A_3D,ppm_drandp_a_3d,DOUBLEVVV,INT)
static inline void
PPM_drandr_a_f(double *a, int n, struct PPM_iinterval_dp *range)
{
assert(n >= 0);
PPM_drandr_a(a, (size_t)n, *range);
}
FCALLSCSUB3(PPM_drandr_a_f,PPM_DRANDR_A,ppm_drandr_a,DOUBLEV,INT,PVOID)
FCALLSCSUB3(PPM_drandr_a_f,PPM_DRANDR_A_2D,ppm_drandr_a_2d,DOUBLEVV,INT,PVOID)
FCALLSCSUB3(PPM_drandr_a_f,PPM_DRANDR_A_3D,ppm_drandr_a_3d,DOUBLEVVV,INT,PVOID)
FCALLSCFUN0(FLOAT,PPM_frand,PPM_FRAND,ppm_frand)
FCALLSCFUN0(FLOAT,PPM_frandp,PPM_FRANDP,ppm_frandp)
static inline float
PPM_frandr_f(struct PPM_iinterval_sp *range)
{
return PPM_frandr(*range);
}
FCALLSCFUN1(FLOAT,PPM_frandr_f,PPM_FRANDR,ppm_frandr,PVOID)
static inline void
PPM_frand_a_f(float *a, int n)
{
assert(n >= 0);
PPM_frand_a(a, (size_t)n);
}