Skip to content

Commit 2c40d01

Browse files
committed
restarting
1 parent 900bda1 commit 2c40d01

File tree

12 files changed

+223
-317
lines changed

12 files changed

+223
-317
lines changed

.vscode/c_cpp_properties.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "windows-gcc-x64",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"compilerPath": "gcc",
9+
"cStandard": "${default}",
10+
"cppStandard": "${default}",
11+
"intelliSenseMode": "windows-gcc-x64",
12+
"compilerArgs": [
13+
""
14+
]
15+
}
16+
],
17+
"version": 4
18+
}

.vscode/launch.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug C++ Project (WSL)",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/bin/app_debug",
9+
"args": [
10+
"input/base-sample.fasta"
11+
],
12+
"stopAtEntry": false,
13+
"cwd": "${workspaceFolder}",
14+
"environment": [],
15+
"externalConsole": false,
16+
"MIMode": "gdb",
17+
"setupCommands": [
18+
{
19+
"description": "Enable pretty-printing for gdb",
20+
"text": "-enable-pretty-printing",
21+
"ignoreFailures": true
22+
}
23+
],
24+
"miDebuggerPath": "/usr/bin/gdb"
25+
},
26+
{
27+
"name": "C/C++ Runner: Debug Session",
28+
"type": "cppdbg",
29+
"request": "launch",
30+
"args": [],
31+
"stopAtEntry": false,
32+
"externalConsole": true,
33+
"cwd": "c:/Users/samue/Desktop/Pairwise-Sequence-Alignment-Algorithm/src/alignment",
34+
"program": "c:/Users/samue/Desktop/Pairwise-Sequence-Alignment-Algorithm/src/alignment/build/Debug/outDebug",
35+
"MIMode": "gdb",
36+
"miDebuggerPath": "gdb",
37+
"setupCommands": [
38+
{
39+
"description": "Enable pretty-printing for gdb",
40+
"text": "-enable-pretty-printing",
41+
"ignoreFailures": true
42+
}
43+
]
44+
}
45+
]
46+
}

.vscode/settings.json

Lines changed: 116 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,117 @@
1-
{
2-
"files.associations": {
3-
"algorithm": "cpp",
4-
"atomic": "cpp",
5-
"bit": "cpp",
6-
"cctype": "cpp",
7-
"charconv": "cpp",
8-
"clocale": "cpp",
9-
"cmath": "cpp",
10-
"compare": "cpp",
11-
"concepts": "cpp",
12-
"cstddef": "cpp",
13-
"cstdint": "cpp",
14-
"cstdio": "cpp",
15-
"cstdlib": "cpp",
16-
"cstring": "cpp",
17-
"ctime": "cpp",
18-
"cwchar": "cpp",
19-
"exception": "cpp",
20-
"format": "cpp",
21-
"fstream": "cpp",
22-
"initializer_list": "cpp",
23-
"ios": "cpp",
24-
"iosfwd": "cpp",
25-
"iostream": "cpp",
26-
"istream": "cpp",
27-
"iterator": "cpp",
28-
"limits": "cpp",
29-
"list": "cpp",
30-
"locale": "cpp",
31-
"memory": "cpp",
32-
"new": "cpp",
33-
"optional": "cpp",
34-
"ostream": "cpp",
35-
"stdexcept": "cpp",
36-
"streambuf": "cpp",
37-
"string": "cpp",
38-
"system_error": "cpp",
39-
"tuple": "cpp",
40-
"type_traits": "cpp",
41-
"typeinfo": "cpp",
42-
"unordered_set": "cpp",
43-
"utility": "cpp",
44-
"vector": "cpp",
45-
"xfacet": "cpp",
46-
"xhash": "cpp",
47-
"xiosbase": "cpp",
48-
"xlocale": "cpp",
49-
"xlocbuf": "cpp",
50-
"xlocinfo": "cpp",
51-
"xlocmes": "cpp",
52-
"xlocmon": "cpp",
53-
"xlocnum": "cpp",
54-
"xloctime": "cpp",
55-
"xmemory": "cpp",
56-
"xstring": "cpp",
57-
"xtr1common": "cpp",
58-
"xutility": "cpp"
59-
}
1+
{
2+
"files.associations": {
3+
"algorithm": "cpp",
4+
"atomic": "cpp",
5+
"bit": "cpp",
6+
"cctype": "cpp",
7+
"charconv": "cpp",
8+
"clocale": "cpp",
9+
"cmath": "cpp",
10+
"compare": "cpp",
11+
"concepts": "cpp",
12+
"cstddef": "cpp",
13+
"cstdint": "cpp",
14+
"cstdio": "cpp",
15+
"cstdlib": "cpp",
16+
"cstring": "cpp",
17+
"ctime": "cpp",
18+
"cwchar": "cpp",
19+
"exception": "cpp",
20+
"format": "cpp",
21+
"fstream": "cpp",
22+
"initializer_list": "cpp",
23+
"ios": "cpp",
24+
"iosfwd": "cpp",
25+
"iostream": "cpp",
26+
"istream": "cpp",
27+
"iterator": "cpp",
28+
"limits": "cpp",
29+
"list": "cpp",
30+
"locale": "cpp",
31+
"memory": "cpp",
32+
"new": "cpp",
33+
"optional": "cpp",
34+
"ostream": "cpp",
35+
"stdexcept": "cpp",
36+
"streambuf": "cpp",
37+
"string": "cpp",
38+
"system_error": "cpp",
39+
"tuple": "cpp",
40+
"type_traits": "cpp",
41+
"typeinfo": "cpp",
42+
"unordered_set": "cpp",
43+
"utility": "cpp",
44+
"vector": "cpp",
45+
"xfacet": "cpp",
46+
"xhash": "cpp",
47+
"xiosbase": "cpp",
48+
"xlocale": "cpp",
49+
"xlocbuf": "cpp",
50+
"xlocinfo": "cpp",
51+
"xlocmes": "cpp",
52+
"xlocmon": "cpp",
53+
"xlocnum": "cpp",
54+
"xloctime": "cpp",
55+
"xmemory": "cpp",
56+
"xstring": "cpp",
57+
"xtr1common": "cpp",
58+
"xutility": "cpp"
59+
},
60+
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvarsall.bat",
61+
"C_Cpp_Runner.cCompilerPath": "gcc",
62+
"C_Cpp_Runner.cppCompilerPath": "g++",
63+
"C_Cpp_Runner.debuggerPath": "gdb",
64+
"C_Cpp_Runner.cStandard": "",
65+
"C_Cpp_Runner.cppStandard": "",
66+
"C_Cpp_Runner.useMsvc": false,
67+
"C_Cpp_Runner.warnings": [
68+
"-Wall",
69+
"-Wextra",
70+
"-Wpedantic",
71+
"-Wshadow",
72+
"-Wformat=2",
73+
"-Wcast-align",
74+
"-Wconversion",
75+
"-Wsign-conversion",
76+
"-Wnull-dereference"
77+
],
78+
"C_Cpp_Runner.msvcWarnings": [
79+
"/W4",
80+
"/permissive-",
81+
"/w14242",
82+
"/w14287",
83+
"/w14296",
84+
"/w14311",
85+
"/w14826",
86+
"/w44062",
87+
"/w44242",
88+
"/w14905",
89+
"/w14906",
90+
"/w14263",
91+
"/w44265",
92+
"/w14928"
93+
],
94+
"C_Cpp_Runner.enableWarnings": true,
95+
"C_Cpp_Runner.warningsAsError": false,
96+
"C_Cpp_Runner.compilerArgs": [],
97+
"C_Cpp_Runner.linkerArgs": [],
98+
"C_Cpp_Runner.includePaths": [],
99+
"C_Cpp_Runner.includeSearch": [
100+
"*",
101+
"**/*"
102+
],
103+
"C_Cpp_Runner.excludeSearch": [
104+
"**/build",
105+
"**/build/**",
106+
"**/.*",
107+
"**/.*/**",
108+
"**/.vscode",
109+
"**/.vscode/**"
110+
],
111+
"C_Cpp_Runner.useAddressSanitizer": false,
112+
"C_Cpp_Runner.useUndefinedSanitizer": false,
113+
"C_Cpp_Runner.useLeakSanitizer": false,
114+
"C_Cpp_Runner.showCompilationTime": false,
115+
"C_Cpp_Runner.useLinkTimeOptimization": false,
116+
"C_Cpp_Runner.msvcSecureNoWarnings": false
60117
}

.vscode/tasks.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build-debug",
6+
"type": "shell",
7+
"command": "make debug",
8+
"group": {
9+
"kind": "build",
10+
"isDefault": true
11+
},
12+
"problemMatcher": ["$gcc"]
13+
}
14+
]
15+
}

bin/app

-19.4 KB
Binary file not shown.

obj/alignment/alignment.o

-30.7 KB
Binary file not shown.

obj/alignment/de_cell.o

-11.6 KB
Binary file not shown.

output.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/alignment/alignment.cpp

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,18 @@
11
#include "./alignment.hpp"
22

33
namespace alignment {
4-
int64_t execute_global_alignment(const std::string& string_one, const std::string& string_two) {
5-
const size_t row_size = string_one.size() + 1;
6-
const size_t col_size = string_two.size() + 1;
7-
std::vector<dp_cell> cur_dp_row(col_size, dp_cell());
8-
std::vector<dp_cell> prev_dp_row(col_size, dp_cell());
9-
10-
// temp
11-
std::ofstream s("./output.txt");
12-
13-
// prev_dp_row[0].print_scores(s);
14-
// s << " ";
15-
16-
for (size_t i = 1; i < col_size; ++i) {
17-
prev_dp_row[i].set_top_row(i);
18-
// prev_dp_row[i].print_scores(s);
19-
// s << " ";
4+
int64_t execute_global_alignment_bad(const std::string& string_one, const std::string& string_two) {
5+
if (string_one.empty() || string_two.empty()) {
6+
return 0;
207
}
8+
size_t max_row = string_one.size();
9+
size_t max_col = string_one.size();
10+
std::vector<std::vector<dp_cell>> dp_table(max_row, std::vector<dp_cell>(max_col, dp_cell()));
2111

22-
for (size_t row_idx = 1; row_idx < row_size; ++row_idx) {
23-
cur_dp_row[0].set_left_col(row_idx);
24-
// cur_dp_row[0].print_scores(s);
25-
// s << " ";
26-
for (size_t col_idx = 1; col_idx < col_size; ++col_idx) {
27-
cur_dp_row[col_idx].score_cell(
28-
prev_dp_row[col_idx-1],
29-
prev_dp_row[col_idx],
30-
cur_dp_row[col_idx-1],
31-
string_one[row_idx-1],
32-
string_two[col_idx-1]
33-
);
34-
// cur_dp_row[col_idx].print_scores(s);
35-
// s << " ";
12+
for (size_t i = 1; i < max_row; ++i) {
13+
for (size_t j = 1; j < max_col; ++i) {
3614
}
37-
// s << std::endl;
38-
std::swap(prev_dp_row, cur_dp_row);
3915
}
40-
41-
s << prev_dp_row.back().to_string() << std::endl;
42-
43-
s.close();
44-
45-
return prev_dp_row.back().get_max_score();
4616
}
4717

4818
// int32_t execute_modified_global_alignment(const std::string& string_one, const std::string& string_two) {

src/alignment/alignment.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "./dp_cell.hpp"
1111

1212
namespace alignment {
13-
int64_t execute_global_alignment(const std::string&, const std::string&);
13+
int64_t execute_global_alignment_bad(const std::string&, const std::string&);
1414
// int32_t execute_modified_global_alignment(const std::string&, const std::string&);
1515
}
1616

0 commit comments

Comments
 (0)