Skip to content

Commit

Permalink
* More testing for nc_powspec_ml_spline.
Browse files Browse the repository at this point in the history
* Removed load_from_file from nc_powspec_ml_spline.
* New ncm_powspec_spline2d for generic power spectrum representation.
  • Loading branch information
vitenti committed Mar 22, 2024
1 parent 3613f34 commit c9413c5
Show file tree
Hide file tree
Showing 9 changed files with 453 additions and 39 deletions.
7 changes: 4 additions & 3 deletions docs/numcosmo-docs.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@
<section>
<title>Power spectrum functions</title>
<xi:include href="xml/ncm_powspec.xml"/>
<xi:include href="xml/ncm_powspec_corr3d.xml"/>
<xi:include href="xml/ncm_powspec_filter.xml"/>
<xi:include href="xml/ncm_powspec_sphere_proj.xml"/>
<xi:include href="xml/ncm_powspec_corr3d.xml"/>
<xi:include href="xml/ncm_powspec_spline2d.xml"/>
</section>
<section>
<title>Harmonic Oscillator</title>
Expand Down Expand Up @@ -321,9 +322,9 @@
<section>
<title>Matter Power Spectrum</title>
<xi:include href="xml/nc_powspec_ml.xml"/>
<xi:include href="xml/nc_powspec_ml_fix_spline.xml"/>
<xi:include href="xml/nc_powspec_ml_transfer.xml"/>
<xi:include href="xml/nc_powspec_ml_cbe.xml"/>
<xi:include href="xml/nc_powspec_ml_spline.xml"/>
<xi:include href="xml/nc_powspec_ml_transfer.xml"/>
<xi:include href="xml/nc_powspec_mnl.xml"/>
<xi:include href="xml/nc_powspec_mnl_halofit.xml"/>
</section>
Expand Down
15 changes: 10 additions & 5 deletions numcosmo/math/ncm_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@
#include "math/ncm_spline2d_spline.h"
#include "math/ncm_integral1d.h"
#include "math/ncm_integral_nd.h"
#include "math/ncm_powspec.h"
#include "math/ncm_powspec_corr3d.h"
#include "math/ncm_powspec_filter.h"
#include "math/ncm_powspec_sphere_proj.h"
#include "math/ncm_powspec_corr3d.h"
#include "math/ncm_powspec_spline2d.h"
#include "math/ncm_powspec.h"
#include "math/ncm_model.h"
#include "math/ncm_model_ctrl.h"
#include "math/ncm_model_builder.h"
Expand Down Expand Up @@ -171,11 +172,12 @@
#include "nc_recomb_seager.h"
#include "nc_hireion.h"
#include "nc_hireion_camb.h"
#include "nc_powspec_ml.h"
#include "nc_powspec_ml_transfer.h"
#include "nc_powspec_ml_cbe.h"
#include "nc_powspec_mnl.h"
#include "nc_powspec_ml_spline.h"
#include "nc_powspec_ml_transfer.h"
#include "nc_powspec_ml.h"
#include "nc_powspec_mnl_halofit.h"
#include "nc_powspec_mnl.h"
#include "nc_snia_dist_cov.h"
#include "nc_planck_fi.h"
#include "nc_planck_fi_cor_tt.h"
Expand Down Expand Up @@ -527,6 +529,7 @@ ncm_cfg_init_full_ptr (gint *argc, gchar ***argv)
ncm_cfg_register_obj (NCM_TYPE_INTEGRAL_ND);

ncm_cfg_register_obj (NCM_TYPE_POWSPEC);
ncm_cfg_register_obj (NCM_TYPE_POWSPEC_SPLINE2D);
ncm_cfg_register_obj (NCM_TYPE_POWSPEC_FILTER);
ncm_cfg_register_obj (NCM_TYPE_POWSPEC_SPHERE_PROJ);
ncm_cfg_register_obj (NCM_TYPE_POWSPEC_CORR3D);
Expand Down Expand Up @@ -691,6 +694,7 @@ ncm_cfg_init_full_ptr (gint *argc, gchar ***argv)
ncm_cfg_register_obj (NC_TYPE_HIREION_CAMB);

ncm_cfg_register_obj (NC_TYPE_POWSPEC_ML);
ncm_cfg_register_obj (NC_TYPE_POWSPEC_ML_SPLINE);
ncm_cfg_register_obj (NC_TYPE_POWSPEC_ML_TRANSFER);
ncm_cfg_register_obj (NC_TYPE_POWSPEC_ML_CBE);

Expand Down Expand Up @@ -2167,3 +2171,4 @@ ncm_cfg_set_fftw_default_flag (guint flag, const gdouble timeout)
guint fftw_default_flags = 0;

#endif /* HAVE_FFTW3 */

303 changes: 303 additions & 0 deletions numcosmo/math/ncm_powspec_spline2d.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
/***************************************************************************
* ncm_powspec_spline2d.c
*
* Tue February 16 17:00:52 2016
* Copyright 2016 Sandro Dias Pinto Vitenti
* <vitenti@uel.br>
****************************************************************************/
/*
* ncm_powspec_spline2d.c
* Copyright (C) 2016 Sandro Dias Pinto Vitenti <vitenti@uel.br>
*
* numcosmo 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 3 of the License, or
* (at your option) any later version.
*
* numcosmo 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, see <http://www.gnu.org/licenses/>.
*/

/**
* SECTION:ncm_powspec_spline2d
* @title: NcmPowspecSpline2d
* @short_description: Power spectrum implementation using a 2D spline
* @stability: Stable
* @include: numcosmo/math/ncm_powspec_spline2d.h
*
* #NcmPowspecSpline2d is a power spectrum implementation using a 2D spline.
*
*/

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif /* HAVE_CONFIG_H */
#include "build_cfg.h"

#include "math/ncm_powspec_spline2d.h"
#include "math/ncm_serialize.h"
#include "math/ncm_cfg.h"
#include "math/ncm_integral1d_ptr.h"
#include "math/ncm_memory_pool.h"
#include "math/ncm_sf_sbessel.h"
#include "math/ncm_c.h"
#include "math/ncm_spline2d_bicubic.h"

#ifndef NUMCOSMO_GIR_SCAN
#include <gsl/gsl_sf_bessel.h>
#endif /* NUMCOSMO_GIR_SCAN */

typedef struct _NcmPowspecSpline2dPrivate
{
/*< private > */
NcmSpline2d *spline2d;
} NcmPowspecSpline2dPrivate;

struct _NcmPowspecSpline2d
{
NcmPowspec parent_instance;
};

enum
{
PROP_0,
PROP_SPLINE2D,
};

G_DEFINE_TYPE_WITH_PRIVATE (NcmPowspecSpline2d, ncm_powspec_spline2d, G_TYPE_OBJECT)

static void
ncm_powspec_spline2d_init (NcmPowspecSpline2d *ps_s2d)

Check warning on line 75 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L75

Added line #L75 was not covered by tests
{
NcmPowspecSpline2dPrivate * const self = ncm_powspec_spline2d_get_instance_private (ps_s2d);

Check warning on line 77 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L77

Added line #L77 was not covered by tests

self->spline2d = NULL;
}

Check warning on line 80 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L79-L80

Added lines #L79 - L80 were not covered by tests

static void
_ncm_powspec_spline2d_dispose (GObject *object)

Check warning on line 83 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L83

Added line #L83 was not covered by tests
{
NcmPowspecSpline2d *ps_s2d = NCM_POWSPEC_SPLINE2D (object);
NcmPowspecSpline2dPrivate * const self = ncm_powspec_spline2d_get_instance_private (ps_s2d);

Check warning on line 86 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L85-L86

Added lines #L85 - L86 were not covered by tests

ncm_spline2d_clear (&self->spline2d);

Check warning on line 88 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L88

Added line #L88 was not covered by tests

/* Chain up : end */
G_OBJECT_CLASS (ncm_powspec_spline2d_parent_class)->dispose (object);
}

Check warning on line 92 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L91-L92

Added lines #L91 - L92 were not covered by tests

static void
_ncm_powspec_spline2d_finalize (GObject *object)

Check warning on line 95 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L95

Added line #L95 was not covered by tests
{
/* Chain up : end */
G_OBJECT_CLASS (ncm_powspec_spline2d_parent_class)->finalize (object);
}

Check warning on line 99 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L98-L99

Added lines #L98 - L99 were not covered by tests

static void
_ncm_powspec_spline2d_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)

Check warning on line 102 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L102

Added line #L102 was not covered by tests
{
NcmPowspecSpline2d *ps_s2d = NCM_POWSPEC_SPLINE2D (object);

Check warning on line 104 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L104

Added line #L104 was not covered by tests

g_return_if_fail (NCM_IS_POWSPEC_SPLINE2D (object));

Check warning on line 106 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L106

Added line #L106 was not covered by tests

switch (prop_id)

Check warning on line 108 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L108

Added line #L108 was not covered by tests
{
case PROP_SPLINE2D:
ncm_powspec_spline2d_set_spline2d (ps_s2d, g_value_get_object (value));
break;

Check warning on line 112 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L110-L112

Added lines #L110 - L112 were not covered by tests
default: /* LCOV_EXCL_LINE */
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); /* LCOV_EXCL_LINE */
break; /* LCOV_EXCL_LINE */
}
}

static void
_ncm_powspec_spline2d_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)

Check warning on line 120 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L120

Added line #L120 was not covered by tests
{
NcmPowspecSpline2d *ps_s2d = NCM_POWSPEC_SPLINE2D (object);

Check warning on line 122 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L122

Added line #L122 was not covered by tests

g_return_if_fail (NCM_IS_POWSPEC_SPLINE2D (object));

Check warning on line 124 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L124

Added line #L124 was not covered by tests

switch (prop_id)

Check warning on line 126 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L126

Added line #L126 was not covered by tests
{
case PROP_SPLINE2D:
g_value_set_object (value, ncm_powspec_spline2d_peek_spline2d (ps_s2d));
break;

Check warning on line 130 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L128-L130

Added lines #L128 - L130 were not covered by tests
default: /* LCOV_EXCL_LINE */
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); /* LCOV_EXCL_LINE */
break; /* LCOV_EXCL_LINE */
}
}

static void
_ncm_powspec_spline2d_prepare (NcmPowspec *powspec, NcmModel *model)

Check warning on line 138 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L138

Added line #L138 was not covered by tests
{
NcmPowspecSpline2d *ps_s2d = NCM_POWSPEC_SPLINE2D (powspec);
NcmPowspecSpline2dPrivate * const self = ncm_powspec_spline2d_get_instance_private (ps_s2d);

Check warning on line 141 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L140-L141

Added lines #L140 - L141 were not covered by tests

if (!ncm_spline2d_is_init (self->spline2d))
ncm_spline2d_prepare (self->spline2d);
}

Check warning on line 145 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L143-L145

Added lines #L143 - L145 were not covered by tests

static gdouble
_ncm_powspec_spline2d_eval (NcmPowspec *powspec, NcmModel *model, const gdouble z, const gdouble k)

Check warning on line 148 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L148

Added line #L148 was not covered by tests
{
NcmPowspecSpline2d *ps_s2d = NCM_POWSPEC_SPLINE2D (powspec);
NcmPowspecSpline2dPrivate * const self = ncm_powspec_spline2d_get_instance_private (ps_s2d);

Check warning on line 151 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L150-L151

Added lines #L150 - L151 were not covered by tests

return ncm_spline2d_eval (self->spline2d, z, k);

Check warning on line 153 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L153

Added line #L153 was not covered by tests
}

static void
_ncm_powspec_spline2d_eval_vec (NcmPowspec *powspec, NcmModel *model, const gdouble z, NcmVector *k, NcmVector *Pk)

Check warning on line 157 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L157

Added line #L157 was not covered by tests
{
NcmPowspecSpline2d *ps_s2d = NCM_POWSPEC_SPLINE2D (powspec);
NcmPowspecSpline2dPrivate * const self = ncm_powspec_spline2d_get_instance_private (ps_s2d);
guint n = ncm_vector_len (k);
guint i;

Check warning on line 162 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L159-L162

Added lines #L159 - L162 were not covered by tests

g_assert_cmpuint (n, ==, ncm_vector_len (Pk));

Check warning on line 164 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L164

Added line #L164 was not covered by tests

for (i = 0; i < n; i++)

Check warning on line 166 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L166

Added line #L166 was not covered by tests
{
const gdouble k_i = ncm_vector_get (k, i);

Check warning on line 168 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L168

Added line #L168 was not covered by tests

ncm_vector_set (Pk, i, ncm_spline2d_eval (self->spline2d, z, k_i));

Check warning on line 170 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L170

Added line #L170 was not covered by tests
}
}

Check warning on line 172 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L172

Added line #L172 was not covered by tests

static NcmSpline2d *
_ncm_powspec_spline2d_get_spline_2d (NcmPowspec *powspec, NcmModel *model)

Check warning on line 175 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L175

Added line #L175 was not covered by tests
{
NcmPowspecSpline2d *ps_s2d = NCM_POWSPEC_SPLINE2D (powspec);
NcmPowspecSpline2dPrivate * const self = ncm_powspec_spline2d_get_instance_private (ps_s2d);

Check warning on line 178 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L177-L178

Added lines #L177 - L178 were not covered by tests

return ncm_spline2d_ref (self->spline2d);

Check warning on line 180 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L180

Added line #L180 was not covered by tests
}

static void
ncm_powspec_spline2d_class_init (NcmPowspecSpline2dClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
NcmPowspecClass *powspec_class = NCM_POWSPEC_CLASS (klass);

object_class->set_property = &_ncm_powspec_spline2d_set_property;
object_class->get_property = &_ncm_powspec_spline2d_get_property;
object_class->dispose = &_ncm_powspec_spline2d_dispose;
object_class->finalize = &_ncm_powspec_spline2d_finalize;

/**
* NcmPowspecSpline2d:reltol:
*
* The relative tolerance on the interpolation error.
*/
g_object_class_install_property (object_class,
PROP_SPLINE2D,
g_param_spec_object ("spline2d",
NULL,
"Spline2d representing the values of the power-spectrum",
NCM_TYPE_SPLINE2D,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB));

powspec_class->prepare = &_ncm_powspec_spline2d_prepare;
powspec_class->eval = &_ncm_powspec_spline2d_eval;
powspec_class->eval_vec = &_ncm_powspec_spline2d_eval_vec;
powspec_class->get_spline_2d = &_ncm_powspec_spline2d_get_spline_2d;
}

NcmPowspecSpline2d *
ncm_powspec_spline2d_new (NcmSpline2d *spline2d)

Check warning on line 214 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L214

Added line #L214 was not covered by tests
{
NcmPowspecSpline2d *ps_s2d = g_object_new (NCM_TYPE_POWSPEC_SPLINE2D,

Check warning on line 216 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L216

Added line #L216 was not covered by tests
"spline2d", spline2d,
NULL);

return ps_s2d;

Check warning on line 220 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L220

Added line #L220 was not covered by tests
}

/**
* ncm_powspec_spline2d_ref:
* @ps_s2d: a #NcmPowspecSpline2d
*
* Increases the reference count of @ps_s2d by one atomically.
*
* Returns: (transfer full): @ps_s2d.
*/
NcmPowspecSpline2d *
ncm_powspec_spline2d_ref (NcmPowspecSpline2d *ps_s2d)

Check warning on line 232 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L232

Added line #L232 was not covered by tests
{
return g_object_ref (ps_s2d);

Check warning on line 234 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L234

Added line #L234 was not covered by tests
}

/**
* ncm_powspec_spline2d_free:
* @ps_s2d: a #NcmPowspecSpline2d
*
* Atomically decrements the reference count of @ps_s2d by one.
* If the reference count drops to 0,
* all memory allocated by @ps_s2d is released.
*
*/
void
ncm_powspec_spline2d_free (NcmPowspecSpline2d *ps_s2d)

Check warning on line 247 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L247

Added line #L247 was not covered by tests
{
g_object_unref (ps_s2d);
}

Check warning on line 250 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L249-L250

Added lines #L249 - L250 were not covered by tests

/**
* ncm_powspec_spline2d_clear:
* @ps_s2d: a #NcmPowspecSpline2d
*
* If @ps_s2d is different from NULL,
* atomically decrements the reference count of @powspec by one.
* If the reference count drops to 0,
* all memory allocated by @powspec is released and @powspec is set to NULL.
*
*/
void
ncm_powspec_spline2d_clear (NcmPowspecSpline2d **ps_s2d)

Check warning on line 263 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L263

Added line #L263 was not covered by tests
{
g_clear_object (ps_s2d);
}

Check warning on line 266 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L265-L266

Added lines #L265 - L266 were not covered by tests

/**
* ncm_powspec_spline2d_set_spline2d:
* @ps_s2d: a #NcmPowspecSpline2d
* @spline2d: a NcmSpline2d
*
* Sets the #NcmSpline2d to @spline2d.
*
*/
void
ncm_powspec_spline2d_set_spline2d (NcmPowspecSpline2d *ps_s2d, NcmSpline2d *spline2d)

Check warning on line 277 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L277

Added line #L277 was not covered by tests
{
NcmPowspecSpline2dPrivate * const self = ncm_powspec_spline2d_get_instance_private (ps_s2d);

Check warning on line 279 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L279

Added line #L279 was not covered by tests

g_assert_nonnull (spline2d);

Check warning on line 281 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L281

Added line #L281 was not covered by tests

ncm_spline2d_clear (&self->spline2d);

Check warning on line 283 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L283

Added line #L283 was not covered by tests

self->spline2d = ncm_spline2d_ref (spline2d);
}

Check warning on line 286 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L285-L286

Added lines #L285 - L286 were not covered by tests

/**
* ncm_powspec_spline2d_peek_spline2d:
* @ps_s2d: a #NcmPowspecSpline2d
*
* Peeks the current #NcmSpline2d.
*
* Returns: (transfer none): the current #NcmSpline2d.
*/
NcmSpline2d *
ncm_powspec_spline2d_peek_spline2d (NcmPowspecSpline2d *ps_s2d)

Check warning on line 297 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L297

Added line #L297 was not covered by tests
{
NcmPowspecSpline2dPrivate * const self = ncm_powspec_spline2d_get_instance_private (ps_s2d);

Check warning on line 299 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L299

Added line #L299 was not covered by tests

return self->spline2d;

Check warning on line 301 in numcosmo/math/ncm_powspec_spline2d.c

View check run for this annotation

Codecov / codecov/patch

numcosmo/math/ncm_powspec_spline2d.c#L301

Added line #L301 was not covered by tests
}

Loading

0 comments on commit c9413c5

Please sign in to comment.