Opened 3 years ago

Closed 3 years ago

#364 closed ожидается проверка (задача сдана)

WW_matrix Klimov lab_07

Reported by: klimov.ivan Owned by: Антон Филатов
Component: WW Matrix Version: 2.0
Keywords: Cc:

Description


Change History (3)

comment:1 Changed 3 years ago by Антон Филатов

Type: ожидается проверкаожидаются исправления

Миллион ворнигов при сборке

g++ -std=c++11 -Wall -pedantic -c -o bin/matrix.o -Iinclude src/matrix.cpp
src/matrix.cpp: In member function ‘void Matrix::init(std::size_t, std::size_t)’:
src/matrix.cpp:9:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 1; i < _rows; i++)
                  ~~^~~~~~~
src/matrix.cpp:12:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < _rows; i++)
                  ~~^~~~~~~
src/matrix.cpp: In member function ‘void Matrix::print(FILE*) const’:
src/matrix.cpp:50:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < _rows; i++) {
                  ~~^~~~~~~
src/matrix.cpp:51:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int j = 0; j < _cols; j++) {
                    ~~^~~~~~~
src/matrix.cpp:53:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if(j + 1 < _cols)
          ~~~~~~^~~~~~~
src/matrix.cpp: In member function ‘bool Matrix::operator==(const Matrix&) const’:
src/matrix.cpp:64:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < _rows; i++)
                  ~~^~~~~~~
src/matrix.cpp:65:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int j = 0; j < _cols; j++)
                    ~~^~~~~~~
src/matrix.cpp: In member function ‘Matrix& Matrix::operator=(const Matrix&)’:
src/matrix.cpp:78:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < _rows; i++)
                  ~~^~~~~~~
src/matrix.cpp: In member function ‘Matrix Matrix::operator+(const Matrix&) const’:
src/matrix.cpp:100:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < _rows; i++)
                  ~~^~~~~~~
src/matrix.cpp:101:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int j = 0; j < _cols; j++)
                    ~~^~~~~~~
src/matrix.cpp: In member function ‘Matrix Matrix::operator-(const Matrix&) const’:
src/matrix.cpp:108:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < res._rows; i++)
                  ~~^~~~~~~~~~~
src/matrix.cpp:109:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int j = 0; j < res._cols; j++)
                    ~~^~~~~~~~~~~
src/matrix.cpp: In member function ‘Matrix Matrix::operator*(const Matrix&) const’:
src/matrix.cpp:118:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < _rows; i++)
                  ~~^~~~~~~
src/matrix.cpp:119:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int j = 0; j < m._cols; j++)
                    ~~^~~~~~~~~
src/matrix.cpp:120:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int k = 0; k < _cols; k++)
                      ~~^~~~~~~
g++ -std=c++11 -Wall -pedantic -o lab_07 -Iinclude src/main.cpp bin/*

Падает тест на оператор =

init a 2 4
init b 6 5
set a 0 2 4
= b a
set a 1 1 1

cp_init c a

Также проверьте вашу матрицу на операторах -= и *=. Там тоже падает

Стиль:

  • функции, которые мы не хотим давать пользователю (init, free) надо сделать приватными

5/10

comment:2 Changed 3 years ago by klimov.ivan

Type: ожидаются исправленияожидается проверка
Version: 1.02.0

comment:3 Changed 3 years ago by Антон Филатов

Resolution: задача сдана
Status: assignedclosed

10/10

Note: See TracTickets for help on using tickets.