[PPL-devel] [GIT] ppl/ppl(master): Completed draft Java interface for PIP_Problem ( untested).
Patricia Hill
p.m.hill at leeds.ac.uk
Tue Mar 30 18:43:27 CEST 2010
Module: ppl/ppl
Branch: master
Commit: 08a88693cc732a773db32c70afe8b85d64a2c67f
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=08a88693cc732a773db32c70afe8b85d64a2c67f
Author: Patricia Hill <p.m.hill at leeds.ac.uk>
Date: Tue Mar 30 15:12:11 2010 +0100
Completed draft Java interface for PIP_Problem (untested).
---
interfaces/Java/jni/ppl_java_globals.cc | 31 ++++++++++++-------
.../Constraint_System_Iterator.java | 4 ++
2 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/interfaces/Java/jni/ppl_java_globals.cc b/interfaces/Java/jni/ppl_java_globals.cc
index f05c6e9..d253fe2 100644
--- a/interfaces/Java/jni/ppl_java_globals.cc
+++ b/interfaces/Java/jni/ppl_java_globals.cc
@@ -1474,7 +1474,8 @@ Java_parma_1polyhedra_1library_IO_wrap_1string
jint preferred_first_line_length, jint preferred_line_length) {
try {
unsigned ind = jtype_to_unsigned<unsigned int>(indent_depth);
- unsigned pfll = jtype_to_unsigned<unsigned int>(preferred_first_line_length);
+ unsigned pfll = jtype_to_unsigned<unsigned int>
+ (preferred_first_line_length);
unsigned pll = jtype_to_unsigned<unsigned int>(preferred_line_length);
const char* chars = env->GetStringUTFChars(str, 0);
CHECK_RESULT_RETURN(env, chars, 0);
@@ -1549,9 +1550,11 @@ Java_parma_1polyhedra_1library_Constraint_1System_1Iterator_equals
(JNIEnv* env, jobject j_this, jobject j_y) {
try {
Constraint_System::const_iterator* this_ptr
- = reinterpret_cast<Constraint_System::const_iterator*>(get_ptr(env, j_this));
+ = reinterpret_cast<Constraint_System::const_iterator*>
+ (get_ptr(env, j_this));
Constraint_System::const_iterator* y_ptr
- = reinterpret_cast<Constraint_System::const_iterator*>(get_ptr(env, j_y));
+ = reinterpret_cast<Constraint_System::const_iterator*>
+ (get_ptr(env, j_y));
return *this_ptr == *y_ptr;
}
CATCH_ALL;
@@ -1562,7 +1565,8 @@ JNIEXPORT void JNICALL
Java_parma_1polyhedra_1library_Constraint_1System_1Iterator_next
(JNIEnv* env, jobject j_this) try {
Constraint_System::const_iterator* this_ptr
- = reinterpret_cast<Constraint_System::const_iterator*>(get_ptr(env, j_this));
+ = reinterpret_cast<Constraint_System::const_iterator*>
+ (get_ptr(env, j_this));
++(*this_ptr);
}
CATCH_ALL
@@ -1572,7 +1576,8 @@ Java_parma_1polyhedra_1library_Constraint_1System_1Iterator_get_1constraint
(JNIEnv* env, jobject j_this) {
try {
Constraint_System::const_iterator* this_ptr
- = reinterpret_cast<Constraint_System::const_iterator*>(get_ptr(env, j_this));
+ = reinterpret_cast<Constraint_System::const_iterator*>
+ (get_ptr(env, j_this));
jclass j_class = env->FindClass("parma_polyhedra_library/Constraint");
CHECK_RESULT_ASSERT(env, j_class);
jmethodID j_ctr_id = env->GetMethodID(j_class, "<init>", "()V");
@@ -1592,7 +1597,8 @@ Java_parma_1polyhedra_1library_Constraint_1System_1Iterator_free
(JNIEnv* env, jobject j_this) try {
if (!is_java_marked(env, j_this)) {
Constraint_System::const_iterator* this_ptr
- = reinterpret_cast<Constraint_System::const_iterator*>(get_ptr(env, j_this));
+ = reinterpret_cast<Constraint_System::const_iterator*>
+ (get_ptr(env, j_this));
delete this_ptr;
void* null_ptr = 0;
set_ptr(env, j_this, null_ptr);
@@ -1605,7 +1611,8 @@ Java_parma_1polyhedra_1library_Constraint_1System_1Iterator_finalize
(JNIEnv* env, jobject j_this) try {
if (!is_java_marked(env, j_this)) {
Constraint_System::const_iterator* this_ptr
- = reinterpret_cast<Constraint_System::const_iterator*>(get_ptr(env, j_this));
+ = reinterpret_cast<Constraint_System::const_iterator*>
+ (get_ptr(env, j_this));
delete this_ptr;
}
}
@@ -1622,7 +1629,6 @@ Java_parma_1polyhedra_1library_PIP_1Problem_build_1cpp_1object__J
CATCH_ALL;
}
-/*
JNIEXPORT void JNICALL
Java_parma_1polyhedra_1library_PIP_1Problem_build_1cpp_1object__JLparma_1polyhedra_1library_Constraint_1System_1Iterator_2Lparma_1polyhedra_1library_Constraint_1System_1Iterator_2Lparma_1polyhedra_1library_Variables_1Set_2
(JNIEnv* env , jobject j_this_pip_problem, jlong j_dim,
@@ -1630,16 +1636,17 @@ Java_parma_1polyhedra_1library_PIP_1Problem_build_1cpp_1object__JLparma_1polyhed
try {
dimension_type p_dim = jtype_to_unsigned<dimension_type>(j_dim);
Constraint_System::const_iterator* p_first
- = reinterpret_cast<Constraint_System::iterator*>(get_ptr(env, j_first));
+ = reinterpret_cast<Constraint_System::const_iterator*>
+ (get_ptr(env, j_first));
Constraint_System::const_iterator* p_last
- = reinterpret_cast<Constraint_System::iterator*>(get_ptr(env, j_last));
+ = reinterpret_cast<Constraint_System::const_iterator*>
+ (get_ptr(env, j_last));
Variables_Set p_vars = build_cxx_variables_set(env, j_vars);
- PIP_Problem* pip_ptr = new PIP_Problem(p_dim, p_first, p_last, p_vars);
+ PIP_Problem* pip_ptr = new PIP_Problem(p_dim, *p_first, *p_last, p_vars);
set_ptr(env, j_this_pip_problem, pip_ptr);
}
CATCH_ALL;
}
-*/
JNIEXPORT void JNICALL
Java_parma_1polyhedra_1library_PIP_1Problem_build_1cpp_1object__Lparma_1polyhedra_1library_PIP_1Problem_2
diff --git a/interfaces/Java/parma_polyhedra_library/Constraint_System_Iterator.java b/interfaces/Java/parma_polyhedra_library/Constraint_System_Iterator.java
index 6a68570..d27eb74 100644
--- a/interfaces/Java/parma_polyhedra_library/Constraint_System_Iterator.java
+++ b/interfaces/Java/parma_polyhedra_library/Constraint_System_Iterator.java
@@ -41,6 +41,10 @@ public class Constraint_System_Iterator extends PPL_Object {
public native boolean equals(Constraint_System_Iterator itr);
+ public native void begin();
+
+ public native void end();
+
public native void next();
public native Constraint get_constraint();
More information about the PPL-devel
mailing list