algos.h 2.53 KB
Newer Older
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
/* Common header file for the rrspace software

This file is part of the rrspace project.

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

This library 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 Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

*/

// This file contains routines for constructing a function on a curve of
// prescribed degree having zeros at prescribed places and with prescribed
// multiplicities.

#ifndef INTERPOLATION_DIV_H_
#define INTERPOLATION_DIV_H_

#include <math.h>
#include <NTL/mat_ZZ_p.h>
#include "bivpol.h"
#include "divisor.h"

// Given an effective divisor D, compute a form h on the curve such that (h) >= D
BivPol
Interpolate(const EffectiveDivisor& D);

NTL::mat_ZZ_p
BuildInterpolationMatrixInDegree(const EffectiveDivisor& D, std::size_t deg);

// Given a form h on the curve, compute the principal effective divisor (h)
EffectiveDivisor
42
PrincipalDivisor(const Curve& C, const BivPol& h, const EffectiveDivisor& E);
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

EffectiveDivisor
PositiveDifference(const EffectiveDivisor& D1, const EffectiveDivisor& D2);

// Add the possibility that the supports are not disjoint
EffectiveDivisor
Sum(const EffectiveDivisor& D1, const EffectiveDivisor& D2);

EffectiveDivisor
MultiplyByInt(const EffectiveDivisor& D, unsigned int k);

// TODO: simplify obtained divisor
Divisor
Sum(const Divisor& D1, const Divisor& D2);

58 59 60
Divisor
SimpleSum(const Divisor& D1, const Divisor& D2);

61 62 63 64 65 66 67 68 69 70
Divisor
MultiplyByInt(const Divisor& D, unsigned int k);

std::vector<BivPol>
EffectiveBasisRRinDegree(const EffectiveDivisor& D, std::size_t deg);

struct RRspace {
  BivPol denom;
  std::vector<BivPol> num_basis;

71
  // Residual divisor: (h) - D_+ + D_-
72 73 74 75 76 77 78 79 80
  // Useful for implementing the arithmetic in the Jacobian with reduced
  // representations of divisors.
  EffectiveDivisor Dnum; 

  RRspace(const BivPol& tdenom, const std::vector<BivPol>& tnum_basis, const EffectiveDivisor& tDnum) 
    : denom(tdenom), num_basis(tnum_basis), Dnum(tDnum) {}
};

RRspace
81
RiemannRochBasis(const Divisor& D, const EffectiveDivisor& E);
82 83

#endif