Skip to content

Commit

Permalink
Recreated function logGamma (issue #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelTroka committed Mar 16, 2017
1 parent e412835 commit ff56b69
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions Computator.NET.Core/Functions/SpecialFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,19 @@ public static System.Numerics.Complex Γ(System.Numerics.Complex z)
return cmplxFromMeta(Meta.Numerics.Functions.AdvancedComplexMath.Gamma(cmplxToMeta(z)));
}

/*
public static Complex logGamma(Complex z)

public static System.Numerics.Complex logGamma(System.Numerics.Complex z)
{
gsl_sf_result lnr = new gsl_sf_result(), arg = new gsl_sf_result();
gsl_sf_lngamma_complex_e(z.Real, z.Imaginary, out lnr, out arg);
return (lnr.val + arg.val*Complex.ImaginaryOne);
if (z.Real < 0) return double.NaN;
return cmplxFromMeta(Meta.Numerics.Functions.AdvancedComplexMath.LogGamma(cmplxToMeta(z)));
}

public static Complex logΓ(Complex z)
public static System.Numerics.Complex logΓ(System.Numerics.Complex z)
{
gsl_sf_result lnr = new gsl_sf_result(), arg = new gsl_sf_result();
gsl_sf_lngamma_complex_e(z.Real, z.Imaginary, out lnr, out arg);
return (lnr.val + arg.val*Complex.ImaginaryOne);
if (z.Real < 0) return double.NaN;
return cmplxFromMeta(Meta.Numerics.Functions.AdvancedComplexMath.LogGamma(cmplxToMeta(z)));
}
*/


[System.Runtime.InteropServices.DllImport(Computator.NET.DataTypes.GslConfig.GslDllName,
CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern int gsl_sf_lngamma_complex_e(double zr, double zi, out gsl_sf_result lnr,
Expand Down Expand Up @@ -2454,21 +2451,17 @@ public static System.Numerics.Complex Γ(System.Numerics.Complex z)
return cmplxFromMeta(Meta.Numerics.Functions.AdvancedComplexMath.Gamma(cmplxToMeta(z)));
}
/*
public static Complex logGamma(Complex z)
public static System.Numerics.Complex logGamma(System.Numerics.Complex z)
{
gsl_sf_result lnr = new gsl_sf_result(), arg = new gsl_sf_result();
gsl_sf_lngamma_complex_e(z.Real, z.Imaginary, out lnr, out arg);
return (lnr.val + arg.val*Complex.ImaginaryOne);
if (z.Real < 0) return double.NaN;
return cmplxFromMeta(Meta.Numerics.Functions.AdvancedComplexMath.LogGamma(cmplxToMeta(z)));
}
public static Complex logΓ(Complex z)
public static System.Numerics.Complex logΓ(System.Numerics.Complex z)
{
gsl_sf_result lnr = new gsl_sf_result(), arg = new gsl_sf_result();
gsl_sf_lngamma_complex_e(z.Real, z.Imaginary, out lnr, out arg);
return (lnr.val + arg.val*Complex.ImaginaryOne);
if (z.Real < 0) return double.NaN;
return cmplxFromMeta(Meta.Numerics.Functions.AdvancedComplexMath.LogGamma(cmplxToMeta(z)));
}
*/
[System.Runtime.InteropServices.DllImport(Computator.NET.DataTypes.GslConfig.GslDllName,
CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)]
Expand Down

0 comments on commit ff56b69

Please sign in to comment.