Vuelva una matriz primitiva 2D de C a Java desde JNI / NDK

He encontrado grandes cantidades de documentación sobre cómo generar una matriz primitiva 2D en JNI y devolverla a Java. Pero estos datos no describen cómo pasar unaya exist 2D flotante (flotante **) dado un contexto enC.

Para describir mi problema explícitamente, agregaré algunasC pseudocódigo de lo que me gustaría implementar:

// Returns a 2D float array from C to Java
jfloatArray ndk_test_getMy2DArray(JNIEnv* env, jobject thiz, jlong context)
{
    // Cast my context reference
    MyContextRef contextRef = (MyContextRef) context;

    // In case we need it below
    unsigned int length = MyContextGet1DLength(contextRef);

    // Get the 2D Array we want to "Cast"
    float** primitive2DArray = MyContextGet2DArray(contextRef);

    // Hokus pokus...
    // We do something to create the returnable data to Java
    //
    // Below is the missing piece that would convert the primitive
    // 2D array into something that can be returned consumed and consumed
    // by Java

    jfloatArray myReturnable2DArray

    return myReturnable2DArray;
}

Supongo que esto no es sencillo, dado que no he podido encontrar nada que describa este escenario.

Gracias por cualquier información útil.

Respuestas a la pregunta(3)

Su respuesta a la pregunta