Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Optimization Lab 2

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.13 sec, absolute service time: 0,33 sec 
edit mode |  history  | discussion
Error(s):
437359614/source.cpp: In function ‘void print_tableau(Tableau, char)’:
437359614/source.cpp:58:47: warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘int’ [-Wformat=]
   printf("\n%d. Tableau %s:\n", ++counter, mes);
                                               ^
437359614/source.cpp:62:16: error: base operand of ‘->’ has non-pointer type ‘Tableau’
   for(j=1;j<tab->n; j++) { printf("    x%d,", j); } printf("\n");
                ^~
437359614/source.cpp:64:16: error: base operand of ‘->’ has non-pointer type ‘Tableau’
   for(i=0;i<tab->m; i++) {
                ^~
437359614/source.cpp:67:18: error: base operand of ‘->’ has non-pointer type ‘Tableau’
     for(j=0;j<tab->n; j++) {
                  ^~
437359614/source.cpp:68:25: error: base operand of ‘->’ has non-pointer type ‘Tableau’
       if (equal((int)tab->mat[i][j], tab->mat[i][j]))
                         ^~
437359614/source.cpp:68:41: error: base operand of ‘->’ has non-pointer type ‘Tableau’
       if (equal((int)tab->mat[i][j], tab->mat[i][j]))
                                         ^~
437359614/source.cpp:69:32: error: base operand of ‘->’ has non-pointer type ‘Tableau’
         printf(" %6d", (int)tab->mat[i][j]);
                                ^~
437359614/source.cpp:71:30: error: base operand of ‘->’ has non-pointer type ‘Tableau’
         printf(" %6.2lf", tab->mat[i][j]);
                              ^~
437359614/source.cpp: In function ‘void simplex(Tableau*)’:
437359614/source.cpp:218:50: error: could not convert ‘tab’ from ‘Tableau*’ to ‘Tableau’
   print_tableau(tab,"Padded with slack variables");
                                                  ^
437359614/source.cpp:226:49: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
       print_optimal_vector(tab, "Optimal vector");
                                                 ^
437359614/source.cpp:240:39: error: could not convert ‘tab’ from ‘Tableau*’ to ‘Tableau’
     print_tableau(tab,"After pivoting");
                                       ^
437359614/source.cpp:241:56: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
     print_optimal_vector(tab, "Basic feasible solution");
                                                        ^
437359614/source.cpp: In function ‘int main(int, char**)’:
437359614/source.cpp:262:17: error: could not convert ‘& tab’ from ‘Tableau*’ to ‘Tableau’
   print_tableau(&tab,"Initial");
                 ^~~~

        

    
                
λ
.NET NoSQL database for rapid development