matrix class issues can't pass arrays

Hi!, so I am trying to complete an assignment, I am implementing a matrix class, I previously made a full program to calculate the inverse of a matrix, having the functions already worked out, I want to adapt them for the class, but haven't had any success up to now.

I keep consistently getting the error:

[Error] prototype for 'fracc matriz::non_verbose_det(fracc (*)[99], int)' does not match any in class 'matriz'..

ideally I would prefer to be able to implement the determinant function inside the class, I tried leaving it also as an external function, but I get similar errors when passing the array so I am not sure what is the issue anymore.

any pointers or help that can be given would be greatly appreciated

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
  class matriz
{
	fracc m[99][99];
	
	int a=0, b=0;
	
	public:
	    matriz();
	    void rand_populate();
	    void printm();
	    void user_populate();
        fracc non_verbose_det(fracc *, int);
        void pass_on(fracc , int );
	    matriz operator+(matriz);
	    matriz operator-(matriz);
	    matriz operator*(matriz);
};

matriz::matriz()
{   
	fracc temp(1, 0);
	for(int i=0; i<3; i++)
	{
		for(int j=0; j<3; j++)
		{
			m[i][j]=temp;
		}
		
	}
}

matriz matriz::operator+(matriz h)
{   
    matriz temp;
    
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {   
            temp.m[i][j]=m[i][j]+h.m[i][j];
        }
        
    }
    
    return temp;
}

matriz matriz::operator-(matriz h)
{
    matriz temp;
    
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {   
            temp.m[i][j]=m[i][j]-h.m[i][j];
        }
        
    }
    
    return temp;
}

matriz matriz::operator*(matriz h)
{
	matriz temp, temp_1;
	
    for(int i=0;i<3;i++)
    {   
        for(int j=0;j<3;j++)
        {   
            for(int k=0; k<3; k++)
            {
            temp.m[i][j]=temp.m[i][j]+m[i][k]*h.m[k][j];
            }
        }  
    }
    return temp;
}

void matriz::rand_populate()
{ 
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {   
        	a=(rand()%2+1/*-(rand()%10+1*/);
        	b=(rand()%2+1/*-(rand()%10+1*/);
        	
        	fracc temp(a, b);
        	temp.REDUX();
            m[i][j]=temp;
        }    
    }   
}

void matriz::pass_on(fracc *m1[99][99], int n)
{ 
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {   
            m1[i][j]=m[i][j];
        }    
    }   
}


void matriz::printm()
{
    cout<<"\n\n";
    cout<<"\tLa matriz inversa de "<<3<<"x"<<3<<" \n\n\n";
    for(int i=0; i<3; i++)
    {
        cout<<"\n";
        for(int j=0; j<3; j++)
   
            {	
                if(m[i][j].a==0)
                {
                    cout<<"\t("<<0<<")";
                }
                else if(m[i][j].b==1)
                {
                    cout<<"\t("<<m[i][j].a<<")";
                }
                else
                {
                    cout<<"\t(";
                    m[i][j].DISPLAY();
                    cout<<")";
                }
			
            }
        cout<<"\t\n\n\n";
    }
}


void matriz::user_populate()
{
    cout << "\n";
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {
            cout << "\tinput["<<i+1<<"]["<<j+1<< "]: ";
           	cin>>a;
        	cin>>b;
        	fracc temp(a, b);
        	temp.REDUX();
            m[i][j]=temp;
        }
    }   
}


fracc matriz::non_verbose_det(fracc m[99][99], int e)
{   
  int n1=0, n2=0;
  
    fracc aux[99][99];
    fracc det=m[0][0] * m[1][1] - m[1][0] * m[0][1];
    fracc d=aux[0][0] * aux[1][1] - aux[1][0] * aux[0][1];
      
    if(e==1)
    {   
        fracc t(0,1);
        return t;
    }
    else if(e==2)
    {   
        return det;
    }
   
   
       for(int k=0;k<e;k++)
       {   
	        n1=0;
	        n2=0;
	        for(int i=1;i<e;i++)
	        {   
	            n1=0;
	            for(int j=0;j<e;j++)
	            {   
	                if(j==k)
	                {
	                    j++;
	                }
	                  
	                aux[n2][n1]=m[i][j];
	                n1++;
	            }
	            n2++;
        }

	        if (k%2==0)
	        {   
	            if (e==2)
	            {
	                d=d+m[0][k]*non_verbose_det(aux, e-1);
	            }
	            else if(e!=2 && k==0)
	            {
	                d=d*m[0][1]+non_verbose_det(aux, e-1)*m[0][0];
	            }
	            else if(e!=2 && k!=0)
	            {
	                d=d+non_verbose_det(aux, e-1)*m[0][k];
	            }
	              
	        }
			else
	        {        
	            if (e==2)
	            {
	                d=d-m[0][k]*non_verbose_det(aux, e-1);
	            }
	            else if(e!=2 && k==0)
	            {
	                d=d*m[0][1]-non_verbose_det(aux, e-1)*m[0][0];
	            }
	            else if(e!=2 && k!=0)
	            {
	                d=d-non_verbose_det(aux, e-1)*m[0][k];
	            }
	        }
	    }
    return d;  
}
What is 'fracc'?
fracc non_verbose_det(fracc *, int);

why is this 1-d when everywhere else you have 2-d constructs?

fracc matriz::non_verbose_det(fracc m[99][99], int e) <--- does not match above...
Registered users can post here. Sign in or register to post.