This file is indexed.

/usr/include/inhomog/inhomog.h is in libinhomog-dev 0.1.7.1-1.

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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
/*
   inhomog - tools and main program for backreaction calculations

   Copyright (C) 2012 Jan Ostrowski, Boud Roukema

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

   See also http://www.gnu.org/licenses/gpl.html

*/

#include <gsl/gsl_spline.h>
#include <time.h>

/* #define TEST_GSL_MAX_N 1000000 */
#define TEST_GSL_MAX_N 1000000
#define TEST_GSL_N_BINS 1000
#define TEST_GSL_N_SIGMA 6
#define TEST_GSL_INTEG_ERROR 1e-5
#define TEST_GSL_N_CALLS 300000

#define HELP_LINE_TESTS "run a Test (\
i[nvariants], p[ower spec], \
u[niform])"
#define W_TYPE_DEFAULT 1
/* default thickness of spherical shells in Mpc */
#define DELTA_R_DEFAULT 0.05
#define HELP_LINE_WINDOW "Window function (0=BKS00_Tab1, 1=sphere, 2=shell) [1]"

#define TOL_LENGTH 1e-100
#define TOL_LENGTH_SQUARED 1e-200
#define TOL_TK_FACTOR 1e-300
#define TOL_LENGTH_INV_III 1e-75
#define TOL_ADOT_INITIAL_SQUARED 1e-100
#define TOL_RAY_FIRST_ORDER_MIN 1e-20
#define TOL_RAY_FIRST_ORDER_MAX 1e6
#define TOL_PK_EISHU 1e-50
#define TOL_MIN_LN_EISHU -100.0

/* tolerances, limits that indicate scale factors growing to extremely
   unphysical values */
#define TOL_A_D_MIN 1e-30
#define TOL_ADOT_SQ_A_OMD 1e-30
#define MAX_DEL_A_D_ACCEPTABLE 1000.0



/* definition 0 = BKS00 (C20)-(C22) = WRONG*/
/* #define  INHOM_INV_III_DEFN 0 */
/* definition 1 = (C9), (C10) + octave + maxima for (C17) generalisation = Roukema + Wiegand */
/* definition 2 = 1/27 <I>^3  (cf spherical) NAIVE */
#define INHOM_INV_III_DEFN 1

/* ****** Choice of a_D_dot_initial and integrator ***** */
/* leave INHOM_A_D_DOT_INITIAL_BKS undefined if you want HAM initial conditions */

/* #define INHOM_A_D_DOT_INITIAL_BKS 1 */

#ifndef INHOM_A_D_DOT_INITIAL_BKS
#define INHOM_A_D_DOT_INITIAL_HAM 1
#endif /* HAM case of initial conditions */

/* set INHOM_A_D_DOT_INITIAL_CURV_FACT to either 1 (GR case)
   or 0 (Newtonian, no curvature) */
#ifndef INHOM_A_D_DOT_INITIAL_CURV_FACTOR
#define INHOM_A_D_DOT_INITIAL_CURV_FACTOR 1
#endif

/* defined: Hamilton integrator; undefined: Raychaudhuri integrator */
/*
#define INHOM_ENABLE_HAMILTON_INTEGRATOR 1
*/



/* for invariants I, II, III */
double flat_length_3(double k_array[3]);

double flat_length_3_3params(double k_array0,
                             double k_array1,
                             double k_array2);

/* for invariants II, III */
double flat_dot_product_3(double *k_array,
                          int j_1,  /* which vector?
                                      j1 \in 1, 2, 3 */
                          int j_2   /* which vector?
                                      j2 \in 1, 2, 3 */
                          );

double flat_dot_product_3_6params
( double a1, double a2, double a3,
  double b1, double b2, double b3);



/* fundamental constants useful in FLRW cosmology (from
   cosmdist-0.2.4.13.2, (c) 2004, B Roukema GPL v2 or later) */

/*  c/H_0  expressed in units of h^{-1} Mpc, where h = H_0/(100 km/s/Mpc)
    In other words, it's   c  in km/s  divided by 100 km/s/Mpc  .
 */
#define COSM_C_ON_H_0_MPC  2997.92458

/*
       COSM_H_0_INV_GYR = 1 kms^-1 Mpc^-1 * 3.15576e16 s Gyr^-1
       = 10e3 m s^-1 (3.08568e22 m)^-1  * 3.15576e16 s Gyr^-1
       = 0.00102271 Gyr^-1

       This converts conventional H_0 units to inverse Gigayears.
*/
#define COSM_H_0_INV_GYR   1.02271e-3

/* multiply H(t) in 1/Gyr by this to get H(t) in km/s/Mpc */
#define KMS_PER_MPCGYR 977.79

#define BOUNDS_CHECK_H_0_MIN 10.0
#define BOUNDS_CHECK_H_0_MAX 600.0
#define BOUNDS_CHECK_Omm_0_MIN -0.01
#define BOUNDS_CHECK_Omm_0_MAX 10.0

struct background_cosm_params_s
{
  /* TODO: for the moment not much more than a dummy */
  int EdS;  /* 1 = EdS; 0 = other */
  int flatFLRW; /* 1 = flat FLRW; 0 = other */
  double H_0;  /* present-day Hubble parameter = Hubble constant = units = km/s/Mpc */
  double Omm_0;  /* present-day matter density parameter */
  double OmLam_0;  /* present-day background-dark-energy density parameter */
  double Ombary_0; /* present-day baryon density parameter */
  double Theta2p7; /* observed CMB temp / 2.7 K */
  double sigma8; /* rms of delta at t_0 of top hat 8 Mpc/h perturbation */
  double correct_Pk_norm; /* correction factor to multiply by
                             INHOMOG_PK_BKS_AMPLITUDE_RAW in order
                             to match sigma8 for the chosen power
                             spectrum and window function
                          */
  int correct_Pk_norm_known; /* is correct_Pk_norm already known? */
  /*
    double Omrad_0 = 0.0; */ /* present-day radiation density parameter */
  /* double wDE_0 = -1.0; */ /* present-day DE evolution parameter; -1.0 means a cosmological constant */
  int    recalculate_t_0; /* boolean: tell a function to make its own
                             calculation of t_0? otherwise: assume
                             that it's already calculated */

  double inhomog_a_scale_factor_initial;
  double inhomog_a_d_scale_factor_initial;
  double inhomog_a_scale_factor_now;

  /* DERIVED parameters; re-calculate if(recalculate_t_0) */
  double t_0;  /* background universe present age in Gyr */
  double H_0_sqrt_OmLam_0; /* in units of inverse Gyr */
  double H_0_sqrt_OmLam_0_threehalves_t_0; /* dimensionless */
};

struct precalculated_invariants_s
{
  int enabled;
  double inv_I;
  double inv_II;
  double inv_III;
};

struct sigma_sq_inv_triple_s
{
  int I_known; /* 1 prevents re-calculation; 0 allows re-calculation */
  int II_known;
  int III_known;
  double sqrt_E_sigma_sq_I; /* 'E' means expectation value; see BKS00 */
  double sqrt_E_sigma_sq_II;
  double sqrt_E_sigma_sq_III;
};


/* parameters for BKS00 integrands (C14), (C18), (C20)-(C22) */
struct rza_integrand_params_s
{
  /* window type */
  int    w_type;
  /* interior of sphere */
  double R_domain;
  /* spherical shell */
  double delta_R;
  double R_domain_1;
  double R_domain_2;
  /* power spectrum type ('B' = BBKS,
     'e' = Eisenstein & Hu short, 'E' = E&Hu full) */
  char pow_spec_type;

  /* If some or all of a triple of expectation values of the squares
     of the invariants have already been calculated, then store these
     values, so that they are availebl to calling routines if needed.
  */
  struct sigma_sq_inv_triple_s sigma_sq_inv_triple;

  /* The domain shape and size and power spectrum are
     not needed if a precalculated (e.g. externally calculated)
     triple of invariants is used instead. */
  struct precalculated_invariants_s precalculated_invariants;

  /* TODO: the following comment is probably obsolete:
     the background cosm parameters struct will normally be written
     to this structure by kinematic_backreaction() */
  struct background_cosm_params_s background_cosm_params;
};


/* Correct the P(k) normalisation */
int correct_Pk_normalisation(/* INPUTS: */
                             struct rza_integrand_params_s *rza_integrand_params, /* +OUT */
                             struct background_cosm_params_s *background_cosm_params, /* +OUT */
                             int want_verbose,
                             long   n_calls_invariants /* for invariant I integration */
                             );


/* initial version of P(k): hardwired BBKS/BKS H_0 = 50km/s/Mpc values */
double power_spectrum_flatspace(double k_mod, /* INPUTS */
                                double a_scale_factor_initial,
                                char   pow_spec_type,
                                struct background_cosm_params_s background_cosm_params
                                );

double power_spectrum_flatspace_BBKS
(double k_mod, /* INPUTS */
 double a_scale_factor_initial,
 struct background_cosm_params_s background_cosm_params
 );

double power_spectrum_flatspace_EisHu_short
(double k_mod, /* INPUTS */
 double a_scale_factor_initial,
 struct background_cosm_params_s background_cosm_params
 );

/*  the GCC compile option -finline-functions should inline the following */
double Transfer0tilde_EisHu(/* double k_mod_t0, -> passed via q_EH98 */
                            double alpha_c,
                            double beta_c,
                            double q_EH98);

double power_spectrum_flatspace_EisHu_full
(double k_mod, /* INPUTS */
 double a_scale_factor_initial,
 struct background_cosm_params_s background_cosm_params
 );

double window_R_k(double R_domain, double k_mod);

double window_R1_R2_k(double R_domain_1,    /* INPUTS: */
                      double R_domain_2,
                      double k_mod
                      );

#define DIM_BKS00 3

/* k integration bounds @z=200 (?)
   octave: 2*pi ./ [0.0002 0.02 5 50]
   2pi / 0.02 Mpc = 314.16 Mpc^-1
   2pi / 0.0002 Mpc = 31416. Mpc^-1   low R, high k limit
*/
#define K_LOWER_BKS00 -31416.0
#define K_UPPER_BKS00 31416.0

/*
  Either INHOMOG_STANDARD_SCALE_FACTOR_CONVENTION
  or INHOMOG_BKS00_SCALE_FACTOR_CONVENTION
  can be defined, but not both.
*/

/* check that at least one is undefined */
#if defined (INHOMOG_STANDARD_SCALE_FACTOR_CONVENTION) && defined (INHOMOG_BKS00_SCALE_FACTOR_CONVENTION)
#error "Error. Both INHOMOG_STANDARD_SCALE_FACTOR_CONVENTION and INHOMOG_BKS00_SCALE_FACTOR_CONVENTION are defined."
#endif

/* if neither are defined, then choose a default: */
#if ! defined (INHOMOG_STANDARD_SCALE_FACTOR_CONVENTION) && ! defined (INHOMOG_BKS00_SCALE_FACTOR_CONVENTION)
/* DEFAULT: standard scale factor convention a(t_0) = 1 */
#define INHOMOG_STANDARD_SCALE_FACTOR_CONVENTION 1
#endif

/* if BKS00 scale factor convention: a(t_{initial}) = 1 */
#ifdef INHOMOG_BKS00_SCALE_FACTOR_CONVENTION
#undef INHOMOG_STANDARD_SCALE_FACTOR_CONVENTION
#endif


#ifdef INHOMOG_STANDARD_SCALE_FACTOR_CONVENTION
#define INHOMOG_A_SCALE_FACTOR_INITIAL (1.0/201.0)
#define INHOMOG_A_D_SCALE_FACTOR_INITIAL (1.0/201.0)
/*
#define INHOMOG_A_SCALE_FACTOR_INITIAL (1.0/35.819)
#define INHOMOG_A_D_SCALE_FACTOR_INITIAL (1.0/35.819)
*/
#define INHOMOG_A_SCALE_FACTOR_NOW (1.0)
#endif

#ifdef INHOMOG_BKS00_SCALE_FACTOR_CONVENTION
#define INHOMOG_A_SCALE_FACTOR_INITIAL (1.0)
#define INHOMOG_A_D_SCALE_FACTOR_INITIAL (1.0)
#define INHOMOG_A_SCALE_FACTOR_NOW (201.0)
#endif

/* #define INHOMOG_A_D_SCALE_FACTOR_NOW (1.0)  */
/* #define INHOMOG_Z_PLUS1_FACTOR_INITIAL 201.0 */
/* TODO: more general BBKS86 version, or more modern version */


double sigma_sq_invariant_I_integrand(double * k_array,
                                      size_t dim,
                                      void * params);

double sigma_sq_invariant_II_integrand(double * k_array,
                                      size_t dim,
                                      void * params);

double sigma_sq_invariant_III_integrand(double * k_array,
                                      size_t dim,
                                      void * params);

int test_power_spectrum_flatspace(int want_verbose);

int sigma_sq_invariant_I(/* INPUTS; */
                         struct rza_integrand_params_s rza_integrand_params,
                         long   n_calls,  /* number of times to evaluate the function */
                         int want_verbose,
                         double *the_integral, /* OUTPUTS: */
                         double *integ_error
                         );

int sigma_sq_invariant_II(/* INPUTS; */
                          struct rza_integrand_params_s rza_integrand_params,
                          long   n_calls,  /* number of times to evaluate the function */
                          int want_verbose,
                          double *the_integral, /* OUTPUTS: */
                          double *integ_error
                          );

int sigma_sq_invariant_III(/* INPUTS; */
                           struct rza_integrand_params_s rza_integrand_params,
                           long   n_calls,  /* number of times to evaluate the function */
                           int want_verbose,
                           double *the_integral, /* OUTPUTS: */
                           double *integ_error
                           );


int test_sigma_sq_invariants(/* INPUTS: */
                             struct rza_integrand_params_s rza_integrand_params
                             );



double a_EdS(/* INPUTS: */
             struct background_cosm_params_s * background_cosm_params,
             double t_background,
             int want_verbose
             /* OUTPUTS: */
             );

double t_EdS(/* INPUTS: */
             struct background_cosm_params_s * background_cosm_params,
             double a_scale_factor,
             int want_verbose
             /* OUTPUTS: */
             );

double a_dot_EdS(/* INPUTS: */
                 struct background_cosm_params_s * background_cosm_params,
                 double t_background,
                 int want_verbose
                 /* OUTPUTS: */
                 );

double a_ddot_EdS(/* INPUTS: */
                 struct background_cosm_params_s * background_cosm_params,
                 double t_background,
                 int want_verbose
                 /* OUTPUTS: */
                 );


double a_flatFLRW(/* INPUTS: */
                  struct background_cosm_params_s * background_cosm_params,
                  double t_background,
                  int want_verbose
                  /* OUTPUTS: */
                  );

double t_flatFLRW(/* INPUTS: */
                  struct background_cosm_params_s * background_cosm_params,
                  double a_scale_factor,
                  int want_verbose
                  /* OUTPUTS: */
                  );

double a_dot_flatFLRW(/* INPUTS: */
                      struct background_cosm_params_s * background_cosm_params,
                      double t_background,
                      int want_verbose
                      /* OUTPUTS: */
                      );


/* See (49) of Buchert et al RZA2 preprint v20120722 for the formula used
   here. */
int kinematical_backreaction(/* INPUTS: */
                              struct rza_integrand_params_s *rza_integrand_params,
                              struct background_cosm_params_s background_cosm_params,
                              double *t_background,
                              int    n_t_background,
                              double n_sigma[3],
                              long   n_calls_invariants,  /* for invariant I integration */
                              int want_planar, /* cf RZA2 V.A */
                              int want_spherical, /* cf RZA2 V.B.3 */
                              int want_verbose,
                              /* OUTPUTS: */
                              double *rza_Q_D
                              );


/*
  int test_kinematical_backreaction(
*/ /* INPUTS: */
/*
                                struct rza_integrand_params_s rza_integrand_params,
                                int want_verbose
                                );
*/


int curvature_backreaction(/* INPUTS: */
                           struct rza_integrand_params_s *rza_integrand_params,
                           struct background_cosm_params_s background_cosm_params,
                           double *t_background,
                           int    n_t_background,
                           double n_sigma[3],
                           long   n_calls_invariants,  /* for invariant I integration */
                           int want_planar, /* cf RZA2 V.A */
                           int want_spherical, /* cf RZA2 V.B.3 */
                           int want_verbose,
                           /* OUTPUTS: */
                           double *rza_R_D
                           );


struct a_D_RZA2_92_params_s
{
  double dummy;
};


/* initial verstion: test GSL suggested example */
#define N_INTEGRATORS 7
int test_inhomog_ODE(int want_verbose);


struct a_D_integrator_params_s
{
  /* constant for a_D integration; EdS: 8/(3t_i)^2 (1 - inv_I_initial) */
  double Aconst;
  /* gsl interpolator objects */
  gsl_interp_accel * accel_Q_D;
  gsl_spline * spline_Q_D;
  /* gsl interpolator objects for Hamiltonian case only */
  gsl_interp_accel * accel_R_D;
  gsl_spline * spline_R_D;
  /* gsl interpolator objects for Hamiltonian case only */
  gsl_interp_accel * accel_a_D;
  gsl_spline * spline_a_D;
  /* a_D_dot sign */
  /* int a_D_dot_sign; */ /* -1 or +1 */
  double t_maybe_neg_sqrt;
  double t_neg_sqrt;
  double a_D_dot_squared; /* return value used for searching for a zero of a_D_dot_squared */
};

/* find the collapse time after running scale_factor_D */
int find_collapse_time(/* INPUTS */
                       int  n_t_background,
                       double *a_D,
                       double *dot_a_D,
                       /* OUTPUTS */
                       int  *i_t_collapse,
                       int  *collapsed /* boolean */
                       );

/* scale_factor_D - wrapper for Raychaudhuri or Hamiltonian ODE integration of a_D */

int scale_factor_D(/* INPUTS: */
                   struct rza_integrand_params_s *rza_integrand_params,
                   struct background_cosm_params_s background_cosm_params,
                   double *t_background,
                   int  n_t_background,
                   double n_sigma[3],
                   long   n_calls_invariants,  /* for invariant I integration */
                   int want_planar, /* cf RZA2 V.A */
                   int want_spherical, /* cf RZA2 V.B.3 */
                   int want_verbose,
                   /* OUTPUTS: */
                   double *a_D,
                   double *dot_a_D,
                   int *unphysical
                   );


int scale_factor_D_Ray_ODE_func(double t,
                            const double func_first_order[],
                            double func_first_order_deriv[],
                            void *params);

int scale_factor_D_Ray_ODE_jacob(double t,
                             const double func_first_order[],
                             double *dfunc1D_partials,
                             double dfunc1D_dt[],
                             void *params);


int scale_factor_D_Ray(/* INPUTS: */
                   struct rza_integrand_params_s *rza_integrand_params,
                   struct background_cosm_params_s background_cosm_params,
                   double *t_background,
                   int  n_t_background,
                   double n_sigma[3],
                   long   n_calls_invariants,  /* for invariant I integration */
                   int want_planar, /* cf RZA2 V.A */
                   int want_spherical, /* cf RZA2 V.B.3 */
                   int want_verbose,
                   /* OUTPUTS: */
                   double *a_D,
                   double *dot_a_D,
                   int *unphysical
                   );

#define HAM_A_D_SQUARED_NEG_LIMIT 1e-2
#define HAM_A_D_SQUARED_ZERO_LIMIT 1e-20
#define SCALE_FACTOR_A_D_NEARLY_ZERO 1e-9


int scale_factor_D_Ham_ODE_func(double t,
                            const double func_first_order[],
                            double func_first_order_deriv[],
                            void *params);

int scale_factor_D_Ham_ODE_jacob(double t,
                             const double func_first_order[],
                             double *dfunc1D_partials,
                             double dfunc1D_dt[],
                             void *params);

/* just one run of integrating a_D from RZA2 (54), possibly
   recalculating t_neg_sqrt */
int scale_factor_D_Ham_one_try(/* INPUTS: */
                               struct a_D_integrator_params_s *a_D_integrator_params,
                               double t_ODE,
                               double h_ODE, /* step size */
                               double a_D_0,
                               double *t_background_in,
                               int  n_t_background_in,
                               int  recalculate_t_neg_sqrt,
                               double t_neg_sqrt_input,
                               /* OUTPUTS: */
                               double *t_neg_sqrt_output,
                               double *a_D_try,
                               double *dot_a_D_try
                               );


int scale_factor_D_Ham(/* INPUTS: */
                   struct rza_integrand_params_s *rza_integrand_params,
                   struct background_cosm_params_s background_cosm_params,
                   double *t_background,
                   int  n_t_background,
                   double n_sigma[3],
                   long   n_calls_invariants,  /* for invariant I integration */
                   int want_planar, /* cf RZA2 V.A */
                   int want_spherical, /* cf RZA2 V.B.3 */
                   int want_verbose,
                   /* OUTPUTS: */
                   double *a_D,
                   double *dot_a_D,
                   int *unphysical
                   );


int Omega_D(/* INPUTS: */
            struct rza_integrand_params_s *rza_integrand_params, /* +OUT */
            struct background_cosm_params_s background_cosm_params,
            double *t_background_in,
            int  n_t_background_in,
            double n_sigma[3],
            long   n_calls_invariants,  /* for invariant I integration */
            int want_planar, /* cf RZA2 V.A */
            int want_spherical, /* cf RZA2 V.B.3 */
            int want_verbose,
            /* OUTPUTS: */
            double *rza_Q_D,
            double *rza_R_D,
            double *a_D,  /* all of size n_t_background_in */
            double *dot_a_D,
            int *unphysical,
            double *H_D,
            double *Omm_D,
            double *OmQ_D,
            double *OmLam_D,
            double *OmR_D
            );


/* to be called from fortran; underscore convention *not* checked automatically */
void omega_d_precalc_(/* INPUTS */
                      int64_t *scal_av_n_gridsize,
                      double **I_inv,
                      double **II_inv,
                      double **III_inv,
                      int64_t *n_t_inhomog,
                      double *a_FLRW_init,
                      double *H1bg,
                      /* OUTPUTS */
                      double **t_RZA,
                      double **a_D_RZA
                      );

double growth_FLRW_func(
                        double t_background, void * params);

double dot_growth_FLRW_func(
                        double t_background, void * params);

/* growth function time derivative */
double dot_growth_FLRW(/* INPUTS: */
                       struct background_cosm_params_s * background_cosm_params,
                       double t_background,
                       int want_verbose
                       /* OUTPUTS: */
                       );

/* growth function for direct use */
double growth_FLRW(/* INPUTS: */
                   struct background_cosm_params_s * background_cosm_params,
                   double t_background,
                   int want_verbose
                   /* OUTPUTS: */
                   );

double ddot_growth_FLRW(/* INPUTS: */
                        struct background_cosm_params_s * background_cosm_params,
                        double t_background,
                        int want_verbose
                        /* OUTPUTS: */
                        );

double print_benchmark(clock_t b0, clock_t b1);