GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
gsvd.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2016-2018 Barbara Lócsi
4 Copyright (C) 2006, 2010 Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
5 Copyright (C) 1996, 1997 John W. Eaton
6 
7 This file is part of Octave.
8 
9 Octave is free software: you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Octave is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Octave; see the file COPYING. If not, see
21 <https://www.gnu.org/licenses/>.
22 
23 */
24 
25 #ifdef HAVE_CONFIG_H
26 # include <config.h>
27 #endif
28 
29 #include "dMatrix.h"
30 #include "CMatrix.h"
31 #include "dDiagMatrix.h"
32 #include "gsvd.h"
33 
34 #include "defun.h"
35 #include "defun-int.h"
36 #include "error.h"
37 #include "errwarn.h"
38 #include "utils.h"
39 #include "ovl.h"
40 #include "ov.h"
41 
42 
43 template <typename T>
44 static typename octave::math::gsvd<T>::Type
46 {
47  return ((nargout == 0 || nargout == 1)
51 }
52 
53 // Named like this to avoid conflicts with the gsvd class.
54 template <typename T>
55 static octave_value_list
56 do_gsvd (const T& A, const T& B, const octave_idx_type nargout,
57  bool is_single = false)
58 {
59  octave::math::gsvd<T> result (A, B, gsvd_type<T> (nargout));
60 
62  if (nargout < 2)
63  {
64  if (is_single)
65  {
66  FloatDiagMatrix sigA = result.singular_values_A ();
67  FloatDiagMatrix sigB = result.singular_values_B ();
68  for (int i = sigA.rows () - 1; i >= 0; i--)
69  sigA.dgxelem(i) /= sigB.dgxelem(i);
70  retval(0) = sigA.diag ();
71  }
72  else
73  {
74  DiagMatrix sigA = result.singular_values_A ();
75  DiagMatrix sigB = result.singular_values_B ();
76  for (int i = sigA.rows () - 1; i >= 0; i--)
77  sigA.dgxelem(i) /= sigB.dgxelem(i);
78  retval(0) = sigA.diag ();
79  }
80  }
81  else
82  {
83  retval(0) = result.left_singular_matrix_A ();
84  retval(1) = result.left_singular_matrix_B ();
85  if (nargout > 2)
86  retval(2) = result.right_singular_matrix ();
87  if (nargout > 3)
88  retval(3) = result.singular_values_A ();
89  if (nargout > 4)
90  retval(4) = result.singular_values_B ();
91  if (nargout > 5)
92  retval(5) = result.R_matrix ();
93  }
94  return retval;
95 }
96 
97 DEFUN (gsvd, args, nargout,
98  doc: /* -*- texinfo -*-
99 @deftypefn {} {@var{S} =} gsvd (@var{A}, @var{B})
100 @deftypefnx {} {[@var{U}, @var{V}, @var{X}, @var{C}, @var{S}] =} gsvd (@var{A}, @var{B})
101 @deftypefnx {} {[@var{U}, @var{V}, @var{X}, @var{C}, @var{S}] =} gsvd (@var{A}, @var{B}, 0)
102 Compute the generalized singular value decomposition of (@var{A}, @var{B}).
103 
104 The generalized singular value decomposition is defined by the following
105 relations:
106 
107 @tex
108 $$ A = U C X^\dagger $$
109 $$ B = V S X^\dagger $$
110 $$ C^\dagger C + S^\dagger S = eye (columns (A)) $$
111 @end tex
112 @ifnottex
113 
114 @example
115 @group
116 A = U*C*X'
117 B = V*S*X'
118 C'*C + S'*S = eye (columns (A))
119 @end group
120 @end example
121 
122 @end ifnottex
123 
124 The function @code{gsvd} normally returns just the vector of generalized
125 singular values
126 @tex
127 $$ \sqrt{{{diag (C^\dagger C)} \over {diag (S^\dagger S)}}} $$
128 @end tex
129 @ifnottex
130 @code{sqrt (diag (C'*C) ./ diag (S'*S))}.
131 @end ifnottex
132 If asked for five return values, it also computes
133 @tex
134 $U$, $V$, $X$, and $C$.
135 @end tex
136 @ifnottex
137 U, V, X, and C.
138 @end ifnottex
139 
140 If the optional third input is present, @code{gsvd} constructs the
141 "economy-sized" decomposition where the number of columns of @var{U}, @var{V}
142 and the number of rows of @var{C}, @var{S} is less than or equal to the number
143 of columns of @var{A}. This option is not yet implemented.
144 
145 Programming Note: the code is a wrapper to the corresponding @sc{lapack} dggsvd
146 and zggsvd routines.
147 
148 @seealso{svd}
149 @end deftypefn */)
150 {
151  int nargin = args.length ();
152 
154  print_usage ();
155  else if (nargin == 3)
156  warning ("gsvd: economy-sized decomposition is not yet implemented, returning full decomposition");
157 
159 
160  octave_value argA = args(0);
161  octave_value argB = args(1);
162 
163  octave_idx_type nr = argA.rows ();
164  octave_idx_type nc = argA.columns ();
165 
166  octave_idx_type np = argB.columns ();
167 
168  // FIXME: This "special" case should be handled in the gsvd class, not here
169  if (nr == 0 || nc == 0)
170  {
172  if (nargout < 2) // S = gsvd (A, B)
173  {
174  if (argA.is_single_type () || argB.is_single_type ())
175  retval(0) = FloatMatrix (0, 1);
176  else
177  retval(0) = Matrix (0, 1);
178  }
179  else // [U, V, X, C, S, R] = gsvd (A, B)
180  {
181  if (argA.is_single_type () || argB.is_single_type ())
182  {
183  retval(0) = float_identity_matrix (nc, nc);
184  retval(1) = float_identity_matrix (nc, nc);
185  if (nargout > 2)
186  retval(2) = float_identity_matrix (nr, nr);
187  if (nargout > 3)
188  retval(3) = FloatMatrix (nr, nc);
189  if (nargout > 4)
190  retval(4) = float_identity_matrix (nr, nr);
191  if (nargout > 5)
192  retval(5) = float_identity_matrix (nr, nr);
193  }
194  else
195  {
196  retval(0) = identity_matrix (nc, nc);
197  retval(1) = identity_matrix (nc, nc);
198  if (nargout > 2)
199  retval(2) = identity_matrix (nr, nr);
200  if (nargout > 3)
201  retval(3) = Matrix (nr, nc);
202  if (nargout > 4)
203  retval(4) = identity_matrix (nr, nr);
204  if (nargout > 5)
205  retval(5) = identity_matrix (nr, nr);
206  }
207  }
208  }
209  else
210  {
211  if (nc != np)
212  print_usage ();
213 
214  if (argA.is_single_type () || argB.is_single_type ())
215  {
216  if (argA.isreal () && argB.isreal ())
217  {
218  FloatMatrix tmpA = argA.xfloat_matrix_value ("gsvd: A must be a real or complex matrix");
219  FloatMatrix tmpB = argB.xfloat_matrix_value ("gsvd: B must be a real or complex matrix");
220 
221  if (tmpA.any_element_is_inf_or_nan ())
222  error ("gsvd: A cannot have Inf or NaN values");
223  if (tmpB.any_element_is_inf_or_nan ())
224  error ("gsvd: B cannot have Inf or NaN values");
225 
226  retval = do_gsvd (tmpA, tmpB, nargout, true);
227  }
228  else if (argA.iscomplex () || argB.iscomplex ())
229  {
230  FloatComplexMatrix ctmpA = argA.xfloat_complex_matrix_value ("gsvd: A must be a real or complex matrix");
231  FloatComplexMatrix ctmpB = argB.xfloat_complex_matrix_value ("gsvd: B must be a real or complex matrix");
232 
233  if (ctmpA.any_element_is_inf_or_nan ())
234  error ("gsvd: A cannot have Inf or NaN values");
235  if (ctmpB.any_element_is_inf_or_nan ())
236  error ("gsvd: B cannot have Inf or NaN values");
237 
238  retval = do_gsvd (ctmpA, ctmpB, nargout, true);
239  }
240  else
241  error ("gsvd: A and B must be real or complex matrices");
242  }
243  else
244  {
245  if (argA.isreal () && argB.isreal ())
246  {
247  Matrix tmpA = argA.xmatrix_value ("gsvd: A must be a real or complex matrix");
248  Matrix tmpB = argB.xmatrix_value ("gsvd: B must be a real or complex matrix");
249 
250  if (tmpA.any_element_is_inf_or_nan ())
251  error ("gsvd: A cannot have Inf or NaN values");
252  if (tmpB.any_element_is_inf_or_nan ())
253  error ("gsvd: B cannot have Inf or NaN values");
254 
255  retval = do_gsvd (tmpA, tmpB, nargout);
256  }
257  else if (argA.iscomplex () || argB.iscomplex ())
258  {
259  ComplexMatrix ctmpA = argA.xcomplex_matrix_value ("gsvd: A must be a real or complex matrix");
260  ComplexMatrix ctmpB = argB.xcomplex_matrix_value ("gsvd: B must be a real or complex matrix");
261 
262  if (ctmpA.any_element_is_inf_or_nan ())
263  error ("gsvd: A cannot have Inf or NaN values");
264  if (ctmpB.any_element_is_inf_or_nan ())
265  error ("gsvd: B cannot have Inf or NaN values");
266 
267  retval = do_gsvd (ctmpA, ctmpB, nargout);
268  }
269  else
270  error ("gsvd: A and B must be real or complex matrices");
271  }
272  }
273 
274  return retval;
275 }
276 
277 /*
278 
279 ## Basic test of decomposition
280 %!test <48807>
281 %! A = reshape (1:15,5,3);
282 %! B = magic (3);
283 %! [U,V,X,C,S] = gsvd (A,B);
284 %! assert (U*C*X', A, 50*eps);
285 %! assert (V*S*X', B, 50*eps);
286 %! S0 = gsvd (A, B);
287 %! S1 = svd (A / B);
288 %! assert (S0, S1, 10*eps);
289 
290 ## a few tests for gsvd.m
291 %!shared A, A0, B, B0, U, V, C, S, X, R, D1, D2
292 %! A0 = randn (5, 3);
293 %! B0 = diag ([1 2 4]);
294 %! A = A0;
295 %! B = B0;
296 
297 ## A (5x3) and B (3x3) are full rank
298 %!test <48807>
299 %! [U, V, X, C, S, R] = gsvd (A, B);
300 %! D1 = zeros (5, 3); D1(1:3, 1:3) = C;
301 %! D2 = S;
302 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
303 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
304 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
305 
306 ## A: 5x3 full rank, B: 3x3 rank deficient
307 %!test <48807>
308 %! B(2, 2) = 0;
309 %! [U, V, X, C, S, R] = gsvd (A, B);
310 %! D1 = zeros (5, 3); D1(1, 1) = 1; D1(2:3, 2:3) = C;
311 %! D2 = [zeros(2, 1) S; zeros(1, 3)];
312 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (2, 1)) <= 1e-6);
313 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
314 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
315 
316 ## A: 5x3 rank deficient, B: 3x3 full rank
317 %!test <48807>
318 %! B = B0;
319 %! A(:, 3) = 2*A(:, 1) - A(:, 2);
320 %! [U, V, X, C, S, R] = gsvd (A, B);
321 %! D1 = zeros(5, 3); D1(1:3, 1:3) = C;
322 %! D2 = S;
323 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
324 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
325 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
326 
327 ## A and B are both rank deficient
328 %!test <48807>
329 %! B(:, 3) = 2*B(:, 1) - B(:, 2);
330 %! [U, V, X, C, S, R] = gsvd (A, B);
331 %! D1 = zeros(5, 2); D1(1:2, 1:2) = C;
332 %! D2 = [S; zeros(1, 2)];
333 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (2, 1)) <= 1e-6);
334 %! assert (norm ((U'*A*X) - D1*[zeros(2, 1) R]) <= 1e-6);
335 %! assert (norm ((V'*B*X) - D2*[zeros(2, 1) R]) <= 1e-6);
336 
337 ## A (now 3x5) and B (now 5x5) are full rank
338 %!test <48807>
339 %! A = A0.';
340 %! B0 = diag ([1 2 4 8 16]);
341 %! B = B0;
342 %! [U, V, X, C, S, R] = gsvd (A, B);
343 %! D1 = [C zeros(3,2)];
344 %! D2 = [S zeros(3,2); zeros(2, 3) eye(2)];
345 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
346 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
347 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
348 
349 ## A: 3x5 full rank, B: 5x5 rank deficient
350 %!test <48807>
351 %! B(2, 2) = 0;
352 %! [U, V, X, C, S, R] = gsvd (A, B);
353 %! D1 = zeros(3, 5); D1(1, 1) = 1; D1(2:3, 2:3) = C;
354 %! D2 = zeros(5, 5); D2(1:2, 2:3) = S; D2(3:4, 4:5) = eye (2);
355 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (2, 1)) <= 1e-6);
356 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
357 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
358 
359 ## A: 3x5 rank deficient, B: 5x5 full rank
360 %!test <48807>
361 %! B = B0;
362 %! A(3, :) = 2*A(1, :) - A(2, :);
363 %! [U, V, X, C, S, R] = gsvd (A, B);
364 %! D1 = zeros (3, 5); D1(1:3, 1:3) = C;
365 %! D2 = zeros (5, 5); D2(1:3, 1:3) = S; D2(4:5, 4:5) = eye (2);
366 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
367 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
368 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
369 
370 ## A and B are both rank deficient
371 %!test <48807>
372 %! A = A0.'; B = B0.';
373 %! A(:, 3) = 2*A(:, 1) - A(:, 2);
374 %! B(:, 3) = 2*B(:, 1) - B(:, 2);
375 %! [U, V, X, C, S, R]=gsvd (A, B);
376 %! D1 = zeros(3, 4); D1(1:3, 1:3) = C;
377 %! D2 = eye (4); D2(1:3, 1:3) = S; D2(5,:) = 0;
378 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
379 %! assert (norm ((U'*A*X) - D1*[zeros(4, 1) R]) <= 1e-6);
380 %! assert (norm ((V'*B*X) - D2*[zeros(4, 1) R]) <= 1e-6);
381 
382 ## A: 5x3 complex full rank, B: 3x3 complex full rank
383 %!test <48807>
384 %! A0 = A0 + j*randn (5, 3);
385 %! B0 = diag ([1 2 4]) + j*diag ([4 -2 -1]);
386 %! A = A0;
387 %! B = B0;
388 %! [U, V, X, C, S, R] = gsvd (A, B);
389 %! D1 = zeros(5, 3); D1(1:3, 1:3) = C;
390 %! D2 = S;
391 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
392 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
393 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
394 
395 ## A: 5x3 complex full rank, B: 3x3 complex rank deficient
396 %!test <48807>
397 %! B(2, 2) = 0;
398 %! [U, V, X, C, S, R] = gsvd (A, B);
399 %! D1 = zeros(5, 3); D1(1, 1) = 1; D1(2:3, 2:3) = C;
400 %! D2 = [zeros(2, 1) S; zeros(1, 3)];
401 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (2, 1)) <= 1e-6);
402 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
403 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
404 
405 ## A: 5x3 complex rank deficient, B: 3x3 complex full rank
406 %!test <48807>
407 %! B = B0;
408 %! A(:, 3) = 2*A(:, 1) - A(:, 2);
409 %! [U, V, X, C, S, R] = gsvd (A, B);
410 %! D1 = zeros(5, 3); D1(1:3, 1:3) = C;
411 %! D2 = S;
412 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
413 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
414 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
415 
416 ## A (5x3) and B (3x3) are both complex rank deficient
417 %!test <48807>
418 %! B(:, 3) = 2*B(:, 1) - B(:, 2);
419 %! [U, V, X, C, S, R] = gsvd (A, B);
420 %! D1 = zeros(5, 2); D1(1:2, 1:2) = C;
421 %! D2 = [S; zeros(1, 2)];
422 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (2, 1)) <= 1e-6);
423 %! assert (norm ((U'*A*X) - D1*[zeros(2, 1) R]) <= 1e-6);
424 %! assert (norm ((V'*B*X) - D2*[zeros(2, 1) R]) <= 1e-6);
425 
426 ## A (now 3x5) complex and B (now 5x5) complex are full rank
427 ## now, A is 3x5
428 %!test <48807>
429 %! A = A0.';
430 %! B0 = diag ([1 2 4 8 16]) + j*diag ([-5 4 -3 2 -1]);
431 %! B = B0;
432 %! [U, V, X, C, S, R] = gsvd (A, B);
433 %! D1 = [C zeros(3,2)];
434 %! D2 = [S zeros(3,2); zeros(2, 3) eye(2)];
435 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
436 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
437 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
438 
439 ## A: 3x5 complex full rank, B: 5x5 complex rank deficient
440 %!test <48807>
441 %! B(2, 2) = 0;
442 %! [U, V, X, C, S, R] = gsvd (A, B);
443 %! D1 = zeros(3, 5); D1(1, 1) = 1; D1(2:3, 2:3) = C;
444 %! D2 = zeros(5,5); D2(1:2, 2:3) = S; D2(3:4, 4:5) = eye (2);
445 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (2, 1)) <= 1e-6);
446 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
447 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
448 
449 ## A: 3x5 complex rank deficient, B: 5x5 complex full rank
450 %!test <48807>
451 %! B = B0;
452 %! A(3, :) = 2*A(1, :) - A(2, :);
453 %! [U, V, X, C, S, R] = gsvd (A, B);
454 %! D1 = zeros(3, 5); D1(1:3, 1:3) = C;
455 %! D2 = zeros(5,5); D2(1:3, 1:3) = S; D2(4:5, 4:5) = eye (2);
456 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
457 %! assert (norm ((U'*A*X) - D1*R) <= 1e-6);
458 %! assert (norm ((V'*B*X) - D2*R) <= 1e-6);
459 
460 ## A and B are both complex rank deficient
461 %!test <48807>
462 %! A = A0.';
463 %! B = B0.';
464 %! A(:, 3) = 2*A(:, 1) - A(:, 2);
465 %! B(:, 3) = 2*B(:, 1) - B(:, 2);
466 %! [U, V, X, C, S, R] = gsvd (A, B);
467 %! D1 = zeros(3, 4); D1(1:3, 1:3) = C;
468 %! D2 = eye (4); D2(1:3, 1:3) = S; D2(5,:) = 0;
469 %! assert (norm (diag (C).^2 + diag (S).^2 - ones (3, 1)) <= 1e-6);
470 %! assert (norm ((U'*A*X) - D1*[zeros(4, 1) R]) <= 1e-6);
471 %! assert (norm ((V'*B*X) - D2*[zeros(4, 1) R]) <= 1e-6);
472 
473 ## Test that single inputs produce single outputs
474 %!test
475 %! s = gsvd (single (ones (0,1)), B);
476 %! assert (class (s), "single");
477 %! s = gsvd (single (ones (1,0)), B);
478 %! assert (class (s), "single");
479 %! s = gsvd (single (ones (1,0)), B);
480 %! [U,V,X,C,S,R] = gsvd (single ([]), B);
481 %! assert (class (U), "single");
482 %! assert (class (V), "single");
483 %! assert (class (X), "single");
484 %! assert (class (C), "single");
485 %! assert (class (S), "single");
486 %! assert (class (R), "single");
487 %!
488 %! s = gsvd (single (A), B);
489 %! assert (class (s), "single");
490 %! [U,V,X,C,S,R] = gsvd (single (A), B);
491 %! assert (class (U), "single");
492 %! assert (class (V), "single");
493 %! assert (class (X), "single");
494 %! assert (class (C), "single");
495 %! assert (class (S), "single");
496 %! assert (class (R), "single");
497 
498 */
static octave_value_list do_gsvd(const T &A, const T &B, const octave_idx_type nargout, bool is_single=false)
Definition: gsvd.cc:56
Definition: mx-defs.h:69
F77_RET_T const F77_INT F77_CMPLX const F77_INT F77_CMPLX * B
OCTINTERP_API void print_usage(void)
Definition: defun.cc:54
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
Definition: defun.h:53
void error(const char *fmt,...)
Definition: error.cc:578
octave_idx_type rows(void) const
Definition: DiagArray2.h:87
bool any_element_is_inf_or_nan(void) const
Definition: fCNDArray.cc:500
F77_RET_T const F77_INT F77_CMPLX * A
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Definition: ov-usr-fcn.cc:997
Matrix xmatrix_value(const char *fmt,...) const
octave_idx_type columns(void) const
Definition: ov.h:474
static octave::math::gsvd< T >::Type gsvd_type(int nargout)
Definition: gsvd.cc:45
bool is_single_type(void) const
Definition: ov.h:651
FloatMatrix xfloat_matrix_value(const char *fmt,...) const
octave_idx_type rows(void) const
Definition: ov.h:472
octave_value retval
Definition: data.cc:6246
MArray< T > diag(octave_idx_type k=0) const
Definition: MDiagArray2.h:100
T & dgxelem(octave_idx_type i)
Definition: DiagArray2.h:150
Definition: dMatrix.h:36
bool any_element_is_inf_or_nan(void) const
Definition: CNDArray.cc:506
With real return the complex result
Definition: data.cc:3260
OCTINTERP_API FloatMatrix float_identity_matrix(octave_idx_type nr, octave_idx_type nc)
void warning(const char *fmt,...)
Definition: error.cc:801
bool isreal(void) const
Definition: ov.h:703
bool any_element_is_inf_or_nan(void) const
Definition: dNDArray.cc:559
OCTINTERP_API Matrix identity_matrix(octave_idx_type nr, octave_idx_type nc)
FloatComplexMatrix xfloat_complex_matrix_value(const char *fmt,...) const
args.length() nargin
Definition: file-io.cc:589
bool iscomplex(void) const
Definition: ov.h:710
for i
Definition: data.cc:5264
ComplexMatrix xcomplex_matrix_value(const char *fmt,...) const
bool any_element_is_inf_or_nan(void) const
Definition: fNDArray.cc:511