diff --git a/stim/math/matrix.h b/stim/math/matrix.h index abe60dd..5530040 100644 --- a/stim/math/matrix.h +++ b/stim/math/matrix.h @@ -435,6 +435,14 @@ public: } } + void raw(std::string filename) { + ofstream out(filename, std::ios::binary); + if (out) { + out.write((char*)data(), rows() * cols() * sizeof(T)); + out.close(); + } + } + void mat4(stim::mat4file& file, std::string name = std::string("unknown"), mat4Format format = mat4_float) { //make sure the matrix name is valid (only numbers and letters, with a letter at the beginning for (size_t c = 0; c < name.size(); c++) { diff --git a/stim/parser/filename.h b/stim/parser/filename.h index 0a47ec7..b0ce603 100644 --- a/stim/parser/filename.h +++ b/stim/parser/filename.h @@ -89,8 +89,11 @@ protected: absolute.push_back(relative[i]); } } - else + else { + if (relative[0] == ".") + relative = std::vector(relative.begin() + 1, relative.end()); absolute = relative; + } } /// Parses a directory string into a drive (NULL if not Windows) and list of hierarchical directories -- libgit2 0.21.4