8000 Upgrade to Lapack lite 3.2.2 by eric-wieser · Pull Request #8649 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Upgrade to Lapack lite 3.2.2 #8649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 26, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file 8000
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ENH: Add more functions copied to f2c_lite.
These are copied from the libf2c source code, which is presumably where all
the others came from
  • Loading branch information
eric-wieser committed Mar 25, 2017
commit febacb2eb2ae691829d83b52023f8312a29a1c68
84 changes: 84 additions & 0 deletions numpy/linalg/lapack_lite/f2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ return( (*x)>=0 ?
}


#ifdef KR_headers
double floor();
integer i_nint(x) real *x;
#else
#undef abs
integer i_nint(real *x)
#endif
{
return (integer)(*x >= 0 ? floor(*x + .5) : -floor(.5 - *x));
}

#ifdef KR_headers
double pow();
double pow_dd(ap, bp) doublereal *ap, *bp;
Expand Down Expand Up @@ -272,6 +283,79 @@ if(n != 0)
}
return(pow);
}

#ifdef KR_headers
VOID pow_zi(p, a, b) /* p = a**b */
doublecomplex *p, *a; integer *b;
#else
extern void z_div(doublecomplex*, doublecomplex*, doublecomplex*);
void pow_zi(doublecomplex *p, doublecomplex *a, integer *b) /* p = a**b */
#endif
{
integer n;
unsigned long u;
double t;
doublecomplex q, x;
static doublecomplex one = {1.0, 0.0};

n = *b;
q.r = 1;
q.i = 0;

if(n == 0)
goto done;
if(n < 0)
{
n = -n;
z_div(&x, &one, a);
}
else
{
x.r = a->r;
x.i = a->i;
}

for(u = n; ; )
{
if(u & 01)
{
t = q.r * x.r - q.i * x.i;
q.i = q.r * x.i + q.i * x.r;
q.r = t;
}
if(u >>= 1)
{
t = x.r * x.r - x.i * x.i;
x.i = 2 * x.r * x.i;
x.r = t;
}
else
break;
}
done:
p->i = q.i;
p->r = q.r;
}

#ifdef KR_headers
VOID pow_ci(p, a, b) /* p = a**b */
complex *p, *a; integer *b;
#else
extern void pow_zi(doublecomplex*, doublecomplex*, integer*);
void pow_ci(complex *p, complex *a, integer *b) /* p = a**b */
#endif
{
doublecomplex p1, a1;

a1.r = a->r;
a1.i = a->i;

pow_zi(&p1, &a1, b);

p->r = p1.r;
p->i = p1.i;
}

/* Unless compiled with -DNO_OVERWRITE, this variant of s_cat allows the
* target of a concatenation to appear on its right-hand side (contrary
* to the Fortran 77 Standard, but in accordance with Fortran 90).
Expand Down
0