Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GaussianProcessTuning/ILNumerics.2.14.4735.573/Native/lapack/IILLapack.cs @ 12858

Last change on this file since 12858 was 9102, checked in by gkronber, 12 years ago

#1967: ILNumerics source for experimentation

File size: 74.3 KB
Line 
1///
2///    This file is part of ILNumerics Community Edition.
3///
4///    ILNumerics Community Edition - high performance computing for applications.
5///    Copyright (C) 2006 - 2012 Haymo Kutschbach, http://ilnumerics.net
6///
7///    ILNumerics Community Edition is free software: you can redistribute it and/or modify
8///    it under the terms of the GNU General Public License version 3 as published by
9///    the Free Software Foundation.
10///
11///    ILNumerics Community Edition 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///    You should have received a copy of the GNU General Public License
17///    along with ILNumerics Community Edition. See the file License.txt in the root
18///    of your distribution package. If not, see <http://www.gnu.org/licenses/>.
19///
20///    In addition this software uses the following components and/or licenses:
21///
22///    =================================================================================
23///    The Open Toolkit Library License
24///   
25///    Copyright (c) 2006 - 2009 the Open Toolkit library.
26///   
27///    Permission is hereby granted, free of charge, to any person obtaining a copy
28///    of this software and associated documentation files (the "Software"), to deal
29///    in the Software without restriction, including without limitation the rights to
30///    use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
31///    the Software, and to permit persons to whom the Software is furnished to do
32///    so, subject to the following conditions:
33///
34///    The above copyright notice and this permission notice shall be included in all
35///    copies or substantial portions of the Software.
36///
37///    =================================================================================
38///   
39
40#pragma warning disable 1591
41
42using System;
43using System.Collections.Generic;
44using System.Text;
45
46namespace ILNumerics.Native {
47    /// <summary>
48    /// Interface to all LAPACK/BLAS functions available
49    /// </summary>
50    /// <remarks>Each native module must implement this interface explicitly. Calls
51    /// to native functions are made virtual by calling functions of this interface.
52    /// Therefore the user can transparently call any function regardless of the
53    /// plattform the assymbly (currently) runs on. The native modules implementing
54    /// this interface take care of the details of implementation.
55    /// <para>Usually users of the library will not have to handle with this interface.
56    /// Its functions will be used from inside built in functions and are therefore wrapped
57    /// (mainly from inside <see cref="ILNumerics.ILMath">ILNumerics.ILMath</see>).</para>
58    /// <para>Every LAPACK/BLAS function is explicitly implemented for any type supported.
59    /// e.g. IILLapack includes four functions doing general matrix multiply: dgemm, zgemm, cgemm and sgemm -
60    /// for all four floating point datatypes supported from the LAPACK package.</para>
61    /// <para>LAPACK is an open source linear algebra functions package optimized for
62    /// use together with highly natively optimized BLAS functions. A LAPACK guide is
63    /// available in the internet: <see href="http://www.netlib.org/lapack">www.netlib.org</see>.</para>
64    /// </remarks>
65    [System.Security.SuppressUnmanagedCodeSecurity]
66    public interface IILLapack {
67       
68        #region ?GEMM
69
70        /// <summary>
71        /// Wrapper implementiation for ATLAS GeneralMatrixMultiply
72        /// </summary>
73        /// <param name="TransA">Transposition state for matrix A: one of the constants in enum CBlas_Transpose</param>
74        /// <param name="TransB">Transposition state for matrix B: one of the constants in enum CBlas_Transpose</param>
75        /// <param name="M">Number of rows in A</param>
76        /// <param name="N">Number of columns in B</param>
77        /// <param name="K">Number of columns in A and number of rows in B</param>
78        /// <param name="alpha">multiplicationi factor for A</param>
79        /// <param name="A">pointer to array A</param>
80        /// <param name="lda">distance between first elements of each column for column based orientation or
81        /// distance between first elements of each row for row based orientation for matrix A</param>
82        /// <param name="B">pointer to array B</param>
83        /// <param name="ldb">distance between first elements of each column for column based orientation or
84        /// distance between first elements of each row for row based orientation for matrix B</param>
85        /// <param name="beta">multiplication faktor for matrix B</param>
86        /// <param name="C">pointer to predefined array C of neccessary length</param>
87        /// <param name="ldc">distance between first elements of each column for column based orientation or
88        /// distance between first elements of each row for row based orientation for matrix C</param>
89        /// <remarks>All parameters except C are readonly. Only elements of matrix C will be altered. C must be a predefined
90        /// continous array of size MxN</remarks>
91        void  dgemm (char TransA, char TransB, int M, int N, int K,
92             double alpha,  IntPtr A, int lda,
93            IntPtr B, int ldb,
94             double beta,  double [] C, int ldc);
95
96        /// <summary>
97        /// Wrapper implementiation for ATLAS GeneralMatrixMultiply
98        /// </summary>
99        /// <param name="TransA">Transposition state for matrix A: one of the constants in enum CBlas_Transpose</param>
100        /// <param name="TransB">Transposition state for matrix B: one of the constants in enum CBlas_Transpose</param>
101        /// <param name="M">Number of rows in A</param>
102        /// <param name="N">Number of columns in B</param>
103        /// <param name="K">Number of columns in A and number of rows in B</param>
104        /// <param name="alpha">multiplicationi factor for A</param>
105        /// <param name="A">pointer to array A</param>
106        /// <param name="lda">distance between first elements of each column for column based orientation or
107        /// distance between first elements of each row for row based orientation for matrix A</param>
108        /// <param name="B">pointer to array B</param>
109        /// <param name="ldb">distance between first elements of each column for column based orientation or
110        /// distance between first elements of each row for row based orientation for matrix B</param>
111        /// <param name="beta">multiplication faktor for matrix B</param>
112        /// <param name="C">pointer to predefined array C of neccessary length</param>
113        /// <param name="ldc">distance between first elements of each column for column based orientation or
114        /// distance between first elements of each row for row based orientation for matrix C</param>
115        /// <remarks>All parameters except C are readonly. Only elements of matrix C will be altered. C must be a predefined
116        /// continous array of size MxN</remarks>
117        void  sgemm (char TransA, char TransB, int M, int N, int K,
118            float alpha,  IntPtr A, int lda,
119            IntPtr B, int ldb,
120            float beta,  float [] C, int ldc);
121       
122
123        /// <summary>
124        /// Wrapper implementiation for ATLAS GeneralMatrixMultiply
125        /// </summary>
126        /// <param name="TransA">Transposition state for matrix A: one of the constants in enum CBlas_Transpose</param>
127        /// <param name="TransB">Transposition state for matrix B: one of the constants in enum CBlas_Transpose</param>
128        /// <param name="M">Number of rows in A</param>
129        /// <param name="N">Number of columns in B</param>
130        /// <param name="K">Number of columns in A and number of rows in B</param>
131        /// <param name="alpha">multiplicationi factor for A</param>
132        /// <param name="A">pointer to array A</param>
133        /// <param name="lda">distance between first elements of each column for column based orientation or
134        /// distance between first elements of each row for row based orientation for matrix A</param>
135        /// <param name="B">pointer to array B</param>
136        /// <param name="ldb">distance between first elements of each column for column based orientation or
137        /// distance between first elements of each row for row based orientation for matrix B</param>
138        /// <param name="beta">multiplication faktor for matrix B</param>
139        /// <param name="C">pointer to predefined array C of neccessary length</param>
140        /// <param name="ldc">distance between first elements of each column for column based orientation or
141        /// distance between first elements of each row for row based orientation for matrix C</param>
142        /// <remarks>All parameters except C are readonly. Only elements of matrix C will be altered. C must be a predefined
143        /// continous array of size MxN</remarks>
144        void  cgemm (char TransA, char TransB, int M, int N, int K,
145            fcomplex alpha,  IntPtr A, int lda,
146            IntPtr B, int ldb,
147            fcomplex beta,  fcomplex [] C, int ldc);
148       
149
150        /// <summary>
151        /// Wrapper implementiation for ATLAS GeneralMatrixMultiply
152        /// </summary>
153        /// <param name="TransA">Transposition state for matrix A: one of the constants in enum CBlas_Transpose</param>
154        /// <param name="TransB">Transposition state for matrix B: one of the constants in enum CBlas_Transpose</param>
155        /// <param name="M">Number of rows in A</param>
156        /// <param name="N">Number of columns in B</param>
157        /// <param name="K">Number of columns in A and number of rows in B</param>
158        /// <param name="alpha">multiplicationi factor for A</param>
159        /// <param name="A">pointer to array A</param>
160        /// <param name="lda">distance between first elements of each column for column based orientation or
161        /// distance between first elements of each row for row based orientation for matrix A</param>
162        /// <param name="B">pointer to array B</param>
163        /// <param name="ldb">distance between first elements of each column for column based orientation or
164        /// distance between first elements of each row for row based orientation for matrix B</param>
165        /// <param name="beta">multiplication faktor for matrix B</param>
166        /// <param name="C">pointer to predefined array C of neccessary length</param>
167        /// <param name="ldc">distance between first elements of each column for column based orientation or
168        /// distance between first elements of each row for row based orientation for matrix C</param>
169        /// <remarks>All parameters except C are readonly. Only elements of matrix C will be altered. C must be a predefined
170        /// continous array of size MxN</remarks>
171        void  zgemm (char TransA, char TransB, int M, int N, int K,
172            complex alpha,  IntPtr A, int lda,
173            IntPtr B, int ldb,
174            complex beta,  complex [] C, int ldc);
175
176#endregion
177
178        #region ?GESDD
179        /// <summary>
180        /// singular value decomposition, new version, more memory needed
181        /// </summary>
182        /// <param name="jobz">Specifies options for computing all or part of the matrix U
183        /// <list type="table">
184        /// <listheader>
185        ///     <term>jobz value</term>
186        ///     <description>... will result in:</description>
187        /// </listheader>
188        ///     <item>
189        ///         <term>A</term>
190        ///         <description>all M columns of U and all N rows of V**T are
191        ///                     returned in the arrays U and VT</description>
192        ///     </item>
193        ///     <item>  <term>S</term>
194        ///             <description>the first min(M,N) columns of U and the first
195        ///              min(M,N) rows of V**T are returned in the arrays U
196        ///              and VT</description>
197        ///     </item>
198        ///     <item> <term>O</term> 
199        ///            <description>If M >= N, the first N columns of U are overwritten
200        ///              on the array A and all rows of V**T are returned in
201        ///              the array VT,
202        ///              otherwise, all columns of U are returned in the
203        ///              array U and the first M rows of V**T are overwritten
204        ///              in the array VT</description>
205        ///     </item>
206        ///     <item> <term>N</term>
207        ///            <description>no columns of U or rows of V**T are computed.</description>
208        ///     </item>
209        /// </list>
210        /// </param>
211        /// <param name="m">The number of rows of the input matrix A.  M greater or equal to 0.</param>
212        /// <param name="n">The number of columns of the input matrix A.  N greater or equal to 0</param>
213        /// <param name="a">On entry, the M-by-N matrix A.
214        ///          On exit, <list><item>
215        ///          if JOBZ = 'O',  A is overwritten with the first N columns
216        ///                          of U (the left singular vectors, stored
217        ///                          columnwise) if M >= N;
218        ///                          A is overwritten with the first M rows
219        ///                          of V**T (the right singular vectors, stored
220        ///                          rowwise) otherwise.</item>
221        ///          <item>if JOBZ .ne. 'O', the contents of A are destroyed.</item></list></param>
222        /// <param name="lda">The leading dimension of the array A.  LDA ge max(1,M).</param>
223        /// <param name="s">array, dimension (min(M,N)). The singular values of A, sorted so that S(i) ge S(i+1)</param>
224        /// <param name="u">array, dimension (LDU,UCOL)
225        ///          UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M &lt; N;
226        ///          UCOL = min(M,N) if JOBZ = 'S'.
227        ///          If JOBZ = 'A' or JOBZ = 'O' and M &lt; N, U contains the M-by-M
228        ///          orthogonal matrix U;
229        ///          if JOBZ = 'S', U contains the first min(M,N) columns of U
230        ///          (the left singular vectors, stored columnwise);
231        ///          if JOBZ = 'O' and M &gt;= N, or JOBZ = 'N', U is not referenced.</param>
232        /// <param name="ldu">The leading dimension of the array U.  LDU &gt;= 1; if 
233        /// JOBZ = 'S' or 'A' or JOBZ = 'O' and M &lt; N, LDU &gt;= M</param>
234        /// <param name="vt">array, dimension (LDVT,N). If JOBZ = 'A' or JOBZ = 'O' and
235        /// M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S',
236        /// VT contains the first min(M,N) rows of V**T
237        /// (the right singular vectors, stored rowwise); if JOBZ = 'O' and M &lt; N,
238        /// or JOBZ = 'N', VT is not referenced</param>
239        /// <param name="ldvt">The leading dimension of the array VT.  LDVT &gt; = 1;
240        /// if JOBZ = 'A' or JOBZ = 'O' and M &gt; = N, LDVT &gt;= N;
241        /// if JOBZ = 'S', LDVT &gt; min(M,N).</param>
242        /// <param name="info">
243        /// <list>
244        ///     <item> 0:  successful exit.</item>
245        ///     <item> <![CDATA[< 0]]> :  if INFO = -i, the i-th argument had an illegal value.</item>
246        ///     <item> <![CDATA[> 0]]> :  ?BGSDD did not converge, updating process failed.</item>
247        /// </list>
248        /// </param>
249        /// <remarks>(From the lapack manual):DGESDD computes the singular value decomposition (SVD) of a real
250        ///M-by-N matrix A, optionally computing the left and right singular
251        ///vectors.  If singular vectors are desired, it uses a
252        ///divide-and-conquer algorithm.
253        ///The SVD is written
254        ///    <code>A = U * SIGMA * transpose(V)</code>
255        ///where SIGMA is an M-by-N matrix which is zero except for its
256        ///min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
257        ///V is an N-by-N orthogonal matrix.  The diagonal elements of SIGMA
258        ///are the singular values of A; they are real and non-negative, and
259        ///are returned in descending order.  The first min(m,n) columns of
260        ///U and V are the left and right singular vectors of A.
261        ///Note that the routine returns VT = V**T, not V.
262        ///The divide and conquer algorithm makes very mild assumptions about
263        ///floating point arithmetic. It will work on machines with a guard
264        ///digit in add/subtract, or on those binary machines without guard
265        ///digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
266        ///Cray-2. It could conceivably fail on hexadecimal or decimal machines
267        ///without guard digits, but we know of none.</remarks>
268        void  dgesdd (char jobz, int m, int n,
269             double [] a, int lda,  double [] s,
270             double [] u, int ldu,  double [] vt,
271                   int ldvt, //double [] work, int lwork,
272                   // int [] iwork,
273                   ref int info);
274
275        /// <summary>
276        /// singular value decomposition, new version, more memory needed
277        /// </summary>
278        /// <param name="jobz">Specifies options for computing all or part of the matrix U
279        /// <list type="table">
280        /// <listheader>
281        ///     <term>jobz value</term>
282        ///     <description>... will result in:</description>
283        /// </listheader>
284        ///     <item>
285        ///         <term>A</term>
286        ///         <description>all M columns of U and all N rows of V**T are
287        ///                     returned in the arrays U and VT</description>
288        ///     </item>
289        ///     <item>  <term>S</term>
290        ///             <description>the first min(M,N) columns of U and the first
291        ///              min(M,N) rows of V**T are returned in the arrays U
292        ///              and VT</description>
293        ///     </item>
294        ///     <item> <term>O</term> 
295        ///            <description>If M >= N, the first N columns of U are overwritten
296        ///              on the array A and all rows of V**T are returned in
297        ///              the array VT,
298        ///              otherwise, all columns of U are returned in the
299        ///              array U and the first M rows of V**T are overwritten
300        ///              in the array VT</description>
301        ///     </item>
302        ///     <item> <term>N</term>
303        ///            <description>no columns of U or rows of V**T are computed.</description>
304        ///     </item>
305        /// </list>
306        /// </param>
307        /// <param name="m">The number of rows of the input matrix A.  M greater or equal to 0.</param>
308        /// <param name="n">The number of columns of the input matrix A.  N greater or equal to 0</param>
309        /// <param name="a">On entry, the M-by-N matrix A.
310        ///          On exit, <list><item>
311        ///          if JOBZ = 'O',  A is overwritten with the first N columns
312        ///                          of U (the left singular vectors, stored
313        ///                          columnwise) if M >= N;
314        ///                          A is overwritten with the first M rows
315        ///                          of V**T (the right singular vectors, stored
316        ///                          rowwise) otherwise.</item>
317        ///          <item>if JOBZ .ne. 'O', the contents of A are destroyed.</item></list></param>
318        /// <param name="lda">The leading dimension of the array A.  LDA ge max(1,M).</param>
319        /// <param name="s">array, dimension (min(M,N)). The singular values of A, sorted so that S(i) ge S(i+1)</param>
320        /// <param name="u">array, dimension (LDU,UCOL)
321        ///          UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M &lt; N;
322        ///          UCOL = min(M,N) if JOBZ = 'S'.
323        ///          If JOBZ = 'A' or JOBZ = 'O' and M &lt; N, U contains the M-by-M
324        ///          orthogonal matrix U;
325        ///          if JOBZ = 'S', U contains the first min(M,N) columns of U
326        ///          (the left singular vectors, stored columnwise);
327        ///          if JOBZ = 'O' and M &gt;= N, or JOBZ = 'N', U is not referenced.</param>
328        /// <param name="ldu">The leading dimension of the array U.  LDU &gt;= 1; if 
329        /// JOBZ = 'S' or 'A' or JOBZ = 'O' and M &lt; N, LDU &gt;= M</param>
330        /// <param name="vt">array, dimension (LDVT,N). If JOBZ = 'A' or JOBZ = 'O' and
331        /// M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S',
332        /// VT contains the first min(M,N) rows of V**T
333        /// (the right singular vectors, stored rowwise); if JOBZ = 'O' and M &lt; N,
334        /// or JOBZ = 'N', VT is not referenced</param>
335        /// <param name="ldvt">The leading dimension of the array VT.  LDVT &gt; = 1;
336        /// if JOBZ = 'A' or JOBZ = 'O' and M &gt; = N, LDVT &gt;= N;
337        /// if JOBZ = 'S', LDVT &gt; min(M,N).</param>
338        /// <param name="info">
339        /// <list>
340        ///     <item> 0:  successful exit.</item>
341        ///     <item> <![CDATA[< 0]]> :  if INFO = -i, the i-th argument had an illegal value.</item>
342        ///     <item> <![CDATA[> 0]]> :  ?BGSDD did not converge, updating process failed.</item>
343        /// </list>
344        /// </param>
345        /// <remarks>(From the lapack manual):DGESDD computes the singular value decomposition (SVD) of a real
346        ///M-by-N matrix A, optionally computing the left and right singular
347        ///vectors.  If singular vectors are desired, it uses a
348        ///divide-and-conquer algorithm.
349        ///The SVD is written
350        ///    <code>A = U * SIGMA * transpose(V)</code>
351        ///where SIGMA is an M-by-N matrix which is zero except for its
352        ///min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
353        ///V is an N-by-N orthogonal matrix.  The diagonal elements of SIGMA
354        ///are the singular values of A; they are real and non-negative, and
355        ///are returned in descending order.  The first min(m,n) columns of
356        ///U and V are the left and right singular vectors of A.
357        ///Note that the routine returns VT = V**T, not V.
358        ///The divide and conquer algorithm makes very mild assumptions about
359        ///floating point arithmetic. It will work on machines with a guard
360        ///digit in add/subtract, or on those binary machines without guard
361        ///digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
362        ///Cray-2. It could conceivably fail on hexadecimal or decimal machines
363        ///without guard digits, but we know of none.</remarks>
364        void  sgesdd (char jobz, int m, int n,
365            float [] a, int lda,  float [] s,
366            float [] u, int ldu,  float [] vt,
367                   int ldvt, //double [] work, int lwork,
368                   // int [] iwork,
369                   ref int info);
370       
371        /// <summary>
372        /// singular value decomposition, new version, more memory needed
373        /// </summary>
374        /// <param name="jobz">Specifies options for computing all or part of the matrix U
375        /// <list type="table">
376        /// <listheader>
377        ///     <term>jobz value</term>
378        ///     <description>... will result in:</description>
379        /// </listheader>
380        ///     <item>
381        ///         <term>A</term>
382        ///         <description>all M columns of U and all N rows of V**T are
383        ///                     returned in the arrays U and VT</description>
384        ///     </item>
385        ///     <item>  <term>S</term>
386        ///             <description>the first min(M,N) columns of U and the first
387        ///              min(M,N) rows of V**T are returned in the arrays U
388        ///              and VT</description>
389        ///     </item>
390        ///     <item> <term>O</term> 
391        ///            <description>If M >= N, the first N columns of U are overwritten
392        ///              on the array A and all rows of V**T are returned in
393        ///              the array VT,
394        ///              otherwise, all columns of U are returned in the
395        ///              array U and the first M rows of V**T are overwritten
396        ///              in the array VT</description>
397        ///     </item>
398        ///     <item> <term>N</term>
399        ///            <description>no columns of U or rows of V**T are computed.</description>
400        ///     </item>
401        /// </list>
402        /// </param>
403        /// <param name="m">The number of rows of the input matrix A.  M greater or equal to 0.</param>
404        /// <param name="n">The number of columns of the input matrix A.  N greater or equal to 0</param>
405        /// <param name="a">On entry, the M-by-N matrix A.
406        ///          On exit, <list><item>
407        ///          if JOBZ = 'O',  A is overwritten with the first N columns
408        ///                          of U (the left singular vectors, stored
409        ///                          columnwise) if M >= N;
410        ///                          A is overwritten with the first M rows
411        ///                          of V**T (the right singular vectors, stored
412        ///                          rowwise) otherwise.</item>
413        ///          <item>if JOBZ .ne. 'O', the contents of A are destroyed.</item></list></param>
414        /// <param name="lda">The leading dimension of the array A.  LDA ge max(1,M).</param>
415        /// <param name="s">array, dimension (min(M,N)). The singular values of A, sorted so that S(i) ge S(i+1)</param>
416        /// <param name="u">array, dimension (LDU,UCOL)
417        ///          UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M &lt; N;
418        ///          UCOL = min(M,N) if JOBZ = 'S'.
419        ///          If JOBZ = 'A' or JOBZ = 'O' and M &lt; N, U contains the M-by-M
420        ///          orthogonal matrix U;
421        ///          if JOBZ = 'S', U contains the first min(M,N) columns of U
422        ///          (the left singular vectors, stored columnwise);
423        ///          if JOBZ = 'O' and M &gt;= N, or JOBZ = 'N', U is not referenced.</param>
424        /// <param name="ldu">The leading dimension of the array U.  LDU &gt;= 1; if 
425        /// JOBZ = 'S' or 'A' or JOBZ = 'O' and M &lt; N, LDU &gt;= M</param>
426        /// <param name="vt">array, dimension (LDVT,N). If JOBZ = 'A' or JOBZ = 'O' and
427        /// M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S',
428        /// VT contains the first min(M,N) rows of V**T
429        /// (the right singular vectors, stored rowwise); if JOBZ = 'O' and M &lt; N,
430        /// or JOBZ = 'N', VT is not referenced</param>
431        /// <param name="ldvt">The leading dimension of the array VT.  LDVT &gt; = 1;
432        /// if JOBZ = 'A' or JOBZ = 'O' and M &gt; = N, LDVT &gt;= N;
433        /// if JOBZ = 'S', LDVT &gt; min(M,N).</param>
434        /// <param name="info">
435        /// <list>
436        ///     <item> 0:  successful exit.</item>
437        ///     <item> <![CDATA[< 0]]> :  if INFO = -i, the i-th argument had an illegal value.</item>
438        ///     <item> <![CDATA[> 0]]> :  ?BGSDD did not converge, updating process failed.</item>
439        /// </list>
440        /// </param>
441        /// <remarks>(From the lapack manual):DGESDD computes the singular value decomposition (SVD) of a real
442        ///M-by-N matrix A, optionally computing the left and right singular
443        ///vectors.  If singular vectors are desired, it uses a
444        ///divide-and-conquer algorithm.
445        ///The SVD is written
446        ///    <code>A = U * SIGMA * transpose(V)</code>
447        ///where SIGMA is an M-by-N matrix which is zero except for its
448        ///min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
449        ///V is an N-by-N orthogonal matrix.  The diagonal elements of SIGMA
450        ///are the singular values of A; they are real and non-negative, and
451        ///are returned in descending order.  The first min(m,n) columns of
452        ///U and V are the left and right singular vectors of A.
453        ///Note that the routine returns VT = V**T, not V.
454        ///The divide and conquer algorithm makes very mild assumptions about
455        ///floating point arithmetic. It will work on machines with a guard
456        ///digit in add/subtract, or on those binary machines without guard
457        ///digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
458        ///Cray-2. It could conceivably fail on hexadecimal or decimal machines
459        ///without guard digits, but we know of none.</remarks>
460        void  cgesdd (char jobz, int m, int n,
461            fcomplex [] a, int lda,  float [] s,
462            fcomplex [] u, int ldu,  fcomplex [] vt,
463                   int ldvt, //double [] work, int lwork,
464                   // int [] iwork,
465                   ref int info);
466       
467        /// <summary>
468        /// singular value decomposition, new version, more memory needed
469        /// </summary>
470        /// <param name="jobz">Specifies options for computing all or part of the matrix U
471        /// <list type="table">
472        /// <listheader>
473        ///     <term>jobz value</term>
474        ///     <description>... will result in:</description>
475        /// </listheader>
476        ///     <item>
477        ///         <term>A</term>
478        ///         <description>all M columns of U and all N rows of V**T are
479        ///                     returned in the arrays U and VT</description>
480        ///     </item>
481        ///     <item>  <term>S</term>
482        ///             <description>the first min(M,N) columns of U and the first
483        ///              min(M,N) rows of V**T are returned in the arrays U
484        ///              and VT</description>
485        ///     </item>
486        ///     <item> <term>O</term> 
487        ///            <description>If M >= N, the first N columns of U are overwritten
488        ///              on the array A and all rows of V**T are returned in
489        ///              the array VT,
490        ///              otherwise, all columns of U are returned in the
491        ///              array U and the first M rows of V**T are overwritten
492        ///              in the array VT</description>
493        ///     </item>
494        ///     <item> <term>N</term>
495        ///            <description>no columns of U or rows of V**T are computed.</description>
496        ///     </item>
497        /// </list>
498        /// </param>
499        /// <param name="m">The number of rows of the input matrix A.  M greater or equal to 0.</param>
500        /// <param name="n">The number of columns of the input matrix A.  N greater or equal to 0</param>
501        /// <param name="a">On entry, the M-by-N matrix A.
502        ///          On exit, <list><item>
503        ///          if JOBZ = 'O',  A is overwritten with the first N columns
504        ///                          of U (the left singular vectors, stored
505        ///                          columnwise) if M >= N;
506        ///                          A is overwritten with the first M rows
507        ///                          of V**T (the right singular vectors, stored
508        ///                          rowwise) otherwise.</item>
509        ///          <item>if JOBZ .ne. 'O', the contents of A are destroyed.</item></list></param>
510        /// <param name="lda">The leading dimension of the array A.  LDA ge max(1,M).</param>
511        /// <param name="s">array, dimension (min(M,N)). The singular values of A, sorted so that S(i) ge S(i+1)</param>
512        /// <param name="u">array, dimension (LDU,UCOL)
513        ///          UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M &lt; N;
514        ///          UCOL = min(M,N) if JOBZ = 'S'.
515        ///          If JOBZ = 'A' or JOBZ = 'O' and M &lt; N, U contains the M-by-M
516        ///          orthogonal matrix U;
517        ///          if JOBZ = 'S', U contains the first min(M,N) columns of U
518        ///          (the left singular vectors, stored columnwise);
519        ///          if JOBZ = 'O' and M &gt;= N, or JOBZ = 'N', U is not referenced.</param>
520        /// <param name="ldu">The leading dimension of the array U.  LDU &gt;= 1; if 
521        /// JOBZ = 'S' or 'A' or JOBZ = 'O' and M &lt; N, LDU &gt;= M</param>
522        /// <param name="vt">array, dimension (LDVT,N). If JOBZ = 'A' or JOBZ = 'O' and
523        /// M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S',
524        /// VT contains the first min(M,N) rows of V**T
525        /// (the right singular vectors, stored rowwise); if JOBZ = 'O' and M &lt; N,
526        /// or JOBZ = 'N', VT is not referenced</param>
527        /// <param name="ldvt">The leading dimension of the array VT.  LDVT &gt; = 1;
528        /// if JOBZ = 'A' or JOBZ = 'O' and M &gt; = N, LDVT &gt;= N;
529        /// if JOBZ = 'S', LDVT &gt; min(M,N).</param>
530        /// <param name="info">
531        /// <list>
532        ///     <item> 0:  successful exit.</item>
533        ///     <item> <![CDATA[< 0]]> :  if INFO = -i, the i-th argument had an illegal value.</item>
534        ///     <item> <![CDATA[> 0]]> :  ?BGSDD did not converge, updating process failed.</item>
535        /// </list>
536        /// </param>
537        /// <remarks>(From the lapack manual):DGESDD computes the singular value decomposition (SVD) of a real
538        ///M-by-N matrix A, optionally computing the left and right singular
539        ///vectors.  If singular vectors are desired, it uses a
540        ///divide-and-conquer algorithm.
541        ///The SVD is written
542        ///    <code>A = U * SIGMA * transpose(V)</code>
543        ///where SIGMA is an M-by-N matrix which is zero except for its
544        ///min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
545        ///V is an N-by-N orthogonal matrix.  The diagonal elements of SIGMA
546        ///are the singular values of A; they are real and non-negative, and
547        ///are returned in descending order.  The first min(m,n) columns of
548        ///U and V are the left and right singular vectors of A.
549        ///Note that the routine returns VT = V**T, not V.
550        ///The divide and conquer algorithm makes very mild assumptions about
551        ///floating point arithmetic. It will work on machines with a guard
552        ///digit in add/subtract, or on those binary machines without guard
553        ///digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
554        ///Cray-2. It could conceivably fail on hexadecimal or decimal machines
555        ///without guard digits, but we know of none.</remarks>
556        void  zgesdd (char jobz, int m, int n,
557            complex [] a, int lda,  double [] s,
558            complex [] u, int ldu,  complex [] vt,
559                   int ldvt, //double [] work, int lwork,
560                   // int [] iwork,
561                   ref int info);
562
563#endregion
564
565        #region ?GESVD
566        /// <summary>
567        /// singular value decomposition, older version, less memory needed
568        /// </summary>
569        /// <param name="jobz">Specifies options for computing all or part of the matrix U
570        /// <list type="bullet"><item>= 'A':  all M columns of U and all N rows of V**T are
571        ///returned in the arrays U and VT</item>
572        ///     <item> = 'S':  the first min(M,N) columns of U and the first
573        ///              min(M,N) rows of V**T are returned in the arrays U
574        ///              and VT</item>
575        ///     <item> = 'O':  If M >= N, the first N columns of U are overwritten
576        ///              on the array A and all rows of V**T are returned in
577        ///              the array VT. Otherwise, all columns of U are returned in the
578        ///              array U and the first M rows of V**T are overwritten
579        ///              in the array VT</item>
580        ///     <item> = 'N':  no columns of U or rows of V**T are computed.</item>
581        ///        </list>
582        /// </param>
583        /// <param name="m">The number of rows of the input matrix A.  M greater or equal to 0.</param>
584        /// <param name="n">The number of columns of the input matrix A.  N greater or equal to 0</param>
585        /// <param name="a">On entry, the M-by-N matrix A.
586        ///          On exit, <list><item>
587        ///          if JOBZ = 'O',  A is overwritten with the first N columns
588        ///                          of U (the left singular vectors, stored
589        ///                          columnwise) if M >= N;
590        ///                          A is overwritten with the first M rows
591        ///                          of V**T (the right singular vectors, stored
592        ///                          rowwise) otherwise.</item>
593        ///          <item>if JOBZ .ne. 'O', the contents of A are destroyed.</item></list></param>
594        /// <param name="lda">The leading dimension of the array A.  LDA ge max(1,M).</param>
595        /// <param name="s">array, dimension (min(M,N)). The singular values of A, sorted so that S(i) ge S(i+1)</param>
596        /// <param name="u">array, dimension (LDU,UCOL)
597        ///          UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M &lt; N;
598        ///          UCOL = min(M,N) if JOBZ = 'S'.
599        ///          If JOBZ = 'A' or JOBZ = 'O' and M &lt; N, U contains the M-by-M
600        ///          orthogonal matrix U;
601        ///          if JOBZ = 'S', U contains the first min(M,N) columns of U
602        ///          (the left singular vectors, stored columnwise);
603        ///          if JOBZ = 'O' and M &gt;= N, or JOBZ = 'N', U is not referenced.</param>
604        /// <param name="ldu">The leading dimension of the array U.  LDU &gt;= 1; if 
605        /// JOBZ = 'S' or 'A' or JOBZ = 'O' and M &lt; N, LDU &gt;= M</param>
606        /// <param name="vt">array, dimension (LDVT,N). If JOBZ = 'A' or JOBZ = 'O' and
607        /// M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S',
608        /// VT contains the first min(M,N) rows of V**T
609        /// (the right singular vectors, stored rowwise); if JOBZ = 'O' and M &lt; N,
610        /// or JOBZ = 'N', VT is not referenced</param>
611        /// <param name="ldvt">The leading dimension of the array VT.  LDVT &gt; = 1;
612        /// if JOBZ = 'A' or JOBZ = 'O' and M &gt; = N, LDVT &gt;= N;
613        /// if JOBZ = 'S', LDVT &gt; min(M,N).</param>
614        /// <param name="info">
615        /// <list>
616        ///     <item> 0:  successful exit.</item>
617        ///     <item> lower 0:  if INFO = -i, the i-th argument had an illegal value.</item>
618        ///     <item> greater 0:  DBDSDC did not converge, updating process failed.</item>
619        /// </list>
620        /// </param>
621        /// <remarks>(From the lapack manual):DGESDD computes the singular value decomposition (SVD) of a real
622        ///M-by-N matrix A, optionally computing the left and right singular
623        ///vectors.  If singular vectors are desired, it uses a
624        ///divide-and-conquer algorithm.
625        ///The SVD is written
626        ///    <br>A = U * SIGMA * transpose(V)</br>
627        ///where SIGMA is an M-by-N matrix which is zero except for its
628        ///min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
629        ///V is an N-by-N orthogonal matrix.  The diagonal elements of SIGMA
630        ///are the singular values of A; they are real and non-negative, and
631        ///are returned in descending order.  The first min(m,n) columns of
632        ///U and V are the left and right singular vectors of A.
633        ///Note that the routine returns VT = V**T, not V.
634        ///The divide and conquer algorithm makes very mild assumptions about
635        ///floating point arithmetic. It will work on machines with a guard
636        ///digit in add/subtract, or on those binary machines without guard
637        ///digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
638        ///Cray-2. It could conceivably fail on hexadecimal or decimal machines
639        ///without guard digits, but we know of none.</remarks>
640        void  dgesvd (char jobz, int m, int n,  double [] a, int lda,
641             double [] s,  double [] u, int ldu,
642             double [] vt, int ldvt, ref int info);
643
644        /// <summary>
645        /// singular value decomposition, older version, less memory needed
646        /// </summary>
647        /// <param name="jobz">Specifies options for computing all or part of the matrix U
648        /// <list type="bullet"><item>= 'A':  all M columns of U and all N rows of V**T are
649        ///returned in the arrays U and VT</item>
650        ///     <item> = 'S':  the first min(M,N) columns of U and the first
651        ///              min(M,N) rows of V**T are returned in the arrays U
652        ///              and VT</item>
653        ///     <item> = 'O':  If M >= N, the first N columns of U are overwritten
654        ///              on the array A and all rows of V**T are returned in
655        ///              the array VT. Otherwise, all columns of U are returned in the
656        ///              array U and the first M rows of V**T are overwritten
657        ///              in the array VT</item>
658        ///     <item> = 'N':  no columns of U or rows of V**T are computed.</item>
659        ///        </list>
660        /// </param>
661        /// <param name="m">The number of rows of the input matrix A.  M greater or equal to 0.</param>
662        /// <param name="n">The number of columns of the input matrix A.  N greater or equal to 0</param>
663        /// <param name="a">On entry, the M-by-N matrix A.
664        ///          On exit, <list><item>
665        ///          if JOBZ = 'O',  A is overwritten with the first N columns
666        ///                          of U (the left singular vectors, stored
667        ///                          columnwise) if M >= N;
668        ///                          A is overwritten with the first M rows
669        ///                          of V**T (the right singular vectors, stored
670        ///                          rowwise) otherwise.</item>
671        ///          <item>if JOBZ .ne. 'O', the contents of A are destroyed.</item></list></param>
672        /// <param name="lda">The leading dimension of the array A.  LDA ge max(1,M).</param>
673        /// <param name="s">array, dimension (min(M,N)). The singular values of A, sorted so that S(i) ge S(i+1)</param>
674        /// <param name="u">array, dimension (LDU,UCOL)
675        ///          UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M &lt; N;
676        ///          UCOL = min(M,N) if JOBZ = 'S'.
677        ///          If JOBZ = 'A' or JOBZ = 'O' and M &lt; N, U contains the M-by-M
678        ///          orthogonal matrix U;
679        ///          if JOBZ = 'S', U contains the first min(M,N) columns of U
680        ///          (the left singular vectors, stored columnwise);
681        ///          if JOBZ = 'O' and M &gt;= N, or JOBZ = 'N', U is not referenced.</param>
682        /// <param name="ldu">The leading dimension of the array U.  LDU &gt;= 1; if 
683        /// JOBZ = 'S' or 'A' or JOBZ = 'O' and M &lt; N, LDU &gt;= M</param>
684        /// <param name="vt">array, dimension (LDVT,N). If JOBZ = 'A' or JOBZ = 'O' and
685        /// M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S',
686        /// VT contains the first min(M,N) rows of V**T
687        /// (the right singular vectors, stored rowwise); if JOBZ = 'O' and M &lt; N,
688        /// or JOBZ = 'N', VT is not referenced</param>
689        /// <param name="ldvt">The leading dimension of the array VT.  LDVT &gt; = 1;
690        /// if JOBZ = 'A' or JOBZ = 'O' and M &gt; = N, LDVT &gt;= N;
691        /// if JOBZ = 'S', LDVT &gt; min(M,N).</param>
692        /// <param name="info">
693        /// <list>
694        ///     <item> 0:  successful exit.</item>
695        ///     <item> lower 0:  if INFO = -i, the i-th argument had an illegal value.</item>
696        ///     <item> greater 0:  DBDSDC did not converge, updating process failed.</item>
697        /// </list>
698        /// </param>
699        /// <remarks>(From the lapack manual):DGESDD computes the singular value decomposition (SVD) of a real
700        ///M-by-N matrix A, optionally computing the left and right singular
701        ///vectors.  If singular vectors are desired, it uses a
702        ///divide-and-conquer algorithm.
703        ///The SVD is written
704        ///    <br>A = U * SIGMA * transpose(V)</br>
705        ///where SIGMA is an M-by-N matrix which is zero except for its
706        ///min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
707        ///V is an N-by-N orthogonal matrix.  The diagonal elements of SIGMA
708        ///are the singular values of A; they are real and non-negative, and
709        ///are returned in descending order.  The first min(m,n) columns of
710        ///U and V are the left and right singular vectors of A.
711        ///Note that the routine returns VT = V**T, not V.
712        ///The divide and conquer algorithm makes very mild assumptions about
713        ///floating point arithmetic. It will work on machines with a guard
714        ///digit in add/subtract, or on those binary machines without guard
715        ///digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
716        ///Cray-2. It could conceivably fail on hexadecimal or decimal machines
717        ///without guard digits, but we know of none.</remarks>
718        void  sgesvd (char jobz, int m, int n,  float [] a, int lda,
719            float [] s,  float [] u, int ldu,
720            float [] vt, int ldvt, ref int info);
721
722       
723        /// <summary>
724        /// singular value decomposition, older version, less memory needed
725        /// </summary>
726        /// <param name="jobz">Specifies options for computing all or part of the matrix U
727        /// <list type="bullet"><item>= 'A':  all M columns of U and all N rows of V**T are
728        ///returned in the arrays U and VT</item>
729        ///     <item> = 'S':  the first min(M,N) columns of U and the first
730        ///              min(M,N) rows of V**T are returned in the arrays U
731        ///              and VT</item>
732        ///     <item> = 'O':  If M >= N, the first N columns of U are overwritten
733        ///              on the array A and all rows of V**T are returned in
734        ///              the array VT. Otherwise, all columns of U are returned in the
735        ///              array U and the first M rows of V**T are overwritten
736        ///              in the array VT</item>
737        ///     <item> = 'N':  no columns of U or rows of V**T are computed.</item>
738        ///        </list>
739        /// </param>
740        /// <param name="m">The number of rows of the input matrix A.  M greater or equal to 0.</param>
741        /// <param name="n">The number of columns of the input matrix A.  N greater or equal to 0</param>
742        /// <param name="a">On entry, the M-by-N matrix A.
743        ///          On exit, <list><item>
744        ///          if JOBZ = 'O',  A is overwritten with the first N columns
745        ///                          of U (the left singular vectors, stored
746        ///                          columnwise) if M >= N;
747        ///                          A is overwritten with the first M rows
748        ///                          of V**T (the right singular vectors, stored
749        ///                          rowwise) otherwise.</item>
750        ///          <item>if JOBZ .ne. 'O', the contents of A are destroyed.</item></list></param>
751        /// <param name="lda">The leading dimension of the array A.  LDA ge max(1,M).</param>
752        /// <param name="s">array, dimension (min(M,N)). The singular values of A, sorted so that S(i) ge S(i+1)</param>
753        /// <param name="u">array, dimension (LDU,UCOL)
754        ///          UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M &lt; N;
755        ///          UCOL = min(M,N) if JOBZ = 'S'.
756        ///          If JOBZ = 'A' or JOBZ = 'O' and M &lt; N, U contains the M-by-M
757        ///          orthogonal matrix U;
758        ///          if JOBZ = 'S', U contains the first min(M,N) columns of U
759        ///          (the left singular vectors, stored columnwise);
760        ///          if JOBZ = 'O' and M &gt;= N, or JOBZ = 'N', U is not referenced.</param>
761        /// <param name="ldu">The leading dimension of the array U.  LDU &gt;= 1; if 
762        /// JOBZ = 'S' or 'A' or JOBZ = 'O' and M &lt; N, LDU &gt;= M</param>
763        /// <param name="vt">array, dimension (LDVT,N). If JOBZ = 'A' or JOBZ = 'O' and
764        /// M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S',
765        /// VT contains the first min(M,N) rows of V**T
766        /// (the right singular vectors, stored rowwise); if JOBZ = 'O' and M &lt; N,
767        /// or JOBZ = 'N', VT is not referenced</param>
768        /// <param name="ldvt">The leading dimension of the array VT.  LDVT &gt; = 1;
769        /// if JOBZ = 'A' or JOBZ = 'O' and M &gt; = N, LDVT &gt;= N;
770        /// if JOBZ = 'S', LDVT &gt; min(M,N).</param>
771        /// <param name="info">
772        /// <list>
773        ///     <item> 0:  successful exit.</item>
774        ///     <item> lower 0:  if INFO = -i, the i-th argument had an illegal value.</item>
775        ///     <item> greater 0:  DBDSDC did not converge, updating process failed.</item>
776        /// </list>
777        /// </param>
778        /// <remarks>(From the lapack manual):DGESDD computes the singular value decomposition (SVD) of a real
779        ///M-by-N matrix A, optionally computing the left and right singular
780        ///vectors.  If singular vectors are desired, it uses a
781        ///divide-and-conquer algorithm.
782        ///The SVD is written
783        ///    <br>A = U * SIGMA * transpose(V)</br>
784        ///where SIGMA is an M-by-N matrix which is zero except for its
785        ///min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
786        ///V is an N-by-N orthogonal matrix.  The diagonal elements of SIGMA
787        ///are the singular values of A; they are real and non-negative, and
788        ///are returned in descending order.  The first min(m,n) columns of
789        ///U and V are the left and right singular vectors of A.
790        ///Note that the routine returns VT = V**T, not V.
791        ///The divide and conquer algorithm makes very mild assumptions about
792        ///floating point arithmetic. It will work on machines with a guard
793        ///digit in add/subtract, or on those binary machines without guard
794        ///digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
795        ///Cray-2. It could conceivably fail on hexadecimal or decimal machines
796        ///without guard digits, but we know of none.</remarks>
797        void  cgesvd (char jobz, int m, int n,  fcomplex [] a, int lda,
798            float [] s,  fcomplex [] u, int ldu,
799            fcomplex [] vt, int ldvt, ref int info);
800
801       
802        /// <summary>
803        /// singular value decomposition, older version, less memory needed
804        /// </summary>
805        /// <param name="jobz">Specifies options for computing all or part of the matrix U
806        /// <list type="bullet"><item>= 'A':  all M columns of U and all N rows of V**T are
807        ///returned in the arrays U and VT</item>
808        ///     <item> = 'S':  the first min(M,N) columns of U and the first
809        ///              min(M,N) rows of V**T are returned in the arrays U
810        ///              and VT</item>
811        ///     <item> = 'O':  If M >= N, the first N columns of U are overwritten
812        ///              on the array A and all rows of V**T are returned in
813        ///              the array VT. Otherwise, all columns of U are returned in the
814        ///              array U and the first M rows of V**T are overwritten
815        ///              in the array VT</item>
816        ///     <item> = 'N':  no columns of U or rows of V**T are computed.</item>
817        ///        </list>
818        /// </param>
819        /// <param name="m">The number of rows of the input matrix A.  M greater or equal to 0.</param>
820        /// <param name="n">The number of columns of the input matrix A.  N greater or equal to 0</param>
821        /// <param name="a">On entry, the M-by-N matrix A.
822        ///          On exit, <list><item>
823        ///          if JOBZ = 'O',  A is overwritten with the first N columns
824        ///                          of U (the left singular vectors, stored
825        ///                          columnwise) if M >= N;
826        ///                          A is overwritten with the first M rows
827        ///                          of V**T (the right singular vectors, stored
828        ///                          rowwise) otherwise.</item>
829        ///          <item>if JOBZ .ne. 'O', the contents of A are destroyed.</item></list></param>
830        /// <param name="lda">The leading dimension of the array A.  LDA ge max(1,M).</param>
831        /// <param name="s">array, dimension (min(M,N)). The singular values of A, sorted so that S(i) ge S(i+1)</param>
832        /// <param name="u">array, dimension (LDU,UCOL)
833        ///          UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M &lt; N;
834        ///          UCOL = min(M,N) if JOBZ = 'S'.
835        ///          If JOBZ = 'A' or JOBZ = 'O' and M &lt; N, U contains the M-by-M
836        ///          orthogonal matrix U;
837        ///          if JOBZ = 'S', U contains the first min(M,N) columns of U
838        ///          (the left singular vectors, stored columnwise);
839        ///          if JOBZ = 'O' and M &gt;= N, or JOBZ = 'N', U is not referenced.</param>
840        /// <param name="ldu">The leading dimension of the array U.  LDU &gt;= 1; if 
841        /// JOBZ = 'S' or 'A' or JOBZ = 'O' and M &lt; N, LDU &gt;= M</param>
842        /// <param name="vt">array, dimension (LDVT,N). If JOBZ = 'A' or JOBZ = 'O' and
843        /// M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S',
844        /// VT contains the first min(M,N) rows of V**T
845        /// (the right singular vectors, stored rowwise); if JOBZ = 'O' and M &lt; N,
846        /// or JOBZ = 'N', VT is not referenced</param>
847        /// <param name="ldvt">The leading dimension of the array VT.  LDVT &gt; = 1;
848        /// if JOBZ = 'A' or JOBZ = 'O' and M &gt; = N, LDVT &gt;= N;
849        /// if JOBZ = 'S', LDVT &gt; min(M,N).</param>
850        /// <param name="info">
851        /// <list>
852        ///     <item> 0:  successful exit.</item>
853        ///     <item> lower 0:  if INFO = -i, the i-th argument had an illegal value.</item>
854        ///     <item> greater 0:  DBDSDC did not converge, updating process failed.</item>
855        /// </list>
856        /// </param>
857        /// <remarks>(From the lapack manual):DGESDD computes the singular value decomposition (SVD) of a real
858        ///M-by-N matrix A, optionally computing the left and right singular
859        ///vectors.  If singular vectors are desired, it uses a
860        ///divide-and-conquer algorithm.
861        ///The SVD is written
862        ///    <br>A = U * SIGMA * transpose(V)</br>
863        ///where SIGMA is an M-by-N matrix which is zero except for its
864        ///min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and
865        ///V is an N-by-N orthogonal matrix.  The diagonal elements of SIGMA
866        ///are the singular values of A; they are real and non-negative, and
867        ///are returned in descending order.  The first min(m,n) columns of
868        ///U and V are the left and right singular vectors of A.
869        ///Note that the routine returns VT = V**T, not V.
870        ///The divide and conquer algorithm makes very mild assumptions about
871        ///floating point arithmetic. It will work on machines with a guard
872        ///digit in add/subtract, or on those binary machines without guard
873        ///digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
874        ///Cray-2. It could conceivably fail on hexadecimal or decimal machines
875        ///without guard digits, but we know of none.</remarks>
876        void  zgesvd (char jobz, int m, int n,  complex [] a, int lda,
877            double [] s,  complex [] u, int ldu,
878            complex [] vt, int ldvt, ref int info);
879        #endregion
880       
881        #region ?POTRF - cholesky factorization
882        /// <summary>
883        /// cholesky factorization
884        /// </summary>
885        void  dpotrf (char uplo, int n,  double [] A, int lda, ref int info);
886        /// <summary>
887        /// cholesky factorization
888        /// </summary>
889        void  spotrf (char uplo, int n,  float [] A, int lda, ref int info);
890       
891        /// <summary>
892        /// cholesky factorization
893        /// </summary>
894        void  cpotrf (char uplo, int n,  fcomplex [] A, int lda, ref int info);
895       
896        /// <summary>
897        /// cholesky factorization
898        /// </summary>
899        void  zpotrf (char uplo, int n,  complex [] A, int lda, ref int info);
900#endregion
901
902        #region ?POTRI - inverse via cholesky factorization
903        /// <summary>
904        /// matrix inverse via cholesky factorization (?potrf)
905        /// </summary>
906        void  dpotri (char uplo, int n,  double [] A, int lda,ref int info);
907        /// <summary>
908        /// matrix inverse via cholesky factorization (?potrf)
909        /// </summary>
910        void  spotri (char uplo, int n,  float [] A, int lda,ref int info);
911       
912        /// <summary>
913        /// matrix inverse via cholesky factorization (?potrf)
914        /// </summary>
915        void  cpotri (char uplo, int n,  fcomplex [] A, int lda,ref int info);
916       
917        /// <summary>
918        /// matrix inverse via cholesky factorization (?potrf)
919        /// </summary>
920        void  zpotri (char uplo, int n,  complex [] A, int lda,ref int info);
921
922#endregion
923
924        #region ?POTRS - Solve via cholesky factors
925        /// <summary>
926        /// solve equation system via cholesky factorization (?potrs)
927        /// </summary>
928        void dpotrs (char uplo, int n, int nrhs, double [] A, int lda, double [] B, int ldb, ref int info);
929        /// <summary>
930        /// solve equation system via cholesky factorization (?potrs)
931        /// </summary>
932        void  spotrs (char uplo, int n, int nrhs, float [] A, int lda, float [] B, int ldb, ref int info);
933        /// <summary>
934        /// solve equation system via cholesky factorization (?potrs)
935        /// </summary>
936        void  cpotrs (char uplo, int n, int nrhs, fcomplex [] A, int lda, fcomplex [] B, int ldb, ref int info);
937        /// <summary>
938        /// solve equation system via cholesky factorization (?potrs)
939        /// </summary>
940        void  zpotrs (char uplo, int n, int nrhs, complex [] A, int lda, complex [] B, int ldb, ref int info);
941#endregion
942
943        #region ?getrf - LU factorization
944        /// <summary>
945        /// LU factorization of general matrix
946        /// </summary>
947        void  dgetrf (int M, int N,  double [] A, int LDA, int [] IPIV, ref int info);
948        /// <summary>
949        /// LU factorization of general matrix
950        /// </summary>
951        void  sgetrf (int M, int N,  float [] A, int LDA, int [] IPIV, ref int info);
952       
953        /// <summary>
954        /// LU factorization of general matrix
955        /// </summary>
956        void  cgetrf (int M, int N,  fcomplex [] A, int LDA, int [] IPIV, ref int info);
957       
958        /// <summary>
959        /// LU factorization of general matrix
960        /// </summary>
961        void  zgetrf (int M, int N,  complex [] A, int LDA, int [] IPIV, ref int info);
962        #endregion
963       
964        #region ?getri - inverse via LU factorization
965        /// <summary>
966        /// inverse of a matrix via LU factorization
967        /// </summary>
968        void  dgetri (int N,  double [] A, int LDA, int [] IPIV, ref int info);
969        /// <summary>
970        /// inverse of a matrix via LU factorization
971        /// </summary>
972        void  sgetri (int N,  float [] A, int LDA, int [] IPIV, ref int info);
973       
974        /// <summary>
975        /// inverse of a matrix via LU factorization
976        /// </summary>
977        void  cgetri (int N,  fcomplex [] A, int LDA, int [] IPIV, ref int info);
978       
979        /// <summary>
980        /// inverse of a matrix via LU factorization
981        /// </summary>
982        void  zgetri (int N,  complex [] A, int LDA, int [] IPIV, ref int info);
983        #endregion
984
985        #region ORGQR
986        /// <summary>
987        /// QR factor extraction
988        /// </summary>
989        void  dorgqr (int M, int N, int K,  double [] A, int lda,  double [] tau, ref int info);
990        /// <summary>
991        /// QR factor extraction
992        /// </summary>
993        void  sorgqr (int M, int N, int K,  float [] A, int lda,  float [] tau, ref int info);
994        /// <summary>
995        /// QR factor extraction
996        /// </summary>
997        void  cungqr (int M, int N, int K,  fcomplex [] A, int lda,  fcomplex [] tau, ref int info);
998        /// <summary>
999        /// QR factor extraction
1000        /// </summary>
1001        void  zungqr (int M, int N, int K,  complex [] A, int lda,  complex [] tau, ref int info);
1002        #endregion
1003
1004        #region ?geqrf - QR factorization
1005        /// <summary>
1006        /// QR factorization
1007        /// </summary>
1008        void  dgeqrf (int M, int N,  double [] A, int lda,  double [] tau, ref int info);
1009        /// <summary>
1010        /// QR factorization
1011        /// </summary>
1012        void  sgeqrf (int M, int N,  float [] A, int lda,  float [] tau, ref int info);
1013        /// <summary>
1014        /// QR factorization
1015        /// </summary>
1016        void  cgeqrf (int M, int N,  fcomplex [] A, int lda,  fcomplex [] tau, ref int info);
1017        /// <summary>
1018        /// QR factorization
1019        /// </summary>
1020        void  zgeqrf (int M, int N,  complex [] A, int lda,  complex [] tau, ref int info);
1021        #endregion
1022
1023        #region GEQP3
1024        /// <summary>
1025        /// QR factorisation with column pivoting
1026        /// </summary>
1027        void dgeqp3 (int M, int N, double [] A, int LDA, int [] JPVT, double [] tau, ref int info);
1028        /// <summary>
1029        /// QR factorisation with column pivoting
1030        /// </summary>
1031        void sgeqp3 (int M, int N, float [] A, int LDA, int [] JPVT, float [] tau, ref int info);
1032        /// <summary>
1033        /// QR factorisation with column pivoting
1034        /// </summary>
1035        void cgeqp3 (int M, int N, fcomplex [] A, int LDA, int [] JPVT, fcomplex [] tau, ref int info);
1036        /// <summary>
1037        /// QR factorisation with column pivoting
1038        /// </summary>
1039        void zgeqp3 (int M, int N, complex [] A, int LDA, int [] JPVT, complex [] tau, ref int info);
1040        #endregion
1041
1042        #region ?ormqr - mmult of QR factorization result
1043        /// <summary>
1044        /// multipliation for general matrix with QR decomposition factor
1045        /// </summary>
1046        void  dormqr (char side, char trans, int m, int n, int k,  double [] A, int lda,  double [] tau,  double [] C, int LDC, ref int info);
1047        /// <summary>
1048        /// multipliation for general matrix with QR decomposition factor
1049        /// </summary>
1050        void  sormqr (char side, char trans, int m, int n, int k,  float [] A, int lda,  float [] tau,  float [] C, int LDC, ref int info);
1051
1052        #endregion
1053       
1054        #region DTRTRS
1055        /// <summary>
1056        /// Solve triangular system of linear equations (forward-/ backward substitution)
1057        /// </summary>
1058        /// <param name="uplo">'U': A is upper triangular, 'L': A is lower triangular</param>
1059        /// <param name="transA">'N':  A * X = B  (No transpose); 'T':  A**T * X = B  (Transpose), 'T':  A**T * X = B  (Transpose)</param>
1060        /// <param name="diag">'N' arbitrary diagonal elements, 'U' unit diagonal</param>
1061        /// <param name="N">order of A</param>
1062        /// <param name="nrhs">number of right hand sides - columns of matrix B</param>
1063        /// <param name="A">square matrix A</param>
1064        /// <param name="LDA">spacing between columns for A</param>
1065        /// <param name="B">(input/output) on input: right hand side, on output: solution x </param>
1066        /// <param name="LDB">spacing between columns for B</param>
1067        /// <param name="info">(output) 0: success; &lt; 0: illigal argument, &gt; 0: A is sinular having a zero on the i-th diagonal element. No solution will be computed than. </param>
1068        void dtrtrs (char uplo, char transA, char diag, int N, int nrhs, IntPtr A, int LDA, IntPtr B, int LDB, ref int info);
1069        /// <summary>
1070        /// Solve triangular system of linear equations (forward-/ backward substitution)
1071        /// </summary>
1072        /// <param name="uplo">'U': A is upper triangular, 'L': A is lower triangular</param>
1073        /// <param name="transA">'N':  A * X = B  (No transpose); 'T':  A**T * X = B  (Transpose), 'T':  A**T * X = B  (Transpose)</param>
1074        /// <param name="diag">'N' arbitrary diagonal elements, 'U' unit diagonal</param>
1075        /// <param name="N">order of A</param>
1076        /// <param name="nrhs">number of right hand sides - columns of matrix B</param>
1077        /// <param name="A">square matrix A</param>
1078        /// <param name="LDA">spacing between columns for A</param>
1079        /// <param name="B">(input/output) on input: right hand side, on output: solution x </param>
1080        /// <param name="LDB">spacing between columns for B</param>
1081        /// <param name="info">(output) 0: success; &lt; 0: illigal argument, &gt; 0: A is sinular having a zero on the i-th diagonal element. No solution will be computed than. </param>
1082        void strtrs (char uplo, char transA, char diag, int N, int nrhs, IntPtr A, int LDA, IntPtr B, int LDB, ref int info);
1083        /// <summary>
1084        /// Solve triangular system of linear equations (forward-/ backward substitution)
1085        /// </summary>
1086        /// <param name="uplo">'U': A is upper triangular, 'L': A is lower triangular</param>
1087        /// <param name="transA">'N':  A * X = B  (No transpose); 'T':  A**T * X = B  (Transpose), 'T':  A**T * X = B  (Transpose)</param>
1088        /// <param name="diag">'N' arbitrary diagonal elements, 'U' unit diagonal</param>
1089        /// <param name="N">order of A</param>
1090        /// <param name="nrhs">number of right hand sides - columns of matrix B</param>
1091        /// <param name="A">square matrix A</param>
1092        /// <param name="LDA">spacing between columns for A</param>
1093        /// <param name="B">(input/output) on input: right hand side, on output: solution x </param>
1094        /// <param name="LDB">spacing between columns for B</param>
1095        /// <param name="info">(output) 0: success; &lt; 0: illigal argument, &gt; 0: A is sinular having a zero on the i-th diagonal element. No solution will be computed than. </param>
1096        void ctrtrs (char uplo, char transA, char diag, int N, int nrhs, IntPtr A, int LDA, IntPtr B, int LDB, ref int info);
1097        /// <summary>
1098        /// Solve triangular system of linear equations (forward-/ backward substitution)
1099        /// </summary>
1100        /// <param name="uplo">'U': A is upper triangular, 'L': A is lower triangular</param>
1101        /// <param name="transA">'N':  A * X = B  (No transpose); 'T':  A**T * X = B  (Transpose), 'T':  A**T * X = B  (Transpose)</param>
1102        /// <param name="diag">'N' arbitrary diagonal elements, 'U' unit diagonal</param>
1103        /// <param name="N">order of A</param>
1104        /// <param name="nrhs">number of right hand sides - columns of matrix B</param>
1105        /// <param name="A">square matrix A</param>
1106        /// <param name="LDA">spacing between columns for A</param>
1107        /// <param name="B">(input/output) on input: right hand side, on output: solution x </param>
1108        /// <param name="LDB">spacing between columns for B</param>
1109        /// <param name="info">(output) 0: success; &lt; 0: illigal argument, &gt; 0: A is sinular having a zero on the i-th diagonal element. No solution will be computed than. </param>
1110        void ztrtrs (char uplo, char transA, char diag, int N, int nrhs, IntPtr A, int LDA, IntPtr B, int LDB, ref int info);
1111        #endregion
1112
1113        #region ?GETRS
1114        /// <summary>
1115        /// solve system of linear equations by triangular matrices
1116        /// </summary>
1117        /// <param name="trans">transpose before work?</param>
1118        /// <param name="N">number rows</param>
1119        /// <param name="NRHS">number right hand sides</param>
1120        /// <param name="A">matrix A</param>
1121        /// <param name="LDA">spacing between columns: A</param>
1122        /// <param name="IPIV">pivoting indices</param>
1123        /// <param name="B">matrix B</param>
1124        /// <param name="LDB">spacing between columns: B</param>
1125        /// <param name="info">success info</param>
1126        void dgetrs (char trans, int N, int NRHS, double [] A, int LDA, int [] IPIV, double [] B, int LDB, ref int info);
1127        /// <summary>
1128        /// solve system of linear equations by triangular matrices
1129        /// </summary>
1130        /// <param name="trans">transpose before work?</param>
1131        /// <param name="N">number rows</param>
1132        /// <param name="NRHS">number right hand sides</param>
1133        /// <param name="A">matrix A</param>
1134        /// <param name="LDA">spacing between columns: A</param>
1135        /// <param name="IPIV">pivoting indices</param>
1136        /// <param name="B">matrix B</param>
1137        /// <param name="LDB">spacing between columns: B</param>
1138        /// <param name="info">success info</param>
1139        void sgetrs (char trans, int N, int NRHS, float [] A, int LDA, int [] IPIV, float [] B, int LDB, ref int info);
1140        /// <summary>
1141        /// solve system of linear equations by triangular matrices
1142        /// </summary>
1143        /// <param name="trans">transpose before work?</param>
1144        /// <param name="N">number rows</param>
1145        /// <param name="NRHS">number right hand sides</param>
1146        /// <param name="A">matrix A</param>
1147        /// <param name="LDA">spacing between columns: A</param>
1148        /// <param name="IPIV">pivoting indices</param>
1149        /// <param name="B">matrix B</param>
1150        /// <param name="LDB">spacing between columns: B</param>
1151        /// <param name="info">success info</param>
1152        void cgetrs (char trans, int N, int NRHS, fcomplex [] A, int LDA, int [] IPIV, fcomplex [] B, int LDB, ref int info);
1153        /// <summary>
1154        /// solve system of linear equations by triangular matrices
1155        /// </summary>
1156        /// <param name="trans">transpose before work?</param>
1157        /// <param name="N">number rows</param>
1158        /// <param name="NRHS">number right hand sides</param>
1159        /// <param name="A">matrix A</param>
1160        /// <param name="LDA">spacing between columns: A</param>
1161        /// <param name="IPIV">pivoting indices</param>
1162        /// <param name="B">matrix B</param>
1163        /// <param name="LDB">spacing between columns: B</param>
1164        /// <param name="info">success info</param>
1165        void zgetrs (char trans, int N, int NRHS, complex [] A, int LDA, int [] IPIV, complex [] B, int LDB, ref int info);
1166        #endregion
1167
1168        #region ?GELSD - least square solution, SVD - divide & conquer
1169        void dgelsd (int m, int n, int nrhs, double[] A, int lda, double[] B, int ldb, double[] S, double RCond, ref int rank, ref int info);
1170        void sgelsd (int m, int n, int nrhs, float[] A, int lda, float[] B, int ldb, float[] S, float RCond, ref int rank, ref int info);
1171        void cgelsd (int m, int n, int nrhs, fcomplex[] A, int lda, fcomplex[] B, int ldb, float[] S, float RCond, ref int rank, ref int info);
1172        void zgelsd (int m, int n, int nrhs, complex[] A, int lda, complex[] B, int ldb, double[] S, double RCond, ref int rank, ref int info);
1173        #endregion
1174
1175        #region ?GELSY - least square solution, QRP
1176        void dgelsy (int m,int n,int nrhs, double[] A,int lda, double[] B,int ldb, int[] JPVT0, double RCond, ref int rank, ref int info);
1177        void sgelsy (int m,int n,int nrhs, float[] A,int lda, float[] B,int ldb, int[] JPVT0, float RCond, ref int rank, ref int info);
1178        void cgelsy (int m,int n,int nrhs, fcomplex[] A,int lda, fcomplex[] B,int ldb, int[] JPVT0, float RCond, ref int rank, ref int info);
1179        void zgelsy (int m,int n,int nrhs, complex[] A,int lda, complex[] B,int ldb, int[] JPVT0, double RCond, ref int rank, ref int info);
1180        #endregion
1181
1182        #region ?GEEVX - eigenvectors & -values, nonsymmetric A
1183        void dgeevx (char balance, char jobvl, char jobvr, char sense, int n, double[] A, int lda, double[] wr, double[] wi, double[] vl, int ldvl, double[] vr, int ldvr, ref int ilo, ref int ihi, double[] scale, ref double abnrm, double[] rconde, double[] rcondv, ref int info);
1184        void sgeevx (char balance, char jobvl, char jobvr, char sense, int n, float[] A, int lda, float[] wr, float[] wi, float[] vl, int ldvl, float[] vr, int ldvr, ref int ilo, ref int ihi, float[] scale, ref float abnrm, float[] rconde, float[] rcondv, ref int info);
1185        void cgeevx (char balance, char jobvl, char jobvr, char sense, int n, fcomplex[] A, int lda, fcomplex[] w, fcomplex[] vl, int ldvl, fcomplex[] vr, int ldvr, ref int ilo, ref int ihi, float[] scale, ref float abnrm, float[] rconde, float[] rcondv, ref int info);
1186        void zgeevx (char balance, char jobvl, char jobvr, char sense, int n, complex[] A, int lda, complex[] w, complex[] vl, int ldvl, complex[] vr, int ldvr, ref int ilo, ref int ihi, double[] scale, ref double abnrm, double[] rconde, double[] rcondv, ref int info);
1187        #endregion
1188
1189        #region ?GEEVR - eigenvectors & -values, symmetric/hermitian A
1190        void dsyevr (char jobz, char range, char uplo, int n, double  [] A, int lda, double vl, double vu, int il, int iu, double abstol, ref int m, double[] w, double  [] z, int ldz, int[] isuppz, ref int info);
1191        void ssyevr (char jobz, char range, char uplo, int n, float   [] A, int lda, float  vl, float  vu, int il, int iu, float  abstol, ref int m, float [] w, float   [] z, int ldz, int[] isuppz, ref int info);
1192        void cheevr (char jobz, char range, char uplo, int n, fcomplex[] A, int lda, float  vl, float  vu, int il, int iu, float  abstol, ref int m, float [] w, fcomplex[] z, int ldz, int[] isuppz, ref int info);
1193        void zheevr (char jobz, char range, char uplo, int n, complex [] A, int lda, double vl, double vu, int il, int iu, double abstol, ref int m, double[] w, complex [] z, int ldz, int[] isuppz, ref int info);
1194        #endregion
1195       
1196        #region ?SYGV - eigenvectors & -values, symmetric/hermitian A and B, pos.def.B
1197        void dsygv (int itype, char jobz, char uplo, int n, double  [] A, int lda, double  [] B, int ldb, double [] w, ref int info);
1198        void ssygv (int itype, char jobz, char uplo, int n, float   [] A, int lda, float   [] B, int ldb, float  [] w, ref int info);
1199        void chegv (int itype, char jobz, char uplo, int n, fcomplex[] A, int lda, fcomplex[] B, int ldb, float  [] w, ref int info);
1200        void zhegv (int itype, char jobz, char uplo, int n, complex [] A, int lda, complex [] B, int ldb, double [] w, ref int info);
1201        #endregion
1202
1203    }
1204}
Note: See TracBrowser for help on using the repository browser.