Skip to content

Commit

Permalink
export inline functions in acb_modular.h
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrik-johansson committed Oct 12, 2023
1 parent aa58ddd commit c37443f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/acb_modular.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
#ifndef ACB_MODULAR_H
#define ACB_MODULAR_H

#ifdef ACB_MODULAR_INLINES_C
#define ACB_MODULAR_INLINE
#else
#define ACB_MODULAR_INLINE static __inline__
#endif

#include "fmpz.h"
#include "acb_types.h"

Expand All @@ -30,7 +36,7 @@ psl2z_struct;

typedef psl2z_struct psl2z_t[1];

static __inline__ void
ACB_MODULAR_INLINE void
psl2z_init(psl2z_t g)
{
fmpz_init(&g->a);
Expand All @@ -41,7 +47,7 @@ psl2z_init(psl2z_t g)
fmpz_one(&g->d);
}

static __inline__ void
ACB_MODULAR_INLINE void
psl2z_clear(psl2z_t g)
{
fmpz_clear(&g->a);
Expand All @@ -50,15 +56,15 @@ psl2z_clear(psl2z_t g)
fmpz_clear(&g->d);
}

static __inline__ void
ACB_MODULAR_INLINE void
psl2z_swap(psl2z_t f, psl2z_t g)
{
psl2z_struct h = *f;
*f = *g;
*g = h;
}

static __inline__ void
ACB_MODULAR_INLINE void
psl2z_set(psl2z_t h, const psl2z_t g)
{
fmpz_set(&h->a, &g->a);
Expand All @@ -67,7 +73,7 @@ psl2z_set(psl2z_t h, const psl2z_t g)
fmpz_set(&h->d, &g->d);
}

static __inline__ void
ACB_MODULAR_INLINE void
psl2z_one(psl2z_t g)
{
fmpz_one(&g->a);
Expand All @@ -82,7 +88,7 @@ void psl2z_fprint(FILE * file, const psl2z_t g);

void psl2z_print(const psl2z_t g);

static __inline__ int
ACB_MODULAR_INLINE int
psl2z_equal(const psl2z_t f, const psl2z_t g)
{
return fmpz_equal(&f->a, &g->a)
Expand Down
14 changes: 14 additions & 0 deletions src/acb_modular/inlines.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
Copyright (C) 2020 Fredrik Johansson
This file is part of Arb.
Arb is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/

#define ACB_MODULAR_INLINES_C
#include "acb_modular.h"

0 comments on commit c37443f

Please sign in to comment.