solvers.h

Go to the documentation of this file.
1 /*************************************************************************
2 ALGLIB 3.11.0 (source code generated 2017-05-11)
3 Copyright (c) Sergey Bochkanov (ALGLIB project).
4 
5 >>> SOURCE LICENSE >>>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation (www.fsf.org); either version 2 of the
9 License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 A copy of the GNU General Public License is available at
17 http://www.fsf.org/licensing/licenses
18 >>> END OF LICENSE >>>
19 *************************************************************************/
20 #ifndef _solvers_pkg_h
21 #define _solvers_pkg_h
22 #include "ap.h"
23 #include "alglibinternal.h"
24 #include "linalg.h"
25 #include "alglibmisc.h"
26 
28 //
29 // THIS SECTION CONTAINS COMPUTATIONAL CORE DECLARATIONS (DATATYPES)
30 //
32 namespace alglib_impl
33 {
34 typedef struct
35 {
36  double r1;
37  double rinf;
38 } densesolverreport;
39 typedef struct
40 {
41  double r2;
42  ae_matrix cx;
43  ae_int_t n;
44  ae_int_t k;
45 } densesolverlsreport;
46 typedef struct
47 {
48  normestimatorstate nes;
49  ae_vector rx;
50  ae_vector b;
51  ae_int_t n;
53  ae_int_t prectype;
54  ae_vector ui;
55  ae_vector uip1;
56  ae_vector vi;
57  ae_vector vip1;
58  ae_vector omegai;
59  ae_vector omegaip1;
60  double alphai;
61  double alphaip1;
62  double betai;
63  double betaip1;
64  double phibari;
65  double phibarip1;
66  double phii;
67  double rhobari;
68  double rhobarip1;
69  double rhoi;
70  double ci;
71  double si;
72  double theta;
73  double lambdai;
75  double anorm;
76  double bnorm2;
77  double dnorm;
78  double r2;
81  ae_vector mtv;
82  double epsa;
83  double epsb;
84  double epsc;
85  ae_int_t maxits;
86  ae_bool xrep;
87  ae_bool xupdated;
88  ae_bool needmv;
89  ae_bool needmtv;
90  ae_bool needmv2;
91  ae_bool needvmv;
92  ae_bool needprec;
93  ae_int_t repiterationscount;
94  ae_int_t repnmv;
95  ae_int_t repterminationtype;
96  ae_bool running;
97  ae_vector tmpd;
98  ae_vector tmpx;
99  rcommstate rstate;
101 typedef struct
102 {
103  ae_int_t iterationscount;
104  ae_int_t nmv;
105  ae_int_t terminationtype;
107 typedef struct
108 {
109  double maxerr;
111 typedef struct
112 {
115  double epsf;
116  ae_int_t maxits;
117  ae_bool xrep;
118  double stpmax;
120  double f;
123  ae_bool needf;
124  ae_bool needfij;
125  ae_bool xupdated;
126  rcommstate rstate;
127  ae_int_t repiterationscount;
128  ae_int_t repnfunc;
129  ae_int_t repnjac;
130  ae_int_t repterminationtype;
131  ae_vector xbase;
132  double fbase;
133  double fprev;
134  ae_vector candstep;
135  ae_vector rightpart;
136  ae_vector cgbuf;
138 typedef struct
139 {
140  ae_int_t iterationscount;
141  ae_int_t nfunc;
142  ae_int_t njac;
143  ae_int_t terminationtype;
145 typedef struct
146 {
150  ae_int_t prectype;
155  ae_vector r;
157  double alpha;
158  double beta;
159  double r2;
160  double meritfunction;
162  ae_vector mv;
164  double vmv;
165  ae_vector startx;
166  double epsf;
167  ae_int_t maxits;
168  ae_int_t itsbeforerestart;
169  ae_int_t itsbeforerupdate;
170  ae_bool xrep;
171  ae_bool xupdated;
172  ae_bool needmv;
173  ae_bool needmtv;
174  ae_bool needmv2;
175  ae_bool needvmv;
176  ae_bool needprec;
177  ae_int_t repiterationscount;
178  ae_int_t repnmv;
179  ae_int_t repterminationtype;
180  ae_bool running;
181  ae_vector tmpd;
182  rcommstate rstate;
184 typedef struct
185 {
186  ae_int_t iterationscount;
187  ae_int_t nmv;
188  ae_int_t terminationtype;
189  double r2;
191 
192 }
193 
195 //
196 // THIS SECTION CONTAINS C++ INTERFACE
197 //
199 namespace alglib
200 {
201 
202 /*************************************************************************
203 
204 *************************************************************************/
205 class _densesolverreport_owner
206 {
207 public:
214 protected:
216 };
218 {
219 public:
224  double &r1;
225  double &rinf;
226 
227 };
228 
229 
230 /*************************************************************************
231 
232 *************************************************************************/
234 {
235 public:
242 protected:
244 };
246 {
247 public:
252  double &r2;
256 
257 };
258 
259 /*************************************************************************
260 This object stores state of the LinLSQR method.
261 
262 You should use ALGLIB functions to work with this object.
263 *************************************************************************/
265 {
266 public:
270  virtual ~_linlsqrstate_owner();
273 protected:
275 };
277 {
278 public:
282  virtual ~linlsqrstate();
283 
284 };
285 
286 
287 /*************************************************************************
288 
289 *************************************************************************/
291 {
292 public:
299 protected:
301 };
303 {
304 public:
308  virtual ~linlsqrreport();
312 
313 };
314 
315 /*************************************************************************
316 
317 *************************************************************************/
319 {
320 public:
327 protected:
329 };
331 {
332 public:
337  double &maxerr;
338 
339 };
340 
341 /*************************************************************************
342 
343 *************************************************************************/
345 {
346 public:
350  virtual ~_nleqstate_owner();
353 protected:
355 };
357 {
358 public:
360  nleqstate(const nleqstate &rhs);
362  virtual ~nleqstate();
366  double &f;
370 
371 };
372 
373 
374 /*************************************************************************
375 
376 *************************************************************************/
378 {
379 public:
386 protected:
388 };
390 {
391 public:
393  nleqreport(const nleqreport &rhs);
395  virtual ~nleqreport();
400 
401 };
402 
403 /*************************************************************************
404 This object stores state of the linear CG method.
405 
406 You should use ALGLIB functions to work with this object.
407 Never try to access its fields directly!
408 *************************************************************************/
410 {
411 public:
415  virtual ~_lincgstate_owner();
418 protected:
420 };
422 {
423 public:
425  lincgstate(const lincgstate &rhs);
427  virtual ~lincgstate();
428 
429 };
430 
431 
432 /*************************************************************************
433 
434 *************************************************************************/
436 {
437 public:
444 protected:
446 };
448 {
449 public:
453  virtual ~lincgreport();
457  double &r2;
458 
459 };
460 
461 /*************************************************************************
462 Dense solver for A*x=b with N*N real matrix A and N*1 real vectorx x and
463 b. This is "slow-but-feature rich" version of the linear solver. Faster
464 version is RMatrixSolveFast() function.
465 
466 Algorithm features:
467 * automatic detection of degenerate cases
468 * condition number estimation
469 * iterative refinement
470 * O(N^3) complexity
471 
472 IMPORTANT: ! this function is NOT the most efficient linear solver provided
473  ! by ALGLIB. It estimates condition number of linear system
474  ! and performs iterative refinement, which results in
475  ! significant performance penalty when compared with "fast"
476  ! version which just performs LU decomposition and calls
477  ! triangular solver.
478  !
479  ! This performance penalty is especially visible in the
480  ! multithreaded mode, because both condition number estimation
481  ! and iterative refinement are inherently sequential
482  ! calculations. It also very significant on small matrices.
483  !
484  ! Thus, if you need high performance and if you are pretty sure
485  ! that your system is well conditioned, we strongly recommend
486  ! you to use faster solver, RMatrixSolveFast() function.
487 
488 COMMERCIAL EDITION OF ALGLIB:
489 
490  ! Commercial version of ALGLIB includes two important improvements of
491  ! this function, which can be used from C++ and C#:
492  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
493  ! * multicore support
494  !
495  ! Intel MKL gives approximately constant (with respect to number of
496  ! worker threads) acceleration factor which depends on CPU being used,
497  ! problem size and "baseline" ALGLIB edition which is used for
498  ! comparison.
499  !
500  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
501  ! * about 2-3x faster than ALGLIB for C++ without MKL
502  ! * about 7-10x faster than "pure C#" edition of ALGLIB
503  ! Difference in performance will be more striking on newer CPU's with
504  ! support for newer SIMD instructions. Generally, MKL accelerates any
505  ! problem whose size is at least 128, with best efficiency achieved for
506  ! N's larger than 512.
507  !
508  ! Commercial edition of ALGLIB also supports multithreaded acceleration
509  ! of this function. We should note that LU decomposition is harder to
510  ! parallelize than, say, matrix-matrix product - this algorithm has
511  ! many internal synchronization points which can not be avoided. However
512  ! parallelism starts to be profitable starting from N=1024, achieving
513  ! near-linear speedup for N=4096 or higher.
514  !
515  ! In order to use multicore features you have to:
516  ! * use commercial version of ALGLIB
517  ! * call this function with "smp_" prefix, which indicates that
518  ! multicore code will be used (for multicore support)
519  !
520  ! We recommend you to read 'Working with commercial version' section of
521  ! ALGLIB Reference Manual in order to find out how to use performance-
522  ! related features provided by commercial edition of ALGLIB.
523 
524 INPUT PARAMETERS
525  A - array[0..N-1,0..N-1], system matrix
526  N - size of A
527  B - array[0..N-1], right part
528 
529 OUTPUT PARAMETERS
530  Info - return code:
531  * -3 matrix is very badly conditioned or exactly singular.
532  * -1 N<=0 was passed
533  * 1 task is solved (but matrix A may be ill-conditioned,
534  check R1/RInf parameters for condition numbers).
535  Rep - additional report, following fields are set:
536  * rep.r1 condition number in 1-norm
537  * rep.rinf condition number in inf-norm
538  X - array[N], it contains:
539  * info>0 => solution
540  * info=-3 => filled by zeros
541 
542  -- ALGLIB --
543  Copyright 27.01.2010 by Bochkanov Sergey
544 *************************************************************************/
545 void rmatrixsolve(const real_2d_array &a, const ae_int_t n, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x);
547 
548 
549 /*************************************************************************
550 Dense solver.
551 
552 This subroutine solves a system A*x=b, where A is NxN non-denegerate
553 real matrix, x and b are vectors. This is a "fast" version of linear
554 solver which does NOT provide any additional functions like condition
555 number estimation or iterative refinement.
556 
557 Algorithm features:
558 * efficient algorithm O(N^3) complexity
559 * no performance overhead from additional functionality
560 
561 If you need condition number estimation or iterative refinement, use more
562 feature-rich version - RMatrixSolve().
563 
564 COMMERCIAL EDITION OF ALGLIB:
565 
566  ! Commercial version of ALGLIB includes two important improvements of
567  ! this function, which can be used from C++ and C#:
568  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
569  ! * multicore support
570  !
571  ! Intel MKL gives approximately constant (with respect to number of
572  ! worker threads) acceleration factor which depends on CPU being used,
573  ! problem size and "baseline" ALGLIB edition which is used for
574  ! comparison.
575  !
576  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
577  ! * about 2-3x faster than ALGLIB for C++ without MKL
578  ! * about 7-10x faster than "pure C#" edition of ALGLIB
579  ! Difference in performance will be more striking on newer CPU's with
580  ! support for newer SIMD instructions. Generally, MKL accelerates any
581  ! problem whose size is at least 128, with best efficiency achieved for
582  ! N's larger than 512.
583  !
584  ! Commercial edition of ALGLIB also supports multithreaded acceleration
585  ! of this function. We should note that LU decomposition is harder to
586  ! parallelize than, say, matrix-matrix product - this algorithm has
587  ! many internal synchronization points which can not be avoided. However
588  ! parallelism starts to be profitable starting from N=1024, achieving
589  ! near-linear speedup for N=4096 or higher.
590  !
591  ! In order to use multicore features you have to:
592  ! * use commercial version of ALGLIB
593  ! * call this function with "smp_" prefix, which indicates that
594  ! multicore code will be used (for multicore support)
595  !
596  ! We recommend you to read 'Working with commercial version' section of
597  ! ALGLIB Reference Manual in order to find out how to use performance-
598  ! related features provided by commercial edition of ALGLIB.
599 
600 INPUT PARAMETERS
601  A - array[0..N-1,0..N-1], system matrix
602  N - size of A
603  B - array[0..N-1], right part
604 
605 OUTPUT PARAMETERS
606  Info - return code:
607  * -3 matrix is exactly singular (ill conditioned matrices
608  are not recognized).
609  * -1 N<=0 was passed
610  * 1 task is solved
611  B - array[N]:
612  * info>0 => overwritten by solution
613  * info=-3 => filled by zeros
614 
615  -- ALGLIB --
616  Copyright 16.03.2015 by Bochkanov Sergey
617 *************************************************************************/
618 void rmatrixsolvefast(const real_2d_array &a, const ae_int_t n, const real_1d_array &b, ae_int_t &info);
619 void smp_rmatrixsolvefast(const real_2d_array &a, const ae_int_t n, const real_1d_array &b, ae_int_t &info);
620 
621 
622 /*************************************************************************
623 Dense solver.
624 
625 Similar to RMatrixSolve() but solves task with multiple right parts (where
626 b and x are NxM matrices). This is "slow-but-robust" version of linear
627 solver with additional functionality like condition number estimation.
628 There also exists faster version - RMatrixSolveMFast().
629 
630 Algorithm features:
631 * automatic detection of degenerate cases
632 * condition number estimation
633 * optional iterative refinement
634 * O(N^3+M*N^2) complexity
635 
636 IMPORTANT: ! this function is NOT the most efficient linear solver provided
637  ! by ALGLIB. It estimates condition number of linear system
638  ! and performs iterative refinement, which results in
639  ! significant performance penalty when compared with "fast"
640  ! version which just performs LU decomposition and calls
641  ! triangular solver.
642  !
643  ! This performance penalty is especially visible in the
644  ! multithreaded mode, because both condition number estimation
645  ! and iterative refinement are inherently sequential
646  ! calculations. It also very significant on small matrices.
647  !
648  ! Thus, if you need high performance and if you are pretty sure
649  ! that your system is well conditioned, we strongly recommend
650  ! you to use faster solver, RMatrixSolveMFast() function.
651 
652 COMMERCIAL EDITION OF ALGLIB:
653 
654  ! Commercial version of ALGLIB includes two important improvements of
655  ! this function, which can be used from C++ and C#:
656  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
657  ! * multicore support
658  !
659  ! Intel MKL gives approximately constant (with respect to number of
660  ! worker threads) acceleration factor which depends on CPU being used,
661  ! problem size and "baseline" ALGLIB edition which is used for
662  ! comparison.
663  !
664  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
665  ! * about 2-3x faster than ALGLIB for C++ without MKL
666  ! * about 7-10x faster than "pure C#" edition of ALGLIB
667  ! Difference in performance will be more striking on newer CPU's with
668  ! support for newer SIMD instructions. Generally, MKL accelerates any
669  ! problem whose size is at least 128, with best efficiency achieved for
670  ! N's larger than 512.
671  !
672  ! Commercial edition of ALGLIB also supports multithreaded acceleration
673  ! of this function. We should note that LU decomposition is harder to
674  ! parallelize than, say, matrix-matrix product - this algorithm has
675  ! many internal synchronization points which can not be avoided. However
676  ! parallelism starts to be profitable starting from N=1024, achieving
677  ! near-linear speedup for N=4096 or higher.
678  !
679  ! In order to use multicore features you have to:
680  ! * use commercial version of ALGLIB
681  ! * call this function with "smp_" prefix, which indicates that
682  ! multicore code will be used (for multicore support)
683  !
684  ! We recommend you to read 'Working with commercial version' section of
685  ! ALGLIB Reference Manual in order to find out how to use performance-
686  ! related features provided by commercial edition of ALGLIB.
687 
688 INPUT PARAMETERS
689  A - array[0..N-1,0..N-1], system matrix
690  N - size of A
691  B - array[0..N-1,0..M-1], right part
692  M - right part size
693  RFS - iterative refinement switch:
694  * True - refinement is used.
695  Less performance, more precision.
696  * False - refinement is not used.
697  More performance, less precision.
698 
699 OUTPUT PARAMETERS
700  Info - return code:
701  * -3 A is ill conditioned or singular.
702  X is filled by zeros in such cases.
703  * -1 N<=0 was passed
704  * 1 task is solved (but matrix A may be ill-conditioned,
705  check R1/RInf parameters for condition numbers).
706  Rep - additional report, following fields are set:
707  * rep.r1 condition number in 1-norm
708  * rep.rinf condition number in inf-norm
709  X - array[N], it contains:
710  * info>0 => solution
711  * info=-3 => filled by zeros
712 
713 
714  -- ALGLIB --
715  Copyright 27.01.2010 by Bochkanov Sergey
716 *************************************************************************/
717 void rmatrixsolvem(const real_2d_array &a, const ae_int_t n, const real_2d_array &b, const ae_int_t m, const bool rfs, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
718 void smp_rmatrixsolvem(const real_2d_array &a, const ae_int_t n, const real_2d_array &b, const ae_int_t m, const bool rfs, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
719 
720 
721 /*************************************************************************
722 Dense solver.
723 
724 Similar to RMatrixSolve() but solves task with multiple right parts (where
725 b and x are NxM matrices). This is "fast" version of linear solver which
726 does NOT offer additional functions like condition number estimation or
727 iterative refinement.
728 
729 Algorithm features:
730 * O(N^3+M*N^2) complexity
731 * no additional functionality, highest performance
732 
733 COMMERCIAL EDITION OF ALGLIB:
734 
735  ! Commercial version of ALGLIB includes two important improvements of
736  ! this function, which can be used from C++ and C#:
737  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
738  ! * multicore support
739  !
740  ! Intel MKL gives approximately constant (with respect to number of
741  ! worker threads) acceleration factor which depends on CPU being used,
742  ! problem size and "baseline" ALGLIB edition which is used for
743  ! comparison.
744  !
745  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
746  ! * about 2-3x faster than ALGLIB for C++ without MKL
747  ! * about 7-10x faster than "pure C#" edition of ALGLIB
748  ! Difference in performance will be more striking on newer CPU's with
749  ! support for newer SIMD instructions. Generally, MKL accelerates any
750  ! problem whose size is at least 128, with best efficiency achieved for
751  ! N's larger than 512.
752  !
753  ! Commercial edition of ALGLIB also supports multithreaded acceleration
754  ! of this function. We should note that LU decomposition is harder to
755  ! parallelize than, say, matrix-matrix product - this algorithm has
756  ! many internal synchronization points which can not be avoided. However
757  ! parallelism starts to be profitable starting from N=1024, achieving
758  ! near-linear speedup for N=4096 or higher.
759  !
760  ! In order to use multicore features you have to:
761  ! * use commercial version of ALGLIB
762  ! * call this function with "smp_" prefix, which indicates that
763  ! multicore code will be used (for multicore support)
764  !
765  ! We recommend you to read 'Working with commercial version' section of
766  ! ALGLIB Reference Manual in order to find out how to use performance-
767  ! related features provided by commercial edition of ALGLIB.
768 
769 INPUT PARAMETERS
770  A - array[0..N-1,0..N-1], system matrix
771  N - size of A
772  B - array[0..N-1,0..M-1], right part
773  M - right part size
774  RFS - iterative refinement switch:
775  * True - refinement is used.
776  Less performance, more precision.
777  * False - refinement is not used.
778  More performance, less precision.
779 
780 OUTPUT PARAMETERS
781  Info - return code:
782  * -3 matrix is exactly singular (ill conditioned matrices
783  are not recognized).
784  X is filled by zeros in such cases.
785  * -1 N<=0 was passed
786  * 1 task is solved
787  Rep - additional report, following fields are set:
788  * rep.r1 condition number in 1-norm
789  * rep.rinf condition number in inf-norm
790  B - array[N]:
791  * info>0 => overwritten by solution
792  * info=-3 => filled by zeros
793 
794 
795  -- ALGLIB --
796  Copyright 27.01.2010 by Bochkanov Sergey
797 *************************************************************************/
798 void rmatrixsolvemfast(const real_2d_array &a, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info);
799 void smp_rmatrixsolvemfast(const real_2d_array &a, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info);
800 
801 
802 /*************************************************************************
803 Dense solver.
804 
805 This subroutine solves a system A*x=b, where A is NxN non-denegerate
806 real matrix given by its LU decomposition, x and b are real vectors. This
807 is "slow-but-robust" version of the linear LU-based solver. Faster version
808 is RMatrixLUSolveFast() function.
809 
810 Algorithm features:
811 * automatic detection of degenerate cases
812 * O(N^2) complexity
813 * condition number estimation
814 
815 No iterative refinement is provided because exact form of original matrix
816 is not known to subroutine. Use RMatrixSolve or RMatrixMixedSolve if you
817 need iterative refinement.
818 
819 IMPORTANT: ! this function is NOT the most efficient linear solver provided
820  ! by ALGLIB. It estimates condition number of linear system,
821  ! which results in 10-15x performance penalty when compared
822  ! with "fast" version which just calls triangular solver.
823  !
824  ! This performance penalty is insignificant when compared with
825  ! cost of large LU decomposition. However, if you call this
826  ! function many times for the same left side, this overhead
827  ! BECOMES significant. It also becomes significant for small-
828  ! scale problems.
829  !
830  ! In such cases we strongly recommend you to use faster solver,
831  ! RMatrixLUSolveFast() function.
832 
833 INPUT PARAMETERS
834  LUA - array[N,N], LU decomposition, RMatrixLU result
835  P - array[N], pivots array, RMatrixLU result
836  N - size of A
837  B - array[N], right part
838 
839 OUTPUT PARAMETERS
840  Info - return code:
841  * -3 matrix is very badly conditioned or exactly singular.
842  * -1 N<=0 was passed
843  * 1 task is solved (but matrix A may be ill-conditioned,
844  check R1/RInf parameters for condition numbers).
845  Rep - additional report, following fields are set:
846  * rep.r1 condition number in 1-norm
847  * rep.rinf condition number in inf-norm
848  X - array[N], it contains:
849  * info>0 => solution
850  * info=-3 => filled by zeros
851 
852 
853  -- ALGLIB --
854  Copyright 27.01.2010 by Bochkanov Sergey
855 *************************************************************************/
856 void rmatrixlusolve(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x);
857 
858 
859 /*************************************************************************
860 Dense solver.
861 
862 This subroutine solves a system A*x=b, where A is NxN non-denegerate
863 real matrix given by its LU decomposition, x and b are real vectors. This
864 is "fast-without-any-checks" version of the linear LU-based solver. Slower
865 but more robust version is RMatrixLUSolve() function.
866 
867 Algorithm features:
868 * O(N^2) complexity
869 * fast algorithm without ANY additional checks, just triangular solver
870 
871 INPUT PARAMETERS
872  LUA - array[0..N-1,0..N-1], LU decomposition, RMatrixLU result
873  P - array[0..N-1], pivots array, RMatrixLU result
874  N - size of A
875  B - array[0..N-1], right part
876 
877 OUTPUT PARAMETERS
878  Info - return code:
879  * -3 matrix is exactly singular (ill conditioned matrices
880  are not recognized).
881  X is filled by zeros in such cases.
882  * -1 N<=0 was passed
883  * 1 task is solved
884  B - array[N]:
885  * info>0 => overwritten by solution
886  * info=-3 => filled by zeros
887 
888  -- ALGLIB --
889  Copyright 18.03.2015 by Bochkanov Sergey
890 *************************************************************************/
891 void rmatrixlusolvefast(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_1d_array &b, ae_int_t &info);
892 
893 
894 /*************************************************************************
895 Dense solver.
896 
897 Similar to RMatrixLUSolve() but solves task with multiple right parts
898 (where b and x are NxM matrices). This is "robust-but-slow" version of
899 LU-based solver which performs additional checks for non-degeneracy of
900 inputs (condition number estimation). If you need best performance, use
901 "fast-without-any-checks" version, RMatrixLUSolveMFast().
902 
903 Algorithm features:
904 * automatic detection of degenerate cases
905 * O(M*N^2) complexity
906 * condition number estimation
907 
908 No iterative refinement is provided because exact form of original matrix
909 is not known to subroutine. Use RMatrixSolve or RMatrixMixedSolve if you
910 need iterative refinement.
911 
912 IMPORTANT: ! this function is NOT the most efficient linear solver provided
913  ! by ALGLIB. It estimates condition number of linear system,
914  ! which results in significant performance penalty when
915  ! compared with "fast" version which just calls triangular
916  ! solver.
917  !
918  ! This performance penalty is especially apparent when you use
919  ! ALGLIB parallel capabilities (condition number estimation is
920  ! inherently sequential). It also becomes significant for
921  ! small-scale problems.
922  !
923  ! In such cases we strongly recommend you to use faster solver,
924  ! RMatrixLUSolveMFast() function.
925 
926 COMMERCIAL EDITION OF ALGLIB:
927 
928  ! Commercial version of ALGLIB includes two important improvements of
929  ! this function, which can be used from C++ and C#:
930  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
931  ! * multicore support
932  !
933  ! Intel MKL gives approximately constant (with respect to number of
934  ! worker threads) acceleration factor which depends on CPU being used,
935  ! problem size and "baseline" ALGLIB edition which is used for
936  ! comparison.
937  !
938  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
939  ! * about 2-3x faster than ALGLIB for C++ without MKL
940  ! * about 7-10x faster than "pure C#" edition of ALGLIB
941  ! Difference in performance will be more striking on newer CPU's with
942  ! support for newer SIMD instructions. Generally, MKL accelerates any
943  ! problem whose size is at least 128, with best efficiency achieved for
944  ! N's larger than 512.
945  !
946  ! Commercial edition of ALGLIB also supports multithreaded acceleration
947  ! of this function. Triangular solver is relatively easy to parallelize.
948  ! However, parallelization will be efficient only for large number of
949  ! right parts M.
950  !
951  ! In order to use multicore features you have to:
952  ! * use commercial version of ALGLIB
953  ! * call this function with "smp_" prefix, which indicates that
954  ! multicore code will be used (for multicore support)
955  !
956  ! We recommend you to read 'Working with commercial version' section of
957  ! ALGLIB Reference Manual in order to find out how to use performance-
958  ! related features provided by commercial edition of ALGLIB.
959 
960 INPUT PARAMETERS
961  LUA - array[N,N], LU decomposition, RMatrixLU result
962  P - array[N], pivots array, RMatrixLU result
963  N - size of A
964  B - array[0..N-1,0..M-1], right part
965  M - right part size
966 
967 OUTPUT PARAMETERS
968  Info - return code:
969  * -3 matrix is very badly conditioned or exactly singular.
970  X is filled by zeros in such cases.
971  * -1 N<=0 was passed
972  * 1 task is solved (but matrix A may be ill-conditioned,
973  check R1/RInf parameters for condition numbers).
974  Rep - additional report, following fields are set:
975  * rep.r1 condition number in 1-norm
976  * rep.rinf condition number in inf-norm
977  X - array[N,M], it contains:
978  * info>0 => solution
979  * info=-3 => filled by zeros
980 
981 
982  -- ALGLIB --
983  Copyright 27.01.2010 by Bochkanov Sergey
984 *************************************************************************/
985 void rmatrixlusolvem(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
986 void smp_rmatrixlusolvem(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
987 
988 
989 /*************************************************************************
990 Dense solver.
991 
992 Similar to RMatrixLUSolve() but solves task with multiple right parts,
993 where b and x are NxM matrices. This is "fast-without-any-checks" version
994 of LU-based solver. It does not estimate condition number of a system,
995 so it is extremely fast. If you need better detection of near-degenerate
996 cases, use RMatrixLUSolveM() function.
997 
998 Algorithm features:
999 * O(M*N^2) complexity
1000 * fast algorithm without ANY additional checks, just triangular solver
1001 
1002 COMMERCIAL EDITION OF ALGLIB:
1003 
1004  ! Commercial version of ALGLIB includes two important improvements of
1005  ! this function, which can be used from C++ and C#:
1006  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1007  ! * multicore support
1008  !
1009  ! Intel MKL gives approximately constant (with respect to number of
1010  ! worker threads) acceleration factor which depends on CPU being used,
1011  ! problem size and "baseline" ALGLIB edition which is used for
1012  ! comparison.
1013  !
1014  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1015  ! * about 2-3x faster than ALGLIB for C++ without MKL
1016  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1017  ! Difference in performance will be more striking on newer CPU's with
1018  ! support for newer SIMD instructions. Generally, MKL accelerates any
1019  ! problem whose size is at least 128, with best efficiency achieved for
1020  ! N's larger than 512.
1021  !
1022  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1023  ! of this function. Triangular solver is relatively easy to parallelize.
1024  ! However, parallelization will be efficient only for large number of
1025  ! right parts M.
1026  !
1027  ! In order to use multicore features you have to:
1028  ! * use commercial version of ALGLIB
1029  ! * call this function with "smp_" prefix, which indicates that
1030  ! multicore code will be used (for multicore support)
1031  !
1032  ! We recommend you to read 'Working with commercial version' section of
1033  ! ALGLIB Reference Manual in order to find out how to use performance-
1034  ! related features provided by commercial edition of ALGLIB.
1035 
1036 INPUT PARAMETERS:
1037  LUA - array[0..N-1,0..N-1], LU decomposition, RMatrixLU result
1038  P - array[0..N-1], pivots array, RMatrixLU result
1039  N - size of A
1040  B - array[0..N-1,0..M-1], right part
1041  M - right part size
1042 
1043 OUTPUT PARAMETERS:
1044  Info - return code:
1045  * -3 matrix is exactly singular (ill conditioned matrices
1046  are not recognized).
1047  * -1 N<=0 was passed
1048  * 1 task is solved
1049  B - array[N,M]:
1050  * info>0 => overwritten by solution
1051  * info=-3 => filled by zeros
1052 
1053  -- ALGLIB --
1054  Copyright 18.03.2015 by Bochkanov Sergey
1055 *************************************************************************/
1056 void rmatrixlusolvemfast(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info);
1057 void smp_rmatrixlusolvemfast(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info);
1058 
1059 
1060 /*************************************************************************
1061 Dense solver.
1062 
1063 This subroutine solves a system A*x=b, where BOTH ORIGINAL A AND ITS
1064 LU DECOMPOSITION ARE KNOWN. You can use it if for some reasons you have
1065 both A and its LU decomposition.
1066 
1067 Algorithm features:
1068 * automatic detection of degenerate cases
1069 * condition number estimation
1070 * iterative refinement
1071 * O(N^2) complexity
1072 
1073 INPUT PARAMETERS
1074  A - array[0..N-1,0..N-1], system matrix
1075  LUA - array[0..N-1,0..N-1], LU decomposition, RMatrixLU result
1076  P - array[0..N-1], pivots array, RMatrixLU result
1077  N - size of A
1078  B - array[0..N-1], right part
1079 
1080 OUTPUT PARAMETERS
1081  Info - return code:
1082  * -3 matrix is very badly conditioned or exactly singular.
1083  * -1 N<=0 was passed
1084  * 1 task is solved (but matrix A may be ill-conditioned,
1085  check R1/RInf parameters for condition numbers).
1086  Rep - additional report, following fields are set:
1087  * rep.r1 condition number in 1-norm
1088  * rep.rinf condition number in inf-norm
1089  X - array[N], it contains:
1090  * info>0 => solution
1091  * info=-3 => filled by zeros
1092 
1093  -- ALGLIB --
1094  Copyright 27.01.2010 by Bochkanov Sergey
1095 *************************************************************************/
1096 void rmatrixmixedsolve(const real_2d_array &a, const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x);
1097 
1098 
1099 /*************************************************************************
1100 Dense solver.
1101 
1102 Similar to RMatrixMixedSolve() but solves task with multiple right parts
1103 (where b and x are NxM matrices).
1104 
1105 Algorithm features:
1106 * automatic detection of degenerate cases
1107 * condition number estimation
1108 * iterative refinement
1109 * O(M*N^2) complexity
1110 
1111 INPUT PARAMETERS
1112  A - array[0..N-1,0..N-1], system matrix
1113  LUA - array[0..N-1,0..N-1], LU decomposition, RMatrixLU result
1114  P - array[0..N-1], pivots array, RMatrixLU result
1115  N - size of A
1116  B - array[0..N-1,0..M-1], right part
1117  M - right part size
1118 
1119 OUTPUT PARAMETERS
1120  Info - return code:
1121  * -3 matrix is very badly conditioned or exactly singular.
1122  * -1 N<=0 was passed
1123  * 1 task is solved (but matrix A may be ill-conditioned,
1124  check R1/RInf parameters for condition numbers).
1125  Rep - additional report, following fields are set:
1126  * rep.r1 condition number in 1-norm
1127  * rep.rinf condition number in inf-norm
1128  X - array[N,M], it contains:
1129  * info>0 => solution
1130  * info=-3 => filled by zeros
1131 
1132  -- ALGLIB --
1133  Copyright 27.01.2010 by Bochkanov Sergey
1134 *************************************************************************/
1135 void rmatrixmixedsolvem(const real_2d_array &a, const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
1136 
1137 
1138 /*************************************************************************
1139 Complex dense solver for A*X=B with N*N complex matrix A, N*M complex
1140 matrices X and B. "Slow-but-feature-rich" version which provides
1141 additional functions, at the cost of slower performance. Faster version
1142 may be invoked with CMatrixSolveMFast() function.
1143 
1144 Algorithm features:
1145 * automatic detection of degenerate cases
1146 * condition number estimation
1147 * iterative refinement
1148 * O(N^3+M*N^2) complexity
1149 
1150 IMPORTANT: ! this function is NOT the most efficient linear solver provided
1151  ! by ALGLIB. It estimates condition number of linear system
1152  ! and performs iterative refinement, which results in
1153  ! significant performance penalty when compared with "fast"
1154  ! version which just performs LU decomposition and calls
1155  ! triangular solver.
1156  !
1157  ! This performance penalty is especially visible in the
1158  ! multithreaded mode, because both condition number estimation
1159  ! and iterative refinement are inherently sequential
1160  ! calculations.
1161  !
1162  ! Thus, if you need high performance and if you are pretty sure
1163  ! that your system is well conditioned, we strongly recommend
1164  ! you to use faster solver, CMatrixSolveMFast() function.
1165 
1166 COMMERCIAL EDITION OF ALGLIB:
1167 
1168  ! Commercial version of ALGLIB includes two important improvements of
1169  ! this function, which can be used from C++ and C#:
1170  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1171  ! * multicore support
1172  !
1173  ! Intel MKL gives approximately constant (with respect to number of
1174  ! worker threads) acceleration factor which depends on CPU being used,
1175  ! problem size and "baseline" ALGLIB edition which is used for
1176  ! comparison.
1177  !
1178  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1179  ! * about 2-3x faster than ALGLIB for C++ without MKL
1180  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1181  ! Difference in performance will be more striking on newer CPU's with
1182  ! support for newer SIMD instructions. Generally, MKL accelerates any
1183  ! problem whose size is at least 128, with best efficiency achieved for
1184  ! N's larger than 512.
1185  !
1186  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1187  ! of this function. We should note that LU decomposition is harder to
1188  ! parallelize than, say, matrix-matrix product - this algorithm has
1189  ! many internal synchronization points which can not be avoided. However
1190  ! parallelism starts to be profitable starting from N=1024, achieving
1191  ! near-linear speedup for N=4096 or higher.
1192  !
1193  ! In order to use multicore features you have to:
1194  ! * use commercial version of ALGLIB
1195  ! * call this function with "smp_" prefix, which indicates that
1196  ! multicore code will be used (for multicore support)
1197  !
1198  ! We recommend you to read 'Working with commercial version' section of
1199  ! ALGLIB Reference Manual in order to find out how to use performance-
1200  ! related features provided by commercial edition of ALGLIB.
1201 
1202 INPUT PARAMETERS
1203  A - array[0..N-1,0..N-1], system matrix
1204  N - size of A
1205  B - array[0..N-1,0..M-1], right part
1206  M - right part size
1207  RFS - iterative refinement switch:
1208  * True - refinement is used.
1209  Less performance, more precision.
1210  * False - refinement is not used.
1211  More performance, less precision.
1212 
1213 OUTPUT PARAMETERS
1214  Info - return code:
1215  * -3 matrix is very badly conditioned or exactly singular.
1216  X is filled by zeros in such cases.
1217  * -1 N<=0 was passed
1218  * 1 task is solved (but matrix A may be ill-conditioned,
1219  check R1/RInf parameters for condition numbers).
1220  Rep - additional report, following fields are set:
1221  * rep.r1 condition number in 1-norm
1222  * rep.rinf condition number in inf-norm
1223  X - array[N,M], it contains:
1224  * info>0 => solution
1225  * info=-3 => filled by zeros
1226 
1227  -- ALGLIB --
1228  Copyright 27.01.2010 by Bochkanov Sergey
1229 *************************************************************************/
1230 void cmatrixsolvem(const complex_2d_array &a, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, const bool rfs, ae_int_t &info, densesolverreport &rep, complex_2d_array &x);
1231 void smp_cmatrixsolvem(const complex_2d_array &a, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, const bool rfs, ae_int_t &info, densesolverreport &rep, complex_2d_array &x);
1232 
1233 
1234 /*************************************************************************
1235 Complex dense solver for A*X=B with N*N complex matrix A, N*M complex
1236 matrices X and B. "Fast-but-lightweight" version which provides just
1237 triangular solver - and no additional functions like iterative refinement
1238 or condition number estimation.
1239 
1240 Algorithm features:
1241 * O(N^3+M*N^2) complexity
1242 * no additional time consuming functions
1243 
1244 COMMERCIAL EDITION OF ALGLIB:
1245 
1246  ! Commercial version of ALGLIB includes two important improvements of
1247  ! this function, which can be used from C++ and C#:
1248  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1249  ! * multicore support
1250  !
1251  ! Intel MKL gives approximately constant (with respect to number of
1252  ! worker threads) acceleration factor which depends on CPU being used,
1253  ! problem size and "baseline" ALGLIB edition which is used for
1254  ! comparison.
1255  !
1256  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1257  ! * about 2-3x faster than ALGLIB for C++ without MKL
1258  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1259  ! Difference in performance will be more striking on newer CPU's with
1260  ! support for newer SIMD instructions. Generally, MKL accelerates any
1261  ! problem whose size is at least 128, with best efficiency achieved for
1262  ! N's larger than 512.
1263  !
1264  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1265  ! of this function. We should note that LU decomposition is harder to
1266  ! parallelize than, say, matrix-matrix product - this algorithm has
1267  ! many internal synchronization points which can not be avoided. However
1268  ! parallelism starts to be profitable starting from N=1024, achieving
1269  ! near-linear speedup for N=4096 or higher.
1270  !
1271  ! In order to use multicore features you have to:
1272  ! * use commercial version of ALGLIB
1273  ! * call this function with "smp_" prefix, which indicates that
1274  ! multicore code will be used (for multicore support)
1275  !
1276  ! We recommend you to read 'Working with commercial version' section of
1277  ! ALGLIB Reference Manual in order to find out how to use performance-
1278  ! related features provided by commercial edition of ALGLIB.
1279 
1280 INPUT PARAMETERS
1281  A - array[0..N-1,0..N-1], system matrix
1282  N - size of A
1283  B - array[0..N-1,0..M-1], right part
1284  M - right part size
1285 
1286 OUTPUT PARAMETERS:
1287  Info - return code:
1288  * -3 matrix is exactly singular (ill conditioned matrices
1289  are not recognized).
1290  * -1 N<=0 was passed
1291  * 1 task is solved
1292  B - array[N,M]:
1293  * info>0 => overwritten by solution
1294  * info=-3 => filled by zeros
1295 
1296  -- ALGLIB --
1297  Copyright 16.03.2015 by Bochkanov Sergey
1298 *************************************************************************/
1299 void cmatrixsolvemfast(const complex_2d_array &a, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info);
1300 void smp_cmatrixsolvemfast(const complex_2d_array &a, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info);
1301 
1302 
1303 /*************************************************************************
1304 Complex dense solver for A*x=B with N*N complex matrix A and N*1 complex
1305 vectors x and b. "Slow-but-feature-rich" version of the solver.
1306 
1307 Algorithm features:
1308 * automatic detection of degenerate cases
1309 * condition number estimation
1310 * iterative refinement
1311 * O(N^3) complexity
1312 
1313 IMPORTANT: ! this function is NOT the most efficient linear solver provided
1314  ! by ALGLIB. It estimates condition number of linear system
1315  ! and performs iterative refinement, which results in
1316  ! significant performance penalty when compared with "fast"
1317  ! version which just performs LU decomposition and calls
1318  ! triangular solver.
1319  !
1320  ! This performance penalty is especially visible in the
1321  ! multithreaded mode, because both condition number estimation
1322  ! and iterative refinement are inherently sequential
1323  ! calculations.
1324  !
1325  ! Thus, if you need high performance and if you are pretty sure
1326  ! that your system is well conditioned, we strongly recommend
1327  ! you to use faster solver, CMatrixSolveFast() function.
1328 
1329 COMMERCIAL EDITION OF ALGLIB:
1330 
1331  ! Commercial version of ALGLIB includes two important improvements of
1332  ! this function, which can be used from C++ and C#:
1333  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1334  ! * multicore support
1335  !
1336  ! Intel MKL gives approximately constant (with respect to number of
1337  ! worker threads) acceleration factor which depends on CPU being used,
1338  ! problem size and "baseline" ALGLIB edition which is used for
1339  ! comparison.
1340  !
1341  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1342  ! * about 2-3x faster than ALGLIB for C++ without MKL
1343  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1344  ! Difference in performance will be more striking on newer CPU's with
1345  ! support for newer SIMD instructions. Generally, MKL accelerates any
1346  ! problem whose size is at least 128, with best efficiency achieved for
1347  ! N's larger than 512.
1348  !
1349  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1350  ! of this function. We should note that LU decomposition is harder to
1351  ! parallelize than, say, matrix-matrix product - this algorithm has
1352  ! many internal synchronization points which can not be avoided. However
1353  ! parallelism starts to be profitable starting from N=1024, achieving
1354  ! near-linear speedup for N=4096 or higher.
1355  !
1356  ! In order to use multicore features you have to:
1357  ! * use commercial version of ALGLIB
1358  ! * call this function with "smp_" prefix, which indicates that
1359  ! multicore code will be used (for multicore support)
1360  !
1361  ! We recommend you to read 'Working with commercial version' section of
1362  ! ALGLIB Reference Manual in order to find out how to use performance-
1363  ! related features provided by commercial edition of ALGLIB.
1364 
1365 INPUT PARAMETERS
1366  A - array[0..N-1,0..N-1], system matrix
1367  N - size of A
1368  B - array[0..N-1], right part
1369 
1370 OUTPUT PARAMETERS
1371  Info - return code:
1372  * -3 matrix is very badly conditioned or exactly singular.
1373  * -1 N<=0 was passed
1374  * 1 task is solved (but matrix A may be ill-conditioned,
1375  check R1/RInf parameters for condition numbers).
1376  Rep - additional report, following fields are set:
1377  * rep.r1 condition number in 1-norm
1378  * rep.rinf condition number in inf-norm
1379  X - array[N], it contains:
1380  * info>0 => solution
1381  * info=-3 => filled by zeros
1382 
1383  -- ALGLIB --
1384  Copyright 27.01.2010 by Bochkanov Sergey
1385 *************************************************************************/
1388 
1389 
1390 /*************************************************************************
1391 Complex dense solver for A*x=B with N*N complex matrix A and N*1 complex
1392 vectors x and b. "Fast-but-lightweight" version of the solver.
1393 
1394 Algorithm features:
1395 * O(N^3) complexity
1396 * no additional time consuming features, just triangular solver
1397 
1398 COMMERCIAL EDITION OF ALGLIB:
1399 
1400  ! Commercial version of ALGLIB includes two important improvements of
1401  ! this function, which can be used from C++ and C#:
1402  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1403  ! * multicore support
1404  !
1405  ! Intel MKL gives approximately constant (with respect to number of
1406  ! worker threads) acceleration factor which depends on CPU being used,
1407  ! problem size and "baseline" ALGLIB edition which is used for
1408  ! comparison.
1409  !
1410  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1411  ! * about 2-3x faster than ALGLIB for C++ without MKL
1412  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1413  ! Difference in performance will be more striking on newer CPU's with
1414  ! support for newer SIMD instructions. Generally, MKL accelerates any
1415  ! problem whose size is at least 128, with best efficiency achieved for
1416  ! N's larger than 512.
1417  !
1418  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1419  ! of this function. We should note that LU decomposition is harder to
1420  ! parallelize than, say, matrix-matrix product - this algorithm has
1421  ! many internal synchronization points which can not be avoided. However
1422  ! parallelism starts to be profitable starting from N=1024, achieving
1423  ! near-linear speedup for N=4096 or higher.
1424  !
1425  ! In order to use multicore features you have to:
1426  ! * use commercial version of ALGLIB
1427  ! * call this function with "smp_" prefix, which indicates that
1428  ! multicore code will be used (for multicore support)
1429  !
1430  ! We recommend you to read 'Working with commercial version' section of
1431  ! ALGLIB Reference Manual in order to find out how to use performance-
1432  ! related features provided by commercial edition of ALGLIB.
1433 
1434 INPUT PARAMETERS:
1435  A - array[0..N-1,0..N-1], system matrix
1436  N - size of A
1437  B - array[0..N-1], right part
1438 
1439 OUTPUT PARAMETERS:
1440  Info - return code:
1441  * -3 matrix is exactly singular (ill conditioned matrices
1442  are not recognized).
1443  * -1 N<=0 was passed
1444  * 1 task is solved
1445  B - array[N]:
1446  * info>0 => overwritten by solution
1447  * info=-3 => filled by zeros
1448 
1449  -- ALGLIB --
1450  Copyright 27.01.2010 by Bochkanov Sergey
1451 *************************************************************************/
1452 void cmatrixsolvefast(const complex_2d_array &a, const ae_int_t n, const complex_1d_array &b, ae_int_t &info);
1454 
1455 
1456 /*************************************************************************
1457 Dense solver for A*X=B with N*N complex A given by its LU decomposition,
1458 and N*M matrices X and B (multiple right sides). "Slow-but-feature-rich"
1459 version of the solver.
1460 
1461 Algorithm features:
1462 * automatic detection of degenerate cases
1463 * O(M*N^2) complexity
1464 * condition number estimation
1465 
1466 No iterative refinement is provided because exact form of original matrix
1467 is not known to subroutine. Use CMatrixSolve or CMatrixMixedSolve if you
1468 need iterative refinement.
1469 
1470 IMPORTANT: ! this function is NOT the most efficient linear solver provided
1471  ! by ALGLIB. It estimates condition number of linear system,
1472  ! which results in significant performance penalty when
1473  ! compared with "fast" version which just calls triangular
1474  ! solver.
1475  !
1476  ! This performance penalty is especially apparent when you use
1477  ! ALGLIB parallel capabilities (condition number estimation is
1478  ! inherently sequential). It also becomes significant for
1479  ! small-scale problems.
1480  !
1481  ! In such cases we strongly recommend you to use faster solver,
1482  ! CMatrixLUSolveMFast() function.
1483 
1484 COMMERCIAL EDITION OF ALGLIB:
1485 
1486  ! Commercial version of ALGLIB includes two important improvements of
1487  ! this function, which can be used from C++ and C#:
1488  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1489  ! * multicore support
1490  !
1491  ! Intel MKL gives approximately constant (with respect to number of
1492  ! worker threads) acceleration factor which depends on CPU being used,
1493  ! problem size and "baseline" ALGLIB edition which is used for
1494  ! comparison.
1495  !
1496  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1497  ! * about 2-3x faster than ALGLIB for C++ without MKL
1498  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1499  ! Difference in performance will be more striking on newer CPU's with
1500  ! support for newer SIMD instructions. Generally, MKL accelerates any
1501  ! problem whose size is at least 128, with best efficiency achieved for
1502  ! N's larger than 512.
1503  !
1504  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1505  ! of this function. Triangular solver is relatively easy to parallelize.
1506  ! However, parallelization will be efficient only for large number of
1507  ! right parts M.
1508  !
1509  ! In order to use multicore features you have to:
1510  ! * use commercial version of ALGLIB
1511  ! * call this function with "smp_" prefix, which indicates that
1512  ! multicore code will be used (for multicore support)
1513  !
1514  ! We recommend you to read 'Working with commercial version' section of
1515  ! ALGLIB Reference Manual in order to find out how to use performance-
1516  ! related features provided by commercial edition of ALGLIB.
1517 
1518 INPUT PARAMETERS
1519  LUA - array[0..N-1,0..N-1], LU decomposition, RMatrixLU result
1520  P - array[0..N-1], pivots array, RMatrixLU result
1521  N - size of A
1522  B - array[0..N-1,0..M-1], right part
1523  M - right part size
1524 
1525 OUTPUT PARAMETERS
1526  Info - return code:
1527  * -3 matrix is very badly conditioned or exactly singular.
1528  * -1 N<=0 was passed
1529  * 1 task is solved (but matrix A may be ill-conditioned,
1530  check R1/RInf parameters for condition numbers).
1531  Rep - additional report, following fields are set:
1532  * rep.r1 condition number in 1-norm
1533  * rep.rinf condition number in inf-norm
1534  X - array[N,M], it contains:
1535  * info>0 => solution
1536  * info=-3 => filled by zeros
1537 
1538  -- ALGLIB --
1539  Copyright 27.01.2010 by Bochkanov Sergey
1540 *************************************************************************/
1543 
1544 
1545 /*************************************************************************
1546 Dense solver for A*X=B with N*N complex A given by its LU decomposition,
1547 and N*M matrices X and B (multiple right sides). "Fast-but-lightweight"
1548 version of the solver.
1549 
1550 Algorithm features:
1551 * O(M*N^2) complexity
1552 * no additional time-consuming features
1553 
1554 COMMERCIAL EDITION OF ALGLIB:
1555 
1556  ! Commercial version of ALGLIB includes two important improvements of
1557  ! this function, which can be used from C++ and C#:
1558  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1559  ! * multicore support
1560  !
1561  ! Intel MKL gives approximately constant (with respect to number of
1562  ! worker threads) acceleration factor which depends on CPU being used,
1563  ! problem size and "baseline" ALGLIB edition which is used for
1564  ! comparison.
1565  !
1566  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1567  ! * about 2-3x faster than ALGLIB for C++ without MKL
1568  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1569  ! Difference in performance will be more striking on newer CPU's with
1570  ! support for newer SIMD instructions. Generally, MKL accelerates any
1571  ! problem whose size is at least 128, with best efficiency achieved for
1572  ! N's larger than 512.
1573  !
1574  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1575  ! of this function. Triangular solver is relatively easy to parallelize.
1576  ! However, parallelization will be efficient only for large number of
1577  ! right parts M.
1578  !
1579  ! In order to use multicore features you have to:
1580  ! * use commercial version of ALGLIB
1581  ! * call this function with "smp_" prefix, which indicates that
1582  ! multicore code will be used (for multicore support)
1583  !
1584  ! We recommend you to read 'Working with commercial version' section of
1585  ! ALGLIB Reference Manual in order to find out how to use performance-
1586  ! related features provided by commercial edition of ALGLIB.
1587 
1588 INPUT PARAMETERS
1589  LUA - array[0..N-1,0..N-1], LU decomposition, RMatrixLU result
1590  P - array[0..N-1], pivots array, RMatrixLU result
1591  N - size of A
1592  B - array[0..N-1,0..M-1], right part
1593  M - right part size
1594 
1595 OUTPUT PARAMETERS
1596  Info - return code:
1597  * -3 matrix is exactly singular (ill conditioned matrices
1598  are not recognized).
1599  * -1 N<=0 was passed
1600  * 1 task is solved
1601  B - array[N,M]:
1602  * info>0 => overwritten by solution
1603  * info=-3 => filled by zeros
1604 
1605 
1606  -- ALGLIB --
1607  Copyright 27.01.2010 by Bochkanov Sergey
1608 *************************************************************************/
1609 void cmatrixlusolvemfast(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info);
1610 void smp_cmatrixlusolvemfast(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info);
1611 
1612 
1613 /*************************************************************************
1614 Complex dense linear solver for A*x=b with complex N*N A given by its LU
1615 decomposition and N*1 vectors x and b. This is "slow-but-robust" version
1616 of the complex linear solver with additional features which add
1617 significant performance overhead. Faster version is CMatrixLUSolveFast()
1618 function.
1619 
1620 Algorithm features:
1621 * automatic detection of degenerate cases
1622 * O(N^2) complexity
1623 * condition number estimation
1624 
1625 No iterative refinement is provided because exact form of original matrix
1626 is not known to subroutine. Use CMatrixSolve or CMatrixMixedSolve if you
1627 need iterative refinement.
1628 
1629 IMPORTANT: ! this function is NOT the most efficient linear solver provided
1630  ! by ALGLIB. It estimates condition number of linear system,
1631  ! which results in 10-15x performance penalty when compared
1632  ! with "fast" version which just calls triangular solver.
1633  !
1634  ! This performance penalty is insignificant when compared with
1635  ! cost of large LU decomposition. However, if you call this
1636  ! function many times for the same left side, this overhead
1637  ! BECOMES significant. It also becomes significant for small-
1638  ! scale problems.
1639  !
1640  ! In such cases we strongly recommend you to use faster solver,
1641  ! CMatrixLUSolveFast() function.
1642 
1643 INPUT PARAMETERS
1644  LUA - array[0..N-1,0..N-1], LU decomposition, CMatrixLU result
1645  P - array[0..N-1], pivots array, CMatrixLU result
1646  N - size of A
1647  B - array[0..N-1], right part
1648 
1649 OUTPUT PARAMETERS
1650  Info - return code:
1651  * -3 matrix is very badly conditioned or exactly singular.
1652  * -1 N<=0 was passed
1653  * 1 task is solved (but matrix A may be ill-conditioned,
1654  check R1/RInf parameters for condition numbers).
1655  Rep - additional report, following fields are set:
1656  * rep.r1 condition number in 1-norm
1657  * rep.rinf condition number in inf-norm
1658  X - array[N], it contains:
1659  * info>0 => solution
1660  * info=-3 => filled by zeros
1661 
1662  -- ALGLIB --
1663  Copyright 27.01.2010 by Bochkanov Sergey
1664 *************************************************************************/
1666 
1667 
1668 /*************************************************************************
1669 Complex dense linear solver for A*x=b with N*N complex A given by its LU
1670 decomposition and N*1 vectors x and b. This is fast lightweight version
1671 of solver, which is significantly faster than CMatrixLUSolve(), but does
1672 not provide additional information (like condition numbers).
1673 
1674 Algorithm features:
1675 * O(N^2) complexity
1676 * no additional time-consuming features, just triangular solver
1677 
1678 INPUT PARAMETERS
1679  LUA - array[0..N-1,0..N-1], LU decomposition, CMatrixLU result
1680  P - array[0..N-1], pivots array, CMatrixLU result
1681  N - size of A
1682  B - array[0..N-1], right part
1683 
1684 OUTPUT PARAMETERS
1685  Info - return code:
1686  * -3 matrix is exactly singular (ill conditioned matrices
1687  are not recognized).
1688  * -1 N<=0 was passed
1689  * 1 task is solved
1690  B - array[N]:
1691  * info>0 => overwritten by solution
1692  * info=-3 => filled by zeros
1693 
1694 NOTE: unlike CMatrixLUSolve(), this function does NOT check for
1695  near-degeneracy of input matrix. It checks for EXACT degeneracy,
1696  because this check is easy to do. However, very badly conditioned
1697  matrices may went unnoticed.
1698 
1699 
1700  -- ALGLIB --
1701  Copyright 27.01.2010 by Bochkanov Sergey
1702 *************************************************************************/
1703 void cmatrixlusolvefast(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_1d_array &b, ae_int_t &info);
1704 
1705 
1706 /*************************************************************************
1707 Dense solver. Same as RMatrixMixedSolveM(), but for complex matrices.
1708 
1709 Algorithm features:
1710 * automatic detection of degenerate cases
1711 * condition number estimation
1712 * iterative refinement
1713 * O(M*N^2) complexity
1714 
1715 INPUT PARAMETERS
1716  A - array[0..N-1,0..N-1], system matrix
1717  LUA - array[0..N-1,0..N-1], LU decomposition, CMatrixLU result
1718  P - array[0..N-1], pivots array, CMatrixLU result
1719  N - size of A
1720  B - array[0..N-1,0..M-1], right part
1721  M - right part size
1722 
1723 OUTPUT PARAMETERS
1724  Info - return code:
1725  * -3 matrix is very badly conditioned or exactly singular.
1726  * -1 N<=0 was passed
1727  * 1 task is solved (but matrix A may be ill-conditioned,
1728  check R1/RInf parameters for condition numbers).
1729  Rep - additional report, following fields are set:
1730  * rep.r1 condition number in 1-norm
1731  * rep.rinf condition number in inf-norm
1732  X - array[N,M], it contains:
1733  * info>0 => solution
1734  * info=-3 => filled by zeros
1735 
1736  -- ALGLIB --
1737  Copyright 27.01.2010 by Bochkanov Sergey
1738 *************************************************************************/
1740 
1741 
1742 /*************************************************************************
1743 Dense solver. Same as RMatrixMixedSolve(), but for complex matrices.
1744 
1745 Algorithm features:
1746 * automatic detection of degenerate cases
1747 * condition number estimation
1748 * iterative refinement
1749 * O(N^2) complexity
1750 
1751 INPUT PARAMETERS
1752  A - array[0..N-1,0..N-1], system matrix
1753  LUA - array[0..N-1,0..N-1], LU decomposition, CMatrixLU result
1754  P - array[0..N-1], pivots array, CMatrixLU result
1755  N - size of A
1756  B - array[0..N-1], right part
1757 
1758 OUTPUT PARAMETERS
1759  Info - return code:
1760  * -3 matrix is very badly conditioned or exactly singular.
1761  * -1 N<=0 was passed
1762  * 1 task is solved (but matrix A may be ill-conditioned,
1763  check R1/RInf parameters for condition numbers).
1764  Rep - additional report, following fields are set:
1765  * rep.r1 condition number in 1-norm
1766  * rep.rinf condition number in inf-norm
1767  X - array[N], it contains:
1768  * info>0 => solution
1769  * info=-3 => filled by zeros
1770 
1771  -- ALGLIB --
1772  Copyright 27.01.2010 by Bochkanov Sergey
1773 *************************************************************************/
1775 
1776 
1777 /*************************************************************************
1778 Dense solver for A*X=B with N*N symmetric positive definite matrix A, and
1779 N*M vectors X and B. It is "slow-but-feature-rich" version of the solver.
1780 
1781 Algorithm features:
1782 * automatic detection of degenerate cases
1783 * condition number estimation
1784 * O(N^3+M*N^2) complexity
1785 * matrix is represented by its upper or lower triangle
1786 
1787 No iterative refinement is provided because such partial representation of
1788 matrix does not allow efficient calculation of extra-precise matrix-vector
1789 products for large matrices. Use RMatrixSolve or RMatrixMixedSolve if you
1790 need iterative refinement.
1791 
1792 IMPORTANT: ! this function is NOT the most efficient linear solver provided
1793  ! by ALGLIB. It estimates condition number of linear system,
1794  ! which results in significant performance penalty when
1795  ! compared with "fast" version which just performs Cholesky
1796  ! decomposition and calls triangular solver.
1797  !
1798  ! This performance penalty is especially visible in the
1799  ! multithreaded mode, because both condition number estimation
1800  ! and iterative refinement are inherently sequential
1801  ! calculations.
1802  !
1803  ! Thus, if you need high performance and if you are pretty sure
1804  ! that your system is well conditioned, we strongly recommend
1805  ! you to use faster solver, SPDMatrixSolveMFast() function.
1806 
1807 COMMERCIAL EDITION OF ALGLIB:
1808 
1809  ! Commercial version of ALGLIB includes two important improvements of
1810  ! this function, which can be used from C++ and C#:
1811  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1812  ! * multicore support
1813  !
1814  ! Intel MKL gives approximately constant (with respect to number of
1815  ! worker threads) acceleration factor which depends on CPU being used,
1816  ! problem size and "baseline" ALGLIB edition which is used for
1817  ! comparison.
1818  !
1819  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1820  ! * about 2-3x faster than ALGLIB for C++ without MKL
1821  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1822  ! Difference in performance will be more striking on newer CPU's with
1823  ! support for newer SIMD instructions. Generally, MKL accelerates any
1824  ! problem whose size is at least 128, with best efficiency achieved for
1825  ! N's larger than 512.
1826  !
1827  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1828  ! of this function. We should note that Cholesky decomposition is harder
1829  ! to parallelize than, say, matrix-matrix product - this algorithm has
1830  ! several synchronization points which can not be avoided. However,
1831  ! parallelism starts to be profitable starting from N=500.
1832  !
1833  ! In order to use multicore features you have to:
1834  ! * use commercial version of ALGLIB
1835  ! * call this function with "smp_" prefix, which indicates that
1836  ! multicore code will be used (for multicore support)
1837  !
1838  ! We recommend you to read 'Working with commercial version' section of
1839  ! ALGLIB Reference Manual in order to find out how to use performance-
1840  ! related features provided by commercial edition of ALGLIB.
1841 
1842 INPUT PARAMETERS
1843  A - array[0..N-1,0..N-1], system matrix
1844  N - size of A
1845  IsUpper - what half of A is provided
1846  B - array[0..N-1,0..M-1], right part
1847  M - right part size
1848 
1849 OUTPUT PARAMETERS
1850  Info - return code:
1851  * -3 matrix is very badly conditioned or non-SPD.
1852  * -1 N<=0 was passed
1853  * 1 task is solved (but matrix A may be ill-conditioned,
1854  check R1/RInf parameters for condition numbers).
1855  Rep - additional report, following fields are set:
1856  * rep.r1 condition number in 1-norm
1857  * rep.rinf condition number in inf-norm
1858  X - array[N,M], it contains:
1859  * info>0 => solution
1860  * info=-3 => filled by zeros
1861 
1862  -- ALGLIB --
1863  Copyright 27.01.2010 by Bochkanov Sergey
1864 *************************************************************************/
1865 void spdmatrixsolvem(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
1866 void smp_spdmatrixsolvem(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
1867 
1868 
1869 /*************************************************************************
1870 Dense solver for A*X=B with N*N symmetric positive definite matrix A, and
1871 N*M vectors X and B. It is "fast-but-lightweight" version of the solver.
1872 
1873 Algorithm features:
1874 * O(N^3+M*N^2) complexity
1875 * matrix is represented by its upper or lower triangle
1876 * no additional time consuming features
1877 
1878 COMMERCIAL EDITION OF ALGLIB:
1879 
1880  ! Commercial version of ALGLIB includes two important improvements of
1881  ! this function, which can be used from C++ and C#:
1882  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1883  ! * multicore support
1884  !
1885  ! Intel MKL gives approximately constant (with respect to number of
1886  ! worker threads) acceleration factor which depends on CPU being used,
1887  ! problem size and "baseline" ALGLIB edition which is used for
1888  ! comparison.
1889  !
1890  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1891  ! * about 2-3x faster than ALGLIB for C++ without MKL
1892  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1893  ! Difference in performance will be more striking on newer CPU's with
1894  ! support for newer SIMD instructions. Generally, MKL accelerates any
1895  ! problem whose size is at least 128, with best efficiency achieved for
1896  ! N's larger than 512.
1897  !
1898  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1899  ! of this function. We should note that Cholesky decomposition is harder
1900  ! to parallelize than, say, matrix-matrix product - this algorithm has
1901  ! several synchronization points which can not be avoided. However,
1902  ! parallelism starts to be profitable starting from N=500.
1903  !
1904  ! In order to use multicore features you have to:
1905  ! * use commercial version of ALGLIB
1906  ! * call this function with "smp_" prefix, which indicates that
1907  ! multicore code will be used (for multicore support)
1908  !
1909  ! We recommend you to read 'Working with commercial version' section of
1910  ! ALGLIB Reference Manual in order to find out how to use performance-
1911  ! related features provided by commercial edition of ALGLIB.
1912 
1913 INPUT PARAMETERS
1914  A - array[0..N-1,0..N-1], system matrix
1915  N - size of A
1916  IsUpper - what half of A is provided
1917  B - array[0..N-1,0..M-1], right part
1918  M - right part size
1919 
1920 OUTPUT PARAMETERS
1921  Info - return code:
1922  * -3 A is is exactly singular
1923  * -1 N<=0 was passed
1924  * 1 task was solved
1925  B - array[N,M], it contains:
1926  * info>0 => solution
1927  * info=-3 => filled by zeros
1928 
1929  -- ALGLIB --
1930  Copyright 17.03.2015 by Bochkanov Sergey
1931 *************************************************************************/
1932 void spdmatrixsolvemfast(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info);
1933 void smp_spdmatrixsolvemfast(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info);
1934 
1935 
1936 /*************************************************************************
1937 Dense linear solver for A*x=b with N*N real symmetric positive definite
1938 matrix A, N*1 vectors x and b. "Slow-but-feature-rich" version of the
1939 solver.
1940 
1941 Algorithm features:
1942 * automatic detection of degenerate cases
1943 * condition number estimation
1944 * O(N^3) complexity
1945 * matrix is represented by its upper or lower triangle
1946 
1947 No iterative refinement is provided because such partial representation of
1948 matrix does not allow efficient calculation of extra-precise matrix-vector
1949 products for large matrices. Use RMatrixSolve or RMatrixMixedSolve if you
1950 need iterative refinement.
1951 
1952 IMPORTANT: ! this function is NOT the most efficient linear solver provided
1953  ! by ALGLIB. It estimates condition number of linear system,
1954  ! which results in significant performance penalty when
1955  ! compared with "fast" version which just performs Cholesky
1956  ! decomposition and calls triangular solver.
1957  !
1958  ! This performance penalty is especially visible in the
1959  ! multithreaded mode, because both condition number estimation
1960  ! and iterative refinement are inherently sequential
1961  ! calculations.
1962  !
1963  ! Thus, if you need high performance and if you are pretty sure
1964  ! that your system is well conditioned, we strongly recommend
1965  ! you to use faster solver, SPDMatrixSolveFast() function.
1966 
1967 COMMERCIAL EDITION OF ALGLIB:
1968 
1969  ! Commercial version of ALGLIB includes two important improvements of
1970  ! this function, which can be used from C++ and C#:
1971  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
1972  ! * multicore support
1973  !
1974  ! Intel MKL gives approximately constant (with respect to number of
1975  ! worker threads) acceleration factor which depends on CPU being used,
1976  ! problem size and "baseline" ALGLIB edition which is used for
1977  ! comparison.
1978  !
1979  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
1980  ! * about 2-3x faster than ALGLIB for C++ without MKL
1981  ! * about 7-10x faster than "pure C#" edition of ALGLIB
1982  ! Difference in performance will be more striking on newer CPU's with
1983  ! support for newer SIMD instructions. Generally, MKL accelerates any
1984  ! problem whose size is at least 128, with best efficiency achieved for
1985  ! N's larger than 512.
1986  !
1987  ! Commercial edition of ALGLIB also supports multithreaded acceleration
1988  ! of this function. We should note that Cholesky decomposition is harder
1989  ! to parallelize than, say, matrix-matrix product - this algorithm has
1990  ! several synchronization points which can not be avoided. However,
1991  ! parallelism starts to be profitable starting from N=500.
1992  !
1993  ! In order to use multicore features you have to:
1994  ! * use commercial version of ALGLIB
1995  ! * call this function with "smp_" prefix, which indicates that
1996  ! multicore code will be used (for multicore support)
1997  !
1998  ! We recommend you to read 'Working with commercial version' section of
1999  ! ALGLIB Reference Manual in order to find out how to use performance-
2000  ! related features provided by commercial edition of ALGLIB.
2001 
2002 INPUT PARAMETERS
2003  A - array[0..N-1,0..N-1], system matrix
2004  N - size of A
2005  IsUpper - what half of A is provided
2006  B - array[0..N-1], right part
2007 
2008 OUTPUT PARAMETERS
2009  Info - return code:
2010  * -3 matrix is very badly conditioned or non-SPD.
2011  * -1 N<=0 was passed
2012  * 1 task is solved (but matrix A may be ill-conditioned,
2013  check R1/RInf parameters for condition numbers).
2014  Rep - additional report, following fields are set:
2015  * rep.r1 condition number in 1-norm
2016  * rep.rinf condition number in inf-norm
2017  X - array[N], it contains:
2018  * info>0 => solution
2019  * info=-3 => filled by zeros
2020 
2021  -- ALGLIB --
2022  Copyright 27.01.2010 by Bochkanov Sergey
2023 *************************************************************************/
2024 void spdmatrixsolve(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x);
2025 void smp_spdmatrixsolve(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x);
2026 
2027 
2028 /*************************************************************************
2029 Dense linear solver for A*x=b with N*N real symmetric positive definite
2030 matrix A, N*1 vectors x and b. "Fast-but-lightweight" version of the
2031 solver.
2032 
2033 Algorithm features:
2034 * O(N^3) complexity
2035 * matrix is represented by its upper or lower triangle
2036 * no additional time consuming features like condition number estimation
2037 
2038 COMMERCIAL EDITION OF ALGLIB:
2039 
2040  ! Commercial version of ALGLIB includes two important improvements of
2041  ! this function, which can be used from C++ and C#:
2042  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
2043  ! * multicore support
2044  !
2045  ! Intel MKL gives approximately constant (with respect to number of
2046  ! worker threads) acceleration factor which depends on CPU being used,
2047  ! problem size and "baseline" ALGLIB edition which is used for
2048  ! comparison.
2049  !
2050  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
2051  ! * about 2-3x faster than ALGLIB for C++ without MKL
2052  ! * about 7-10x faster than "pure C#" edition of ALGLIB
2053  ! Difference in performance will be more striking on newer CPU's with
2054  ! support for newer SIMD instructions. Generally, MKL accelerates any
2055  ! problem whose size is at least 128, with best efficiency achieved for
2056  ! N's larger than 512.
2057  !
2058  ! Commercial edition of ALGLIB also supports multithreaded acceleration
2059  ! of this function. We should note that Cholesky decomposition is harder
2060  ! to parallelize than, say, matrix-matrix product - this algorithm has
2061  ! several synchronization points which can not be avoided. However,
2062  ! parallelism starts to be profitable starting from N=500.
2063  !
2064  ! In order to use multicore features you have to:
2065  ! * use commercial version of ALGLIB
2066  ! * call this function with "smp_" prefix, which indicates that
2067  ! multicore code will be used (for multicore support)
2068  !
2069  ! We recommend you to read 'Working with commercial version' section of
2070  ! ALGLIB Reference Manual in order to find out how to use performance-
2071  ! related features provided by commercial edition of ALGLIB.
2072 
2073 INPUT PARAMETERS
2074  A - array[0..N-1,0..N-1], system matrix
2075  N - size of A
2076  IsUpper - what half of A is provided
2077  B - array[0..N-1], right part
2078 
2079 OUTPUT PARAMETERS
2080  Info - return code:
2081  * -3 A is is exactly singular or non-SPD
2082  * -1 N<=0 was passed
2083  * 1 task was solved
2084  B - array[N], it contains:
2085  * info>0 => solution
2086  * info=-3 => filled by zeros
2087 
2088  -- ALGLIB --
2089  Copyright 17.03.2015 by Bochkanov Sergey
2090 *************************************************************************/
2091 void spdmatrixsolvefast(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info);
2092 void smp_spdmatrixsolvefast(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info);
2093 
2094 
2095 /*************************************************************************
2096 Dense solver for A*X=B with N*N symmetric positive definite matrix A given
2097 by its Cholesky decomposition, and N*M vectors X and B. It is "slow-but-
2098 feature-rich" version of the solver which estimates condition number of
2099 the system.
2100 
2101 Algorithm features:
2102 * automatic detection of degenerate cases
2103 * O(M*N^2) complexity
2104 * condition number estimation
2105 * matrix is represented by its upper or lower triangle
2106 
2107 No iterative refinement is provided because such partial representation of
2108 matrix does not allow efficient calculation of extra-precise matrix-vector
2109 products for large matrices. Use RMatrixSolve or RMatrixMixedSolve if you
2110 need iterative refinement.
2111 
2112 IMPORTANT: ! this function is NOT the most efficient linear solver provided
2113  ! by ALGLIB. It estimates condition number of linear system,
2114  ! which results in significant performance penalty when
2115  ! compared with "fast" version which just calls triangular
2116  ! solver. Amount of overhead introduced depends on M (the
2117  ! larger - the more efficient).
2118  !
2119  ! This performance penalty is insignificant when compared with
2120  ! cost of large LU decomposition. However, if you call this
2121  ! function many times for the same left side, this overhead
2122  ! BECOMES significant. It also becomes significant for small-
2123  ! scale problems (N<50).
2124  !
2125  ! In such cases we strongly recommend you to use faster solver,
2126  ! SPDMatrixCholeskySolveMFast() function.
2127 
2128 INPUT PARAMETERS
2129  CHA - array[0..N-1,0..N-1], Cholesky decomposition,
2130  SPDMatrixCholesky result
2131  N - size of CHA
2132  IsUpper - what half of CHA is provided
2133  B - array[0..N-1,0..M-1], right part
2134  M - right part size
2135 
2136 OUTPUT PARAMETERS
2137  Info - return code:
2138  * -3 A is is exactly singular or badly conditioned
2139  X is filled by zeros in such cases.
2140  * -1 N<=0 was passed
2141  * 1 task was solved
2142  Rep - additional report, following fields are set:
2143  * rep.r1 condition number in 1-norm
2144  * rep.rinf condition number in inf-norm
2145  X - array[N]:
2146  * for info>0 contains solution
2147  * for info=-3 filled by zeros
2148 
2149  -- ALGLIB --
2150  Copyright 27.01.2010 by Bochkanov Sergey
2151 *************************************************************************/
2152 void spdmatrixcholeskysolvem(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
2153 void smp_spdmatrixcholeskysolvem(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x);
2154 
2155 
2156 /*************************************************************************
2157 Dense solver for A*X=B with N*N symmetric positive definite matrix A given
2158 by its Cholesky decomposition, and N*M vectors X and B. It is "fast-but-
2159 lightweight" version of the solver which just solves linear system,
2160 without any additional functions.
2161 
2162 Algorithm features:
2163 * O(M*N^2) complexity
2164 * matrix is represented by its upper or lower triangle
2165 * no additional functionality
2166 
2167 INPUT PARAMETERS
2168  CHA - array[N,N], Cholesky decomposition,
2169  SPDMatrixCholesky result
2170  N - size of CHA
2171  IsUpper - what half of CHA is provided
2172  B - array[N,M], right part
2173  M - right part size
2174 
2175 OUTPUT PARAMETERS
2176  Info - return code:
2177  * -3 A is is exactly singular or badly conditioned
2178  X is filled by zeros in such cases.
2179  * -1 N<=0 was passed
2180  * 1 task was solved
2181  B - array[N]:
2182  * for info>0 overwritten by solution
2183  * for info=-3 filled by zeros
2184 
2185  -- ALGLIB --
2186  Copyright 18.03.2015 by Bochkanov Sergey
2187 *************************************************************************/
2188 void spdmatrixcholeskysolvemfast(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info);
2189 void smp_spdmatrixcholeskysolvemfast(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info);
2190 
2191 
2192 /*************************************************************************
2193 Dense solver for A*x=b with N*N symmetric positive definite matrix A given
2194 by its Cholesky decomposition, and N*1 real vectors x and b. This is "slow-
2195 but-feature-rich" version of the solver which, in addition to the
2196 solution, performs condition number estimation.
2197 
2198 Algorithm features:
2199 * automatic detection of degenerate cases
2200 * O(N^2) complexity
2201 * condition number estimation
2202 * matrix is represented by its upper or lower triangle
2203 
2204 No iterative refinement is provided because such partial representation of
2205 matrix does not allow efficient calculation of extra-precise matrix-vector
2206 products for large matrices. Use RMatrixSolve or RMatrixMixedSolve if you
2207 need iterative refinement.
2208 
2209 IMPORTANT: ! this function is NOT the most efficient linear solver provided
2210  ! by ALGLIB. It estimates condition number of linear system,
2211  ! which results in 10-15x performance penalty when compared
2212  ! with "fast" version which just calls triangular solver.
2213  !
2214  ! This performance penalty is insignificant when compared with
2215  ! cost of large LU decomposition. However, if you call this
2216  ! function many times for the same left side, this overhead
2217  ! BECOMES significant. It also becomes significant for small-
2218  ! scale problems (N<50).
2219  !
2220  ! In such cases we strongly recommend you to use faster solver,
2221  ! SPDMatrixCholeskySolveFast() function.
2222 
2223 INPUT PARAMETERS
2224  CHA - array[N,N], Cholesky decomposition,
2225  SPDMatrixCholesky result
2226  N - size of A
2227  IsUpper - what half of CHA is provided
2228  B - array[N], right part
2229 
2230 OUTPUT PARAMETERS
2231  Info - return code:
2232  * -3 A is is exactly singular or ill conditioned
2233  X is filled by zeros in such cases.
2234  * -1 N<=0 was passed
2235  * 1 task is solved
2236  Rep - additional report, following fields are set:
2237  * rep.r1 condition number in 1-norm
2238  * rep.rinf condition number in inf-norm
2239  X - array[N]:
2240  * for info>0 - solution
2241  * for info=-3 - filled by zeros
2242 
2243  -- ALGLIB --
2244  Copyright 27.01.2010 by Bochkanov Sergey
2245 *************************************************************************/
2246 void spdmatrixcholeskysolve(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x);
2247 
2248 
2249 /*************************************************************************
2250 Dense solver for A*x=b with N*N symmetric positive definite matrix A given
2251 by its Cholesky decomposition, and N*1 real vectors x and b. This is "fast-
2252 but-lightweight" version of the solver.
2253 
2254 Algorithm features:
2255 * O(N^2) complexity
2256 * matrix is represented by its upper or lower triangle
2257 * no additional features
2258 
2259 INPUT PARAMETERS
2260  CHA - array[N,N], Cholesky decomposition,
2261  SPDMatrixCholesky result
2262  N - size of A
2263  IsUpper - what half of CHA is provided
2264  B - array[N], right part
2265 
2266 OUTPUT PARAMETERS
2267  Info - return code:
2268  * -3 A is is exactly singular or ill conditioned
2269  X is filled by zeros in such cases.
2270  * -1 N<=0 was passed
2271  * 1 task is solved
2272  B - array[N]:
2273  * for info>0 - overwritten by solution
2274  * for info=-3 - filled by zeros
2275 
2276  -- ALGLIB --
2277  Copyright 27.01.2010 by Bochkanov Sergey
2278 *************************************************************************/
2279 void spdmatrixcholeskysolvefast(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info);
2280 
2281 
2282 /*************************************************************************
2283 Dense solver for A*X=B, with N*N Hermitian positive definite matrix A and
2284 N*M complex matrices X and B. "Slow-but-feature-rich" version of the
2285 solver.
2286 
2287 Algorithm features:
2288 * automatic detection of degenerate cases
2289 * condition number estimation
2290 * O(N^3+M*N^2) complexity
2291 * matrix is represented by its upper or lower triangle
2292 
2293 No iterative refinement is provided because such partial representation of
2294 matrix does not allow efficient calculation of extra-precise matrix-vector
2295 products for large matrices. Use RMatrixSolve or RMatrixMixedSolve if you
2296 need iterative refinement.
2297 
2298 IMPORTANT: ! this function is NOT the most efficient linear solver provided
2299  ! by ALGLIB. It estimates condition number of linear system,
2300  ! which results in significant performance penalty when
2301  ! compared with "fast" version which just calls triangular
2302  ! solver.
2303  !
2304  ! This performance penalty is especially apparent when you use
2305  ! ALGLIB parallel capabilities (condition number estimation is
2306  ! inherently sequential). It also becomes significant for
2307  ! small-scale problems (N<100).
2308  !
2309  ! In such cases we strongly recommend you to use faster solver,
2310  ! HPDMatrixSolveMFast() function.
2311 
2312 COMMERCIAL EDITION OF ALGLIB:
2313 
2314  ! Commercial version of ALGLIB includes two important improvements of
2315  ! this function, which can be used from C++ and C#:
2316  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
2317  ! * multicore support
2318  !
2319  ! Intel MKL gives approximately constant (with respect to number of
2320  ! worker threads) acceleration factor which depends on CPU being used,
2321  ! problem size and "baseline" ALGLIB edition which is used for
2322  ! comparison.
2323  !
2324  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
2325  ! * about 2-3x faster than ALGLIB for C++ without MKL
2326  ! * about 7-10x faster than "pure C#" edition of ALGLIB
2327  ! Difference in performance will be more striking on newer CPU's with
2328  ! support for newer SIMD instructions. Generally, MKL accelerates any
2329  ! problem whose size is at least 128, with best efficiency achieved for
2330  ! N's larger than 512.
2331  !
2332  ! Commercial edition of ALGLIB also supports multithreaded acceleration
2333  ! of this function. We should note that Cholesky decomposition is harder
2334  ! to parallelize than, say, matrix-matrix product - this algorithm has
2335  ! several synchronization points which can not be avoided. However,
2336  ! parallelism starts to be profitable starting from N=500.
2337  !
2338  ! In order to use multicore features you have to:
2339  ! * use commercial version of ALGLIB
2340  ! * call this function with "smp_" prefix, which indicates that
2341  ! multicore code will be used (for multicore support)
2342  !
2343  ! We recommend you to read 'Working with commercial version' section of
2344  ! ALGLIB Reference Manual in order to find out how to use performance-
2345  ! related features provided by commercial edition of ALGLIB.
2346 
2347 INPUT PARAMETERS
2348  A - array[0..N-1,0..N-1], system matrix
2349  N - size of A
2350  IsUpper - what half of A is provided
2351  B - array[0..N-1,0..M-1], right part
2352  M - right part size
2353 
2354 OUTPUT PARAMETERS
2355  Info - same as in RMatrixSolve.
2356  Returns -3 for non-HPD matrices.
2357  Rep - same as in RMatrixSolve
2358  X - same as in RMatrixSolve
2359 
2360  -- ALGLIB --
2361  Copyright 27.01.2010 by Bochkanov Sergey
2362 *************************************************************************/
2363 void hpdmatrixsolvem(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x);
2364 void smp_hpdmatrixsolvem(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x);
2365 
2366 
2367 /*************************************************************************
2368 Dense solver for A*X=B, with N*N Hermitian positive definite matrix A and
2369 N*M complex matrices X and B. "Fast-but-lightweight" version of the solver.
2370 
2371 Algorithm features:
2372 * O(N^3+M*N^2) complexity
2373 * matrix is represented by its upper or lower triangle
2374 * no additional time consuming features like condition number estimation
2375 
2376 COMMERCIAL EDITION OF ALGLIB:
2377 
2378  ! Commercial version of ALGLIB includes two important improvements of
2379  ! this function, which can be used from C++ and C#:
2380  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
2381  ! * multicore support
2382  !
2383  ! Intel MKL gives approximately constant (with respect to number of
2384  ! worker threads) acceleration factor which depends on CPU being used,
2385  ! problem size and "baseline" ALGLIB edition which is used for
2386  ! comparison.
2387  !
2388  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
2389  ! * about 2-3x faster than ALGLIB for C++ without MKL
2390  ! * about 7-10x faster than "pure C#" edition of ALGLIB
2391  ! Difference in performance will be more striking on newer CPU's with
2392  ! support for newer SIMD instructions. Generally, MKL accelerates any
2393  ! problem whose size is at least 128, with best efficiency achieved for
2394  ! N's larger than 512.
2395  !
2396  ! Commercial edition of ALGLIB also supports multithreaded acceleration
2397  ! of this function. We should note that Cholesky decomposition is harder
2398  ! to parallelize than, say, matrix-matrix product - this algorithm has
2399  ! several synchronization points which can not be avoided. However,
2400  ! parallelism starts to be profitable starting from N=500.
2401  !
2402  ! In order to use multicore features you have to:
2403  ! * use commercial version of ALGLIB
2404  ! * call this function with "smp_" prefix, which indicates that
2405  ! multicore code will be used (for multicore support)
2406  !
2407  ! We recommend you to read 'Working with commercial version' section of
2408  ! ALGLIB Reference Manual in order to find out how to use performance-
2409  ! related features provided by commercial edition of ALGLIB.
2410 
2411 INPUT PARAMETERS
2412  A - array[0..N-1,0..N-1], system matrix
2413  N - size of A
2414  IsUpper - what half of A is provided
2415  B - array[0..N-1,0..M-1], right part
2416  M - right part size
2417 
2418 OUTPUT PARAMETERS
2419  Info - return code:
2420  * -3 A is is exactly singular or is not positive definite.
2421  B is filled by zeros in such cases.
2422  * -1 N<=0 was passed
2423  * 1 task is solved
2424  B - array[0..N-1]:
2425  * overwritten by solution
2426  * zeros, if problem was not solved
2427 
2428  -- ALGLIB --
2429  Copyright 17.03.2015 by Bochkanov Sergey
2430 *************************************************************************/
2431 void hpdmatrixsolvemfast(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info);
2432 void smp_hpdmatrixsolvemfast(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info);
2433 
2434 
2435 /*************************************************************************
2436 Dense solver for A*x=b, with N*N Hermitian positive definite matrix A, and
2437 N*1 complex vectors x and b. "Slow-but-feature-rich" version of the
2438 solver.
2439 
2440 Algorithm features:
2441 * automatic detection of degenerate cases
2442 * condition number estimation
2443 * O(N^3) complexity
2444 * matrix is represented by its upper or lower triangle
2445 
2446 No iterative refinement is provided because such partial representation of
2447 matrix does not allow efficient calculation of extra-precise matrix-vector
2448 products for large matrices. Use RMatrixSolve or RMatrixMixedSolve if you
2449 need iterative refinement.
2450 
2451 IMPORTANT: ! this function is NOT the most efficient linear solver provided
2452  ! by ALGLIB. It estimates condition number of linear system,
2453  ! which results in significant performance penalty when
2454  ! compared with "fast" version which just performs Cholesky
2455  ! decomposition and calls triangular solver.
2456  !
2457  ! This performance penalty is especially visible in the
2458  ! multithreaded mode, because both condition number estimation
2459  ! and iterative refinement are inherently sequential
2460  ! calculations.
2461  !
2462  ! Thus, if you need high performance and if you are pretty sure
2463  ! that your system is well conditioned, we strongly recommend
2464  ! you to use faster solver, HPDMatrixSolveFast() function.
2465 
2466 COMMERCIAL EDITION OF ALGLIB:
2467 
2468  ! Commercial version of ALGLIB includes two important improvements of
2469  ! this function, which can be used from C++ and C#:
2470  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
2471  ! * multicore support
2472  !
2473  ! Intel MKL gives approximately constant (with respect to number of
2474  ! worker threads) acceleration factor which depends on CPU being used,
2475  ! problem size and "baseline" ALGLIB edition which is used for
2476  ! comparison.
2477  !
2478  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
2479  ! * about 2-3x faster than ALGLIB for C++ without MKL
2480  ! * about 7-10x faster than "pure C#" edition of ALGLIB
2481  ! Difference in performance will be more striking on newer CPU's with
2482  ! support for newer SIMD instructions. Generally, MKL accelerates any
2483  ! problem whose size is at least 128, with best efficiency achieved for
2484  ! N's larger than 512.
2485  !
2486  ! Commercial edition of ALGLIB also supports multithreaded acceleration
2487  ! of this function. We should note that Cholesky decomposition is harder
2488  ! to parallelize than, say, matrix-matrix product - this algorithm has
2489  ! several synchronization points which can not be avoided. However,
2490  ! parallelism starts to be profitable starting from N=500.
2491  !
2492  ! In order to use multicore features you have to:
2493  ! * use commercial version of ALGLIB
2494  ! * call this function with "smp_" prefix, which indicates that
2495  ! multicore code will be used (for multicore support)
2496  !
2497  ! We recommend you to read 'Working with commercial version' section of
2498  ! ALGLIB Reference Manual in order to find out how to use performance-
2499  ! related features provided by commercial edition of ALGLIB.
2500 
2501 INPUT PARAMETERS
2502  A - array[0..N-1,0..N-1], system matrix
2503  N - size of A
2504  IsUpper - what half of A is provided
2505  B - array[0..N-1], right part
2506 
2507 OUTPUT PARAMETERS
2508  Info - same as in RMatrixSolve
2509  Returns -3 for non-HPD matrices.
2510  Rep - same as in RMatrixSolve
2511  X - same as in RMatrixSolve
2512 
2513  -- ALGLIB --
2514  Copyright 27.01.2010 by Bochkanov Sergey
2515 *************************************************************************/
2516 void hpdmatrixsolve(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x);
2517 void smp_hpdmatrixsolve(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x);
2518 
2519 
2520 /*************************************************************************
2521 Dense solver for A*x=b, with N*N Hermitian positive definite matrix A, and
2522 N*1 complex vectors x and b. "Fast-but-lightweight" version of the
2523 solver without additional functions.
2524 
2525 Algorithm features:
2526 * O(N^3) complexity
2527 * matrix is represented by its upper or lower triangle
2528 * no additional time consuming functions
2529 
2530 COMMERCIAL EDITION OF ALGLIB:
2531 
2532  ! Commercial version of ALGLIB includes two important improvements of
2533  ! this function, which can be used from C++ and C#:
2534  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
2535  ! * multicore support
2536  !
2537  ! Intel MKL gives approximately constant (with respect to number of
2538  ! worker threads) acceleration factor which depends on CPU being used,
2539  ! problem size and "baseline" ALGLIB edition which is used for
2540  ! comparison.
2541  !
2542  ! Say, on SSE2-capable CPU with N=1024, HPC ALGLIB will be:
2543  ! * about 2-3x faster than ALGLIB for C++ without MKL
2544  ! * about 7-10x faster than "pure C#" edition of ALGLIB
2545  ! Difference in performance will be more striking on newer CPU's with
2546  ! support for newer SIMD instructions. Generally, MKL accelerates any
2547  ! problem whose size is at least 128, with best efficiency achieved for
2548  ! N's larger than 512.
2549  !
2550  ! Commercial edition of ALGLIB also supports multithreaded acceleration
2551  ! of this function. We should note that Cholesky decomposition is harder
2552  ! to parallelize than, say, matrix-matrix product - this algorithm has
2553  ! several synchronization points which can not be avoided. However,
2554  ! parallelism starts to be profitable starting from N=500.
2555  !
2556  ! In order to use multicore features you have to:
2557  ! * use commercial version of ALGLIB
2558  ! * call this function with "smp_" prefix, which indicates that
2559  ! multicore code will be used (for multicore support)
2560  !
2561  ! We recommend you to read 'Working with commercial version' section of
2562  ! ALGLIB Reference Manual in order to find out how to use performance-
2563  ! related features provided by commercial edition of ALGLIB.
2564 
2565 INPUT PARAMETERS
2566  A - array[0..N-1,0..N-1], system matrix
2567  N - size of A
2568  IsUpper - what half of A is provided
2569  B - array[0..N-1], right part
2570 
2571 OUTPUT PARAMETERS
2572  Info - return code:
2573  * -3 A is is exactly singular or not positive definite
2574  X is filled by zeros in such cases.
2575  * -1 N<=0 was passed
2576  * 1 task was solved
2577  B - array[0..N-1]:
2578  * overwritten by solution
2579  * zeros, if A is exactly singular (diagonal of its LU
2580  decomposition has exact zeros).
2581 
2582  -- ALGLIB --
2583  Copyright 17.03.2015 by Bochkanov Sergey
2584 *************************************************************************/
2585 void hpdmatrixsolvefast(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info);
2586 void smp_hpdmatrixsolvefast(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info);
2587 
2588 
2589 /*************************************************************************
2590 Dense solver for A*X=B with N*N Hermitian positive definite matrix A given
2591 by its Cholesky decomposition and N*M complex matrices X and B. This is
2592 "slow-but-feature-rich" version of the solver which, in addition to the
2593 solution, estimates condition number of the system.
2594 
2595 Algorithm features:
2596 * automatic detection of degenerate cases
2597 * O(M*N^2) complexity
2598 * condition number estimation
2599 * matrix is represented by its upper or lower triangle
2600 
2601 No iterative refinement is provided because such partial representation of
2602 matrix does not allow efficient calculation of extra-precise matrix-vector
2603 products for large matrices. Use RMatrixSolve or RMatrixMixedSolve if you
2604 need iterative refinement.
2605 
2606 IMPORTANT: ! this function is NOT the most efficient linear solver provided
2607  ! by ALGLIB. It estimates condition number of linear system,
2608  ! which results in significant performance penalty when
2609  ! compared with "fast" version which just calls triangular
2610  ! solver. Amount of overhead introduced depends on M (the
2611  ! larger - the more efficient).
2612  !
2613  ! This performance penalty is insignificant when compared with
2614  ! cost of large Cholesky decomposition. However, if you call
2615  ! this function many times for the same left side, this
2616  ! overhead BECOMES significant. It also becomes significant
2617  ! for small-scale problems (N<50).
2618  !
2619  ! In such cases we strongly recommend you to use faster solver,
2620  ! HPDMatrixCholeskySolveMFast() function.
2621 
2622 
2623 INPUT PARAMETERS
2624  CHA - array[N,N], Cholesky decomposition,
2625  HPDMatrixCholesky result
2626  N - size of CHA
2627  IsUpper - what half of CHA is provided
2628  B - array[N,M], right part
2629  M - right part size
2630 
2631 OUTPUT PARAMETERS:
2632  Info - return code:
2633  * -3 A is singular, or VERY close to singular.
2634  X is filled by zeros in such cases.
2635  * -1 N<=0 was passed
2636  * 1 task was solved
2637  Rep - additional report, following fields are set:
2638  * rep.r1 condition number in 1-norm
2639  * rep.rinf condition number in inf-norm
2640  X - array[N]:
2641  * for info>0 contains solution
2642  * for info=-3 filled by zeros
2643 
2644  -- ALGLIB --
2645  Copyright 27.01.2010 by Bochkanov Sergey
2646 *************************************************************************/
2647 void hpdmatrixcholeskysolvem(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x);
2648 void smp_hpdmatrixcholeskysolvem(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x);
2649 
2650 
2651 /*************************************************************************
2652 Dense solver for A*X=B with N*N Hermitian positive definite matrix A given
2653 by its Cholesky decomposition and N*M complex matrices X and B. This is
2654 "fast-but-lightweight" version of the solver.
2655 
2656 Algorithm features:
2657 * O(M*N^2) complexity
2658 * matrix is represented by its upper or lower triangle
2659 * no additional time-consuming features
2660 
2661 INPUT PARAMETERS
2662  CHA - array[N,N], Cholesky decomposition,
2663  HPDMatrixCholesky result
2664  N - size of CHA
2665  IsUpper - what half of CHA is provided
2666  B - array[N,M], right part
2667  M - right part size
2668 
2669 OUTPUT PARAMETERS:
2670  Info - return code:
2671  * -3 A is singular, or VERY close to singular.
2672  X is filled by zeros in such cases.
2673  * -1 N<=0 was passed
2674  * 1 task was solved
2675  B - array[N]:
2676  * for info>0 overwritten by solution
2677  * for info=-3 filled by zeros
2678 
2679  -- ALGLIB --
2680  Copyright 18.03.2015 by Bochkanov Sergey
2681 *************************************************************************/
2682 void hpdmatrixcholeskysolvemfast(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info);
2683 void smp_hpdmatrixcholeskysolvemfast(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info);
2684 
2685 
2686 /*************************************************************************
2687 Dense solver for A*x=b with N*N Hermitian positive definite matrix A given
2688 by its Cholesky decomposition, and N*1 complex vectors x and b. This is
2689 "slow-but-feature-rich" version of the solver which estimates condition
2690 number of the system.
2691 
2692 Algorithm features:
2693 * automatic detection of degenerate cases
2694 * O(N^2) complexity
2695 * condition number estimation
2696 * matrix is represented by its upper or lower triangle
2697 
2698 No iterative refinement is provided because such partial representation of
2699 matrix does not allow efficient calculation of extra-precise matrix-vector
2700 products for large matrices. Use RMatrixSolve or RMatrixMixedSolve if you
2701 need iterative refinement.
2702 
2703 IMPORTANT: ! this function is NOT the most efficient linear solver provided
2704  ! by ALGLIB. It estimates condition number of linear system,
2705  ! which results in 10-15x performance penalty when compared
2706  ! with "fast" version which just calls triangular solver.
2707  !
2708  ! This performance penalty is insignificant when compared with
2709  ! cost of large LU decomposition. However, if you call this
2710  ! function many times for the same left side, this overhead
2711  ! BECOMES significant. It also becomes significant for small-
2712  ! scale problems (N<50).
2713  !
2714  ! In such cases we strongly recommend you to use faster solver,
2715  ! HPDMatrixCholeskySolveFast() function.
2716 
2717 INPUT PARAMETERS
2718  CHA - array[0..N-1,0..N-1], Cholesky decomposition,
2719  SPDMatrixCholesky result
2720  N - size of A
2721  IsUpper - what half of CHA is provided
2722  B - array[0..N-1], right part
2723 
2724 OUTPUT PARAMETERS
2725  Info - return code:
2726  * -3 A is is exactly singular or ill conditioned
2727  X is filled by zeros in such cases.
2728  * -1 N<=0 was passed
2729  * 1 task is solved
2730  Rep - additional report, following fields are set:
2731  * rep.r1 condition number in 1-norm
2732  * rep.rinf condition number in inf-norm
2733  X - array[N]:
2734  * for info>0 - solution
2735  * for info=-3 - filled by zeros
2736 
2737  -- ALGLIB --
2738  Copyright 27.01.2010 by Bochkanov Sergey
2739 *************************************************************************/
2740 void hpdmatrixcholeskysolve(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x);
2741 
2742 
2743 /*************************************************************************
2744 Dense solver for A*x=b with N*N Hermitian positive definite matrix A given
2745 by its Cholesky decomposition, and N*1 complex vectors x and b. This is
2746 "fast-but-lightweight" version of the solver.
2747 
2748 Algorithm features:
2749 * O(N^2) complexity
2750 * matrix is represented by its upper or lower triangle
2751 * no additional time-consuming features
2752 
2753 INPUT PARAMETERS
2754  CHA - array[0..N-1,0..N-1], Cholesky decomposition,
2755  SPDMatrixCholesky result
2756  N - size of A
2757  IsUpper - what half of CHA is provided
2758  B - array[0..N-1], right part
2759 
2760 OUTPUT PARAMETERS
2761  Info - return code:
2762  * -3 A is is exactly singular or ill conditioned
2763  B is filled by zeros in such cases.
2764  * -1 N<=0 was passed
2765  * 1 task is solved
2766  B - array[N]:
2767  * for info>0 - overwritten by solution
2768  * for info=-3 - filled by zeros
2769 
2770  -- ALGLIB --
2771  Copyright 18.03.2015 by Bochkanov Sergey
2772 *************************************************************************/
2773 void hpdmatrixcholeskysolvefast(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info);
2774 
2775 
2776 /*************************************************************************
2777 Dense solver.
2778 
2779 This subroutine finds solution of the linear system A*X=B with non-square,
2780 possibly degenerate A. System is solved in the least squares sense, and
2781 general least squares solution X = X0 + CX*y which minimizes |A*X-B| is
2782 returned. If A is non-degenerate, solution in the usual sense is returned.
2783 
2784 Algorithm features:
2785 * automatic detection (and correct handling!) of degenerate cases
2786 * iterative refinement
2787 * O(N^3) complexity
2788 
2789 COMMERCIAL EDITION OF ALGLIB:
2790 
2791  ! Commercial version of ALGLIB includes one important improvement of
2792  ! this function, which can be used from C++ and C#:
2793  ! * Intel MKL support (lightweight Intel MKL is shipped with ALGLIB)
2794  !
2795  ! Intel MKL gives approximately constant (with respect to number of
2796  ! worker threads) acceleration factor which depends on CPU being used,
2797  ! problem size and "baseline" ALGLIB edition which is used for
2798  ! comparison.
2799  !
2800  ! Generally, commercial ALGLIB is several times faster than open-source
2801  ! generic C edition, and many times faster than open-source C# edition.
2802  !
2803  ! Multithreaded acceleration is only partially supported (some parts are
2804  ! optimized, but most - are not).
2805  !
2806  ! We recommend you to read 'Working with commercial version' section of
2807  ! ALGLIB Reference Manual in order to find out how to use performance-
2808  ! related features provided by commercial edition of ALGLIB.
2809 
2810 INPUT PARAMETERS
2811  A - array[0..NRows-1,0..NCols-1], system matrix
2812  NRows - vertical size of A
2813  NCols - horizontal size of A
2814  B - array[0..NCols-1], right part
2815  Threshold- a number in [0,1]. Singular values beyond Threshold are
2816  considered zero. Set it to 0.0, if you don't understand
2817  what it means, so the solver will choose good value on its
2818  own.
2819 
2820 OUTPUT PARAMETERS
2821  Info - return code:
2822  * -4 SVD subroutine failed
2823  * -1 if NRows<=0 or NCols<=0 or Threshold<0 was passed
2824  * 1 if task is solved
2825  Rep - solver report, see below for more info
2826  X - array[0..N-1,0..M-1], it contains:
2827  * solution of A*X=B (even for singular A)
2828  * zeros, if SVD subroutine failed
2829 
2830 SOLVER REPORT
2831 
2832 Subroutine sets following fields of the Rep structure:
2833 * R2 reciprocal of condition number: 1/cond(A), 2-norm.
2834 * N = NCols
2835 * K dim(Null(A))
2836 * CX array[0..N-1,0..K-1], kernel of A.
2837  Columns of CX store such vectors that A*CX[i]=0.
2838 
2839  -- ALGLIB --
2840  Copyright 24.08.2009 by Bochkanov Sergey
2841 *************************************************************************/
2842 void rmatrixsolvels(const real_2d_array &a, const ae_int_t nrows, const ae_int_t ncols, const real_1d_array &b, const double threshold, ae_int_t &info, densesolverlsreport &rep, real_1d_array &x);
2843 void smp_rmatrixsolvels(const real_2d_array &a, const ae_int_t nrows, const ae_int_t ncols, const real_1d_array &b, const double threshold, ae_int_t &info, densesolverlsreport &rep, real_1d_array &x);
2844 
2845 /*************************************************************************
2846 This function initializes linear LSQR Solver. This solver is used to solve
2847 non-symmetric (and, possibly, non-square) problems. Least squares solution
2848 is returned for non-compatible systems.
2849 
2850 USAGE:
2851 1. User initializes algorithm state with LinLSQRCreate() call
2852 2. User tunes solver parameters with LinLSQRSetCond() and other functions
2853 3. User calls LinLSQRSolveSparse() function which takes algorithm state
2854  and SparseMatrix object.
2855 4. User calls LinLSQRResults() to get solution
2856 5. Optionally, user may call LinLSQRSolveSparse() again to solve another
2857  problem with different matrix and/or right part without reinitializing
2858  LinLSQRState structure.
2859 
2860 INPUT PARAMETERS:
2861  M - number of rows in A
2862  N - number of variables, N>0
2863 
2864 OUTPUT PARAMETERS:
2865  State - structure which stores algorithm state
2866 
2867  -- ALGLIB --
2868  Copyright 30.11.2011 by Bochkanov Sergey
2869 *************************************************************************/
2870 void linlsqrcreate(const ae_int_t m, const ae_int_t n, linlsqrstate &state);
2871 
2872 
2873 /*************************************************************************
2874 This function changes preconditioning settings of LinLSQQSolveSparse()
2875 function. By default, SolveSparse() uses diagonal preconditioner, but if
2876 you want to use solver without preconditioning, you can call this function
2877 which forces solver to use unit matrix for preconditioning.
2878 
2879 INPUT PARAMETERS:
2880  State - structure which stores algorithm state
2881 
2882  -- ALGLIB --
2883  Copyright 19.11.2012 by Bochkanov Sergey
2884 *************************************************************************/
2886 
2887 
2888 /*************************************************************************
2889 This function changes preconditioning settings of LinCGSolveSparse()
2890 function. LinCGSolveSparse() will use diagonal of the system matrix as
2891 preconditioner. This preconditioning mode is active by default.
2892 
2893 INPUT PARAMETERS:
2894  State - structure which stores algorithm state
2895 
2896  -- ALGLIB --
2897  Copyright 19.11.2012 by Bochkanov Sergey
2898 *************************************************************************/
2900 
2901 
2902 /*************************************************************************
2903 This function sets optional Tikhonov regularization coefficient.
2904 It is zero by default.
2905 
2906 INPUT PARAMETERS:
2907  LambdaI - regularization factor, LambdaI>=0
2908 
2909 OUTPUT PARAMETERS:
2910  State - structure which stores algorithm state
2911 
2912  -- ALGLIB --
2913  Copyright 30.11.2011 by Bochkanov Sergey
2914 *************************************************************************/
2915 void linlsqrsetlambdai(const linlsqrstate &state, const double lambdai);
2916 
2917 
2918 /*************************************************************************
2919 Procedure for solution of A*x=b with sparse A.
2920 
2921 INPUT PARAMETERS:
2922  State - algorithm state
2923  A - sparse M*N matrix in the CRS format (you MUST contvert it
2924  to CRS format by calling SparseConvertToCRS() function
2925  BEFORE you pass it to this function).
2926  B - right part, array[M]
2927 
2928 RESULT:
2929  This function returns no result.
2930  You can get solution by calling LinCGResults()
2931 
2932 NOTE: this function uses lightweight preconditioning - multiplication by
2933  inverse of diag(A). If you want, you can turn preconditioning off by
2934  calling LinLSQRSetPrecUnit(). However, preconditioning cost is low
2935  and preconditioner is very important for solution of badly scaled
2936  problems.
2937 
2938  -- ALGLIB --
2939  Copyright 30.11.2011 by Bochkanov Sergey
2940 *************************************************************************/
2941 void linlsqrsolvesparse(const linlsqrstate &state, const sparsematrix &a, const real_1d_array &b);
2942 
2943 
2944 /*************************************************************************
2945 This function sets stopping criteria.
2946 
2947 INPUT PARAMETERS:
2948  EpsA - algorithm will be stopped if ||A^T*Rk||/(||A||*||Rk||)<=EpsA.
2949  EpsB - algorithm will be stopped if ||Rk||<=EpsB*||B||
2950  MaxIts - algorithm will be stopped if number of iterations
2951  more than MaxIts.
2952 
2953 OUTPUT PARAMETERS:
2954  State - structure which stores algorithm state
2955 
2956 NOTE: if EpsA,EpsB,EpsC and MaxIts are zero then these variables will
2957 be setted as default values.
2958 
2959  -- ALGLIB --
2960  Copyright 30.11.2011 by Bochkanov Sergey
2961 *************************************************************************/
2962 void linlsqrsetcond(const linlsqrstate &state, const double epsa, const double epsb, const ae_int_t maxits);
2963 
2964 
2965 /*************************************************************************
2966 LSQR solver: results.
2967 
2968 This function must be called after LinLSQRSolve
2969 
2970 INPUT PARAMETERS:
2971  State - algorithm state
2972 
2973 OUTPUT PARAMETERS:
2974  X - array[N], solution
2975  Rep - optimization report:
2976  * Rep.TerminationType completetion code:
2977  * 1 ||Rk||<=EpsB*||B||
2978  * 4 ||A^T*Rk||/(||A||*||Rk||)<=EpsA
2979  * 5 MaxIts steps was taken
2980  * 7 rounding errors prevent further progress,
2981  X contains best point found so far.
2982  (sometimes returned on singular systems)
2983  * Rep.IterationsCount contains iterations count
2984  * NMV countains number of matrix-vector calculations
2985 
2986  -- ALGLIB --
2987  Copyright 30.11.2011 by Bochkanov Sergey
2988 *************************************************************************/
2990 
2991 
2992 /*************************************************************************
2993 This function turns on/off reporting.
2994 
2995 INPUT PARAMETERS:
2996  State - structure which stores algorithm state
2997  NeedXRep- whether iteration reports are needed or not
2998 
2999 If NeedXRep is True, algorithm will call rep() callback function if it is
3000 provided to MinCGOptimize().
3001 
3002  -- ALGLIB --
3003  Copyright 30.11.2011 by Bochkanov Sergey
3004 *************************************************************************/
3005 void linlsqrsetxrep(const linlsqrstate &state, const bool needxrep);
3006 
3007 /*************************************************************************
3008 Polynomial root finding.
3009 
3010 This function returns all roots of the polynomial
3011  P(x) = a0 + a1*x + a2*x^2 + ... + an*x^n
3012 Both real and complex roots are returned (see below).
3013 
3014 INPUT PARAMETERS:
3015  A - array[N+1], polynomial coefficients:
3016  * A[0] is constant term
3017  * A[N] is a coefficient of X^N
3018  N - polynomial degree
3019 
3020 OUTPUT PARAMETERS:
3021  X - array of complex roots:
3022  * for isolated real root, X[I] is strictly real: IMAGE(X[I])=0
3023  * complex roots are always returned in pairs - roots occupy
3024  positions I and I+1, with:
3025  * X[I+1]=Conj(X[I])
3026  * IMAGE(X[I]) > 0
3027  * IMAGE(X[I+1]) = -IMAGE(X[I]) < 0
3028  * multiple real roots may have non-zero imaginary part due
3029  to roundoff errors. There is no reliable way to distinguish
3030  real root of multiplicity 2 from two complex roots in
3031  the presence of roundoff errors.
3032  Rep - report, additional information, following fields are set:
3033  * Rep.MaxErr - max( |P(xi)| ) for i=0..N-1. This field
3034  allows to quickly estimate "quality" of the roots being
3035  returned.
3036 
3037 NOTE: this function uses companion matrix method to find roots. In case
3038  internal EVD solver fails do find eigenvalues, exception is
3039  generated.
3040 
3041 NOTE: roots are not "polished" and no matrix balancing is performed
3042  for them.
3043 
3044  -- ALGLIB --
3045  Copyright 24.02.2014 by Bochkanov Sergey
3046 *************************************************************************/
3048 
3049 /*************************************************************************
3050  LEVENBERG-MARQUARDT-LIKE NONLINEAR SOLVER
3051 
3052 DESCRIPTION:
3053 This algorithm solves system of nonlinear equations
3054  F[0](x[0], ..., x[n-1]) = 0
3055  F[1](x[0], ..., x[n-1]) = 0
3056  ...
3057  F[M-1](x[0], ..., x[n-1]) = 0
3058 with M/N do not necessarily coincide. Algorithm converges quadratically
3059 under following conditions:
3060  * the solution set XS is nonempty
3061  * for some xs in XS there exist such neighbourhood N(xs) that:
3062  * vector function F(x) and its Jacobian J(x) are continuously
3063  differentiable on N
3064  * ||F(x)|| provides local error bound on N, i.e. there exists such
3065  c1, that ||F(x)||>c1*distance(x,XS)
3066 Note that these conditions are much more weaker than usual non-singularity
3067 conditions. For example, algorithm will converge for any affine function
3068 F (whether its Jacobian singular or not).
3069 
3070 
3071 REQUIREMENTS:
3072 Algorithm will request following information during its operation:
3073 * function vector F[] and Jacobian matrix at given point X
3074 * value of merit function f(x)=F[0]^2(x)+...+F[M-1]^2(x) at given point X
3075 
3076 
3077 USAGE:
3078 1. User initializes algorithm state with NLEQCreateLM() call
3079 2. User tunes solver parameters with NLEQSetCond(), NLEQSetStpMax() and
3080  other functions
3081 3. User calls NLEQSolve() function which takes algorithm state and
3082  pointers (delegates, etc.) to callback functions which calculate merit
3083  function value and Jacobian.
3084 4. User calls NLEQResults() to get solution
3085 5. Optionally, user may call NLEQRestartFrom() to solve another problem
3086  with same parameters (N/M) but another starting point and/or another
3087  function vector. NLEQRestartFrom() allows to reuse already initialized
3088  structure.
3089 
3090 
3091 INPUT PARAMETERS:
3092  N - space dimension, N>1:
3093  * if provided, only leading N elements of X are used
3094  * if not provided, determined automatically from size of X
3095  M - system size
3096  X - starting point
3097 
3098 
3099 OUTPUT PARAMETERS:
3100  State - structure which stores algorithm state
3101 
3102 
3103 NOTES:
3104 1. you may tune stopping conditions with NLEQSetCond() function
3105 2. if target function contains exp() or other fast growing functions, and
3106  optimization algorithm makes too large steps which leads to overflow,
3107  use NLEQSetStpMax() function to bound algorithm's steps.
3108 3. this algorithm is a slightly modified implementation of the method
3109  described in 'Levenberg-Marquardt method for constrained nonlinear
3110  equations with strong local convergence properties' by Christian Kanzow
3111  Nobuo Yamashita and Masao Fukushima and further developed in 'On the
3112  convergence of a New Levenberg-Marquardt Method' by Jin-yan Fan and
3113  Ya-Xiang Yuan.
3114 
3115 
3116  -- ALGLIB --
3117  Copyright 20.08.2009 by Bochkanov Sergey
3118 *************************************************************************/
3119 void nleqcreatelm(const ae_int_t n, const ae_int_t m, const real_1d_array &x, nleqstate &state);
3120 void nleqcreatelm(const ae_int_t m, const real_1d_array &x, nleqstate &state);
3121 
3122 
3123 /*************************************************************************
3124 This function sets stopping conditions for the nonlinear solver
3125 
3126 INPUT PARAMETERS:
3127  State - structure which stores algorithm state
3128  EpsF - >=0
3129  The subroutine finishes its work if on k+1-th iteration
3130  the condition ||F||<=EpsF is satisfied
3131  MaxIts - maximum number of iterations. If MaxIts=0, the number of
3132  iterations is unlimited.
3133 
3134 Passing EpsF=0 and MaxIts=0 simultaneously will lead to automatic
3135 stopping criterion selection (small EpsF).
3136 
3137 NOTES:
3138 
3139  -- ALGLIB --
3140  Copyright 20.08.2010 by Bochkanov Sergey
3141 *************************************************************************/
3142 void nleqsetcond(const nleqstate &state, const double epsf, const ae_int_t maxits);
3143 
3144 
3145 /*************************************************************************
3146 This function turns on/off reporting.
3147 
3148 INPUT PARAMETERS:
3149  State - structure which stores algorithm state
3150  NeedXRep- whether iteration reports are needed or not
3151 
3152 If NeedXRep is True, algorithm will call rep() callback function if it is
3153 provided to NLEQSolve().
3154 
3155  -- ALGLIB --
3156  Copyright 20.08.2010 by Bochkanov Sergey
3157 *************************************************************************/
3158 void nleqsetxrep(const nleqstate &state, const bool needxrep);
3159 
3160 
3161 /*************************************************************************
3162 This function sets maximum step length
3163 
3164 INPUT PARAMETERS:
3165  State - structure which stores algorithm state
3166  StpMax - maximum step length, >=0. Set StpMax to 0.0, if you don't
3167  want to limit step length.
3168 
3169 Use this subroutine when target function contains exp() or other fast
3170 growing functions, and algorithm makes too large steps which lead to
3171 overflow. This function allows us to reject steps that are too large (and
3172 therefore expose us to the possible overflow) without actually calculating
3173 function value at the x+stp*d.
3174 
3175  -- ALGLIB --
3176  Copyright 20.08.2010 by Bochkanov Sergey
3177 *************************************************************************/
3178 void nleqsetstpmax(const nleqstate &state, const double stpmax);
3179 
3180 
3181 /*************************************************************************
3182 This function provides reverse communication interface
3183 Reverse communication interface is not documented or recommended to use.
3184 See below for functions which provide better documented API
3185 *************************************************************************/
3186 bool nleqiteration(const nleqstate &state);
3187 
3188 
3189 /*************************************************************************
3190 This family of functions is used to launcn iterations of nonlinear solver
3191 
3192 These functions accept following parameters:
3193  state - algorithm state
3194  func - callback which calculates function (or merit function)
3195  value func at given point x
3196  jac - callback which calculates function vector fi[]
3197  and Jacobian jac at given point x
3198  rep - optional callback which is called after each iteration
3199  can be NULL
3200  ptr - optional pointer which is passed to func/grad/hess/jac/rep
3201  can be NULL
3202 
3203 
3204  -- ALGLIB --
3205  Copyright 20.03.2009 by Bochkanov Sergey
3206 
3207 *************************************************************************/
3208 void nleqsolve(nleqstate &state,
3209  void (*func)(const real_1d_array &x, double &func, void *ptr),
3210  void (*jac)(const real_1d_array &x, real_1d_array &fi, real_2d_array &jac, void *ptr),
3211  void (*rep)(const real_1d_array &x, double func, void *ptr) = NULL,
3212  void *ptr = NULL);
3213 
3214 
3215 /*************************************************************************
3216 NLEQ solver results
3217 
3218 INPUT PARAMETERS:
3219  State - algorithm state.
3220 
3221 OUTPUT PARAMETERS:
3222  X - array[0..N-1], solution
3223  Rep - optimization report:
3224  * Rep.TerminationType completetion code:
3225  * -4 ERROR: algorithm has converged to the
3226  stationary point Xf which is local minimum of
3227  f=F[0]^2+...+F[m-1]^2, but is not solution of
3228  nonlinear system.
3229  * 1 sqrt(f)<=EpsF.
3230  * 5 MaxIts steps was taken
3231  * 7 stopping conditions are too stringent,
3232  further improvement is impossible
3233  * Rep.IterationsCount contains iterations count
3234  * NFEV countains number of function calculations
3235  * ActiveConstraints contains number of active constraints
3236 
3237  -- ALGLIB --
3238  Copyright 20.08.2009 by Bochkanov Sergey
3239 *************************************************************************/
3240 void nleqresults(const nleqstate &state, real_1d_array &x, nleqreport &rep);
3241 
3242 
3243 /*************************************************************************
3244 NLEQ solver results
3245 
3246 Buffered implementation of NLEQResults(), which uses pre-allocated buffer
3247 to store X[]. If buffer size is too small, it resizes buffer. It is
3248 intended to be used in the inner cycles of performance critical algorithms
3249 where array reallocation penalty is too large to be ignored.
3250 
3251  -- ALGLIB --
3252  Copyright 20.08.2009 by Bochkanov Sergey
3253 *************************************************************************/
3254 void nleqresultsbuf(const nleqstate &state, real_1d_array &x, nleqreport &rep);
3255 
3256 
3257 /*************************************************************************
3258 This subroutine restarts CG algorithm from new point. All optimization
3259 parameters are left unchanged.
3260 
3261 This function allows to solve multiple optimization problems (which
3262 must have same number of dimensions) without object reallocation penalty.
3263 
3264 INPUT PARAMETERS:
3265  State - structure used for reverse communication previously
3266  allocated with MinCGCreate call.
3267  X - new starting point.
3268  BndL - new lower bounds
3269  BndU - new upper bounds
3270 
3271  -- ALGLIB --
3272  Copyright 30.07.2010 by Bochkanov Sergey
3273 *************************************************************************/
3274 void nleqrestartfrom(const nleqstate &state, const real_1d_array &x);
3275 
3276 /*************************************************************************
3277 This function initializes linear CG Solver. This solver is used to solve
3278 symmetric positive definite problems. If you want to solve nonsymmetric
3279 (or non-positive definite) problem you may use LinLSQR solver provided by
3280 ALGLIB.
3281 
3282 USAGE:
3283 1. User initializes algorithm state with LinCGCreate() call
3284 2. User tunes solver parameters with LinCGSetCond() and other functions
3285 3. Optionally, user sets starting point with LinCGSetStartingPoint()
3286 4. User calls LinCGSolveSparse() function which takes algorithm state and
3287  SparseMatrix object.
3288 5. User calls LinCGResults() to get solution
3289 6. Optionally, user may call LinCGSolveSparse() again to solve another
3290  problem with different matrix and/or right part without reinitializing
3291  LinCGState structure.
3292 
3293 INPUT PARAMETERS:
3294  N - problem dimension, N>0
3295 
3296 OUTPUT PARAMETERS:
3297  State - structure which stores algorithm state
3298 
3299  -- ALGLIB --
3300  Copyright 14.11.2011 by Bochkanov Sergey
3301 *************************************************************************/
3302 void lincgcreate(const ae_int_t n, lincgstate &state);
3303 
3304 
3305 /*************************************************************************
3306 This function sets starting point.
3307 By default, zero starting point is used.
3308 
3309 INPUT PARAMETERS:
3310  X - starting point, array[N]
3311 
3312 OUTPUT PARAMETERS:
3313  State - structure which stores algorithm state
3314 
3315  -- ALGLIB --
3316  Copyright 14.11.2011 by Bochkanov Sergey
3317 *************************************************************************/
3318 void lincgsetstartingpoint(const lincgstate &state, const real_1d_array &x);
3319 
3320 
3321 /*************************************************************************
3322 This function changes preconditioning settings of LinCGSolveSparse()
3323 function. By default, SolveSparse() uses diagonal preconditioner, but if
3324 you want to use solver without preconditioning, you can call this function
3325 which forces solver to use unit matrix for preconditioning.
3326 
3327 INPUT PARAMETERS:
3328  State - structure which stores algorithm state
3329 
3330  -- ALGLIB --
3331  Copyright 19.11.2012 by Bochkanov Sergey
3332 *************************************************************************/
3333 void lincgsetprecunit(const lincgstate &state);
3334 
3335 
3336 /*************************************************************************
3337 This function changes preconditioning settings of LinCGSolveSparse()
3338 function. LinCGSolveSparse() will use diagonal of the system matrix as
3339 preconditioner. This preconditioning mode is active by default.
3340 
3341 INPUT PARAMETERS:
3342  State - structure which stores algorithm state
3343 
3344  -- ALGLIB --
3345  Copyright 19.11.2012 by Bochkanov Sergey
3346 *************************************************************************/
3347 void lincgsetprecdiag(const lincgstate &state);
3348 
3349 
3350 /*************************************************************************
3351 This function sets stopping criteria.
3352 
3353 INPUT PARAMETERS:
3354  EpsF - algorithm will be stopped if norm of residual is less than
3355  EpsF*||b||.
3356  MaxIts - algorithm will be stopped if number of iterations is more
3357  than MaxIts.
3358 
3359 OUTPUT PARAMETERS:
3360  State - structure which stores algorithm state
3361 
3362 NOTES:
3363 If both EpsF and MaxIts are zero then small EpsF will be set to small
3364 value.
3365 
3366  -- ALGLIB --
3367  Copyright 14.11.2011 by Bochkanov Sergey
3368 *************************************************************************/
3369 void lincgsetcond(const lincgstate &state, const double epsf, const ae_int_t maxits);
3370 
3371 
3372 /*************************************************************************
3373 Procedure for solution of A*x=b with sparse A.
3374 
3375 INPUT PARAMETERS:
3376  State - algorithm state
3377  A - sparse matrix in the CRS format (you MUST contvert it to
3378  CRS format by calling SparseConvertToCRS() function).
3379  IsUpper - whether upper or lower triangle of A is used:
3380  * IsUpper=True => only upper triangle is used and lower
3381  triangle is not referenced at all
3382  * IsUpper=False => only lower triangle is used and upper
3383  triangle is not referenced at all
3384  B - right part, array[N]
3385 
3386 RESULT:
3387  This function returns no result.
3388  You can get solution by calling LinCGResults()
3389 
3390 NOTE: this function uses lightweight preconditioning - multiplication by
3391  inverse of diag(A). If you want, you can turn preconditioning off by
3392  calling LinCGSetPrecUnit(). However, preconditioning cost is low and
3393  preconditioner is very important for solution of badly scaled
3394  problems.
3395 
3396  -- ALGLIB --
3397  Copyright 14.11.2011 by Bochkanov Sergey
3398 *************************************************************************/
3399 void lincgsolvesparse(const lincgstate &state, const sparsematrix &a, const bool isupper, const real_1d_array &b);
3400 
3401 
3402 /*************************************************************************
3403 CG-solver: results.
3404 
3405 This function must be called after LinCGSolve
3406 
3407 INPUT PARAMETERS:
3408  State - algorithm state
3409 
3410 OUTPUT PARAMETERS:
3411  X - array[N], solution
3412  Rep - optimization report:
3413  * Rep.TerminationType completetion code:
3414  * -5 input matrix is either not positive definite,
3415  too large or too small
3416  * -4 overflow/underflow during solution
3417  (ill conditioned problem)
3418  * 1 ||residual||<=EpsF*||b||
3419  * 5 MaxIts steps was taken
3420  * 7 rounding errors prevent further progress,
3421  best point found is returned
3422  * Rep.IterationsCount contains iterations count
3423  * NMV countains number of matrix-vector calculations
3424 
3425  -- ALGLIB --
3426  Copyright 14.11.2011 by Bochkanov Sergey
3427 *************************************************************************/
3428 void lincgresults(const lincgstate &state, real_1d_array &x, lincgreport &rep);
3429 
3430 
3431 /*************************************************************************
3432 This function sets restart frequency. By default, algorithm is restarted
3433 after N subsequent iterations.
3434 
3435  -- ALGLIB --
3436  Copyright 14.11.2011 by Bochkanov Sergey
3437 *************************************************************************/
3438 void lincgsetrestartfreq(const lincgstate &state, const ae_int_t srf);
3439 
3440 
3441 /*************************************************************************
3442 This function sets frequency of residual recalculations.
3443 
3444 Algorithm updates residual r_k using iterative formula, but recalculates
3445 it from scratch after each 10 iterations. It is done to avoid accumulation
3446 of numerical errors and to stop algorithm when r_k starts to grow.
3447 
3448 Such low update frequence (1/10) gives very little overhead, but makes
3449 algorithm a bit more robust against numerical errors. However, you may
3450 change it
3451 
3452 INPUT PARAMETERS:
3453  Freq - desired update frequency, Freq>=0.
3454  Zero value means that no updates will be done.
3455 
3456  -- ALGLIB --
3457  Copyright 14.11.2011 by Bochkanov Sergey
3458 *************************************************************************/
3459 void lincgsetrupdatefreq(const lincgstate &state, const ae_int_t freq);
3460 
3461 
3462 /*************************************************************************
3463 This function turns on/off reporting.
3464 
3465 INPUT PARAMETERS:
3466  State - structure which stores algorithm state
3467  NeedXRep- whether iteration reports are needed or not
3468 
3469 If NeedXRep is True, algorithm will call rep() callback function if it is
3470 provided to MinCGOptimize().
3471 
3472  -- ALGLIB --
3473  Copyright 14.11.2011 by Bochkanov Sergey
3474 *************************************************************************/
3475 void lincgsetxrep(const lincgstate &state, const bool needxrep);
3476 }
3477 
3479 //
3480 // THIS SECTION CONTAINS COMPUTATIONAL CORE DECLARATIONS (FUNCTIONS)
3481 //
3483 namespace alglib_impl
3484 {
3485 void rmatrixsolve(/* Real */ ae_matrix* a,
3486  ae_int_t n,
3487  /* Real */ ae_vector* b,
3488  ae_int_t* info,
3489  densesolverreport* rep,
3490  /* Real */ ae_vector* x,
3491  ae_state *_state);
3492 void _pexec_rmatrixsolve(/* Real */ ae_matrix* a,
3493  ae_int_t n,
3494  /* Real */ ae_vector* b,
3495  ae_int_t* info,
3496  densesolverreport* rep,
3497  /* Real */ ae_vector* x, ae_state *_state);
3498 void rmatrixsolvefast(/* Real */ ae_matrix* a,
3499  ae_int_t n,
3500  /* Real */ ae_vector* b,
3501  ae_int_t* info,
3502  ae_state *_state);
3504  ae_int_t n,
3505  /* Real */ ae_vector* b,
3506  ae_int_t* info, ae_state *_state);
3507 void rmatrixsolvem(/* Real */ ae_matrix* a,
3508  ae_int_t n,
3509  /* Real */ ae_matrix* b,
3510  ae_int_t m,
3511  ae_bool rfs,
3512  ae_int_t* info,
3513  densesolverreport* rep,
3514  /* Real */ ae_matrix* x,
3515  ae_state *_state);
3516 void _pexec_rmatrixsolvem(/* Real */ ae_matrix* a,
3517  ae_int_t n,
3518  /* Real */ ae_matrix* b,
3519  ae_int_t m,
3520  ae_bool rfs,
3521  ae_int_t* info,
3522  densesolverreport* rep,
3523  /* Real */ ae_matrix* x, ae_state *_state);
3524 void rmatrixsolvemfast(/* Real */ ae_matrix* a,
3525  ae_int_t n,
3526  /* Real */ ae_matrix* b,
3527  ae_int_t m,
3528  ae_int_t* info,
3529  ae_state *_state);
3531  ae_int_t n,
3532  /* Real */ ae_matrix* b,
3533  ae_int_t m,
3534  ae_int_t* info, ae_state *_state);
3535 void rmatrixlusolve(/* Real */ ae_matrix* lua,
3536  /* Integer */ ae_vector* p,
3537  ae_int_t n,
3538  /* Real */ ae_vector* b,
3539  ae_int_t* info,
3540  densesolverreport* rep,
3541  /* Real */ ae_vector* x,
3542  ae_state *_state);
3543 void rmatrixlusolvefast(/* Real */ ae_matrix* lua,
3544  /* Integer */ ae_vector* p,
3545  ae_int_t n,
3546  /* Real */ ae_vector* b,
3547  ae_int_t* info,
3548  ae_state *_state);
3549 void rmatrixlusolvem(/* Real */ ae_matrix* lua,
3550  /* Integer */ ae_vector* p,
3551  ae_int_t n,
3552  /* Real */ ae_matrix* b,
3553  ae_int_t m,
3554  ae_int_t* info,
3555  densesolverreport* rep,
3556  /* Real */ ae_matrix* x,
3557  ae_state *_state);
3558 void _pexec_rmatrixlusolvem(/* Real */ ae_matrix* lua,
3559  /* Integer */ ae_vector* p,
3560  ae_int_t n,
3561  /* Real */ ae_matrix* b,
3562  ae_int_t m,
3563  ae_int_t* info,
3564  densesolverreport* rep,
3565  /* Real */ ae_matrix* x, ae_state *_state);
3566 void rmatrixlusolvemfast(/* Real */ ae_matrix* lua,
3567  /* Integer */ ae_vector* p,
3568  ae_int_t n,
3569  /* Real */ ae_matrix* b,
3570  ae_int_t m,
3571  ae_int_t* info,
3572  ae_state *_state);
3574  /* Integer */ ae_vector* p,
3575  ae_int_t n,
3576  /* Real */ ae_matrix* b,
3577  ae_int_t m,
3578  ae_int_t* info, ae_state *_state);
3579 void rmatrixmixedsolve(/* Real */ ae_matrix* a,
3580  /* Real */ ae_matrix* lua,
3581  /* Integer */ ae_vector* p,
3582  ae_int_t n,
3583  /* Real */ ae_vector* b,
3584  ae_int_t* info,
3585  densesolverreport* rep,
3586  /* Real */ ae_vector* x,
3587  ae_state *_state);
3588 void rmatrixmixedsolvem(/* Real */ ae_matrix* a,
3589  /* Real */ ae_matrix* lua,
3590  /* Integer */ ae_vector* p,
3591  ae_int_t n,
3592  /* Real */ ae_matrix* b,
3593  ae_int_t m,
3594  ae_int_t* info,
3595  densesolverreport* rep,
3596  /* Real */ ae_matrix* x,
3597  ae_state *_state);
3598 void cmatrixsolvem(/* Complex */ ae_matrix* a,
3599  ae_int_t n,
3600  /* Complex */ ae_matrix* b,
3601  ae_int_t m,
3602  ae_bool rfs,
3603  ae_int_t* info,
3604  densesolverreport* rep,
3605  /* Complex */ ae_matrix* x,
3606  ae_state *_state);
3607 void _pexec_cmatrixsolvem(/* Complex */ ae_matrix* a,
3608  ae_int_t n,
3609  /* Complex */ ae_matrix* b,
3610  ae_int_t m,
3611  ae_bool rfs,
3612  ae_int_t* info,
3613  densesolverreport* rep,
3614  /* Complex */ ae_matrix* x, ae_state *_state);
3615 void cmatrixsolvemfast(/* Complex */ ae_matrix* a,
3616  ae_int_t n,
3617  /* Complex */ ae_matrix* b,
3618  ae_int_t m,
3619  ae_int_t* info,
3620  ae_state *_state);
3621 void _pexec_cmatrixsolvemfast(/* Complex */ ae_matrix* a,
3622  ae_int_t n,
3623  /* Complex */ ae_matrix* b,
3624  ae_int_t m,
3625  ae_int_t* info, ae_state *_state);
3626 void cmatrixsolve(/* Complex */ ae_matrix* a,
3627  ae_int_t n,
3628  /* Complex */ ae_vector* b,
3629  ae_int_t* info,
3630  densesolverreport* rep,
3631  /* Complex */ ae_vector* x,
3632  ae_state *_state);
3633 void _pexec_cmatrixsolve(/* Complex */ ae_matrix* a,
3634  ae_int_t n,
3635  /* Complex */ ae_vector* b,
3636  ae_int_t* info,
3637  densesolverreport* rep,
3638  /* Complex */ ae_vector* x, ae_state *_state);
3639 void cmatrixsolvefast(/* Complex */ ae_matrix* a,
3640  ae_int_t n,
3641  /* Complex */ ae_vector* b,
3642  ae_int_t* info,
3643  ae_state *_state);
3644 void _pexec_cmatrixsolvefast(/* Complex */ ae_matrix* a,
3645  ae_int_t n,
3646  /* Complex */ ae_vector* b,
3647  ae_int_t* info, ae_state *_state);
3648 void cmatrixlusolvem(/* Complex */ ae_matrix* lua,
3649  /* Integer */ ae_vector* p,
3650  ae_int_t n,
3651  /* Complex */ ae_matrix* b,
3652  ae_int_t m,
3653  ae_int_t* info,
3654  densesolverreport* rep,
3655  /* Complex */ ae_matrix* x,
3656  ae_state *_state);
3657 void _pexec_cmatrixlusolvem(/* Complex */ ae_matrix* lua,
3658  /* Integer */ ae_vector* p,
3659  ae_int_t n,
3660  /* Complex */ ae_matrix* b,
3661  ae_int_t m,
3662  ae_int_t* info,
3663  densesolverreport* rep,
3664  /* Complex */ ae_matrix* x, ae_state *_state);
3665 void cmatrixlusolvemfast(/* Complex */ ae_matrix* lua,
3666  /* Integer */ ae_vector* p,
3667  ae_int_t n,
3668  /* Complex */ ae_matrix* b,
3669  ae_int_t m,
3670  ae_int_t* info,
3671  ae_state *_state);
3672 void _pexec_cmatrixlusolvemfast(/* Complex */ ae_matrix* lua,
3673  /* Integer */ ae_vector* p,
3674  ae_int_t n,
3675  /* Complex */ ae_matrix* b,
3676  ae_int_t m,
3677  ae_int_t* info, ae_state *_state);
3678 void cmatrixlusolve(/* Complex */ ae_matrix* lua,
3679  /* Integer */ ae_vector* p,
3680  ae_int_t n,
3681  /* Complex */ ae_vector* b,
3682  ae_int_t* info,
3683  densesolverreport* rep,
3684  /* Complex */ ae_vector* x,
3685  ae_state *_state);
3686 void cmatrixlusolvefast(/* Complex */ ae_matrix* lua,
3687  /* Integer */ ae_vector* p,
3688  ae_int_t n,
3689  /* Complex */ ae_vector* b,
3690  ae_int_t* info,
3691  ae_state *_state);
3692 void cmatrixmixedsolvem(/* Complex */ ae_matrix* a,
3693  /* Complex */ ae_matrix* lua,
3694  /* Integer */ ae_vector* p,
3695  ae_int_t n,
3696  /* Complex */ ae_matrix* b,
3697  ae_int_t m,
3698  ae_int_t* info,
3699  densesolverreport* rep,
3700  /* Complex */ ae_matrix* x,
3701  ae_state *_state);
3702 void cmatrixmixedsolve(/* Complex */ ae_matrix* a,
3703  /* Complex */ ae_matrix* lua,
3704  /* Integer */ ae_vector* p,
3705  ae_int_t n,
3706  /* Complex */ ae_vector* b,
3707  ae_int_t* info,
3708  densesolverreport* rep,
3709  /* Complex */ ae_vector* x,
3710  ae_state *_state);
3711 void spdmatrixsolvem(/* Real */ ae_matrix* a,
3712  ae_int_t n,
3713  ae_bool isupper,
3714  /* Real */ ae_matrix* b,
3715  ae_int_t m,
3716  ae_int_t* info,
3717  densesolverreport* rep,
3718  /* Real */ ae_matrix* x,
3719  ae_state *_state);
3721  ae_int_t n,
3722  ae_bool isupper,
3723  /* Real */ ae_matrix* b,
3724  ae_int_t m,
3725  ae_int_t* info,
3726  densesolverreport* rep,
3727  /* Real */ ae_matrix* x, ae_state *_state);
3728 void spdmatrixsolvemfast(/* Real */ ae_matrix* a,
3729  ae_int_t n,
3730  ae_bool isupper,
3731  /* Real */ ae_matrix* b,
3732  ae_int_t m,
3733  ae_int_t* info,
3734  ae_state *_state);
3736  ae_int_t n,
3737  ae_bool isupper,
3738  /* Real */ ae_matrix* b,
3739  ae_int_t m,
3740  ae_int_t* info, ae_state *_state);
3741 void spdmatrixsolve(/* Real */ ae_matrix* a,
3742  ae_int_t n,
3743  ae_bool isupper,
3744  /* Real */ ae_vector* b,
3745  ae_int_t* info,
3746  densesolverreport* rep,
3747  /* Real */ ae_vector* x,
3748  ae_state *_state);
3750  ae_int_t n,
3751  ae_bool isupper,
3752  /* Real */ ae_vector* b,
3753  ae_int_t* info,
3754  densesolverreport* rep,
3755  /* Real */ ae_vector* x, ae_state *_state);
3756 void spdmatrixsolvefast(/* Real */ ae_matrix* a,
3757  ae_int_t n,
3758  ae_bool isupper,
3759  /* Real */ ae_vector* b,
3760  ae_int_t* info,
3761  ae_state *_state);
3763  ae_int_t n,
3764  ae_bool isupper,
3765  /* Real */ ae_vector* b,
3766  ae_int_t* info, ae_state *_state);
3767 void spdmatrixcholeskysolvem(/* Real */ ae_matrix* cha,
3768  ae_int_t n,
3769  ae_bool isupper,
3770  /* Real */ ae_matrix* b,
3771  ae_int_t m,
3772  ae_int_t* info,
3773  densesolverreport* rep,
3774  /* Real */ ae_matrix* x,
3775  ae_state *_state);
3777  ae_int_t n,
3778  ae_bool isupper,
3779  /* Real */ ae_matrix* b,
3780  ae_int_t m,
3781  ae_int_t* info,
3782  densesolverreport* rep,
3783  /* Real */ ae_matrix* x, ae_state *_state);
3785  ae_int_t n,
3786  ae_bool isupper,
3787  /* Real */ ae_matrix* b,
3788  ae_int_t m,
3789  ae_int_t* info,
3790  ae_state *_state);
3792  ae_int_t n,
3793  ae_bool isupper,
3794  /* Real */ ae_matrix* b,
3795  ae_int_t m,
3796  ae_int_t* info, ae_state *_state);
3797 void spdmatrixcholeskysolve(/* Real */ ae_matrix* cha,
3798  ae_int_t n,
3799  ae_bool isupper,
3800  /* Real */ ae_vector* b,
3801  ae_int_t* info,
3802  densesolverreport* rep,
3803  /* Real */ ae_vector* x,
3804  ae_state *_state);
3806  ae_int_t n,
3807  ae_bool isupper,
3808  /* Real */ ae_vector* b,
3809  ae_int_t* info,
3810  ae_state *_state);
3811 void hpdmatrixsolvem(/* Complex */ ae_matrix* a,
3812  ae_int_t n,
3813  ae_bool isupper,
3814  /* Complex */ ae_matrix* b,
3815  ae_int_t m,
3816  ae_int_t* info,
3817  densesolverreport* rep,
3818  /* Complex */ ae_matrix* x,
3819  ae_state *_state);
3820 void _pexec_hpdmatrixsolvem(/* Complex */ ae_matrix* a,
3821  ae_int_t n,
3822  ae_bool isupper,
3823  /* Complex */ ae_matrix* b,
3824  ae_int_t m,
3825  ae_int_t* info,
3826  densesolverreport* rep,
3827  /* Complex */ ae_matrix* x, ae_state *_state);
3828 void hpdmatrixsolvemfast(/* Complex */ ae_matrix* a,
3829  ae_int_t n,
3830  ae_bool isupper,
3831  /* Complex */ ae_matrix* b,
3832  ae_int_t m,
3833  ae_int_t* info,
3834  ae_state *_state);
3836  ae_int_t n,
3837  ae_bool isupper,
3838  /* Complex */ ae_matrix* b,
3839  ae_int_t m,
3840  ae_int_t* info, ae_state *_state);
3841 void hpdmatrixsolve(/* Complex */ ae_matrix* a,
3842  ae_int_t n,
3843  ae_bool isupper,
3844  /* Complex */ ae_vector* b,
3845  ae_int_t* info,
3846  densesolverreport* rep,
3847  /* Complex */ ae_vector* x,
3848  ae_state *_state);
3849 void _pexec_hpdmatrixsolve(/* Complex */ ae_matrix* a,
3850  ae_int_t n,
3851  ae_bool isupper,
3852  /* Complex */ ae_vector* b,
3853  ae_int_t* info,
3854  densesolverreport* rep,
3855  /* Complex */ ae_vector* x, ae_state *_state);
3856 void hpdmatrixsolvefast(/* Complex */ ae_matrix* a,
3857  ae_int_t n,
3858  ae_bool isupper,
3859  /* Complex */ ae_vector* b,
3860  ae_int_t* info,
3861  ae_state *_state);
3862 void _pexec_hpdmatrixsolvefast(/* Complex */ ae_matrix* a,
3863  ae_int_t n,
3864  ae_bool isupper,
3865  /* Complex */ ae_vector* b,
3866  ae_int_t* info, ae_state *_state);
3867 void hpdmatrixcholeskysolvem(/* Complex */ ae_matrix* cha,
3868  ae_int_t n,
3869  ae_bool isupper,
3870  /* Complex */ ae_matrix* b,
3871  ae_int_t m,
3872  ae_int_t* info,
3873  densesolverreport* rep,
3874  /* Complex */ ae_matrix* x,
3875  ae_state *_state);
3877  ae_int_t n,
3878  ae_bool isupper,
3879  /* Complex */ ae_matrix* b,
3880  ae_int_t m,
3881  ae_int_t* info,
3882  densesolverreport* rep,
3883  /* Complex */ ae_matrix* x, ae_state *_state);
3884 void hpdmatrixcholeskysolvemfast(/* Complex */ ae_matrix* cha,
3885  ae_int_t n,
3886  ae_bool isupper,
3887  /* Complex */ ae_matrix* b,
3888  ae_int_t m,
3889  ae_int_t* info,
3890  ae_state *_state);
3892  ae_int_t n,
3893  ae_bool isupper,
3894  /* Complex */ ae_matrix* b,
3895  ae_int_t m,
3896  ae_int_t* info, ae_state *_state);
3897 void hpdmatrixcholeskysolve(/* Complex */ ae_matrix* cha,
3898  ae_int_t n,
3899  ae_bool isupper,
3900  /* Complex */ ae_vector* b,
3901  ae_int_t* info,
3902  densesolverreport* rep,
3903  /* Complex */ ae_vector* x,
3904  ae_state *_state);
3905 void hpdmatrixcholeskysolvefast(/* Complex */ ae_matrix* cha,
3906  ae_int_t n,
3907  ae_bool isupper,
3908  /* Complex */ ae_vector* b,
3909  ae_int_t* info,
3910  ae_state *_state);
3911 void rmatrixsolvels(/* Real */ ae_matrix* a,
3912  ae_int_t nrows,
3913  ae_int_t ncols,
3914  /* Real */ ae_vector* b,
3915  double threshold,
3916  ae_int_t* info,
3917  densesolverlsreport* rep,
3918  /* Real */ ae_vector* x,
3919  ae_state *_state);
3921  ae_int_t nrows,
3922  ae_int_t ncols,
3923  /* Real */ ae_vector* b,
3924  double threshold,
3925  ae_int_t* info,
3926  densesolverlsreport* rep,
3927  /* Real */ ae_vector* x, ae_state *_state);
3928 void _densesolverreport_init(void* _p, ae_state *_state);
3929 void _densesolverreport_init_copy(void* _dst, void* _src, ae_state *_state);
3932 void _densesolverlsreport_init(void* _p, ae_state *_state);
3933 void _densesolverlsreport_init_copy(void* _dst, void* _src, ae_state *_state);
3937  ae_int_t n,
3938  linlsqrstate* state,
3939  ae_state *_state);
3941  /* Real */ ae_vector* b,
3942  ae_state *_state);
3946  double lambdai,
3947  ae_state *_state);
3950  sparsematrix* a,
3951  /* Real */ ae_vector* b,
3952  ae_state *_state);
3954  double epsa,
3955  double epsb,
3956  ae_int_t maxits,
3957  ae_state *_state);
3959  /* Real */ ae_vector* x,
3960  linlsqrreport* rep,
3961  ae_state *_state);
3963  ae_bool needxrep,
3964  ae_state *_state);
3965 void linlsqrrestart(linlsqrstate* state, ae_state *_state);
3966 void _linlsqrstate_init(void* _p, ae_state *_state);
3967 void _linlsqrstate_init_copy(void* _dst, void* _src, ae_state *_state);
3968 void _linlsqrstate_clear(void* _p);
3969 void _linlsqrstate_destroy(void* _p);
3970 void _linlsqrreport_init(void* _p, ae_state *_state);
3971 void _linlsqrreport_init_copy(void* _dst, void* _src, ae_state *_state);
3972 void _linlsqrreport_clear(void* _p);
3973 void _linlsqrreport_destroy(void* _p);
3974 void polynomialsolve(/* Real */ ae_vector* a,
3975  ae_int_t n,
3976  /* Complex */ ae_vector* x,
3978  ae_state *_state);
3979 void _polynomialsolverreport_init(void* _p, ae_state *_state);
3980 void _polynomialsolverreport_init_copy(void* _dst, void* _src, ae_state *_state);
3984  ae_int_t m,
3985  /* Real */ ae_vector* x,
3986  nleqstate* state,
3987  ae_state *_state);
3989  double epsf,
3990  ae_int_t maxits,
3991  ae_state *_state);
3992 void nleqsetxrep(nleqstate* state, ae_bool needxrep, ae_state *_state);
3993 void nleqsetstpmax(nleqstate* state, double stpmax, ae_state *_state);
3996  /* Real */ ae_vector* x,
3997  nleqreport* rep,
3998  ae_state *_state);
4000  /* Real */ ae_vector* x,
4001  nleqreport* rep,
4002  ae_state *_state);
4004  /* Real */ ae_vector* x,
4005  ae_state *_state);
4006 void _nleqstate_init(void* _p, ae_state *_state);
4007 void _nleqstate_init_copy(void* _dst, void* _src, ae_state *_state);
4008 void _nleqstate_clear(void* _p);
4009 void _nleqstate_destroy(void* _p);
4010 void _nleqreport_init(void* _p, ae_state *_state);
4011 void _nleqreport_init_copy(void* _dst, void* _src, ae_state *_state);
4012 void _nleqreport_clear(void* _p);
4013 void _nleqreport_destroy(void* _p);
4014 void lincgcreate(ae_int_t n, lincgstate* state, ae_state *_state);
4016  /* Real */ ae_vector* x,
4017  ae_state *_state);
4018 void lincgsetb(lincgstate* state,
4019  /* Real */ ae_vector* b,
4020  ae_state *_state);
4021 void lincgsetprecunit(lincgstate* state, ae_state *_state);
4022 void lincgsetprecdiag(lincgstate* state, ae_state *_state);
4024  double epsf,
4025  ae_int_t maxits,
4026  ae_state *_state);
4029  sparsematrix* a,
4030  ae_bool isupper,
4031  /* Real */ ae_vector* b,
4032  ae_state *_state);
4034  /* Real */ ae_vector* x,
4035  lincgreport* rep,
4036  ae_state *_state);
4038  ae_int_t srf,
4039  ae_state *_state);
4041  ae_int_t freq,
4042  ae_state *_state);
4043 void lincgsetxrep(lincgstate* state, ae_bool needxrep, ae_state *_state);
4044 void lincgrestart(lincgstate* state, ae_state *_state);
4045 void _lincgstate_init(void* _p, ae_state *_state);
4046 void _lincgstate_init_copy(void* _dst, void* _src, ae_state *_state);
4047 void _lincgstate_clear(void* _p);
4048 void _lincgstate_destroy(void* _p);
4049 void _lincgreport_init(void* _p, ae_state *_state);
4050 void _lincgreport_init_copy(void* _dst, void* _src, ae_state *_state);
4051 void _lincgreport_clear(void* _p);
4052 void _lincgreport_destroy(void* _p);
4053 
4054 }
4055 #endif
4056 
void nleqresults(const nleqstate &state, real_1d_array &x, nleqreport &rep)
void lincgsolvesparse(const lincgstate &state, const sparsematrix &a, const bool isupper, const real_1d_array &b)
alglib_impl::linlsqrreport * p_struct
Definition: solvers.h:302
void _densesolverlsreport_destroy(void *_p)
void nleqcreatelm(const ae_int_t n, const ae_int_t m, const real_1d_array &x, nleqstate &state)
void _pexec_hpdmatrixsolvemfast(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void spdmatrixcholeskysolvemfast(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
ae_bool & needfij
Definition: solvers.h:364
void _pexec_rmatrixsolvemfast(ae_matrix *a, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void _linlsqrreport_clear(void *_p)
void cmatrixlusolvem(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void nleqcreatelm(ae_int_t n, ae_int_t m, ae_vector *x, nleqstate *state, ae_state *_state)
void lincgsetprecunit(lincgstate *state, ae_state *_state)
void linlsqrsetlambdai(const linlsqrstate &state, const double lambdai)
void smp_spdmatrixsolvefast(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info)
alglib_impl::lincgreport * c_ptr()
alglib_impl::nleqreport * p_struct
Definition: solvers.h:389
void _pexec_hpdmatrixcholeskysolvem(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void hpdmatrixcholeskysolvefast(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info)
void smp_cmatrixlusolvem(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
void lincgsetstartingpoint(lincgstate *state, ae_vector *x, ae_state *_state)
void rmatrixlusolvemfast(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info)
void hpdmatrixsolvem(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
void _pexec_cmatrixlusolvem(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void smp_spdmatrixsolve(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x)
void cmatrixsolvefast(ae_matrix *a, ae_int_t n, ae_vector *b, ae_int_t *info, ae_state *_state)
void _linlsqrstate_init(void *_p, ae_state *_state)
void _lincgstate_clear(void *_p)
void cmatrixsolvefast(const complex_2d_array &a, const ae_int_t n, const complex_1d_array &b, ae_int_t &info)
ae_int_t & nmv
Definition: solvers.h:455
alglib_impl::linlsqrstate * c_ptr()
void smp_rmatrixsolvemfast(const real_2d_array &a, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info)
void linlsqrsetlambdai(linlsqrstate *state, double lambdai, ae_state *_state)
ae_int_t & nfunc
Definition: solvers.h:397
void hpdmatrixsolvefast(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, ae_state *_state)
void _densesolverreport_destroy(void *_p)
void rmatrixsolvemfast(const real_2d_array &a, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info)
void _nleqreport_destroy(void *_p)
nleqstate(const nleqstate &rhs)
void _pexec_rmatrixlusolvemfast(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void _pexec_rmatrixsolve(ae_matrix *a, ae_int_t n, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void linlsqrresults(linlsqrstate *state, ae_vector *x, linlsqrreport *rep, ae_state *_state)
linlsqrreport(const linlsqrreport &rhs)
void spdmatrixsolvem(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
void _lincgstate_init(void *_p, ae_state *_state)
_linlsqrreport_owner & operator=(const _linlsqrreport_owner &rhs)
alglib_impl::linlsqrreport * c_ptr()
void nleqsetstpmax(const nleqstate &state, const double stpmax)
void rmatrixmixedsolvem(ae_matrix *a, ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
alglib_impl::densesolverreport * c_ptr()
nleqreport(const nleqreport &rhs)
void cmatrixmixedsolve(const complex_2d_array &a, const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x)
void linlsqrsolvesparse(const linlsqrstate &state, const sparsematrix &a, const real_1d_array &b)
void _lincgreport_destroy(void *_p)
void smp_spdmatrixcholeskysolvem(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
ae_int_t & njac
Definition: solvers.h:398
void linlsqrcreate(ae_int_t m, ae_int_t n, linlsqrstate *state, ae_state *_state)
void rmatrixsolve(const real_2d_array &a, const ae_int_t n, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x)
void cmatrixsolvemfast(ae_matrix *a, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void _pexec_spdmatrixsolve(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void smp_cmatrixlusolvemfast(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info)
virtual ~nleqreport()
void cmatrixlusolve(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void spdmatrixsolve(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x)
void _densesolverlsreport_init(void *_p, ae_state *_state)
void _nleqreport_init(void *_p, ae_state *_state)
void smp_hpdmatrixcholeskysolvemfast(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info)
void linlsqrsetxrep(linlsqrstate *state, ae_bool needxrep, ae_state *_state)
void _pexec_cmatrixsolve(ae_matrix *a, ae_int_t n, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
ae_int_t & terminationtype
Definition: solvers.h:399
double & f
Definition: solvers.h:366
void linlsqrcreate(const ae_int_t m, const ae_int_t n, linlsqrstate &state)
void lincgsetrupdatefreq(lincgstate *state, ae_int_t freq, ae_state *_state)
void hpdmatrixcholeskysolvefast(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, ae_state *_state)
void _pexec_spdmatrixsolvem(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void rmatrixmixedsolve(ae_matrix *a, ae_matrix *lua, ae_vector *p, ae_int_t n, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void smp_hpdmatrixcholeskysolvem(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
alglib_impl::nleqstate * c_ptr()
void _pexec_cmatrixsolvem(ae_matrix *a, ae_int_t n, ae_matrix *b, ae_int_t m, ae_bool rfs, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void _pexec_spdmatrixcholeskysolvem(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void hpdmatrixsolvefast(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info)
bool nleqiteration(const nleqstate &state)
_lincgstate_owner & operator=(const _lincgstate_owner &rhs)
void linlsqrsetxrep(const linlsqrstate &state, const bool needxrep)
void smp_rmatrixlusolvemfast(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info)
void rmatrixlusolvefast(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_vector *b, ae_int_t *info, ae_state *_state)
void rmatrixsolvem(const real_2d_array &a, const ae_int_t n, const real_2d_array &b, const ae_int_t m, const bool rfs, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
void smp_hpdmatrixsolvem(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
void hpdmatrixcholeskysolvem(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void lincgsetrestartfreq(const lincgstate &state, const ae_int_t srf)
void rmatrixsolve(ae_matrix *a, ae_int_t n, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void linlsqrsetprecunit(const linlsqrstate &state)
void spdmatrixcholeskysolvemfast(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info)
void lincgsetprecunit(const lincgstate &state)
void nleqsetxrep(nleqstate *state, ae_bool needxrep, ae_state *_state)
void rmatrixsolvels(ae_matrix *a, ae_int_t nrows, ae_int_t ncols, ae_vector *b, double threshold, ae_int_t *info, densesolverlsreport *rep, ae_vector *x, ae_state *_state)
lincgreport(const lincgreport &rhs)
void spdmatrixsolvem(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void _linlsqrstate_init_copy(void *_dst, void *_src, ae_state *_state)
_polynomialsolverreport_owner & operator=(const _polynomialsolverreport_owner &rhs)
void smp_spdmatrixsolvemfast(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info)
void lincgsetrestartfreq(lincgstate *state, ae_int_t srf, ae_state *_state)
void hpdmatrixsolvemfast(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
densesolverreport(const densesolverreport &rhs)
void hpdmatrixcholeskysolve(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
alglib_impl::densesolverreport * p_struct
Definition: solvers.h:217
void linlsqrsetcond(const linlsqrstate &state, const double epsa, const double epsb, const ae_int_t maxits)
void nleqsetstpmax(nleqstate *state, double stpmax, ae_state *_state)
void smp_hpdmatrixsolve(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x)
void spdmatrixcholeskysolvem(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
void cmatrixsolve(ae_matrix *a, ae_int_t n, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
real_1d_array x
Definition: solvers.h:369
ae_bool & needf
Definition: solvers.h:363
_densesolverlsreport_owner & operator=(const _densesolverlsreport_owner &rhs)
_lincgreport_owner & operator=(const _lincgreport_owner &rhs)
void hpdmatrixcholeskysolvemfast(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info)
void nleqrestartfrom(nleqstate *state, ae_vector *x, ae_state *_state)
void smp_cmatrixsolvemfast(const complex_2d_array &a, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info)
polynomialsolverreport(const polynomialsolverreport &rhs)
alglib_impl::linlsqrstate * p_struct
Definition: solvers.h:278
void smp_cmatrixsolve(const complex_2d_array &a, const ae_int_t n, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x)
void rmatrixmixedsolvem(const real_2d_array &a, const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
void _pexec_spdmatrixsolvemfast(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
ae_bool & xupdated
Definition: solvers.h:365
void lincgsetb(lincgstate *state, ae_vector *b, ae_state *_state)
void _nleqstate_clear(void *_p)
void rmatrixsolvefast(ae_matrix *a, ae_int_t n, ae_vector *b, ae_int_t *info, ae_state *_state)
void _polynomialsolverreport_init(void *_p, ae_state *_state)
void smp_cmatrixsolvem(const complex_2d_array &a, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, const bool rfs, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
ae_int_t & nmv
Definition: solvers.h:310
void _densesolverreport_clear(void *_p)
void lincgsetstartingpoint(const lincgstate &state, const real_1d_array &x)
void spdmatrixsolvefast(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info)
virtual ~lincgstate()
void rmatrixlusolve(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x)
void smp_hpdmatrixsolvefast(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info)
ae_bool lincgiteration(lincgstate *state, ae_state *_state)
void _lincgstate_destroy(void *_p)
#define ae_bool
Definition: ap.h:193
lincgreport & operator=(const lincgreport &rhs)
ae_bool linlsqriteration(linlsqrstate *state, ae_state *_state)
void cmatrixlusolve(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x)
void _pexec_hpdmatrixsolve(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void lincgsetxrep(const lincgstate &state, const bool needxrep)
void lincgsolvesparse(lincgstate *state, sparsematrix *a, ae_bool isupper, ae_vector *b, ae_state *_state)
alglib_impl::densesolverlsreport * p_struct
Definition: solvers.h:245
void smp_rmatrixlusolvem(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
ae_bool nleqiteration(nleqstate *state, ae_state *_state)
void spdmatrixcholeskysolvem(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void hpdmatrixcholeskysolvem(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
ae_int_t & terminationtype
Definition: solvers.h:456
void lincgcreate(const ae_int_t n, lincgstate &state)
void _nleqreport_init_copy(void *_dst, void *_src, ae_state *_state)
void _nleqstate_init_copy(void *_dst, void *_src, ae_state *_state)
void rmatrixmixedsolve(const real_2d_array &a, const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x)
densesolverlsreport & operator=(const densesolverlsreport &rhs)
void spdmatrixsolvemfast(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
real_2d_array j
Definition: solvers.h:368
void _pexec_cmatrixsolvemfast(ae_matrix *a, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void hpdmatrixcholeskysolvemfast(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void hpdmatrixsolve(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
virtual ~lincgreport()
void cmatrixlusolvemfast(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info)
alglib_impl::densesolverlsreport * c_ptr()
void hpdmatrixcholeskysolve(const complex_2d_array &cha, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x)
void cmatrixlusolvemfast(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void linlsqrsetprecdiag(linlsqrstate *state, ae_state *_state)
densesolverlsreport(const densesolverlsreport &rhs)
void hpdmatrixsolvem(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
struct alglib_impl::ae_vector ae_vector
void smp_spdmatrixsolvem(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
void cmatrixlusolvefast(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_1d_array &b, ae_int_t &info)
void cmatrixsolvem(const complex_2d_array &a, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, const bool rfs, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
densesolverreport & operator=(const densesolverreport &rhs)
void hpdmatrixsolve(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x)
void _densesolverlsreport_init_copy(void *_dst, void *_src, ae_state *_state)
alglib_impl::nleqreport * c_ptr()
void smp_rmatrixsolvefast(const real_2d_array &a, const ae_int_t n, const real_1d_array &b, ae_int_t &info)
void _polynomialsolverreport_destroy(void *_p)
void rmatrixsolvels(const real_2d_array &a, const ae_int_t nrows, const ae_int_t ncols, const real_1d_array &b, const double threshold, ae_int_t &info, densesolverlsreport &rep, real_1d_array &x)
void nleqrestartfrom(const nleqstate &state, const real_1d_array &x)
void lincgsetcond(const lincgstate &state, const double epsf, const ae_int_t maxits)
void _pexec_rmatrixsolvefast(ae_matrix *a, ae_int_t n, ae_vector *b, ae_int_t *info, ae_state *_state)
_densesolverreport_owner & operator=(const _densesolverreport_owner &rhs)
void cmatrixsolvem(ae_matrix *a, ae_int_t n, ae_matrix *b, ae_int_t m, ae_bool rfs, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void rmatrixsolvefast(const real_2d_array &a, const ae_int_t n, const real_1d_array &b, ae_int_t &info)
void linlsqrsolvesparse(linlsqrstate *state, sparsematrix *a, ae_vector *b, ae_state *_state)
void _pexec_rmatrixsolvels(ae_matrix *a, ae_int_t nrows, ae_int_t ncols, ae_vector *b, double threshold, ae_int_t *info, densesolverlsreport *rep, ae_vector *x, ae_state *_state)
void _nleqreport_clear(void *_p)
void linlsqrresults(const linlsqrstate &state, real_1d_array &x, linlsqrreport &rep)
void smp_hpdmatrixsolvemfast(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info)
void nleqsetcond(const nleqstate &state, const double epsf, const ae_int_t maxits)
void nleqsetxrep(const nleqstate &state, const bool needxrep)
alglib_impl::polynomialsolverreport * c_ptr()
alglib_impl::lincgstate * p_struct
Definition: solvers.h:424
void spdmatrixsolvemfast(const real_2d_array &a, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info)
void _linlsqrreport_init_copy(void *_dst, void *_src, ae_state *_state)
alglib_impl::ae_int_t ae_int_t
Definition: ap.h:965
void nleqsetcond(nleqstate *state, double epsf, ae_int_t maxits, ae_state *_state)
void _pexec_cmatrixlusolvemfast(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void linlsqrsetb(linlsqrstate *state, ae_vector *b, ae_state *_state)
void nleqresultsbuf(nleqstate *state, ae_vector *x, nleqreport *rep, ae_state *_state)
void hpdmatrixsolvemfast(const complex_2d_array &a, const ae_int_t n, const bool isupper, const complex_2d_array &b, const ae_int_t m, ae_int_t &info)
void _pexec_hpdmatrixcholeskysolvemfast(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void lincgsetprecdiag(lincgstate *state, ae_state *_state)
void _pexec_rmatrixsolvem(ae_matrix *a, ae_int_t n, ae_matrix *b, ae_int_t m, ae_bool rfs, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void _densesolverlsreport_clear(void *_p)
void spdmatrixcholeskysolve(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x)
nleqreport & operator=(const nleqreport &rhs)
void lincgsetcond(lincgstate *state, double epsf, ae_int_t maxits, ae_state *_state)
_nleqreport_owner & operator=(const _nleqreport_owner &rhs)
void cmatrixlusolvem(const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
real_1d_array fi
Definition: solvers.h:367
void _pexec_hpdmatrixsolvem(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
_linlsqrstate_owner & operator=(const _linlsqrstate_owner &rhs)
nleqstate & operator=(const nleqstate &rhs)
void lincgrestart(lincgstate *state, ae_state *_state)
void lincgsetprecdiag(const lincgstate &state)
void linlsqrsetprecunit(linlsqrstate *state, ae_state *_state)
ae_int_t & terminationtype
Definition: solvers.h:311
void smp_spdmatrixcholeskysolvemfast(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_2d_array &b, const ae_int_t m, ae_int_t &info)
double beta(double a, double b, ae_state *_state)
void rmatrixlusolvem(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
ae_int_t & iterationscount
Definition: solvers.h:309
void rmatrixsolvem(ae_matrix *a, ae_int_t n, ae_matrix *b, ae_int_t m, ae_bool rfs, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void lincgsetrupdatefreq(const lincgstate &state, const ae_int_t freq)
void nleqresultsbuf(const nleqstate &state, real_1d_array &x, nleqreport &rep)
void polynomialsolve(const real_1d_array &a, const ae_int_t n, complex_1d_array &x, polynomialsolverreport &rep)
linlsqrstate(const linlsqrstate &rhs)
void spdmatrixsolvefast(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, ae_state *_state)
void rmatrixlusolvem(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
struct alglib_impl::ae_matrix ae_matrix
void lincgresults(const lincgstate &state, real_1d_array &x, lincgreport &rep)
void spdmatrixcholeskysolve(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void _lincgreport_init_copy(void *_dst, void *_src, ae_state *_state)
void _linlsqrreport_init(void *_p, ae_state *_state)
alglib_impl::lincgreport * p_struct
Definition: solvers.h:447
void rmatrixlusolvefast(const real_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const real_1d_array &b, ae_int_t &info)
ae_int_t & iterationscount
Definition: solvers.h:396
void nleqsolve(nleqstate &state, void(*func)(const real_1d_array &x, double &func, void *ptr), void(*jac)(const real_1d_array &x, real_1d_array &fi, real_2d_array &jac, void *ptr), void(*rep)(const real_1d_array &x, double func, void *ptr)=NULL, void *ptr=NULL)
void rmatrixlusolve(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void _pexec_spdmatrixcholeskysolvemfast(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void linlsqrsetcond(linlsqrstate *state, double epsa, double epsb, ae_int_t maxits, ae_state *_state)
void _pexec_spdmatrixsolvefast(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, ae_state *_state)
void cmatrixsolvemfast(const complex_2d_array &a, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info)
void _polynomialsolverreport_init_copy(void *_dst, void *_src, ae_state *_state)
void _pexec_cmatrixsolvefast(ae_matrix *a, ae_int_t n, ae_vector *b, ae_int_t *info, ae_state *_state)
void cmatrixmixedsolvem(ae_matrix *a, ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
void _linlsqrstate_destroy(void *_p)
void _lincgstate_init_copy(void *_dst, void *_src, ae_state *_state)
void smp_rmatrixsolve(const real_2d_array &a, const ae_int_t n, const real_1d_array &b, ae_int_t &info, densesolverreport &rep, real_1d_array &x)
void spdmatrixcholeskysolvefast(const real_2d_array &cha, const ae_int_t n, const bool isupper, const real_1d_array &b, ae_int_t &info)
_nleqstate_owner & operator=(const _nleqstate_owner &rhs)
void smp_rmatrixsolvels(const real_2d_array &a, const ae_int_t nrows, const ae_int_t ncols, const real_1d_array &b, const double threshold, ae_int_t &info, densesolverlsreport &rep, real_1d_array &x)
lincgstate & operator=(const lincgstate &rhs)
void spdmatrixsolve(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
alglib_impl::lincgstate * c_ptr()
lincgstate(const lincgstate &rhs)
void _nleqstate_init(void *_p, ae_state *_state)
alglib_impl::nleqstate * p_struct
Definition: solvers.h:356
void lincgcreate(ae_int_t n, lincgstate *state, ae_state *_state)
linlsqrstate & operator=(const linlsqrstate &rhs)
void spdmatrixcholeskysolvefast(ae_matrix *cha, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, ae_state *_state)
linlsqrreport & operator=(const linlsqrreport &rhs)
void lincgsetxrep(lincgstate *state, ae_bool needxrep, ae_state *_state)
void smp_rmatrixsolvem(const real_2d_array &a, const ae_int_t n, const real_2d_array &b, const ae_int_t m, const bool rfs, ae_int_t &info, densesolverreport &rep, real_2d_array &x)
alglib_impl::polynomialsolverreport * p_struct
Definition: solvers.h:330
void cmatrixmixedsolve(ae_matrix *a, ae_matrix *lua, ae_vector *p, ae_int_t n, ae_vector *b, ae_int_t *info, densesolverreport *rep, ae_vector *x, ae_state *_state)
void _densesolverreport_init_copy(void *_dst, void *_src, ae_state *_state)
void cmatrixsolve(const complex_2d_array &a, const ae_int_t n, const complex_1d_array &b, ae_int_t &info, densesolverreport &rep, complex_1d_array &x)
void _lincgreport_clear(void *_p)
void linlsqrsetprecdiag(const linlsqrstate &state)
void linlsqrrestart(linlsqrstate *state, ae_state *_state)
ptrdiff_t ae_int_t
Definition: ap.h:185
void _linlsqrreport_destroy(void *_p)
void _pexec_rmatrixlusolvem(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, densesolverreport *rep, ae_matrix *x, ae_state *_state)
ae_int_t & iterationscount
Definition: solvers.h:454
void _nleqstate_destroy(void *_p)
void _linlsqrstate_clear(void *_p)
void polynomialsolve(ae_vector *a, ae_int_t n, ae_vector *x, polynomialsolverreport *rep, ae_state *_state)
polynomialsolverreport & operator=(const polynomialsolverreport &rhs)
void rmatrixlusolvemfast(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
virtual ~nleqstate()
void smp_cmatrixsolvefast(const complex_2d_array &a, const ae_int_t n, const complex_1d_array &b, ae_int_t &info)
void nleqresults(nleqstate *state, ae_vector *x, nleqreport *rep, ae_state *_state)
void _polynomialsolverreport_clear(void *_p)
void cmatrixlusolvefast(ae_matrix *lua, ae_vector *p, ae_int_t n, ae_vector *b, ae_int_t *info, ae_state *_state)
void cmatrixmixedsolvem(const complex_2d_array &a, const complex_2d_array &lua, const integer_1d_array &p, const ae_int_t n, const complex_2d_array &b, const ae_int_t m, ae_int_t &info, densesolverreport &rep, complex_2d_array &x)
void _densesolverreport_init(void *_p, ae_state *_state)
void lincgresults(lincgstate *state, ae_vector *x, lincgreport *rep, ae_state *_state)
void _lincgreport_init(void *_p, ae_state *_state)
void rmatrixsolvemfast(ae_matrix *a, ae_int_t n, ae_matrix *b, ae_int_t m, ae_int_t *info, ae_state *_state)
void _pexec_hpdmatrixsolvefast(ae_matrix *a, ae_int_t n, ae_bool isupper, ae_vector *b, ae_int_t *info, ae_state *_state)
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich