Commit 5b3fa710 authored by Arťom Ňorba's avatar Arťom Ňorba
Browse files

generate txt files for speed testing

parent 00346780
......@@ -14,22 +14,22 @@ int Matrix::getColumns() const {
return this->columns;
}
vector<vector<double> > Matrix::getValues() {
vector<vector<long double> > Matrix::getValues() {
return this->values;
}
void Matrix::setValuesBegin(vector<vector<double> > put) {
void Matrix::setValuesBegin(vector<vector<long double> > put) {
this->values = put;
}
double& Matrix::operator()(const int row, const int col) {
long double& Matrix::operator()(const int row, const int col) {
return this->values[row][col];
}
const double &Matrix::operator()(const int row, const int col) const {
const long double &Matrix::operator()(const int row, const int col) const {
return this->values[row][col];
}
void Matrix::changeValue(int row, int column, double value) {
void Matrix::changeValue(int row, int column, long double value) {
if (((row + 1) > this->rows) || ((column + 1 ) > this->columns)){
cout << "u can not change that position because this position does not exist" << endl;
return;
......@@ -57,11 +57,11 @@ void Matrix::printMatrix() {
}
vector<double> Matrix::getResultsArray() {
vector<long double> Matrix::getResultsArray() {
return this->results;
}
void Matrix::addResult(int pos, double res) {
void Matrix::addResult(int pos, long double res) {
this->results[pos] = res;
}
......@@ -71,12 +71,12 @@ void Matrix::printResults() {
}
}
void Matrix::setResults(vector<double> res) {
void Matrix::setResults(vector<long double> res) {
this->results = res;
}
void Matrix::setResultArray() {
vector<double> resultik;
vector<long double> resultik;
for (int i = 0; i < rows; ++i) {
resultik.push_back(0);
}
......
......@@ -15,8 +15,8 @@ private:
int rows;
int columns;
vector<vector<double> > values;
vector<double> results;
vector<vector<long double> > values;
vector<long double> results;
public:
......@@ -24,18 +24,18 @@ public:
int getRows() const;
int getColumns() const;
vector<vector<double> > getValues();
void setValuesBegin(vector<vector<double> > put);
void changeValue(int row, int column, double value);
vector<vector<long double> > getValues();
void setValuesBegin(vector<vector<long double> > put);
void changeValue(int row, int column, long double value);
void printMatrix();
vector<double> getResultsArray();
void setResults(vector<double> res);
void addResult(int pos, double res);
vector<long double> getResultsArray();
void setResults(vector<long double> res);
void addResult(int pos, long double res);
void printResults();
void setResultArray();
double& operator()(int row, int col);
const double& operator()(int row, int col) const;
long double& operator()(int row, int col);
const long double& operator()(int row, int col) const;
};
......
......@@ -21,7 +21,7 @@ void MatrixHelper::doGemSolve() {
for(int i=0;i<matrix.getRows()-1;i++){
for(int j=i+1;j<matrix.getRows();j++){
double f = matrix(j,i) / matrix(i,i);
long double f = matrix(j,i) / matrix(i,i);
for(int k=0;k<matrix.getRows()+1;k++){
matrix.changeValue(j, k,matrix(j,k)-f*matrix(i,k));
}
......@@ -85,6 +85,7 @@ void MatrixHelper::printResults() {
cout<<"\nHere are your results\n";
cout<<"_____________________\n";
matrix.printResults();
cout<<"_____________________\n";
}
else {
cout << "\nYour matrix has infinity results\n";
......
{
"cmake" :
{
"generator" :
{
"multiConfig" : false,
"name" : "Ninja"
},
"paths" :
{
"cmake" : "/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake",
"cpack" : "/Applications/CLion.app/Contents/bin/cmake/mac/bin/cpack",
"ctest" : "/Applications/CLion.app/Contents/bin/cmake/mac/bin/ctest",
"root" : "/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.21"
},
"version" :
{
"isDirty" : false,
"major" : 3,
"minor" : 21,
"patch" : 1,
"string" : "3.21.1",
"suffix" : ""
}
},
"objects" :
[
{
"jsonFile" : "codemodel-v2-2fd502c5cc2fccfba1e2.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
},
{
"jsonFile" : "cache-v2-054856e5930bf62c1bdf.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
{
"jsonFile" : "cmakeFiles-v1-afd644a44ae6f437b898.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
},
{
"jsonFile" : "toolchains-v1-1f7832ad266a08ab8d0e.json",
"kind" : "toolchains",
"version" :
{
"major" : 1,
"minor" : 0
}
}
],
"reply" :
{
"cache-v2" :
{
"jsonFile" : "cache-v2-054856e5930bf62c1bdf.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
"cmakeFiles-v1" :
{
"jsonFile" : "cmakeFiles-v1-afd644a44ae6f437b898.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
},
"codemodel-v2" :
{
"jsonFile" : "codemodel-v2-2fd502c5cc2fccfba1e2.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
},
"toolchains-v1" :
{
"jsonFile" : "toolchains-v1-1f7832ad266a08ab8d0e.json",
"kind" : "toolchains",
"version" :
{
"major" : 1,
"minor" : 0
}
}
}
}
......@@ -67,3 +67,15 @@
1451 1540 1642106204003876074 semestralka_pjc e23c61409220f109
2 1285 1642106219344979796 CMakeFiles/semestralka_pjc.dir/main.cpp.o a8f001d087801410
1285 1349 1642106219413226728 semestralka_pjc e23c61409220f109
3 1666 1642116975030139259 CMakeFiles/semestralka_pjc.dir/main.cpp.o a8f001d087801410
1666 1778 1642116975150415634 semestralka_pjc e23c61409220f109
2 1533 1642117534113831952 CMakeFiles/semestralka_pjc.dir/main.cpp.o a8f001d087801410
1533 1615 1642117534203445710 semestralka_pjc e23c61409220f109
8 1480 1642118203223952776 CMakeFiles/semestralka_pjc.dir/MatrixHelper.cpp.o d6e62ab562d627c0
7 1534 1642118203295511455 CMakeFiles/semestralka_pjc.dir/Matrix.cpp.o f9806aba2a6f6dfd
7 1843 1642118203606166960 CMakeFiles/semestralka_pjc.dir/main.cpp.o a8f001d087801410
1843 1951 1642118203719113845 semestralka_pjc e23c61409220f109
3 1107 1642118660134381697 CMakeFiles/semestralka_pjc.dir/MatrixHelper.cpp.o d6e62ab562d627c0
1107 1195 1642118660225354614 semestralka_pjc e23c61409220f109
2 839 1642118755550812946 CMakeFiles/semestralka_pjc.dir/MatrixHelper.cpp.o d6e62ab562d627c0
839 911 1642118755624914958 semestralka_pjc e23c61409220f109
Start testing: Jan 14 00:15 CET
Start testing: Jan 14 01:20 CET
----------------------------------------------------------
End testing: Jan 14 00:15 CET
End testing: Jan 14 01:20 CET
{
"configurations" :
[
{
"directories" :
[
{
"build" : ".",
"jsonFile" : "directory-.-Release-f5ebdc15457944623624.json",
"minimumCMakeVersion" :
{
"string" : "3.21"
},
"projectIndex" : 0,
"source" : ".",
"targetIndexes" :
[
0
]
}
],
"name" : "Release",
"projects" :
[
{
"directoryIndexes" :
[
0
],
"name" : "semestralka_pjc",
"targetIndexes" :
[
0
]
}
],
"targets" :
[
{
"directoryIndex" : 0,
"id" : "semestralka_pjc::@6890427a1f51a3e7e1df",
"jsonFile" : "target-semestralka_pjc-Release-361c60a85d04c58c0d42.json",
"name" : "semestralka_pjc",
"projectIndex" : 0
}
]
}
],
"kind" : "codemodel",
"paths" :
{
"build" : "/Users/artomnorba/Desktop/semestralka_pjc/semestralka_pjc/cmake-build-release",
"source" : "/Users/artomnorba/Desktop/semestralka_pjc/semestralka_pjc"
},
"version" :
{
"major" : 2,
"minor" : 3
}
}
{
"backtraceGraph" :
{
"commands" : [],
"files" : [],
"nodes" : []
},
"installers" : [],
"paths" :
{
"build" : ".",
"source" : "."
}
}
{
"cmake" :
{
"generator" :
{
"multiConfig" : false,
"name" : "Ninja"
},
"paths" :
{
"cmake" : "/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake",
"cpack" : "/Applications/CLion.app/Contents/bin/cmake/mac/bin/cpack",
"ctest" : "/Applications/CLion.app/Contents/bin/cmake/mac/bin/ctest",
"root" : "/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.21"
},
"version" :
{
"isDirty" : false,
"major" : 3,
"minor" : 21,
"patch" : 1,
"string" : "3.21.1",
"suffix" : ""
}
},
"objects" :
[
{
"jsonFile" : "codemodel-v2-1599411b911ae8178f42.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
},
{
"jsonFile" : "cache-v2-d9e917b063908d944e83.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
{
"jsonFile" : "cmakeFiles-v1-d4a56a3c3d9d15aba524.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
},
{
"jsonFile" : "toolchains-v1-1f7832ad266a08ab8d0e.json",
"kind" : "toolchains",
"version" :
{
"major" : 1,
"minor" : 0
}
}
],
"reply" :
{
"cache-v2" :
{
"jsonFile" : "cache-v2-d9e917b063908d944e83.json",
"kind" : "cache",
"version" :
{
"major" : 2,
"minor" : 0
}
},
"cmakeFiles-v1" :
{
"jsonFile" : "cmakeFiles-v1-d4a56a3c3d9d15aba524.json",
"kind" : "cmakeFiles",
"version" :
{
"major" : 1,
"minor" : 0
}
},
"codemodel-v2" :
{
"jsonFile" : "codemodel-v2-1599411b911ae8178f42.json",
"kind" : "codemodel",
"version" :
{
"major" : 2,
"minor" : 3
}
},
"toolchains-v1" :
{
"jsonFile" : "toolchains-v1-1f7832ad266a08ab8d0e.json",
"kind" : "toolchains",
"version" :
{
"major" : 1,
"minor" : 0
}
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment