Displaying 20 results from an estimated 62 matches for "f77_call".
2010 Jan 03
3
F77_CALL, F77_NAME definition
I give up. Maybe it is my search (Windows) but I cannot seem to find the definition of the F77_CALL or F77_NAME macros. Either there are too many matches or the search just doesn't find it. For example where is the source for:
F77_CALL(dpotri)
?
Thank you.
Kevin
2014 Dec 20
2
Unexplained difference between results of dppsv and dpotri LAPACK routines
...ntributors,
Considering the following sample C code, that illustrates two possible
uses of a Cholesky decomp for inverting a matrix, equally valid at
least in theory:
SEXP test() {
int d = 2;
int info = 0;
double mat[4] = {2.5, 0.4, 0.4, 1.7};
double id[4] = {1.0, 0.0, 0.0, 1.0};
double lmat[3];
F77_CALL(dpotrf)("L", &d, mat, &d, &info);
lmat[0] = mat[0];
lmat[1] = mat[1];
lmat[2] = mat[3];
F77_CALL(dppsv)("L", &d, &d, lmat, id, &d, &info);
// id now contains L^(-T)
F77_CALL(dpotri)("L", &d, mat, &d, &info);
// mat contains mat^(...
2009 Jun 12
1
Can't get F77_CALL(dgemm) to work [SEC=UNCLASSIFIED]
Hi
I am new to writing C code and am trying to write an R extension in C. I
have hit a wall with F77_CALL(dgemm) in that it produces wrong results.
The code below is a simplified example that multiplies the matrices Ab and
Bm to give Cm. The results below show clearly that Cm is wrong.
Am=
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
17 18 19 20
Bm=
1 1 1
1 1 1
1 1...
2008 Mar 27
1
Cannot update packages on F8
...9;double'
corStruct.c:46: warning: assignment makes pointer from integer without a cast
corStruct.c:47: error: expected expression before 'double'
corStruct.c:47: warning: assignment makes pointer from integer without a cast
corStruct.c:51: warning: implicit declaration of function 'F77_CALL'
corStruct.c:51: error: 'chol' undeclared (first use in this function)
corStruct.c:51: error: (Each undeclared identifier is reported only once
corStruct.c:51: error: for each function it appears in.)
corStruct.c:51: error: called object
'F77_CALL(<erroneous-expression>)'...
2020 Jul 15
2
Openblas?
...lbuettel wrote:
>
> G?ran,
>
> This is not an easy email to reply to because it _contains nothing
> reproducible_.
Thanks Dirk,
Sorry about that, but my real question was (see below): "Is the problem
that openblas uses C versions of blas?" That is, do I need to change
F77_CALL(name)(...);
to
cblas_name(...);
everywhere? And if so, is this really a good idea with old code?
I'll try to extract a reproducible example from the package (eha) where
I run it.
G?ran
>
> On 15 July 2020 at 13:24, G?ran Brostr?m wrote:
> | Hello,
> |
> | I thought that I...
2015 Mar 25
4
F77_CALL/NAME problem
...C. Here it is the relevant
part of the C file I am currently writing
#include<stdio.h>
#include<R.h>
#include<Rmath.h>
#include<math.h>
void F77_NAME(DGESV)( int*, int*, double*, int*, int*, double*, int*, int*);
void solve( int *p, double *A, double *Ainv)
{
...
F77_CALL(DGESV)(p, p, Ain, p, ipiv, Bin, p, &info);
}
In order to create the ".so" file to load in R I downloaded the dgesv.f file
as well as the dependencies (dgetf2.f dgetrf.f dgetrs.f dlaswp.f). As I was
used to I ran in a terminal
R CMD COMPILE *.f
R CMD SHLIB MY_C_FILE.c *.o
to get the...
2011 Feb 20
2
Problem using F77_CALL(dgemm) in a package
...n);i++){
Rprintf("%f ",A[i]);
}
Rprintf("\n");
for(i=0;i<(*n**p);i++){
Rprintf("%f ",B[i]);
}
Rprintf("\n");
for(i=0;i<(*m**p);i++){
Rprintf("%f ",C[i]);
}
Rprintf("\n");
//Here is the actual multiplication
F77_CALL(dgemm)("N","N",m,n,p,&one,A,m,B,n,&zero,C,m);
}
And the file C_matrix_multiply.R in my R directory:
C_matrix_multiply = function(A,B){
C <- matrix(0,nrow(A),ncol(B))
cout <- .C("R_matrix_multiply",as.double(A),as.double(B),nrow(A),ncol(A),ncol(B),as.d...
2017 Feb 09
3
Ancient C /Fortran code linpack error
In my package 'glmmML' I'm using old C code and linpack in the
optimizing procedure. Specifically, one part of the code looks like this:
F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info);
if (*info == 0){
F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job);
........
This usually works OK, but with an ill-conditioned data set (from a user
of glmmML) it happened that the hessian was all...
2012 Mar 06
2
Calling FORTRAN function from R issue?
...ot;
void testzdotc() {
Rcomplex zx[3], zy[3], ret_val;
zx[0].r = 1.0; zx[0].i = 0.0;
zx[1].r = 2.0; zx[0].i = 0.0;
zx[2].r = 3.0; zx[0].i = 0.0;
zy[0].r = 1.0; zy[0].i = 0.0;
zy[1].r = 2.0; zy[0].i = 0.0;
zy[2].r = 3.0; zy[0].i = 0.0;
int n=3, incx=1, incy=1;
F77_CALL(zdotc)(&ret_val, &n, zx, &incx, zy, &incy);
Rprintf("ret_val = %f, %f\n", ret_val.r, ret_val.i);
}
This does not work. When I run '.C('testzdotc')' there is
typically a delay for a second or so, then I get: 0.0, 0.0
instead of the correct ans: 14.0, 0....
2020 Jul 15
2
Openblas?
...0.052 0.953
2 158.948 3.661 20.915
3 3.277 1.894 1.908
Comments on that? To me it seems clear that openblas (0, 2, 3) has
nothing to offer me, as my C code stands now. Is the problem that
openblas uses C versions of blas? I am using the Fortran version via
F77_CALL(name)
I tried adding
PKG_CFLAGS = $(SHLIB_OPENMP_CFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)
to src/Makevars, but then I got
...undefined symbol: dsytri_
when compiling.
G?ran
2009 Mar 25
2
Listing of LAPACK error codes
...and as such are compiler- and CPU-specific."
Is there a listing for the error codes from Lapack routine 'dsyevr'?
Especially I am interested about the meaning and handling of error codes 1
and 2. In Lapack.c I only see the reference to the variable info in certain
Fortran code:
F77_CALL(dsyevr)(jobv, range, uplo, &n, rx, &n, &vl, &vu, &il, &iu,
&abstol, &m, rvalues, rz, &n, isuppz, &tmp, &lwork, &itmp, &liwork, &info);
if (info != 0)
error(_("error code %d from Lapack routine '%s'"), info, "...
2017 Feb 09
3
Ancient C /Fortran code linpack error
> > On 9 Feb 2017, at 16:00, G?ran Brostr?m <goran.brostrom at umu.se> wrote:
> >
> > In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this:
> >
> > F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info);
> > if (*info == 0){
> > F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job);
> > ........
> >
> > This usually works OK, but with an ill-conditioned data set (from a user of g...
2003 Jul 18
1
(PR#2867)
This is a multipart message in MIME format.
--=_alternative 00812CFCCA256D66_=
Content-Type: text/plain; charset="us-ascii"
Two points in respect to PR#2867.
First, the trivial one:
(1) In Lapack.c, on lines 806 and 812, there are calls of
F77_CALL(dgeqp3). But the error messages on lines on lines 809 and 815
refer to "dqeqp3", i.e., they currently have a "q" where they should have
a "g".
Secondly, the non-trivial one
(2) I have built R-1.7.1 under Solaris 7 on a SunUltrasparc 2 using
gcc-2.95.3. On runni...
2008 Apr 10
1
Computing time when calling C functions - why does an extra function call induce such an overhead?
...Vector(getAttrib(A, R_DimSymbol), INTSXP));
Bdims = INTEGER(coerceVector(getAttrib(B, R_DimSymbol), INTSXP));
int nrA, ncB;
double *Ap, *Bp;
nrA = Adims[0];
ncB = Bdims[1];
Ap = REAL(A);
Bp = REAL(B);
/* int info, *ipiv = (int *) R_alloc(nrA, sizeof(int)); */
/* F77_CALL(dgesv)(&nrA, &ncB, Ap, &nrA, ipiv, Bp, &nrA, &info); */
mysolve2(Ap, &nrA, Bp, &ncB, &tol);
UNPROTECT(2);
return B;
}
void mysolve2(double *A, int *nrA, double *B, int *ncB, double *tolin)
{
int info;
int *ipiv = (int *) R_alloc((int) nrA, sizeof(int))...
2017 Feb 10
1
Ancient C /Fortran code linpack error
...n 9 Feb 2017, at 16:00, G?ran Brostr?m <goran.brostrom at umu.se> wrote:
>>>>
>>>> In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this:
>>>>
>>>> F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info);
>>>> if (*info == 0){
>>>> F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job);
>>>> ........
>>>>
>>>> This usually works OK, but with an ill-condit...
2014 Dec 20
0
Unexplained difference between results of dppsv and dpotri LAPACK routines
...hat illustrates two possible
> uses of a Cholesky decomp for inverting a matrix, equally valid at
> least in theory:
>
> SEXP test() {
>
> int d = 2;
> int info = 0;
> double mat[4] = {2.5, 0.4, 0.4, 1.7};
> double id[4] = {1.0, 0.0, 0.0, 1.0};
> double lmat[3];
> F77_CALL(dpotrf)("L", &d, mat, &d, &info);
> lmat[0] = mat[0];
> lmat[1] = mat[1];
> lmat[2] = mat[3];
> F77_CALL(dppsv)("L", &d, &d, lmat, id, &d, &info);
> // id now contains L^(-T)
> F77_CALL(dpotri)("L", &d, mat, &d, &am...
2006 Dec 19
1
precision when calling a C function; presence of Fortran call
...ouble *f){
int outC;
double c0;
c0 = (double) *n * *f;
outC = floor(c0);
printf("when f computed by R, C says %d by itself\n",outC);
}
void test2(int *n, double *f){
extern int F77_NAME(ifloor)(double *);
int outC,outFor;
double c0;
c0 = (double) *n * *f;
outFor = F77_CALL(ifloor)(&c0);
outC = floor(c0);
printf("when f computed by R, C says %d, Fortran says %d\n",outC,outFor);
}
where the Fortran function ifloor is
integer function ifloor(x)
DOUBLE PRECISION x
ifloor=x
if(ifloor.gt.x) ifloor=ifloor-1
end
void test3()...
2009 Jun 01
2
Calling Fortran from C++
Hi,
can anybody point me to a package with C++ code that call Fortran
subroutines?
I am trying to do the same thing but we scarce success.
Error in dyn.load("utils.so") :
unable to load shared library 'utils.so':
dlopen(utils.so, 6): Symbol not found: _robcovf
Referenced from: utils.so
Expected in: dynamic lookup
[[alternative HTML version deleted]]
2006 Aug 03
1
question about dll crashing R
...double one = 1.0 , zero = 0.0 ;
xdims = getAttrib (x , R_DimSymbol ) ;
ydims = getAttrib (y , R_DimSymbol ) ;
mode = REALSXP;
nrx = INTEGER( xdims ) [ 0 ] ;
ncx = INTEGER( xdims ) [ 1 ] ;
nry = INTEGER( ydims ) [ 0 ] ;
ncy = INTEGER( ydims ) [ 1 ] ;
PROTECT( ans = allocMatrix (mode, nrx , ncy ) ) ;
F77_CALL(dgemm) ( transa , transb , &nrx , &ncy , &ncx
, &one ,
REAL( x ) , &nrx , REAL( y ) , &nry , &zero ,
REAL( ans ) , &nrx ) ;
UNPROTECT( 1 ) ;
return( ans ) ;
}
I am also generating random multiavriate normals using
the (not pretty) code
*
1) Generate P independent...
2001 Jun 19
5
core dump on 64-bit Solaris (PR#990)
Using the 64-bit Solaris compilers make check dumps core in La_rs at
73 F77_CALL(dsyev)(jobv, uplo, &n, rx, &n, rvalues, work, &lwork,
&info);
I can't reproduce it easily, but example(eigen) occasionally stops with
Error: abs(sm - V %*% diag(lam) %*% t(V)) < 60 * Meps is not TRUE
which might be connected. The tiny rounding errors in example(eigen)
aren...