/*
 * Copyright 2003-2007 Keith Seymour.
 * Copyright 1992-2007 The University of Tennessee. All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * - Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * 
 * - Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer listed
 *   in this license in the documentation and/or other materials
 *   provided with the distribution.
 * 
 * - Neither the name of the copyright holders nor the names of its
 *   contributors may be used to endorse or promote products derived from
 *   this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * This file was auto-generated by the org.netlib.generate.JavaGenerator
 * program, a part of netlib-java.
 * 
 * @see http://code.google.com/p/netlib-java/
 */

#include "f2j_jni.h"
#include "org_netlib_blas_NativeBLAS.h"

JNIEXPORT jdouble JNICALL Java_org_netlib_blas_NativeBLAS_dasum (JNIEnv * env, jobject calling_obj, jint n, jdoubleArray dx, jint incx){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);
	jdouble returnValue;

	returnValue = cblas_dasum(n, jni_dx, incx);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);

	return returnValue;
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_daxpy (JNIEnv * env, jobject calling_obj, jint n, jdouble da, jdoubleArray dx, jint incx, jdoubleArray dy, jint incy){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);
	jdouble * jni_dy = (*env)->GetPrimitiveArrayCritical(env, dy, JNI_FALSE);
	check_memory(env, jni_dy);

	cblas_daxpy(n, da, jni_dx, incx, jni_dy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, dy, jni_dy, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dcopy (JNIEnv * env, jobject calling_obj, jint n, jdoubleArray dx, jint incx, jdoubleArray dy, jint incy){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);
	jdouble * jni_dy = (*env)->GetPrimitiveArrayCritical(env, dy, JNI_FALSE);
	check_memory(env, jni_dy);

	cblas_dcopy(n, jni_dx, incx, jni_dy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, dy, jni_dy, 0);
}

JNIEXPORT jdouble JNICALL Java_org_netlib_blas_NativeBLAS_ddot (JNIEnv * env, jobject calling_obj, jint n, jdoubleArray dx, jint incx, jdoubleArray dy, jint incy){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);
	jdouble * jni_dy = (*env)->GetPrimitiveArrayCritical(env, dy, JNI_FALSE);
	check_memory(env, jni_dy);
	jdouble returnValue;

	returnValue = cblas_ddot(n, jni_dx, incx, jni_dy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, dy, jni_dy, 0);

	return returnValue;
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dgbmv (JNIEnv * env, jobject calling_obj, jstring trans, jint m, jint n, jint kl, jint ku, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray x, jint incx, jdouble beta, jdoubleArray y, jint incy){
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_dgbmv(F2J_JNI_ORDER, getTrans(jni_trans), m, n, kl, ku, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dgemm (JNIEnv * env, jobject calling_obj, jstring transa, jstring transb, jint m, jint n, jint k, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray b, jint ldb, jdouble beta, jdoubleArray c, jint Ldc){
	char * jni_transa = (char *)(*env)->GetStringUTFChars(env, transa, JNI_FALSE);
	char * jni_transb = (char *)(*env)->GetStringUTFChars(env, transb, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);
	jdouble * jni_c = (*env)->GetPrimitiveArrayCritical(env, c, JNI_FALSE);
	check_memory(env, jni_c);

	cblas_dgemm(F2J_JNI_ORDER, getTrans(jni_transa), getTrans(jni_transb), m, n, k, alpha, jni_a, lda, jni_b, ldb, beta, jni_c, Ldc);

	(*env)->ReleaseStringUTFChars(env, transa, jni_transa);
	(*env)->ReleaseStringUTFChars(env, transb, jni_transb);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, c, jni_c, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dgemv (JNIEnv * env, jobject calling_obj, jstring trans, jint m, jint n, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray x, jint incx, jdouble beta, jdoubleArray y, jint incy){
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_dgemv(F2J_JNI_ORDER, getTrans(jni_trans), m, n, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dger (JNIEnv * env, jobject calling_obj, jint m, jint n, jdouble alpha, jdoubleArray x, jint incx, jdoubleArray y, jint incy, jdoubleArray a, jint lda){
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);

	cblas_dger(F2J_JNI_ORDER, m, n, alpha, jni_x, incx, jni_y, incy, jni_a, lda);

	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
}

JNIEXPORT jdouble JNICALL Java_org_netlib_blas_NativeBLAS_dnrm2 (JNIEnv * env, jobject calling_obj, jint n, jdoubleArray x, jint incx){
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble returnValue;

	returnValue = cblas_dnrm2(n, jni_x, incx);

	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);

	return returnValue;
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_drot (JNIEnv * env, jobject calling_obj, jint n, jdoubleArray dx, jint incx, jdoubleArray dy, jint incy, jdouble c, jdouble s){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);
	jdouble * jni_dy = (*env)->GetPrimitiveArrayCritical(env, dy, JNI_FALSE);
	check_memory(env, jni_dy);

	cblas_drot(n, jni_dx, incx, jni_dy, incy, c, s);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, dy, jni_dy, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_drotg (JNIEnv * env, jobject calling_obj, jobject da, jobject db, jobject c, jobject s){
	jclass jni_daClass = (*env)->GetObjectClass(env, da);
	jfieldID jni_daId = (*env)->GetFieldID(env, jni_daClass, "val", "D");
	jdouble jni_da = (*env)->GetDoubleField(env, da, jni_daId);
	jclass jni_dbClass = (*env)->GetObjectClass(env, db);
	jfieldID jni_dbId = (*env)->GetFieldID(env, jni_dbClass, "val", "D");
	jdouble jni_db = (*env)->GetDoubleField(env, db, jni_dbId);
	jclass jni_cClass = (*env)->GetObjectClass(env, c);
	jfieldID jni_cId = (*env)->GetFieldID(env, jni_cClass, "val", "D");
	jdouble jni_c = (*env)->GetDoubleField(env, c, jni_cId);
	jclass jni_sClass = (*env)->GetObjectClass(env, s);
	jfieldID jni_sId = (*env)->GetFieldID(env, jni_sClass, "val", "D");
	jdouble jni_s = (*env)->GetDoubleField(env, s, jni_sId);

	cblas_drotg(&jni_da, &jni_db, &jni_c, &jni_s);

	(*env)->SetDoubleField(env, da, jni_daId, jni_da);
	(*env)->SetDoubleField(env, db, jni_dbId, jni_db);
	(*env)->SetDoubleField(env, c, jni_cId, jni_c);
	(*env)->SetDoubleField(env, s, jni_sId, jni_s);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_drotm (JNIEnv * env, jobject calling_obj, jint n, jdoubleArray dx, jint incx, jdoubleArray dy, jint incy, jdoubleArray dparam){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);
	jdouble * jni_dy = (*env)->GetPrimitiveArrayCritical(env, dy, JNI_FALSE);
	check_memory(env, jni_dy);
	jdouble * jni_dparam = (*env)->GetPrimitiveArrayCritical(env, dparam, JNI_FALSE);
	check_memory(env, jni_dparam);

	cblas_drotm(n, jni_dx, incx, jni_dy, incy, jni_dparam);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, dy, jni_dy, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, dparam, jni_dparam, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_drotmg (JNIEnv * env, jobject calling_obj, jobject dd1, jobject dd2, jobject dx1, jdouble dy1, jdoubleArray dparam){
	jclass jni_dd1Class = (*env)->GetObjectClass(env, dd1);
	jfieldID jni_dd1Id = (*env)->GetFieldID(env, jni_dd1Class, "val", "D");
	jdouble jni_dd1 = (*env)->GetDoubleField(env, dd1, jni_dd1Id);
	jclass jni_dd2Class = (*env)->GetObjectClass(env, dd2);
	jfieldID jni_dd2Id = (*env)->GetFieldID(env, jni_dd2Class, "val", "D");
	jdouble jni_dd2 = (*env)->GetDoubleField(env, dd2, jni_dd2Id);
	jclass jni_dx1Class = (*env)->GetObjectClass(env, dx1);
	jfieldID jni_dx1Id = (*env)->GetFieldID(env, jni_dx1Class, "val", "D");
	jdouble jni_dx1 = (*env)->GetDoubleField(env, dx1, jni_dx1Id);
	jdouble * jni_dparam = (*env)->GetPrimitiveArrayCritical(env, dparam, JNI_FALSE);
	check_memory(env, jni_dparam);

	cblas_drotmg(&jni_dd1, &jni_dd2, &jni_dx1, dy1, jni_dparam);

	(*env)->SetDoubleField(env, dd1, jni_dd1Id, jni_dd1);
	(*env)->SetDoubleField(env, dd2, jni_dd2Id, jni_dd2);
	(*env)->SetDoubleField(env, dx1, jni_dx1Id, jni_dx1);
	(*env)->ReleasePrimitiveArrayCritical(env, dparam, jni_dparam, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dsbmv (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jint k, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray x, jint incx, jdouble beta, jdoubleArray y, jint incy){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_dsbmv(F2J_JNI_ORDER, getUpLo(jni_uplo), n, k, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dscal (JNIEnv * env, jobject calling_obj, jint n, jdouble da, jdoubleArray dx, jint incx){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);

	cblas_dscal(n, da, jni_dx, incx);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dspmv (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jdouble alpha, jdoubleArray ap, jdoubleArray x, jint incx, jdouble beta, jdoubleArray y, jint incy){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jdouble * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_dspmv(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_ap, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dspr (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jdouble alpha, jdoubleArray x, jint incx, jdoubleArray ap){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);

	cblas_dspr(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_x, incx, jni_ap);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dspr2 (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jdouble alpha, jdoubleArray x, jint incx, jdoubleArray y, jint incy, jdoubleArray ap){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);
	jdouble * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);

	cblas_dspr2(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_x, incx, jni_y, incy, jni_ap);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dswap (JNIEnv * env, jobject calling_obj, jint n, jdoubleArray dx, jint incx, jdoubleArray dy, jint incy){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);
	jdouble * jni_dy = (*env)->GetPrimitiveArrayCritical(env, dy, JNI_FALSE);
	check_memory(env, jni_dy);

	cblas_dswap(n, jni_dx, incx, jni_dy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, dy, jni_dy, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dsymm (JNIEnv * env, jobject calling_obj, jstring side, jstring uplo, jint m, jint n, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray b, jint ldb, jdouble beta, jdoubleArray c, jint Ldc){
	char * jni_side = (char *)(*env)->GetStringUTFChars(env, side, JNI_FALSE);
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);
	jdouble * jni_c = (*env)->GetPrimitiveArrayCritical(env, c, JNI_FALSE);
	check_memory(env, jni_c);

	cblas_dsymm(F2J_JNI_ORDER, getSide(jni_side), getUpLo(jni_uplo), m, n, alpha, jni_a, lda, jni_b, ldb, beta, jni_c, Ldc);

	(*env)->ReleaseStringUTFChars(env, side, jni_side);
	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, c, jni_c, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dsymv (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray x, jint incx, jdouble beta, jdoubleArray y, jint incy){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_dsymv(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dsyr (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jdouble alpha, jdoubleArray x, jint incx, jdoubleArray a, jint lda){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);

	cblas_dsyr(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_x, incx, jni_a, lda);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dsyr2 (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jdouble alpha, jdoubleArray x, jint incx, jdoubleArray y, jint incy, jdoubleArray a, jint lda){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jdouble * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);

	cblas_dsyr2(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_x, incx, jni_y, incy, jni_a, lda);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dsyr2k (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jint n, jint k, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray b, jint ldb, jdouble beta, jdoubleArray c, jint Ldc){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);
	jdouble * jni_c = (*env)->GetPrimitiveArrayCritical(env, c, JNI_FALSE);
	check_memory(env, jni_c);

	cblas_dsyr2k(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), n, k, alpha, jni_a, lda, jni_b, ldb, beta, jni_c, Ldc);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, c, jni_c, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dsyrk (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jint n, jint k, jdouble alpha, jdoubleArray a, jint lda, jdouble beta, jdoubleArray c, jint Ldc){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_c = (*env)->GetPrimitiveArrayCritical(env, c, JNI_FALSE);
	check_memory(env, jni_c);

	cblas_dsyrk(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), n, k, alpha, jni_a, lda, beta, jni_c, Ldc);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, c, jni_c, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dtbmv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jint k, jdoubleArray a, jint lda, jdoubleArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_dtbmv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, k, jni_a, lda, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dtbsv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jint k, jdoubleArray a, jint lda, jdoubleArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_dtbsv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, k, jni_a, lda, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dtpmv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jdoubleArray ap, jdoubleArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jdouble * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_dtpmv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, jni_ap, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dtpsv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jdoubleArray ap, jdoubleArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jdouble * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_dtpsv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, jni_ap, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dtrmm (JNIEnv * env, jobject calling_obj, jstring side, jstring uplo, jstring transa, jstring diag, jint m, jint n, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray b, jint ldb){
	char * jni_side = (char *)(*env)->GetStringUTFChars(env, side, JNI_FALSE);
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_transa = (char *)(*env)->GetStringUTFChars(env, transa, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);

	cblas_dtrmm(F2J_JNI_ORDER, getSide(jni_side), getUpLo(jni_uplo), getTrans(jni_transa), getDiag(jni_diag), m, n, alpha, jni_a, lda, jni_b, ldb);

	(*env)->ReleaseStringUTFChars(env, side, jni_side);
	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, transa, jni_transa);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dtrmv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jdoubleArray a, jint lda, jdoubleArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_dtrmv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, jni_a, lda, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dtrsm (JNIEnv * env, jobject calling_obj, jstring side, jstring uplo, jstring transa, jstring diag, jint m, jint n, jdouble alpha, jdoubleArray a, jint lda, jdoubleArray b, jint ldb){
	char * jni_side = (char *)(*env)->GetStringUTFChars(env, side, JNI_FALSE);
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_transa = (char *)(*env)->GetStringUTFChars(env, transa, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);

	cblas_dtrsm(F2J_JNI_ORDER, getSide(jni_side), getUpLo(jni_uplo), getTrans(jni_transa), getDiag(jni_diag), m, n, alpha, jni_a, lda, jni_b, ldb);

	(*env)->ReleaseStringUTFChars(env, side, jni_side);
	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, transa, jni_transa);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_dtrsv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jdoubleArray a, jint lda, jdoubleArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jdouble * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jdouble * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_dtrsv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, jni_a, lda, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT jint JNICALL Java_org_netlib_blas_NativeBLAS_idamax (JNIEnv * env, jobject calling_obj, jint n, jdoubleArray dx, jint incx){
	jdouble * jni_dx = (*env)->GetPrimitiveArrayCritical(env, dx, JNI_FALSE);
	check_memory(env, jni_dx);
	jint returnValue;

	returnValue = cblas_idamax(n, jni_dx, incx);

	(*env)->ReleasePrimitiveArrayCritical(env, dx, jni_dx, 0);

	return returnValue;
}

JNIEXPORT jint JNICALL Java_org_netlib_blas_NativeBLAS_isamax (JNIEnv * env, jobject calling_obj, jint n, jfloatArray sx, jint incx){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jint returnValue;

	returnValue = cblas_isamax(n, jni_sx, incx);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);

	return returnValue;
}

JNIEXPORT jfloat JNICALL Java_org_netlib_blas_NativeBLAS_sasum (JNIEnv * env, jobject calling_obj, jint n, jfloatArray sx, jint incx){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jfloat returnValue;

	returnValue = cblas_sasum(n, jni_sx, incx);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);

	return returnValue;
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_saxpy (JNIEnv * env, jobject calling_obj, jint n, jfloat sa, jfloatArray sx, jint incx, jfloatArray sy, jint incy){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jfloat * jni_sy = (*env)->GetPrimitiveArrayCritical(env, sy, JNI_FALSE);
	check_memory(env, jni_sy);

	cblas_saxpy(n, sa, jni_sx, incx, jni_sy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, sy, jni_sy, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_scopy (JNIEnv * env, jobject calling_obj, jint n, jfloatArray sx, jint incx, jfloatArray sy, jint incy){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jfloat * jni_sy = (*env)->GetPrimitiveArrayCritical(env, sy, JNI_FALSE);
	check_memory(env, jni_sy);

	cblas_scopy(n, jni_sx, incx, jni_sy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, sy, jni_sy, 0);
}

JNIEXPORT jfloat JNICALL Java_org_netlib_blas_NativeBLAS_sdot (JNIEnv * env, jobject calling_obj, jint n, jfloatArray sx, jint incx, jfloatArray sy, jint incy){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jfloat * jni_sy = (*env)->GetPrimitiveArrayCritical(env, sy, JNI_FALSE);
	check_memory(env, jni_sy);
	jfloat returnValue;

	returnValue = cblas_sdot(n, jni_sx, incx, jni_sy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, sy, jni_sy, 0);

	return returnValue;
}

JNIEXPORT jfloat JNICALL Java_org_netlib_blas_NativeBLAS_sdsdot (JNIEnv * env, jobject calling_obj, jint n, jfloat sb, jfloatArray sx, jint incx, jfloatArray sy, jint incy){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jfloat * jni_sy = (*env)->GetPrimitiveArrayCritical(env, sy, JNI_FALSE);
	check_memory(env, jni_sy);
	jfloat returnValue;

	returnValue = cblas_sdsdot(n, sb, jni_sx, incx, jni_sy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, sy, jni_sy, 0);

	return returnValue;
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sgbmv (JNIEnv * env, jobject calling_obj, jstring trans, jint m, jint n, jint kl, jint ku, jfloat alpha, jfloatArray a, jint lda, jfloatArray x, jint incx, jfloat beta, jfloatArray y, jint incy){
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_sgbmv(F2J_JNI_ORDER, getTrans(jni_trans), m, n, kl, ku, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sgemm (JNIEnv * env, jobject calling_obj, jstring transa, jstring transb, jint m, jint n, jint k, jfloat alpha, jfloatArray a, jint lda, jfloatArray b, jint ldb, jfloat beta, jfloatArray c, jint Ldc){
	char * jni_transa = (char *)(*env)->GetStringUTFChars(env, transa, JNI_FALSE);
	char * jni_transb = (char *)(*env)->GetStringUTFChars(env, transb, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);
	jfloat * jni_c = (*env)->GetPrimitiveArrayCritical(env, c, JNI_FALSE);
	check_memory(env, jni_c);

	cblas_sgemm(F2J_JNI_ORDER, getTrans(jni_transa), getTrans(jni_transb), m, n, k, alpha, jni_a, lda, jni_b, ldb, beta, jni_c, Ldc);

	(*env)->ReleaseStringUTFChars(env, transa, jni_transa);
	(*env)->ReleaseStringUTFChars(env, transb, jni_transb);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, c, jni_c, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sgemv (JNIEnv * env, jobject calling_obj, jstring trans, jint m, jint n, jfloat alpha, jfloatArray a, jint lda, jfloatArray x, jint incx, jfloat beta, jfloatArray y, jint incy){
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_sgemv(F2J_JNI_ORDER, getTrans(jni_trans), m, n, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sger (JNIEnv * env, jobject calling_obj, jint m, jint n, jfloat alpha, jfloatArray x, jint incx, jfloatArray y, jint incy, jfloatArray a, jint lda){
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);

	cblas_sger(F2J_JNI_ORDER, m, n, alpha, jni_x, incx, jni_y, incy, jni_a, lda);

	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
}

JNIEXPORT jfloat JNICALL Java_org_netlib_blas_NativeBLAS_snrm2 (JNIEnv * env, jobject calling_obj, jint n, jfloatArray x, jint incx){
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat returnValue;

	returnValue = cblas_snrm2(n, jni_x, incx);

	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);

	return returnValue;
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_srot (JNIEnv * env, jobject calling_obj, jint n, jfloatArray sx, jint incx, jfloatArray sy, jint incy, jfloat c, jfloat s){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jfloat * jni_sy = (*env)->GetPrimitiveArrayCritical(env, sy, JNI_FALSE);
	check_memory(env, jni_sy);

	cblas_srot(n, jni_sx, incx, jni_sy, incy, c, s);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, sy, jni_sy, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_srotg (JNIEnv * env, jobject calling_obj, jobject sa, jobject sb, jobject c, jobject s){
	jclass jni_saClass = (*env)->GetObjectClass(env, sa);
	jfieldID jni_saId = (*env)->GetFieldID(env, jni_saClass, "val", "D");
	jfloat jni_sa = (*env)->GetFloatField(env, sa, jni_saId);
	jclass jni_sbClass = (*env)->GetObjectClass(env, sb);
	jfieldID jni_sbId = (*env)->GetFieldID(env, jni_sbClass, "val", "D");
	jfloat jni_sb = (*env)->GetFloatField(env, sb, jni_sbId);
	jclass jni_cClass = (*env)->GetObjectClass(env, c);
	jfieldID jni_cId = (*env)->GetFieldID(env, jni_cClass, "val", "D");
	jfloat jni_c = (*env)->GetFloatField(env, c, jni_cId);
	jclass jni_sClass = (*env)->GetObjectClass(env, s);
	jfieldID jni_sId = (*env)->GetFieldID(env, jni_sClass, "val", "D");
	jfloat jni_s = (*env)->GetFloatField(env, s, jni_sId);

	cblas_srotg(&jni_sa, &jni_sb, &jni_c, &jni_s);

	(*env)->SetFloatField(env, sa, jni_saId, jni_sa);
	(*env)->SetFloatField(env, sb, jni_sbId, jni_sb);
	(*env)->SetFloatField(env, c, jni_cId, jni_c);
	(*env)->SetFloatField(env, s, jni_sId, jni_s);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_srotm (JNIEnv * env, jobject calling_obj, jint n, jfloatArray sx, jint incx, jfloatArray sy, jint incy, jfloatArray sparam){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jfloat * jni_sy = (*env)->GetPrimitiveArrayCritical(env, sy, JNI_FALSE);
	check_memory(env, jni_sy);
	jfloat * jni_sparam = (*env)->GetPrimitiveArrayCritical(env, sparam, JNI_FALSE);
	check_memory(env, jni_sparam);

	cblas_srotm(n, jni_sx, incx, jni_sy, incy, jni_sparam);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, sy, jni_sy, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, sparam, jni_sparam, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_srotmg (JNIEnv * env, jobject calling_obj, jobject sd1, jobject sd2, jobject sx1, jfloat sy1, jfloatArray sparam){
	jclass jni_sd1Class = (*env)->GetObjectClass(env, sd1);
	jfieldID jni_sd1Id = (*env)->GetFieldID(env, jni_sd1Class, "val", "D");
	jfloat jni_sd1 = (*env)->GetFloatField(env, sd1, jni_sd1Id);
	jclass jni_sd2Class = (*env)->GetObjectClass(env, sd2);
	jfieldID jni_sd2Id = (*env)->GetFieldID(env, jni_sd2Class, "val", "D");
	jfloat jni_sd2 = (*env)->GetFloatField(env, sd2, jni_sd2Id);
	jclass jni_sx1Class = (*env)->GetObjectClass(env, sx1);
	jfieldID jni_sx1Id = (*env)->GetFieldID(env, jni_sx1Class, "val", "D");
	jfloat jni_sx1 = (*env)->GetFloatField(env, sx1, jni_sx1Id);
	jfloat * jni_sparam = (*env)->GetPrimitiveArrayCritical(env, sparam, JNI_FALSE);
	check_memory(env, jni_sparam);

	cblas_srotmg(&jni_sd1, &jni_sd2, &jni_sx1, sy1, jni_sparam);

	(*env)->SetFloatField(env, sd1, jni_sd1Id, jni_sd1);
	(*env)->SetFloatField(env, sd2, jni_sd2Id, jni_sd2);
	(*env)->SetFloatField(env, sx1, jni_sx1Id, jni_sx1);
	(*env)->ReleasePrimitiveArrayCritical(env, sparam, jni_sparam, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_ssbmv (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jint k, jfloat alpha, jfloatArray a, jint lda, jfloatArray x, jint incx, jfloat beta, jfloatArray y, jint incy){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_ssbmv(F2J_JNI_ORDER, getUpLo(jni_uplo), n, k, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sscal (JNIEnv * env, jobject calling_obj, jint n, jfloat sa, jfloatArray sx, jint incx){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);

	cblas_sscal(n, sa, jni_sx, incx);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sspmv (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jfloat alpha, jfloatArray ap, jfloatArray x, jint incx, jfloat beta, jfloatArray y, jint incy){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jfloat * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_sspmv(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_ap, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sspr (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jfloat alpha, jfloatArray x, jint incx, jfloatArray ap){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);

	cblas_sspr(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_x, incx, jni_ap);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sspr2 (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jfloat alpha, jfloatArray x, jint incx, jfloatArray y, jint incy, jfloatArray ap){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);
	jfloat * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);

	cblas_sspr2(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_x, incx, jni_y, incy, jni_ap);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_sswap (JNIEnv * env, jobject calling_obj, jint n, jfloatArray sx, jint incx, jfloatArray sy, jint incy){
	jfloat * jni_sx = (*env)->GetPrimitiveArrayCritical(env, sx, JNI_FALSE);
	check_memory(env, jni_sx);
	jfloat * jni_sy = (*env)->GetPrimitiveArrayCritical(env, sy, JNI_FALSE);
	check_memory(env, jni_sy);

	cblas_sswap(n, jni_sx, incx, jni_sy, incy);

	(*env)->ReleasePrimitiveArrayCritical(env, sx, jni_sx, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, sy, jni_sy, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_ssymm (JNIEnv * env, jobject calling_obj, jstring side, jstring uplo, jint m, jint n, jfloat alpha, jfloatArray a, jint lda, jfloatArray b, jint ldb, jfloat beta, jfloatArray c, jint Ldc){
	char * jni_side = (char *)(*env)->GetStringUTFChars(env, side, JNI_FALSE);
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);
	jfloat * jni_c = (*env)->GetPrimitiveArrayCritical(env, c, JNI_FALSE);
	check_memory(env, jni_c);

	cblas_ssymm(F2J_JNI_ORDER, getSide(jni_side), getUpLo(jni_uplo), m, n, alpha, jni_a, lda, jni_b, ldb, beta, jni_c, Ldc);

	(*env)->ReleaseStringUTFChars(env, side, jni_side);
	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, c, jni_c, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_ssymv (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jfloat alpha, jfloatArray a, jint lda, jfloatArray x, jint incx, jfloat beta, jfloatArray y, jint incy){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);

	cblas_ssymv(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_a, lda, jni_x, incx, beta, jni_y, incy);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_ssyr (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jfloat alpha, jfloatArray x, jint incx, jfloatArray a, jint lda){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);

	cblas_ssyr(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_x, incx, jni_a, lda);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_ssyr2 (JNIEnv * env, jobject calling_obj, jstring uplo, jint n, jfloat alpha, jfloatArray x, jint incx, jfloatArray y, jint incy, jfloatArray a, jint lda){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);
	jfloat * jni_y = (*env)->GetPrimitiveArrayCritical(env, y, JNI_FALSE);
	check_memory(env, jni_y);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);

	cblas_ssyr2(F2J_JNI_ORDER, getUpLo(jni_uplo), n, alpha, jni_x, incx, jni_y, incy, jni_a, lda);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, y, jni_y, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_ssyr2k (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jint n, jint k, jfloat alpha, jfloatArray a, jint lda, jfloatArray b, jint ldb, jfloat beta, jfloatArray c, jint Ldc){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);
	jfloat * jni_c = (*env)->GetPrimitiveArrayCritical(env, c, JNI_FALSE);
	check_memory(env, jni_c);

	cblas_ssyr2k(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), n, k, alpha, jni_a, lda, jni_b, ldb, beta, jni_c, Ldc);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, c, jni_c, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_ssyrk (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jint n, jint k, jfloat alpha, jfloatArray a, jint lda, jfloat beta, jfloatArray c, jint Ldc){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_c = (*env)->GetPrimitiveArrayCritical(env, c, JNI_FALSE);
	check_memory(env, jni_c);

	cblas_ssyrk(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), n, k, alpha, jni_a, lda, beta, jni_c, Ldc);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, c, jni_c, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_stbmv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jint k, jfloatArray a, jint lda, jfloatArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_stbmv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, k, jni_a, lda, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_stbsv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jint k, jfloatArray a, jint lda, jfloatArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_stbsv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, k, jni_a, lda, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_stpmv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jfloatArray ap, jfloatArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jfloat * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_stpmv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, jni_ap, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_stpsv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jfloatArray ap, jfloatArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jfloat * jni_ap = (*env)->GetPrimitiveArrayCritical(env, ap, JNI_FALSE);
	check_memory(env, jni_ap);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_stpsv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, jni_ap, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, ap, jni_ap, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_strmm (JNIEnv * env, jobject calling_obj, jstring side, jstring uplo, jstring transa, jstring diag, jint m, jint n, jfloat alpha, jfloatArray a, jint lda, jfloatArray b, jint ldb){
	char * jni_side = (char *)(*env)->GetStringUTFChars(env, side, JNI_FALSE);
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_transa = (char *)(*env)->GetStringUTFChars(env, transa, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);

	cblas_strmm(F2J_JNI_ORDER, getSide(jni_side), getUpLo(jni_uplo), getTrans(jni_transa), getDiag(jni_diag), m, n, alpha, jni_a, lda, jni_b, ldb);

	(*env)->ReleaseStringUTFChars(env, side, jni_side);
	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, transa, jni_transa);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_strmv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jfloatArray a, jint lda, jfloatArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_strmv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, jni_a, lda, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_strsm (JNIEnv * env, jobject calling_obj, jstring side, jstring uplo, jstring transa, jstring diag, jint m, jint n, jfloat alpha, jfloatArray a, jint lda, jfloatArray b, jint ldb){
	char * jni_side = (char *)(*env)->GetStringUTFChars(env, side, JNI_FALSE);
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_transa = (char *)(*env)->GetStringUTFChars(env, transa, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_b = (*env)->GetPrimitiveArrayCritical(env, b, JNI_FALSE);
	check_memory(env, jni_b);

	cblas_strsm(F2J_JNI_ORDER, getSide(jni_side), getUpLo(jni_uplo), getTrans(jni_transa), getDiag(jni_diag), m, n, alpha, jni_a, lda, jni_b, ldb);

	(*env)->ReleaseStringUTFChars(env, side, jni_side);
	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, transa, jni_transa);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, b, jni_b, 0);
}

JNIEXPORT void JNICALL Java_org_netlib_blas_NativeBLAS_strsv (JNIEnv * env, jobject calling_obj, jstring uplo, jstring trans, jstring diag, jint n, jfloatArray a, jint lda, jfloatArray x, jint incx){
	char * jni_uplo = (char *)(*env)->GetStringUTFChars(env, uplo, JNI_FALSE);
	char * jni_trans = (char *)(*env)->GetStringUTFChars(env, trans, JNI_FALSE);
	char * jni_diag = (char *)(*env)->GetStringUTFChars(env, diag, JNI_FALSE);
	jfloat * jni_a = (*env)->GetPrimitiveArrayCritical(env, a, JNI_FALSE);
	check_memory(env, jni_a);
	jfloat * jni_x = (*env)->GetPrimitiveArrayCritical(env, x, JNI_FALSE);
	check_memory(env, jni_x);

	cblas_strsv(F2J_JNI_ORDER, getUpLo(jni_uplo), getTrans(jni_trans), getDiag(jni_diag), n, jni_a, lda, jni_x, incx);

	(*env)->ReleaseStringUTFChars(env, uplo, jni_uplo);
	(*env)->ReleaseStringUTFChars(env, trans, jni_trans);
	(*env)->ReleaseStringUTFChars(env, diag, jni_diag);
	(*env)->ReleasePrimitiveArrayCritical(env, a, jni_a, 0);
	(*env)->ReleasePrimitiveArrayCritical(env, x, jni_x, 0);
}

