@@ -229,3 +229,82 @@ VALUE cmatrix_dense_set(VALUE self, VALUE r, VALUE c, VALUE operand)
229229
230230 return self ;
231231}
232+
233+
234+ VALUE cmatrix_dense_det (VALUE self )
235+ {
236+ CDenseMatrix * this ;
237+ Data_Get_Struct (self , CDenseMatrix , this );
238+
239+ basic_struct * cresult ;
240+ VALUE result ;
241+
242+ cresult = basic_new_heap ();
243+
244+ dense_matrix_det (cresult , this );
245+ result = Data_Wrap_Struct (Klass_of_Basic (cresult ), NULL , basic_free_heap ,
246+ cresult );
247+ return result ;
248+ }
249+ VALUE cmatrix_dense_inv (VALUE self )
250+ {
251+ CDenseMatrix * this ;
252+ Data_Get_Struct (self , CDenseMatrix , this );
253+
254+ CDenseMatrix * cresult ;
255+ VALUE result ;
256+
257+ cresult = dense_matrix_new ();
258+
259+ dense_matrix_inv (cresult , this );
260+ result = Data_Wrap_Struct (c_dense_matrix , NULL , dense_matrix_free ,
261+ cresult );
262+ return result ;
263+ }
264+
265+ VALUE cmatrix_dense_transpose (VALUE self )
266+ {
267+ CDenseMatrix * this ;
268+ Data_Get_Struct (self , CDenseMatrix , this );
269+
270+ CDenseMatrix * cresult ;
271+ VALUE result ;
272+
273+ cresult = dense_matrix_new ();
274+
275+ dense_matrix_transpose (cresult , this );
276+ result = Data_Wrap_Struct (c_dense_matrix , NULL , dense_matrix_free ,
277+ cresult );
278+ return result ;
279+ }
280+
281+ VALUE cmatrix_dense_submatrix (VALUE self , VALUE r1 , VALUE c1 , VALUE r2 , VALUE c2 , VALUE r_ , VALUE c_ )
282+ {
283+ CDenseMatrix * this ;
284+ Data_Get_Struct (self , CDenseMatrix , this );
285+
286+ CDenseMatrix * cresult ;
287+ VALUE result ;
288+
289+ unsigned long cbasic_r1 ;
290+ cbasic_r1 = NUM2ULONG (r1 );
291+ unsigned long cbasic_c1 ;
292+ cbasic_c1 = NUM2ULONG (c1 );
293+
294+ unsigned long cbasic_r2 ;
295+ cbasic_r2 = NUM2ULONG (r2 );
296+ unsigned long cbasic_c2 ;
297+ cbasic_c2 = NUM2ULONG (c2 );
298+
299+ unsigned long cbasic_r ;
300+ cbasic_r = NUM2ULONG (r_ );
301+ unsigned long cbasic_c ;
302+ cbasic_c = NUM2ULONG (c_ );
303+
304+ cresult = dense_matrix_new ();
305+
306+ dense_matrix_submatrix (cresult , this , cbasic_r1 , cbasic_c1 , cbasic_r2 , cbasic_c2 , cbasic_r , cbasic_c );
307+ result = Data_Wrap_Struct (c_dense_matrix , NULL , dense_matrix_free ,
308+ cresult );
309+ return result ;
310+ }
0 commit comments