Library 5

zero errors in simpletest
This commit is contained in:
Alessandro Ferro 2021-06-03 21:46:22 +02:00
parent 0658e80cbd
commit f5eb9cda23
5 changed files with 3 additions and 24 deletions

View File

@ -39,7 +39,6 @@ MatrixCSR<Data>::MatrixCSR(const MatrixCSR& toCopy) : MatrixCSR(toCopy.rows, toC
template <typename Data> template <typename Data>
MatrixCSR<Data>::MatrixCSR(MatrixCSR&& toMove) noexcept{ MatrixCSR<Data>::MatrixCSR(MatrixCSR&& toMove) noexcept{
std::swap(rows, toMove.rows); std::swap(rows, toMove.rows);
std::swap(columns, toMove.columns); std::swap(columns, toMove.columns);
std::swap(size, toMove.size); std::swap(size, toMove.size);
@ -69,7 +68,6 @@ MatrixCSR<Data>& MatrixCSR<Data>::operator=(const MatrixCSR<Data>& toCopy){
template <typename Data> template <typename Data>
MatrixCSR<Data>& MatrixCSR<Data>::operator=(MatrixCSR<Data>&& toMove) noexcept{ MatrixCSR<Data>& MatrixCSR<Data>::operator=(MatrixCSR<Data>&& toMove) noexcept{
Clear();
std::swap(rows, toMove.rows); std::swap(rows, toMove.rows);
std::swap(columns, toMove.columns); std::swap(columns, toMove.columns);
std::swap(size, toMove.size); std::swap(size, toMove.size);

View File

@ -48,7 +48,6 @@ MatrixVec<Data>& MatrixVec<Data>::operator=(const MatrixVec& toCopy){
template <typename Data> template <typename Data>
MatrixVec<Data>& MatrixVec<Data>::operator=(MatrixVec&& toMove) noexcept{ MatrixVec<Data>& MatrixVec<Data>::operator=(MatrixVec&& toMove) noexcept{
Clear();
std::swap(rows, toMove.rows); std::swap(rows, toMove.rows);
std::swap(columns, toMove.columns); std::swap(columns, toMove.columns);
std::swap(size, toMove.size); std::swap(size, toMove.size);

View File

@ -235,8 +235,8 @@ void stestMatrixFloat(Mat& mat, uint& testnum, uint& testerr) {
SetCell(loctestnum, loctesterr, mat, true, 2, 0, 2.1); SetCell(loctestnum, loctesterr, mat, true, 2, 0, 2.1);
SetCell(loctestnum, loctesterr, mat, true, 3, 2, 3.0); SetCell(loctestnum, loctesterr, mat, true, 3, 2, 3.0);
SetCell(loctestnum, loctesterr, mat, true, 2, 1, 2.1); SetCell(loctestnum, loctesterr, mat, true, 2, 1, 2.1); //11
SetCell(loctestnum, loctesterr, mat, true, 1, 0, 1.2); SetCell(loctestnum, loctesterr, mat, true, 1, 0, 1.2); //12
Mat newmat(5, 10); Mat newmat(5, 10);
newmat = std::move(mat); newmat = std::move(mat);

View File

@ -36,24 +36,6 @@ void menu(){
if(choice==1){ if(choice==1){
lasdtest(); lasdtest();
}else{ }else{
MatrixCSR<long> mat;
mat.RowResize(5);
mat.ColumnResize(5);
mat(0,1) = 1;
mat(0,3) = 4;
mat(1,0) = 2;
mat(1,4) = 8;
mat(2,1) = 3;
mat(2,2) = 5;
mat(3,4) = 9;
mat(4,1) = 6;
mat(4,3) = 7;
mat(4,0) = 13;
mat.ColumnResize(2);
MatrixCSR<long> copmat;
copmat = std::move(mat);
} }
} }

Binary file not shown.