Skip to content

Instantly share code, notes, and snippets.

@OpenGamma-Blog
Created May 29, 2012 12:31
Show Gist options
  • Save OpenGamma-Blog/2828162 to your computer and use it in GitHub Desktop.
Save OpenGamma-Blog/2828162 to your computer and use it in GitHub Desktop.
Accessing Native Maths Libraries 2
#ifdef __cplusplus
extern "C"
#endif
/*
* Class: OGBLASRawWrapper
* Method: wrapped_dgemv
* Signature: (CIID[DI[DID[DI)V
*/
JNIEXPORT void JNICALL Java_com_opengamma_maths_nativewrappers_OGBLASRawWrapper_wrapped_1dgemv(JNIEnv * env, jclass theClass, jchar trans, jint m, jint n, jdouble alpha, jdoubleArray a, jint _offset_a ,jint lda, jdoubleArray x, jint _offset_x ,jint incx, jdouble beta, jdoubleArray y, jint _offset_y ,jint incy) {
char* _OG_ctrans = (char*) &trans;
int* _OG_cm = (int*) &m;
int* _OG_cn = (int*) &n;
double* _OG_calpha = (double*) α
double* _OG_ca;
int* _OG_clda = (int*) &lda;
double* _OG_cx;
int* _OG_cincx = (int*) &incx;
double* _OG_cbeta = (double*) β
double* _OG_cy;
int* _OG_cincy = (int*) &incy;
MACRO_CRITICALGETPOINTER(a);
MACRO_FAILEDPOINTERGRAB(a,DGEMV,BLAS)
MACRO_CRITICALGETPOINTER(x);
MACRO_FAILEDPOINTERGRAB(x,DGEMV,BLAS)
MACRO_CRITICALGETPOINTER(y);
MACRO_FAILEDPOINTERGRAB(y,DGEMV,BLAS)
DGEMV_F77(_OG_ctrans, _OG_cm, _OG_cn, _OG_calpha, &_OG_ca[_offset_a], _OG_clda, &_OG_cx[_offset_x], _OG_cincx, _OG_cbeta, &_OG_cy[_offset_y], _OG_cincy);
MACRO_CRITICALFREEPOINTER(a);
MACRO_CRITICALFREEPOINTER(x);
MACRO_CRITICALFREEPOINTER(y);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment