diff --git a/prism/include/ExportIterations.h b/prism/include/ExportIterations.h index 9ea8599d..8a8a1ef6 100644 --- a/prism/include/ExportIterations.h +++ b/prism/include/ExportIterations.h @@ -41,6 +41,7 @@ class ExportIterations { private: FILE *fp; + std::string filename; public: /** @@ -48,6 +49,7 @@ public: */ ExportIterations(const char* title = "", const char* filename = get_export_iterations_filename()) { fp = fopen(filename, "w"); + this->filename = filename; fprintf(fp, "\n"); fprintf(fp, "\n"); @@ -64,6 +66,13 @@ public: fprintf(fp, "\n"); } + /** + * Get the filename used for exporting. + */ + const std::string& getFileName() { + return filename; + } + /** * Export the given vector, with size n and given type (0 = normal, VI from below, 1 = VI from above) */ diff --git a/prism/src/explicit/ExportIterations.java b/prism/src/explicit/ExportIterations.java index 196177bb..54c874c5 100644 --- a/prism/src/explicit/ExportIterations.java +++ b/prism/src/explicit/ExportIterations.java @@ -70,6 +70,18 @@ public class ExportIterations { log.flush(); } + /** + * Returns the name of the file used for exporting, + * or {@code null} if it can not be determined. + */ + public String getFileName() + { + if (log instanceof PrismFileLog) { + return ((PrismFileLog)log).getFileName(); + } + return null; + } + /** * Export the given vector. * @param soln the value vector