Xmipp  v3.23.11-Nereus
linalg.h
Go to the documentation of this file.
1 /*************************************************************************
2 Copyright (c) Sergey Bochkanov (ALGLIB project).
3 
4 >>> SOURCE LICENSE >>>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation (www.fsf.org); either version 2 of the
8 License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 A copy of the GNU General Public License is available at
16 http://www.fsf.org/licensing/licenses
17 >>> END OF LICENSE >>>
18 *************************************************************************/
19 #ifndef _linalg_pkg_h
20 #define _linalg_pkg_h
21 #include "ap.h"
22 #include "alglibinternal.h"
23 #include "alglibmisc.h"
24 
26 //
27 // THIS SECTION CONTAINS COMPUTATIONAL CORE DECLARATIONS (DATATYPES)
28 //
30 namespace alglib_impl
31 {
32 typedef struct
33 {
34  double r1;
35  double rinf;
36 } matinvreport;
37 typedef struct
38 {
49 } sparsematrix;
50 typedef struct
51 {
52  double e1;
53  double e2;
56  double xax;
68 typedef struct
69 {
85  double repnorm;
88 
89 }
90 
92 //
93 // THIS SECTION CONTAINS C++ INTERFACE
94 //
96 namespace alglib
97 {
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 /*************************************************************************
116 Matrix inverse report:
117 * R1 reciprocal of condition number in 1-norm
118 * RInf reciprocal of condition number in inf-norm
119 *************************************************************************/
121 {
122 public:
125  _matinvreport_owner& operator=(const _matinvreport_owner &rhs);
126  virtual ~_matinvreport_owner();
127  alglib_impl::matinvreport* c_ptr();
128  alglib_impl::matinvreport* c_ptr() const;
129 protected:
131 };
133 {
134 public:
135  matinvreport();
136  matinvreport(const matinvreport &rhs);
137  matinvreport& operator=(const matinvreport &rhs);
138  virtual ~matinvreport();
139  double &r1;
140  double &rinf;
141 
142 };
143 
144 /*************************************************************************
145 Sparse matrix
146 
147 You should use ALGLIB functions to work with sparse matrix.
148 Never try to access its fields directly!
149 *************************************************************************/
151 {
152 public:
155  _sparsematrix_owner& operator=(const _sparsematrix_owner &rhs);
156  virtual ~_sparsematrix_owner();
157  alglib_impl::sparsematrix* c_ptr();
158  alglib_impl::sparsematrix* c_ptr() const;
159 protected:
161 };
163 {
164 public:
165  sparsematrix();
166  sparsematrix(const sparsematrix &rhs);
167  sparsematrix& operator=(const sparsematrix &rhs);
168  virtual ~sparsematrix();
169 
170 };
171 
172 
173 
174 /*************************************************************************
175 This object stores state of the iterative norm estimation algorithm.
176 
177 You should use ALGLIB functions to work with this object.
178 *************************************************************************/
180 {
181 public:
185  virtual ~_normestimatorstate_owner();
187  alglib_impl::normestimatorstate* c_ptr() const;
188 protected:
190 };
192 {
193 public:
196  normestimatorstate& operator=(const normestimatorstate &rhs);
197  virtual ~normestimatorstate();
198 
199 };
200 
201 /*************************************************************************
202 Cache-oblivous complex "copy-and-transpose"
203 
204 Input parameters:
205  M - number of rows
206  N - number of columns
207  A - source matrix, MxN submatrix is copied and transposed
208  IA - submatrix offset (row index)
209  JA - submatrix offset (column index)
210  B - destination matrix, must be large enough to store result
211  IB - submatrix offset (row index)
212  JB - submatrix offset (column index)
213 *************************************************************************/
214 void cmatrixtranspose(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, complex_2d_array &b, const ae_int_t ib, const ae_int_t jb);
215 
216 
217 /*************************************************************************
218 Cache-oblivous real "copy-and-transpose"
219 
220 Input parameters:
221  M - number of rows
222  N - number of columns
223  A - source matrix, MxN submatrix is copied and transposed
224  IA - submatrix offset (row index)
225  JA - submatrix offset (column index)
226  B - destination matrix, must be large enough to store result
227  IB - submatrix offset (row index)
228  JB - submatrix offset (column index)
229 *************************************************************************/
230 void rmatrixtranspose(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, real_2d_array &b, const ae_int_t ib, const ae_int_t jb);
231 
232 
233 /*************************************************************************
234 This code enforces symmetricy of the matrix by copying Upper part to lower
235 one (or vice versa).
236 
237 INPUT PARAMETERS:
238  A - matrix
239  N - number of rows/columns
240  IsUpper - whether we want to copy upper triangle to lower one (True)
241  or vice versa (False).
242 *************************************************************************/
243 void rmatrixenforcesymmetricity(const real_2d_array &a, const ae_int_t n, const bool isupper);
244 
245 
246 /*************************************************************************
247 Copy
248 
249 Input parameters:
250  M - number of rows
251  N - number of columns
252  A - source matrix, MxN submatrix is copied and transposed
253  IA - submatrix offset (row index)
254  JA - submatrix offset (column index)
255  B - destination matrix, must be large enough to store result
256  IB - submatrix offset (row index)
257  JB - submatrix offset (column index)
258 *************************************************************************/
259 void cmatrixcopy(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, complex_2d_array &b, const ae_int_t ib, const ae_int_t jb);
260 
261 
262 /*************************************************************************
263 Copy
264 
265 Input parameters:
266  M - number of rows
267  N - number of columns
268  A - source matrix, MxN submatrix is copied and transposed
269  IA - submatrix offset (row index)
270  JA - submatrix offset (column index)
271  B - destination matrix, must be large enough to store result
272  IB - submatrix offset (row index)
273  JB - submatrix offset (column index)
274 *************************************************************************/
275 void rmatrixcopy(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, real_2d_array &b, const ae_int_t ib, const ae_int_t jb);
276 
277 
278 /*************************************************************************
279 Rank-1 correction: A := A + u*v'
280 
281 INPUT PARAMETERS:
282  M - number of rows
283  N - number of columns
284  A - target matrix, MxN submatrix is updated
285  IA - submatrix offset (row index)
286  JA - submatrix offset (column index)
287  U - vector #1
288  IU - subvector offset
289  V - vector #2
290  IV - subvector offset
291 *************************************************************************/
292 void cmatrixrank1(const ae_int_t m, const ae_int_t n, complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, complex_1d_array &u, const ae_int_t iu, complex_1d_array &v, const ae_int_t iv);
293 
294 
295 /*************************************************************************
296 Rank-1 correction: A := A + u*v'
297 
298 INPUT PARAMETERS:
299  M - number of rows
300  N - number of columns
301  A - target matrix, MxN submatrix is updated
302  IA - submatrix offset (row index)
303  JA - submatrix offset (column index)
304  U - vector #1
305  IU - subvector offset
306  V - vector #2
307  IV - subvector offset
308 *************************************************************************/
309 void rmatrixrank1(const ae_int_t m, const ae_int_t n, real_2d_array &a, const ae_int_t ia, const ae_int_t ja, real_1d_array &u, const ae_int_t iu, real_1d_array &v, const ae_int_t iv);
310 
311 
312 /*************************************************************************
313 Matrix-vector product: y := op(A)*x
314 
315 INPUT PARAMETERS:
316  M - number of rows of op(A)
317  M>=0
318  N - number of columns of op(A)
319  N>=0
320  A - target matrix
321  IA - submatrix offset (row index)
322  JA - submatrix offset (column index)
323  OpA - operation type:
324  * OpA=0 => op(A) = A
325  * OpA=1 => op(A) = A^T
326  * OpA=2 => op(A) = A^H
327  X - input vector
328  IX - subvector offset
329  IY - subvector offset
330  Y - preallocated matrix, must be large enough to store result
331 
332 OUTPUT PARAMETERS:
333  Y - vector which stores result
334 
335 if M=0, then subroutine does nothing.
336 if N=0, Y is filled by zeros.
337 
338 
339  -- ALGLIB routine --
340 
341  28.01.2010
342  Bochkanov Sergey
343 *************************************************************************/
344 void cmatrixmv(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t opa, const complex_1d_array &x, const ae_int_t ix, complex_1d_array &y, const ae_int_t iy);
345 
346 
347 /*************************************************************************
348 Matrix-vector product: y := op(A)*x
349 
350 INPUT PARAMETERS:
351  M - number of rows of op(A)
352  N - number of columns of op(A)
353  A - target matrix
354  IA - submatrix offset (row index)
355  JA - submatrix offset (column index)
356  OpA - operation type:
357  * OpA=0 => op(A) = A
358  * OpA=1 => op(A) = A^T
359  X - input vector
360  IX - subvector offset
361  IY - subvector offset
362  Y - preallocated matrix, must be large enough to store result
363 
364 OUTPUT PARAMETERS:
365  Y - vector which stores result
366 
367 if M=0, then subroutine does nothing.
368 if N=0, Y is filled by zeros.
369 
370 
371  -- ALGLIB routine --
372 
373  28.01.2010
374  Bochkanov Sergey
375 *************************************************************************/
376 void rmatrixmv(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t opa, const real_1d_array &x, const ae_int_t ix, real_1d_array &y, const ae_int_t iy);
377 
378 
379 /*************************************************************************
380 
381 *************************************************************************/
382 void cmatrixrighttrsm(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const complex_2d_array &x, const ae_int_t i2, const ae_int_t j2);
383 void smp_cmatrixrighttrsm(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const complex_2d_array &x, const ae_int_t i2, const ae_int_t j2);
384 
385 
386 /*************************************************************************
387 
388 *************************************************************************/
389 void cmatrixlefttrsm(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const complex_2d_array &x, const ae_int_t i2, const ae_int_t j2);
390 void smp_cmatrixlefttrsm(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const complex_2d_array &x, const ae_int_t i2, const ae_int_t j2);
391 
392 
393 /*************************************************************************
394 
395 *************************************************************************/
396 void rmatrixrighttrsm(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const real_2d_array &x, const ae_int_t i2, const ae_int_t j2);
397 void smp_rmatrixrighttrsm(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const real_2d_array &x, const ae_int_t i2, const ae_int_t j2);
398 
399 
400 /*************************************************************************
401 
402 *************************************************************************/
403 void rmatrixlefttrsm(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const real_2d_array &x, const ae_int_t i2, const ae_int_t j2);
404 void smp_rmatrixlefttrsm(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const real_2d_array &x, const ae_int_t i2, const ae_int_t j2);
405 
406 
407 /*************************************************************************
408 
409 *************************************************************************/
410 void cmatrixsyrk(const ae_int_t n, const ae_int_t k, const double alpha, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const double beta, const complex_2d_array &c, const ae_int_t ic, const ae_int_t jc, const bool isupper);
411 void smp_cmatrixsyrk(const ae_int_t n, const ae_int_t k, const double alpha, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const double beta, const complex_2d_array &c, const ae_int_t ic, const ae_int_t jc, const bool isupper);
412 
413 
414 /*************************************************************************
415 
416 *************************************************************************/
417 void rmatrixsyrk(const ae_int_t n, const ae_int_t k, const double alpha, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const double beta, const real_2d_array &c, const ae_int_t ic, const ae_int_t jc, const bool isupper);
418 void smp_rmatrixsyrk(const ae_int_t n, const ae_int_t k, const double alpha, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const double beta, const real_2d_array &c, const ae_int_t ic, const ae_int_t jc, const bool isupper);
419 
420 
421 /*************************************************************************
422 
423 *************************************************************************/
424 void cmatrixgemm(const ae_int_t m, const ae_int_t n, const ae_int_t k, const alglib::complex alpha, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const complex_2d_array &b, const ae_int_t ib, const ae_int_t jb, const ae_int_t optypeb, const alglib::complex beta, const complex_2d_array &c, const ae_int_t ic, const ae_int_t jc);
425 void smp_cmatrixgemm(const ae_int_t m, const ae_int_t n, const ae_int_t k, const alglib::complex alpha, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const complex_2d_array &b, const ae_int_t ib, const ae_int_t jb, const ae_int_t optypeb, const alglib::complex beta, const complex_2d_array &c, const ae_int_t ic, const ae_int_t jc);
426 
427 
428 /*************************************************************************
429 
430 *************************************************************************/
431 void rmatrixgemm(const ae_int_t m, const ae_int_t n, const ae_int_t k, const double alpha, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const real_2d_array &b, const ae_int_t ib, const ae_int_t jb, const ae_int_t optypeb, const double beta, const real_2d_array &c, const ae_int_t ic, const ae_int_t jc);
432 void smp_rmatrixgemm(const ae_int_t m, const ae_int_t n, const ae_int_t k, const double alpha, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const real_2d_array &b, const ae_int_t ib, const ae_int_t jb, const ae_int_t optypeb, const double beta, const real_2d_array &c, const ae_int_t ic, const ae_int_t jc);
433 
434 /*************************************************************************
435 QR decomposition of a rectangular matrix of size MxN
436 
437 Input parameters:
438  A - matrix A whose indexes range within [0..M-1, 0..N-1].
439  M - number of rows in matrix A.
440  N - number of columns in matrix A.
441 
442 Output parameters:
443  A - matrices Q and R in compact form (see below).
444  Tau - array of scalar factors which are used to form
445  matrix Q. Array whose index ranges within [0.. Min(M-1,N-1)].
446 
447 Matrix A is represented as A = QR, where Q is an orthogonal matrix of size
448 MxM, R - upper triangular (or upper trapezoid) matrix of size M x N.
449 
450 The elements of matrix R are located on and above the main diagonal of
451 matrix A. The elements which are located in Tau array and below the main
452 diagonal of matrix A are used to form matrix Q as follows:
453 
454 Matrix Q is represented as a product of elementary reflections
455 
456 Q = H(0)*H(2)*...*H(k-1),
457 
458 where k = min(m,n), and each H(i) is in the form
459 
460 H(i) = 1 - tau * v * (v^T)
461 
462 where tau is a scalar stored in Tau[I]; v - real vector,
463 so that v(0:i-1) = 0, v(i) = 1, v(i+1:m-1) stored in A(i+1:m-1,i).
464 
465  -- ALGLIB routine --
466  17.02.2010
467  Bochkanov Sergey
468 *************************************************************************/
469 void rmatrixqr(real_2d_array &a, const ae_int_t m, const ae_int_t n, real_1d_array &tau);
470 
471 
472 /*************************************************************************
473 LQ decomposition of a rectangular matrix of size MxN
474 
475 Input parameters:
476  A - matrix A whose indexes range within [0..M-1, 0..N-1].
477  M - number of rows in matrix A.
478  N - number of columns in matrix A.
479 
480 Output parameters:
481  A - matrices L and Q in compact form (see below)
482  Tau - array of scalar factors which are used to form
483  matrix Q. Array whose index ranges within [0..Min(M,N)-1].
484 
485 Matrix A is represented as A = LQ, where Q is an orthogonal matrix of size
486 MxM, L - lower triangular (or lower trapezoid) matrix of size M x N.
487 
488 The elements of matrix L are located on and below the main diagonal of
489 matrix A. The elements which are located in Tau array and above the main
490 diagonal of matrix A are used to form matrix Q as follows:
491 
492 Matrix Q is represented as a product of elementary reflections
493 
494 Q = H(k-1)*H(k-2)*...*H(1)*H(0),
495 
496 where k = min(m,n), and each H(i) is of the form
497 
498 H(i) = 1 - tau * v * (v^T)
499 
500 where tau is a scalar stored in Tau[I]; v - real vector, so that v(0:i-1)=0,
501 v(i) = 1, v(i+1:n-1) stored in A(i,i+1:n-1).
502 
503  -- ALGLIB routine --
504  17.02.2010
505  Bochkanov Sergey
506 *************************************************************************/
507 void rmatrixlq(real_2d_array &a, const ae_int_t m, const ae_int_t n, real_1d_array &tau);
508 
509 
510 /*************************************************************************
511 QR decomposition of a rectangular complex matrix of size MxN
512 
513 Input parameters:
514  A - matrix A whose indexes range within [0..M-1, 0..N-1]
515  M - number of rows in matrix A.
516  N - number of columns in matrix A.
517 
518 Output parameters:
519  A - matrices Q and R in compact form
520  Tau - array of scalar factors which are used to form matrix Q. Array
521  whose indexes range within [0.. Min(M,N)-1]
522 
523 Matrix A is represented as A = QR, where Q is an orthogonal matrix of size
524 MxM, R - upper triangular (or upper trapezoid) matrix of size MxN.
525 
526  -- LAPACK routine (version 3.0) --
527  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
528  Courant Institute, Argonne National Lab, and Rice University
529  September 30, 1994
530 *************************************************************************/
531 void cmatrixqr(complex_2d_array &a, const ae_int_t m, const ae_int_t n, complex_1d_array &tau);
532 
533 
534 /*************************************************************************
535 LQ decomposition of a rectangular complex matrix of size MxN
536 
537 Input parameters:
538  A - matrix A whose indexes range within [0..M-1, 0..N-1]
539  M - number of rows in matrix A.
540  N - number of columns in matrix A.
541 
542 Output parameters:
543  A - matrices Q and L in compact form
544  Tau - array of scalar factors which are used to form matrix Q. Array
545  whose indexes range within [0.. Min(M,N)-1]
546 
547 Matrix A is represented as A = LQ, where Q is an orthogonal matrix of size
548 MxM, L - lower triangular (or lower trapezoid) matrix of size MxN.
549 
550  -- LAPACK routine (version 3.0) --
551  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
552  Courant Institute, Argonne National Lab, and Rice University
553  September 30, 1994
554 *************************************************************************/
555 void cmatrixlq(complex_2d_array &a, const ae_int_t m, const ae_int_t n, complex_1d_array &tau);
556 
557 
558 /*************************************************************************
559 Partial unpacking of matrix Q from the QR decomposition of a matrix A
560 
561 Input parameters:
562  A - matrices Q and R in compact form.
563  Output of RMatrixQR subroutine.
564  M - number of rows in given matrix A. M>=0.
565  N - number of columns in given matrix A. N>=0.
566  Tau - scalar factors which are used to form Q.
567  Output of the RMatrixQR subroutine.
568  QColumns - required number of columns of matrix Q. M>=QColumns>=0.
569 
570 Output parameters:
571  Q - first QColumns columns of matrix Q.
572  Array whose indexes range within [0..M-1, 0..QColumns-1].
573  If QColumns=0, the array remains unchanged.
574 
575  -- ALGLIB routine --
576  17.02.2010
577  Bochkanov Sergey
578 *************************************************************************/
579 void rmatrixqrunpackq(const real_2d_array &a, const ae_int_t m, const ae_int_t n, const real_1d_array &tau, const ae_int_t qcolumns, real_2d_array &q);
580 
581 
582 /*************************************************************************
583 Unpacking of matrix R from the QR decomposition of a matrix A
584 
585 Input parameters:
586  A - matrices Q and R in compact form.
587  Output of RMatrixQR subroutine.
588  M - number of rows in given matrix A. M>=0.
589  N - number of columns in given matrix A. N>=0.
590 
591 Output parameters:
592  R - matrix R, array[0..M-1, 0..N-1].
593 
594  -- ALGLIB routine --
595  17.02.2010
596  Bochkanov Sergey
597 *************************************************************************/
598 void rmatrixqrunpackr(const real_2d_array &a, const ae_int_t m, const ae_int_t n, real_2d_array &r);
599 
600 
601 /*************************************************************************
602 Partial unpacking of matrix Q from the LQ decomposition of a matrix A
603 
604 Input parameters:
605  A - matrices L and Q in compact form.
606  Output of RMatrixLQ subroutine.
607  M - number of rows in given matrix A. M>=0.
608  N - number of columns in given matrix A. N>=0.
609  Tau - scalar factors which are used to form Q.
610  Output of the RMatrixLQ subroutine.
611  QRows - required number of rows in matrix Q. N>=QRows>=0.
612 
613 Output parameters:
614  Q - first QRows rows of matrix Q. Array whose indexes range
615  within [0..QRows-1, 0..N-1]. If QRows=0, the array remains
616  unchanged.
617 
618  -- ALGLIB routine --
619  17.02.2010
620  Bochkanov Sergey
621 *************************************************************************/
622 void rmatrixlqunpackq(const real_2d_array &a, const ae_int_t m, const ae_int_t n, const real_1d_array &tau, const ae_int_t qrows, real_2d_array &q);
623 
624 
625 /*************************************************************************
626 Unpacking of matrix L from the LQ decomposition of a matrix A
627 
628 Input parameters:
629  A - matrices Q and L in compact form.
630  Output of RMatrixLQ subroutine.
631  M - number of rows in given matrix A. M>=0.
632  N - number of columns in given matrix A. N>=0.
633 
634 Output parameters:
635  L - matrix L, array[0..M-1, 0..N-1].
636 
637  -- ALGLIB routine --
638  17.02.2010
639  Bochkanov Sergey
640 *************************************************************************/
641 void rmatrixlqunpackl(const real_2d_array &a, const ae_int_t m, const ae_int_t n, real_2d_array &l);
642 
643 
644 /*************************************************************************
645 Partial unpacking of matrix Q from QR decomposition of a complex matrix A.
646 
647 Input parameters:
648  A - matrices Q and R in compact form.
649  Output of CMatrixQR subroutine .
650  M - number of rows in matrix A. M>=0.
651  N - number of columns in matrix A. N>=0.
652  Tau - scalar factors which are used to form Q.
653  Output of CMatrixQR subroutine .
654  QColumns - required number of columns in matrix Q. M>=QColumns>=0.
655 
656 Output parameters:
657  Q - first QColumns columns of matrix Q.
658  Array whose index ranges within [0..M-1, 0..QColumns-1].
659  If QColumns=0, array isn't changed.
660 
661  -- ALGLIB routine --
662  17.02.2010
663  Bochkanov Sergey
664 *************************************************************************/
665 void cmatrixqrunpackq(const complex_2d_array &a, const ae_int_t m, const ae_int_t n, const complex_1d_array &tau, const ae_int_t qcolumns, complex_2d_array &q);
666 
667 
668 /*************************************************************************
669 Unpacking of matrix R from the QR decomposition of a matrix A
670 
671 Input parameters:
672  A - matrices Q and R in compact form.
673  Output of CMatrixQR subroutine.
674  M - number of rows in given matrix A. M>=0.
675  N - number of columns in given matrix A. N>=0.
676 
677 Output parameters:
678  R - matrix R, array[0..M-1, 0..N-1].
679 
680  -- ALGLIB routine --
681  17.02.2010
682  Bochkanov Sergey
683 *************************************************************************/
684 void cmatrixqrunpackr(const complex_2d_array &a, const ae_int_t m, const ae_int_t n, complex_2d_array &r);
685 
686 
687 /*************************************************************************
688 Partial unpacking of matrix Q from LQ decomposition of a complex matrix A.
689 
690 Input parameters:
691  A - matrices Q and R in compact form.
692  Output of CMatrixLQ subroutine .
693  M - number of rows in matrix A. M>=0.
694  N - number of columns in matrix A. N>=0.
695  Tau - scalar factors which are used to form Q.
696  Output of CMatrixLQ subroutine .
697  QRows - required number of rows in matrix Q. N>=QColumns>=0.
698 
699 Output parameters:
700  Q - first QRows rows of matrix Q.
701  Array whose index ranges within [0..QRows-1, 0..N-1].
702  If QRows=0, array isn't changed.
703 
704  -- ALGLIB routine --
705  17.02.2010
706  Bochkanov Sergey
707 *************************************************************************/
708 void cmatrixlqunpackq(const complex_2d_array &a, const ae_int_t m, const ae_int_t n, const complex_1d_array &tau, const ae_int_t qrows, complex_2d_array &q);
709 
710 
711 /*************************************************************************
712 Unpacking of matrix L from the LQ decomposition of a matrix A
713 
714 Input parameters:
715  A - matrices Q and L in compact form.
716  Output of CMatrixLQ subroutine.
717  M - number of rows in given matrix A. M>=0.
718  N - number of columns in given matrix A. N>=0.
719 
720 Output parameters:
721  L - matrix L, array[0..M-1, 0..N-1].
722 
723  -- ALGLIB routine --
724  17.02.2010
725  Bochkanov Sergey
726 *************************************************************************/
727 void cmatrixlqunpackl(const complex_2d_array &a, const ae_int_t m, const ae_int_t n, complex_2d_array &l);
728 
729 
730 /*************************************************************************
731 Reduction of a rectangular matrix to bidiagonal form
732 
733 The algorithm reduces the rectangular matrix A to bidiagonal form by
734 orthogonal transformations P and Q: A = Q*B*P.
735 
736 Input parameters:
737  A - source matrix. array[0..M-1, 0..N-1]
738  M - number of rows in matrix A.
739  N - number of columns in matrix A.
740 
741 Output parameters:
742  A - matrices Q, B, P in compact form (see below).
743  TauQ - scalar factors which are used to form matrix Q.
744  TauP - scalar factors which are used to form matrix P.
745 
746 The main diagonal and one of the secondary diagonals of matrix A are
747 replaced with bidiagonal matrix B. Other elements contain elementary
748 reflections which form MxM matrix Q and NxN matrix P, respectively.
749 
750 If M>=N, B is the upper bidiagonal MxN matrix and is stored in the
751 corresponding elements of matrix A. Matrix Q is represented as a
752 product of elementary reflections Q = H(0)*H(1)*...*H(n-1), where
753 H(i) = 1-tau*v*v'. Here tau is a scalar which is stored in TauQ[i], and
754 vector v has the following structure: v(0:i-1)=0, v(i)=1, v(i+1:m-1) is
755 stored in elements A(i+1:m-1,i). Matrix P is as follows: P =
756 G(0)*G(1)*...*G(n-2), where G(i) = 1 - tau*u*u'. Tau is stored in TauP[i],
757 u(0:i)=0, u(i+1)=1, u(i+2:n-1) is stored in elements A(i,i+2:n-1).
758 
759 If M<N, B is the lower bidiagonal MxN matrix and is stored in the
760 corresponding elements of matrix A. Q = H(0)*H(1)*...*H(m-2), where
761 H(i) = 1 - tau*v*v', tau is stored in TauQ, v(0:i)=0, v(i+1)=1, v(i+2:m-1)
762 is stored in elements A(i+2:m-1,i). P = G(0)*G(1)*...*G(m-1),
763 G(i) = 1-tau*u*u', tau is stored in TauP, u(0:i-1)=0, u(i)=1, u(i+1:n-1)
764 is stored in A(i,i+1:n-1).
765 
766 EXAMPLE:
767 
768 m=6, n=5 (m > n): m=5, n=6 (m < n):
769 
770 ( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 )
771 ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 )
772 ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 )
773 ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 )
774 ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 )
775 ( v1 v2 v3 v4 v5 )
776 
777 Here vi and ui are vectors which form H(i) and G(i), and d and e -
778 are the diagonal and off-diagonal elements of matrix B.
779 
780  -- LAPACK routine (version 3.0) --
781  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
782  Courant Institute, Argonne National Lab, and Rice University
783  September 30, 1994.
784  Sergey Bochkanov, ALGLIB project, translation from FORTRAN to
785  pseudocode, 2007-2010.
786 *************************************************************************/
787 void rmatrixbd(real_2d_array &a, const ae_int_t m, const ae_int_t n, real_1d_array &tauq, real_1d_array &taup);
788 
789 
790 /*************************************************************************
791 Unpacking matrix Q which reduces a matrix to bidiagonal form.
792 
793 Input parameters:
794  QP - matrices Q and P in compact form.
795  Output of ToBidiagonal subroutine.
796  M - number of rows in matrix A.
797  N - number of columns in matrix A.
798  TAUQ - scalar factors which are used to form Q.
799  Output of ToBidiagonal subroutine.
800  QColumns - required number of columns in matrix Q.
801  M>=QColumns>=0.
802 
803 Output parameters:
804  Q - first QColumns columns of matrix Q.
805  Array[0..M-1, 0..QColumns-1]
806  If QColumns=0, the array is not modified.
807 
808  -- ALGLIB --
809  2005-2010
810  Bochkanov Sergey
811 *************************************************************************/
812 void rmatrixbdunpackq(const real_2d_array &qp, const ae_int_t m, const ae_int_t n, const real_1d_array &tauq, const ae_int_t qcolumns, real_2d_array &q);
813 
814 
815 /*************************************************************************
816 Multiplication by matrix Q which reduces matrix A to bidiagonal form.
817 
818 The algorithm allows pre- or post-multiply by Q or Q'.
819 
820 Input parameters:
821  QP - matrices Q and P in compact form.
822  Output of ToBidiagonal subroutine.
823  M - number of rows in matrix A.
824  N - number of columns in matrix A.
825  TAUQ - scalar factors which are used to form Q.
826  Output of ToBidiagonal subroutine.
827  Z - multiplied matrix.
828  array[0..ZRows-1,0..ZColumns-1]
829  ZRows - number of rows in matrix Z. If FromTheRight=False,
830  ZRows=M, otherwise ZRows can be arbitrary.
831  ZColumns - number of columns in matrix Z. If FromTheRight=True,
832  ZColumns=M, otherwise ZColumns can be arbitrary.
833  FromTheRight - pre- or post-multiply.
834  DoTranspose - multiply by Q or Q'.
835 
836 Output parameters:
837  Z - product of Z and Q.
838  Array[0..ZRows-1,0..ZColumns-1]
839  If ZRows=0 or ZColumns=0, the array is not modified.
840 
841  -- ALGLIB --
842  2005-2010
843  Bochkanov Sergey
844 *************************************************************************/
845 void rmatrixbdmultiplybyq(const real_2d_array &qp, const ae_int_t m, const ae_int_t n, const real_1d_array &tauq, real_2d_array &z, const ae_int_t zrows, const ae_int_t zcolumns, const bool fromtheright, const bool dotranspose);
846 
847 
848 /*************************************************************************
849 Unpacking matrix P which reduces matrix A to bidiagonal form.
850 The subroutine returns transposed matrix P.
851 
852 Input parameters:
853  QP - matrices Q and P in compact form.
854  Output of ToBidiagonal subroutine.
855  M - number of rows in matrix A.
856  N - number of columns in matrix A.
857  TAUP - scalar factors which are used to form P.
858  Output of ToBidiagonal subroutine.
859  PTRows - required number of rows of matrix P^T. N >= PTRows >= 0.
860 
861 Output parameters:
862  PT - first PTRows columns of matrix P^T
863  Array[0..PTRows-1, 0..N-1]
864  If PTRows=0, the array is not modified.
865 
866  -- ALGLIB --
867  2005-2010
868  Bochkanov Sergey
869 *************************************************************************/
870 void rmatrixbdunpackpt(const real_2d_array &qp, const ae_int_t m, const ae_int_t n, const real_1d_array &taup, const ae_int_t ptrows, real_2d_array &pt);
871 
872 
873 /*************************************************************************
874 Multiplication by matrix P which reduces matrix A to bidiagonal form.
875 
876 The algorithm allows pre- or post-multiply by P or P'.
877 
878 Input parameters:
879  QP - matrices Q and P in compact form.
880  Output of RMatrixBD subroutine.
881  M - number of rows in matrix A.
882  N - number of columns in matrix A.
883  TAUP - scalar factors which are used to form P.
884  Output of RMatrixBD subroutine.
885  Z - multiplied matrix.
886  Array whose indexes range within [0..ZRows-1,0..ZColumns-1].
887  ZRows - number of rows in matrix Z. If FromTheRight=False,
888  ZRows=N, otherwise ZRows can be arbitrary.
889  ZColumns - number of columns in matrix Z. If FromTheRight=True,
890  ZColumns=N, otherwise ZColumns can be arbitrary.
891  FromTheRight - pre- or post-multiply.
892  DoTranspose - multiply by P or P'.
893 
894 Output parameters:
895  Z - product of Z and P.
896  Array whose indexes range within [0..ZRows-1,0..ZColumns-1].
897  If ZRows=0 or ZColumns=0, the array is not modified.
898 
899  -- ALGLIB --
900  2005-2010
901  Bochkanov Sergey
902 *************************************************************************/
903 void rmatrixbdmultiplybyp(const real_2d_array &qp, const ae_int_t m, const ae_int_t n, const real_1d_array &taup, real_2d_array &z, const ae_int_t zrows, const ae_int_t zcolumns, const bool fromtheright, const bool dotranspose);
904 
905 
906 /*************************************************************************
907 Unpacking of the main and secondary diagonals of bidiagonal decomposition
908 of matrix A.
909 
910 Input parameters:
911  B - output of RMatrixBD subroutine.
912  M - number of rows in matrix B.
913  N - number of columns in matrix B.
914 
915 Output parameters:
916  IsUpper - True, if the matrix is upper bidiagonal.
917  otherwise IsUpper is False.
918  D - the main diagonal.
919  Array whose index ranges within [0..Min(M,N)-1].
920  E - the secondary diagonal (upper or lower, depending on
921  the value of IsUpper).
922  Array index ranges within [0..Min(M,N)-1], the last
923  element is not used.
924 
925  -- ALGLIB --
926  2005-2010
927  Bochkanov Sergey
928 *************************************************************************/
929 void rmatrixbdunpackdiagonals(const real_2d_array &b, const ae_int_t m, const ae_int_t n, bool &isupper, real_1d_array &d, real_1d_array &e);
930 
931 
932 /*************************************************************************
933 Reduction of a square matrix to upper Hessenberg form: Q'*A*Q = H,
934 where Q is an orthogonal matrix, H - Hessenberg matrix.
935 
936 Input parameters:
937  A - matrix A with elements [0..N-1, 0..N-1]
938  N - size of matrix A.
939 
940 Output parameters:
941  A - matrices Q and P in compact form (see below).
942  Tau - array of scalar factors which are used to form matrix Q.
943  Array whose index ranges within [0..N-2]
944 
945 Matrix H is located on the main diagonal, on the lower secondary diagonal
946 and above the main diagonal of matrix A. The elements which are used to
947 form matrix Q are situated in array Tau and below the lower secondary
948 diagonal of matrix A as follows:
949 
950 Matrix Q is represented as a product of elementary reflections
951 
952 Q = H(0)*H(2)*...*H(n-2),
953 
954 where each H(i) is given by
955 
956 H(i) = 1 - tau * v * (v^T)
957 
958 where tau is a scalar stored in Tau[I]; v - is a real vector,
959 so that v(0:i) = 0, v(i+1) = 1, v(i+2:n-1) stored in A(i+2:n-1,i).
960 
961  -- LAPACK routine (version 3.0) --
962  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
963  Courant Institute, Argonne National Lab, and Rice University
964  October 31, 1992
965 *************************************************************************/
966 void rmatrixhessenberg(real_2d_array &a, const ae_int_t n, real_1d_array &tau);
967 
968 
969 /*************************************************************************
970 Unpacking matrix Q which reduces matrix A to upper Hessenberg form
971 
972 Input parameters:
973  A - output of RMatrixHessenberg subroutine.
974  N - size of matrix A.
975  Tau - scalar factors which are used to form Q.
976  Output of RMatrixHessenberg subroutine.
977 
978 Output parameters:
979  Q - matrix Q.
980  Array whose indexes range within [0..N-1, 0..N-1].
981 
982  -- ALGLIB --
983  2005-2010
984  Bochkanov Sergey
985 *************************************************************************/
986 void rmatrixhessenbergunpackq(const real_2d_array &a, const ae_int_t n, const real_1d_array &tau, real_2d_array &q);
987 
988 
989 /*************************************************************************
990 Unpacking matrix H (the result of matrix A reduction to upper Hessenberg form)
991 
992 Input parameters:
993  A - output of RMatrixHessenberg subroutine.
994  N - size of matrix A.
995 
996 Output parameters:
997  H - matrix H. Array whose indexes range within [0..N-1, 0..N-1].
998 
999  -- ALGLIB --
1000  2005-2010
1001  Bochkanov Sergey
1002 *************************************************************************/
1003 void rmatrixhessenbergunpackh(const real_2d_array &a, const ae_int_t n, real_2d_array &h);
1004 
1005 
1006 /*************************************************************************
1007 Reduction of a symmetric matrix which is given by its higher or lower
1008 triangular part to a tridiagonal matrix using orthogonal similarity
1009 transformation: Q'*A*Q=T.
1010 
1011 Input parameters:
1012  A - matrix to be transformed
1013  array with elements [0..N-1, 0..N-1].
1014  N - size of matrix A.
1015  IsUpper - storage format. If IsUpper = True, then matrix A is given
1016  by its upper triangle, and the lower triangle is not used
1017  and not modified by the algorithm, and vice versa
1018  if IsUpper = False.
1019 
1020 Output parameters:
1021  A - matrices T and Q in compact form (see lower)
1022  Tau - array of factors which are forming matrices H(i)
1023  array with elements [0..N-2].
1024  D - main diagonal of symmetric matrix T.
1025  array with elements [0..N-1].
1026  E - secondary diagonal of symmetric matrix T.
1027  array with elements [0..N-2].
1028 
1029 
1030  If IsUpper=True, the matrix Q is represented as a product of elementary
1031  reflectors
1032 
1033  Q = H(n-2) . . . H(2) H(0).
1034 
1035  Each H(i) has the form
1036 
1037  H(i) = I - tau * v * v'
1038 
1039  where tau is a real scalar, and v is a real vector with
1040  v(i+1:n-1) = 0, v(i) = 1, v(0:i-1) is stored on exit in
1041  A(0:i-1,i+1), and tau in TAU(i).
1042 
1043  If IsUpper=False, the matrix Q is represented as a product of elementary
1044  reflectors
1045 
1046  Q = H(0) H(2) . . . H(n-2).
1047 
1048  Each H(i) has the form
1049 
1050  H(i) = I - tau * v * v'
1051 
1052  where tau is a real scalar, and v is a real vector with
1053  v(0:i) = 0, v(i+1) = 1, v(i+2:n-1) is stored on exit in A(i+2:n-1,i),
1054  and tau in TAU(i).
1055 
1056  The contents of A on exit are illustrated by the following examples
1057  with n = 5:
1058 
1059  if UPLO = 'U': if UPLO = 'L':
1060 
1061  ( d e v1 v2 v3 ) ( d )
1062  ( d e v2 v3 ) ( e d )
1063  ( d e v3 ) ( v0 e d )
1064  ( d e ) ( v0 v1 e d )
1065  ( d ) ( v0 v1 v2 e d )
1066 
1067  where d and e denote diagonal and off-diagonal elements of T, and vi
1068  denotes an element of the vector defining H(i).
1069 
1070  -- LAPACK routine (version 3.0) --
1071  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1072  Courant Institute, Argonne National Lab, and Rice University
1073  October 31, 1992
1074 *************************************************************************/
1075 void smatrixtd(real_2d_array &a, const ae_int_t n, const bool isupper, real_1d_array &tau, real_1d_array &d, real_1d_array &e);
1076 
1077 
1078 /*************************************************************************
1079 Unpacking matrix Q which reduces symmetric matrix to a tridiagonal
1080 form.
1081 
1082 Input parameters:
1083  A - the result of a SMatrixTD subroutine
1084  N - size of matrix A.
1085  IsUpper - storage format (a parameter of SMatrixTD subroutine)
1086  Tau - the result of a SMatrixTD subroutine
1087 
1088 Output parameters:
1089  Q - transformation matrix.
1090  array with elements [0..N-1, 0..N-1].
1091 
1092  -- ALGLIB --
1093  Copyright 2005-2010 by Bochkanov Sergey
1094 *************************************************************************/
1095 void smatrixtdunpackq(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &tau, real_2d_array &q);
1096 
1097 
1098 /*************************************************************************
1099 Reduction of a Hermitian matrix which is given by its higher or lower
1100 triangular part to a real tridiagonal matrix using unitary similarity
1101 transformation: Q'*A*Q = T.
1102 
1103 Input parameters:
1104  A - matrix to be transformed
1105  array with elements [0..N-1, 0..N-1].
1106  N - size of matrix A.
1107  IsUpper - storage format. If IsUpper = True, then matrix A is given
1108  by its upper triangle, and the lower triangle is not used
1109  and not modified by the algorithm, and vice versa
1110  if IsUpper = False.
1111 
1112 Output parameters:
1113  A - matrices T and Q in compact form (see lower)
1114  Tau - array of factors which are forming matrices H(i)
1115  array with elements [0..N-2].
1116  D - main diagonal of real symmetric matrix T.
1117  array with elements [0..N-1].
1118  E - secondary diagonal of real symmetric matrix T.
1119  array with elements [0..N-2].
1120 
1121 
1122  If IsUpper=True, the matrix Q is represented as a product of elementary
1123  reflectors
1124 
1125  Q = H(n-2) . . . H(2) H(0).
1126 
1127  Each H(i) has the form
1128 
1129  H(i) = I - tau * v * v'
1130 
1131  where tau is a complex scalar, and v is a complex vector with
1132  v(i+1:n-1) = 0, v(i) = 1, v(0:i-1) is stored on exit in
1133  A(0:i-1,i+1), and tau in TAU(i).
1134 
1135  If IsUpper=False, the matrix Q is represented as a product of elementary
1136  reflectors
1137 
1138  Q = H(0) H(2) . . . H(n-2).
1139 
1140  Each H(i) has the form
1141 
1142  H(i) = I - tau * v * v'
1143 
1144  where tau is a complex scalar, and v is a complex vector with
1145  v(0:i) = 0, v(i+1) = 1, v(i+2:n-1) is stored on exit in A(i+2:n-1,i),
1146  and tau in TAU(i).
1147 
1148  The contents of A on exit are illustrated by the following examples
1149  with n = 5:
1150 
1151  if UPLO = 'U': if UPLO = 'L':
1152 
1153  ( d e v1 v2 v3 ) ( d )
1154  ( d e v2 v3 ) ( e d )
1155  ( d e v3 ) ( v0 e d )
1156  ( d e ) ( v0 v1 e d )
1157  ( d ) ( v0 v1 v2 e d )
1158 
1159 where d and e denote diagonal and off-diagonal elements of T, and vi
1160 denotes an element of the vector defining H(i).
1161 
1162  -- LAPACK routine (version 3.0) --
1163  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1164  Courant Institute, Argonne National Lab, and Rice University
1165  October 31, 1992
1166 *************************************************************************/
1167 void hmatrixtd(complex_2d_array &a, const ae_int_t n, const bool isupper, complex_1d_array &tau, real_1d_array &d, real_1d_array &e);
1168 
1169 
1170 /*************************************************************************
1171 Unpacking matrix Q which reduces a Hermitian matrix to a real tridiagonal
1172 form.
1173 
1174 Input parameters:
1175  A - the result of a HMatrixTD subroutine
1176  N - size of matrix A.
1177  IsUpper - storage format (a parameter of HMatrixTD subroutine)
1178  Tau - the result of a HMatrixTD subroutine
1179 
1180 Output parameters:
1181  Q - transformation matrix.
1182  array with elements [0..N-1, 0..N-1].
1183 
1184  -- ALGLIB --
1185  Copyright 2005-2010 by Bochkanov Sergey
1186 *************************************************************************/
1187 void hmatrixtdunpackq(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &tau, complex_2d_array &q);
1188 
1189 /*************************************************************************
1190 Singular value decomposition of a bidiagonal matrix (extended algorithm)
1191 
1192 The algorithm performs the singular value decomposition of a bidiagonal
1193 matrix B (upper or lower) representing it as B = Q*S*P^T, where Q and P -
1194 orthogonal matrices, S - diagonal matrix with non-negative elements on the
1195 main diagonal, in descending order.
1196 
1197 The algorithm finds singular values. In addition, the algorithm can
1198 calculate matrices Q and P (more precisely, not the matrices, but their
1199 product with given matrices U and VT - U*Q and (P^T)*VT)). Of course,
1200 matrices U and VT can be of any type, including identity. Furthermore, the
1201 algorithm can calculate Q'*C (this product is calculated more effectively
1202 than U*Q, because this calculation operates with rows instead of matrix
1203 columns).
1204 
1205 The feature of the algorithm is its ability to find all singular values
1206 including those which are arbitrarily close to 0 with relative accuracy
1207 close to machine precision. If the parameter IsFractionalAccuracyRequired
1208 is set to True, all singular values will have high relative accuracy close
1209 to machine precision. If the parameter is set to False, only the biggest
1210 singular value will have relative accuracy close to machine precision.
1211 The absolute error of other singular values is equal to the absolute error
1212 of the biggest singular value.
1213 
1214 Input parameters:
1215  D - main diagonal of matrix B.
1216  Array whose index ranges within [0..N-1].
1217  E - superdiagonal (or subdiagonal) of matrix B.
1218  Array whose index ranges within [0..N-2].
1219  N - size of matrix B.
1220  IsUpper - True, if the matrix is upper bidiagonal.
1221  IsFractionalAccuracyRequired -
1222  THIS PARAMETER IS IGNORED SINCE ALGLIB 3.5.0
1223  SINGULAR VALUES ARE ALWAYS SEARCHED WITH HIGH ACCURACY.
1224  U - matrix to be multiplied by Q.
1225  Array whose indexes range within [0..NRU-1, 0..N-1].
1226  The matrix can be bigger, in that case only the submatrix
1227  [0..NRU-1, 0..N-1] will be multiplied by Q.
1228  NRU - number of rows in matrix U.
1229  C - matrix to be multiplied by Q'.
1230  Array whose indexes range within [0..N-1, 0..NCC-1].
1231  The matrix can be bigger, in that case only the submatrix
1232  [0..N-1, 0..NCC-1] will be multiplied by Q'.
1233  NCC - number of columns in matrix C.
1234  VT - matrix to be multiplied by P^T.
1235  Array whose indexes range within [0..N-1, 0..NCVT-1].
1236  The matrix can be bigger, in that case only the submatrix
1237  [0..N-1, 0..NCVT-1] will be multiplied by P^T.
1238  NCVT - number of columns in matrix VT.
1239 
1240 Output parameters:
1241  D - singular values of matrix B in descending order.
1242  U - if NRU>0, contains matrix U*Q.
1243  VT - if NCVT>0, contains matrix (P^T)*VT.
1244  C - if NCC>0, contains matrix Q'*C.
1245 
1246 Result:
1247  True, if the algorithm has converged.
1248  False, if the algorithm hasn't converged (rare case).
1249 
1250 Additional information:
1251  The type of convergence is controlled by the internal parameter TOL.
1252  If the parameter is greater than 0, the singular values will have
1253  relative accuracy TOL. If TOL<0, the singular values will have
1254  absolute accuracy ABS(TOL)*norm(B).
1255  By default, |TOL| falls within the range of 10*Epsilon and 100*Epsilon,
1256  where Epsilon is the machine precision. It is not recommended to use
1257  TOL less than 10*Epsilon since this will considerably slow down the
1258  algorithm and may not lead to error decreasing.
1259 History:
1260  * 31 March, 2007.
1261  changed MAXITR from 6 to 12.
1262 
1263  -- LAPACK routine (version 3.0) --
1264  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1265  Courant Institute, Argonne National Lab, and Rice University
1266  October 31, 1999.
1267 *************************************************************************/
1268 bool rmatrixbdsvd(real_1d_array &d, const real_1d_array &e, const ae_int_t n, const bool isupper, const bool isfractionalaccuracyrequired, real_2d_array &u, const ae_int_t nru, real_2d_array &c, const ae_int_t ncc, real_2d_array &vt, const ae_int_t ncvt);
1269 
1270 /*************************************************************************
1271 Singular value decomposition of a rectangular matrix.
1272 
1273 The algorithm calculates the singular value decomposition of a matrix of
1274 size MxN: A = U * S * V^T
1275 
1276 The algorithm finds the singular values and, optionally, matrices U and V^T.
1277 The algorithm can find both first min(M,N) columns of matrix U and rows of
1278 matrix V^T (singular vectors), and matrices U and V^T wholly (of sizes MxM
1279 and NxN respectively).
1280 
1281 Take into account that the subroutine does not return matrix V but V^T.
1282 
1283 Input parameters:
1284  A - matrix to be decomposed.
1285  Array whose indexes range within [0..M-1, 0..N-1].
1286  M - number of rows in matrix A.
1287  N - number of columns in matrix A.
1288  UNeeded - 0, 1 or 2. See the description of the parameter U.
1289  VTNeeded - 0, 1 or 2. See the description of the parameter VT.
1290  AdditionalMemory -
1291  If the parameter:
1292  * equals 0, the algorithm doesn’t use additional
1293  memory (lower requirements, lower performance).
1294  * equals 1, the algorithm uses additional
1295  memory of size min(M,N)*min(M,N) of real numbers.
1296  It often speeds up the algorithm.
1297  * equals 2, the algorithm uses additional
1298  memory of size M*min(M,N) of real numbers.
1299  It allows to get a maximum performance.
1300  The recommended value of the parameter is 2.
1301 
1302 Output parameters:
1303  W - contains singular values in descending order.
1304  U - if UNeeded=0, U isn't changed, the left singular vectors
1305  are not calculated.
1306  if Uneeded=1, U contains left singular vectors (first
1307  min(M,N) columns of matrix U). Array whose indexes range
1308  within [0..M-1, 0..Min(M,N)-1].
1309  if UNeeded=2, U contains matrix U wholly. Array whose
1310  indexes range within [0..M-1, 0..M-1].
1311  VT - if VTNeeded=0, VT isn’t changed, the right singular vectors
1312  are not calculated.
1313  if VTNeeded=1, VT contains right singular vectors (first
1314  min(M,N) rows of matrix V^T). Array whose indexes range
1315  within [0..min(M,N)-1, 0..N-1].
1316  if VTNeeded=2, VT contains matrix V^T wholly. Array whose
1317  indexes range within [0..N-1, 0..N-1].
1318 
1319  -- ALGLIB --
1320  Copyright 2005 by Bochkanov Sergey
1321 *************************************************************************/
1322 bool rmatrixsvd(const real_2d_array &a, const ae_int_t m, const ae_int_t n, const ae_int_t uneeded, const ae_int_t vtneeded, const ae_int_t additionalmemory, real_1d_array &w, real_2d_array &u, real_2d_array &vt);
1323 
1324 /*************************************************************************
1325 Finding the eigenvalues and eigenvectors of a symmetric matrix
1326 
1327 The algorithm finds eigen pairs of a symmetric matrix by reducing it to
1328 tridiagonal form and using the QL/QR algorithm.
1329 
1330 Input parameters:
1331  A - symmetric matrix which is given by its upper or lower
1332  triangular part.
1333  Array whose indexes range within [0..N-1, 0..N-1].
1334  N - size of matrix A.
1335  ZNeeded - flag controlling whether the eigenvectors are needed or not.
1336  If ZNeeded is equal to:
1337  * 0, the eigenvectors are not returned;
1338  * 1, the eigenvectors are returned.
1339  IsUpper - storage format.
1340 
1341 Output parameters:
1342  D - eigenvalues in ascending order.
1343  Array whose index ranges within [0..N-1].
1344  Z - if ZNeeded is equal to:
1345  * 0, Z hasn’t changed;
1346  * 1, Z contains the eigenvectors.
1347  Array whose indexes range within [0..N-1, 0..N-1].
1348  The eigenvectors are stored in the matrix columns.
1349 
1350 Result:
1351  True, if the algorithm has converged.
1352  False, if the algorithm hasn't converged (rare case).
1353 
1354  -- ALGLIB --
1355  Copyright 2005-2008 by Bochkanov Sergey
1356 *************************************************************************/
1357 bool smatrixevd(const real_2d_array &a, const ae_int_t n, const ae_int_t zneeded, const bool isupper, real_1d_array &d, real_2d_array &z);
1358 
1359 
1360 /*************************************************************************
1361 Subroutine for finding the eigenvalues (and eigenvectors) of a symmetric
1362 matrix in a given half open interval (A, B] by using a bisection and
1363 inverse iteration
1364 
1365 Input parameters:
1366  A - symmetric matrix which is given by its upper or lower
1367  triangular part. Array [0..N-1, 0..N-1].
1368  N - size of matrix A.
1369  ZNeeded - flag controlling whether the eigenvectors are needed or not.
1370  If ZNeeded is equal to:
1371  * 0, the eigenvectors are not returned;
1372  * 1, the eigenvectors are returned.
1373  IsUpperA - storage format of matrix A.
1374  B1, B2 - half open interval (B1, B2] to search eigenvalues in.
1375 
1376 Output parameters:
1377  M - number of eigenvalues found in a given half-interval (M>=0).
1378  W - array of the eigenvalues found.
1379  Array whose index ranges within [0..M-1].
1380  Z - if ZNeeded is equal to:
1381  * 0, Z hasn’t changed;
1382  * 1, Z contains eigenvectors.
1383  Array whose indexes range within [0..N-1, 0..M-1].
1384  The eigenvectors are stored in the matrix columns.
1385 
1386 Result:
1387  True, if successful. M contains the number of eigenvalues in the given
1388  half-interval (could be equal to 0), W contains the eigenvalues,
1389  Z contains the eigenvectors (if needed).
1390 
1391  False, if the bisection method subroutine wasn't able to find the
1392  eigenvalues in the given interval or if the inverse iteration subroutine
1393  wasn't able to find all the corresponding eigenvectors.
1394  In that case, the eigenvalues and eigenvectors are not returned,
1395  M is equal to 0.
1396 
1397  -- ALGLIB --
1398  Copyright 07.01.2006 by Bochkanov Sergey
1399 *************************************************************************/
1400 bool smatrixevdr(const real_2d_array &a, const ae_int_t n, const ae_int_t zneeded, const bool isupper, const double b1, const double b2, ae_int_t &m, real_1d_array &w, real_2d_array &z);
1401 
1402 
1403 /*************************************************************************
1404 Subroutine for finding the eigenvalues and eigenvectors of a symmetric
1405 matrix with given indexes by using bisection and inverse iteration methods.
1406 
1407 Input parameters:
1408  A - symmetric matrix which is given by its upper or lower
1409  triangular part. Array whose indexes range within [0..N-1, 0..N-1].
1410  N - size of matrix A.
1411  ZNeeded - flag controlling whether the eigenvectors are needed or not.
1412  If ZNeeded is equal to:
1413  * 0, the eigenvectors are not returned;
1414  * 1, the eigenvectors are returned.
1415  IsUpperA - storage format of matrix A.
1416  I1, I2 - index interval for searching (from I1 to I2).
1417  0 <= I1 <= I2 <= N-1.
1418 
1419 Output parameters:
1420  W - array of the eigenvalues found.
1421  Array whose index ranges within [0..I2-I1].
1422  Z - if ZNeeded is equal to:
1423  * 0, Z hasn’t changed;
1424  * 1, Z contains eigenvectors.
1425  Array whose indexes range within [0..N-1, 0..I2-I1].
1426  In that case, the eigenvectors are stored in the matrix columns.
1427 
1428 Result:
1429  True, if successful. W contains the eigenvalues, Z contains the
1430  eigenvectors (if needed).
1431 
1432  False, if the bisection method subroutine wasn't able to find the
1433  eigenvalues in the given interval or if the inverse iteration subroutine
1434  wasn't able to find all the corresponding eigenvectors.
1435  In that case, the eigenvalues and eigenvectors are not returned.
1436 
1437  -- ALGLIB --
1438  Copyright 07.01.2006 by Bochkanov Sergey
1439 *************************************************************************/
1440 bool smatrixevdi(const real_2d_array &a, const ae_int_t n, const ae_int_t zneeded, const bool isupper, const ae_int_t i1, const ae_int_t i2, real_1d_array &w, real_2d_array &z);
1441 
1442 
1443 /*************************************************************************
1444 Finding the eigenvalues and eigenvectors of a Hermitian matrix
1445 
1446 The algorithm finds eigen pairs of a Hermitian matrix by reducing it to
1447 real tridiagonal form and using the QL/QR algorithm.
1448 
1449 Input parameters:
1450  A - Hermitian matrix which is given by its upper or lower
1451  triangular part.
1452  Array whose indexes range within [0..N-1, 0..N-1].
1453  N - size of matrix A.
1454  IsUpper - storage format.
1455  ZNeeded - flag controlling whether the eigenvectors are needed or
1456  not. If ZNeeded is equal to:
1457  * 0, the eigenvectors are not returned;
1458  * 1, the eigenvectors are returned.
1459 
1460 Output parameters:
1461  D - eigenvalues in ascending order.
1462  Array whose index ranges within [0..N-1].
1463  Z - if ZNeeded is equal to:
1464  * 0, Z hasn’t changed;
1465  * 1, Z contains the eigenvectors.
1466  Array whose indexes range within [0..N-1, 0..N-1].
1467  The eigenvectors are stored in the matrix columns.
1468 
1469 Result:
1470  True, if the algorithm has converged.
1471  False, if the algorithm hasn't converged (rare case).
1472 
1473 Note:
1474  eigenvectors of Hermitian matrix are defined up to multiplication by
1475  a complex number L, such that |L|=1.
1476 
1477  -- ALGLIB --
1478  Copyright 2005, 23 March 2007 by Bochkanov Sergey
1479 *************************************************************************/
1480 bool hmatrixevd(const complex_2d_array &a, const ae_int_t n, const ae_int_t zneeded, const bool isupper, real_1d_array &d, complex_2d_array &z);
1481 
1482 
1483 /*************************************************************************
1484 Subroutine for finding the eigenvalues (and eigenvectors) of a Hermitian
1485 matrix in a given half-interval (A, B] by using a bisection and inverse
1486 iteration
1487 
1488 Input parameters:
1489  A - Hermitian matrix which is given by its upper or lower
1490  triangular part. Array whose indexes range within
1491  [0..N-1, 0..N-1].
1492  N - size of matrix A.
1493  ZNeeded - flag controlling whether the eigenvectors are needed or
1494  not. If ZNeeded is equal to:
1495  * 0, the eigenvectors are not returned;
1496  * 1, the eigenvectors are returned.
1497  IsUpperA - storage format of matrix A.
1498  B1, B2 - half-interval (B1, B2] to search eigenvalues in.
1499 
1500 Output parameters:
1501  M - number of eigenvalues found in a given half-interval, M>=0
1502  W - array of the eigenvalues found.
1503  Array whose index ranges within [0..M-1].
1504  Z - if ZNeeded is equal to:
1505  * 0, Z hasn’t changed;
1506  * 1, Z contains eigenvectors.
1507  Array whose indexes range within [0..N-1, 0..M-1].
1508  The eigenvectors are stored in the matrix columns.
1509 
1510 Result:
1511  True, if successful. M contains the number of eigenvalues in the given
1512  half-interval (could be equal to 0), W contains the eigenvalues,
1513  Z contains the eigenvectors (if needed).
1514 
1515  False, if the bisection method subroutine wasn't able to find the
1516  eigenvalues in the given interval or if the inverse iteration
1517  subroutine wasn't able to find all the corresponding eigenvectors.
1518  In that case, the eigenvalues and eigenvectors are not returned, M is
1519  equal to 0.
1520 
1521 Note:
1522  eigen vectors of Hermitian matrix are defined up to multiplication by
1523  a complex number L, such as |L|=1.
1524 
1525  -- ALGLIB --
1526  Copyright 07.01.2006, 24.03.2007 by Bochkanov Sergey.
1527 *************************************************************************/
1528 bool hmatrixevdr(const complex_2d_array &a, const ae_int_t n, const ae_int_t zneeded, const bool isupper, const double b1, const double b2, ae_int_t &m, real_1d_array &w, complex_2d_array &z);
1529 
1530 
1531 /*************************************************************************
1532 Subroutine for finding the eigenvalues and eigenvectors of a Hermitian
1533 matrix with given indexes by using bisection and inverse iteration methods
1534 
1535 Input parameters:
1536  A - Hermitian matrix which is given by its upper or lower
1537  triangular part.
1538  Array whose indexes range within [0..N-1, 0..N-1].
1539  N - size of matrix A.
1540  ZNeeded - flag controlling whether the eigenvectors are needed or
1541  not. If ZNeeded is equal to:
1542  * 0, the eigenvectors are not returned;
1543  * 1, the eigenvectors are returned.
1544  IsUpperA - storage format of matrix A.
1545  I1, I2 - index interval for searching (from I1 to I2).
1546  0 <= I1 <= I2 <= N-1.
1547 
1548 Output parameters:
1549  W - array of the eigenvalues found.
1550  Array whose index ranges within [0..I2-I1].
1551  Z - if ZNeeded is equal to:
1552  * 0, Z hasn’t changed;
1553  * 1, Z contains eigenvectors.
1554  Array whose indexes range within [0..N-1, 0..I2-I1].
1555  In that case, the eigenvectors are stored in the matrix
1556  columns.
1557 
1558 Result:
1559  True, if successful. W contains the eigenvalues, Z contains the
1560  eigenvectors (if needed).
1561 
1562  False, if the bisection method subroutine wasn't able to find the
1563  eigenvalues in the given interval or if the inverse iteration
1564  subroutine wasn't able to find all the corresponding eigenvectors.
1565  In that case, the eigenvalues and eigenvectors are not returned.
1566 
1567 Note:
1568  eigen vectors of Hermitian matrix are defined up to multiplication by
1569  a complex number L, such as |L|=1.
1570 
1571  -- ALGLIB --
1572  Copyright 07.01.2006, 24.03.2007 by Bochkanov Sergey.
1573 *************************************************************************/
1574 bool hmatrixevdi(const complex_2d_array &a, const ae_int_t n, const ae_int_t zneeded, const bool isupper, const ae_int_t i1, const ae_int_t i2, real_1d_array &w, complex_2d_array &z);
1575 
1576 
1577 /*************************************************************************
1578 Finding the eigenvalues and eigenvectors of a tridiagonal symmetric matrix
1579 
1580 The algorithm finds the eigen pairs of a tridiagonal symmetric matrix by
1581 using an QL/QR algorithm with implicit shifts.
1582 
1583 Input parameters:
1584  D - the main diagonal of a tridiagonal matrix.
1585  Array whose index ranges within [0..N-1].
1586  E - the secondary diagonal of a tridiagonal matrix.
1587  Array whose index ranges within [0..N-2].
1588  N - size of matrix A.
1589  ZNeeded - flag controlling whether the eigenvectors are needed or not.
1590  If ZNeeded is equal to:
1591  * 0, the eigenvectors are not needed;
1592  * 1, the eigenvectors of a tridiagonal matrix
1593  are multiplied by the square matrix Z. It is used if the
1594  tridiagonal matrix is obtained by the similarity
1595  transformation of a symmetric matrix;
1596  * 2, the eigenvectors of a tridiagonal matrix replace the
1597  square matrix Z;
1598  * 3, matrix Z contains the first row of the eigenvectors
1599  matrix.
1600  Z - if ZNeeded=1, Z contains the square matrix by which the
1601  eigenvectors are multiplied.
1602  Array whose indexes range within [0..N-1, 0..N-1].
1603 
1604 Output parameters:
1605  D - eigenvalues in ascending order.
1606  Array whose index ranges within [0..N-1].
1607  Z - if ZNeeded is equal to:
1608  * 0, Z hasn’t changed;
1609  * 1, Z contains the product of a given matrix (from the left)
1610  and the eigenvectors matrix (from the right);
1611  * 2, Z contains the eigenvectors.
1612  * 3, Z contains the first row of the eigenvectors matrix.
1613  If ZNeeded<3, Z is the array whose indexes range within [0..N-1, 0..N-1].
1614  In that case, the eigenvectors are stored in the matrix columns.
1615  If ZNeeded=3, Z is the array whose indexes range within [0..0, 0..N-1].
1616 
1617 Result:
1618  True, if the algorithm has converged.
1619  False, if the algorithm hasn't converged.
1620 
1621  -- LAPACK routine (version 3.0) --
1622  Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
1623  Courant Institute, Argonne National Lab, and Rice University
1624  September 30, 1994
1625 *************************************************************************/
1626 bool smatrixtdevd(real_1d_array &d, const real_1d_array &e, const ae_int_t n, const ae_int_t zneeded, real_2d_array &z);
1627 
1628 
1629 /*************************************************************************
1630 Subroutine for finding the tridiagonal matrix eigenvalues/vectors in a
1631 given half-interval (A, B] by using bisection and inverse iteration.
1632 
1633 Input parameters:
1634  D - the main diagonal of a tridiagonal matrix.
1635  Array whose index ranges within [0..N-1].
1636  E - the secondary diagonal of a tridiagonal matrix.
1637  Array whose index ranges within [0..N-2].
1638  N - size of matrix, N>=0.
1639  ZNeeded - flag controlling whether the eigenvectors are needed or not.
1640  If ZNeeded is equal to:
1641  * 0, the eigenvectors are not needed;
1642  * 1, the eigenvectors of a tridiagonal matrix are multiplied
1643  by the square matrix Z. It is used if the tridiagonal
1644  matrix is obtained by the similarity transformation
1645  of a symmetric matrix.
1646  * 2, the eigenvectors of a tridiagonal matrix replace matrix Z.
1647  A, B - half-interval (A, B] to search eigenvalues in.
1648  Z - if ZNeeded is equal to:
1649  * 0, Z isn't used and remains unchanged;
1650  * 1, Z contains the square matrix (array whose indexes range
1651  within [0..N-1, 0..N-1]) which reduces the given symmetric
1652  matrix to tridiagonal form;
1653  * 2, Z isn't used (but changed on the exit).
1654 
1655 Output parameters:
1656  D - array of the eigenvalues found.
1657  Array whose index ranges within [0..M-1].
1658  M - number of eigenvalues found in the given half-interval (M>=0).
1659  Z - if ZNeeded is equal to:
1660  * 0, doesn't contain any information;
1661  * 1, contains the product of a given NxN matrix Z (from the
1662  left) and NxM matrix of the eigenvectors found (from the
1663  right). Array whose indexes range within [0..N-1, 0..M-1].
1664  * 2, contains the matrix of the eigenvectors found.
1665  Array whose indexes range within [0..N-1, 0..M-1].
1666 
1667 Result:
1668 
1669  True, if successful. In that case, M contains the number of eigenvalues
1670  in the given half-interval (could be equal to 0), D contains the eigenvalues,
1671  Z contains the eigenvectors (if needed).
1672  It should be noted that the subroutine changes the size of arrays D and Z.
1673 
1674  False, if the bisection method subroutine wasn't able to find the
1675  eigenvalues in the given interval or if the inverse iteration subroutine
1676  wasn't able to find all the corresponding eigenvectors. In that case,
1677  the eigenvalues and eigenvectors are not returned, M is equal to 0.
1678 
1679  -- ALGLIB --
1680  Copyright 31.03.2008 by Bochkanov Sergey
1681 *************************************************************************/
1682 bool smatrixtdevdr(real_1d_array &d, const real_1d_array &e, const ae_int_t n, const ae_int_t zneeded, const double a, const double b, ae_int_t &m, real_2d_array &z);
1683 
1684 
1685 /*************************************************************************
1686 Subroutine for finding tridiagonal matrix eigenvalues/vectors with given
1687 indexes (in ascending order) by using the bisection and inverse iteraion.
1688 
1689 Input parameters:
1690  D - the main diagonal of a tridiagonal matrix.
1691  Array whose index ranges within [0..N-1].
1692  E - the secondary diagonal of a tridiagonal matrix.
1693  Array whose index ranges within [0..N-2].
1694  N - size of matrix. N>=0.
1695  ZNeeded - flag controlling whether the eigenvectors are needed or not.
1696  If ZNeeded is equal to:
1697  * 0, the eigenvectors are not needed;
1698  * 1, the eigenvectors of a tridiagonal matrix are multiplied
1699  by the square matrix Z. It is used if the
1700  tridiagonal matrix is obtained by the similarity transformation
1701  of a symmetric matrix.
1702  * 2, the eigenvectors of a tridiagonal matrix replace
1703  matrix Z.
1704  I1, I2 - index interval for searching (from I1 to I2).
1705  0 <= I1 <= I2 <= N-1.
1706  Z - if ZNeeded is equal to:
1707  * 0, Z isn't used and remains unchanged;
1708  * 1, Z contains the square matrix (array whose indexes range within [0..N-1, 0..N-1])
1709  which reduces the given symmetric matrix to tridiagonal form;
1710  * 2, Z isn't used (but changed on the exit).
1711 
1712 Output parameters:
1713  D - array of the eigenvalues found.
1714  Array whose index ranges within [0..I2-I1].
1715  Z - if ZNeeded is equal to:
1716  * 0, doesn't contain any information;
1717  * 1, contains the product of a given NxN matrix Z (from the left) and
1718  Nx(I2-I1) matrix of the eigenvectors found (from the right).
1719  Array whose indexes range within [0..N-1, 0..I2-I1].
1720  * 2, contains the matrix of the eigenvalues found.
1721  Array whose indexes range within [0..N-1, 0..I2-I1].
1722 
1723 
1724 Result:
1725 
1726  True, if successful. In that case, D contains the eigenvalues,
1727  Z contains the eigenvectors (if needed).
1728  It should be noted that the subroutine changes the size of arrays D and Z.
1729 
1730  False, if the bisection method subroutine wasn't able to find the eigenvalues
1731  in the given interval or if the inverse iteration subroutine wasn't able
1732  to find all the corresponding eigenvectors. In that case, the eigenvalues
1733  and eigenvectors are not returned.
1734 
1735  -- ALGLIB --
1736  Copyright 25.12.2005 by Bochkanov Sergey
1737 *************************************************************************/
1738 bool smatrixtdevdi(real_1d_array &d, const real_1d_array &e, const ae_int_t n, const ae_int_t zneeded, const ae_int_t i1, const ae_int_t i2, real_2d_array &z);
1739 
1740 
1741 /*************************************************************************
1742 Finding eigenvalues and eigenvectors of a general matrix
1743 
1744 The algorithm finds eigenvalues and eigenvectors of a general matrix by
1745 using the QR algorithm with multiple shifts. The algorithm can find
1746 eigenvalues and both left and right eigenvectors.
1747 
1748 The right eigenvector is a vector x such that A*x = w*x, and the left
1749 eigenvector is a vector y such that y'*A = w*y' (here y' implies a complex
1750 conjugate transposition of vector y).
1751 
1752 Input parameters:
1753  A - matrix. Array whose indexes range within [0..N-1, 0..N-1].
1754  N - size of matrix A.
1755  VNeeded - flag controlling whether eigenvectors are needed or not.
1756  If VNeeded is equal to:
1757  * 0, eigenvectors are not returned;
1758  * 1, right eigenvectors are returned;
1759  * 2, left eigenvectors are returned;
1760  * 3, both left and right eigenvectors are returned.
1761 
1762 Output parameters:
1763  WR - real parts of eigenvalues.
1764  Array whose index ranges within [0..N-1].
1765  WR - imaginary parts of eigenvalues.
1766  Array whose index ranges within [0..N-1].
1767  VL, VR - arrays of left and right eigenvectors (if they are needed).
1768  If WI[i]=0, the respective eigenvalue is a real number,
1769  and it corresponds to the column number I of matrices VL/VR.
1770  If WI[i]>0, we have a pair of complex conjugate numbers with
1771  positive and negative imaginary parts:
1772  the first eigenvalue WR[i] + sqrt(-1)*WI[i];
1773  the second eigenvalue WR[i+1] + sqrt(-1)*WI[i+1];
1774  WI[i]>0
1775  WI[i+1] = -WI[i] < 0
1776  In that case, the eigenvector corresponding to the first
1777  eigenvalue is located in i and i+1 columns of matrices
1778  VL/VR (the column number i contains the real part, and the
1779  column number i+1 contains the imaginary part), and the vector
1780  corresponding to the second eigenvalue is a complex conjugate to
1781  the first vector.
1782  Arrays whose indexes range within [0..N-1, 0..N-1].
1783 
1784 Result:
1785  True, if the algorithm has converged.
1786  False, if the algorithm has not converged.
1787 
1788 Note 1:
1789  Some users may ask the following question: what if WI[N-1]>0?
1790  WI[N] must contain an eigenvalue which is complex conjugate to the
1791  N-th eigenvalue, but the array has only size N?
1792  The answer is as follows: such a situation cannot occur because the
1793  algorithm finds a pairs of eigenvalues, therefore, if WI[i]>0, I is
1794  strictly less than N-1.
1795 
1796 Note 2:
1797  The algorithm performance depends on the value of the internal parameter
1798  NS of the InternalSchurDecomposition subroutine which defines the number
1799  of shifts in the QR algorithm (similarly to the block width in block-matrix
1800  algorithms of linear algebra). If you require maximum performance
1801  on your machine, it is recommended to adjust this parameter manually.
1802 
1803 
1804 See also the InternalTREVC subroutine.
1805 
1806 The algorithm is based on the LAPACK 3.0 library.
1807 *************************************************************************/
1808 bool rmatrixevd(const real_2d_array &a, const ae_int_t n, const ae_int_t vneeded, real_1d_array &wr, real_1d_array &wi, real_2d_array &vl, real_2d_array &vr);
1809 
1810 /*************************************************************************
1811 Generation of a random uniformly distributed (Haar) orthogonal matrix
1812 
1813 INPUT PARAMETERS:
1814  N - matrix size, N>=1
1815 
1816 OUTPUT PARAMETERS:
1817  A - orthogonal NxN matrix, array[0..N-1,0..N-1]
1818 
1819  -- ALGLIB routine --
1820  04.12.2009
1821  Bochkanov Sergey
1822 *************************************************************************/
1823 void rmatrixrndorthogonal(const ae_int_t n, real_2d_array &a);
1824 
1825 
1826 /*************************************************************************
1827 Generation of random NxN matrix with given condition number and norm2(A)=1
1828 
1829 INPUT PARAMETERS:
1830  N - matrix size
1831  C - condition number (in 2-norm)
1832 
1833 OUTPUT PARAMETERS:
1834  A - random matrix with norm2(A)=1 and cond(A)=C
1835 
1836  -- ALGLIB routine --
1837  04.12.2009
1838  Bochkanov Sergey
1839 *************************************************************************/
1840 void rmatrixrndcond(const ae_int_t n, const double c, real_2d_array &a);
1841 
1842 
1843 /*************************************************************************
1844 Generation of a random Haar distributed orthogonal complex matrix
1845 
1846 INPUT PARAMETERS:
1847  N - matrix size, N>=1
1848 
1849 OUTPUT PARAMETERS:
1850  A - orthogonal NxN matrix, array[0..N-1,0..N-1]
1851 
1852  -- ALGLIB routine --
1853  04.12.2009
1854  Bochkanov Sergey
1855 *************************************************************************/
1857 
1858 
1859 /*************************************************************************
1860 Generation of random NxN complex matrix with given condition number C and
1861 norm2(A)=1
1862 
1863 INPUT PARAMETERS:
1864  N - matrix size
1865  C - condition number (in 2-norm)
1866 
1867 OUTPUT PARAMETERS:
1868  A - random matrix with norm2(A)=1 and cond(A)=C
1869 
1870  -- ALGLIB routine --
1871  04.12.2009
1872  Bochkanov Sergey
1873 *************************************************************************/
1874 void cmatrixrndcond(const ae_int_t n, const double c, complex_2d_array &a);
1875 
1876 
1877 /*************************************************************************
1878 Generation of random NxN symmetric matrix with given condition number and
1879 norm2(A)=1
1880 
1881 INPUT PARAMETERS:
1882  N - matrix size
1883  C - condition number (in 2-norm)
1884 
1885 OUTPUT PARAMETERS:
1886  A - random matrix with norm2(A)=1 and cond(A)=C
1887 
1888  -- ALGLIB routine --
1889  04.12.2009
1890  Bochkanov Sergey
1891 *************************************************************************/
1892 void smatrixrndcond(const ae_int_t n, const double c, real_2d_array &a);
1893 
1894 
1895 /*************************************************************************
1896 Generation of random NxN symmetric positive definite matrix with given
1897 condition number and norm2(A)=1
1898 
1899 INPUT PARAMETERS:
1900  N - matrix size
1901  C - condition number (in 2-norm)
1902 
1903 OUTPUT PARAMETERS:
1904  A - random SPD matrix with norm2(A)=1 and cond(A)=C
1905 
1906  -- ALGLIB routine --
1907  04.12.2009
1908  Bochkanov Sergey
1909 *************************************************************************/
1910 void spdmatrixrndcond(const ae_int_t n, const double c, real_2d_array &a);
1911 
1912 
1913 /*************************************************************************
1914 Generation of random NxN Hermitian matrix with given condition number and
1915 norm2(A)=1
1916 
1917 INPUT PARAMETERS:
1918  N - matrix size
1919  C - condition number (in 2-norm)
1920 
1921 OUTPUT PARAMETERS:
1922  A - random matrix with norm2(A)=1 and cond(A)=C
1923 
1924  -- ALGLIB routine --
1925  04.12.2009
1926  Bochkanov Sergey
1927 *************************************************************************/
1928 void hmatrixrndcond(const ae_int_t n, const double c, complex_2d_array &a);
1929 
1930 
1931 /*************************************************************************
1932 Generation of random NxN Hermitian positive definite matrix with given
1933 condition number and norm2(A)=1
1934 
1935 INPUT PARAMETERS:
1936  N - matrix size
1937  C - condition number (in 2-norm)
1938 
1939 OUTPUT PARAMETERS:
1940  A - random HPD matrix with norm2(A)=1 and cond(A)=C
1941 
1942  -- ALGLIB routine --
1943  04.12.2009
1944  Bochkanov Sergey
1945 *************************************************************************/
1946 void hpdmatrixrndcond(const ae_int_t n, const double c, complex_2d_array &a);
1947 
1948 
1949 /*************************************************************************
1950 Multiplication of MxN matrix by NxN random Haar distributed orthogonal matrix
1951 
1952 INPUT PARAMETERS:
1953  A - matrix, array[0..M-1, 0..N-1]
1954  M, N- matrix size
1955 
1956 OUTPUT PARAMETERS:
1957  A - A*Q, where Q is random NxN orthogonal matrix
1958 
1959  -- ALGLIB routine --
1960  04.12.2009
1961  Bochkanov Sergey
1962 *************************************************************************/
1964 
1965 
1966 /*************************************************************************
1967 Multiplication of MxN matrix by MxM random Haar distributed orthogonal matrix
1968 
1969 INPUT PARAMETERS:
1970  A - matrix, array[0..M-1, 0..N-1]
1971  M, N- matrix size
1972 
1973 OUTPUT PARAMETERS:
1974  A - Q*A, where Q is random MxM orthogonal matrix
1975 
1976  -- ALGLIB routine --
1977  04.12.2009
1978  Bochkanov Sergey
1979 *************************************************************************/
1981 
1982 
1983 /*************************************************************************
1984 Multiplication of MxN complex matrix by NxN random Haar distributed
1985 complex orthogonal matrix
1986 
1987 INPUT PARAMETERS:
1988  A - matrix, array[0..M-1, 0..N-1]
1989  M, N- matrix size
1990 
1991 OUTPUT PARAMETERS:
1992  A - A*Q, where Q is random NxN orthogonal matrix
1993 
1994  -- ALGLIB routine --
1995  04.12.2009
1996  Bochkanov Sergey
1997 *************************************************************************/
1999 
2000 
2001 /*************************************************************************
2002 Multiplication of MxN complex matrix by MxM random Haar distributed
2003 complex orthogonal matrix
2004 
2005 INPUT PARAMETERS:
2006  A - matrix, array[0..M-1, 0..N-1]
2007  M, N- matrix size
2008 
2009 OUTPUT PARAMETERS:
2010  A - Q*A, where Q is random MxM orthogonal matrix
2011 
2012  -- ALGLIB routine --
2013  04.12.2009
2014  Bochkanov Sergey
2015 *************************************************************************/
2017 
2018 
2019 /*************************************************************************
2020 Symmetric multiplication of NxN matrix by random Haar distributed
2021 orthogonal matrix
2022 
2023 INPUT PARAMETERS:
2024  A - matrix, array[0..N-1, 0..N-1]
2025  N - matrix size
2026 
2027 OUTPUT PARAMETERS:
2028  A - Q'*A*Q, where Q is random NxN orthogonal matrix
2029 
2030  -- ALGLIB routine --
2031  04.12.2009
2032  Bochkanov Sergey
2033 *************************************************************************/
2034 void smatrixrndmultiply(real_2d_array &a, const ae_int_t n);
2035 
2036 
2037 /*************************************************************************
2038 Hermitian multiplication of NxN matrix by random Haar distributed
2039 complex orthogonal matrix
2040 
2041 INPUT PARAMETERS:
2042  A - matrix, array[0..N-1, 0..N-1]
2043  N - matrix size
2044 
2045 OUTPUT PARAMETERS:
2046  A - Q^H*A*Q, where Q is random NxN orthogonal matrix
2047 
2048  -- ALGLIB routine --
2049  04.12.2009
2050  Bochkanov Sergey
2051 *************************************************************************/
2052 void hmatrixrndmultiply(complex_2d_array &a, const ae_int_t n);
2053 
2054 /*************************************************************************
2055 LU decomposition of a general real matrix with row pivoting
2056 
2057 A is represented as A = P*L*U, where:
2058 * L is lower unitriangular matrix
2059 * U is upper triangular matrix
2060 * P = P0*P1*...*PK, K=min(M,N)-1,
2061  Pi - permutation matrix for I and Pivots[I]
2062 
2063 This is cache-oblivous implementation of LU decomposition.
2064 It is optimized for square matrices. As for rectangular matrices:
2065 * best case - M>>N
2066 * worst case - N>>M, small M, large N, matrix does not fit in CPU cache
2067 
2068 INPUT PARAMETERS:
2069  A - array[0..M-1, 0..N-1].
2070  M - number of rows in matrix A.
2071  N - number of columns in matrix A.
2072 
2073 
2074 OUTPUT PARAMETERS:
2075  A - matrices L and U in compact form:
2076  * L is stored under main diagonal
2077  * U is stored on and above main diagonal
2078  Pivots - permutation matrix in compact form.
2079  array[0..Min(M-1,N-1)].
2080 
2081  -- ALGLIB routine --
2082  10.01.2010
2083  Bochkanov Sergey
2084 *************************************************************************/
2085 void rmatrixlu(real_2d_array &a, const ae_int_t m, const ae_int_t n, integer_1d_array &pivots);
2086 
2087 
2088 /*************************************************************************
2089 LU decomposition of a general complex matrix with row pivoting
2090 
2091 A is represented as A = P*L*U, where:
2092 * L is lower unitriangular matrix
2093 * U is upper triangular matrix
2094 * P = P0*P1*...*PK, K=min(M,N)-1,
2095  Pi - permutation matrix for I and Pivots[I]
2096 
2097 This is cache-oblivous implementation of LU decomposition. It is optimized
2098 for square matrices. As for rectangular matrices:
2099 * best case - M>>N
2100 * worst case - N>>M, small M, large N, matrix does not fit in CPU cache
2101 
2102 INPUT PARAMETERS:
2103  A - array[0..M-1, 0..N-1].
2104  M - number of rows in matrix A.
2105  N - number of columns in matrix A.
2106 
2107 
2108 OUTPUT PARAMETERS:
2109  A - matrices L and U in compact form:
2110  * L is stored under main diagonal
2111  * U is stored on and above main diagonal
2112  Pivots - permutation matrix in compact form.
2113  array[0..Min(M-1,N-1)].
2114 
2115  -- ALGLIB routine --
2116  10.01.2010
2117  Bochkanov Sergey
2118 *************************************************************************/
2119 void cmatrixlu(complex_2d_array &a, const ae_int_t m, const ae_int_t n, integer_1d_array &pivots);
2120 
2121 
2122 /*************************************************************************
2123 Cache-oblivious Cholesky decomposition
2124 
2125 The algorithm computes Cholesky decomposition of a Hermitian positive-
2126 definite matrix. The result of an algorithm is a representation of A as
2127 A=U'*U or A=L*L' (here X' detones conj(X^T)).
2128 
2129 INPUT PARAMETERS:
2130  A - upper or lower triangle of a factorized matrix.
2131  array with elements [0..N-1, 0..N-1].
2132  N - size of matrix A.
2133  IsUpper - if IsUpper=True, then A contains an upper triangle of
2134  a symmetric matrix, otherwise A contains a lower one.
2135 
2136 OUTPUT PARAMETERS:
2137  A - the result of factorization. If IsUpper=True, then
2138  the upper triangle contains matrix U, so that A = U'*U,
2139  and the elements below the main diagonal are not modified.
2140  Similarly, if IsUpper = False.
2141 
2142 RESULT:
2143  If the matrix is positive-definite, the function returns True.
2144  Otherwise, the function returns False. Contents of A is not determined
2145  in such case.
2146 
2147  -- ALGLIB routine --
2148  15.12.2009
2149  Bochkanov Sergey
2150 *************************************************************************/
2151 bool hpdmatrixcholesky(complex_2d_array &a, const ae_int_t n, const bool isupper);
2152 
2153 
2154 /*************************************************************************
2155 Cache-oblivious Cholesky decomposition
2156 
2157 The algorithm computes Cholesky decomposition of a symmetric positive-
2158 definite matrix. The result of an algorithm is a representation of A as
2159 A=U^T*U or A=L*L^T
2160 
2161 INPUT PARAMETERS:
2162  A - upper or lower triangle of a factorized matrix.
2163  array with elements [0..N-1, 0..N-1].
2164  N - size of matrix A.
2165  IsUpper - if IsUpper=True, then A contains an upper triangle of
2166  a symmetric matrix, otherwise A contains a lower one.
2167 
2168 OUTPUT PARAMETERS:
2169  A - the result of factorization. If IsUpper=True, then
2170  the upper triangle contains matrix U, so that A = U^T*U,
2171  and the elements below the main diagonal are not modified.
2172  Similarly, if IsUpper = False.
2173 
2174 RESULT:
2175  If the matrix is positive-definite, the function returns True.
2176  Otherwise, the function returns False. Contents of A is not determined
2177  in such case.
2178 
2179  -- ALGLIB routine --
2180  15.12.2009
2181  Bochkanov Sergey
2182 *************************************************************************/
2183 bool spdmatrixcholesky(real_2d_array &a, const ae_int_t n, const bool isupper);
2184 
2185 /*************************************************************************
2186 Estimate of a matrix condition number (1-norm)
2187 
2188 The algorithm calculates a lower bound of the condition number. In this case,
2189 the algorithm does not return a lower bound of the condition number, but an
2190 inverse number (to avoid an overflow in case of a singular matrix).
2191 
2192 Input parameters:
2193  A - matrix. Array whose indexes range within [0..N-1, 0..N-1].
2194  N - size of matrix A.
2195 
2196 Result: 1/LowerBound(cond(A))
2197 
2198 NOTE:
2199  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2200  0.0 is returned in such cases.
2201 *************************************************************************/
2202 double rmatrixrcond1(const real_2d_array &a, const ae_int_t n);
2203 
2204 
2205 /*************************************************************************
2206 Estimate of a matrix condition number (infinity-norm).
2207 
2208 The algorithm calculates a lower bound of the condition number. In this case,
2209 the algorithm does not return a lower bound of the condition number, but an
2210 inverse number (to avoid an overflow in case of a singular matrix).
2211 
2212 Input parameters:
2213  A - matrix. Array whose indexes range within [0..N-1, 0..N-1].
2214  N - size of matrix A.
2215 
2216 Result: 1/LowerBound(cond(A))
2217 
2218 NOTE:
2219  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2220  0.0 is returned in such cases.
2221 *************************************************************************/
2222 double rmatrixrcondinf(const real_2d_array &a, const ae_int_t n);
2223 
2224 
2225 /*************************************************************************
2226 Condition number estimate of a symmetric positive definite matrix.
2227 
2228 The algorithm calculates a lower bound of the condition number. In this case,
2229 the algorithm does not return a lower bound of the condition number, but an
2230 inverse number (to avoid an overflow in case of a singular matrix).
2231 
2232 It should be noted that 1-norm and inf-norm of condition numbers of symmetric
2233 matrices are equal, so the algorithm doesn't take into account the
2234 differences between these types of norms.
2235 
2236 Input parameters:
2237  A - symmetric positive definite matrix which is given by its
2238  upper or lower triangle depending on the value of
2239  IsUpper. Array with elements [0..N-1, 0..N-1].
2240  N - size of matrix A.
2241  IsUpper - storage format.
2242 
2243 Result:
2244  1/LowerBound(cond(A)), if matrix A is positive definite,
2245  -1, if matrix A is not positive definite, and its condition number
2246  could not be found by this algorithm.
2247 
2248 NOTE:
2249  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2250  0.0 is returned in such cases.
2251 *************************************************************************/
2252 double spdmatrixrcond(const real_2d_array &a, const ae_int_t n, const bool isupper);
2253 
2254 
2255 /*************************************************************************
2256 Triangular matrix: estimate of a condition number (1-norm)
2257 
2258 The algorithm calculates a lower bound of the condition number. In this case,
2259 the algorithm does not return a lower bound of the condition number, but an
2260 inverse number (to avoid an overflow in case of a singular matrix).
2261 
2262 Input parameters:
2263  A - matrix. Array[0..N-1, 0..N-1].
2264  N - size of A.
2265  IsUpper - True, if the matrix is upper triangular.
2266  IsUnit - True, if the matrix has a unit diagonal.
2267 
2268 Result: 1/LowerBound(cond(A))
2269 
2270 NOTE:
2271  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2272  0.0 is returned in such cases.
2273 *************************************************************************/
2274 double rmatrixtrrcond1(const real_2d_array &a, const ae_int_t n, const bool isupper, const bool isunit);
2275 
2276 
2277 /*************************************************************************
2278 Triangular matrix: estimate of a matrix condition number (infinity-norm).
2279 
2280 The algorithm calculates a lower bound of the condition number. In this case,
2281 the algorithm does not return a lower bound of the condition number, but an
2282 inverse number (to avoid an overflow in case of a singular matrix).
2283 
2284 Input parameters:
2285  A - matrix. Array whose indexes range within [0..N-1, 0..N-1].
2286  N - size of matrix A.
2287  IsUpper - True, if the matrix is upper triangular.
2288  IsUnit - True, if the matrix has a unit diagonal.
2289 
2290 Result: 1/LowerBound(cond(A))
2291 
2292 NOTE:
2293  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2294  0.0 is returned in such cases.
2295 *************************************************************************/
2296 double rmatrixtrrcondinf(const real_2d_array &a, const ae_int_t n, const bool isupper, const bool isunit);
2297 
2298 
2299 /*************************************************************************
2300 Condition number estimate of a Hermitian positive definite matrix.
2301 
2302 The algorithm calculates a lower bound of the condition number. In this case,
2303 the algorithm does not return a lower bound of the condition number, but an
2304 inverse number (to avoid an overflow in case of a singular matrix).
2305 
2306 It should be noted that 1-norm and inf-norm of condition numbers of symmetric
2307 matrices are equal, so the algorithm doesn't take into account the
2308 differences between these types of norms.
2309 
2310 Input parameters:
2311  A - Hermitian positive definite matrix which is given by its
2312  upper or lower triangle depending on the value of
2313  IsUpper. Array with elements [0..N-1, 0..N-1].
2314  N - size of matrix A.
2315  IsUpper - storage format.
2316 
2317 Result:
2318  1/LowerBound(cond(A)), if matrix A is positive definite,
2319  -1, if matrix A is not positive definite, and its condition number
2320  could not be found by this algorithm.
2321 
2322 NOTE:
2323  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2324  0.0 is returned in such cases.
2325 *************************************************************************/
2326 double hpdmatrixrcond(const complex_2d_array &a, const ae_int_t n, const bool isupper);
2327 
2328 
2329 /*************************************************************************
2330 Estimate of a matrix condition number (1-norm)
2331 
2332 The algorithm calculates a lower bound of the condition number. In this case,
2333 the algorithm does not return a lower bound of the condition number, but an
2334 inverse number (to avoid an overflow in case of a singular matrix).
2335 
2336 Input parameters:
2337  A - matrix. Array whose indexes range within [0..N-1, 0..N-1].
2338  N - size of matrix A.
2339 
2340 Result: 1/LowerBound(cond(A))
2341 
2342 NOTE:
2343  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2344  0.0 is returned in such cases.
2345 *************************************************************************/
2346 double cmatrixrcond1(const complex_2d_array &a, const ae_int_t n);
2347 
2348 
2349 /*************************************************************************
2350 Estimate of a matrix condition number (infinity-norm).
2351 
2352 The algorithm calculates a lower bound of the condition number. In this case,
2353 the algorithm does not return a lower bound of the condition number, but an
2354 inverse number (to avoid an overflow in case of a singular matrix).
2355 
2356 Input parameters:
2357  A - matrix. Array whose indexes range within [0..N-1, 0..N-1].
2358  N - size of matrix A.
2359 
2360 Result: 1/LowerBound(cond(A))
2361 
2362 NOTE:
2363  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2364  0.0 is returned in such cases.
2365 *************************************************************************/
2366 double cmatrixrcondinf(const complex_2d_array &a, const ae_int_t n);
2367 
2368 
2369 /*************************************************************************
2370 Estimate of the condition number of a matrix given by its LU decomposition (1-norm)
2371 
2372 The algorithm calculates a lower bound of the condition number. In this case,
2373 the algorithm does not return a lower bound of the condition number, but an
2374 inverse number (to avoid an overflow in case of a singular matrix).
2375 
2376 Input parameters:
2377  LUA - LU decomposition of a matrix in compact form. Output of
2378  the RMatrixLU subroutine.
2379  N - size of matrix A.
2380 
2381 Result: 1/LowerBound(cond(A))
2382 
2383 NOTE:
2384  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2385  0.0 is returned in such cases.
2386 *************************************************************************/
2387 double rmatrixlurcond1(const real_2d_array &lua, const ae_int_t n);
2388 
2389 
2390 /*************************************************************************
2391 Estimate of the condition number of a matrix given by its LU decomposition
2392 (infinity norm).
2393 
2394 The algorithm calculates a lower bound of the condition number. In this case,
2395 the algorithm does not return a lower bound of the condition number, but an
2396 inverse number (to avoid an overflow in case of a singular matrix).
2397 
2398 Input parameters:
2399  LUA - LU decomposition of a matrix in compact form. Output of
2400  the RMatrixLU subroutine.
2401  N - size of matrix A.
2402 
2403 Result: 1/LowerBound(cond(A))
2404 
2405 NOTE:
2406  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2407  0.0 is returned in such cases.
2408 *************************************************************************/
2409 double rmatrixlurcondinf(const real_2d_array &lua, const ae_int_t n);
2410 
2411 
2412 /*************************************************************************
2413 Condition number estimate of a symmetric positive definite matrix given by
2414 Cholesky decomposition.
2415 
2416 The algorithm calculates a lower bound of the condition number. In this
2417 case, the algorithm does not return a lower bound of the condition number,
2418 but an inverse number (to avoid an overflow in case of a singular matrix).
2419 
2420 It should be noted that 1-norm and inf-norm condition numbers of symmetric
2421 matrices are equal, so the algorithm doesn't take into account the
2422 differences between these types of norms.
2423 
2424 Input parameters:
2425  CD - Cholesky decomposition of matrix A,
2426  output of SMatrixCholesky subroutine.
2427  N - size of matrix A.
2428 
2429 Result: 1/LowerBound(cond(A))
2430 
2431 NOTE:
2432  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2433  0.0 is returned in such cases.
2434 *************************************************************************/
2435 double spdmatrixcholeskyrcond(const real_2d_array &a, const ae_int_t n, const bool isupper);
2436 
2437 
2438 /*************************************************************************
2439 Condition number estimate of a Hermitian positive definite matrix given by
2440 Cholesky decomposition.
2441 
2442 The algorithm calculates a lower bound of the condition number. In this
2443 case, the algorithm does not return a lower bound of the condition number,
2444 but an inverse number (to avoid an overflow in case of a singular matrix).
2445 
2446 It should be noted that 1-norm and inf-norm condition numbers of symmetric
2447 matrices are equal, so the algorithm doesn't take into account the
2448 differences between these types of norms.
2449 
2450 Input parameters:
2451  CD - Cholesky decomposition of matrix A,
2452  output of SMatrixCholesky subroutine.
2453  N - size of matrix A.
2454 
2455 Result: 1/LowerBound(cond(A))
2456 
2457 NOTE:
2458  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2459  0.0 is returned in such cases.
2460 *************************************************************************/
2461 double hpdmatrixcholeskyrcond(const complex_2d_array &a, const ae_int_t n, const bool isupper);
2462 
2463 
2464 /*************************************************************************
2465 Estimate of the condition number of a matrix given by its LU decomposition (1-norm)
2466 
2467 The algorithm calculates a lower bound of the condition number. In this case,
2468 the algorithm does not return a lower bound of the condition number, but an
2469 inverse number (to avoid an overflow in case of a singular matrix).
2470 
2471 Input parameters:
2472  LUA - LU decomposition of a matrix in compact form. Output of
2473  the CMatrixLU subroutine.
2474  N - size of matrix A.
2475 
2476 Result: 1/LowerBound(cond(A))
2477 
2478 NOTE:
2479  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2480  0.0 is returned in such cases.
2481 *************************************************************************/
2482 double cmatrixlurcond1(const complex_2d_array &lua, const ae_int_t n);
2483 
2484 
2485 /*************************************************************************
2486 Estimate of the condition number of a matrix given by its LU decomposition
2487 (infinity norm).
2488 
2489 The algorithm calculates a lower bound of the condition number. In this case,
2490 the algorithm does not return a lower bound of the condition number, but an
2491 inverse number (to avoid an overflow in case of a singular matrix).
2492 
2493 Input parameters:
2494  LUA - LU decomposition of a matrix in compact form. Output of
2495  the CMatrixLU subroutine.
2496  N - size of matrix A.
2497 
2498 Result: 1/LowerBound(cond(A))
2499 
2500 NOTE:
2501  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2502  0.0 is returned in such cases.
2503 *************************************************************************/
2504 double cmatrixlurcondinf(const complex_2d_array &lua, const ae_int_t n);
2505 
2506 
2507 /*************************************************************************
2508 Triangular matrix: estimate of a condition number (1-norm)
2509 
2510 The algorithm calculates a lower bound of the condition number. In this case,
2511 the algorithm does not return a lower bound of the condition number, but an
2512 inverse number (to avoid an overflow in case of a singular matrix).
2513 
2514 Input parameters:
2515  A - matrix. Array[0..N-1, 0..N-1].
2516  N - size of A.
2517  IsUpper - True, if the matrix is upper triangular.
2518  IsUnit - True, if the matrix has a unit diagonal.
2519 
2520 Result: 1/LowerBound(cond(A))
2521 
2522 NOTE:
2523  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2524  0.0 is returned in such cases.
2525 *************************************************************************/
2526 double cmatrixtrrcond1(const complex_2d_array &a, const ae_int_t n, const bool isupper, const bool isunit);
2527 
2528 
2529 /*************************************************************************
2530 Triangular matrix: estimate of a matrix condition number (infinity-norm).
2531 
2532 The algorithm calculates a lower bound of the condition number. In this case,
2533 the algorithm does not return a lower bound of the condition number, but an
2534 inverse number (to avoid an overflow in case of a singular matrix).
2535 
2536 Input parameters:
2537  A - matrix. Array whose indexes range within [0..N-1, 0..N-1].
2538  N - size of matrix A.
2539  IsUpper - True, if the matrix is upper triangular.
2540  IsUnit - True, if the matrix has a unit diagonal.
2541 
2542 Result: 1/LowerBound(cond(A))
2543 
2544 NOTE:
2545  if k(A) is very large, then matrix is assumed degenerate, k(A)=INF,
2546  0.0 is returned in such cases.
2547 *************************************************************************/
2548 double cmatrixtrrcondinf(const complex_2d_array &a, const ae_int_t n, const bool isupper, const bool isunit);
2549 
2550 /*************************************************************************
2551 Inversion of a matrix given by its LU decomposition.
2552 
2553 INPUT PARAMETERS:
2554  A - LU decomposition of the matrix
2555  (output of RMatrixLU subroutine).
2556  Pivots - table of permutations
2557  (the output of RMatrixLU subroutine).
2558  N - size of matrix A (optional) :
2559  * if given, only principal NxN submatrix is processed and
2560  overwritten. other elements are unchanged.
2561  * if not given, size is automatically determined from
2562  matrix size (A must be square matrix)
2563 
2564 OUTPUT PARAMETERS:
2565  Info - return code:
2566  * -3 A is singular, or VERY close to singular.
2567  it is filled by zeros in such cases.
2568  * 1 task is solved (but matrix A may be ill-conditioned,
2569  check R1/RInf parameters for condition numbers).
2570  Rep - solver report, see below for more info
2571  A - inverse of matrix A.
2572  Array whose indexes range within [0..N-1, 0..N-1].
2573 
2574 SOLVER REPORT
2575 
2576 Subroutine sets following fields of the Rep structure:
2577 * R1 reciprocal of condition number: 1/cond(A), 1-norm.
2578 * RInf reciprocal of condition number: 1/cond(A), inf-norm.
2579 
2580  -- ALGLIB routine --
2581  05.02.2010
2582  Bochkanov Sergey
2583 *************************************************************************/
2584 void rmatrixluinverse(real_2d_array &a, const integer_1d_array &pivots, const ae_int_t n, ae_int_t &info, matinvreport &rep);
2585 void rmatrixluinverse(real_2d_array &a, const integer_1d_array &pivots, ae_int_t &info, matinvreport &rep);
2586 
2587 
2588 /*************************************************************************
2589 Inversion of a general matrix.
2590 
2591 Input parameters:
2592  A - matrix.
2593  N - size of matrix A (optional) :
2594  * if given, only principal NxN submatrix is processed and
2595  overwritten. other elements are unchanged.
2596  * if not given, size is automatically determined from
2597  matrix size (A must be square matrix)
2598 
2599 Output parameters:
2600  Info - return code, same as in RMatrixLUInverse
2601  Rep - solver report, same as in RMatrixLUInverse
2602  A - inverse of matrix A, same as in RMatrixLUInverse
2603 
2604 Result:
2605  True, if the matrix is not singular.
2606  False, if the matrix is singular.
2607 
2608  -- ALGLIB --
2609  Copyright 2005-2010 by Bochkanov Sergey
2610 *************************************************************************/
2611 void rmatrixinverse(real_2d_array &a, const ae_int_t n, ae_int_t &info, matinvreport &rep);
2612 void rmatrixinverse(real_2d_array &a, ae_int_t &info, matinvreport &rep);
2613 
2614 
2615 /*************************************************************************
2616 Inversion of a matrix given by its LU decomposition.
2617 
2618 INPUT PARAMETERS:
2619  A - LU decomposition of the matrix
2620  (output of CMatrixLU subroutine).
2621  Pivots - table of permutations
2622  (the output of CMatrixLU subroutine).
2623  N - size of matrix A (optional) :
2624  * if given, only principal NxN submatrix is processed and
2625  overwritten. other elements are unchanged.
2626  * if not given, size is automatically determined from
2627  matrix size (A must be square matrix)
2628 
2629 OUTPUT PARAMETERS:
2630  Info - return code, same as in RMatrixLUInverse
2631  Rep - solver report, same as in RMatrixLUInverse
2632  A - inverse of matrix A, same as in RMatrixLUInverse
2633 
2634  -- ALGLIB routine --
2635  05.02.2010
2636  Bochkanov Sergey
2637 *************************************************************************/
2638 void cmatrixluinverse(complex_2d_array &a, const integer_1d_array &pivots, const ae_int_t n, ae_int_t &info, matinvreport &rep);
2639 void cmatrixluinverse(complex_2d_array &a, const integer_1d_array &pivots, ae_int_t &info, matinvreport &rep);
2640 
2641 
2642 /*************************************************************************
2643 Inversion of a general matrix.
2644 
2645 Input parameters:
2646  A - matrix
2647  N - size of matrix A (optional) :
2648  * if given, only principal NxN submatrix is processed and
2649  overwritten. other elements are unchanged.
2650  * if not given, size is automatically determined from
2651  matrix size (A must be square matrix)
2652 
2653 Output parameters:
2654  Info - return code, same as in RMatrixLUInverse
2655  Rep - solver report, same as in RMatrixLUInverse
2656  A - inverse of matrix A, same as in RMatrixLUInverse
2657 
2658  -- ALGLIB --
2659  Copyright 2005 by Bochkanov Sergey
2660 *************************************************************************/
2661 void cmatrixinverse(complex_2d_array &a, const ae_int_t n, ae_int_t &info, matinvreport &rep);
2663 
2664 
2665 /*************************************************************************
2666 Inversion of a symmetric positive definite matrix which is given
2667 by Cholesky decomposition.
2668 
2669 Input parameters:
2670  A - Cholesky decomposition of the matrix to be inverted:
2671  A=U’*U or A = L*L'.
2672  Output of SPDMatrixCholesky subroutine.
2673  N - size of matrix A (optional) :
2674  * if given, only principal NxN submatrix is processed and
2675  overwritten. other elements are unchanged.
2676  * if not given, size is automatically determined from
2677  matrix size (A must be square matrix)
2678  IsUpper - storage type (optional):
2679  * if True, symmetric matrix A is given by its upper
2680  triangle, and the lower triangle isn’t used/changed by
2681  function
2682  * if False, symmetric matrix A is given by its lower
2683  triangle, and the upper triangle isn’t used/changed by
2684  function
2685  * if not given, lower half is used.
2686 
2687 Output parameters:
2688  Info - return code, same as in RMatrixLUInverse
2689  Rep - solver report, same as in RMatrixLUInverse
2690  A - inverse of matrix A, same as in RMatrixLUInverse
2691 
2692  -- ALGLIB routine --
2693  10.02.2010
2694  Bochkanov Sergey
2695 *************************************************************************/
2696 void spdmatrixcholeskyinverse(real_2d_array &a, const ae_int_t n, const bool isupper, ae_int_t &info, matinvreport &rep);
2698 
2699 
2700 /*************************************************************************
2701 Inversion of a symmetric positive definite matrix.
2702 
2703 Given an upper or lower triangle of a symmetric positive definite matrix,
2704 the algorithm generates matrix A^-1 and saves the upper or lower triangle
2705 depending on the input.
2706 
2707 Input parameters:
2708  A - matrix to be inverted (upper or lower triangle).
2709  Array with elements [0..N-1,0..N-1].
2710  N - size of matrix A (optional) :
2711  * if given, only principal NxN submatrix is processed and
2712  overwritten. other elements are unchanged.
2713  * if not given, size is automatically determined from
2714  matrix size (A must be square matrix)
2715  IsUpper - storage type (optional):
2716  * if True, symmetric matrix A is given by its upper
2717  triangle, and the lower triangle isn’t used/changed by
2718  function
2719  * if False, symmetric matrix A is given by its lower
2720  triangle, and the upper triangle isn’t used/changed by
2721  function
2722  * if not given, both lower and upper triangles must be
2723  filled.
2724 
2725 Output parameters:
2726  Info - return code, same as in RMatrixLUInverse
2727  Rep - solver report, same as in RMatrixLUInverse
2728  A - inverse of matrix A, same as in RMatrixLUInverse
2729 
2730  -- ALGLIB routine --
2731  10.02.2010
2732  Bochkanov Sergey
2733 *************************************************************************/
2734 void spdmatrixinverse(real_2d_array &a, const ae_int_t n, const bool isupper, ae_int_t &info, matinvreport &rep);
2735 void spdmatrixinverse(real_2d_array &a, ae_int_t &info, matinvreport &rep);
2736 
2737 
2738 /*************************************************************************
2739 Inversion of a Hermitian positive definite matrix which is given
2740 by Cholesky decomposition.
2741 
2742 Input parameters:
2743  A - Cholesky decomposition of the matrix to be inverted:
2744  A=U’*U or A = L*L'.
2745  Output of HPDMatrixCholesky subroutine.
2746  N - size of matrix A (optional) :
2747  * if given, only principal NxN submatrix is processed and
2748  overwritten. other elements are unchanged.
2749  * if not given, size is automatically determined from
2750  matrix size (A must be square matrix)
2751  IsUpper - storage type (optional):
2752  * if True, symmetric matrix A is given by its upper
2753  triangle, and the lower triangle isn’t used/changed by
2754  function
2755  * if False, symmetric matrix A is given by its lower
2756  triangle, and the upper triangle isn’t used/changed by
2757  function
2758  * if not given, lower half is used.
2759 
2760 Output parameters:
2761  Info - return code, same as in RMatrixLUInverse
2762  Rep - solver report, same as in RMatrixLUInverse
2763  A - inverse of matrix A, same as in RMatrixLUInverse
2764 
2765  -- ALGLIB routine --
2766  10.02.2010
2767  Bochkanov Sergey
2768 *************************************************************************/
2769 void hpdmatrixcholeskyinverse(complex_2d_array &a, const ae_int_t n, const bool isupper, ae_int_t &info, matinvreport &rep);
2771 
2772 
2773 /*************************************************************************
2774 Inversion of a Hermitian positive definite matrix.
2775 
2776 Given an upper or lower triangle of a Hermitian positive definite matrix,
2777 the algorithm generates matrix A^-1 and saves the upper or lower triangle
2778 depending on the input.
2779 
2780 Input parameters:
2781  A - matrix to be inverted (upper or lower triangle).
2782  Array with elements [0..N-1,0..N-1].
2783  N - size of matrix A (optional) :
2784  * if given, only principal NxN submatrix is processed and
2785  overwritten. other elements are unchanged.
2786  * if not given, size is automatically determined from
2787  matrix size (A must be square matrix)
2788  IsUpper - storage type (optional):
2789  * if True, symmetric matrix A is given by its upper
2790  triangle, and the lower triangle isn’t used/changed by
2791  function
2792  * if False, symmetric matrix A is given by its lower
2793  triangle, and the upper triangle isn’t used/changed by
2794  function
2795  * if not given, both lower and upper triangles must be
2796  filled.
2797 
2798 Output parameters:
2799  Info - return code, same as in RMatrixLUInverse
2800  Rep - solver report, same as in RMatrixLUInverse
2801  A - inverse of matrix A, same as in RMatrixLUInverse
2802 
2803  -- ALGLIB routine --
2804  10.02.2010
2805  Bochkanov Sergey
2806 *************************************************************************/
2807 void hpdmatrixinverse(complex_2d_array &a, const ae_int_t n, const bool isupper, ae_int_t &info, matinvreport &rep);
2809 
2810 
2811 /*************************************************************************
2812 Triangular matrix inverse (real)
2813 
2814 The subroutine inverts the following types of matrices:
2815  * upper triangular
2816  * upper triangular with unit diagonal
2817  * lower triangular
2818  * lower triangular with unit diagonal
2819 
2820 In case of an upper (lower) triangular matrix, the inverse matrix will
2821 also be upper (lower) triangular, and after the end of the algorithm, the
2822 inverse matrix replaces the source matrix. The elements below (above) the
2823 main diagonal are not changed by the algorithm.
2824 
2825 If the matrix has a unit diagonal, the inverse matrix also has a unit
2826 diagonal, and the diagonal elements are not passed to the algorithm.
2827 
2828 Input parameters:
2829  A - matrix, array[0..N-1, 0..N-1].
2830  N - size of matrix A (optional) :
2831  * if given, only principal NxN submatrix is processed and
2832  overwritten. other elements are unchanged.
2833  * if not given, size is automatically determined from
2834  matrix size (A must be square matrix)
2835  IsUpper - True, if the matrix is upper triangular.
2836  IsUnit - diagonal type (optional):
2837  * if True, matrix has unit diagonal (a[i,i] are NOT used)
2838  * if False, matrix diagonal is arbitrary
2839  * if not given, False is assumed
2840 
2841 Output parameters:
2842  Info - same as for RMatrixLUInverse
2843  Rep - same as for RMatrixLUInverse
2844  A - same as for RMatrixLUInverse.
2845 
2846  -- ALGLIB --
2847  Copyright 05.02.2010 by Bochkanov Sergey
2848 *************************************************************************/
2849 void rmatrixtrinverse(real_2d_array &a, const ae_int_t n, const bool isupper, const bool isunit, ae_int_t &info, matinvreport &rep);
2850 void rmatrixtrinverse(real_2d_array &a, const bool isupper, ae_int_t &info, matinvreport &rep);
2851 
2852 
2853 /*************************************************************************
2854 Triangular matrix inverse (complex)
2855 
2856 The subroutine inverts the following types of matrices:
2857  * upper triangular
2858  * upper triangular with unit diagonal
2859  * lower triangular
2860  * lower triangular with unit diagonal
2861 
2862 In case of an upper (lower) triangular matrix, the inverse matrix will
2863 also be upper (lower) triangular, and after the end of the algorithm, the
2864 inverse matrix replaces the source matrix. The elements below (above) the
2865 main diagonal are not changed by the algorithm.
2866 
2867 If the matrix has a unit diagonal, the inverse matrix also has a unit
2868 diagonal, and the diagonal elements are not passed to the algorithm.
2869 
2870 Input parameters:
2871  A - matrix, array[0..N-1, 0..N-1].
2872  N - size of matrix A (optional) :
2873  * if given, only principal NxN submatrix is processed and
2874  overwritten. other elements are unchanged.
2875  * if not given, size is automatically determined from
2876  matrix size (A must be square matrix)
2877  IsUpper - True, if the matrix is upper triangular.
2878  IsUnit - diagonal type (optional):
2879  * if True, matrix has unit diagonal (a[i,i] are NOT used)
2880  * if False, matrix diagonal is arbitrary
2881  * if not given, False is assumed
2882 
2883 Output parameters:
2884  Info - same as for RMatrixLUInverse
2885  Rep - same as for RMatrixLUInverse
2886  A - same as for RMatrixLUInverse.
2887 
2888  -- ALGLIB --
2889  Copyright 05.02.2010 by Bochkanov Sergey
2890 *************************************************************************/
2891 void cmatrixtrinverse(complex_2d_array &a, const ae_int_t n, const bool isupper, const bool isunit, ae_int_t &info, matinvreport &rep);
2892 void cmatrixtrinverse(complex_2d_array &a, const bool isupper, ae_int_t &info, matinvreport &rep);
2893 
2894 /*************************************************************************
2895 This function creates sparse matrix in a Hash-Table format.
2896 
2897 This function creates Hast-Table matrix, which can be converted to CRS
2898 format after its initialization is over. Typical usage scenario for a
2899 sparse matrix is:
2900 1. creation in a Hash-Table format
2901 2. insertion of the matrix elements
2902 3. conversion to the CRS representation
2903 4. matrix is passed to some linear algebra algorithm
2904 
2905 Some information about different matrix formats can be found below, in
2906 the "NOTES" section.
2907 
2908 INPUT PARAMETERS
2909  M - number of rows in a matrix, M>=1
2910  N - number of columns in a matrix, N>=1
2911  K - K>=0, expected number of non-zero elements in a matrix.
2912  K can be inexact approximation, can be less than actual
2913  number of elements (table will grow when needed) or
2914  even zero).
2915  It is important to understand that although hash-table
2916  may grow automatically, it is better to provide good
2917  estimate of data size.
2918 
2919 OUTPUT PARAMETERS
2920  S - sparse M*N matrix in Hash-Table representation.
2921  All elements of the matrix are zero.
2922 
2923 NOTE 1.
2924 
2925 Sparse matrices can be stored using either Hash-Table representation or
2926 Compressed Row Storage representation. Hast-table is better suited for
2927 querying and dynamic operations (thus, it is used for matrix
2928 initialization), but it is inefficient when you want to make some linear
2929 algebra operations.
2930 
2931 From the other side, CRS is better suited for linear algebra operations,
2932 but initialization is less convenient - you have to tell row sizes at the
2933 initialization, and you can fill matrix only row by row, from left to
2934 right. CRS is also very inefficient when you want to find matrix element
2935 by its index.
2936 
2937 Thus, Hash-Table representation does not support linear algebra
2938 operations, while CRS format does not support modification of the table.
2939 Tables below outline information about these two formats:
2940 
2941  OPERATIONS WITH MATRIX HASH CRS
2942  create + +
2943  read element + +
2944  modify element +
2945  add value to element +
2946  A*x (dense vector) +
2947  A'*x (dense vector) +
2948  A*X (dense matrix) +
2949  A'*X (dense matrix) +
2950 
2951 NOTE 2.
2952 
2953 Hash-tables use memory inefficiently, and they have to keep some amount
2954 of the "spare memory" in order to have good performance. Hash table for
2955 matrix with K non-zero elements will need C*K*(8+2*sizeof(int)) bytes,
2956 where C is a small constant, about 1.5-2 in magnitude.
2957 
2958 CRS storage, from the other side, is more memory-efficient, and needs
2959 just K*(8+sizeof(int))+M*sizeof(int) bytes, where M is a number of rows
2960 in a matrix.
2961 
2962 When you convert from the Hash-Table to CRS representation, all unneeded
2963 memory will be freed.
2964 
2965  -- ALGLIB PROJECT --
2966  Copyright 14.10.2011 by Bochkanov Sergey
2967 *************************************************************************/
2968 void sparsecreate(const ae_int_t m, const ae_int_t n, const ae_int_t k, sparsematrix &s);
2969 void sparsecreate(const ae_int_t m, const ae_int_t n, sparsematrix &s);
2970 
2971 
2972 /*************************************************************************
2973 This function creates sparse matrix in a CRS format (expert function for
2974 situations when you are running out of memory).
2975 
2976 This function creates CRS matrix. Typical usage scenario for a CRS matrix
2977 is:
2978 1. creation (you have to tell number of non-zero elements at each row at
2979  this moment)
2980 2. insertion of the matrix elements (row by row, from left to right)
2981 3. matrix is passed to some linear algebra algorithm
2982 
2983 This function is a memory-efficient alternative to SparseCreate(), but it
2984 is more complex because it requires you to know in advance how large your
2985 matrix is. Some information about different matrix formats can be found
2986 below, in the "NOTES" section.
2987 
2988 INPUT PARAMETERS
2989  M - number of rows in a matrix, M>=1
2990  N - number of columns in a matrix, N>=1
2991  NER - number of elements at each row, array[M], NER[I]>=0
2992 
2993 OUTPUT PARAMETERS
2994  S - sparse M*N matrix in CRS representation.
2995  You have to fill ALL non-zero elements by calling
2996  SparseSet() BEFORE you try to use this matrix.
2997 
2998 NOTE 1.
2999 
3000 Sparse matrices can be stored using either Hash-Table representation or
3001 Compressed Row Storage representation. Hast-table is better suited for
3002 querying and dynamic operations (thus, it is used for matrix
3003 initialization), but it is inefficient when you want to make some linear
3004 algebra operations.
3005 
3006 From the other side, CRS is better suited for linear algebra operations,
3007 but initialization is less convenient - you have to tell row sizes at the
3008 initialization, and you can fill matrix only row by row, from left to
3009 right. CRS is also very inefficient when you want to find matrix element
3010 by its index.
3011 
3012 Thus, Hash-Table representation does not support linear algebra
3013 operations, while CRS format does not support modification of the table.
3014 Tables below outline information about these two formats:
3015 
3016  OPERATIONS WITH MATRIX HASH CRS
3017  create + +
3018  read element + +
3019  modify element +
3020  add value to element +
3021  A*x (dense vector) +
3022  A'*x (dense vector) +
3023  A*X (dense matrix) +
3024  A'*X (dense matrix) +
3025 
3026 NOTE 2.
3027 
3028 Hash-tables use memory inefficiently, and they have to keep some amount
3029 of the "spare memory" in order to have good performance. Hash table for
3030 matrix with K non-zero elements will need C*K*(8+2*sizeof(int)) bytes,
3031 where C is a small constant, about 1.5-2 in magnitude.
3032 
3033 CRS storage, from the other side, is more memory-efficient, and needs
3034 just K*(8+sizeof(int))+M*sizeof(int) bytes, where M is a number of rows
3035 in a matrix.
3036 
3037 When you convert from the Hash-Table to CRS representation, all unneeded
3038 memory will be freed.
3039 
3040  -- ALGLIB PROJECT --
3041  Copyright 14.10.2011 by Bochkanov Sergey
3042 *************************************************************************/
3043 void sparsecreatecrs(const ae_int_t m, const ae_int_t n, const integer_1d_array &ner, sparsematrix &s);
3044 
3045 
3046 /*************************************************************************
3047 This function copies S0 to S1.
3048 
3049 NOTE: this function does not verify its arguments, it just copies all
3050 fields of the structure.
3051 
3052  -- ALGLIB PROJECT --
3053  Copyright 14.10.2011 by Bochkanov Sergey
3054 *************************************************************************/
3055 void sparsecopy(const sparsematrix &s0, sparsematrix &s1);
3056 
3057 
3058 /*************************************************************************
3059 This function adds value to S[i,j] - element of the sparse matrix. Matrix
3060 must be in a Hash-Table mode.
3061 
3062 In case S[i,j] already exists in the table, V i added to its value. In
3063 case S[i,j] is non-existent, it is inserted in the table. Table
3064 automatically grows when necessary.
3065 
3066 INPUT PARAMETERS
3067  S - sparse M*N matrix in Hash-Table representation.
3068  Exception will be thrown for CRS matrix.
3069  I - row index of the element to modify, 0<=I<M
3070  J - column index of the element to modify, 0<=J<N
3071  V - value to add, must be finite number
3072 
3073 OUTPUT PARAMETERS
3074  S - modified matrix
3075 
3076 NOTE 1: when S[i,j] is exactly zero after modification, it is deleted
3077 from the table.
3078 
3079  -- ALGLIB PROJECT --
3080  Copyright 14.10.2011 by Bochkanov Sergey
3081 *************************************************************************/
3082 void sparseadd(const sparsematrix &s, const ae_int_t i, const ae_int_t j, const double v);
3083 
3084 
3085 /*************************************************************************
3086 This function modifies S[i,j] - element of the sparse matrix.
3087 
3088 For Hash-based storage format:
3089 * new value can be zero or non-zero. In case new value of S[i,j] is zero,
3090  this element is deleted from the table.
3091 * this function has no effect when called with zero V for non-existent
3092  element.
3093 
3094 For CRS-bases storage format:
3095 * new value MUST be non-zero. Exception will be thrown for zero V.
3096 * elements must be initialized in correct order - from top row to bottom,
3097  within row - from left to right.
3098 
3099 INPUT PARAMETERS
3100  S - sparse M*N matrix in Hash-Table or CRS representation.
3101  I - row index of the element to modify, 0<=I<M
3102  J - column index of the element to modify, 0<=J<N
3103  V - value to set, must be finite number, can be zero
3104 
3105 OUTPUT PARAMETERS
3106  S - modified matrix
3107 
3108  -- ALGLIB PROJECT --
3109  Copyright 14.10.2011 by Bochkanov Sergey
3110 *************************************************************************/
3111 void sparseset(const sparsematrix &s, const ae_int_t i, const ae_int_t j, const double v);
3112 
3113 
3114 /*************************************************************************
3115 This function returns S[i,j] - element of the sparse matrix. Matrix can
3116 be in any mode (Hash-Table or CRS), but this function is less efficient
3117 for CRS matrices. Hash-Table matrices can find element in O(1) time,
3118 while CRS matrices need O(log(RS)) time, where RS is an number of non-
3119 zero elements in a row.
3120 
3121 INPUT PARAMETERS
3122  S - sparse M*N matrix in Hash-Table representation.
3123  Exception will be thrown for CRS matrix.
3124  I - row index of the element to modify, 0<=I<M
3125  J - column index of the element to modify, 0<=J<N
3126 
3127 RESULT
3128  value of S[I,J] or zero (in case no element with such index is found)
3129 
3130  -- ALGLIB PROJECT --
3131  Copyright 14.10.2011 by Bochkanov Sergey
3132 *************************************************************************/
3133 double sparseget(const sparsematrix &s, const ae_int_t i, const ae_int_t j);
3134 
3135 
3136 /*************************************************************************
3137 This function returns I-th diagonal element of the sparse matrix.
3138 
3139 Matrix can be in any mode (Hash-Table or CRS storage), but this function
3140 is most efficient for CRS matrices - it requires less than 50 CPU cycles
3141 to extract diagonal element. For Hash-Table matrices we still have O(1)
3142 query time, but function is many times slower.
3143 
3144 INPUT PARAMETERS
3145  S - sparse M*N matrix in Hash-Table representation.
3146  Exception will be thrown for CRS matrix.
3147  I - index of the element to modify, 0<=I<min(M,N)
3148 
3149 RESULT
3150  value of S[I,I] or zero (in case no element with such index is found)
3151 
3152  -- ALGLIB PROJECT --
3153  Copyright 14.10.2011 by Bochkanov Sergey
3154 *************************************************************************/
3155 double sparsegetdiagonal(const sparsematrix &s, const ae_int_t i);
3156 
3157 
3158 /*************************************************************************
3159 This function converts matrix to CRS format.
3160 
3161 Some algorithms (linear algebra ones, for example) require matrices in
3162 CRS format.
3163 
3164 INPUT PARAMETERS
3165  S - sparse M*N matrix in any format
3166 
3167 OUTPUT PARAMETERS
3168  S - matrix in CRS format
3169 
3170 NOTE: this function has no effect when called with matrix which is
3171 already in CRS mode.
3172 
3173  -- ALGLIB PROJECT --
3174  Copyright 14.10.2011 by Bochkanov Sergey
3175 *************************************************************************/
3176 void sparseconverttocrs(const sparsematrix &s);
3177 
3178 
3179 /*************************************************************************
3180 This function calculates matrix-vector product S*x. Matrix S must be
3181 stored in CRS format (exception will be thrown otherwise).
3182 
3183 INPUT PARAMETERS
3184  S - sparse M*N matrix in CRS format (you MUST convert it
3185  to CRS before calling this function).
3186  X - array[N], input vector. For performance reasons we
3187  make only quick checks - we check that array size is
3188  at least N, but we do not check for NAN's or INF's.
3189  Y - output buffer, possibly preallocated. In case buffer
3190  size is too small to store result, this buffer is
3191  automatically resized.
3192 
3193 OUTPUT PARAMETERS
3194  Y - array[M], S*x
3195 
3196 NOTE: this function throws exception when called for non-CRS matrix. You
3197 must convert your matrix with SparseConvertToCRS() before using this
3198 function.
3199 
3200  -- ALGLIB PROJECT --
3201  Copyright 14.10.2011 by Bochkanov Sergey
3202 *************************************************************************/
3203 void sparsemv(const sparsematrix &s, const real_1d_array &x, real_1d_array &y);
3204 
3205 
3206 /*************************************************************************
3207 This function calculates matrix-vector product S^T*x. Matrix S must be
3208 stored in CRS format (exception will be thrown otherwise).
3209 
3210 INPUT PARAMETERS
3211  S - sparse M*N matrix in CRS format (you MUST convert it
3212  to CRS before calling this function).
3213  X - array[M], input vector. For performance reasons we
3214  make only quick checks - we check that array size is
3215  at least M, but we do not check for NAN's or INF's.
3216  Y - output buffer, possibly preallocated. In case buffer
3217  size is too small to store result, this buffer is
3218  automatically resized.
3219 
3220 OUTPUT PARAMETERS
3221  Y - array[N], S^T*x
3222 
3223 NOTE: this function throws exception when called for non-CRS matrix. You
3224 must convert your matrix with SparseConvertToCRS() before using this
3225 function.
3226 
3227  -- ALGLIB PROJECT --
3228  Copyright 14.10.2011 by Bochkanov Sergey
3229 *************************************************************************/
3230 void sparsemtv(const sparsematrix &s, const real_1d_array &x, real_1d_array &y);
3231 
3232 
3233 /*************************************************************************
3234 This function simultaneously calculates two matrix-vector products:
3235  S*x and S^T*x.
3236 S must be square (non-rectangular) matrix stored in CRS format (exception
3237 will be thrown otherwise).
3238 
3239 INPUT PARAMETERS
3240  S - sparse N*N matrix in CRS format (you MUST convert it
3241  to CRS before calling this function).
3242  X - array[N], input vector. For performance reasons we
3243  make only quick checks - we check that array size is
3244  at least N, but we do not check for NAN's or INF's.
3245  Y0 - output buffer, possibly preallocated. In case buffer
3246  size is too small to store result, this buffer is
3247  automatically resized.
3248  Y1 - output buffer, possibly preallocated. In case buffer
3249  size is too small to store result, this buffer is
3250  automatically resized.
3251 
3252 OUTPUT PARAMETERS
3253  Y0 - array[N], S*x
3254  Y1 - array[N], S^T*x
3255 
3256 NOTE: this function throws exception when called for non-CRS matrix. You
3257 must convert your matrix with SparseConvertToCRS() before using this
3258 function. It also throws exception when S is non-square.
3259 
3260  -- ALGLIB PROJECT --
3261  Copyright 14.10.2011 by Bochkanov Sergey
3262 *************************************************************************/
3263 void sparsemv2(const sparsematrix &s, const real_1d_array &x, real_1d_array &y0, real_1d_array &y1);
3264 
3265 
3266 /*************************************************************************
3267 This function calculates matrix-vector product S*x, when S is symmetric
3268 matrix. Matrix S must be stored in CRS format (exception will be
3269 thrown otherwise).
3270 
3271 INPUT PARAMETERS
3272  S - sparse M*M matrix in CRS format (you MUST convert it
3273  to CRS before calling this function).
3274  IsUpper - whether upper or lower triangle of S is given:
3275  * if upper triangle is given, only S[i,j] for j>=i
3276  are used, and lower triangle is ignored (it can be
3277  empty - these elements are not referenced at all).
3278  * if lower triangle is given, only S[i,j] for j<=i
3279  are used, and upper triangle is ignored.
3280  X - array[N], input vector. For performance reasons we
3281  make only quick checks - we check that array size is
3282  at least N, but we do not check for NAN's or INF's.
3283  Y - output buffer, possibly preallocated. In case buffer
3284  size is too small to store result, this buffer is
3285  automatically resized.
3286 
3287 OUTPUT PARAMETERS
3288  Y - array[M], S*x
3289 
3290 NOTE: this function throws exception when called for non-CRS matrix. You
3291 must convert your matrix with SparseConvertToCRS() before using this
3292 function.
3293 
3294  -- ALGLIB PROJECT --
3295  Copyright 14.10.2011 by Bochkanov Sergey
3296 *************************************************************************/
3297 void sparsesmv(const sparsematrix &s, const bool isupper, const real_1d_array &x, real_1d_array &y);
3298 
3299 
3300 /*************************************************************************
3301 This function calculates matrix-matrix product S*A. Matrix S must be
3302 stored in CRS format (exception will be thrown otherwise).
3303 
3304 INPUT PARAMETERS
3305  S - sparse M*N matrix in CRS format (you MUST convert it
3306  to CRS before calling this function).
3307  A - array[N][K], input dense matrix. For performance reasons
3308  we make only quick checks - we check that array size
3309  is at least N, but we do not check for NAN's or INF's.
3310  K - number of columns of matrix (A).
3311  B - output buffer, possibly preallocated. In case buffer
3312  size is too small to store result, this buffer is
3313  automatically resized.
3314 
3315 OUTPUT PARAMETERS
3316  B - array[M][K], S*A
3317 
3318 NOTE: this function throws exception when called for non-CRS matrix. You
3319 must convert your matrix with SparseConvertToCRS() before using this
3320 function.
3321 
3322  -- ALGLIB PROJECT --
3323  Copyright 14.10.2011 by Bochkanov Sergey
3324 *************************************************************************/
3325 void sparsemm(const sparsematrix &s, const real_2d_array &a, const ae_int_t k, real_2d_array &b);
3326 
3327 
3328 /*************************************************************************
3329 This function calculates matrix-matrix product S^T*A. Matrix S must be
3330 stored in CRS format (exception will be thrown otherwise).
3331 
3332 INPUT PARAMETERS
3333  S - sparse M*N matrix in CRS format (you MUST convert it
3334  to CRS before calling this function).
3335  A - array[M][K], input dense matrix. For performance reasons
3336  we make only quick checks - we check that array size is
3337  at least M, but we do not check for NAN's or INF's.
3338  K - number of columns of matrix (A).
3339  B - output buffer, possibly preallocated. In case buffer
3340  size is too small to store result, this buffer is
3341  automatically resized.
3342 
3343 OUTPUT PARAMETERS
3344  B - array[N][K], S^T*A
3345 
3346 NOTE: this function throws exception when called for non-CRS matrix. You
3347 must convert your matrix with SparseConvertToCRS() before using this
3348 function.
3349 
3350  -- ALGLIB PROJECT --
3351  Copyright 14.10.2011 by Bochkanov Sergey
3352 *************************************************************************/
3353 void sparsemtm(const sparsematrix &s, const real_2d_array &a, const ae_int_t k, real_2d_array &b);
3354 
3355 
3356 /*************************************************************************
3357 This function simultaneously calculates two matrix-matrix products:
3358  S*A and S^T*A.
3359 S must be square (non-rectangular) matrix stored in CRS format (exception
3360 will be thrown otherwise).
3361 
3362 INPUT PARAMETERS
3363  S - sparse N*N matrix in CRS format (you MUST convert it
3364  to CRS before calling this function).
3365  A - array[N][K], input dense matrix. For performance reasons
3366  we make only quick checks - we check that array size is
3367  at least N, but we do not check for NAN's or INF's.
3368  K - number of columns of matrix (A).
3369  B0 - output buffer, possibly preallocated. In case buffer
3370  size is too small to store result, this buffer is
3371  automatically resized.
3372  B1 - output buffer, possibly preallocated. In case buffer
3373  size is too small to store result, this buffer is
3374  automatically resized.
3375 
3376 OUTPUT PARAMETERS
3377  B0 - array[N][K], S*A
3378  B1 - array[N][K], S^T*A
3379 
3380 NOTE: this function throws exception when called for non-CRS matrix. You
3381 must convert your matrix with SparseConvertToCRS() before using this
3382 function. It also throws exception when S is non-square.
3383 
3384  -- ALGLIB PROJECT --
3385  Copyright 14.10.2011 by Bochkanov Sergey
3386 *************************************************************************/
3387 void sparsemm2(const sparsematrix &s, const real_2d_array &a, const ae_int_t k, real_2d_array &b0, real_2d_array &b1);
3388 
3389 
3390 /*************************************************************************
3391 This function calculates matrix-matrix product S*A, when S is symmetric
3392 matrix. Matrix S must be stored in CRS format (exception will be
3393 thrown otherwise).
3394 
3395 INPUT PARAMETERS
3396  S - sparse M*M matrix in CRS format (you MUST convert it
3397  to CRS before calling this function).
3398  IsUpper - whether upper or lower triangle of S is given:
3399  * if upper triangle is given, only S[i,j] for j>=i
3400  are used, and lower triangle is ignored (it can be
3401  empty - these elements are not referenced at all).
3402  * if lower triangle is given, only S[i,j] for j<=i
3403  are used, and upper triangle is ignored.
3404  A - array[N][K], input dense matrix. For performance reasons
3405  we make only quick checks - we check that array size is
3406  at least N, but we do not check for NAN's or INF's.
3407  K - number of columns of matrix (A).
3408  B - output buffer, possibly preallocated. In case buffer
3409  size is too small to store result, this buffer is
3410  automatically resized.
3411 
3412 OUTPUT PARAMETERS
3413  B - array[M][K], S*A
3414 
3415 NOTE: this function throws exception when called for non-CRS matrix. You
3416 must convert your matrix with SparseConvertToCRS() before using this
3417 function.
3418 
3419  -- ALGLIB PROJECT --
3420  Copyright 14.10.2011 by Bochkanov Sergey
3421 *************************************************************************/
3422 void sparsesmm(const sparsematrix &s, const bool isupper, const real_2d_array &a, const ae_int_t k, real_2d_array &b);
3423 
3424 
3425 /*************************************************************************
3426 This procedure resizes Hash-Table matrix. It can be called when you have
3427 deleted too many elements from the matrix, and you want to free unneeded
3428 memory.
3429 
3430  -- ALGLIB PROJECT --
3431  Copyright 14.10.2011 by Bochkanov Sergey
3432 *************************************************************************/
3433 void sparseresizematrix(const sparsematrix &s);
3434 
3435 
3436 /*************************************************************************
3437 This function is used to enumerate all elements of the sparse matrix.
3438 Before first call user initializes T0 and T1 counters by zero. These
3439 counters are used to remember current position in a matrix; after each
3440 call they are updated by the function.
3441 
3442 Subsequent calls to this function return non-zero elements of the sparse
3443 matrix, one by one. If you enumerate CRS matrix, matrix is traversed from
3444 left to right, from top to bottom. In case you enumerate matrix stored as
3445 Hash table, elements are returned in random order.
3446 
3447 EXAMPLE
3448  > T0=0
3449  > T1=0
3450  > while SparseEnumerate(S,T0,T1,I,J,V) do
3451  > ....do something with I,J,V
3452 
3453 INPUT PARAMETERS
3454  S - sparse M*N matrix in Hash-Table or CRS representation.
3455  T0 - internal counter
3456  T1 - internal counter
3457 
3458 OUTPUT PARAMETERS
3459  T0 - new value of the internal counter
3460  T1 - new value of the internal counter
3461  I - row index of non-zero element, 0<=I<M.
3462  J - column index of non-zero element, 0<=J<N
3463  V - value of the T-th element
3464 
3465 RESULT
3466  True in case of success (next non-zero element was retrieved)
3467  False in case all non-zero elements were enumerated
3468 
3469  -- ALGLIB PROJECT --
3470  Copyright 14.03.2012 by Bochkanov Sergey
3471 *************************************************************************/
3472 bool sparseenumerate(const sparsematrix &s, ae_int_t &t0, ae_int_t &t1, ae_int_t &i, ae_int_t &j, double &v);
3473 
3474 
3475 /*************************************************************************
3476 This function rewrites existing (non-zero) element. It returns True if
3477 element exists or False, when it is called for non-existing (zero)
3478 element.
3479 
3480 The purpose of this function is to provide convenient thread-safe way to
3481 modify sparse matrix. Such modification (already existing element is
3482 rewritten) is guaranteed to be thread-safe without any synchronization, as
3483 long as different threads modify different elements.
3484 
3485 INPUT PARAMETERS
3486  S - sparse M*N matrix in Hash-Table or CRS representation.
3487  I - row index of non-zero element to modify, 0<=I<M
3488  J - column index of non-zero element to modify, 0<=J<N
3489  V - value to rewrite, must be finite number
3490 
3491 OUTPUT PARAMETERS
3492  S - modified matrix
3493 RESULT
3494  True in case when element exists
3495  False in case when element doesn't exist or it is zero
3496 
3497  -- ALGLIB PROJECT --
3498  Copyright 14.03.2012 by Bochkanov Sergey
3499 *************************************************************************/
3500 bool sparserewriteexisting(const sparsematrix &s, const ae_int_t i, const ae_int_t j, const double v);
3501 
3502 
3503 /*************************************************************************
3504 This function returns I-th row of the sparse matrix stored in CRS format.
3505 
3506 NOTE: when incorrect I (outside of [0,M-1]) or matrix (non-CRS) are
3507  passed, this function throws exception.
3508 
3509 INPUT PARAMETERS:
3510  S - sparse M*N matrix in CRS format
3511  I - row index, 0<=I<M
3512  IRow - output buffer, can be preallocated. In case buffer
3513  size is too small to store I-th row, it is
3514  automatically reallocated.
3515 
3516 OUTPUT PARAMETERS:
3517  IRow - array[M], I-th row.
3518 
3519 
3520  -- ALGLIB PROJECT --
3521  Copyright 20.07.2012 by Bochkanov Sergey
3522 *************************************************************************/
3523 void sparsegetrow(const sparsematrix &s, const ae_int_t i, real_1d_array &irow);
3524 
3525 
3526 /*************************************************************************
3527 This function performs in-place conversion from CRS format to Hash table
3528 storage.
3529 
3530 INPUT PARAMETERS
3531  S - sparse matrix in CRS format.
3532 
3533 OUTPUT PARAMETERS
3534  S - sparse matrix in Hash table format.
3535 
3536 NOTE: this function has no effect when called with matrix which is
3537 already in Hash table mode.
3538 
3539  -- ALGLIB PROJECT --
3540  Copyright 20.07.2012 by Bochkanov Sergey
3541 *************************************************************************/
3542 void sparseconverttohash(const sparsematrix &s);
3543 
3544 
3545 /*************************************************************************
3546 This function performs out-of-place conversion to Hash table storage
3547 format. S0 is copied to S1 and converted on-the-fly.
3548 
3549 INPUT PARAMETERS
3550  S0 - sparse matrix in any format.
3551 
3552 OUTPUT PARAMETERS
3553  S1 - sparse matrix in Hash table format.
3554 
3555 NOTE: if S0 is stored as Hash-table, it is just copied without conversion.
3556 
3557  -- ALGLIB PROJECT --
3558  Copyright 20.07.2012 by Bochkanov Sergey
3559 *************************************************************************/
3560 void sparsecopytohash(const sparsematrix &s0, sparsematrix &s1);
3561 
3562 
3563 /*************************************************************************
3564 This function performs out-of-place conversion to CRS format. S0 is
3565 copied to S1 and converted on-the-fly.
3566 
3567 INPUT PARAMETERS
3568  S0 - sparse matrix in any format.
3569 
3570 OUTPUT PARAMETERS
3571  S1 - sparse matrix in CRS format.
3572 
3573 NOTE: if S0 is stored as CRS, it is just copied without conversion.
3574 
3575  -- ALGLIB PROJECT --
3576  Copyright 20.07.2012 by Bochkanov Sergey
3577 *************************************************************************/
3578 void sparsecopytocrs(const sparsematrix &s0, sparsematrix &s1);
3579 
3580 
3581 /*************************************************************************
3582 This function returns type of the matrix storage format.
3583 
3584 INPUT PARAMETERS:
3585  S - sparse matrix.
3586 
3587 RESULT:
3588  sparse storage format used by matrix:
3589  0 - Hash-table
3590  1 - CRS-format
3591 
3592 NOTE: future versions of ALGLIB may include additional sparse storage
3593  formats.
3594 
3595 
3596  -- ALGLIB PROJECT --
3597  Copyright 20.07.2012 by Bochkanov Sergey
3598 *************************************************************************/
3600 
3601 
3602 /*************************************************************************
3603 This function checks matrix storage format and returns True when matrix is
3604 stored using Hash table representation.
3605 
3606 INPUT PARAMETERS:
3607  S - sparse matrix.
3608 
3609 RESULT:
3610  True if matrix type is Hash table
3611  False if matrix type is not Hash table
3612 
3613  -- ALGLIB PROJECT --
3614  Copyright 20.07.2012 by Bochkanov Sergey
3615 *************************************************************************/
3616 bool sparseishash(const sparsematrix &s);
3617 
3618 
3619 /*************************************************************************
3620 This function checks matrix storage format and returns True when matrix is
3621 stored using CRS representation.
3622 
3623 INPUT PARAMETERS:
3624  S - sparse matrix.
3625 
3626 RESULT:
3627  True if matrix type is CRS
3628  False if matrix type is not CRS
3629 
3630  -- ALGLIB PROJECT --
3631  Copyright 20.07.2012 by Bochkanov Sergey
3632 *************************************************************************/
3633 bool sparseiscrs(const sparsematrix &s);
3634 
3635 
3636 /*************************************************************************
3637 The function frees all memory occupied by sparse matrix. Sparse matrix
3638 structure becomes unusable after this call.
3639 
3640 OUTPUT PARAMETERS
3641  S - sparse matrix to delete
3642 
3643  -- ALGLIB PROJECT --
3644  Copyright 24.07.2012 by Bochkanov Sergey
3645 *************************************************************************/
3646 void sparsefree(sparsematrix &s);
3647 
3648 
3649 /*************************************************************************
3650 The function returns number of rows of a sparse matrix.
3651 
3652 RESULT: number of rows of a sparse matrix.
3653 
3654  -- ALGLIB PROJECT --
3655  Copyright 23.08.2012 by Bochkanov Sergey
3656 *************************************************************************/
3658 
3659 
3660 /*************************************************************************
3661 The function returns number of columns of a sparse matrix.
3662 
3663 RESULT: number of columns of a sparse matrix.
3664 
3665  -- ALGLIB PROJECT --
3666  Copyright 23.08.2012 by Bochkanov Sergey
3667 *************************************************************************/
3669 
3670 
3671 
3672 /*************************************************************************
3673 This procedure initializes matrix norm estimator.
3674 
3675 USAGE:
3676 1. User initializes algorithm state with NormEstimatorCreate() call
3677 2. User calls NormEstimatorEstimateSparse() (or NormEstimatorIteration())
3678 3. User calls NormEstimatorResults() to get solution.
3679 
3680 INPUT PARAMETERS:
3681  M - number of rows in the matrix being estimated, M>0
3682  N - number of columns in the matrix being estimated, N>0
3683  NStart - number of random starting vectors
3684  recommended value - at least 5.
3685  NIts - number of iterations to do with best starting vector
3686  recommended value - at least 5.
3687 
3688 OUTPUT PARAMETERS:
3689  State - structure which stores algorithm state
3690 
3691 
3692 NOTE: this algorithm is effectively deterministic, i.e. it always returns
3693 same result when repeatedly called for the same matrix. In fact, algorithm
3694 uses randomized starting vectors, but internal random numbers generator
3695 always generates same sequence of the random values (it is a feature, not
3696 bug).
3697 
3698 Algorithm can be made non-deterministic with NormEstimatorSetSeed(0) call.
3699 
3700  -- ALGLIB --
3701  Copyright 06.12.2011 by Bochkanov Sergey
3702 *************************************************************************/
3703 void normestimatorcreate(const ae_int_t m, const ae_int_t n, const ae_int_t nstart, const ae_int_t nits, normestimatorstate &state);
3704 
3705 
3706 /*************************************************************************
3707 This function changes seed value used by algorithm. In some cases we need
3708 deterministic processing, i.e. subsequent calls must return equal results,
3709 in other cases we need non-deterministic algorithm which returns different
3710 results for the same matrix on every pass.
3711 
3712 Setting zero seed will lead to non-deterministic algorithm, while non-zero
3713 value will make our algorithm deterministic.
3714 
3715 INPUT PARAMETERS:
3716  State - norm estimator state, must be initialized with a call
3717  to NormEstimatorCreate()
3718  SeedVal - seed value, >=0. Zero value = non-deterministic algo.
3719 
3720  -- ALGLIB --
3721  Copyright 06.12.2011 by Bochkanov Sergey
3722 *************************************************************************/
3723 void normestimatorsetseed(const normestimatorstate &state, const ae_int_t seedval);
3724 
3725 
3726 /*************************************************************************
3727 This function estimates norm of the sparse M*N matrix A.
3728 
3729 INPUT PARAMETERS:
3730  State - norm estimator state, must be initialized with a call
3731  to NormEstimatorCreate()
3732  A - sparse M*N matrix, must be converted to CRS format
3733  prior to calling this function.
3734 
3735 After this function is over you can call NormEstimatorResults() to get
3736 estimate of the norm(A).
3737 
3738  -- ALGLIB --
3739  Copyright 06.12.2011 by Bochkanov Sergey
3740 *************************************************************************/
3741 void normestimatorestimatesparse(const normestimatorstate &state, const sparsematrix &a);
3742 
3743 
3744 /*************************************************************************
3745 Matrix norm estimation results
3746 
3747 INPUT PARAMETERS:
3748  State - algorithm state
3749 
3750 OUTPUT PARAMETERS:
3751  Nrm - estimate of the matrix norm, Nrm>=0
3752 
3753  -- ALGLIB --
3754  Copyright 06.12.2011 by Bochkanov Sergey
3755 *************************************************************************/
3756 void normestimatorresults(const normestimatorstate &state, double &nrm);
3757 
3758 /*************************************************************************
3759 Determinant calculation of the matrix given by its LU decomposition.
3760 
3761 Input parameters:
3762  A - LU decomposition of the matrix (output of
3763  RMatrixLU subroutine).
3764  Pivots - table of permutations which were made during
3765  the LU decomposition.
3766  Output of RMatrixLU subroutine.
3767  N - (optional) size of matrix A:
3768  * if given, only principal NxN submatrix is processed and
3769  overwritten. other elements are unchanged.
3770  * if not given, automatically determined from matrix size
3771  (A must be square matrix)
3772 
3773 Result: matrix determinant.
3774 
3775  -- ALGLIB --
3776  Copyright 2005 by Bochkanov Sergey
3777 *************************************************************************/
3778 double rmatrixludet(const real_2d_array &a, const integer_1d_array &pivots, const ae_int_t n);
3779 double rmatrixludet(const real_2d_array &a, const integer_1d_array &pivots);
3780 
3781 
3782 /*************************************************************************
3783 Calculation of the determinant of a general matrix
3784 
3785 Input parameters:
3786  A - matrix, array[0..N-1, 0..N-1]
3787  N - (optional) size of matrix A:
3788  * if given, only principal NxN submatrix is processed and
3789  overwritten. other elements are unchanged.
3790  * if not given, automatically determined from matrix size
3791  (A must be square matrix)
3792 
3793 Result: determinant of matrix A.
3794 
3795  -- ALGLIB --
3796  Copyright 2005 by Bochkanov Sergey
3797 *************************************************************************/
3798 double rmatrixdet(const real_2d_array &a, const ae_int_t n);
3799 double rmatrixdet(const real_2d_array &a);
3800 
3801 
3802 /*************************************************************************
3803 Determinant calculation of the matrix given by its LU decomposition.
3804 
3805 Input parameters:
3806  A - LU decomposition of the matrix (output of
3807  RMatrixLU subroutine).
3808  Pivots - table of permutations which were made during
3809  the LU decomposition.
3810  Output of RMatrixLU subroutine.
3811  N - (optional) size of matrix A:
3812  * if given, only principal NxN submatrix is processed and
3813  overwritten. other elements are unchanged.
3814  * if not given, automatically determined from matrix size
3815  (A must be square matrix)
3816 
3817 Result: matrix determinant.
3818 
3819  -- ALGLIB --
3820  Copyright 2005 by Bochkanov Sergey
3821 *************************************************************************/
3822 alglib::complex cmatrixludet(const complex_2d_array &a, const integer_1d_array &pivots, const ae_int_t n);
3824 
3825 
3826 /*************************************************************************
3827 Calculation of the determinant of a general matrix
3828 
3829 Input parameters:
3830  A - matrix, array[0..N-1, 0..N-1]
3831  N - (optional) size of matrix A:
3832  * if given, only principal NxN submatrix is processed and
3833  overwritten. other elements are unchanged.
3834  * if not given, automatically determined from matrix size
3835  (A must be square matrix)
3836 
3837 Result: determinant of matrix A.
3838 
3839  -- ALGLIB --
3840  Copyright 2005 by Bochkanov Sergey
3841 *************************************************************************/
3844 
3845 
3846 /*************************************************************************
3847 Determinant calculation of the matrix given by the Cholesky decomposition.
3848 
3849 Input parameters:
3850  A - Cholesky decomposition,
3851  output of SMatrixCholesky subroutine.
3852  N - (optional) size of matrix A:
3853  * if given, only principal NxN submatrix is processed and
3854  overwritten. other elements are unchanged.
3855  * if not given, automatically determined from matrix size
3856  (A must be square matrix)
3857 
3858 As the determinant is equal to the product of squares of diagonal elements,
3859 it’s not necessary to specify which triangle - lower or upper - the matrix
3860 is stored in.
3861 
3862 Result:
3863  matrix determinant.
3864 
3865  -- ALGLIB --
3866  Copyright 2005-2008 by Bochkanov Sergey
3867 *************************************************************************/
3868 double spdmatrixcholeskydet(const real_2d_array &a, const ae_int_t n);
3869 double spdmatrixcholeskydet(const real_2d_array &a);
3870 
3871 
3872 /*************************************************************************
3873 Determinant calculation of the symmetric positive definite matrix.
3874 
3875 Input parameters:
3876  A - matrix. Array with elements [0..N-1, 0..N-1].
3877  N - (optional) size of matrix A:
3878  * if given, only principal NxN submatrix is processed and
3879  overwritten. other elements are unchanged.
3880  * if not given, automatically determined from matrix size
3881  (A must be square matrix)
3882  IsUpper - (optional) storage type:
3883  * if True, symmetric matrix A is given by its upper
3884  triangle, and the lower triangle isn’t used/changed by
3885  function
3886  * if False, symmetric matrix A is given by its lower
3887  triangle, and the upper triangle isn’t used/changed by
3888  function
3889  * if not given, both lower and upper triangles must be
3890  filled.
3891 
3892 Result:
3893  determinant of matrix A.
3894  If matrix A is not positive definite, exception is thrown.
3895 
3896  -- ALGLIB --
3897  Copyright 2005-2008 by Bochkanov Sergey
3898 *************************************************************************/
3899 double spdmatrixdet(const real_2d_array &a, const ae_int_t n, const bool isupper);
3900 double spdmatrixdet(const real_2d_array &a);
3901 
3902 /*************************************************************************
3903 Algorithm for solving the following generalized symmetric positive-definite
3904 eigenproblem:
3905  A*x = lambda*B*x (1) or
3906  A*B*x = lambda*x (2) or
3907  B*A*x = lambda*x (3).
3908 where A is a symmetric matrix, B - symmetric positive-definite matrix.
3909 The problem is solved by reducing it to an ordinary symmetric eigenvalue
3910 problem.
3911 
3912 Input parameters:
3913  A - symmetric matrix which is given by its upper or lower
3914  triangular part.
3915  Array whose indexes range within [0..N-1, 0..N-1].
3916  N - size of matrices A and B.
3917  IsUpperA - storage format of matrix A.
3918  B - symmetric positive-definite matrix which is given by
3919  its upper or lower triangular part.
3920  Array whose indexes range within [0..N-1, 0..N-1].
3921  IsUpperB - storage format of matrix B.
3922  ZNeeded - if ZNeeded is equal to:
3923  * 0, the eigenvectors are not returned;
3924  * 1, the eigenvectors are returned.
3925  ProblemType - if ProblemType is equal to:
3926  * 1, the following problem is solved: A*x = lambda*B*x;
3927  * 2, the following problem is solved: A*B*x = lambda*x;
3928  * 3, the following problem is solved: B*A*x = lambda*x.
3929 
3930 Output parameters:
3931  D - eigenvalues in ascending order.
3932  Array whose index ranges within [0..N-1].
3933  Z - if ZNeeded is equal to:
3934  * 0, Z hasn’t changed;
3935  * 1, Z contains eigenvectors.
3936  Array whose indexes range within [0..N-1, 0..N-1].
3937  The eigenvectors are stored in matrix columns. It should
3938  be noted that the eigenvectors in such problems do not
3939  form an orthogonal system.
3940 
3941 Result:
3942  True, if the problem was solved successfully.
3943  False, if the error occurred during the Cholesky decomposition of matrix
3944  B (the matrix isn’t positive-definite) or during the work of the iterative
3945  algorithm for solving the symmetric eigenproblem.
3946 
3947 See also the GeneralizedSymmetricDefiniteEVDReduce subroutine.
3948 
3949  -- ALGLIB --
3950  Copyright 1.28.2006 by Bochkanov Sergey
3951 *************************************************************************/
3952 bool smatrixgevd(const real_2d_array &a, const ae_int_t n, const bool isuppera, const real_2d_array &b, const bool isupperb, const ae_int_t zneeded, const ae_int_t problemtype, real_1d_array &d, real_2d_array &z);
3953 
3954 
3955 /*************************************************************************
3956 Algorithm for reduction of the following generalized symmetric positive-
3957 definite eigenvalue problem:
3958  A*x = lambda*B*x (1) or
3959  A*B*x = lambda*x (2) or
3960  B*A*x = lambda*x (3)
3961 to the symmetric eigenvalues problem C*y = lambda*y (eigenvalues of this and
3962 the given problems are the same, and the eigenvectors of the given problem
3963 could be obtained by multiplying the obtained eigenvectors by the
3964 transformation matrix x = R*y).
3965 
3966 Here A is a symmetric matrix, B - symmetric positive-definite matrix.
3967 
3968 Input parameters:
3969  A - symmetric matrix which is given by its upper or lower
3970  triangular part.
3971  Array whose indexes range within [0..N-1, 0..N-1].
3972  N - size of matrices A and B.
3973  IsUpperA - storage format of matrix A.
3974  B - symmetric positive-definite matrix which is given by
3975  its upper or lower triangular part.
3976  Array whose indexes range within [0..N-1, 0..N-1].
3977  IsUpperB - storage format of matrix B.
3978  ProblemType - if ProblemType is equal to:
3979  * 1, the following problem is solved: A*x = lambda*B*x;
3980  * 2, the following problem is solved: A*B*x = lambda*x;
3981  * 3, the following problem is solved: B*A*x = lambda*x.
3982 
3983 Output parameters:
3984  A - symmetric matrix which is given by its upper or lower
3985  triangle depending on IsUpperA. Contains matrix C.
3986  Array whose indexes range within [0..N-1, 0..N-1].
3987  R - upper triangular or low triangular transformation matrix
3988  which is used to obtain the eigenvectors of a given problem
3989  as the product of eigenvectors of C (from the right) and
3990  matrix R (from the left). If the matrix is upper
3991  triangular, the elements below the main diagonal
3992  are equal to 0 (and vice versa). Thus, we can perform
3993  the multiplication without taking into account the
3994  internal structure (which is an easier though less
3995  effective way).
3996  Array whose indexes range within [0..N-1, 0..N-1].
3997  IsUpperR - type of matrix R (upper or lower triangular).
3998 
3999 Result:
4000  True, if the problem was reduced successfully.
4001  False, if the error occurred during the Cholesky decomposition of
4002  matrix B (the matrix is not positive-definite).
4003 
4004  -- ALGLIB --
4005  Copyright 1.28.2006 by Bochkanov Sergey
4006 *************************************************************************/
4007 bool smatrixgevdreduce(real_2d_array &a, const ae_int_t n, const bool isuppera, const real_2d_array &b, const bool isupperb, const ae_int_t problemtype, real_2d_array &r, bool &isupperr);
4008 
4009 /*************************************************************************
4010 Inverse matrix update by the Sherman-Morrison formula
4011 
4012 The algorithm updates matrix A^-1 when adding a number to an element
4013 of matrix A.
4014 
4015 Input parameters:
4016  InvA - inverse of matrix A.
4017  Array whose indexes range within [0..N-1, 0..N-1].
4018  N - size of matrix A.
4019  UpdRow - row where the element to be updated is stored.
4020  UpdColumn - column where the element to be updated is stored.
4021  UpdVal - a number to be added to the element.
4022 
4023 
4024 Output parameters:
4025  InvA - inverse of modified matrix A.
4026 
4027  -- ALGLIB --
4028  Copyright 2005 by Bochkanov Sergey
4029 *************************************************************************/
4030 void rmatrixinvupdatesimple(real_2d_array &inva, const ae_int_t n, const ae_int_t updrow, const ae_int_t updcolumn, const double updval);
4031 
4032 
4033 /*************************************************************************
4034 Inverse matrix update by the Sherman-Morrison formula
4035 
4036 The algorithm updates matrix A^-1 when adding a vector to a row
4037 of matrix A.
4038 
4039 Input parameters:
4040  InvA - inverse of matrix A.
4041  Array whose indexes range within [0..N-1, 0..N-1].
4042  N - size of matrix A.
4043  UpdRow - the row of A whose vector V was added.
4044  0 <= Row <= N-1
4045  V - the vector to be added to a row.
4046  Array whose index ranges within [0..N-1].
4047 
4048 Output parameters:
4049  InvA - inverse of modified matrix A.
4050 
4051  -- ALGLIB --
4052  Copyright 2005 by Bochkanov Sergey
4053 *************************************************************************/
4054 void rmatrixinvupdaterow(real_2d_array &inva, const ae_int_t n, const ae_int_t updrow, const real_1d_array &v);
4055 
4056 
4057 /*************************************************************************
4058 Inverse matrix update by the Sherman-Morrison formula
4059 
4060 The algorithm updates matrix A^-1 when adding a vector to a column
4061 of matrix A.
4062 
4063 Input parameters:
4064  InvA - inverse of matrix A.
4065  Array whose indexes range within [0..N-1, 0..N-1].
4066  N - size of matrix A.
4067  UpdColumn - the column of A whose vector U was added.
4068  0 <= UpdColumn <= N-1
4069  U - the vector to be added to a column.
4070  Array whose index ranges within [0..N-1].
4071 
4072 Output parameters:
4073  InvA - inverse of modified matrix A.
4074 
4075  -- ALGLIB --
4076  Copyright 2005 by Bochkanov Sergey
4077 *************************************************************************/
4078 void rmatrixinvupdatecolumn(real_2d_array &inva, const ae_int_t n, const ae_int_t updcolumn, const real_1d_array &u);
4079 
4080 
4081 /*************************************************************************
4082 Inverse matrix update by the Sherman-Morrison formula
4083 
4084 The algorithm computes the inverse of matrix A+u*v’ by using the given matrix
4085 A^-1 and the vectors u and v.
4086 
4087 Input parameters:
4088  InvA - inverse of matrix A.
4089  Array whose indexes range within [0..N-1, 0..N-1].
4090  N - size of matrix A.
4091  U - the vector modifying the matrix.
4092  Array whose index ranges within [0..N-1].
4093  V - the vector modifying the matrix.
4094  Array whose index ranges within [0..N-1].
4095 
4096 Output parameters:
4097  InvA - inverse of matrix A + u*v'.
4098 
4099  -- ALGLIB --
4100  Copyright 2005 by Bochkanov Sergey
4101 *************************************************************************/
4102 void rmatrixinvupdateuv(real_2d_array &inva, const ae_int_t n, const real_1d_array &u, const real_1d_array &v);
4103 
4104 /*************************************************************************
4105 Subroutine performing the Schur decomposition of a general matrix by using
4106 the QR algorithm with multiple shifts.
4107 
4108 The source matrix A is represented as S'*A*S = T, where S is an orthogonal
4109 matrix (Schur vectors), T - upper quasi-triangular matrix (with blocks of
4110 sizes 1x1 and 2x2 on the main diagonal).
4111 
4112 Input parameters:
4113  A - matrix to be decomposed.
4114  Array whose indexes range within [0..N-1, 0..N-1].
4115  N - size of A, N>=0.
4116 
4117 
4118 Output parameters:
4119  A - contains matrix T.
4120  Array whose indexes range within [0..N-1, 0..N-1].
4121  S - contains Schur vectors.
4122  Array whose indexes range within [0..N-1, 0..N-1].
4123 
4124 Note 1:
4125  The block structure of matrix T can be easily recognized: since all
4126  the elements below the blocks are zeros, the elements a[i+1,i] which
4127  are equal to 0 show the block border.
4128 
4129 Note 2:
4130  The algorithm performance depends on the value of the internal parameter
4131  NS of the InternalSchurDecomposition subroutine which defines the number
4132  of shifts in the QR algorithm (similarly to the block width in block-matrix
4133  algorithms in linear algebra). If you require maximum performance on
4134  your machine, it is recommended to adjust this parameter manually.
4135 
4136 Result:
4137  True,
4138  if the algorithm has converged and parameters A and S contain the result.
4139  False,
4140  if the algorithm has not converged.
4141 
4142 Algorithm implemented on the basis of the DHSEQR subroutine (LAPACK 3.0 library).
4143 *************************************************************************/
4144 bool rmatrixschur(real_2d_array &a, const ae_int_t n, real_2d_array &s);
4145 }
4146 
4148 //
4149 // THIS SECTION CONTAINS COMPUTATIONAL CORE DECLARATIONS (FUNCTIONS)
4150 //
4152 namespace alglib_impl
4153 {
4154 void ablassplitlength(/* Real */ ae_matrix* a,
4155  ae_int_t n,
4156  ae_int_t* n1,
4157  ae_int_t* n2,
4158  ae_state *_state);
4159 void ablascomplexsplitlength(/* Complex */ ae_matrix* a,
4160  ae_int_t n,
4161  ae_int_t* n1,
4162  ae_int_t* n2,
4163  ae_state *_state);
4164 ae_int_t ablasblocksize(/* Real */ ae_matrix* a, ae_state *_state);
4165 ae_int_t ablascomplexblocksize(/* Complex */ ae_matrix* a,
4166  ae_state *_state);
4169  ae_int_t n,
4170  /* Complex */ ae_matrix* a,
4171  ae_int_t ia,
4172  ae_int_t ja,
4173  /* Complex */ ae_matrix* b,
4174  ae_int_t ib,
4175  ae_int_t jb,
4176  ae_state *_state);
4177 void rmatrixtranspose(ae_int_t m,
4178  ae_int_t n,
4179  /* Real */ ae_matrix* a,
4180  ae_int_t ia,
4181  ae_int_t ja,
4182  /* Real */ ae_matrix* b,
4183  ae_int_t ib,
4184  ae_int_t jb,
4185  ae_state *_state);
4186 void rmatrixenforcesymmetricity(/* Real */ ae_matrix* a,
4187  ae_int_t n,
4188  ae_bool isupper,
4189  ae_state *_state);
4190 void cmatrixcopy(ae_int_t m,
4191  ae_int_t n,
4192  /* Complex */ ae_matrix* a,
4193  ae_int_t ia,
4194  ae_int_t ja,
4195  /* Complex */ ae_matrix* b,
4196  ae_int_t ib,
4197  ae_int_t jb,
4198  ae_state *_state);
4199 void rmatrixcopy(ae_int_t m,
4200  ae_int_t n,
4201  /* Real */ ae_matrix* a,
4202  ae_int_t ia,
4203  ae_int_t ja,
4204  /* Real */ ae_matrix* b,
4205  ae_int_t ib,
4206  ae_int_t jb,
4207  ae_state *_state);
4208 void cmatrixrank1(ae_int_t m,
4209  ae_int_t n,
4210  /* Complex */ ae_matrix* a,
4211  ae_int_t ia,
4212  ae_int_t ja,
4213  /* Complex */ ae_vector* u,
4214  ae_int_t iu,
4215  /* Complex */ ae_vector* v,
4216  ae_int_t iv,
4217  ae_state *_state);
4218 void rmatrixrank1(ae_int_t m,
4219  ae_int_t n,
4220  /* Real */ ae_matrix* a,
4221  ae_int_t ia,
4222  ae_int_t ja,
4223  /* Real */ ae_vector* u,
4224  ae_int_t iu,
4225  /* Real */ ae_vector* v,
4226  ae_int_t iv,
4227  ae_state *_state);
4228 void cmatrixmv(ae_int_t m,
4229  ae_int_t n,
4230  /* Complex */ ae_matrix* a,
4231  ae_int_t ia,
4232  ae_int_t ja,
4233  ae_int_t opa,
4234  /* Complex */ ae_vector* x,
4235  ae_int_t ix,
4236  /* Complex */ ae_vector* y,
4237  ae_int_t iy,
4238  ae_state *_state);
4239 void rmatrixmv(ae_int_t m,
4240  ae_int_t n,
4241  /* Real */ ae_matrix* a,
4242  ae_int_t ia,
4243  ae_int_t ja,
4244  ae_int_t opa,
4245  /* Real */ ae_vector* x,
4246  ae_int_t ix,
4247  /* Real */ ae_vector* y,
4248  ae_int_t iy,
4249  ae_state *_state);
4250 void cmatrixrighttrsm(ae_int_t m,
4251  ae_int_t n,
4252  /* Complex */ ae_matrix* a,
4253  ae_int_t i1,
4254  ae_int_t j1,
4255  ae_bool isupper,
4256  ae_bool isunit,
4257  ae_int_t optype,
4258  /* Complex */ ae_matrix* x,
4259  ae_int_t i2,
4260  ae_int_t j2,
4261  ae_state *_state);
4263  ae_int_t n,
4264  /* Complex */ ae_matrix* a,
4265  ae_int_t i1,
4266  ae_int_t j1,
4267  ae_bool isupper,
4268  ae_bool isunit,
4269  ae_int_t optype,
4270  /* Complex */ ae_matrix* x,
4271  ae_int_t i2,
4272  ae_int_t j2, ae_state *_state);
4273 void cmatrixlefttrsm(ae_int_t m,
4274  ae_int_t n,
4275  /* Complex */ ae_matrix* a,
4276  ae_int_t i1,
4277  ae_int_t j1,
4278  ae_bool isupper,
4279  ae_bool isunit,
4280  ae_int_t optype,
4281  /* Complex */ ae_matrix* x,
4282  ae_int_t i2,
4283  ae_int_t j2,
4284  ae_state *_state);
4286  ae_int_t n,
4287  /* Complex */ ae_matrix* a,
4288  ae_int_t i1,
4289  ae_int_t j1,
4290  ae_bool isupper,
4291  ae_bool isunit,
4292  ae_int_t optype,
4293  /* Complex */ ae_matrix* x,
4294  ae_int_t i2,
4295  ae_int_t j2, ae_state *_state);
4296 void rmatrixrighttrsm(ae_int_t m,
4297  ae_int_t n,
4298  /* Real */ ae_matrix* a,
4299  ae_int_t i1,
4300  ae_int_t j1,
4301  ae_bool isupper,
4302  ae_bool isunit,
4303  ae_int_t optype,
4304  /* Real */ ae_matrix* x,
4305  ae_int_t i2,
4306  ae_int_t j2,
4307  ae_state *_state);
4309  ae_int_t n,
4310  /* Real */ ae_matrix* a,
4311  ae_int_t i1,
4312  ae_int_t j1,
4313  ae_bool isupper,
4314  ae_bool isunit,
4315  ae_int_t optype,
4316  /* Real */ ae_matrix* x,
4317  ae_int_t i2,
4318  ae_int_t j2, ae_state *_state);
4319 void rmatrixlefttrsm(ae_int_t m,
4320  ae_int_t n,
4321  /* Real */ ae_matrix* a,
4322  ae_int_t i1,
4323  ae_int_t j1,
4324  ae_bool isupper,
4325  ae_bool isunit,
4326  ae_int_t optype,
4327  /* Real */ ae_matrix* x,
4328  ae_int_t i2,
4329  ae_int_t j2,
4330  ae_state *_state);
4332  ae_int_t n,
4333  /* Real */ ae_matrix* a,
4334  ae_int_t i1,
4335  ae_int_t j1,
4336  ae_bool isupper,
4337  ae_bool isunit,
4338  ae_int_t optype,
4339  /* Real */ ae_matrix* x,
4340  ae_int_t i2,
4341  ae_int_t j2, ae_state *_state);
4342 void cmatrixsyrk(ae_int_t n,
4343  ae_int_t k,
4344  double alpha,
4345  /* Complex */ ae_matrix* a,
4346  ae_int_t ia,
4347  ae_int_t ja,
4348  ae_int_t optypea,
4349  double beta,
4350  /* Complex */ ae_matrix* c,
4351  ae_int_t ic,
4352  ae_int_t jc,
4353  ae_bool isupper,
4354  ae_state *_state);
4356  ae_int_t k,
4357  double alpha,
4358  /* Complex */ ae_matrix* a,
4359  ae_int_t ia,
4360  ae_int_t ja,
4361  ae_int_t optypea,
4362  double beta,
4363  /* Complex */ ae_matrix* c,
4364  ae_int_t ic,
4365  ae_int_t jc,
4366  ae_bool isupper, ae_state *_state);
4367 void rmatrixsyrk(ae_int_t n,
4368  ae_int_t k,
4369  double alpha,
4370  /* Real */ ae_matrix* a,
4371  ae_int_t ia,
4372  ae_int_t ja,
4373  ae_int_t optypea,
4374  double beta,
4375  /* Real */ ae_matrix* c,
4376  ae_int_t ic,
4377  ae_int_t jc,
4378  ae_bool isupper,
4379  ae_state *_state);
4381  ae_int_t k,
4382  double alpha,
4383  /* Real */ ae_matrix* a,
4384  ae_int_t ia,
4385  ae_int_t ja,
4386  ae_int_t optypea,
4387  double beta,
4388  /* Real */ ae_matrix* c,
4389  ae_int_t ic,
4390  ae_int_t jc,
4391  ae_bool isupper, ae_state *_state);
4392 void cmatrixgemm(ae_int_t m,
4393  ae_int_t n,
4394  ae_int_t k,
4395  ae_complex alpha,
4396  /* Complex */ ae_matrix* a,
4397  ae_int_t ia,
4398  ae_int_t ja,
4399  ae_int_t optypea,
4400  /* Complex */ ae_matrix* b,
4401  ae_int_t ib,
4402  ae_int_t jb,
4403  ae_int_t optypeb,
4404  ae_complex beta,
4405  /* Complex */ ae_matrix* c,
4406  ae_int_t ic,
4407  ae_int_t jc,
4408  ae_state *_state);
4410  ae_int_t n,
4411  ae_int_t k,
4412  ae_complex alpha,
4413  /* Complex */ ae_matrix* a,
4414  ae_int_t ia,
4415  ae_int_t ja,
4416  ae_int_t optypea,
4417  /* Complex */ ae_matrix* b,
4418  ae_int_t ib,
4419  ae_int_t jb,
4420  ae_int_t optypeb,
4421  ae_complex beta,
4422  /* Complex */ ae_matrix* c,
4423  ae_int_t ic,
4424  ae_int_t jc, ae_state *_state);
4425 void rmatrixgemm(ae_int_t m,
4426  ae_int_t n,
4427  ae_int_t k,
4428  double alpha,
4429  /* Real */ ae_matrix* a,
4430  ae_int_t ia,
4431  ae_int_t ja,
4432  ae_int_t optypea,
4433  /* Real */ ae_matrix* b,
4434  ae_int_t ib,
4435  ae_int_t jb,
4436  ae_int_t optypeb,
4437  double beta,
4438  /* Real */ ae_matrix* c,
4439  ae_int_t ic,
4440  ae_int_t jc,
4441  ae_state *_state);
4443  ae_int_t n,
4444  ae_int_t k,
4445  double alpha,
4446  /* Real */ ae_matrix* a,
4447  ae_int_t ia,
4448  ae_int_t ja,
4449  ae_int_t optypea,
4450  /* Real */ ae_matrix* b,
4451  ae_int_t ib,
4452  ae_int_t jb,
4453  ae_int_t optypeb,
4454  double beta,
4455  /* Real */ ae_matrix* c,
4456  ae_int_t ic,
4457  ae_int_t jc, ae_state *_state);
4458 void rmatrixqr(/* Real */ ae_matrix* a,
4459  ae_int_t m,
4460  ae_int_t n,
4461  /* Real */ ae_vector* tau,
4462  ae_state *_state);
4463 void rmatrixlq(/* Real */ ae_matrix* a,
4464  ae_int_t m,
4465  ae_int_t n,
4466  /* Real */ ae_vector* tau,
4467  ae_state *_state);
4468 void cmatrixqr(/* Complex */ ae_matrix* a,
4469  ae_int_t m,
4470  ae_int_t n,
4471  /* Complex */ ae_vector* tau,
4472  ae_state *_state);
4473 void cmatrixlq(/* Complex */ ae_matrix* a,
4474  ae_int_t m,
4475  ae_int_t n,
4476  /* Complex */ ae_vector* tau,
4477  ae_state *_state);
4478 void rmatrixqrunpackq(/* Real */ ae_matrix* a,
4479  ae_int_t m,
4480  ae_int_t n,
4481  /* Real */ ae_vector* tau,
4482  ae_int_t qcolumns,
4483  /* Real */ ae_matrix* q,
4484  ae_state *_state);
4485 void rmatrixqrunpackr(/* Real */ ae_matrix* a,
4486  ae_int_t m,
4487  ae_int_t n,
4488  /* Real */ ae_matrix* r,
4489  ae_state *_state);
4490 void rmatrixlqunpackq(/* Real */ ae_matrix* a,
4491  ae_int_t m,
4492  ae_int_t n,
4493  /* Real */ ae_vector* tau,
4494  ae_int_t qrows,
4495  /* Real */ ae_matrix* q,
4496  ae_state *_state);
4497 void rmatrixlqunpackl(/* Real */ ae_matrix* a,
4498  ae_int_t m,
4499  ae_int_t n,
4500  /* Real */ ae_matrix* l,
4501  ae_state *_state);
4502 void cmatrixqrunpackq(/* Complex */ ae_matrix* a,
4503  ae_int_t m,
4504  ae_int_t n,
4505  /* Complex */ ae_vector* tau,
4506  ae_int_t qcolumns,
4507  /* Complex */ ae_matrix* q,
4508  ae_state *_state);
4509 void cmatrixqrunpackr(/* Complex */ ae_matrix* a,
4510  ae_int_t m,
4511  ae_int_t n,
4512  /* Complex */ ae_matrix* r,
4513  ae_state *_state);
4514 void cmatrixlqunpackq(/* Complex */ ae_matrix* a,
4515  ae_int_t m,
4516  ae_int_t n,
4517  /* Complex */ ae_vector* tau,
4518  ae_int_t qrows,
4519  /* Complex */ ae_matrix* q,
4520  ae_state *_state);
4521 void cmatrixlqunpackl(/* Complex */ ae_matrix* a,
4522  ae_int_t m,
4523  ae_int_t n,
4524  /* Complex */ ae_matrix* l,
4525  ae_state *_state);
4526 void rmatrixqrbasecase(/* Real */ ae_matrix* a,
4527  ae_int_t m,
4528  ae_int_t n,
4529  /* Real */ ae_vector* work,
4530  /* Real */ ae_vector* t,
4531  /* Real */ ae_vector* tau,
4532  ae_state *_state);
4533 void rmatrixlqbasecase(/* Real */ ae_matrix* a,
4534  ae_int_t m,
4535  ae_int_t n,
4536  /* Real */ ae_vector* work,
4537  /* Real */ ae_vector* t,
4538  /* Real */ ae_vector* tau,
4539  ae_state *_state);
4540 void rmatrixbd(/* Real */ ae_matrix* a,
4541  ae_int_t m,
4542  ae_int_t n,
4543  /* Real */ ae_vector* tauq,
4544  /* Real */ ae_vector* taup,
4545  ae_state *_state);
4546 void rmatrixbdunpackq(/* Real */ ae_matrix* qp,
4547  ae_int_t m,
4548  ae_int_t n,
4549  /* Real */ ae_vector* tauq,
4550  ae_int_t qcolumns,
4551  /* Real */ ae_matrix* q,
4552  ae_state *_state);
4553 void rmatrixbdmultiplybyq(/* Real */ ae_matrix* qp,
4554  ae_int_t m,
4555  ae_int_t n,
4556  /* Real */ ae_vector* tauq,
4557  /* Real */ ae_matrix* z,
4558  ae_int_t zrows,
4559  ae_int_t zcolumns,
4560  ae_bool fromtheright,
4561  ae_bool dotranspose,
4562  ae_state *_state);
4563 void rmatrixbdunpackpt(/* Real */ ae_matrix* qp,
4564  ae_int_t m,
4565  ae_int_t n,
4566  /* Real */ ae_vector* taup,
4567  ae_int_t ptrows,
4568  /* Real */ ae_matrix* pt,
4569  ae_state *_state);
4570 void rmatrixbdmultiplybyp(/* Real */ ae_matrix* qp,
4571  ae_int_t m,
4572  ae_int_t n,
4573  /* Real */ ae_vector* taup,
4574  /* Real */ ae_matrix* z,
4575  ae_int_t zrows,
4576  ae_int_t zcolumns,
4577  ae_bool fromtheright,
4578  ae_bool dotranspose,
4579  ae_state *_state);
4580 void rmatrixbdunpackdiagonals(/* Real */ ae_matrix* b,
4581  ae_int_t m,
4582  ae_int_t n,
4583  ae_bool* isupper,
4584  /* Real */ ae_vector* d,
4585  /* Real */ ae_vector* e,
4586  ae_state *_state);
4587 void rmatrixhessenberg(/* Real */ ae_matrix* a,
4588  ae_int_t n,
4589  /* Real */ ae_vector* tau,
4590  ae_state *_state);
4591 void rmatrixhessenbergunpackq(/* Real */ ae_matrix* a,
4592  ae_int_t n,
4593  /* Real */ ae_vector* tau,
4594  /* Real */ ae_matrix* q,
4595  ae_state *_state);
4596 void rmatrixhessenbergunpackh(/* Real */ ae_matrix* a,
4597  ae_int_t n,
4598  /* Real */ ae_matrix* h,
4599  ae_state *_state);
4600 void smatrixtd(/* Real */ ae_matrix* a,
4601  ae_int_t n,
4602  ae_bool isupper,
4603  /* Real */ ae_vector* tau,
4604  /* Real */ ae_vector* d,
4605  /* Real */ ae_vector* e,
4606  ae_state *_state);
4607 void smatrixtdunpackq(/* Real */ ae_matrix* a,
4608  ae_int_t n,
4609  ae_bool isupper,
4610  /* Real */ ae_vector* tau,
4611  /* Real */ ae_matrix* q,
4612  ae_state *_state);
4613 void hmatrixtd(/* Complex */ ae_matrix* a,
4614  ae_int_t n,
4615  ae_bool isupper,
4616  /* Complex */ ae_vector* tau,
4617  /* Real */ ae_vector* d,
4618  /* Real */ ae_vector* e,
4619  ae_state *_state);
4620 void hmatrixtdunpackq(/* Complex */ ae_matrix* a,
4621  ae_int_t n,
4622  ae_bool isupper,
4623  /* Complex */ ae_vector* tau,
4624  /* Complex */ ae_matrix* q,
4625  ae_state *_state);
4626 ae_bool rmatrixbdsvd(/* Real */ ae_vector* d,
4627  /* Real */ ae_vector* e,
4628  ae_int_t n,
4629  ae_bool isupper,
4630  ae_bool isfractionalaccuracyrequired,
4631  /* Real */ ae_matrix* u,
4632  ae_int_t nru,
4633  /* Real */ ae_matrix* c,
4634  ae_int_t ncc,
4635  /* Real */ ae_matrix* vt,
4636  ae_int_t ncvt,
4637  ae_state *_state);
4639  /* Real */ ae_vector* e,
4640  ae_int_t n,
4641  ae_bool isupper,
4642  ae_bool isfractionalaccuracyrequired,
4643  /* Real */ ae_matrix* u,
4644  ae_int_t nru,
4645  /* Real */ ae_matrix* c,
4646  ae_int_t ncc,
4647  /* Real */ ae_matrix* vt,
4648  ae_int_t ncvt,
4649  ae_state *_state);
4650 ae_bool rmatrixsvd(/* Real */ ae_matrix* a,
4651  ae_int_t m,
4652  ae_int_t n,
4653  ae_int_t uneeded,
4654  ae_int_t vtneeded,
4655  ae_int_t additionalmemory,
4656  /* Real */ ae_vector* w,
4657  /* Real */ ae_matrix* u,
4658  /* Real */ ae_matrix* vt,
4659  ae_state *_state);
4660 ae_bool smatrixevd(/* Real */ ae_matrix* a,
4661  ae_int_t n,
4662  ae_int_t zneeded,
4663  ae_bool isupper,
4664  /* Real */ ae_vector* d,
4665  /* Real */ ae_matrix* z,
4666  ae_state *_state);
4667 ae_bool smatrixevdr(/* Real */ ae_matrix* a,
4668  ae_int_t n,
4669  ae_int_t zneeded,
4670  ae_bool isupper,
4671  double b1,
4672  double b2,
4673  ae_int_t* m,
4674  /* Real */ ae_vector* w,
4675  /* Real */ ae_matrix* z,
4676  ae_state *_state);
4677 ae_bool smatrixevdi(/* Real */ ae_matrix* a,
4678  ae_int_t n,
4679  ae_int_t zneeded,
4680  ae_bool isupper,
4681  ae_int_t i1,
4682  ae_int_t i2,
4683  /* Real */ ae_vector* w,
4684  /* Real */ ae_matrix* z,
4685  ae_state *_state);
4686 ae_bool hmatrixevd(/* Complex */ ae_matrix* a,
4687  ae_int_t n,
4688  ae_int_t zneeded,
4689  ae_bool isupper,
4690  /* Real */ ae_vector* d,
4691  /* Complex */ ae_matrix* z,
4692  ae_state *_state);
4693 ae_bool hmatrixevdr(/* Complex */ ae_matrix* a,
4694  ae_int_t n,
4695  ae_int_t zneeded,
4696  ae_bool isupper,
4697  double b1,
4698  double b2,
4699  ae_int_t* m,
4700  /* Real */ ae_vector* w,
4701  /* Complex */ ae_matrix* z,
4702  ae_state *_state);
4703 ae_bool hmatrixevdi(/* Complex */ ae_matrix* a,
4704  ae_int_t n,
4705  ae_int_t zneeded,
4706  ae_bool isupper,
4707  ae_int_t i1,
4708  ae_int_t i2,
4709  /* Real */ ae_vector* w,
4710  /* Complex */ ae_matrix* z,
4711  ae_state *_state);
4712 ae_bool smatrixtdevd(/* Real */ ae_vector* d,
4713  /* Real */ ae_vector* e,
4714  ae_int_t n,
4715  ae_int_t zneeded,
4716  /* Real */ ae_matrix* z,
4717  ae_state *_state);
4718 ae_bool smatrixtdevdr(/* Real */ ae_vector* d,
4719  /* Real */ ae_vector* e,
4720  ae_int_t n,
4721  ae_int_t zneeded,
4722  double a,
4723  double b,
4724  ae_int_t* m,
4725  /* Real */ ae_matrix* z,
4726  ae_state *_state);
4727 ae_bool smatrixtdevdi(/* Real */ ae_vector* d,
4728  /* Real */ ae_vector* e,
4729  ae_int_t n,
4730  ae_int_t zneeded,
4731  ae_int_t i1,
4732  ae_int_t i2,
4733  /* Real */ ae_matrix* z,
4734  ae_state *_state);
4735 ae_bool rmatrixevd(/* Real */ ae_matrix* a,
4736  ae_int_t n,
4737  ae_int_t vneeded,
4738  /* Real */ ae_vector* wr,
4739  /* Real */ ae_vector* wi,
4740  /* Real */ ae_matrix* vl,
4741  /* Real */ ae_matrix* vr,
4742  ae_state *_state);
4744  /* Real */ ae_matrix* a,
4745  ae_state *_state);
4746 void rmatrixrndcond(ae_int_t n,
4747  double c,
4748  /* Real */ ae_matrix* a,
4749  ae_state *_state);
4751  /* Complex */ ae_matrix* a,
4752  ae_state *_state);
4753 void cmatrixrndcond(ae_int_t n,
4754  double c,
4755  /* Complex */ ae_matrix* a,
4756  ae_state *_state);
4757 void smatrixrndcond(ae_int_t n,
4758  double c,
4759  /* Real */ ae_matrix* a,
4760  ae_state *_state);
4761 void spdmatrixrndcond(ae_int_t n,
4762  double c,
4763  /* Real */ ae_matrix* a,
4764  ae_state *_state);
4765 void hmatrixrndcond(ae_int_t n,
4766  double c,
4767  /* Complex */ ae_matrix* a,
4768  ae_state *_state);
4769 void hpdmatrixrndcond(ae_int_t n,
4770  double c,
4771  /* Complex */ ae_matrix* a,
4772  ae_state *_state);
4773 void rmatrixrndorthogonalfromtheright(/* Real */ ae_matrix* a,
4774  ae_int_t m,
4775  ae_int_t n,
4776  ae_state *_state);
4777 void rmatrixrndorthogonalfromtheleft(/* Real */ ae_matrix* a,
4778  ae_int_t m,
4779  ae_int_t n,
4780  ae_state *_state);
4781 void cmatrixrndorthogonalfromtheright(/* Complex */ ae_matrix* a,
4782  ae_int_t m,
4783  ae_int_t n,
4784  ae_state *_state);
4785 void cmatrixrndorthogonalfromtheleft(/* Complex */ ae_matrix* a,
4786  ae_int_t m,
4787  ae_int_t n,
4788  ae_state *_state);
4789 void smatrixrndmultiply(/* Real */ ae_matrix* a,
4790  ae_int_t n,
4791  ae_state *_state);
4792 void hmatrixrndmultiply(/* Complex */ ae_matrix* a,
4793  ae_int_t n,
4794  ae_state *_state);
4795 void rmatrixlu(/* Real */ ae_matrix* a,
4796  ae_int_t m,
4797  ae_int_t n,
4798  /* Integer */ ae_vector* pivots,
4799  ae_state *_state);
4800 void cmatrixlu(/* Complex */ ae_matrix* a,
4801  ae_int_t m,
4802  ae_int_t n,
4803  /* Integer */ ae_vector* pivots,
4804  ae_state *_state);
4805 ae_bool hpdmatrixcholesky(/* Complex */ ae_matrix* a,
4806  ae_int_t n,
4807  ae_bool isupper,
4808  ae_state *_state);
4809 ae_bool spdmatrixcholesky(/* Real */ ae_matrix* a,
4810  ae_int_t n,
4811  ae_bool isupper,
4812  ae_state *_state);
4813 void rmatrixlup(/* Real */ ae_matrix* a,
4814  ae_int_t m,
4815  ae_int_t n,
4816  /* Integer */ ae_vector* pivots,
4817  ae_state *_state);
4818 void cmatrixlup(/* Complex */ ae_matrix* a,
4819  ae_int_t m,
4820  ae_int_t n,
4821  /* Integer */ ae_vector* pivots,
4822  ae_state *_state);
4823 void rmatrixplu(/* Real */ ae_matrix* a,
4824  ae_int_t m,
4825  ae_int_t n,
4826  /* Integer */ ae_vector* pivots,
4827  ae_state *_state);
4828 void cmatrixplu(/* Complex */ ae_matrix* a,
4829  ae_int_t m,
4830  ae_int_t n,
4831  /* Integer */ ae_vector* pivots,
4832  ae_state *_state);
4833 ae_bool spdmatrixcholeskyrec(/* Real */ ae_matrix* a,
4834  ae_int_t offs,
4835  ae_int_t n,
4836  ae_bool isupper,
4837  /* Real */ ae_vector* tmp,
4838  ae_state *_state);
4839 double rmatrixrcond1(/* Real */ ae_matrix* a,
4840  ae_int_t n,
4841  ae_state *_state);
4842 double rmatrixrcondinf(/* Real */ ae_matrix* a,
4843  ae_int_t n,
4844  ae_state *_state);
4845 double spdmatrixrcond(/* Real */ ae_matrix* a,
4846  ae_int_t n,
4847  ae_bool isupper,
4848  ae_state *_state);
4849 double rmatrixtrrcond1(/* Real */ ae_matrix* a,
4850  ae_int_t n,
4851  ae_bool isupper,
4852  ae_bool isunit,
4853  ae_state *_state);
4854 double rmatrixtrrcondinf(/* Real */ ae_matrix* a,
4855  ae_int_t n,
4856  ae_bool isupper,
4857  ae_bool isunit,
4858  ae_state *_state);
4859 double hpdmatrixrcond(/* Complex */ ae_matrix* a,
4860  ae_int_t n,
4861  ae_bool isupper,
4862  ae_state *_state);
4863 double cmatrixrcond1(/* Complex */ ae_matrix* a,
4864  ae_int_t n,
4865  ae_state *_state);
4866 double cmatrixrcondinf(/* Complex */ ae_matrix* a,
4867  ae_int_t n,
4868  ae_state *_state);
4869 double rmatrixlurcond1(/* Real */ ae_matrix* lua,
4870  ae_int_t n,
4871  ae_state *_state);
4872 double rmatrixlurcondinf(/* Real */ ae_matrix* lua,
4873  ae_int_t n,
4874  ae_state *_state);
4875 double spdmatrixcholeskyrcond(/* Real */ ae_matrix* a,
4876  ae_int_t n,
4877  ae_bool isupper,
4878  ae_state *_state);
4879 double hpdmatrixcholeskyrcond(/* Complex */ ae_matrix* a,
4880  ae_int_t n,
4881  ae_bool isupper,
4882  ae_state *_state);
4883 double cmatrixlurcond1(/* Complex */ ae_matrix* lua,
4884  ae_int_t n,
4885  ae_state *_state);
4886 double cmatrixlurcondinf(/* Complex */ ae_matrix* lua,
4887  ae_int_t n,
4888  ae_state *_state);
4889 double cmatrixtrrcond1(/* Complex */ ae_matrix* a,
4890  ae_int_t n,
4891  ae_bool isupper,
4892  ae_bool isunit,
4893  ae_state *_state);
4894 double cmatrixtrrcondinf(/* Complex */ ae_matrix* a,
4895  ae_int_t n,
4896  ae_bool isupper,
4897  ae_bool isunit,
4898  ae_state *_state);
4899 double rcondthreshold(ae_state *_state);
4900 void rmatrixluinverse(/* Real */ ae_matrix* a,
4901  /* Integer */ ae_vector* pivots,
4902  ae_int_t n,
4903  ae_int_t* info,
4904  matinvreport* rep,
4905  ae_state *_state);
4906 void rmatrixinverse(/* Real */ ae_matrix* a,
4907  ae_int_t n,
4908  ae_int_t* info,
4909  matinvreport* rep,
4910  ae_state *_state);
4911 void cmatrixluinverse(/* Complex */ ae_matrix* a,
4912  /* Integer */ ae_vector* pivots,
4913  ae_int_t n,
4914  ae_int_t* info,
4915  matinvreport* rep,
4916  ae_state *_state);
4917 void cmatrixinverse(/* Complex */ ae_matrix* a,
4918  ae_int_t n,
4919  ae_int_t* info,
4920  matinvreport* rep,
4921  ae_state *_state);
4922 void spdmatrixcholeskyinverse(/* Real */ ae_matrix* a,
4923  ae_int_t n,
4924  ae_bool isupper,
4925  ae_int_t* info,
4926  matinvreport* rep,
4927  ae_state *_state);
4928 void spdmatrixinverse(/* Real */ ae_matrix* a,
4929  ae_int_t n,
4930  ae_bool isupper,
4931  ae_int_t* info,
4932  matinvreport* rep,
4933  ae_state *_state);
4934 void hpdmatrixcholeskyinverse(/* Complex */ ae_matrix* a,
4935  ae_int_t n,
4936  ae_bool isupper,
4937  ae_int_t* info,
4938  matinvreport* rep,
4939  ae_state *_state);
4940 void hpdmatrixinverse(/* Complex */ ae_matrix* a,
4941  ae_int_t n,
4942  ae_bool isupper,
4943  ae_int_t* info,
4944  matinvreport* rep,
4945  ae_state *_state);
4946 void rmatrixtrinverse(/* Real */ ae_matrix* a,
4947  ae_int_t n,
4948  ae_bool isupper,
4949  ae_bool isunit,
4950  ae_int_t* info,
4951  matinvreport* rep,
4952  ae_state *_state);
4953 void cmatrixtrinverse(/* Complex */ ae_matrix* a,
4954  ae_int_t n,
4955  ae_bool isupper,
4956  ae_bool isunit,
4957  ae_int_t* info,
4958  matinvreport* rep,
4959  ae_state *_state);
4960 ae_bool _matinvreport_init(void* _p, ae_state *_state, ae_bool make_automatic);
4961 ae_bool _matinvreport_init_copy(void* _dst, void* _src, ae_state *_state, ae_bool make_automatic);
4962 void _matinvreport_clear(void* _p);
4963 void _matinvreport_destroy(void* _p);
4964 void sparsecreate(ae_int_t m,
4965  ae_int_t n,
4966  ae_int_t k,
4967  sparsematrix* s,
4968  ae_state *_state);
4969 void sparsecreatecrs(ae_int_t m,
4970  ae_int_t n,
4971  /* Integer */ ae_vector* ner,
4972  sparsematrix* s,
4973  ae_state *_state);
4974 void sparsecopy(sparsematrix* s0, sparsematrix* s1, ae_state *_state);
4975 void sparseadd(sparsematrix* s,
4976  ae_int_t i,
4977  ae_int_t j,
4978  double v,
4979  ae_state *_state);
4980 void sparseset(sparsematrix* s,
4981  ae_int_t i,
4982  ae_int_t j,
4983  double v,
4984  ae_state *_state);
4985 double sparseget(sparsematrix* s,
4986  ae_int_t i,
4987  ae_int_t j,
4988  ae_state *_state);
4989 double sparsegetdiagonal(sparsematrix* s, ae_int_t i, ae_state *_state);
4990 void sparseconverttocrs(sparsematrix* s, ae_state *_state);
4991 void sparsemv(sparsematrix* s,
4992  /* Real */ ae_vector* x,
4993  /* Real */ ae_vector* y,
4994  ae_state *_state);
4995 void sparsemtv(sparsematrix* s,
4996  /* Real */ ae_vector* x,
4997  /* Real */ ae_vector* y,
4998  ae_state *_state);
4999 void sparsemv2(sparsematrix* s,
5000  /* Real */ ae_vector* x,
5001  /* Real */ ae_vector* y0,
5002  /* Real */ ae_vector* y1,
5003  ae_state *_state);
5004 void sparsesmv(sparsematrix* s,
5005  ae_bool isupper,
5006  /* Real */ ae_vector* x,
5007  /* Real */ ae_vector* y,
5008  ae_state *_state);
5009 void sparsemm(sparsematrix* s,
5010  /* Real */ ae_matrix* a,
5011  ae_int_t k,
5012  /* Real */ ae_matrix* b,
5013  ae_state *_state);
5014 void sparsemtm(sparsematrix* s,
5015  /* Real */ ae_matrix* a,
5016  ae_int_t k,
5017  /* Real */ ae_matrix* b,
5018  ae_state *_state);
5019 void sparsemm2(sparsematrix* s,
5020  /* Real */ ae_matrix* a,
5021  ae_int_t k,
5022  /* Real */ ae_matrix* b0,
5023  /* Real */ ae_matrix* b1,
5024  ae_state *_state);
5025 void sparsesmm(sparsematrix* s,
5026  ae_bool isupper,
5027  /* Real */ ae_matrix* a,
5028  ae_int_t k,
5029  /* Real */ ae_matrix* b,
5030  ae_state *_state);
5031 void sparseresizematrix(sparsematrix* s, ae_state *_state);
5034  ae_int_t* t0,
5035  ae_int_t* t1,
5036  ae_int_t* i,
5037  ae_int_t* j,
5038  double* v,
5039  ae_state *_state);
5041  ae_int_t i,
5042  ae_int_t j,
5043  double v,
5044  ae_state *_state);
5045 void sparsegetrow(sparsematrix* s,
5046  ae_int_t i,
5047  /* Real */ ae_vector* irow,
5048  ae_state *_state);
5049 void sparseconverttohash(sparsematrix* s, ae_state *_state);
5051  sparsematrix* s1,
5052  ae_state *_state);
5053 void sparsecopytocrs(sparsematrix* s0, sparsematrix* s1, ae_state *_state);
5057 void sparsefree(sparsematrix* s, ae_state *_state);
5060 ae_bool _sparsematrix_init(void* _p, ae_state *_state, ae_bool make_automatic);
5061 ae_bool _sparsematrix_init_copy(void* _dst, void* _src, ae_state *_state, ae_bool make_automatic);
5062 void _sparsematrix_clear(void* _p);
5063 void _sparsematrix_destroy(void* _p);
5064 void fblscholeskysolve(/* Real */ ae_matrix* cha,
5065  double sqrtscalea,
5066  ae_int_t n,
5067  ae_bool isupper,
5068  /* Real */ ae_vector* xb,
5069  /* Real */ ae_vector* tmp,
5070  ae_state *_state);
5071 void fblssolvecgx(/* Real */ ae_matrix* a,
5072  ae_int_t m,
5073  ae_int_t n,
5074  double alpha,
5075  /* Real */ ae_vector* b,
5076  /* Real */ ae_vector* x,
5077  /* Real */ ae_vector* buf,
5078  ae_state *_state);
5079 void fblscgcreate(/* Real */ ae_vector* x,
5080  /* Real */ ae_vector* b,
5081  ae_int_t n,
5082  fblslincgstate* state,
5083  ae_state *_state);
5084 ae_bool fblscgiteration(fblslincgstate* state, ae_state *_state);
5085 void fblssolvels(/* Real */ ae_matrix* a,
5086  /* Real */ ae_vector* b,
5087  ae_int_t m,
5088  ae_int_t n,
5089  /* Real */ ae_vector* tmp0,
5090  /* Real */ ae_vector* tmp1,
5091  /* Real */ ae_vector* tmp2,
5092  ae_state *_state);
5093 ae_bool _fblslincgstate_init(void* _p, ae_state *_state, ae_bool make_automatic);
5094 ae_bool _fblslincgstate_init_copy(void* _dst, void* _src, ae_state *_state, ae_bool make_automatic);
5095 void _fblslincgstate_clear(void* _p);
5096 void _fblslincgstate_destroy(void* _p);
5098  ae_int_t n,
5099  ae_int_t nstart,
5100  ae_int_t nits,
5101  normestimatorstate* state,
5102  ae_state *_state);
5104  ae_int_t seedval,
5105  ae_state *_state);
5107  ae_state *_state);
5109  sparsematrix* a,
5110  ae_state *_state);
5112  double* nrm,
5113  ae_state *_state);
5114 void normestimatorrestart(normestimatorstate* state, ae_state *_state);
5115 ae_bool _normestimatorstate_init(void* _p, ae_state *_state, ae_bool make_automatic);
5116 ae_bool _normestimatorstate_init_copy(void* _dst, void* _src, ae_state *_state, ae_bool make_automatic);
5117 void _normestimatorstate_clear(void* _p);
5118 void _normestimatorstate_destroy(void* _p);
5119 double rmatrixludet(/* Real */ ae_matrix* a,
5120  /* Integer */ ae_vector* pivots,
5121  ae_int_t n,
5122  ae_state *_state);
5123 double rmatrixdet(/* Real */ ae_matrix* a,
5124  ae_int_t n,
5125  ae_state *_state);
5126 ae_complex cmatrixludet(/* Complex */ ae_matrix* a,
5127  /* Integer */ ae_vector* pivots,
5128  ae_int_t n,
5129  ae_state *_state);
5130 ae_complex cmatrixdet(/* Complex */ ae_matrix* a,
5131  ae_int_t n,
5132  ae_state *_state);
5133 double spdmatrixcholeskydet(/* Real */ ae_matrix* a,
5134  ae_int_t n,
5135  ae_state *_state);
5136 double spdmatrixdet(/* Real */ ae_matrix* a,
5137  ae_int_t n,
5138  ae_bool isupper,
5139  ae_state *_state);
5140 ae_bool smatrixgevd(/* Real */ ae_matrix* a,
5141  ae_int_t n,
5142  ae_bool isuppera,
5143  /* Real */ ae_matrix* b,
5144  ae_bool isupperb,
5145  ae_int_t zneeded,
5146  ae_int_t problemtype,
5147  /* Real */ ae_vector* d,
5148  /* Real */ ae_matrix* z,
5149  ae_state *_state);
5150 ae_bool smatrixgevdreduce(/* Real */ ae_matrix* a,
5151  ae_int_t n,
5152  ae_bool isuppera,
5153  /* Real */ ae_matrix* b,
5154  ae_bool isupperb,
5155  ae_int_t problemtype,
5156  /* Real */ ae_matrix* r,
5157  ae_bool* isupperr,
5158  ae_state *_state);
5159 void rmatrixinvupdatesimple(/* Real */ ae_matrix* inva,
5160  ae_int_t n,
5161  ae_int_t updrow,
5162  ae_int_t updcolumn,
5163  double updval,
5164  ae_state *_state);
5165 void rmatrixinvupdaterow(/* Real */ ae_matrix* inva,
5166  ae_int_t n,
5167  ae_int_t updrow,
5168  /* Real */ ae_vector* v,
5169  ae_state *_state);
5170 void rmatrixinvupdatecolumn(/* Real */ ae_matrix* inva,
5171  ae_int_t n,
5172  ae_int_t updcolumn,
5173  /* Real */ ae_vector* u,
5174  ae_state *_state);
5175 void rmatrixinvupdateuv(/* Real */ ae_matrix* inva,
5176  ae_int_t n,
5177  /* Real */ ae_vector* u,
5178  /* Real */ ae_vector* v,
5179  ae_state *_state);
5180 ae_bool rmatrixschur(/* Real */ ae_matrix* a,
5181  ae_int_t n,
5182  /* Real */ ae_matrix* s,
5183  ae_state *_state);
5184 
5185 }
5186 #endif
5187 
void smp_rmatrixlefttrsm(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const real_2d_array &x, const ae_int_t i2, const ae_int_t j2)
Definition: linalg.cpp:463
void hpdmatrixrndcond(ae_int_t n, double c, ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:22083
void cmatrixlu(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *pivots, ae_state *_state)
Definition: linalg.cpp:22816
ae_bool spdmatrixcholesky(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:22913
void smp_cmatrixgemm(const ae_int_t m, const ae_int_t n, const ae_int_t k, const alglib::complex alpha, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const complex_2d_array &b, const ae_int_t ib, const ae_int_t jb, const ae_int_t optypeb, const alglib::complex beta, const complex_2d_array &c, const ae_int_t ic, const ae_int_t jc)
Definition: linalg.cpp:571
struct alglib_impl::ae_state ae_state
double beta(double a, double b, ae_state *_state)
double rmatrixrcond1(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:24306
double rmatrixrcondinf(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:24369
ae_int_t ablasblocksize(ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:7695
double sparseget(sparsematrix *s, ae_int_t i, ae_int_t j, ae_state *_state)
Definition: linalg.cpp:29561
double cmatrixtrrcondinf(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_bool isunit, ae_state *_state)
Definition: linalg.cpp:25184
void smp_rmatrixgemm(const ae_int_t m, const ae_int_t n, const ae_int_t k, const double alpha, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const real_2d_array &b, const ae_int_t ib, const ae_int_t jb, const ae_int_t optypeb, const double beta, const real_2d_array &c, const ae_int_t ic, const ae_int_t jc)
Definition: linalg.cpp:607
alglib_impl::matinvreport * p_struct
Definition: linalg.h:130
void rmatrixlqunpackq(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tau, ae_int_t qrows, ae_matrix *q, ae_state *_state)
Definition: linalg.cpp:11152
ae_bool _fblslincgstate_init(void *_p, ae_state *_state, ae_bool make_automatic)
Definition: linalg.cpp:32087
ae_bool bidiagonalsvddecomposition(ae_vector *d, ae_vector *e, ae_int_t n, ae_bool isupper, ae_bool isfractionalaccuracyrequired, ae_matrix *u, ae_int_t nru, ae_matrix *c, ae_int_t ncc, ae_matrix *vt, ae_int_t ncvt, ae_state *_state)
Definition: linalg.cpp:13893
double spdmatrixcholeskydet(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:32839
void sparsecopy(sparsematrix *s0, sparsematrix *s1, ae_state *_state)
Definition: linalg.cpp:29262
void ablascomplexsplitlength(ae_matrix *a, ae_int_t n, ae_int_t *n1, ae_int_t *n2, ae_state *_state)
Definition: linalg.cpp:7661
ae_bool normestimatoriteration(normestimatorstate *state, ae_state *_state)
Definition: linalg.cpp:32286
ae_int_t sparsegetnrows(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:31194
void rmatrixqr(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tau, ae_state *_state)
Definition: linalg.cpp:10371
void rmatrixgemm(ae_int_t m, ae_int_t n, ae_int_t k, double alpha, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t optypea, ae_matrix *b, ae_int_t ib, ae_int_t jb, ae_int_t optypeb, double beta, ae_matrix *c, ae_int_t ic, ae_int_t jc, ae_state *_state)
Definition: linalg.cpp:9104
void cmatrixlq(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tau, ae_state *_state)
Definition: linalg.cpp:10810
void sparsemv(sparsematrix *s, ae_vector *x, ae_vector *y, ae_state *_state)
Definition: linalg.cpp:29804
void rmatrixbdmultiplybyp(ae_matrix *qp, ae_int_t m, ae_int_t n, ae_vector *taup, ae_matrix *z, ae_int_t zrows, ae_int_t zcolumns, ae_bool fromtheright, ae_bool dotranspose, ae_state *_state)
Definition: linalg.cpp:12368
void rmatrixbdunpackdiagonals(ae_matrix *b, ae_int_t m, ae_int_t n, ae_bool *isupper, ae_vector *d, ae_vector *e, ae_state *_state)
Definition: linalg.cpp:12529
void hmatrixtdunpackq(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *tau, ae_matrix *q, ae_state *_state)
Definition: linalg.cpp:13368
void smp_cmatrixsyrk(const ae_int_t n, const ae_int_t k, const double alpha, const complex_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const double beta, const complex_2d_array &c, const ae_int_t ic, const ae_int_t jc, const bool isupper)
Definition: linalg.cpp:499
void sparseresizematrix(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:30498
doublereal * c
void normestimatorsetseed(normestimatorstate *state, ae_int_t seedval, ae_state *_state)
Definition: linalg.cpp:32270
ae_bool smatrixevdr(ae_matrix *a, ae_int_t n, ae_int_t zneeded, ae_bool isupper, double b1, double b2, ae_int_t *m, ae_vector *w, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:15539
void _normestimatorstate_clear(void *_p)
Definition: linalg.cpp:32601
ae_bool hmatrixevdi(ae_matrix *a, ae_int_t n, ae_int_t zneeded, ae_bool isupper, ae_int_t i1, ae_int_t i2, ae_vector *w, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:15977
ae_bool _sparsematrix_init(void *_p, ae_state *_state, ae_bool make_automatic)
Definition: linalg.cpp:31297
void _sparsematrix_clear(void *_p)
Definition: linalg.cpp:31338
void cmatrixrighttrsm(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t i1, ae_int_t j1, ae_bool isupper, ae_bool isunit, ae_int_t optype, ae_matrix *x, ae_int_t i2, ae_int_t j2, ae_state *_state)
Definition: linalg.cpp:8276
void _pexec_rmatrixlefttrsm(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t i1, ae_int_t j1, ae_bool isupper, ae_bool isunit, ae_int_t optype, ae_matrix *x, ae_int_t i2, ae_int_t j2, ae_state *_state)
Definition: linalg.cpp:8739
static double * y
void normestimatorresults(normestimatorstate *state, double *nrm, ae_state *_state)
Definition: linalg.cpp:32511
void _pexec_rmatrixsyrk(ae_int_t n, ae_int_t k, double alpha, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t optypea, double beta, ae_matrix *c, ae_int_t ic, ae_int_t jc, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:8954
ae_bool hpdmatrixcholesky(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:22860
ae_int_t ablascomplexblocksize(ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:7712
ae_bool smatrixgevdreduce(ae_matrix *a, ae_int_t n, ae_bool isuppera, ae_matrix *b, ae_bool isupperb, ae_int_t problemtype, ae_matrix *r, ae_bool *isupperr, ae_state *_state)
Definition: linalg.cpp:33129
alglib_impl::sparsematrix * p_struct
Definition: linalg.h:160
void smatrixrndmultiply(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:22561
ae_bool rmatrixschur(ae_matrix *a, ae_int_t n, ae_matrix *s, ae_state *_state)
Definition: linalg.cpp:33736
double rmatrixdet(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:32701
void rmatrixlup(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *pivots, ae_state *_state)
Definition: linalg.cpp:22937
doublereal * w
void cmatrixlqunpackq(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tau, ae_int_t qrows, ae_matrix *q, ae_state *_state)
Definition: linalg.cpp:11557
void rmatrixlefttrsm(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t i1, ae_int_t j1, ae_bool isupper, ae_bool isunit, ae_int_t optype, ae_matrix *x, ae_int_t i2, ae_int_t j2, ae_state *_state)
Definition: linalg.cpp:8639
void _pexec_rmatrixgemm(ae_int_t m, ae_int_t n, ae_int_t k, double alpha, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t optypea, ae_matrix *b, ae_int_t ib, ae_int_t jb, ae_int_t optypeb, double beta, ae_matrix *c, ae_int_t ic, ae_int_t jc, ae_state *_state)
Definition: linalg.cpp:9233
void sparsemtv(sparsematrix *s, ae_vector *x, ae_vector *y, ae_state *_state)
Definition: linalg.cpp:29858
double cmatrixlurcond1(ae_matrix *lua, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:25033
void cmatrixqr(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tau, ae_state *_state)
Definition: linalg.cpp:10668
ae_bool _matinvreport_init_copy(void *_dst, void *_src, ae_state *_state, ae_bool make_automatic)
Definition: linalg.cpp:29018
void cmatrixmv(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t opa, ae_vector *x, ae_int_t ix, ae_vector *y, ae_int_t iy, ae_state *_state)
Definition: linalg.cpp:8100
void rmatrixinvupdaterow(ae_matrix *inva, ae_int_t n, ae_int_t updrow, ae_vector *v, ae_state *_state)
Definition: linalg.cpp:33502
void sparsesmm(sparsematrix *s, ae_bool isupper, ae_matrix *a, ae_int_t k, ae_matrix *b, ae_state *_state)
Definition: linalg.cpp:30377
double rmatrixludet(ae_matrix *a, ae_vector *pivots, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:32655
void sparsemtm(sparsematrix *s, ae_matrix *a, ae_int_t k, ae_matrix *b, ae_state *_state)
Definition: linalg.cpp:30177
void rmatrixhessenberg(ae_matrix *a, ae_int_t n, ae_vector *tau, ae_state *_state)
Definition: linalg.cpp:12607
ae_bool sparserewriteexisting(sparsematrix *s, ae_int_t i, ae_int_t j, double v, ae_state *_state)
Definition: linalg.cpp:30748
void sparseconverttocrs(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:29687
double spdmatrixdet(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:32893
void cmatrixrndcond(ae_int_t n, double c, ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:21787
void _fblslincgstate_destroy(void *_p)
Definition: linalg.cpp:32169
ae_int_t sparsegetmatrixtype(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:31102
void rmatrixenforcesymmetricity(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:7872
void cmatrixplu(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *pivots, ae_state *_state)
Definition: linalg.cpp:23117
doublereal * x
#define i
void fblssolvels(ae_matrix *a, ae_vector *b, ae_int_t m, ae_int_t n, ae_vector *tmp0, ae_vector *tmp1, ae_vector *tmp2, ae_state *_state)
Definition: linalg.cpp:32023
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
ae_complex cmatrixdet(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:32792
doublereal * d
void cmatrixrndorthogonalfromtheright(ae_matrix *a, ae_int_t m, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:22370
void sparseconverttohash(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:30878
double hpdmatrixrcond(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:24687
void cmatrixlqunpackl(ae_matrix *a, ae_int_t m, ae_int_t n, ae_matrix *l, ae_state *_state)
Definition: linalg.cpp:11707
void rmatrixsyrk(ae_int_t n, ae_int_t k, double alpha, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t optypea, double beta, ae_matrix *c, ae_int_t ic, ae_int_t jc, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:8857
void spdmatrixrndcond(ae_int_t n, double c, ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:21927
void rmatrixrndorthogonal(ae_int_t n, ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:21637
ae_bool sparseishash(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:31127
void hmatrixrndcond(ae_int_t n, double c, ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:22003
void normestimatorrestart(normestimatorstate *state, ae_state *_state)
Definition: linalg.cpp:32531
void rmatrixrndcond(ae_int_t n, double c, ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:21680
void sparseset(sparsematrix *s, ae_int_t i, ae_int_t j, double v, ae_state *_state)
Definition: linalg.cpp:29440
void rmatrixrndorthogonalfromtheleft(ae_matrix *a, ae_int_t m, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:22267
void rmatrixlqunpackl(ae_matrix *a, ae_int_t m, ae_int_t n, ae_matrix *l, ae_state *_state)
Definition: linalg.cpp:11300
void rmatrixtrinverse(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_bool isunit, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27906
doublereal * b
void cmatrixqrunpackq(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tau, ae_int_t qcolumns, ae_matrix *q, ae_state *_state)
Definition: linalg.cpp:11353
#define y0
ae_bool _normestimatorstate_init_copy(void *_dst, void *_src, ae_state *_state, ae_bool make_automatic)
Definition: linalg.cpp:32567
void hpdmatrixinverse(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27841
void smp_cmatrixlefttrsm(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const complex_2d_array &x, const ae_int_t i2, const ae_int_t j2)
Definition: linalg.cpp:391
void rmatrixcopy(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_matrix *b, ae_int_t ib, ae_int_t jb, ae_state *_state)
Definition: linalg.cpp:7954
void sparsemm(sparsematrix *s, ae_matrix *a, ae_int_t k, ae_matrix *b, ae_state *_state)
Definition: linalg.cpp:30090
double cmatrixtrrcond1(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_bool isunit, ae_state *_state)
Definition: linalg.cpp:25101
void rmatrixbdunpackq(ae_matrix *qp, ae_int_t m, ae_int_t n, ae_vector *tauq, ae_int_t qcolumns, ae_matrix *q, ae_state *_state)
Definition: linalg.cpp:12056
void smatrixrndcond(ae_int_t n, double c, ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:21855
void spdmatrixinverse(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27675
void cmatrixtrinverse(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_bool isunit, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27998
void sparsemv2(sparsematrix *s, ae_vector *x, ae_vector *y0, ae_vector *y1, ae_state *_state)
Definition: linalg.cpp:29923
void rmatrixplu(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *pivots, ae_state *_state)
Definition: linalg.cpp:23057
double cmatrixrcondinf(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:24837
void rmatrixinvupdatesimple(ae_matrix *inva, ae_int_t n, ae_int_t updrow, ae_int_t updcolumn, double updval, ae_state *_state)
Definition: linalg.cpp:33430
void hmatrixtd(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *tau, ae_vector *d, ae_vector *e, ae_state *_state)
Definition: linalg.cpp:13181
void sparsegetrow(sparsematrix *s, ae_int_t i, ae_vector *irow, ae_state *_state)
Definition: linalg.cpp:30840
void _pexec_cmatrixrighttrsm(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t i1, ae_int_t j1, ae_bool isupper, ae_bool isunit, ae_int_t optype, ae_matrix *x, ae_int_t i2, ae_int_t j2, ae_state *_state)
Definition: linalg.cpp:8383
void _pexec_cmatrixgemm(ae_int_t m, ae_int_t n, ae_int_t k, ae_complex alpha, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t optypea, ae_matrix *b, ae_int_t ib, ae_int_t jb, ae_int_t optypeb, ae_complex beta, ae_matrix *c, ae_int_t ic, ae_int_t jc, ae_state *_state)
Definition: linalg.cpp:9083
void sparsecreatecrs(ae_int_t m, ae_int_t n, ae_vector *ner, sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:29217
void rmatrixhessenbergunpackh(ae_matrix *a, ae_int_t n, ae_matrix *h, ae_state *_state)
Definition: linalg.cpp:12754
#define ae_bool
Definition: ap.h:194
void rmatrixinvupdateuv(ae_matrix *inva, ae_int_t n, ae_vector *u, ae_vector *v, ae_state *_state)
Definition: linalg.cpp:33641
void rmatrixlu(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *pivots, ae_state *_state)
Definition: linalg.cpp:22770
void _pexec_cmatrixlefttrsm(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t i1, ae_int_t j1, ae_bool isupper, ae_bool isunit, ae_int_t optype, ae_matrix *x, ae_int_t i2, ae_int_t j2, ae_state *_state)
Definition: linalg.cpp:8500
void rmatrixtranspose(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_matrix *b, ae_int_t ib, ae_int_t jb, ae_state *_state)
Definition: linalg.cpp:7814
double rmatrixtrrcond1(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_bool isunit, ae_state *_state)
Definition: linalg.cpp:24522
void cmatrixrank1(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_vector *u, ae_int_t iu, ae_vector *v, ae_int_t iv, ae_state *_state)
Definition: linalg.cpp:7992
double z
void cmatrixinverse(ae_matrix *a, ae_int_t n, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27512
void hpdmatrixcholeskyinverse(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27733
void sparsecopytohash(sparsematrix *s0, sparsematrix *s1, ae_state *_state)
Definition: linalg.cpp:30942
void rmatrixinverse(ae_matrix *a, ae_int_t n, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27368
void sparseadd(sparsematrix *s, ae_int_t i, ae_int_t j, double v, ae_state *_state)
Definition: linalg.cpp:29339
void rmatrixinvupdatecolumn(ae_matrix *inva, ae_int_t n, ae_int_t updcolumn, ae_vector *u, ae_state *_state)
Definition: linalg.cpp:33572
void rmatrixrank1(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_vector *u, ae_int_t iu, ae_vector *v, ae_int_t iv, ae_state *_state)
Definition: linalg.cpp:8037
ae_bool fblscgiteration(fblslincgstate *state, ae_state *_state)
Definition: linalg.cpp:31780
void rmatrixbdmultiplybyq(ae_matrix *qp, ae_int_t m, ae_int_t n, ae_vector *tauq, ae_matrix *z, ae_int_t zrows, ae_int_t zcolumns, ae_bool fromtheright, ae_bool dotranspose, ae_state *_state)
Definition: linalg.cpp:12132
void fblscgcreate(ae_vector *x, ae_vector *b, ae_int_t n, fblslincgstate *state, ae_state *_state)
Definition: linalg.cpp:31714
void rmatrixlq(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tau, ae_state *_state)
Definition: linalg.cpp:10527
ae_bool _fblslincgstate_init_copy(void *_dst, void *_src, ae_state *_state, ae_bool make_automatic)
Definition: linalg.cpp:32117
ae_bool sparseiscrs(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:31152
ae_bool sparseenumerate(sparsematrix *s, ae_int_t *t0, ae_int_t *t1, ae_int_t *i, ae_int_t *j, double *v, ae_state *_state)
Definition: linalg.cpp:30650
double rcondthreshold(ae_state *_state)
Definition: linalg.cpp:25246
void _fblslincgstate_clear(void *_p)
Definition: linalg.cpp:32151
double cmatrixlurcondinf(ae_matrix *lua, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:25067
ae_int_t ablasmicroblocksize(ae_state *_state)
Definition: linalg.cpp:7730
ae_bool hmatrixevd(ae_matrix *a, ae_int_t n, ae_int_t zneeded, ae_bool isupper, ae_vector *d, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:15687
ae_bool smatrixgevd(ae_matrix *a, ae_int_t n, ae_bool isuppera, ae_matrix *b, ae_bool isupperb, ae_int_t zneeded, ae_int_t problemtype, ae_vector *d, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:32971
void smp_rmatrixrighttrsm(const ae_int_t m, const ae_int_t n, const real_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const real_2d_array &x, const ae_int_t i2, const ae_int_t j2)
Definition: linalg.cpp:427
ae_int_t sparsegetncols(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:31212
void _matinvreport_clear(void *_p)
Definition: linalg.cpp:29028
void normestimatorcreate(ae_int_t m, ae_int_t n, ae_int_t nstart, ae_int_t nits, normestimatorstate *state, ae_state *_state)
Definition: linalg.cpp:32220
ae_bool smatrixtdevdi(ae_vector *d, ae_vector *e, ae_int_t n, ae_int_t zneeded, ae_int_t i1, ae_int_t i2, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:16568
double rmatrixlurcond1(ae_matrix *lua, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:24892
ae_complex cmatrixludet(ae_matrix *a, ae_vector *pivots, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:32746
double rmatrixtrrcondinf(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_bool isunit, ae_state *_state)
Definition: linalg.cpp:24605
struct alglib_impl::ae_vector ae_vector
void ablassplitlength(ae_matrix *a, ae_int_t n, ae_int_t *n1, ae_int_t *n2, ae_state *_state)
Definition: linalg.cpp:7633
double sparsegetaveragelengthofchain(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:30559
void rmatrixmv(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t opa, ae_vector *x, ae_int_t ix, ae_vector *y, ae_int_t iy, ae_state *_state)
Definition: linalg.cpp:8211
#define j
void rmatrixqrunpackr(ae_matrix *a, ae_int_t m, ae_int_t n, ae_matrix *r, ae_state *_state)
Definition: linalg.cpp:11099
void smp_rmatrixsyrk(const ae_int_t n, const ae_int_t k, const double alpha, const real_2d_array &a, const ae_int_t ia, const ae_int_t ja, const ae_int_t optypea, const double beta, const real_2d_array &c, const ae_int_t ic, const ae_int_t jc, const bool isupper)
Definition: linalg.cpp:535
int m
double spdmatrixrcond(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:24433
void _matinvreport_destroy(void *_p)
Definition: linalg.cpp:29035
ae_bool rmatrixevd(ae_matrix *a, ae_int_t n, ae_int_t vneeded, ae_vector *wr, ae_vector *wi, ae_matrix *vl, ae_matrix *vr, ae_state *_state)
Definition: linalg.cpp:16878
void cmatrixgemm(ae_int_t m, ae_int_t n, ae_int_t k, ae_complex alpha, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t optypea, ae_matrix *b, ae_int_t ib, ae_int_t jb, ae_int_t optypeb, ae_complex beta, ae_matrix *c, ae_int_t ic, ae_int_t jc, ae_state *_state)
Definition: linalg.cpp:8971
void rmatrixqrunpackq(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tau, ae_int_t qcolumns, ae_matrix *q, ae_state *_state)
Definition: linalg.cpp:10951
double cmatrixrcond1(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:24774
struct alglib_impl::ae_matrix ae_matrix
ae_bool rmatrixbdsvd(ae_vector *d, ae_vector *e, ae_int_t n, ae_bool isupper, ae_bool isfractionalaccuracyrequired, ae_matrix *u, ae_int_t nru, ae_matrix *c, ae_int_t ncc, ae_matrix *vt, ae_int_t ncvt, ae_state *_state)
Definition: linalg.cpp:13854
ae_bool smatrixtdevd(ae_vector *d, ae_vector *e, ae_int_t n, ae_int_t zneeded, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:16129
void cmatrixlefttrsm(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t i1, ae_int_t j1, ae_bool isupper, ae_bool isunit, ae_int_t optype, ae_matrix *x, ae_int_t i2, ae_int_t j2, ae_state *_state)
Definition: linalg.cpp:8399
ae_bool rmatrixsvd(ae_matrix *a, ae_int_t m, ae_int_t n, ae_int_t uneeded, ae_int_t vtneeded, ae_int_t additionalmemory, ae_vector *w, ae_matrix *u, ae_matrix *vt, ae_state *_state)
Definition: linalg.cpp:15147
void rmatrixhessenbergunpackq(ae_matrix *a, ae_int_t n, ae_vector *tau, ae_matrix *q, ae_state *_state)
Definition: linalg.cpp:12679
void cmatrixsyrk(ae_int_t n, ae_int_t k, double alpha, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t optypea, double beta, ae_matrix *c, ae_int_t ic, ae_int_t jc, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:8755
void rmatrixluinverse(ae_matrix *a, ae_vector *pivots, ae_int_t n, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27267
double spdmatrixcholeskyrcond(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:24962
void cmatrixtranspose(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_matrix *b, ae_int_t ib, ae_int_t jb, ae_state *_state)
Definition: linalg.cpp:7753
ae_bool smatrixevdi(ae_matrix *a, ae_int_t n, ae_int_t zneeded, ae_bool isupper, ae_int_t i1, ae_int_t i2, ae_vector *w, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:15614
ae_bool spdmatrixcholeskyrec(ae_matrix *a, ae_int_t offs, ae_int_t n, ae_bool isupper, ae_vector *tmp, ae_state *_state)
Definition: linalg.cpp:23199
void cmatrixrndorthogonalfromtheleft(ae_matrix *a, ae_int_t m, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:22465
ae_bool hmatrixevdr(ae_matrix *a, ae_int_t n, ae_int_t zneeded, ae_bool isupper, double b1, double b2, ae_int_t *m, ae_vector *w, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:15831
ptrdiff_t ae_int_t
Definition: ap.h:186
void rmatrixbdunpackpt(ae_matrix *qp, ae_int_t m, ae_int_t n, ae_vector *taup, ae_int_t ptrows, ae_matrix *pt, ae_state *_state)
Definition: linalg.cpp:12292
void cmatrixqrunpackr(ae_matrix *a, ae_int_t m, ae_int_t n, ae_matrix *r, ae_state *_state)
Definition: linalg.cpp:11504
void _pexec_rmatrixrighttrsm(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t i1, ae_int_t j1, ae_bool isupper, ae_bool isunit, ae_int_t optype, ae_matrix *x, ae_int_t i2, ae_int_t j2, ae_state *_state)
Definition: linalg.cpp:8623
doublereal * u
void _normestimatorstate_destroy(void *_p)
Definition: linalg.cpp:32617
void sparsefree(sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:31173
void rmatrixlqbasecase(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *work, ae_vector *t, ae_vector *tau, ae_state *_state)
Definition: linalg.cpp:11802
void cmatrixrndorthogonal(ae_int_t n, ae_matrix *a, ae_state *_state)
Definition: linalg.cpp:21743
void sparsecreate(ae_int_t m, ae_int_t n, ae_int_t k, sparsematrix *s, ae_state *_state)
Definition: linalg.cpp:29118
ae_bool _normestimatorstate_init(void *_p, ae_state *_state, ae_bool make_automatic)
Definition: linalg.cpp:32541
void rmatrixbd(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *tauq, ae_vector *taup, ae_state *_state)
Definition: linalg.cpp:11896
void _sparsematrix_destroy(void *_p)
Definition: linalg.cpp:31350
ae_bool smatrixtdevdr(ae_vector *d, ae_vector *e, ae_int_t n, ae_int_t zneeded, double a, double b, ae_int_t *m, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:16273
void smp_cmatrixrighttrsm(const ae_int_t m, const ae_int_t n, const complex_2d_array &a, const ae_int_t i1, const ae_int_t j1, const bool isupper, const bool isunit, const ae_int_t optype, const complex_2d_array &x, const ae_int_t i2, const ae_int_t j2)
Definition: linalg.cpp:355
void cmatrixlup(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *pivots, ae_state *_state)
Definition: linalg.cpp:22997
double rmatrixlurcondinf(ae_matrix *lua, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:24925
void cmatrixluinverse(ae_matrix *a, ae_vector *pivots, ae_int_t n, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27415
void rmatrixqrbasecase(ae_matrix *a, ae_int_t m, ae_int_t n, ae_vector *work, ae_vector *t, ae_vector *tau, ae_state *_state)
Definition: linalg.cpp:11749
void smatrixtd(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *tau, ae_vector *d, ae_vector *e, ae_state *_state)
Definition: linalg.cpp:12858
alglib_impl::ae_int_t ae_int_t
Definition: ap.h:889
void sparsesmv(sparsematrix *s, ae_bool isupper, ae_vector *x, ae_vector *y, ae_state *_state)
Definition: linalg.cpp:30000
void _pexec_cmatrixsyrk(ae_int_t n, ae_int_t k, double alpha, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_int_t optypea, double beta, ae_matrix *c, ae_int_t ic, ae_int_t jc, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:8840
ae_bool _sparsematrix_init_copy(void *_dst, void *_src, ae_state *_state, ae_bool make_automatic)
Definition: linalg.cpp:31315
void hmatrixrndmultiply(ae_matrix *a, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:22656
int * n
double hpdmatrixcholeskyrcond(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_state *_state)
Definition: linalg.cpp:25000
doublereal * a
void fblscholeskysolve(ae_matrix *cha, double sqrtscalea, ae_int_t n, ae_bool isupper, ae_vector *xb, ae_vector *tmp, ae_state *_state)
Definition: linalg.cpp:31390
double sparsegetdiagonal(sparsematrix *s, ae_int_t i, ae_state *_state)
Definition: linalg.cpp:29643
void spdmatrixcholeskyinverse(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_int_t *info, matinvreport *rep, ae_state *_state)
Definition: linalg.cpp:27567
void sparsecopytocrs(sparsematrix *s0, sparsematrix *s1, ae_state *_state)
Definition: linalg.cpp:30987
void normestimatorestimatesparse(normestimatorstate *state, sparsematrix *a, ae_state *_state)
Definition: linalg.cpp:32476
void smatrixtdunpackq(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *tau, ae_matrix *q, ae_state *_state)
Definition: linalg.cpp:13034
void rmatrixrighttrsm(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t i1, ae_int_t j1, ae_bool isupper, ae_bool isunit, ae_int_t optype, ae_matrix *x, ae_int_t i2, ae_int_t j2, ae_state *_state)
Definition: linalg.cpp:8516
ae_bool smatrixevd(ae_matrix *a, ae_int_t n, ae_int_t zneeded, ae_bool isupper, ae_vector *d, ae_matrix *z, ae_state *_state)
Definition: linalg.cpp:15465
void fblssolvecgx(ae_matrix *a, ae_int_t m, ae_int_t n, double alpha, ae_vector *b, ae_vector *x, ae_vector *buf, ae_state *_state)
Definition: linalg.cpp:31514
ae_bool _matinvreport_init(void *_p, ae_state *_state, ae_bool make_automatic)
Definition: linalg.cpp:29010
void cmatrixcopy(ae_int_t m, ae_int_t n, ae_matrix *a, ae_int_t ia, ae_int_t ja, ae_matrix *b, ae_int_t ib, ae_int_t jb, ae_state *_state)
Definition: linalg.cpp:7917
alglib_impl::normestimatorstate * p_struct
Definition: linalg.h:189
void rmatrixrndorthogonalfromtheright(ae_matrix *a, ae_int_t m, ae_int_t n, ae_state *_state)
Definition: linalg.cpp:22166
void sparsemm2(sparsematrix *s, ae_matrix *a, ae_int_t k, ae_matrix *b0, ae_matrix *b1, ae_state *_state)
Definition: linalg.cpp:30269