Compare View
Commits (4)
Showing
2 changed files
Show diff stats
stim/biomodels/centerline.h
@@ -330,8 +330,10 @@ public: | @@ -330,8 +330,10 @@ public: | ||
330 | #endif | 330 | #endif |
331 | } | 331 | } |
332 | else { | 332 | else { |
333 | - auto smallest = std::min_element(dist.begin(), dist.end()); | ||
334 | - auto i = std::distance(dist.begin(), smallest); // find the index of min-distance in distance list | 333 | + // auto smallest = std::min_element(dist.begin(), dist.end()); |
334 | + unsigned int smallest = std::min_element(dist.begin(), dist.end()); | ||
335 | + // auto i = std::distance(dist.begin(), smallest); // find the index of min-distance in distance list | ||
336 | + unsigned int i = std::distance(dist.begin(), smallest); // find the index of min-distance in distance list | ||
335 | 337 | ||
336 | // stitch position in c1 and c2 | 338 | // stitch position in c1 and c2 |
337 | int id1 = index[i]; | 339 | int id1 = index[i]; |
stim/biomodels/network.h
@@ -599,7 +599,7 @@ public: | @@ -599,7 +599,7 @@ public: | ||
599 | int dims[2]; ///number of vertex, number of edges | 599 | int dims[2]; ///number of vertex, number of edges |
600 | readHeader(filename, &dims[0]); //read header | 600 | readHeader(filename, &dims[0]); //read header |
601 | std::ifstream file; | 601 | std::ifstream file; |
602 | - file.open(filename, std::ios::in | std::ios::binary); ///skip header information. | 602 | + file.open(filename.c_str(), std::ios::in | std::ios::binary); ///skip header information. |
603 | file.seekg(14+58+4+4, file.beg); | 603 | file.seekg(14+58+4+4, file.beg); |
604 | vertex v; | 604 | vertex v; |
605 | for(int i = 0; i < dims[0]; i++) ///for every vertex, read vertex, add to network. | 605 | for(int i = 0; i < dims[0]; i++) ///for every vertex, read vertex, add to network. |
@@ -626,7 +626,7 @@ public: | @@ -626,7 +626,7 @@ public: | ||
626 | { | 626 | { |
627 | writeHeader(filename); | 627 | writeHeader(filename); |
628 | std::ofstream file; | 628 | std::ofstream file; |
629 | - file.open(filename, std::ios::out | std::ios::binary | std::ios::app); ///since we have written the header we are not appending. | 629 | + file.open(filename.c_str(), std::ios::out | std::ios::binary | std::ios::app); ///since we have written the header we are not appending. |
630 | for(int i = 0; i < V.size(); i++) ///look through the Vertices and write each one. | 630 | for(int i = 0; i < V.size(); i++) ///look through the Vertices and write each one. |
631 | { | 631 | { |
632 | // std::cout << i << " " << V[i].str() << std::endl; | 632 | // std::cout << i << " " << V[i].str() << std::endl; |
@@ -650,7 +650,7 @@ public: | @@ -650,7 +650,7 @@ public: | ||
650 | int hNumVertices = V.size(); ///int byte header storing the number of vertices in the file | 650 | int hNumVertices = V.size(); ///int byte header storing the number of vertices in the file |
651 | int hNumEdges = E.size(); ///int byte header storing the number of edges. | 651 | int hNumEdges = E.size(); ///int byte header storing the number of edges. |
652 | std::ofstream file; | 652 | std::ofstream file; |
653 | - file.open(filename, std::ios::out | std::ios::binary); | 653 | + file.open(filename.c_str(), std::ios::out | std::ios::binary); |
654 | std::cout << hNumVertices << " " << hNumEdges << std::endl; | 654 | std::cout << hNumVertices << " " << hNumEdges << std::endl; |
655 | file.write(reinterpret_cast<const char*>(&magicString.c_str()[0]), 14); //write the file id | 655 | file.write(reinterpret_cast<const char*>(&magicString.c_str()[0]), 14); //write the file id |
656 | file.write(reinterpret_cast<const char*>(&desc.c_str()[0]), 58); //write the description | 656 | file.write(reinterpret_cast<const char*>(&desc.c_str()[0]), 58); //write the description |
@@ -670,7 +670,7 @@ public: | @@ -670,7 +670,7 @@ public: | ||
670 | int hNumVertices; ///#vert | 670 | int hNumVertices; ///#vert |
671 | int hNumEdges; ///#edges | 671 | int hNumEdges; ///#edges |
672 | std::ifstream file; ////create stream | 672 | std::ifstream file; ////create stream |
673 | - file.open(filename, std::ios::in | std::ios::binary); | 673 | + file.open(filename.c_str(), std::ios::in | std::ios::binary); |
674 | file.read(reinterpret_cast<char*>(&magicString[0]), 14); ///read the file id. | 674 | file.read(reinterpret_cast<char*>(&magicString[0]), 14); ///read the file id. |
675 | file.read(reinterpret_cast<char*>(&desc[0]), 58); ///read the description | 675 | file.read(reinterpret_cast<char*>(&desc[0]), 58); ///read the description |
676 | file.read(reinterpret_cast<char*>(&hNumVertices), sizeof(int)); ///read the number of vertices | 676 | file.read(reinterpret_cast<char*>(&hNumVertices), sizeof(int)); ///read the number of vertices |