/usr/include/sundials/sundials_math.h is in libsundials-dev 2.7.0+dfsg-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | /*
* -----------------------------------------------------------------
* $Revision: 4378 $
* $Date: 2015-02-19 10:55:14 -0800 (Thu, 19 Feb 2015) $
* -----------------------------------------------------------------
* Programmer(s): Scott D. Cohen, Alan C. Hindmarsh and
* Aaron Collier @ LLNL
* -----------------------------------------------------------------
* LLNS Copyright Start
* Copyright (c) 2014, Lawrence Livermore National Security
* This work was performed under the auspices of the U.S. Department
* of Energy by Lawrence Livermore National Laboratory in part under
* Contract W-7405-Eng-48 and in part under Contract DE-AC52-07NA27344.
* Produced at the Lawrence Livermore National Laboratory.
* All rights reserved.
* For details, see the LICENSE file.
* LLNS Copyright End
* -----------------------------------------------------------------
* This is the header file for a simple C-language math library. The
* routines listed here work with the type realtype as defined in
* the header file sundials_types.h.
* -----------------------------------------------------------------
*/
#ifndef _SUNDIALSMATH_H
#define _SUNDIALSMATH_H
#include <sundials/sundials_types.h>
#ifdef __cplusplus /* wrapper to enable C++ usage */
extern "C" {
#endif
/*
* -----------------------------------------------------------------
* Macros : MIN and MAX
* -----------------------------------------------------------------
* MIN(A,B) returns the minimum of A and B
*
* MAX(A,B) returns the maximum of A and B
*
* SQR(A) returns A^2
* -----------------------------------------------------------------
*/
#ifndef SUNMIN
#define SUNMIN(A, B) ((A) < (B) ? (A) : (B))
#endif
#ifndef SUNMAX
#define SUNMAX(A, B) ((A) > (B) ? (A) : (B))
#endif
#ifndef SUNSQR
#define SUNSQR(A) ((A)*(A))
#endif
/*
* -----------------------------------------------------------------
* Function : SUNRpowerI
* -----------------------------------------------------------------
* Usage : int exponent;
* realtype base, ans;
* ans = SUNRpowerI(base,exponent);
* -----------------------------------------------------------------
* SUNRpowerI returns the value of base^exponent, where base is of type
* realtype and exponent is of type int.
* -----------------------------------------------------------------
*/
SUNDIALS_EXPORT realtype SUNRpowerI(realtype base, int exponent);
/*
* -----------------------------------------------------------------
* Function : SUNRpowerR
* -----------------------------------------------------------------
* Usage : realtype base, exponent, ans;
* ans = SUNRpowerR(base,exponent);
* -----------------------------------------------------------------
* SUNRpowerR returns the value of base^exponent, where both base and
* exponent are of type realtype. If base < ZERO, then SUNRpowerR
* returns ZERO.
* -----------------------------------------------------------------
*/
SUNDIALS_EXPORT realtype SUNRpowerR(realtype base, realtype exponent);
/*
* -----------------------------------------------------------------
* Function : SUNRsqrt
* -----------------------------------------------------------------
* Usage : realtype sqrt_x;
* sqrt_x = SUNRsqrt(x);
* -----------------------------------------------------------------
* SUNRsqrt(x) returns the square root of x. If x < ZERO, then
* SUNRsqrt returns ZERO.
* -----------------------------------------------------------------
*/
SUNDIALS_EXPORT realtype SUNRsqrt(realtype x);
/*
* -----------------------------------------------------------------
* Function : SUNRabs
* -----------------------------------------------------------------
* Usage : realtype abs_x;
* abs_x = SUNRabs(x);
* -----------------------------------------------------------------
* SUNRabs(x) returns the absolute value of x.
* -----------------------------------------------------------------
*/
SUNDIALS_EXPORT realtype SUNRabs(realtype x);
/*
* -----------------------------------------------------------------
* Function : SUNRexp
* -----------------------------------------------------------------
* Usage : realtype exp_x;
* exp_x = SUNRexp(x);
* -----------------------------------------------------------------
* SUNRexp(x) returns e^x (base-e exponential function).
* -----------------------------------------------------------------
*/
SUNDIALS_EXPORT realtype SUNRexp(realtype x);
#ifdef __cplusplus
}
#endif
#endif
|