comparison liboctave/CMatrix.cc @ 2563:8b0911d576bf

[project @ 1996-12-05 19:06:58 by jwe]
author jwe
date Thu, 05 Dec 1996 19:06:59 +0000
parents 4d941ba99862
children a5a300c61159
comparison
equal deleted inserted replaced
2562:0c978e147a3a 2563:8b0911d576bf
1414 Complex *presult = result.fortran_vec (); 1414 Complex *presult = result.fortran_vec ();
1415 1415
1416 int len_s = m < n ? m : n; 1416 int len_s = m < n ? m : n;
1417 Array<double> s (len_s); 1417 Array<double> s (len_s);
1418 double *ps = s.fortran_vec (); 1418 double *ps = s.fortran_vec ();
1419
1419 double rcond = -1.0; 1420 double rcond = -1.0;
1421
1420 int lwork; 1422 int lwork;
1421 if (m < n) 1423 if (m < n)
1422 lwork = 2*m + (nrhs > n ? nrhs : n); 1424 lwork = 2*m + (nrhs > n ? nrhs : n);
1423 else 1425 else
1424 lwork = 2*n + (nrhs > m ? nrhs : m); 1426 lwork = 2*n + (nrhs > m ? nrhs : m);
1437 1439
1438 if (f77_exception_encountered) 1440 if (f77_exception_encountered)
1439 (*current_liboctave_error_handler) ("unrecoverable error in zgelss"); 1441 (*current_liboctave_error_handler) ("unrecoverable error in zgelss");
1440 else 1442 else
1441 { 1443 {
1442 ComplexMatrix retval (n, nrhs); 1444 retval.resize (n, nrhs);
1443 for (int j = 0; j < nrhs; j++) 1445 for (int j = 0; j < nrhs; j++)
1444 for (int i = 0; i < n; i++) 1446 for (int i = 0; i < n; i++)
1445 retval.elem (i, j) = result.elem (i, j); 1447 retval.elem (i, j) = result.elem (i, j);
1446 } 1448 }
1447 } 1449 }
1517 1519
1518 if (f77_exception_encountered) 1520 if (f77_exception_encountered)
1519 (*current_liboctave_error_handler) ("unrecoverable error in zgelss"); 1521 (*current_liboctave_error_handler) ("unrecoverable error in zgelss");
1520 else 1522 else
1521 { 1523 {
1522 ComplexColumnVector retval (n); 1524 retval.resize (n);
1523 for (int i = 0; i < n; i++) 1525 for (int i = 0; i < n; i++)
1524 retval.elem (i) = result.elem (i); 1526 retval.elem (i) = result.elem (i);
1525 } 1527 }
1526 } 1528 }
1527 1529