Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GaussianProcessTuning/ILNumerics.2.14.4735.573/Native/lapack/ILLapackGenLinux.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: 85.1 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 1570, 1591
41using System;
42using System.Collections.Generic;
43using System.Text;
44using System.Runtime.InteropServices;
45using System.Security;
46using ILNumerics.Native;
47using ILNumerics.Misc;
48using ILNumerics.Exceptions;
49
50namespace ILNumerics.Native  {
51    /// <summary>
52    /// Generic LAPACK implementation, unsupported processor types
53    /// </summary>
54  public class ILLapackGenLinux : IILLapack {
55
56        #region DLL INCLUDES
57        [DllImport("liblapack.so", EntryPoint = "ilaenv_"),SuppressUnmanagedCodeSecurity]
58        private static extern int lapack_ilaenv(ref int ispec, ref string name, ref string opts, ref int n1, ref int n2, ref int n3, ref int n4);
59
60        ///////////////////////////   DOUBLE LAPACK /////////////////////////////////
61        [DllImport("liblapack.so", EntryPoint = "dgemm_"),SuppressUnmanagedCodeSecurity]
62        private static extern void lapack_dgemm(ref char TransA, ref char TransB, ref int M,ref int N, ref int K, ref  double alpha, IntPtr A, ref int lda, IntPtr B, ref int ldb, ref double beta, double[] C, ref int ldc);
63        [DllImport("liblapack.so", EntryPoint = "sgemm_"),SuppressUnmanagedCodeSecurity]
64    private static extern void lapack_sgemm(ref char TransA, ref char TransB, ref int M,ref int N, ref int K, ref float alpha, IntPtr A,ref int lda, IntPtr B, ref int ldb, ref float beta,float[] C, ref int ldc);
65        [DllImport("liblapack.so", EntryPoint = "cgemm_"),SuppressUnmanagedCodeSecurity]
66    private static extern void lapack_cgemm(ref char TransA, ref char TransB, ref int M,ref int N, ref int K, ref fcomplex alpha, IntPtr A, ref int lda, IntPtr B, ref int ldb, ref fcomplex beta,[In,Out] fcomplex [] C, ref int ldc);
67        [DllImport("liblapack.so", EntryPoint = "zgemm_"),SuppressUnmanagedCodeSecurity]
68    private static extern void lapack_zgemm(ref char TransA, ref char TransB, ref int M, ref int N, ref int K, ref complex alpha, IntPtr A, ref int lda, IntPtr B, ref int ldb, ref complex beta,[In,Out] complex [] C, ref int ldc);
69
70        [DllImport("liblapack.so", EntryPoint = "dgesdd_"),SuppressUnmanagedCodeSecurity]
71    private static extern void lapack_dgesdd(ref char jobz, ref int m, ref int n,double[] a, ref int lda, double[] s,double[] u, ref int ldu, double[] vt,ref int ldvt, double[] work, ref int lwork,int[] iwork, ref int info);
72        [DllImport("liblapack.so", EntryPoint = "sgesdd_"),SuppressUnmanagedCodeSecurity]
73    private static extern void lapack_sgesdd(ref char jobz, ref int m, ref int n,float[] a, ref int lda, float[] s,float[] u, ref int ldu, float[] vt, ref int ldvt, float[] work, ref int lwork,int[] iwork, ref int info);
74        [DllImport("liblapack.so", EntryPoint = "cgesdd_"),SuppressUnmanagedCodeSecurity]
75    private static extern void lapack_cgesdd(ref char jobz, ref int m, ref int n,[In, Out] fcomplex[] a, ref int lda, float[] s,[In, Out] fcomplex[] u, ref int ldu, [In, Out]  fcomplex[] vt, ref int ldvt, [In, Out] fcomplex[] work, ref int lwork,[In,Out] float[] rwork, int[] iwork, ref int info);
76        [DllImport("liblapack.so", EntryPoint = "zgesdd_"),SuppressUnmanagedCodeSecurity]
77    private static extern void lapack_zgesdd(ref char jobz, ref int m, ref int n,[In, Out] complex[] a, ref int lda, double[] s,[In, Out] complex[] u, ref int ldu, [In, Out] complex[] vt,ref int ldvt, [In, Out] complex[] work, ref int lwork,[In,Out] double[] rwork, int[] iwork, ref int info);
78
79        [DllImport("liblapack.so", EntryPoint = "dgesvd_"),SuppressUnmanagedCodeSecurity]
80    private static extern void lapack_dgesvd(ref char jobu, ref  char jobvt, ref int m, ref int n,double[] a, ref int lda, double[] s,double[] u, ref int ldu, double[] vt,ref int ldvt, double[] work, ref int lwork,int[] iwork,ref int info);
81        [DllImport("liblapack.so", EntryPoint = "sgesvd_"),SuppressUnmanagedCodeSecurity]
82    private static extern void lapack_sgesvd(ref char jobu, ref  char jobvt, ref int m, ref int n, float[] a, ref int lda, float[] s,float[] u, ref int ldu, float[] vt,ref int ldvt, float[] work, ref int lwork,int[] iwork, ref int info);
83        [DllImport("liblapack.so", EntryPoint = "cgesvd_"),SuppressUnmanagedCodeSecurity]
84    private static extern void lapack_cgesvd(ref char jobu, ref  char jobvt, ref int m, ref int n,[In, Out] fcomplex[] a, ref int lda, float[] s,[In, Out] fcomplex[] u, ref int ldu,[In,Out] fcomplex[] vt,ref int ldvt, [In, Out]  fcomplex[] work, ref int lwork,int[] iwork,ref int info);
85        [DllImport("liblapack.so", EntryPoint = "zgesvd_"),SuppressUnmanagedCodeSecurity]
86    private static extern void lapack_zgesvd(ref char jobu, ref  char jobvt, ref int m, ref int n,[In, Out] complex[] a, ref int lda, double[] s,[In, Out] complex[] u, ref int ldu, [In, Out] complex[] vt,ref int ldvt, [In, Out]  complex[] work, ref int lwork,int[] iwork,ref int info);
87
88        [DllImport("liblapack.so", EntryPoint = "dpotrf_"),SuppressUnmanagedCodeSecurity]
89        private static extern void lapack_dpotrf (ref char uplo, ref int n, double [] A, ref int lda, ref int info);
90        [DllImport("liblapack.so", EntryPoint = "spotrf_"),SuppressUnmanagedCodeSecurity]
91        private static extern void lapack_spotrf (ref char uplo, ref int n, float [] A, ref int lda, ref int info);
92        [DllImport("liblapack.so", EntryPoint = "cpotrf_"),SuppressUnmanagedCodeSecurity]
93        private static extern void lapack_cpotrf (ref char uplo, ref int n,[In,Out] fcomplex [] A, ref int lda, ref int info);
94        [DllImport("liblapack.so", EntryPoint = "zpotrf_"),SuppressUnmanagedCodeSecurity]
95        private static extern void lapack_zpotrf (ref char uplo, ref int n, [In,Out] complex [] A, ref int lda, ref int info);
96       
97        [DllImport("liblapack.so", EntryPoint = "dpotri_"),SuppressUnmanagedCodeSecurity]
98        private static extern void lapack_dpotri (ref char uplo,ref  int n, double [] A, ref int lda, ref int info);
99        [DllImport("liblapack.so", EntryPoint = "spotri_"),SuppressUnmanagedCodeSecurity]
100        private static extern void lapack_spotri (ref char uplo, ref int n, float [] A, ref int lda, ref int info);
101        [DllImport("liblapack.so", EntryPoint = "cpotri_"),SuppressUnmanagedCodeSecurity]
102        private static extern void lapack_cpotri (ref char uplo, ref int n,[In,Out] fcomplex [] A, ref int lda,ref int info);
103        [DllImport("liblapack.so", EntryPoint = "zpotri_"),SuppressUnmanagedCodeSecurity]
104        private static extern void lapack_zpotri (ref char uplo, ref int n, [In,Out] complex [] A, ref int lda,ref int info);
105
106        [DllImport("liblapack.so", EntryPoint = "dpotrs_"),SuppressUnmanagedCodeSecurity]
107        private static extern void lapack_dpotrs (ref char uplo,ref  int n, ref int NRHS, double [] A, ref int lda, double[] B, ref int ldb, ref int info);
108        [DllImport("liblapack.so", EntryPoint = "spotrs_"),SuppressUnmanagedCodeSecurity]
109        private static extern void lapack_spotrs (ref char uplo,ref  int n, ref int NRHS, float [] A, ref int lda, float[] B, ref int ldb, ref int info);
110        [DllImport("liblapack.so", EntryPoint = "cpotrs_"),SuppressUnmanagedCodeSecurity]
111        private static extern void lapack_cpotrs (ref char uplo,ref  int n, ref int NRHS, [In,Out] fcomplex [] A, ref int lda, [In,Out] fcomplex[] B, ref int ldb, ref int info);
112        [DllImport("liblapack.so", EntryPoint = "zpotrs_"),SuppressUnmanagedCodeSecurity]
113        private static extern void lapack_zpotrs (ref char uplo,ref  int n, ref int NRHS, [In,Out] complex [] A, ref int lda, [In,Out] complex[] B, ref int ldb, ref int info);
114
115        [DllImport("liblapack.so", EntryPoint = "dgetrf_"),SuppressUnmanagedCodeSecurity]
116        private static extern void lapack_dgetrf (ref int M, ref int N, double [] A, ref int LDA, int[] IPIV, ref int info);
117        [DllImport("liblapack.so", EntryPoint = "sgetrf_"),SuppressUnmanagedCodeSecurity]
118        private static extern void lapack_sgetrf (ref int M, ref int N, float[] A, ref int LDA, int [] IPIV, ref int info);
119        [DllImport("liblapack.so", EntryPoint = "cgetrf_"),SuppressUnmanagedCodeSecurity]
120        private static extern void lapack_cgetrf (ref int M, ref int N, [In,Out] fcomplex [] A, ref int LDA, int [] IPIV, ref int info);
121        [DllImport("liblapack.so", EntryPoint = "zgetrf_"),SuppressUnmanagedCodeSecurity]
122        private static extern void lapack_zgetrf (ref int M, ref int N, [In,Out] complex [] A, ref int LDA, int [] IPIV, ref int info);
123
124        [DllImport("liblapack.so", EntryPoint = "dgetri_"),SuppressUnmanagedCodeSecurity]
125        private static extern void lapack_dgetri (ref int N, double[] A,ref  int LDA, int[] IPIV, double[] work, ref int lwork, ref int info);
126        [DllImport("liblapack.so", EntryPoint = "sgetri_"),SuppressUnmanagedCodeSecurity]
127        private static extern void lapack_sgetri (ref int N, float [] A, ref int LDA, int [] IPIV, float[] work, ref int lwork, ref int info);
128        [DllImport("liblapack.so", EntryPoint = "cgetri_"),SuppressUnmanagedCodeSecurity]
129        private static extern void lapack_cgetri (ref int N, [In,Out] fcomplex [] A, ref int LDA,[In,Out] int [] IPIV, [In,Out] fcomplex[] work, ref int lwork, ref int info);
130        [DllImport("liblapack.so", EntryPoint = "zgetri_"),SuppressUnmanagedCodeSecurity]
131        private static extern void lapack_zgetri (ref int N, [In,Out] complex [] A, ref int LDA, int [] IPIV, [In,Out] complex[] work, ref int lwork, ref int info);
132
133        [DllImport("liblapack.so", EntryPoint = "dgeqrf_"),SuppressUnmanagedCodeSecurity]
134        private static extern void lapack_dgeqrf (ref int M, ref int N, double [] A, ref int lda, double [] tau, double[] work, ref int lwork, ref int info);
135        [DllImport("liblapack.so", EntryPoint = "sgeqrf_"),SuppressUnmanagedCodeSecurity]
136        private static extern void lapack_sgeqrf (ref int M, ref int N, float [] A, ref int lda, float [] tau, float[] work, ref int lwork,  ref int info);
137        [DllImport("liblapack.so", EntryPoint = "cgeqrf_"),SuppressUnmanagedCodeSecurity]
138        private static extern void lapack_cgeqrf (ref int M, ref int N, [In,Out] fcomplex [] A, ref int lda, [In,Out] fcomplex [] tau, [In,Out] fcomplex[] work, ref int lwork, ref int info);
139        [DllImport("liblapack.so", EntryPoint = "zgeqrf_"),SuppressUnmanagedCodeSecurity]
140        private static extern void lapack_zgeqrf (ref int M, ref int N, [In,Out] complex [] A, ref int lda, [In,Out] complex [] tau, [In,Out] complex[] work, ref int lwork,  ref int info);
141
142        [DllImport("liblapack.so", EntryPoint = "dgeqp3_"),SuppressUnmanagedCodeSecurity]
143        private static extern void lapack_dgeqp3 (ref int M, ref int N, double [] A, ref int LDA, int [] JPVT, double [] tau, double [] work, ref int lwork, ref int info );
144        [DllImport("liblapack.so", EntryPoint = "sgeqp3_"),SuppressUnmanagedCodeSecurity]
145        private static extern void lapack_sgeqp3 (ref int M, ref int N, float [] A, ref int LDA, int [] JPVT, float [] tau, float [] work, ref int lwork, ref int info );
146        [DllImport("liblapack.so", EntryPoint = "cgeqp3_"),SuppressUnmanagedCodeSecurity]
147        private static extern void lapack_cgeqp3 (ref int M, ref int N,[In,Out] fcomplex [] A, ref int LDA,[In,Out] int [] JPVT, [In,Out] fcomplex [] tau, [In,Out] fcomplex [] work, ref int lwork,[In,Out] float [] rwork, ref int info );
148        [DllImport("liblapack.so", EntryPoint = "zgeqp3_"),SuppressUnmanagedCodeSecurity]
149        private static extern void lapack_zgeqp3 (ref int M, ref int N, [In,Out] complex [] A, ref int LDA, [In,Out] int [] JPVT, [In,Out] complex [] tau, [In,Out] complex [] work, ref int lwork, [In,Out] double [] rwork, ref int info );
150
151        [DllImport("liblapack.so", EntryPoint = "dormqr_"),SuppressUnmanagedCodeSecurity]
152        private static extern void lapack_dormqr (ref char side, ref char trans, ref int m, ref int n, ref int k, double[] A, int lda, double[] tau, double[] C, ref int ldc, ref int info);
153        [DllImport("liblapack.so", EntryPoint = "sormqr_"),SuppressUnmanagedCodeSecurity]
154        private static extern void lapack_sormqr (ref char side, ref char trans, ref int m, ref int n, ref int k, float [] A, ref int lda, float [] tau , float [] C, ref int ldc, ref int info);
155       
156        [DllImport("liblapack.so", EntryPoint = "dorgqr_"),SuppressUnmanagedCodeSecurity]
157        private static extern void lapack_dorgqr (ref int m, ref int n, ref int k, double[] A,ref int lda, double[] tau, double[] work, ref int lwork, ref int info);
158        [DllImport("liblapack.so", EntryPoint = "sorgqr_"),SuppressUnmanagedCodeSecurity]
159        private static extern void lapack_sorgqr (ref int m, ref int n, ref int k, float [] A, ref int lda, float [] tau , float[] work, ref int lwork,  ref int info);
160        [DllImport("liblapack.so", EntryPoint = "cungqr_"),SuppressUnmanagedCodeSecurity]
161        private static extern void lapack_cungqr (ref int m, ref int n, ref int k, [In,Out] fcomplex[] A,ref int lda, [In,Out] fcomplex[] tau, [In,Out] fcomplex[] work, ref int lwork, ref int info);
162        [DllImport("liblapack.so", EntryPoint = "zungqr_"),SuppressUnmanagedCodeSecurity]
163        private static extern void lapack_zungqr (ref int m, ref int n, ref int k, [In,Out] complex[] A,ref int lda, [In,Out] complex[] tau, [In,Out] complex[] work, ref int lwork, ref int info);
164       
165        [DllImport("liblapack.so", EntryPoint = "dtrtrs_"),SuppressUnmanagedCodeSecurity]
166        private static extern void lapack_dtrtrs (ref char uplo, ref char transA, ref char diag, ref int N, ref int nrhs, IntPtr A, ref int LDA, IntPtr B, ref int LDB, ref int info);
167        [DllImport("liblapack.so", EntryPoint = "strtrs_"),SuppressUnmanagedCodeSecurity]
168        private static extern void lapack_strtrs (ref char uplo, ref char transA, ref char diag, ref int N, ref int nrhs, IntPtr A, ref int LDA, IntPtr B, ref int LDB, ref int info);
169        [DllImport("liblapack.so", EntryPoint = "ctrtrs_"),SuppressUnmanagedCodeSecurity]
170        private static extern void lapack_ctrtrs (ref char uplo, ref char transA, ref char diag, ref int N, ref int nrhs, IntPtr A, ref int LDA, IntPtr B, ref int LDB, ref int info);
171        [DllImport("liblapack.so", EntryPoint = "ztrtrs_"),SuppressUnmanagedCodeSecurity]
172        private static extern void lapack_ztrtrs (ref char uplo, ref char transA, ref char diag, ref int N, ref int nrhs, IntPtr A, ref int LDA, IntPtr B, ref int LDB, ref int info);
173       
174        [DllImport("liblapack.so", EntryPoint = "dgetrs_"),SuppressUnmanagedCodeSecurity]
175        private static extern void lapack_dgetrs(ref char trans, ref int N, ref int NRHS, double[] A, ref int LDA, int[] IPIV, double[] B, ref int LDB, ref int info);
176        [DllImport("liblapack.so", EntryPoint = "sgetrs_"),SuppressUnmanagedCodeSecurity]
177        private static extern void lapack_sgetrs(ref char trans, ref int N, ref int NRHS, float[] A, ref int LDA, int[] IPIV, float[] B, ref int LDB, ref int info);
178        [DllImport("liblapack.so", EntryPoint = "cgetrs_"),SuppressUnmanagedCodeSecurity]
179        private static extern void lapack_cgetrs(ref char trans, ref int N, ref int NRHS, [In,Out] fcomplex[] A, ref int LDA, int[] IPIV, [In,Out] fcomplex[] B, ref int LDB, ref int info);
180        [DllImport("liblapack.so", EntryPoint = "zgetrs_"),SuppressUnmanagedCodeSecurity]
181        private static extern void lapack_zgetrs(ref char trans, ref int N, ref int NRHS, [In,Out] complex[] A, ref int LDA, int[] IPIV, [In,Out] complex[] B, ref int LDB, ref int info);
182
183        [DllImport("liblapack.so", EntryPoint = "dgelsd_"),SuppressUnmanagedCodeSecurity]
184        private static extern void lapack_dgelsd (ref int m,ref int n,ref int nrhs, double[] A,ref int lda, double[] B,ref int ldb, double[] S, ref double RCond, ref int rank, double[] work,ref int lwork, int[] iwork, ref int info);
185        [DllImport("liblapack.so", EntryPoint = "sgelsd_"),SuppressUnmanagedCodeSecurity]
186        private static extern void lapack_sgelsd (ref int m,ref int n,ref int nrhs, float[] A,ref int lda, float[] B,ref int ldb, float[] S, ref float RCond, ref int rank, float[] work,ref int lwork, int[] iwork, ref int info);
187        [DllImport("liblapack.so", EntryPoint = "cgelsd_"),SuppressUnmanagedCodeSecurity]
188        private static extern void lapack_cgelsd (ref int m,ref int n,ref int nrhs, [In,Out] fcomplex[] A,ref int lda, [In,Out] fcomplex[] B,ref int ldb, float[] S , ref float RCond, ref int rank, [In,Out] fcomplex[] work, ref int lwork, float[] rwork, int[] iwork, ref int info);
189        [DllImport("liblapack.so", EntryPoint = "zgelsd_"),SuppressUnmanagedCodeSecurity]
190        private static extern void lapack_zgelsd (ref int m,ref int n,ref int nrhs, [In,Out] complex[] A,ref int lda, [In,Out] complex[] B,ref int ldb, double[] S, ref double RCond, ref int rank, [In,Out]  complex[] work,ref int lwork, double[] rwork, int[] iwork, ref int info);
191       
192        [DllImport("liblapack.so", EntryPoint = "dgelsy_"),SuppressUnmanagedCodeSecurity]
193        private static extern void lapack_dgelsy (ref int m,ref int n,ref int nrhs, double[] A,ref int lda, double[] B,ref int ldb, int[] JPVT0, ref double RCond, ref int rank, double[] work, ref int lwork, ref int info);
194        [DllImport("liblapack.so", EntryPoint = "dgelsy_"),SuppressUnmanagedCodeSecurity]
195        private static extern void lapack_sgelsy (ref int m,ref int n,ref int nrhs, float[] A,ref int lda, float[] B,ref int ldb, int[] JPVT0, ref float RCond, ref int rank, float[] work,ref int lwork, ref int info);
196        [DllImport("liblapack.so", EntryPoint = "dgelsy_"),SuppressUnmanagedCodeSecurity]
197        private static extern void lapack_cgelsy (ref int m,ref int n,ref int nrhs, [In,Out] fcomplex[] A,ref int lda, [In,Out] fcomplex[] B,ref int ldb, int[] JPVT0, ref float RCond, ref int rank, [In,Out] fcomplex[] work, ref int lwork, float[] rwork, ref int info);
198        [DllImport("liblapack.so", EntryPoint = "dgelsy_"),SuppressUnmanagedCodeSecurity]
199        private static extern void lapack_zgelsy (ref int m,ref int n,ref int nrhs, [In,Out] complex[] A,ref int lda, [In,Out] complex[] B,ref int ldb, int[] JPVT0, ref double RCond, ref int rank, [In,Out]  complex[] work, ref int lwork, double[] rwork, ref int info);
200       
201        [DllImport("liblapack.so", EntryPoint = "dgeevx_"),SuppressUnmanagedCodeSecurity]
202        private static extern void lapack_dgeevx (ref char balance, ref char jobvl, ref char jobvr, ref char sense, ref int n,            double[] A, ref int lda,          double[] wr, double[] wi, double[] vl, ref int ldvl,            double[] vr, ref int ldvr, ref int ilo, ref int ihi, double[] scale, ref double abnrm, double[] rconde, double[] rcondv, double[] work, ref int lwork, int [] iwork, ref int info);
203        [DllImport("liblapack.so", EntryPoint = "sgeevx_"),SuppressUnmanagedCodeSecurity]
204        private static extern void lapack_sgeevx (ref char balance, ref char jobvl, ref char jobvr, ref char sense, ref int n,             float[] A, ref int lda,             float[] wr, float[] wi, float[] vl, ref int ldvl,             float[] vr, ref int ldvr, ref int ilo, ref int ihi, float[]  scale, ref float  abnrm, float[]  rconde, float[]  rcondv, float [] work, ref int lwork, int [] iwork, ref int info);
205        [DllImport("liblapack.so", EntryPoint = "cgeevx_"),SuppressUnmanagedCodeSecurity]
206        private static extern void lapack_cgeevx (ref char balance, ref char jobvl, ref char jobvr, ref char sense, ref int n, [In,Out] fcomplex[] A, ref int lda, [In,Out] fcomplex[] w,  [In,Out] fcomplex[] vl, ref int ldvl, [In,Out] fcomplex[] vr, ref int ldvr, ref int ilo, ref int ihi, float[]  scale, ref float  abnrm, float[]  rconde, float[]  rcondv, [In,Out] fcomplex[] work, ref int lwork, float[] rwork, ref int info);
207        [DllImport("liblapack.so", EntryPoint = "zgeevx_"),SuppressUnmanagedCodeSecurity]
208        private static extern void lapack_zgeevx (ref char balance, ref char jobvl, ref char jobvr, ref char sense, ref int n, [In,Out]  complex[] A, ref int lda, [In,Out] complex[]  w,   [In,Out] complex[] vl, ref int ldvl, [In,Out]  complex[] vr, ref int ldvr, ref int ilo, ref int ihi, double[] scale, ref double abnrm, double[] rconde, double[] rcondv, [In,Out] complex[] work, ref int lwork, double[] rwork, ref int info);
209
210        [DllImport("liblapack.so", EntryPoint = "dsyevr_"),SuppressUnmanagedCodeSecurity]
211        private static extern void lapack_dsyevr (ref char jobz, ref char range, ref char uplo, ref int n,          double  [] A, ref int lda, ref double vl, ref double vu, ref int il, ref int iu, ref double abstol, ref int m, double[] w,          double  [] z, ref int ldz, int[] isuppz, double[] work, ref int lwork, int[] iwork, ref int liwork, ref int info);
212        [DllImport("liblapack.so", EntryPoint = "ssyevr_"),SuppressUnmanagedCodeSecurity]                                                                                                                                                                                                                                         
213        private static extern void lapack_ssyevr (ref char jobz, ref char range, ref char uplo, ref int n,          float   [] A, ref int lda, ref float  vl, ref float  vu, ref int il, ref int iu, ref float  abstol, ref int m, float [] w,          float   [] z, ref int ldz, int[] isuppz, float [] work, ref int lwork, int[] iwork, ref int liwork, ref int info);
214        [DllImport("liblapack.so", EntryPoint = "cheevr_"),SuppressUnmanagedCodeSecurity]                                                                                                                                                                                                                                         
215        private static extern void lapack_cheevr (ref char jobz, ref char range, ref char uplo, ref int n, [In,Out] fcomplex[] A, ref int lda, ref float  vl, ref float  vu, ref int il, ref int iu, ref float  abstol, ref int m, float [] w, [In,Out] fcomplex[] z, ref int ldz, int[] isuppz, [In,Out] fcomplex[] work, ref int lwork, float[] rwork, ref int lrwork, int[] iwork, ref int liwork, ref int info);
216        [DllImport("liblapack.so", EntryPoint = "zheevr_"),SuppressUnmanagedCodeSecurity]                                                                                                                                                                                                                                         
217        private static extern void lapack_zheevr (ref char jobz, ref char range, ref char uplo, ref int n, [In,Out] complex [] A, ref int lda, ref double vl, ref double vu, ref int il, ref int iu, ref double abstol, ref int m, double[] w, [In,Out] complex [] z, ref int ldz, int[] isuppz, [In,Out] complex[] work, ref int lwork, double[] rwork, ref int lrwork, int[] iwork, ref int liwork, ref int info);
218
219        [DllImport("liblapack.so", EntryPoint = "dsygv_"),SuppressUnmanagedCodeSecurity]
220        private static extern void lapack_dsygv (ref int itype, ref char jobz, ref char uplo, ref int n, double  [] A, ref int lda, double  [] B, ref int ldb, double [] w, double [] work, ref int lwork, ref int info);
221        [DllImport("liblapack.so", EntryPoint = "ssygv_"),SuppressUnmanagedCodeSecurity]
222        private static extern void lapack_ssygv (ref int itype, ref char jobz, ref char uplo, ref int n, float   [] A, ref int lda, float   [] B, ref int ldb, float [] w,  float  [] work, ref int lwork, ref int info);
223        [DllImport("liblapack.so", EntryPoint = "chegv_"),SuppressUnmanagedCodeSecurity]
224        private static extern void lapack_chegv (ref int itype, ref char jobz, ref char uplo, ref int n, [In,Out] fcomplex[] A, ref int lda, [In,Out] fcomplex [] B, ref int ldb, float  [] w, [In,Out] fcomplex[] work , ref int lwork, float[] rwork, ref int info);
225        [DllImport("liblapack.so", EntryPoint = "zhegv_"),SuppressUnmanagedCodeSecurity]
226        private static extern void lapack_zhegv (ref int itype, ref char jobz, ref char uplo, ref int n, [In,Out] complex [] A, ref int lda, [In,Out] complex  [] B, ref int ldb, double [] w, [In,Out]  complex[] work , ref int lwork, double[] rwork, ref int info);
227
228#endregion DLL INCLUDES
229
230        #region ILLAPACK INTERFACE
231
232        private int ILAENV (int ispec, string name, string opts, int n1, int n2, int n3, int n4) {
233            return lapack_ilaenv(ref ispec, ref name, ref opts, ref n1, ref n2, ref n3, ref n4);
234        }
235
236        /// <summary>
237        /// Implement wrapper for ATLAS GeneralMatrixMultiply
238        /// </summary>
239        /// <param name="TransA">Transposition state for matrix A: one of the constants in enum CBlas_Transpose</param>
240        /// <param name="TransB">Transposition state for matrix B: one of the constants in enum CBlas_Transpose</param>
241        /// <param name="M">Number of rows in A</param>
242        /// <param name="N">Number of columns in B</param>
243        /// <param name="K">Number of columns in A and number of rows in B</param>
244        /// <param name="alpha">multiplicationi factor for A</param>
245        /// <param name="A">pointer to double array A</param>
246        /// <param name="lda">distance between first elements of each column for column based orientation or
247        /// distance between first elements of each row for row based orientation for matrix B</param>
248        /// <param name="B">pointer to double array B</param>
249        /// <param name="ldb">distance between first elements of each column for column based orientation or
250        /// distance between first elements of each row for row based orientation for matrix A</param>
251        /// <param name="beta">multiplication faktor for matrix B</param>
252        /// <param name="C">pointer to predefined double array C of neccessary length</param>
253        /// <param name="ldc">distance between first elements of each column for column based orientation or
254        /// distance between first elements of each row for row based orientation for matrix C</param>
255        /// <remarks>All parameters except C are readonly. Only elements of matrix C will be altered. C must be a predefined
256        /// continous double array of size MxN</remarks>
257        public void dgemm(char TransA, char TransB, int M, int N, int K, double alpha, IntPtr A, int lda, IntPtr B, int ldb, double beta, double[] C, int ldc) {
258            lapack_dgemm(ref TransA, ref TransB, ref M, ref  N, ref  K, ref  alpha, A, ref lda, B, ref ldb, ref  beta, C, ref  ldc);
259        }
260        /// <summary>
261        /// Implement wrapper for ATLAS GeneralMatrixMultiply
262        /// </summary>
263        /// <param name="TransA">Transposition state for matrix A: one of the constants in enum CBlas_Transpose</param>
264        /// <param name="TransB">Transposition state for matrix B: one of the constants in enum CBlas_Transpose</param>
265        /// <param name="M">Number of rows in A</param>
266        /// <param name="N">Number of columns in B</param>
267        /// <param name="K">Number of columns in A and number of rows in B</param>
268        /// <param name="alpha">multiplicationi factor for A</param>
269        /// <param name="A">pointer to double array A</param>
270        /// <param name="lda">distance between first elements of each column for column based orientation or
271        /// distance between first elements of each row for row based orientation for matrix B</param>
272        /// <param name="B">pointer to double array B</param>
273        /// <param name="ldb">distance between first elements of each column for column based orientation or
274        /// distance between first elements of each row for row based orientation for matrix A</param>
275        /// <param name="beta">multiplication faktor for matrix B</param>
276        /// <param name="C">pointer to predefined double array C of neccessary length</param>
277        /// <param name="ldc">distance between first elements of each column for column based orientation or
278        /// distance between first elements of each row for row based orientation for matrix C</param>
279        /// <remarks>All parameters except C are readonly. Only elements of matrix C will be altered. C must be a predefined
280        /// continous double array of size MxN</remarks>
281        public void sgemm(char TransA, char TransB, int M, int N, int K, float alpha, IntPtr A, int lda, IntPtr B, int ldb, float beta, float[] C, int ldc) {
282            lapack_sgemm(ref TransA, ref TransB, ref M, ref  N, ref  K, ref  alpha, A, ref lda, B, ref ldb, ref  beta, C, ref  ldc);
283        }
284        /// <summary>
285        /// Implement wrapper for ATLAS GeneralMatrixMultiply
286        /// </summary>
287        /// <param name="TransA">Transposition state for matrix A: one of the constants in enum CBlas_Transpose</param>
288        /// <param name="TransB">Transposition state for matrix B: one of the constants in enum CBlas_Transpose</param>
289        /// <param name="M">Number of rows in A</param>
290        /// <param name="N">Number of columns in B</param>
291        /// <param name="K">Number of columns in A and number of rows in B</param>
292        /// <param name="alpha">multiplicationi factor for A</param>
293        /// <param name="A">pointer to double array A</param>
294        /// <param name="lda">distance between first elements of each column for column based orientation or
295        /// distance between first elements of each row for row based orientation for matrix B</param>
296        /// <param name="B">pointer to double array B</param>
297        /// <param name="ldb">distance between first elements of each column for column based orientation or
298        /// distance between first elements of each row for row based orientation for matrix A</param>
299        /// <param name="beta">multiplication faktor for matrix B</param>
300        /// <param name="C">pointer to predefined double array C of neccessary length</param>
301        /// <param name="ldc">distance between first elements of each column for column based orientation or
302        /// distance between first elements of each row for row based orientation for matrix C</param>
303        /// <remarks>All parameters except C are readonly. Only elements of matrix C will be altered. C must be a predefined
304        /// continous double array of size MxN</remarks>
305        public void cgemm(char TransA, char TransB, int M, int N, int K, fcomplex alpha, IntPtr A, int lda, IntPtr B, int ldb, fcomplex beta, fcomplex[] C, int ldc) {
306            lapack_cgemm(ref TransA, ref TransB, ref M, ref  N, ref  K, ref  alpha, A, ref lda, B, ref ldb, ref  beta, C, ref  ldc);
307        }
308        /// <summary>
309        /// Implement wrapper for ATLAS GeneralMatrixMultiply
310        /// </summary>
311        /// <param name="TransA">Transposition state for matrix A: one of the constants in enum CBlas_Transpose</param>
312        /// <param name="TransB">Transposition state for matrix B: one of the constants in enum CBlas_Transpose</param>
313        /// <param name="M">Number of rows in A</param>
314        /// <param name="N">Number of columns in B</param>
315        /// <param name="K">Number of columns in A and number of rows in B</param>
316        /// <param name="alpha">multiplicationi factor for A</param>
317        /// <param name="A">pointer to double array A</param>
318        /// <param name="lda">distance between first elements of each column for column based orientation or
319        /// distance between first elements of each row for row based orientation for matrix B</param>
320        /// <param name="B">pointer to double array B</param>
321        /// <param name="ldb">distance between first elements of each column for column based orientation or
322        /// distance between first elements of each row for row based orientation for matrix A</param>
323        /// <param name="beta">multiplication faktor for matrix B</param>
324        /// <param name="C">pointer to predefined double array C of neccessary length</param>
325        /// <param name="ldc">distance between first elements of each column for column based orientation or
326        /// distance between first elements of each row for row based orientation for matrix C</param>
327        /// <remarks>All parameters except C are readonly. Only elements of matrix C will be altered. C must be a predefined
328        /// continous double array of size MxN</remarks>
329        public void zgemm(char TransA, char TransB, int M, int N, int K, complex alpha, IntPtr A, int lda, IntPtr B, int ldb, complex beta, complex[] C, int ldc) {
330            lapack_zgemm(ref TransA, ref TransB, ref M, ref  N, ref  K, ref  alpha, A, ref lda, B, ref ldb, ref  beta, C, ref  ldc);
331        }
332
333
334       
335        public void  dgesdd (char jobz, int m, int n,  double [] a, int lda,  double [] s,  double [] u, int ldu,  double [] vt, int ldvt, ref int info) {
336            try {
337                 double [] work = new  double [1] { ( double )0.0 };
338                int lwork = -1;
339                int[] iwork = new int[((m < n) ? m : n) * 8];
340                 lapack_dgesdd (ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
341                if (work[0] != 0) {
342                    work = new  double [(int)work[0]];
343                    lwork = work.Length;
344                     lapack_dgesdd (ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
345                }
346            } catch (Exception e) {
347                if (e is OutOfMemoryException) {
348                     dgesvd (jobz, m, n, a, lda, s, u, ldu, vt, ldvt, ref info);
349                }
350                throw new ILException("Unable to do " +  "dgesdd"  + ".", e);
351            }
352        }
353
354#region HYCALPER AUTO GENERATED CODE
355
356       
357        public void  sgesdd (char jobz, int m, int n,  float [] a, int lda,  float [] s,  float [] u, int ldu,  float [] vt, int ldvt, ref int info) {
358            try {
359                float [] work = new  float [1] { ( float )0.0 };
360                int lwork = -1;
361                int[] iwork = new int[((m < n) ? m : n) * 8];
362                lapack_sgesdd (ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
363                if (work[0] != 0) {
364                    work = new  float [(int)work[0]];
365                    lwork = work.Length;
366                    lapack_sgesdd (ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
367                }
368            } catch (Exception e) {
369                if (e is OutOfMemoryException) {
370                    sgesvd (jobz, m, n, a, lda, s, u, ldu, vt, ldvt, ref info);
371                }
372                throw new ILException("Unable to do " +  "sgesdd"  + ".", e);
373            }
374        }
375
376#endregion HYCALPER AUTO GENERATED CODE
377
378
379
380        public void  zgesdd (char jobz, int m, int n,  complex [] a, int lda,  double [] s,  complex [] u, int ldu, complex [] vt, int ldvt, ref int info)
381        {
382            try {
383                 complex [] work = new  complex [1] { (  complex )0.0 };
384                 double [] rwork;
385                int minMN = (m < n) ? m : n;
386                if (jobz == 'N') {
387                    rwork = new  double [minMN * 7]; 
388                } else {
389                    rwork = new  double [5 * minMN * minMN + 5 * minMN]; 
390                }
391                int lwork = -1;
392                int[] iwork = new int[minMN * 8];
393                 lapack_zgesdd (ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, rwork, iwork, ref info);
394                if (work[0] != 0) {
395                    work = new  complex [(int)work[0].real];
396                    lwork = work.Length;
397                     lapack_zgesdd (ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork,rwork, iwork, ref info);
398                }
399            } catch (Exception e) {
400                if (e is OutOfMemoryException) {
401                     zgesvd (jobz, m, n, a, lda, s, u, ldu, vt, ldvt, ref info);
402                }
403                throw new ILException("Unable to do " +  "zgesdd"  + ".", e);
404            }
405        }
406
407#region HYCALPER AUTO GENERATED CODE
408
409
410        public void  cgesdd (char jobz, int m, int n,  fcomplex [] a, int lda,  float [] s,  fcomplex [] u, int ldu, fcomplex [] vt, int ldvt, ref int info)
411        {
412            try {
413                fcomplex [] work = new  fcomplex [1] { (  fcomplex )0.0 };
414                float [] rwork;
415                int minMN = (m < n) ? m : n;
416                if (jobz == 'N') {
417                    rwork = new  float [minMN * 7]; 
418                } else {
419                    rwork = new  float [5 * minMN * minMN + 5 * minMN]; 
420                }
421                int lwork = -1;
422                int[] iwork = new int[minMN * 8];
423                lapack_cgesdd (ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, rwork, iwork, ref info);
424                if (work[0] != 0) {
425                    work = new  fcomplex [(int)work[0].real];
426                    lwork = work.Length;
427                    lapack_cgesdd (ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork,rwork, iwork, ref info);
428                }
429            } catch (Exception e) {
430                if (e is OutOfMemoryException) {
431                    cgesvd (jobz, m, n, a, lda, s, u, ldu, vt, ldvt, ref info);
432                }
433                throw new ILException("Unable to do " +  "zgesdd"  + ".", e);
434            }
435        }
436
437#endregion HYCALPER AUTO GENERATED CODE
438
439
440       
441
442        /// <summary>
443        /// singular value decomposition
444        /// </summary>
445        /// <param name="jobz"></param>
446        /// <param name="m"></param>
447        /// <param name="n"></param>
448        /// <param name="a"></param>
449        /// <param name="lda"></param>
450        /// <param name="s"></param>
451        /// <param name="u"></param>
452        /// <param name="ldu"></param>
453        /// <param name="vt"></param>
454        /// <param name="ldvt"></param>
455        /// <param name="info"></param>
456        public void  dgesvd (char jobz, int m, int n,  double [] a, int lda,
457                            double [] s,  double [] u, int ldu,  double [] vt, int ldvt, ref int info) {
458            if (jobz != 'A' && jobz != 'S' && jobz != 'N')
459                throw new ILArgumentException("Argument jobz must be one of 'A','S' or 'N'");
460            try {
461                 double [] work = new  double [1] { ( double )0.0 };
462                int lwork = -1;
463                int[] iwork = new int[((m < n) ? m : n) * 8];
464                 lapack_dgesvd (ref jobz, ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
465                if (work[0] != 0) {
466                    work = new  double [(int)work[0]];
467                    lwork = work.Length;
468                     lapack_dgesvd (ref jobz, ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
469                }
470            } catch (Exception e) {
471                if (e is OutOfMemoryException) {
472                    throw new ILMemoryException("Not enough memory for given arguments.");
473                }
474                throw new ILException("Unable to do gesvd.", e);
475            }
476        }
477
478#region HYCALPER AUTO GENERATED CODE
479
480       
481
482        /// <summary>
483        /// singular value decomposition
484        /// </summary>
485        /// <param name="jobz"></param>
486        /// <param name="m"></param>
487        /// <param name="n"></param>
488        /// <param name="a"></param>
489        /// <param name="lda"></param>
490        /// <param name="s"></param>
491        /// <param name="u"></param>
492        /// <param name="ldu"></param>
493        /// <param name="vt"></param>
494        /// <param name="ldvt"></param>
495        /// <param name="info"></param>
496        public void  sgesvd (char jobz, int m, int n,  float [] a, int lda,
497                           float [] s,  float [] u, int ldu,  float [] vt, int ldvt, ref int info) {
498            if (jobz != 'A' && jobz != 'S' && jobz != 'N')
499                throw new ILArgumentException("Argument jobz must be one of 'A','S' or 'N'");
500            try {
501                float [] work = new  float [1] { ( float )0.0 };
502                int lwork = -1;
503                int[] iwork = new int[((m < n) ? m : n) * 8];
504                lapack_sgesvd (ref jobz, ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
505                if (work[0] != 0) {
506                    work = new  float [(int)work[0]];
507                    lwork = work.Length;
508                    lapack_sgesvd (ref jobz, ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
509                }
510            } catch (Exception e) {
511                if (e is OutOfMemoryException) {
512                    throw new ILMemoryException("Not enough memory for given arguments.");
513                }
514                throw new ILException("Unable to do gesvd.", e);
515            }
516        }
517       
518
519        /// <summary>
520        /// singular value decomposition
521        /// </summary>
522        /// <param name="jobz"></param>
523        /// <param name="m"></param>
524        /// <param name="n"></param>
525        /// <param name="a"></param>
526        /// <param name="lda"></param>
527        /// <param name="s"></param>
528        /// <param name="u"></param>
529        /// <param name="ldu"></param>
530        /// <param name="vt"></param>
531        /// <param name="ldvt"></param>
532        /// <param name="info"></param>
533        public void  zgesvd (char jobz, int m, int n,  complex [] a, int lda,
534                           double [] s,  complex [] u, int ldu,  complex [] vt, int ldvt, ref int info) {
535            if (jobz != 'A' && jobz != 'S' && jobz != 'N')
536                throw new ILArgumentException("Argument jobz must be one of 'A','S' or 'N'");
537            try {
538                complex [] work = new  complex [1] { ( complex )0.0 };
539                int lwork = -1;
540                int[] iwork = new int[((m < n) ? m : n) * 8];
541                lapack_zgesvd (ref jobz, ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
542                if (work[0] != 0) {
543                    work = new  complex [(int)work[0]];
544                    lwork = work.Length;
545                    lapack_zgesvd (ref jobz, ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
546                }
547            } catch (Exception e) {
548                if (e is OutOfMemoryException) {
549                    throw new ILMemoryException("Not enough memory for given arguments.");
550                }
551                throw new ILException("Unable to do gesvd.", e);
552            }
553        }
554       
555
556        /// <summary>
557        /// singular value decomposition
558        /// </summary>
559        /// <param name="jobz"></param>
560        /// <param name="m"></param>
561        /// <param name="n"></param>
562        /// <param name="a"></param>
563        /// <param name="lda"></param>
564        /// <param name="s"></param>
565        /// <param name="u"></param>
566        /// <param name="ldu"></param>
567        /// <param name="vt"></param>
568        /// <param name="ldvt"></param>
569        /// <param name="info"></param>
570        public void  cgesvd (char jobz, int m, int n,  fcomplex [] a, int lda,
571                           float [] s,  fcomplex [] u, int ldu,  fcomplex [] vt, int ldvt, ref int info) {
572            if (jobz != 'A' && jobz != 'S' && jobz != 'N')
573                throw new ILArgumentException("Argument jobz must be one of 'A','S' or 'N'");
574            try {
575                fcomplex [] work = new  fcomplex [1] { ( fcomplex )0.0 };
576                int lwork = -1;
577                int[] iwork = new int[((m < n) ? m : n) * 8];
578                lapack_cgesvd (ref jobz, ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
579                if (work[0] != 0) {
580                    work = new  fcomplex [(int)work[0]];
581                    lwork = work.Length;
582                    lapack_cgesvd (ref jobz, ref jobz, ref m, ref n, a, ref lda, s, u, ref ldu, vt, ref ldvt, work, ref lwork, iwork, ref info);
583                }
584            } catch (Exception e) {
585                if (e is OutOfMemoryException) {
586                    throw new ILMemoryException("Not enough memory for given arguments.");
587                }
588                throw new ILException("Unable to do gesvd.", e);
589            }
590        }
591
592#endregion HYCALPER AUTO GENERATED CODE
593
594        public void dpotrf(char uplo, int n, double[] A, int lda, ref int info) {
595            lapack_dpotrf(ref uplo, ref n, A, ref lda, ref info);
596        }
597        public void spotrf(char uplo, int n, float[] A, int lda, ref int info) {
598            lapack_spotrf(ref uplo, ref n, A, ref lda, ref info);
599        }
600        public void cpotrf(char uplo, int n, fcomplex[] A, int lda, ref int info) {
601            lapack_cpotrf(ref uplo, ref n, A, ref lda, ref info);
602        }
603        public void zpotrf(char uplo, int n, complex[] A, int lda, ref int info) {
604            lapack_zpotrf(ref uplo, ref n, A, ref lda, ref info);
605        }
606
607
608        public void dpotri(char uplo, int n, double[] A, int lda, ref int info) {
609            lapack_dpotri(ref uplo, ref n, A, ref lda, ref info);
610        }
611        public void spotri(char uplo, int n, float[] A, int lda, ref int info) {
612            lapack_spotri(ref uplo, ref n, A, ref lda, ref info);
613        }
614        public void cpotri(char uplo, int n, fcomplex[] A, int lda, ref int info) {
615            lapack_cpotri(ref uplo, ref n, A, ref lda, ref info);
616        }
617        public void zpotri(char uplo, int n, complex[] A, int lda, ref int info) {
618            lapack_zpotri(ref uplo, ref n, A, ref lda, ref info);
619        }
620
621
622        public void dgetrf(int M, int N, double[] A, int LDA, int[] IPIV, ref int info) {
623            lapack_dgetrf(ref M, ref N, A, ref LDA, IPIV, ref info);
624        }
625        public void sgetrf(int M, int N, float[] A, int LDA, int[] IPIV, ref int info) {
626            lapack_sgetrf(ref M, ref N, A, ref LDA, IPIV, ref info);
627        }
628        public void cgetrf(int M, int N, fcomplex[] A, int LDA, int[] IPIV, ref int info) {
629            lapack_cgetrf(ref M, ref N, A, ref LDA, IPIV, ref info);
630        }
631        public void zgetrf(int M, int N, complex[] A, int LDA, int[] IPIV, ref int info) {
632            lapack_zgetrf(ref M, ref N, A, ref LDA, IPIV, ref info);
633        }
634
635
636       
637        public void  dgetri (int N,  double [] A, int LDA, int[] IPIV, ref int info) {
638             double [] work = new  double [1]; 
639            int lwork = -1;
640            try {
641                 lapack_dgetri (ref N, A, ref LDA, IPIV, work, ref lwork, ref info);
642                lwork = (int)work[0];
643                if (lwork > 0 && info == 0) {
644                    work = new  double [lwork];
645                     lapack_dgetri (ref N, A, ref LDA, IPIV, work, ref lwork, ref info);
646                } else {
647                    throw new ILException("error in lapack_dgetri");
648                }
649            } catch (OutOfMemoryException e) {
650                throw new ILException("error on dgetri. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
651            }
652        }
653
654#region HYCALPER AUTO GENERATED CODE
655
656       
657        public void  sgetri (int N,  float [] A, int LDA, int[] IPIV, ref int info) {
658            float [] work = new  float [1]; 
659            int lwork = -1;
660            try {
661                lapack_sgetri (ref N, A, ref LDA, IPIV, work, ref lwork, ref info);
662                lwork = (int)work[0];
663                if (lwork > 0 && info == 0) {
664                    work = new  float [lwork];
665                    lapack_sgetri (ref N, A, ref LDA, IPIV, work, ref lwork, ref info);
666                } else {
667                    throw new ILException("error in lapack_dgetri");
668                }
669            } catch (OutOfMemoryException e) {
670                throw new ILException("error on dgetri. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
671            }
672        }
673       
674        public void  zgetri (int N,  complex [] A, int LDA, int[] IPIV, ref int info) {
675            complex [] work = new  complex [1]; 
676            int lwork = -1;
677            try {
678                lapack_zgetri (ref N, A, ref LDA, IPIV, work, ref lwork, ref info);
679                lwork = (int)work[0];
680                if (lwork > 0 && info == 0) {
681                    work = new  complex [lwork];
682                    lapack_zgetri (ref N, A, ref LDA, IPIV, work, ref lwork, ref info);
683                } else {
684                    throw new ILException("error in lapack_dgetri");
685                }
686            } catch (OutOfMemoryException e) {
687                throw new ILException("error on dgetri. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
688            }
689        }
690       
691        public void  cgetri (int N,  fcomplex [] A, int LDA, int[] IPIV, ref int info) {
692            fcomplex [] work = new  fcomplex [1]; 
693            int lwork = -1;
694            try {
695                lapack_cgetri (ref N, A, ref LDA, IPIV, work, ref lwork, ref info);
696                lwork = (int)work[0];
697                if (lwork > 0 && info == 0) {
698                    work = new  fcomplex [lwork];
699                    lapack_cgetri (ref N, A, ref LDA, IPIV, work, ref lwork, ref info);
700                } else {
701                    throw new ILException("error in lapack_dgetri");
702                }
703            } catch (OutOfMemoryException e) {
704                throw new ILException("error on dgetri. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
705            }
706        }
707
708#endregion HYCALPER AUTO GENERATED CODE
709
710
711       
712        public void  dgeqrf (int M, int N,  double [] A, int lda,  double [] tau, ref int info) {
713             double [] work = new  double [1]; 
714            int lwork = -1;
715            try {
716                 lapack_dgeqrf (ref M, ref N, A, ref lda, tau, work, ref lwork, ref info);
717                lwork = (int)work[0];
718                if (lwork > 0 && info == 0) {
719                    work = new  double [lwork];
720                     lapack_dgeqrf (ref M, ref N, A, ref lda, tau, work, ref lwork, ref info);
721                } else {
722                    throw new ILException("error in lapack_?geqrf");
723                }
724            } catch (OutOfMemoryException e) {
725                throw new ILException("error on ?geqrf. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
726            }
727        }
728
729#region HYCALPER AUTO GENERATED CODE
730
731       
732        public void  sgeqrf (int M, int N,  float [] A, int lda,  float [] tau, ref int info) {
733            float [] work = new  float [1]; 
734            int lwork = -1;
735            try {
736                lapack_sgeqrf (ref M, ref N, A, ref lda, tau, work, ref lwork, ref info);
737                lwork = (int)work[0];
738                if (lwork > 0 && info == 0) {
739                    work = new  float [lwork];
740                    lapack_sgeqrf (ref M, ref N, A, ref lda, tau, work, ref lwork, ref info);
741                } else {
742                    throw new ILException("error in lapack_?geqrf");
743                }
744            } catch (OutOfMemoryException e) {
745                throw new ILException("error on ?geqrf. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
746            }
747        }
748       
749        public void  zgeqrf (int M, int N,  complex [] A, int lda,  complex [] tau, ref int info) {
750            complex [] work = new  complex [1]; 
751            int lwork = -1;
752            try {
753                lapack_zgeqrf (ref M, ref N, A, ref lda, tau, work, ref lwork, ref info);
754                lwork = (int)work[0];
755                if (lwork > 0 && info == 0) {
756                    work = new  complex [lwork];
757                    lapack_zgeqrf (ref M, ref N, A, ref lda, tau, work, ref lwork, ref info);
758                } else {
759                    throw new ILException("error in lapack_?geqrf");
760                }
761            } catch (OutOfMemoryException e) {
762                throw new ILException("error on ?geqrf. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
763            }
764        }
765       
766        public void  cgeqrf (int M, int N,  fcomplex [] A, int lda,  fcomplex [] tau, ref int info) {
767            fcomplex [] work = new  fcomplex [1]; 
768            int lwork = -1;
769            try {
770                lapack_cgeqrf (ref M, ref N, A, ref lda, tau, work, ref lwork, ref info);
771                lwork = (int)work[0];
772                if (lwork > 0 && info == 0) {
773                    work = new  fcomplex [lwork];
774                    lapack_cgeqrf (ref M, ref N, A, ref lda, tau, work, ref lwork, ref info);
775                } else {
776                    throw new ILException("error in lapack_?geqrf");
777                }
778            } catch (OutOfMemoryException e) {
779                throw new ILException("error on ?geqrf. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
780            }
781        }
782
783#endregion HYCALPER AUTO GENERATED CODE
784
785        public 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) {
786            throw new Exception("The method or operation is not implemented.");
787        }
788        public 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) {
789            throw new Exception("The method or operation is not implemented.");
790        }
791
792
793       
794        public void  dorgqr (int M, int N, int K,  double [] A, int lda,  double [] tau, ref int info) {
795             double [] work = new  double [1]; 
796            int lwork = -1;
797            try {
798                /*!HC:lapack_***gqr*/ lapack_dorgqr (ref M, ref N, ref K, A, ref lda, tau, work, ref lwork, ref info);
799                lwork = (int)work[0];
800                if (lwork > 0 && info == 0) {
801                    work = new  double [lwork];
802                    /*!HC:lapack_***gqr*/ lapack_dorgqr (ref M, ref N, ref K, A, ref lda, tau, work, ref lwork, ref info);
803                } else {
804                    throw new ILException("error in lapack_?[un/or]gqr");
805                }
806            } catch (OutOfMemoryException e) {
807                throw new ILException("error on ?[un/or]gqr. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
808            }
809        }
810
811#region HYCALPER AUTO GENERATED CODE
812
813       
814        public void  sorgqr (int M, int N, int K,  float [] A, int lda,  float [] tau, ref int info) {
815            float [] work = new  float [1]; 
816            int lwork = -1;
817            try {
818                lapack_sorgqr (ref M, ref N, ref K, A, ref lda, tau, work, ref lwork, ref info);
819                lwork = (int)work[0];
820                if (lwork > 0 && info == 0) {
821                    work = new  float [lwork];
822                    lapack_sorgqr (ref M, ref N, ref K, A, ref lda, tau, work, ref lwork, ref info);
823                } else {
824                    throw new ILException("error in lapack_?[un/or]gqr");
825                }
826            } catch (OutOfMemoryException e) {
827                throw new ILException("error on ?[un/or]gqr. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
828            }
829        }
830       
831        public void  zungqr (int M, int N, int K,  complex [] A, int lda,  complex [] tau, ref int info) {
832            complex [] work = new  complex [1]; 
833            int lwork = -1;
834            try {
835                lapack_zungqr (ref M, ref N, ref K, A, ref lda, tau, work, ref lwork, ref info);
836                lwork = (int)work[0];
837                if (lwork > 0 && info == 0) {
838                    work = new  complex [lwork];
839                    lapack_zungqr (ref M, ref N, ref K, A, ref lda, tau, work, ref lwork, ref info);
840                } else {
841                    throw new ILException("error in lapack_?[un/or]gqr");
842                }
843            } catch (OutOfMemoryException e) {
844                throw new ILException("error on ?[un/or]gqr. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
845            }
846        }
847       
848        public void  cungqr (int M, int N, int K,  fcomplex [] A, int lda,  fcomplex [] tau, ref int info) {
849            fcomplex [] work = new  fcomplex [1]; 
850            int lwork = -1;
851            try {
852                lapack_cungqr (ref M, ref N, ref K, A, ref lda, tau, work, ref lwork, ref info);
853                lwork = (int)work[0];
854                if (lwork > 0 && info == 0) {
855                    work = new  fcomplex [lwork];
856                    lapack_cungqr (ref M, ref N, ref K, A, ref lda, tau, work, ref lwork, ref info);
857                } else {
858                    throw new ILException("error in lapack_?[un/or]gqr");
859                }
860            } catch (OutOfMemoryException e) {
861                throw new ILException("error on ?[un/or]gqr. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
862            }
863        }
864
865#endregion HYCALPER AUTO GENERATED CODE
866
867
868       
869        public void  dgeqp3 ( int M,int N, double [] A,int LDA,int [] JPVT, double [] tau, ref int info ) {
870             double [] work = new  double [1];
871            int lwork = -1;
872            try {
873                 
874                /*dummy*/
875                 
876                lapack_dgeqp3 (ref M, ref N, A, ref LDA, JPVT, tau, work, ref lwork, ref info);
877                lwork = (int)work[0];
878                if (lwork > 0 && info == 0) {
879                    work = new  double [lwork];
880                     
881                    lapack_dgeqp3 (ref M, ref N, A, ref LDA, JPVT, tau, work, ref lwork, ref info);
882                } else {
883                    throw new ILException("error in lapack_?geqp3");
884                }
885            } catch (OutOfMemoryException e) {
886                throw new ILException("error on ?geqp3. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
887            }
888        }
889
890#region HYCALPER AUTO GENERATED CODE
891
892       
893        public void  sgeqp3 ( int M,int N, float [] A,int LDA,int [] JPVT, float [] tau, ref int info ) {
894            float [] work = new  float [1];
895            int lwork = -1;
896            try {
897               
898                lapack_sgeqp3 (ref M, ref N, A, ref LDA, JPVT, tau, work, ref lwork, ref info);
899                lwork = (int)work[0];
900                if (lwork > 0 && info == 0) {
901                    work = new  float [lwork];
902                    lapack_sgeqp3 (ref M, ref N, A, ref LDA, JPVT, tau, work, ref lwork, ref info);
903                } else {
904                    throw new ILException("error in lapack_?geqp3");
905                }
906            } catch (OutOfMemoryException e) {
907                throw new ILException("error on ?geqp3. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
908            }
909        }
910       
911        public void  zgeqp3 ( int M,int N, complex [] A,int LDA,int [] JPVT, complex [] tau, ref int info ) {
912            complex [] work = new  complex [1];
913            int lwork = -1;
914            try {
915                double[] rwork = new double[2 * N];
916                lapack_zgeqp3 (ref M, ref N, A, ref LDA, JPVT, tau, work, ref lwork, rwork, ref info);
917                lwork = (int)work[0];
918                if (lwork > 0 && info == 0) {
919                    work = new  complex [lwork];
920                    lapack_zgeqp3 (ref M, ref N, A, ref LDA, JPVT, tau, work, ref lwork, rwork, ref info);
921                } else {
922                    throw new ILException("error in lapack_?geqp3");
923                }
924            } catch (OutOfMemoryException e) {
925                throw new ILException("error on ?geqp3. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
926            }
927        }
928       
929        public void  cgeqp3 ( int M,int N, fcomplex [] A,int LDA,int [] JPVT, fcomplex [] tau, ref int info ) {
930            fcomplex [] work = new  fcomplex [1];
931            int lwork = -1;
932            try {
933                float[] rwork = new float[2 * N];
934                lapack_cgeqp3 (ref M, ref N, A, ref LDA, JPVT, tau, work, ref lwork, rwork, ref info);
935                lwork = (int)work[0];
936                if (lwork > 0 && info == 0) {
937                    work = new  fcomplex [lwork];
938                    lapack_cgeqp3 (ref M, ref N, A, ref LDA, JPVT, tau, work, ref lwork, rwork, ref info);
939                } else {
940                    throw new ILException("error in lapack_?geqp3");
941                }
942            } catch (OutOfMemoryException e) {
943                throw new ILException("error on ?geqp3. Not enough memory! " + (lwork * Marshal.SizeOf( work[0] )).ToString() + " bytes has been requested.",e);
944            }
945        }
946
947#endregion HYCALPER AUTO GENERATED CODE
948
949        public void dtrtrs(char uplo, char transA, char diag, int N, int nrhs, IntPtr A, int LDA, IntPtr B, int LDB, ref int info) {
950            lapack_dtrtrs(ref uplo, ref transA, ref diag, ref N, ref nrhs, A, ref LDA, B, ref LDB, ref info);
951        }
952        public void strtrs(char uplo, char transA, char diag, int N, int nrhs, IntPtr A, int LDA, IntPtr B, int LDB, ref int info) {
953            lapack_strtrs(ref uplo, ref transA, ref diag, ref N, ref nrhs, A, ref LDA, B, ref LDB, ref info);
954        }
955        public void ctrtrs(char uplo, char transA, char diag, int N, int nrhs, IntPtr A, int LDA, IntPtr B, int LDB, ref int info) {
956            lapack_ctrtrs(ref uplo, ref transA, ref diag, ref N, ref nrhs, A, ref LDA, B, ref LDB, ref info);
957        }
958        public void ztrtrs(char uplo, char transA, char diag, int N, int nrhs, IntPtr A, int LDA, IntPtr B, int LDB, ref int info) {
959            lapack_ztrtrs(ref uplo, ref transA, ref diag, ref N, ref nrhs, A, ref LDA, B, ref LDB, ref info);
960        }
961
962        public void dgetrs(char trans, int N, int NRHS, double[] A, int LDA, int[] IPIV, double[] B, int LDB, ref int info) {
963            lapack_dgetrs(ref trans,ref N,ref NRHS, A, ref LDA, IPIV, B, ref LDB, ref info);     
964        }
965
966        public void sgetrs(char trans, int N, int NRHS, float[] A, int LDA, int[] IPIV, float[] B, int LDB, ref int info) {
967            lapack_sgetrs(ref trans,ref N,ref NRHS, A, ref LDA, IPIV, B, ref LDB, ref info);     
968        }
969
970        public void cgetrs(char trans, int N, int NRHS, fcomplex[] A, int LDA, int[] IPIV, fcomplex[] B, int LDB, ref int info) {
971            lapack_cgetrs(ref trans,ref N,ref NRHS, A, ref LDA, IPIV, B, ref LDB, ref info);     
972        }
973
974        public void zgetrs(char trans, int N, int NRHS, complex[] A, int LDA, int[] IPIV, complex[] B, int LDB, ref int info) {
975            lapack_zgetrs(ref trans,ref N,ref NRHS, A, ref LDA, IPIV, B, ref LDB, ref info);
976        }
977       
978        public void dpotrs(char uplo, int n, int nrhs, double[] A, int lda, double[] B, int ldb, ref int info) {
979            lapack_dpotrs(ref uplo, ref n, ref nrhs, A, ref lda, B, ref ldb, ref info);
980        }
981
982        public void spotrs(char uplo, int n, int nrhs, float[] A, int lda, float[] B, int ldb, ref int info) {
983            lapack_spotrs(ref uplo, ref n, ref nrhs, A, ref lda, B, ref ldb, ref info);
984        }
985
986        public void cpotrs(char uplo, int n, int nrhs, fcomplex[] A, int lda, fcomplex[] B, int ldb, ref int info) {
987            lapack_cpotrs(ref uplo, ref n, ref nrhs, A, ref lda, B, ref ldb, ref info);
988        }
989
990        public void zpotrs(char uplo, int n, int nrhs, complex[] A, int lda, complex[] B, int ldb, ref int info) {
991            lapack_zpotrs(ref uplo, ref n, ref nrhs, A, ref lda, B, ref ldb, ref info);
992        }
993
994
995       
996        public 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) {
997             double [] work = new  double [1];
998            int [] iwork = new int[1];
999            int lwork = -1;
1000            /*HC:HycalpTag1*/
1001            lapack_dgelsd (ref m, ref n, ref nrhs, A, ref lda, B, ref ldb, S,ref RCond, ref rank, work, ref lwork, iwork, ref info);
1002            if (info != 0)
1003                throw new ILArgumentException("dgelsd: invalid parameter: #" + (-info).ToString());
1004            lwork = ILAENV(9, "dgelsd", " ",0,0,0,0);
1005            if (lwork <= 0)
1006                throw new ILArgumentException("dgelsd: unknown error determining working size liwork");
1007            iwork = new int[lwork];
1008            lwork = (int)work[0];
1009            work = new  double [lwork];
1010            /*HC:HycalpTag2*/
1011            lapack_dgelsd (ref m, ref n, ref nrhs, A, ref lda, B, ref ldb, S,ref RCond, ref rank, work, ref lwork, iwork, ref info);
1012        }
1013
1014#region HYCALPER AUTO GENERATED CODE
1015
1016       
1017        public 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) {
1018            float [] work = new  float [1];
1019            int [] iwork = new int[1];
1020            int lwork = -1;
1021            lapack_sgelsd (ref m, ref n, ref nrhs, A, ref lda, B, ref ldb, S,ref RCond, ref rank, work, ref lwork, iwork, ref info);
1022            if (info != 0)
1023                throw new ILArgumentException("dgelsd: invalid parameter: #" + (-info).ToString());
1024            lwork = ILAENV(9, "dgelsd", " ",0,0,0,0);
1025            if (lwork <= 0)
1026                throw new ILArgumentException("dgelsd: unknown error determining working size liwork");
1027            iwork = new int[lwork];
1028            lwork = (int)work[0];
1029            work = new  float [lwork];
1030            lapack_sgelsd (ref m, ref n, ref nrhs, A, ref lda, B, ref ldb, S,ref RCond, ref rank, work, ref lwork, iwork, ref info);
1031        }
1032       
1033        public 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) {
1034            complex [] work = new  complex [1];
1035            int [] iwork = new int[1];
1036            int lwork = -1;
1037            double [] rwork = new double [1];  lapack_zgelsd (ref m, ref n, ref nrhs, A, ref lda, B, ref ldb, S,ref RCond, ref rank, work, ref lwork, rwork, iwork, ref info);
1038            if (info != 0)
1039                throw new ILArgumentException("dgelsd: invalid parameter: #" + (-info).ToString());
1040            lwork = ILAENV(9, "dgelsd", " ",0,0,0,0);
1041            if (lwork <= 0)
1042                throw new ILArgumentException("dgelsd: unknown error determining working size liwork");
1043            iwork = new int[lwork];
1044            lwork = (int)work[0];
1045            work = new  complex [lwork];
1046            rwork = new double [(int)rwork[0]];  lapack_zgelsd (ref m, ref n, ref nrhs, A, ref lda, B, ref ldb, S,ref RCond, ref rank, work, ref lwork, rwork, iwork, ref info);
1047        }
1048       
1049        public 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) {
1050            fcomplex [] work = new  fcomplex [1];
1051            int [] iwork = new int[1];
1052            int lwork = -1;
1053            float [] rwork = new float [1];  lapack_cgelsd (ref m, ref n, ref nrhs, A, ref lda, B, ref ldb, S,ref RCond, ref rank, work, ref lwork, rwork, iwork, ref info);
1054            if (info != 0)
1055                throw new ILArgumentException("dgelsd: invalid parameter: #" + (-info).ToString());
1056            lwork = ILAENV(9, "dgelsd", " ",0,0,0,0);
1057            if (lwork <= 0)
1058                throw new ILArgumentException("dgelsd: unknown error determining working size liwork");
1059            iwork = new int[lwork];
1060            lwork = (int)work[0];
1061            work = new  fcomplex [lwork];
1062            rwork = new float [(int)rwork[0]];  lapack_cgelsd (ref m, ref n, ref nrhs, A, ref lda, B, ref ldb, S,ref RCond, ref rank, work, ref lwork, rwork, iwork, ref info);
1063        }
1064
1065#endregion HYCALPER AUTO GENERATED CODE
1066
1067
1068       
1069        public 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) {
1070            int lwork = -1;
1071             double [] work = new  double [1];
1072             //
1073            /*!HC:lapack_?gelsy*/
1074            lapack_dgelsy (ref m,ref n,ref nrhs,A,ref lda,B,ref ldb,JPVT0,ref RCond,ref rank,work,ref lwork,ref info);
1075            if (info != 0)
1076                throw new ILArgumentException("?gelsy: unable to determine optimal block size. cancelling...");
1077            lwork = (int) work[0];
1078            work = new  double [lwork];
1079             //
1080            /*!HC:lapack_?gelsy*/
1081            lapack_dgelsy (ref m,ref n,ref nrhs,A,ref lda,B,ref ldb,JPVT0,ref RCond,ref rank,work,ref lwork,ref info);
1082        }
1083
1084#region HYCALPER AUTO GENERATED CODE
1085
1086       
1087        public 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) {
1088            int lwork = -1;
1089            float [] work = new  float [1];
1090           
1091            lapack_sgelsy (ref m,ref n,ref nrhs,A,ref lda,B,ref ldb,JPVT0,ref RCond,ref rank,work,ref lwork,ref info);
1092            if (info != 0)
1093                throw new ILArgumentException("?gelsy: unable to determine optimal block size. cancelling...");
1094            lwork = (int) work[0];
1095            work = new  float [lwork];
1096           
1097            lapack_sgelsy (ref m,ref n,ref nrhs,A,ref lda,B,ref ldb,JPVT0,ref RCond,ref rank,work,ref lwork,ref info);
1098        }
1099       
1100        public 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) {
1101            int lwork = -1;
1102            complex [] work = new  complex [1];
1103            double[] rwork = new double[1];
1104            lapack_zgelsy (ref m,ref n,ref nrhs,A,ref lda,B,ref ldb,JPVT0,ref RCond,ref rank,work,ref lwork, rwork, ref info);
1105            if (info != 0)
1106                throw new ILArgumentException("?gelsy: unable to determine optimal block size. cancelling...");
1107            lwork = (int) work[0];
1108            work = new  complex [lwork];
1109            rwork = new double[lwork];
1110            lapack_zgelsy (ref m,ref n,ref nrhs,A,ref lda,B,ref ldb,JPVT0,ref RCond,ref rank,work,ref lwork, rwork, ref info);
1111        }
1112       
1113        public 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) {
1114            int lwork = -1;
1115            fcomplex [] work = new  fcomplex [1];
1116            float[] rwork = new float[1];
1117            lapack_cgelsy (ref m,ref n,ref nrhs,A,ref lda,B,ref ldb,JPVT0,ref RCond,ref rank,work,ref lwork, rwork, ref info);
1118            if (info != 0)
1119                throw new ILArgumentException("?gelsy: unable to determine optimal block size. cancelling...");
1120            lwork = (int) work[0];
1121            work = new  fcomplex [lwork];
1122            rwork = new float[lwork];
1123            lapack_cgelsy (ref m,ref n,ref nrhs,A,ref lda,B,ref ldb,JPVT0,ref RCond,ref rank,work,ref lwork, rwork, ref info);
1124        }
1125
1126#endregion HYCALPER AUTO GENERATED CODE
1127
1128        #region ?GEEVX
1129        public 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) {
1130            double [] work = new double[1];
1131            int lwork = -1;
1132            int [] iwork = new int[2 * n - 2];
1133            lapack_dgeevx(ref balance, ref jobvl, ref jobvr, ref sense, ref n, A, ref lda, wr, wi, vl, ref ldvl, vr, ref ldvr, ref ilo, ref ihi, scale, ref abnrm, rconde, rcondv, work, ref lwork, iwork, ref info);
1134            if (info != 0)
1135                throw new ILArgumentException("error in lapack call: ?geevx. (" + info + ")");
1136            lwork = (int)work[0];
1137            work = new double[lwork];
1138            lapack_dgeevx(ref balance, ref jobvl, ref jobvr, ref sense, ref n, A, ref lda, wr, wi, vl, ref ldvl, vr, ref ldvr, ref ilo, ref ihi, scale, ref abnrm, rconde, rcondv, work, ref lwork, iwork, ref info);
1139        }
1140        public 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) {
1141            float [] work = new float[1];
1142            int lwork = -1;
1143            int [] iwork = new int[2 * n - 2];
1144            lapack_sgeevx(ref balance, ref jobvl, ref jobvr, ref sense, ref n, A, ref lda, wr, wi, vl, ref ldvl, vr, ref ldvr, ref ilo, ref ihi, scale, ref abnrm, rconde, rcondv, work, ref lwork, iwork, ref info);
1145            if (info != 0)
1146                throw new ILArgumentException("error in lapack call: ?geevx. (" + info + ")");
1147            lwork = (int)work[0];
1148            work = new float[lwork];
1149            lapack_sgeevx(ref balance, ref jobvl, ref jobvr, ref sense, ref n, A, ref lda, wr, wi, vl, ref ldvl, vr, ref ldvr, ref ilo, ref ihi, scale, ref abnrm, rconde, rcondv, work, ref lwork, iwork, ref info);
1150        }
1151        public 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) {
1152            fcomplex [] work = new fcomplex[1];
1153            int lwork = -1;
1154            float[] rwork = new float[2 * n];
1155            lapack_cgeevx(ref balance, ref jobvl, ref jobvr, ref sense, ref n, A, ref lda, w, vl, ref ldvl, vr, ref ldvr, ref ilo, ref ihi, scale, ref abnrm, rconde, rcondv, work, ref lwork, rwork, ref info);
1156            if (info != 0)
1157                throw new ILArgumentException("error in lapack call: ?geevx. (" + info + ")");
1158            lwork = (int)work[0];
1159            work = new fcomplex[lwork];
1160            lapack_cgeevx(ref balance, ref jobvl, ref jobvr, ref sense, ref n, A, ref lda, w, vl, ref ldvl, vr, ref ldvr, ref ilo, ref ihi, scale, ref abnrm, rconde, rcondv, work, ref lwork, rwork, ref info);
1161        }
1162        public 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) {
1163            complex [] work = new complex[1];
1164            int lwork = -1;
1165            double[] rwork = new double[2 * n];
1166            lapack_zgeevx(ref balance, ref jobvl, ref jobvr, ref sense, ref n, A, ref lda, w, vl, ref ldvl, vr, ref ldvr, ref ilo, ref ihi, scale, ref abnrm, rconde, rcondv, work, ref lwork, rwork, ref info);
1167            if (info != 0)
1168                throw new ILArgumentException("error in lapack call: ?geevx. (" + info + ")");
1169            lwork = (int)work[0];
1170            work = new complex[lwork];
1171            lapack_zgeevx(ref balance, ref jobvl, ref jobvr, ref sense, ref n, A, ref lda, w, vl, ref ldvl, vr, ref ldvr, ref ilo, ref ihi, scale, ref abnrm, rconde, rcondv, work, ref lwork, rwork, ref info);
1172        }
1173        #endregion
1174
1175        #region ?SYEVR
1176        public 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) {
1177            double [] work = new double[1];
1178            int lwork = -1, liwork = -1;
1179            int [] iwork = new int[1];
1180            lapack_dsyevr(ref jobz,ref range,ref uplo,ref n, A,ref lda, ref vl, ref vu, ref il, ref iu, ref abstol,ref m, w,z,ref ldz,isuppz, work,ref lwork,iwork,ref liwork,ref info);
1181            if (info != 0) {
1182                throw new ILArgumentException("?syevr: error returned from lapack: " + info);
1183            }
1184            lwork = (int)work[0];
1185            work = new double[lwork];
1186            liwork = (int) iwork[0];
1187            iwork = new int[liwork];
1188            lapack_dsyevr(ref jobz,ref range,ref uplo,ref n, A,ref lda, ref vl, ref vu, ref il, ref iu, ref abstol,ref m, w,z,ref ldz,isuppz, work,ref lwork,iwork,ref liwork,ref info);
1189        }
1190        public 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) {
1191            float [] work = new float[1];
1192            int lwork = -1, liwork = -1;
1193            int [] iwork = new int[1];
1194            lapack_ssyevr(ref jobz,ref range,ref uplo,ref n, A,ref lda, ref vl, ref vu, ref il, ref iu, ref abstol,ref m, w,z,ref ldz,isuppz, work,ref lwork,iwork,ref liwork,ref info);
1195            if (info != 0) {
1196                throw new ILArgumentException("?syevr: error returned from lapack: " + info);
1197            }
1198            lwork = (int)work[0];
1199            work = new float[lwork];
1200            liwork = (int) iwork[0];
1201            iwork = new int[liwork];
1202            lapack_ssyevr(ref jobz,ref range,ref uplo,ref n, A,ref lda, ref vl, ref vu, ref il, ref iu, ref abstol,ref m, w,z,ref ldz,isuppz, work,ref lwork,iwork,ref liwork,ref info);
1203        }
1204        public 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) {
1205            fcomplex[] work = new fcomplex[1];
1206            float [] rwork = new float[1];
1207            int [] iwork = new int[1];
1208            int lrwork = -1, liwork = -1, lwork = -1;
1209            lapack_cheevr(ref jobz,ref range,ref uplo,ref n, A,ref lda, ref vl, ref vu, ref il, ref iu, ref abstol,ref m, w,z,ref ldz,isuppz, work,ref lwork,rwork,ref lrwork, iwork,ref liwork,ref info);
1210            if (info != 0) {
1211                throw new ILArgumentException("?syevr: error returned from lapack: " + info);
1212            }
1213            lrwork = (int)rwork[0];
1214            rwork = new float[lrwork];
1215            lwork = (int) work[0];
1216            work = new fcomplex[lwork];
1217            liwork = (int) iwork[0];
1218            iwork = new int[liwork];
1219            lapack_cheevr(ref jobz,ref range,ref uplo,ref n, A,ref lda, ref vl, ref vu, ref il, ref iu, ref abstol,ref m, w,z,ref ldz,isuppz, work,ref lwork,rwork,ref lrwork,iwork,ref liwork,ref info);
1220        }
1221        public 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) {
1222            complex[] work = new complex[1];
1223            double [] rwork = new double[1];
1224            int [] iwork = new int[1];
1225            int lrwork = -1, liwork = -1, lwork = -1;
1226            lapack_zheevr(ref jobz,ref range,ref uplo,ref n, A,ref lda, ref vl, ref vu, ref il, ref iu, ref abstol,ref m, w,z,ref ldz,isuppz, work,ref lwork,rwork,ref lrwork, iwork,ref liwork,ref info);
1227            if (info != 0) {
1228                throw new ILArgumentException("?syevr: error returned from lapack: " + info);
1229            }
1230            lrwork = (int)rwork[0];
1231            rwork = new double[lrwork];
1232            lwork = (int) work[0];
1233            work = new complex[lwork];
1234            liwork = (int) iwork[0];
1235            iwork = new int[liwork];
1236            lapack_zheevr(ref jobz,ref range,ref uplo,ref n, A,ref lda, ref vl, ref vu, ref il, ref iu, ref abstol,ref m, w,z,ref ldz,isuppz, work,ref lwork,rwork,ref lrwork,iwork,ref liwork,ref info);
1237        }
1238        #endregion
1239
1240        #region ?[he/sy]gv - generalized eigenproblem
1241        public void dsygv (int itype, char jobz, char uplo, int n, double  [] A, int lda, double  [] B, int ldb, double [] w, ref int info) {
1242            // query workspace
1243            int lwork = -1;
1244            double [] work = new double[1] {0.0};
1245            lapack_dsygv (ref itype,ref jobz,ref uplo,ref n, A,ref lda, B,ref ldb, w, work, ref lwork, ref info);
1246            if (info != 0 || work[0] <= 0.0) return;
1247            // create temporary array(s)
1248            lwork = (int) work[0];
1249            work = ILMemoryPool.Pool.New<double>(lwork);
1250            lapack_dsygv (ref itype,ref jobz,ref uplo,ref n, A,ref lda, B,ref ldb, w, work, ref lwork, ref info);
1251            ILMemoryPool.Pool.Free(work);
1252        }       
1253        public void ssygv (int itype, char jobz, char uplo, int n, float   [] A, int lda, float   [] B, int ldb, float  [] w, ref int info) {
1254            // query workspace
1255            int lwork = -1;
1256            float [] work = new float[1] {0.0f};
1257            lapack_ssygv (ref itype,ref jobz,ref uplo,ref n, A,ref lda, B,ref ldb, w, work, ref lwork, ref info);
1258            if (info != 0 || work[0] <= 0.0) return;
1259            // create temporary array(s)
1260            lwork = (int) work[0];
1261            work = ILMemoryPool.Pool.New<float>(lwork);
1262            lapack_ssygv (ref itype,ref jobz,ref uplo,ref n, A,ref lda, B,ref ldb, w, work, ref lwork, ref info);
1263            ILMemoryPool.Pool.Free(work);
1264        }
1265        public void chegv (int itype, char jobz, char uplo, int n, fcomplex[] A, int lda, fcomplex[] B, int ldb, float  [] w, ref int info) {
1266            // query workspace
1267            int lwork = -1;
1268            fcomplex [] work = new fcomplex[1] {0.0f};
1269            float [] rwork = ILMemoryPool.Pool.New<float>(Math.Max(1,3*n-2));
1270            lapack_chegv(ref itype,ref  jobz,ref  uplo,ref  n, A,ref  lda, B,ref  ldb, w, work, ref lwork, rwork, ref info);
1271            if (info != 0 || work[0] <= 0.0) return;
1272            // create temporary array(s)
1273            lwork = (int) work[0];
1274            work = ILMemoryPool.Pool.New<fcomplex>(lwork);
1275            lapack_chegv (ref itype,ref  jobz,ref  uplo,ref  n, A,ref  lda, B,ref  ldb, w, work, ref lwork, rwork, ref info);
1276            ILMemoryPool.Pool.Free(rwork);
1277            ILMemoryPool.Pool.Free(work);
1278        }
1279        public void zhegv (int itype, char jobz, char uplo, int n, complex [] A, int lda, complex [] B, int ldb, double [] w, ref int info) {
1280            // query workspace
1281            int lwork = -1;
1282            complex [] work = new complex[1] {0.0f};
1283            double [] rwork = ILMemoryPool.Pool.New<double>(Math.Max(1,3*n-2));
1284            lapack_zhegv(ref itype,ref  jobz,ref  uplo,ref  n, A,ref  lda, B,ref  ldb, w, work, ref lwork, rwork, ref info);
1285            if (info != 0 || work[0] <= 0.0) return;
1286            // create temporary array(s)
1287            lwork = (int) work[0];
1288            work = ILMemoryPool.Pool.New<complex>(lwork);
1289            lapack_zhegv (ref itype,ref  jobz,ref  uplo,ref  n, A,ref  lda, B,ref  ldb, w, work, ref lwork, rwork, ref info);
1290            ILMemoryPool.Pool.Free(rwork);
1291            ILMemoryPool.Pool.Free(work);
1292        }
1293        #endregion
1294
1295        #endregion
1296    }
1297}
Note: See TracBrowser for help on using the repository browser.