From 7454f81abe0cd5477c5e5ab6e86555de58e090f1 Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Mon, 22 Jul 2013 08:27:09 +0000 Subject: [PATCH] Update comments git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@7118 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/dv/DoubleVector.java | 27 ++++++++++++++++++++++----- prism/src/dv/package-info.java | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/prism/src/dv/DoubleVector.java b/prism/src/dv/DoubleVector.java index 4da7e5a3..052bdd92 100644 --- a/prism/src/dv/DoubleVector.java +++ b/prism/src/dv/DoubleVector.java @@ -67,13 +67,21 @@ public class DoubleVector // instance variables/methods //------------------------------------------------------------------------------ - // data - private long v; // vector (actually a C/C++ pointer cast to a long) - private int n; // size + /** + * Vector contents (C/C++ pointer cast to a long) + */ + private long v; + /** + * Size of vector + */ + private int n; // constructors - private native long DV_CreateZeroVector(int n); + /** + * Create a new DoubleVector of size {@code size} with all entries set to 0. + * @throws PrismException if there is insufficient memory to create the array. + */ public DoubleVector(int size) throws PrismException { v = DV_CreateZeroVector(size); @@ -81,19 +89,28 @@ public class DoubleVector n = size; } + private native long DV_CreateZeroVector(int n); + + /** + * Create a new DoubleVector from a pointer {@code vect} to an existing native double array of size {@code size}. + */ public DoubleVector(long vector, int size) { v = vector; n = size; } - private native long DV_ConvertMTBDD(long dd, long vars, int num_vars, long odd); + /** + * Create a new DoubleVector from an existing MTBDD representation of an array. + */ public DoubleVector(JDDNode dd, JDDVars vars, ODDNode odd) { v = DV_ConvertMTBDD(dd.ptr(), vars.array(), vars.n(), odd.ptr()); n = (int)(odd.getEOff() + odd.getTOff()); } + private native long DV_ConvertMTBDD(long dd, long vars, int num_vars, long odd); + // get methods public long getPtr() diff --git a/prism/src/dv/package-info.java b/prism/src/dv/package-info.java index 64fe5050..3a70c127 100644 --- a/prism/src/dv/package-info.java +++ b/prism/src/dv/package-info.java @@ -1,4 +1,4 @@ /** - * Utility functions for operations on vectors of doubles (stored in C++ through JNI). + * Utility functions for operations on vectors of doubles or integers (stored in C++ through JNI). */ package dv;