Compare commits
5 Commits
main
...
060b9f9182
| Author | SHA1 | Date | |
|---|---|---|---|
| 060b9f9182 | |||
| 59fd47e684 | |||
| 593b813988 | |||
| 5f6305a2f2 | |||
| dddf8ca632 |
@@ -8,11 +8,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
# set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
add_compile_options(-ggdb)
|
||||
|
||||
include_directories(
|
||||
external/include
|
||||
shared/inc
|
||||
)
|
||||
|
||||
include_directories(external/include/)
|
||||
link_libraries(
|
||||
${CMAKE_SOURCE_DIR}/external/libimgui.a
|
||||
${CMAKE_SOURCE_DIR}/external/libraylib.a
|
||||
@@ -22,7 +18,11 @@ link_libraries(
|
||||
m
|
||||
)
|
||||
|
||||
add_library(shared STATIC
|
||||
add_executable(app
|
||||
app/src/main.cpp
|
||||
app/src/App.cpp
|
||||
app/src/DnaStore.cpp
|
||||
app/src/sys.cpp
|
||||
shared/src/canvas/BackGround.cpp
|
||||
shared/src/canvas/BackGroundColors.cpp
|
||||
shared/src/canvas/Canvas.cpp
|
||||
@@ -32,33 +32,36 @@ add_library(shared STATIC
|
||||
shared/src/values/mrand.cpp
|
||||
shared/src/values/Similarity.cpp
|
||||
shared/src/TcpSocket.cpp
|
||||
shared/src/sql.cpp
|
||||
)
|
||||
|
||||
add_executable(app
|
||||
app/src/main.cpp
|
||||
app/src/App.cpp
|
||||
app/src/DnaStore.cpp
|
||||
app/src/sys.cpp
|
||||
)
|
||||
target_include_directories(app PRIVATE app/inc)
|
||||
target_link_libraries(app PRIVATE shared)
|
||||
# Add include directories
|
||||
target_include_directories(app PRIVATE app/inc shared/inc )
|
||||
|
||||
add_executable(server
|
||||
server/src/server.cpp
|
||||
server/src/checker.cpp
|
||||
|
||||
shared/src/sql.cpp
|
||||
shared/src/TcpSocket.cpp
|
||||
shared/src/values/Dna.cpp
|
||||
shared/src/values/DnaManager.cpp
|
||||
shared/src/values/mrand.cpp
|
||||
)
|
||||
target_include_directories(server PRIVATE server/inc)
|
||||
target_link_libraries(server PRIVATE shared)
|
||||
# Add include directories
|
||||
target_include_directories(server PRIVATE server/inc shared/inc)
|
||||
|
||||
add_executable(view
|
||||
view/src/main.cpp
|
||||
view/src/Vapp.cpp
|
||||
)
|
||||
target_include_directories(view PRIVATE view/inc)
|
||||
target_link_libraries(view PRIVATE shared)
|
||||
shared/src/canvas/BackGround.cpp
|
||||
shared/src/canvas/BackGroundColors.cpp
|
||||
shared/src/canvas/Canvas.cpp
|
||||
shared/src/canvas/Tree.cpp
|
||||
shared/src/values/Dna.cpp
|
||||
shared/src/values/DnaManager.cpp
|
||||
shared/src/values/mrand.cpp
|
||||
shared/src/values/Similarity.cpp
|
||||
|
||||
add_executable(slike
|
||||
random/slike.cpp
|
||||
shared/src/sql.cpp
|
||||
)
|
||||
target_link_libraries(slike PRIVATE shared)
|
||||
# Add include directories
|
||||
target_include_directories(view PRIVATE view/inc shared/inc)
|
||||
147
random/slike.cpp
147
random/slike.cpp
@@ -1,147 +0,0 @@
|
||||
#include <raylib.h>
|
||||
#include <raymath.h>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
Vector2 newPoint(Vector2 start, float len, float angleD){
|
||||
float angleR = (angleD * PI) / 180; // radian
|
||||
return {start.x + len * cos(angleR), start.y - len * sin(angleR)};
|
||||
}
|
||||
|
||||
void drawBranch(Vector2 startV, Vector2 endV, Color startC, Color endC, int startR, int endR){
|
||||
float fstep = 0.05;
|
||||
for (float i = 0; i < 1.05; i += fstep)
|
||||
{
|
||||
Vector2 point = Vector2Lerp(startV, endV, i);
|
||||
Color color = ColorLerp(startC, endC, i);
|
||||
int size = Lerp(startR, endR, i);
|
||||
DrawCircleV(point, size, color);
|
||||
}
|
||||
}
|
||||
|
||||
constexpr float screenWidth = 800;
|
||||
constexpr float screenHeight = 800;
|
||||
|
||||
constexpr float len = 300;
|
||||
constexpr float angleD = 100;
|
||||
constexpr Vector2 start = {screenWidth / 2, screenHeight - 100};
|
||||
constexpr float radius = 20;
|
||||
constexpr float radiusS = 80;
|
||||
constexpr float radiusE = 60;
|
||||
constexpr Color colorS = RED;
|
||||
constexpr Color colorE = GREEN;
|
||||
|
||||
typedef void (*slika)();
|
||||
|
||||
int idx = 0;
|
||||
|
||||
std::vector<slika> v_slik = {
|
||||
[]()
|
||||
{
|
||||
DrawCircleV(start, radius, BLACK);
|
||||
},
|
||||
|
||||
[]()
|
||||
{
|
||||
Vector2 end = {start.x, start.y - len};
|
||||
DrawCircleV(start, radius, BLACK);
|
||||
DrawLineEx(start, end, 10, BLACK);
|
||||
},
|
||||
|
||||
[]()
|
||||
{
|
||||
Vector2 end = newPoint(start, len, angleD);
|
||||
DrawCircleV(start, radius, BLACK);
|
||||
DrawLineEx(start, end, 10, BLACK);
|
||||
DrawCircleV(end, radius, BLACK);
|
||||
DrawCircleSectorLines(start, len / 3, 360 - angleD, 360, 30, BLACK);
|
||||
},
|
||||
|
||||
[]()
|
||||
{
|
||||
Vector2 end = newPoint(start, len, angleD);
|
||||
DrawCircleV(start, radius, BLACK);
|
||||
DrawLineEx(start, end, 10, BLACK);
|
||||
DrawCircleV(end, radius, BLACK);
|
||||
DrawCircleLinesV(start, radiusS, BLACK);
|
||||
DrawCircleLinesV(end, radiusE, BLACK);
|
||||
},
|
||||
|
||||
[]()
|
||||
{
|
||||
Vector2 end = newPoint(start, len, angleD);
|
||||
DrawLineEx(start, end, 10, BLACK);
|
||||
DrawCircleV(start, radiusS, colorS);
|
||||
DrawCircleV(end, radiusE, colorE);
|
||||
},
|
||||
|
||||
[]()
|
||||
{
|
||||
Vector2 end = newPoint(start, len, angleD);
|
||||
drawBranch(start, end, colorS, colorE, radiusS, radiusE);
|
||||
},
|
||||
|
||||
[]()
|
||||
{
|
||||
Vector2 p = newPoint(start, len, angleD);
|
||||
drawBranch(start, p, colorS, colorE, radiusS, radiusE);
|
||||
Vector2 p1 = newPoint(p, len, 135);
|
||||
Vector2 p2 = newPoint(p, len, 90);
|
||||
Vector2 p3 = newPoint(p, len, 45);
|
||||
DrawLineEx(p, p1, 10, BLACK);
|
||||
DrawLineEx(p, p2, 10, BLACK);
|
||||
DrawLineEx(p, p3, 10, BLACK);
|
||||
DrawCircleV(p, radius, BLACK);
|
||||
DrawCircleV(p1, radius, BLACK);
|
||||
DrawCircleV(p2, radius, BLACK);
|
||||
DrawCircleV(p3, radius, BLACK);
|
||||
},
|
||||
|
||||
[]()
|
||||
{
|
||||
Vector2 p = newPoint(start, len, angleD);
|
||||
drawBranch(start, p, colorS, colorE, radiusS, radiusE);
|
||||
Vector2 p1 = newPoint(p, len, 135);
|
||||
Vector2 p2 = newPoint(p, len, 90);
|
||||
Vector2 p3 = newPoint(p, len, 45);
|
||||
drawBranch(p, p1, colorE, BLUE, radiusE, 50);
|
||||
drawBranch(p, p2, colorE, ORANGE, radiusE, 50);
|
||||
drawBranch(p, p3, colorE, PURPLE, radiusE, 50);
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
InitWindow(screenWidth, screenHeight, "Slike");
|
||||
SetTargetFPS(60);
|
||||
|
||||
while (!WindowShouldClose())
|
||||
{
|
||||
BeginDrawing();
|
||||
if (IsKeyPressed(KEY_S))
|
||||
{
|
||||
TakeScreenshot(TextFormat("slika%.2d.png", idx));
|
||||
}
|
||||
if (IsKeyPressed(KEY_N))
|
||||
{
|
||||
idx++;
|
||||
if (idx >= v_slik.size())
|
||||
idx = v_slik.size() - 1;
|
||||
}
|
||||
if (IsKeyPressed(KEY_P))
|
||||
{
|
||||
idx--;
|
||||
if (idx < 0)
|
||||
idx = 0;
|
||||
}
|
||||
ClearBackground(WHITE);
|
||||
v_slik[idx]();
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
||||
|
||||
CloseWindow();
|
||||
return 0;
|
||||
}
|
||||
@@ -32,9 +32,8 @@ private:
|
||||
Vector2 start = {0};
|
||||
std::list<DrawArgs> drawCalls;
|
||||
|
||||
void calculateBranch();
|
||||
void drawBranch();
|
||||
|
||||
void drawBranch(Vector2 startPoint, Vector2 endPoint, Color startColor, Color endColor, float startThickness, float endThickness);
|
||||
inline size_t getNumOfBranches(int dep);
|
||||
inline Color getStartColor(DrawArgs &arg);
|
||||
inline Color getEndColor(int dep, Color &start);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Similarity
|
||||
{
|
||||
float euclidean_distance(Dna *d1, Dna *d2);// direct distance betwen vector. wont give 0 and 1
|
||||
float dot_minmax(Dna *d1, Dna *d2); // doent return betwen 0 to 1
|
||||
// float dot_product(Dna *d1, Dna *d2); // doent return betwen 0 to 1
|
||||
float cosine_similarity(Dna *d1, Dna *d2);
|
||||
float cosine_similarity_int(Dna *d1, Dna *d2);
|
||||
float hamming_distance(Dna *d1, Dna *d2);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
|
||||
#include "canvas/BackGround.hpp"
|
||||
#include "canvas/BackGroundColors.hpp"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <raylib.h>
|
||||
#include <raymath.h>
|
||||
#include <rlgl.h>
|
||||
|
||||
#define ITER_PER_FRAME 5000
|
||||
|
||||
@@ -57,7 +56,7 @@ bool Tree::tick()
|
||||
size_t i = 0;
|
||||
while (!drawCalls.empty())
|
||||
{
|
||||
calculateBranch();
|
||||
drawBranch();
|
||||
drawCalls.pop_front();
|
||||
i++;
|
||||
if (i >= ITER_PER_FRAME)
|
||||
@@ -69,7 +68,7 @@ bool Tree::tick()
|
||||
|
||||
// Private
|
||||
|
||||
void Tree::calculateBranch()
|
||||
void Tree::drawBranch()
|
||||
{
|
||||
DrawArgs arg = drawCalls.front();
|
||||
if (arg.dep == MAX_DEPTH)
|
||||
@@ -87,7 +86,7 @@ void Tree::calculateBranch()
|
||||
|
||||
Color colorStart = getStartColor(arg);
|
||||
Color colorEnd = getEndColor(arg.dep, colorStart);
|
||||
// drawBranch(arg.start, end, colorStart, colorEnd, sizeStart, sizeEnd);
|
||||
|
||||
for (float i = 0; i < 1; i += fstep)
|
||||
{
|
||||
Vector2 point = Vector2Lerp(arg.start, end, i);
|
||||
@@ -95,6 +94,9 @@ void Tree::calculateBranch()
|
||||
int size = Lerp(sizeStart, sizeEnd, i);
|
||||
DrawCircleV(point, size, color);
|
||||
//DrawTextureEx(texBunny, point,0, ((float)size) / texBunny.height, color);
|
||||
|
||||
// use
|
||||
// DrawRectangleGradientEx
|
||||
}
|
||||
|
||||
// add more branches to draw
|
||||
@@ -198,51 +200,3 @@ inline float Tree::getAngleVar(DrawArgs &arg)
|
||||
|
||||
return angleVar;
|
||||
}
|
||||
|
||||
void Tree::drawBranch(Vector2 startPoint, Vector2 endPoint, Color startColor, Color endColor, float startThickness, float endThickness)
|
||||
{
|
||||
// Calculate the direction vector from startPoint to endPoint
|
||||
Vector2 direction = {endPoint.x - startPoint.x, endPoint.y - startPoint.y};
|
||||
|
||||
// Normalize the direction vector
|
||||
float length = sqrtf(direction.x * direction.x + direction.y * direction.y);
|
||||
if (length == 0)
|
||||
length = 1; // Avoid division by zero
|
||||
Vector2 normalizedDir = {direction.x / length, direction.y / length};
|
||||
|
||||
// Calculate the perpendicular vector (rotate 90 degrees)
|
||||
Vector2 perpendicular = {-normalizedDir.y, normalizedDir.x};
|
||||
|
||||
// Calculate the four vertices of the quadrilateral
|
||||
Vector2 topLeft = {
|
||||
startPoint.x + perpendicular.x * startThickness,
|
||||
startPoint.y + perpendicular.y * startThickness};
|
||||
Vector2 topRight = {
|
||||
endPoint.x + perpendicular.x * endThickness,
|
||||
endPoint.y + perpendicular.y * endThickness};
|
||||
Vector2 bottomLeft = {
|
||||
startPoint.x - perpendicular.x * startThickness,
|
||||
startPoint.y - perpendicular.y * startThickness};
|
||||
Vector2 bottomRight = {
|
||||
endPoint.x - perpendicular.x * endThickness,
|
||||
endPoint.y - perpendicular.y * endThickness};
|
||||
|
||||
// Draw the two triangles to form the quadrilateral
|
||||
rlBegin(RL_TRIANGLES);
|
||||
// First triangle
|
||||
rlColor4ub(startColor.r, startColor.g, startColor.b, startColor.a);
|
||||
rlVertex2f(topLeft.x, topLeft.y);
|
||||
rlColor4ub(endColor.r, endColor.g, endColor.b, endColor.a);
|
||||
rlVertex2f(topRight.x, topRight.y);
|
||||
rlColor4ub(startColor.r, startColor.g, startColor.b, startColor.a);
|
||||
rlVertex2f(bottomLeft.x, bottomLeft.y);
|
||||
|
||||
// Second triangle
|
||||
rlColor4ub(startColor.r, startColor.g, startColor.b, startColor.a);
|
||||
rlVertex2f(bottomLeft.x, bottomLeft.y);
|
||||
rlColor4ub(endColor.r, endColor.g, endColor.b, endColor.a);
|
||||
rlVertex2f(topRight.x, topRight.y);
|
||||
rlColor4ub(endColor.r, endColor.g, endColor.b, endColor.a);
|
||||
rlVertex2f(bottomRight.x, bottomRight.y);
|
||||
rlEnd();
|
||||
}
|
||||
@@ -2,26 +2,10 @@
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <raylib.h>
|
||||
#include <chrono>
|
||||
|
||||
namespace Similarity
|
||||
{
|
||||
|
||||
float dot_minmax(Dna *d1, Dna *d2)
|
||||
{
|
||||
uint64_t max = sizeof(Dna) * 255 * 255;
|
||||
uint8_t *a = (uint8_t *)d1;
|
||||
uint8_t *b = (uint8_t *)d2;
|
||||
uint32_t result = 0;
|
||||
for (size_t i = 0; i < sizeof(Dna); ++i)
|
||||
{
|
||||
result += static_cast<uint32_t>(a[i]) * static_cast<uint32_t>(b[i]);
|
||||
}
|
||||
|
||||
return result / (double)max;
|
||||
}
|
||||
|
||||
float euclidean_distance(Dna *d1, Dna *d2)
|
||||
{
|
||||
uint8_t *a = (uint8_t *)d1;
|
||||
@@ -116,45 +100,8 @@ namespace Similarity
|
||||
return 1 - (distance / (end - start));
|
||||
}
|
||||
|
||||
const char *nameofFunc(simil_func f)
|
||||
{
|
||||
if (f == &Similarity::euclidean_distance)
|
||||
{
|
||||
return "eucl";
|
||||
}
|
||||
else if (f == &Similarity::dot_minmax)
|
||||
{
|
||||
return "dot";
|
||||
}
|
||||
else if (f == &Similarity::cosine_similarity)
|
||||
{
|
||||
return "cos";
|
||||
}
|
||||
else if (f == &Similarity::cosine_similarity_int)
|
||||
{
|
||||
return "cos_i";
|
||||
}
|
||||
else if (f == &Similarity::hamming_distance)
|
||||
{
|
||||
return "hamming_distance";
|
||||
}
|
||||
else if (f == &Similarity::hamming_distance_without_seeds)
|
||||
{
|
||||
return "hamming_distance_without_seeds";
|
||||
}
|
||||
else if (f == &Similarity::levenshtein_distance)
|
||||
{
|
||||
return "leven";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "unknown nameofFunc";
|
||||
}
|
||||
}
|
||||
|
||||
float calc_similarity(std::vector<Dna> &vec, simil_func f)
|
||||
{
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
size_t num_pairs = (vec.size() * (vec.size() - 1)) / 2;
|
||||
|
||||
float total_similarity = 0.0;
|
||||
@@ -166,11 +113,6 @@ namespace Similarity
|
||||
}
|
||||
}
|
||||
float average_similarity = total_similarity / num_pairs;
|
||||
|
||||
auto stop = std::chrono::high_resolution_clock::now();
|
||||
|
||||
const auto int_ms = std::chrono::duration_cast<std::chrono::microseconds>(stop - start);
|
||||
|
||||
return average_similarity * 100.0f;
|
||||
}
|
||||
|
||||
@@ -181,7 +123,7 @@ namespace Similarity
|
||||
uint8_t *b = (uint8_t *)d2;
|
||||
|
||||
// Create a distance matrix
|
||||
static std::vector<std::vector<uint32_t>> dp(len + 1, std::vector<uint32_t>(len + 1, 0));
|
||||
std::vector<std::vector<uint32_t>> dp(len + 1, std::vector<uint32_t>(len + 1, 0));
|
||||
|
||||
// Initialize the first row and column
|
||||
for (size_t i = 0; i <= len; ++i)
|
||||
|
||||
14
tmp.txt
14
tmp.txt
@@ -1,14 +0,0 @@
|
||||
eucl cos cos_i hamming dot leven
|
||||
91 117 181 87 41 105799
|
||||
60 78 305 250 40 100331
|
||||
61 78 121 105 40 97438
|
||||
66 81 124 106 40 97529
|
||||
60 78 127 108 40 96296
|
||||
62 85 131 104 39 96456
|
||||
61 81 125 106 40 96510
|
||||
61 81 125 103 40 97253
|
||||
61 81 125 78 40 97409
|
||||
60 82 125 103 40 99816
|
||||
62 81 128 81 40 98978
|
||||
68 81 126 58 40 98289
|
||||
61 88 130 60 39 99663
|
||||
@@ -28,7 +28,6 @@ public:
|
||||
private:
|
||||
bool showSelection;
|
||||
bool showStats;
|
||||
bool saveToFile;
|
||||
sqlite3 *db;
|
||||
sqlite3_stmt *get_gen_num;
|
||||
std::vector<int64_t> ids;
|
||||
|
||||
@@ -105,12 +105,12 @@ void Vapp::update()
|
||||
simil[1] = Similarity::calc_similarity(manager.vector, Similarity::cosine_similarity);
|
||||
simil[2] = Similarity::calc_similarity(manager.vector, Similarity::cosine_similarity_int);
|
||||
simil[3] = Similarity::calc_similarity(manager.vector, Similarity::hamming_distance);
|
||||
simil[4] = Similarity::calc_similarity(manager.vector, Similarity::levenshtein_distance);
|
||||
simil[5] = Similarity::calc_similarity(manager.vector, Similarity::dot_minmax);
|
||||
simil[4] = Similarity::calc_similarity(manager.vector, Similarity::hamming_distance_without_seeds);
|
||||
simil[5] = Similarity::calc_similarity(manager.vector, Similarity::levenshtein_distance);
|
||||
stageOfDrawing = DrawingStage::save;
|
||||
break;
|
||||
case DrawingStage::save:
|
||||
if(saveToFile) drawToFile();
|
||||
drawToFile();
|
||||
stageOfDrawing = DrawingStage::done;
|
||||
break;
|
||||
case DrawingStage::done:
|
||||
@@ -140,10 +140,6 @@ void Vapp::draw()
|
||||
{
|
||||
setUpTable();
|
||||
}
|
||||
if(ImGui::MenuItem("Save to File", nullptr, saveToFile, true))
|
||||
{
|
||||
saveToFile = !saveToFile;
|
||||
}
|
||||
ImGui::EndMainMenuBar();
|
||||
}
|
||||
|
||||
@@ -189,8 +185,8 @@ void Vapp::draw()
|
||||
ImGui::LabelText("##sim2", "cosine_similarity: %f", simil[1]);
|
||||
ImGui::LabelText("##sim3", "cosine_similarity_int: %f", simil[2]);
|
||||
ImGui::LabelText("##sim4", "hamming_distance: %f", simil[3]);
|
||||
ImGui::LabelText("##sim5", "levenshtein_distance: %f", simil[4]);
|
||||
ImGui::LabelText("##sim6", "dot_minmax: %f", simil[5]);
|
||||
ImGui::LabelText("##sim5", "hamming_distance_without_seeds: %f", simil[4]);
|
||||
ImGui::LabelText("##sim6", "levenshtein_distance: %f", simil[5]);
|
||||
|
||||
const ImGuiTableFlags flags = ImGuiTableFlags_NoHostExtendX | ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_ContextMenuInBody;
|
||||
const int columns = numberOfFunc + 1;
|
||||
@@ -210,9 +206,9 @@ void Vapp::draw()
|
||||
ImGui::TableSetColumnIndex(4);
|
||||
ImGui::Text("hamming_distance");
|
||||
ImGui::TableSetColumnIndex(5);
|
||||
ImGui::Text("levenshtein_distance");
|
||||
ImGui::Text("hamming_distance_without_seeds");
|
||||
ImGui::TableSetColumnIndex(6);
|
||||
ImGui::Text("dot_minmax");
|
||||
ImGui::Text("levenshtein_distance");
|
||||
|
||||
for (int row = 0; row < similTable.size(); row++)
|
||||
{
|
||||
@@ -329,8 +325,8 @@ void Vapp::setUpTable()
|
||||
similTable[s][1] = Similarity::calc_similarity(manager.vector, Similarity::cosine_similarity);
|
||||
similTable[s][2] = Similarity::calc_similarity(manager.vector, Similarity::cosine_similarity_int);
|
||||
similTable[s][3] = Similarity::calc_similarity(manager.vector, Similarity::hamming_distance);
|
||||
similTable[s][4] = Similarity::calc_similarity(manager.vector, Similarity::levenshtein_distance);
|
||||
similTable[s][5] = Similarity::calc_similarity(manager.vector, Similarity::dot_minmax);
|
||||
similTable[s][4] = Similarity::calc_similarity(manager.vector, Similarity::hamming_distance_without_seeds);
|
||||
similTable[s][5] = Similarity::calc_similarity(manager.vector, Similarity::levenshtein_distance);
|
||||
DnaManager::newGen(&manager);
|
||||
}
|
||||
else
|
||||
@@ -339,13 +335,13 @@ void Vapp::setUpTable()
|
||||
}
|
||||
|
||||
sql::reset(get_gen_stmt);
|
||||
if(saveToFile)
|
||||
{
|
||||
|
||||
int64_t id = ids[selected_id_index];
|
||||
const char* buff = TextFormat("%ld.txt", id);
|
||||
char buff[50];
|
||||
sprintf(buff, "%ld.txt", id);
|
||||
std::ofstream file(buff);
|
||||
|
||||
file << "| index | euclidean_distance | cosine_similarity | cosine_similarity_int | hamming_distance | levenshtein_distance | dot_minmax |\n";
|
||||
file << "| index | euclidean_distance | cosine_similarity | cosine_similarity_int | hamming_distance | hamming_distance_without_seeds | levenshtein_distance |\n";
|
||||
file << "| --- | --- | --- | --- | --- | --- | --- |\n";
|
||||
|
||||
|
||||
@@ -360,7 +356,6 @@ void Vapp::setUpTable()
|
||||
file << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sql::finalize(get_gen_stmt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user