amino
Lightweight Robot Utility Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lapack_impl.h
1 /* -*- mode: C; c-basic-offset: 4 -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2008-2012, Georgia Tech Research Corporation
5  * All rights reserved.
6  *
7  * Author(s): Neil T. Dantam <ntd@gatech.edu>
8  * Georgia Tech Humanoid Robotics Lab
9  * Under Direction of Prof. Mike Stilman <mstilman@cc.gatech.edu>
10  *
11  *
12  * This file is provided under the following "BSD-style" License:
13  *
14  *
15  * Redistribution and use in source and binary forms, with or
16  * without modification, are permitted provided that the following
17  * conditions are met:
18  *
19  * * Redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer.
21  *
22  * * Redistributions in binary form must reproduce the above
23  * copyright notice, this list of conditions and the following
24  * disclaimer in the documentation and/or other materials provided
25  * with the distribution.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
28  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
29  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
35  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
36  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39  * POSSIBILITY OF SUCH DAMAGE.
40  *
41  */
42 
43 #include "amino/def.h"
44 
45 /* FILE lapack_impl.h
46  * BRIEF: C prototypes to various fortran lapack routines.
47  *
48  * Since there is no official c binding to lapack as there as with
49  * BLAS, the only reasonable way to interface with lapack from C is to
50  * call the fortran methods directly.
51  *
52  * Authors:
53  * Neil T. Dantam
54  */
55 
71 AA_API void AA_LAPACK_NAME(getri)
72 ( const int *N, AA_TYPE *A, const int *LDA,
73  const int *IPIV, AA_TYPE *WORK, const int *LWORK, int *INFO );
74 
113 AA_API void AA_LAPACK_NAME(getrf)
114 ( const int *M, const int *N, AA_TYPE *A, const int *LDA,
115  int *IPIV, int *INFO );
116 
184 AA_API void AA_LAPACK_NAME(geqrf)
185 ( const int *M, const int *N, AA_TYPE *A, const int *LDA,
186  AA_TYPE *TAU, AA_TYPE *WORK, int *LWORK, int *INFO );
187 
242 AA_API void AA_LAPACK_NAME(orgqr)
243 ( const int *M, const int *N, const int *K,
244  AA_TYPE *A, const int *LDA, const AA_TYPE *TAU,
245  AA_TYPE *WORK, const int *LWORK, int *INFO );
246 
247 
248 AA_API void AA_LAPACK_NAME(posv)
249 ( const char UPLO[1], const int *N, const int *NRHS,
250  AA_TYPE *A, const int *LDA,
251  AA_TYPE *B, const int *LDB,
252  int *INFO );
253 
351 AA_API void AA_LAPACK_NAME(gesvd)
352 ( const char jobu[1], const char jobvt[1],
353  const int *m, const int *n,
354  AA_TYPE *A, const int *lda,
355  AA_TYPE *S, AA_TYPE *U,
356  const int *ldu, AA_TYPE *Vt, const int *ldvt,
357  AA_TYPE *work, const int *lwork, int *info );
358 
359 AA_API void AA_LAPACK_NAME(gesdd)
360 (const char *JOBZ, const int *M, const int *N,
361  AA_TYPE *A, const int *LDA,
362  AA_TYPE *S,
363  AA_TYPE *U, const int *LDU,
364  AA_TYPE *VT, const int * LDVT,
365  AA_TYPE *WORK, const int *LWORK,
366  int *IWORK, int *INFO);
367 
368 AA_API int AA_LAPACK_NAME(geev)
369 (const char *jobvl, const char *jobvr,
370  int *n, AA_TYPE *a, int *lda,
371  AA_TYPE *wr, AA_TYPE *wi,
372  AA_TYPE *vl, int *ldvl,
373  AA_TYPE *vr, int *ldvr,
374  AA_TYPE *work, int *lwork, int *info);
375 
376 
377 
487 AA_API void AA_LAPACK_NAME(gelsd)
488 ( const int *M, const int *N, const int *NRHS,
489  AA_TYPE *A, const int *LDA, AA_TYPE *B, const int *LDB,
490  AA_TYPE *S, const AA_TYPE *RCOND, int *RANK,
491  AA_TYPE *WORK, int *LWORK, int *IWORK, int *INFO );
492 
493 
550 AA_API void AA_LAPACK_NAME(gebal)
551 ( const char JOB[1], int *N, AA_TYPE *A, const int *LDA,
552  int *ILO, int *IHI, AA_TYPE *SCALE, int *INFO );
553 
554 
671 AA_API void AA_LAPACK_NAME(gees)
672 ( const char JOBVS[1], const char SORT[1],
673  int (*SELECT)(const AA_TYPE*,const AA_TYPE*),
674  const int *N, AA_TYPE *A, const int *LDA, int *SDIM,
675  AA_TYPE *WR, AA_TYPE *WI,
676  AA_TYPE *VS, const int *LDVS,
677  AA_TYPE *WORK, const int *LWORK, int *BWORK, int *INFO );
678 
777 AA_API void AA_LAPACK_NAME(gels)
778 ( const char TRANS[1], const int *M, const int *N, const int *NRHS,
779  AA_TYPE *A, const int *LDA, AA_TYPE *B, const int *LDB, AA_TYPE *WORK,
780  const int *LWORK, int *INFO );
781 
782 /*
783 * DPOTRF computes the Cholesky factorization of a real symmetric
784 * positive definite matrix A.
785 *
786 * The factorization has the form
787 * \f[ A = U^T * U \f] if UPLO = 'U'
788 * or
789 * \f[ A = L * L^T \f] if UPLO = 'L'
790 *
791 * where U is an upper triangular matrix and L is lower triangular.
792 *
793 * This is the block version of the algorithm, calling Level 3 BLAS.
794 *
795 *
796 * \param[in] UPLO
797 * = 'U': Upper triangle of A is stored;
798 * = 'L': Lower triangle of A is stored.
799 *
800 * \param[in] N
801 * The order of the matrix A. N >= 0.
802 *
803 * \param[inout] A
804 * On entry, the symmetric matrix A. If UPLO = 'U', the leading
805 * N-by-N upper triangular part of A contains the upper
806 * triangular part of the matrix A, and the strictly lower
807 * triangular part of A is not referenced. If UPLO = 'L', the
808 * leading N-by-N lower triangular part of A contains the lower
809 * triangular part of the matrix A, and the strictly upper
810 * triangular part of A is not referenced.
811 * On exit, if INFO = 0, the factor U or L from the Cholesky
812 * factorization A = U**T*U or A = L*L**T.
813 *
814 * \param[in] LDA
815 * The leading dimension of the array A. LDA >= max(1,N).
816 *
817 * \param[out] INFO
818 * - = 0: successful exit
819 * - < 0: if INFO = -i, the i-th argument had an illegal value
820 * - > 0: if INFO = i, the leading minor of order i is not
821 * positive definite, and the factorization could not be
822 * completed.
823 */
824 
825 AA_API void AA_LAPACK_NAME(potrf)
826 ( const char UPLO[1], const int *N,
827  AA_TYPE *A, const int *LDA,
828  int *INFO );
829 
830 AA_API void AA_LAPACK_NAME(potrs)
831 ( const char UPLO[1], const int *N, const int *nrhs,
832  AA_TYPE *A, const int *LDA,
833  AA_TYPE *B, const int *LDB,
834  int *INFO );
835 
868 AA_API void AA_LAPACK_NAME(lacpy)
869 ( const char UPLO[1], const int *M, const int *N,
870  const AA_TYPE *A, const int *LDA, AA_TYPE *B, const int *LDB );
871 
872 
876 AA_API AA_TYPE AA_LAPACK_NAME(lapy2)
877 ( const AA_TYPE *x, const AA_TYPE *y );
878 
882 AA_API AA_TYPE AA_LAPACK_NAME(lapy3)
883 ( const AA_TYPE *x, const AA_TYPE *y, const AA_TYPE *z );
884 
885 
926 AA_API void AA_LAPACK_NAME(laruv)
927 ( int ISEED[4], const int *N, AA_TYPE *X );
928 
956 AA_API void AA_LAPACK_NAME(larnv)
957 ( const int *IDIST, int ISEED[4],
958  const int *N, AA_TYPE *X );
959 
1015 AA_API void AA_LAPACK_NAME(lascl)
1016 ( const char TYPE[1], const int *KL, const int *KU,
1017  const AA_TYPE *CFROM, const AA_TYPE *CTO,
1018  const int *M, const int *N, AA_TYPE *A, const int *LDA,
1019  int *INFO );
1020 
1071 AA_API void AA_LAPACK_NAME(laset)
1072 ( const char UPLO[1], const int *M, const int *N,
1073  const AA_TYPE *ALPHA,
1074  const AA_TYPE *BETA,
1075  AA_TYPE *A, const int *LDA );
1076 
1077 
1078 
1079 
1080 
1081 #include "amino/undef.h"
1082 
1083 #if AA_TYPE == double
1084 
1114 AA_API void dlag2s_ ( const int *M, const int *N,
1115  double *A, const int *LDA,
1116  float *SA, const int *LDSA,
1117  const int *INFO );
1118 
1119 
1120 #endif // AA_TYPE == double
1121 
1122 
1123 #if AA_TYPE == float
1124 
1159 AA_API void slag2d_ ( const int *M, const int *N,
1160  float *SA, const int *LDSA,
1161  double *A, const int *LDA,
1162  const int *INFO );
1163 
1164 #endif // AA_TYPE == float
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95