added lapack-3.6.0
This commit is contained in:
88
lapack-netlib/LAPACKE/CMakeLists.txt
Normal file
88
lapack-netlib/LAPACKE/CMakeLists.txt
Normal file
@@ -0,0 +1,88 @@
|
||||
message(STATUS "LAPACKE enable")
|
||||
enable_language(C)
|
||||
|
||||
set(LAPACK_INSTALL_EXPORT_NAME lapacke-targets)
|
||||
|
||||
# Create a header file netlib.h for the routines called in my C programs
|
||||
include(FortranCInterface)
|
||||
FortranCInterface_HEADER( ${CMAKE_CURRENT_SOURCE_DIR}/include/lapacke_mangling.h
|
||||
MACRO_NAMESPACE "LAPACK_"
|
||||
SYMBOL_NAMESPACE "LAPACK_" )
|
||||
|
||||
# Old way to detect mangling
|
||||
#include(FortranMangling)
|
||||
#FORTRAN_MANGLING(CDEFS)
|
||||
#set(CDEFS ${CDEFS} CACHE STRING "Fortran Mangling" FORCE)
|
||||
#MESSAGE(STATUS "=========")
|
||||
|
||||
# --------------------------------------------------
|
||||
# Compiler Flags
|
||||
#ADD_DEFINITIONS( "-D${CDEFS}")
|
||||
|
||||
if (WIN32 AND NOT UNIX)
|
||||
ADD_DEFINITIONS(-DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE)
|
||||
MESSAGE (STATUS "Windows BUILD")
|
||||
endif (WIN32 AND NOT UNIX)
|
||||
|
||||
get_directory_property( DirDefs COMPILE_DEFINITIONS )
|
||||
|
||||
include_directories( include )
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(utils)
|
||||
|
||||
macro(append_subdir_files variable dirname)
|
||||
get_directory_property(holder DIRECTORY ${dirname} DEFINITION ${variable})
|
||||
foreach(depfile ${holder})
|
||||
list(APPEND ${variable} "${dirname}/${depfile}")
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
append_subdir_files(LAPACKE_INCLUDE "include")
|
||||
append_subdir_files(SRC_OBJ "src")
|
||||
append_subdir_files(SRCX_OBJ "src")
|
||||
append_subdir_files(MATGEN_OBJ "src")
|
||||
append_subdir_files(UTILS_OBJ "utils")
|
||||
|
||||
if (USE_XBLAS)
|
||||
add_library(lapacke ${SRC_OBJ} ${SRCX_OBJ} ${UTILS_OBJ})
|
||||
target_link_libraries(lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${XBLAS_LIBRARY})
|
||||
else (USE_XBLAS)
|
||||
if (LAPACKE_WITH_TMG)
|
||||
add_library(lapacke ${SRC_OBJ} ${MATGEN_OBJ} ${UTILS_OBJ})
|
||||
target_link_libraries(lapacke tmglib ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
|
||||
else (LAPACKE_WITH_TMG)
|
||||
add_library(lapacke ${SRC_OBJ} ${UTILS_OBJ})
|
||||
target_link_libraries(lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
|
||||
endif(LAPACKE_WITH_TMG)
|
||||
endif(USE_XBLAS)
|
||||
|
||||
lapack_install_library(lapacke)
|
||||
INSTALL( FILES ${LAPACKE_INCLUDE} DESTINATION include )
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(example)
|
||||
endif(BUILD_TESTING)
|
||||
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapacke.pc.in ${CMAKE_CURRENT_BINARY_DIR}/lapacke.pc)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/lapacke.pc
|
||||
DESTINATION ${PKG_CONFIG_DIR}
|
||||
)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-version.cmake.in
|
||||
${LAPACK_BINARY_DIR}/lapacke-config-version.cmake @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-build.cmake.in
|
||||
${LAPACK_BINARY_DIR}/lapacke-config.cmake @ONLY)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/lapacke-config-install.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/lapacke-config.cmake @ONLY)
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/lapacke-config.cmake
|
||||
${LAPACK_BINARY_DIR}/lapacke-config-version.cmake
|
||||
DESTINATION lib/cmake/lapacke-${LAPACK_VERSION}
|
||||
)
|
||||
|
||||
install(EXPORT lapacke-targets
|
||||
DESTINATION lib/cmake/lapacke-${LAPACK_VERSION})
|
||||
26
lapack-netlib/LAPACKE/LICENSE
Normal file
26
lapack-netlib/LAPACKE/LICENSE
Normal file
@@ -0,0 +1,26 @@
|
||||
Copyright (c) 2012, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
64
lapack-netlib/LAPACKE/Makefile
Normal file
64
lapack-netlib/LAPACKE/Makefile
Normal file
@@ -0,0 +1,64 @@
|
||||
##############################################################################
|
||||
# Copyright (c) 2010, Intel Corp.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Intel Corporation nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
# THE POSSIBILITY OF SUCH DAMAGE.
|
||||
##############################################################################
|
||||
# Contents: Native C interface to LAPACK
|
||||
# Author: Intel Corporation
|
||||
# September, 2010
|
||||
##############################################################################
|
||||
# Top-level makefile for LAPACKE.
|
||||
#
|
||||
# To generate lapacke library type 'make lapacke'
|
||||
# To make both just type 'make'
|
||||
#
|
||||
# To remove lapacke object files type 'make cleanlib'
|
||||
# To clean all above type 'make clean'
|
||||
# To clean everything including lapacke library type
|
||||
# 'make cleanall'
|
||||
#
|
||||
include ../make.inc
|
||||
|
||||
all: lapacke
|
||||
|
||||
lapacke:
|
||||
cd include && cp lapacke_mangling_with_flags.h lapacke_mangling.h
|
||||
cd src && $(MAKE)
|
||||
cd utils && $(MAKE)
|
||||
|
||||
lapacke_example:
|
||||
cd example && $(MAKE)
|
||||
|
||||
clean: cleanlib
|
||||
|
||||
cleanlib:
|
||||
cd src && $(MAKE) clean
|
||||
cd utils && $(MAKE) clean
|
||||
|
||||
cleanall: clean
|
||||
rm -f $(LAPACKE)
|
||||
cd example && $(MAKE) clean
|
||||
|
||||
208
lapack-netlib/LAPACKE/README
Normal file
208
lapack-netlib/LAPACKE/README
Normal file
@@ -0,0 +1,208 @@
|
||||
-------------------------------------------------------------------------------
|
||||
C Interface to LAPACK
|
||||
README
|
||||
-------------------------------------------------------------------------------
|
||||
Introduction
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This library is a part of reference implementation for the C interface to
|
||||
LAPACK project according to the specifications described at the forum for
|
||||
the Intel(R) Math Kernel Library (Intel(R) MKL):
|
||||
http://software.intel.com/en-us/forums/showthread.php?t=61234
|
||||
|
||||
This implementation provides a native C interface to LAPACK routines available
|
||||
at www.netlib.org/lapack to facilitate usage of LAPACK functionality
|
||||
for C programmers.
|
||||
This implementation introduces:
|
||||
- row-major and column-major matrix layout controlled by the first function
|
||||
parameter;
|
||||
- an implementation with working arrays (middle-level interface) as well as
|
||||
without working arrays (high-level interface);
|
||||
- input scalars passed by value;
|
||||
- error code as a return value instead of the INFO parameter.
|
||||
|
||||
This implementation supports both the ILP64 and LP64 programming models,
|
||||
and different complex type styles: structure, C99.
|
||||
|
||||
This implementation includes interfaces for the LAPACK-3.2.1 Driver and
|
||||
Computational routines only.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Product Directories
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The installation directory of this package has the following structure:
|
||||
|
||||
src - C interface source files
|
||||
utils - C interface auxiliary files
|
||||
include - header files for C interface
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Installation
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The reference code for the C interface to LAPACK is built similarly to the
|
||||
Basic Linear Algebra Subprograms (BLAS) and LAPACK. The build system produces
|
||||
a static binary lapacke.a.
|
||||
|
||||
You need to provide a make.inc file in the top directory that defines the
|
||||
compiler, compiler flags, names for binaries to be created/linked to. You may
|
||||
choose the appropriate LP64/ILP64 model, convenient complex type style,
|
||||
LAPACKE name pattern, and/or redefine system malloc/free in make.inc. Several
|
||||
examples of make.inc are provided.
|
||||
|
||||
After setting up the make.inc, you can build C interface to LAPACK by typing
|
||||
|
||||
make lapacke
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Handling Complex Types
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The interface uses complex types lapack_complex_float/lapack_complex_double.
|
||||
You have several options to define them:
|
||||
|
||||
1) C99 complex types (default):
|
||||
|
||||
#define lapack_complex_float float _Complex
|
||||
#define lapack_complex_double double _Complex
|
||||
|
||||
2) C structure option (set by enabling in the configuration file):
|
||||
-DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_STRUCTURE
|
||||
|
||||
typedef struct { float real, imag; } _lapack_complex_float;
|
||||
typedef struct { double real, imag; } _lapack_complex_double;
|
||||
#define lapack_complex_float _lapack_complex_float
|
||||
#define lapack_complex_double _lapack_complex_double
|
||||
|
||||
3) C++ complex types (set by enabling in the configuration file):
|
||||
-DHAVE_LAPACK_CONFIG_H -DLAPACK_COMPLEX_CPP
|
||||
|
||||
#define lapack_complex_float std::complex<float>
|
||||
#define lapack_complex_double std::complex<double>
|
||||
|
||||
You have to compile the interface with C++ compiler with C++ types.
|
||||
|
||||
4) Custom complex types:
|
||||
-DLAPACK_COMPLEX_CUSTOM
|
||||
|
||||
To use custom complex types, you need to:
|
||||
- Define lapack_complex_float/lapack_complex_double types on your own.
|
||||
- Optionally define lapack_make_complex_float/lapack_make_complex_double_real
|
||||
functions if you want to build the testing suite supplied. Use these
|
||||
functions for the testing system. Their purpose is to make a complex value of
|
||||
a real part re, imaginary part im. The prototypes are as follows:
|
||||
|
||||
lapack_complex_float lapack_make_complex_float( float re, float im );
|
||||
lapack_complex_double lapack_make_complex_double( double re, double im );
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Choosing ILP64 Data Model
|
||||
-------------------------------------------------------------------------------
|
||||
To choose ILP64 data model (set by enabling in the configuration file), use the
|
||||
following options:
|
||||
|
||||
-DHAVE_LAPACK_CONFIG_H -DLAPACK_ILP64
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Using Predicate Functions
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The functions
|
||||
|
||||
lapacke_?gees/lapacke_?gees_work
|
||||
lapacke_?geesx/lapacke_?geesx_work
|
||||
lapacke_?geev/lapacke_?geev_work
|
||||
lapacke_?geevx/lapacke_?geevx_work
|
||||
|
||||
require the pointer to a predicate function as an argument of a predefined type
|
||||
such as:
|
||||
|
||||
typedef lapack_logical (*LAPACK_S_SELECT2) ( const float*, const float* );
|
||||
|
||||
The purpose and format of these predicate functions are described in the LAPACK
|
||||
documentation. This interface passes the pointer to the corresponding LAPACK
|
||||
routine as it is.
|
||||
|
||||
Be cautious with return values of the logical type if you link against LAPACK
|
||||
compiled with Fortran compiler. Whereas all non-zero values are treated as TRUE
|
||||
generally, some Fortran compilers may rely on a certain TRUE value, so you will
|
||||
have to use the same TRUE value in the predicate function to be consistent with
|
||||
LAPACK implementation.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Implementation Details
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The current C interface implementation consists of wrappers to LAPACK routines.
|
||||
The row-major matrices are transposed on entry to and on exit from the LAPACK
|
||||
routine, if needed. Top-level interfaces additionally allocate/deallocate
|
||||
working space on entry to and on exit from the LAPACK routine.
|
||||
|
||||
Because of possible additional transpositions, a routine called with
|
||||
this interface may require more memory space and run slower than the
|
||||
corresponding LAPACK routine.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Disclaimer and Legal Information
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL(R)
|
||||
PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO
|
||||
ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT
|
||||
AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS,
|
||||
INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS
|
||||
OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS
|
||||
INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR
|
||||
PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR
|
||||
OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS OTHERWISE AGREED IN WRITING
|
||||
BY INTEL, THE INTEL PRODUCTS ARE NOT DESIGNED NOR INTENDED FOR ANY
|
||||
APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A
|
||||
SITUATION WHERE PERSONAL INJURY OR DEATH MAY OCCUR.
|
||||
|
||||
Intel may make changes to specifications and product descriptions at
|
||||
any time, without notice. Designers must not rely on the absence or
|
||||
characteristics of any features or instructions marked "reserved" or
|
||||
"undefined." Intel reserves these for future definition and shall have
|
||||
no responsibility whatsoever for conflicts or incompatibilities
|
||||
arising from future changes to them. The information here is subject
|
||||
to change without notice. Do not finalize a design with this
|
||||
information.
|
||||
|
||||
The products described in this document may contain design defects or
|
||||
errors known as errata which may cause the product to deviate from
|
||||
published specifications. Current characterized errata are available
|
||||
on request.
|
||||
|
||||
Contact your local Intel sales office or your distributor to obtain
|
||||
the latest specifications and before placing your product order.
|
||||
Copies of documents which have an order number and are referenced in
|
||||
this document, or other Intel literature, may be obtained by calling
|
||||
1-800-548-4725, or go to http://www.intel.com/design/literature.htm
|
||||
|
||||
Intel processor numbers are not a measure of performance. Processor
|
||||
numbers differentiate features within each processor family, not
|
||||
across different processor families. See
|
||||
http://www.intel.com/products/processor_number for details.
|
||||
|
||||
This document contains information on products in the design phase of
|
||||
development.
|
||||
|
||||
BunnyPeople, Celeron, Celeron Inside, Centrino, Centrino Atom,
|
||||
Centrino Atom Inside, Centrino Inside, Centrino logo, Core Inside,
|
||||
FlashFile, i960, InstantIP, Intel, Intel logo, Intel386, Intel486,
|
||||
IntelDX2, IntelDX4, IntelSX2, Intel Atom, Intel Atom Inside, Intel
|
||||
Core, Intel Inside, Intel Inside logo, Intel. Leap ahead., Intel. Leap
|
||||
ahead. logo, Intel NetBurst, Intel NetMerge, Intel NetStructure,
|
||||
Intel SingleDriver, Intel SpeedStep, Intel StrataFlash, Intel Viiv,
|
||||
Intel vPro, XScale, IPLink, Itanium, Itanium Inside, MCS, MMX, Oplus,
|
||||
OverDrive, Intel PDCharm, Pentium, Pentium Inside, skoool, Sound Mark,
|
||||
The Journey Inside, VTune, Xeon, and Xeon Inside are trademarks of
|
||||
Intel Corporation in the U.S. and other countries.
|
||||
|
||||
|
||||
* Other names and brands may be claimed as the property of others.
|
||||
|
||||
Copyright (C) 2011, Intel Corporation. All rights reserved.
|
||||
|
||||
|
||||
14
lapack-netlib/LAPACKE/cmake/lapacke-config-build.cmake.in
Normal file
14
lapack-netlib/LAPACKE/cmake/lapacke-config-build.cmake.in
Normal file
@@ -0,0 +1,14 @@
|
||||
# Load the LAPACK package with which we were built.
|
||||
set(LAPACK_DIR "@LAPACK_BINARY_DIR@")
|
||||
find_package(LAPACK NO_MODULE)
|
||||
|
||||
# Load lapack targets from the build tree, including lapacke targets.
|
||||
if(NOT TARGET lapacke)
|
||||
include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
|
||||
endif()
|
||||
|
||||
# Report lapacke header search locations.
|
||||
set(LAPACKE_INCLUDE_DIRS "@LAPACK_SOURCE_DIR@/lapacke/include")
|
||||
|
||||
# Report lapacke libraries.
|
||||
set(LAPACKE_LIBRARIES lapacke)
|
||||
23
lapack-netlib/LAPACKE/cmake/lapacke-config-install.cmake.in
Normal file
23
lapack-netlib/LAPACKE/cmake/lapacke-config-install.cmake.in
Normal file
@@ -0,0 +1,23 @@
|
||||
# Compute locations from <prefix>/lib/cmake/lapacke-<v>/<self>.cmake
|
||||
get_filename_component(_LAPACKE_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_SELF_DIR}" PATH)
|
||||
get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH)
|
||||
get_filename_component(_LAPACKE_PREFIX "${_LAPACKE_PREFIX}" PATH)
|
||||
|
||||
# Load the LAPACK package with which we were built.
|
||||
set(LAPACK_DIR "${_LAPACKE_PREFIX}/lib/cmake/lapack-@LAPACK_VERSION@")
|
||||
find_package(LAPACK NO_MODULE)
|
||||
|
||||
# Load lapacke targets from the install tree.
|
||||
if(NOT TARGET lapacke)
|
||||
include(${_LAPACKE_SELF_DIR}/lapacke-targets.cmake)
|
||||
endif()
|
||||
|
||||
# Report lapacke header search locations.
|
||||
set(LAPACKE_INCLUDE_DIRS ${_LAPACKE_PREFIX}/include)
|
||||
|
||||
# Report lapacke libraries.
|
||||
set(LAPACKE_LIBRARIES lapacke)
|
||||
|
||||
unset(_LAPACKE_PREFIX)
|
||||
unset(_LAPACKE_SELF_DIR)
|
||||
@@ -0,0 +1,8 @@
|
||||
set(PACKAGE_VERSION "@LAPACK_VERSION@")
|
||||
if(NOT ${PACKAGE_FIND_VERSION} VERSION_GREATER ${PACKAGE_VERSION})
|
||||
set(PACKAGE_VERSION_COMPATIBLE 1)
|
||||
if(${PACKAGE_FIND_VERSION} VERSION_EQUAL ${PACKAGE_VERSION})
|
||||
set(PACKAGE_VERSION_EXACT 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
14
lapack-netlib/LAPACKE/example/CMakeLists.txt
Normal file
14
lapack-netlib/LAPACKE/example/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
add_executable(xexample_DGESV_rowmajor example_DGESV_rowmajor.c lapacke_example_aux.c lapacke_example_aux.h)
|
||||
add_executable(xexample_DGESV_colmajor example_DGESV_colmajor.c lapacke_example_aux.c lapacke_example_aux.h)
|
||||
add_executable(xexample_DGELS_rowmajor example_DGELS_rowmajor.c lapacke_example_aux.c lapacke_example_aux.h)
|
||||
add_executable(xexample_DGELS_colmajor example_DGELS_colmajor.c lapacke_example_aux.c lapacke_example_aux.h)
|
||||
|
||||
target_link_libraries(xexample_DGESV_rowmajor lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
|
||||
target_link_libraries(xexample_DGESV_colmajor lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
|
||||
target_link_libraries(xexample_DGELS_rowmajor lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
|
||||
target_link_libraries(xexample_DGELS_colmajor lapacke ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
|
||||
|
||||
add_test(example_DGESV_rowmajor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGESV_rowmajor)
|
||||
add_test(example_DGESV_colmajor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGESV_colmajor)
|
||||
add_test(example_DGELS_rowmajor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGELS_rowmajor)
|
||||
add_test(example_DGELS_colmajor ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/xexample_DGELS_colmajor)
|
||||
35
lapack-netlib/LAPACKE/example/Makefile
Normal file
35
lapack-netlib/LAPACKE/example/Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
include ../../make.inc
|
||||
|
||||
all: xexample_DGESV_rowmajor \
|
||||
xexample_DGESV_colmajor \
|
||||
xexample_DGELS_rowmajor \
|
||||
xexample_DGELS_colmajor
|
||||
|
||||
LIBRAIRIES= ../../$(LAPACKELIB) ../../$(LAPACKLIB) $(BLASLIB)
|
||||
|
||||
# Double Precision Examples
|
||||
xexample_DGESV_rowmajor: example_DGESV_rowmajor.o lapacke_example_aux.o $(LIBRAIRIES)
|
||||
$(LOADER) $(LOADOPTS) example_DGESV_rowmajor.o lapacke_example_aux.o \
|
||||
$(LIBRAIRIES) -o $@
|
||||
./$@
|
||||
|
||||
xexample_DGESV_colmajor: example_DGESV_colmajor.o lapacke_example_aux.o $(LIBRAIRIES)
|
||||
$(LOADER) $(LOADOPTS) example_DGESV_colmajor.o lapacke_example_aux.o \
|
||||
$(LIBRAIRIES) -o $@
|
||||
./$@
|
||||
|
||||
xexample_DGELS_rowmajor: example_DGELS_rowmajor.o lapacke_example_aux.o $(LIBRAIRIES)
|
||||
$(LOADER) $(LOADOPTS) example_DGELS_rowmajor.o lapacke_example_aux.o \
|
||||
$(LIBRAIRIES) -o $@
|
||||
./$@
|
||||
|
||||
xexample_DGELS_colmajor: example_DGELS_colmajor.o lapacke_example_aux.o $(LIBRAIRIES)
|
||||
$(LOADER) $(LOADOPTS) example_DGELS_colmajor.o lapacke_example_aux.o \
|
||||
$(LIBRAIRIES) -o $@
|
||||
./$@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) -I. -I ../include -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f *.o x*
|
||||
95
lapack-netlib/LAPACKE/example/example_DGELS_colmajor.c
Normal file
95
lapack-netlib/LAPACKE/example/example_DGELS_colmajor.c
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
LAPACKE Example : Calling DGELS using col-major layout
|
||||
=====================================================
|
||||
|
||||
The program computes the solution to the system of linear
|
||||
equations with a square matrix A and multiple
|
||||
right-hand sides B, where A is the coefficient matrix
|
||||
and b is the right-hand side matrix:
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
In this example, we wish solve the least squares problem min_x || B - Ax ||
|
||||
for two right-hand sides using the LAPACK routine DGELS. For input we will
|
||||
use the 5-by-3 matrix
|
||||
|
||||
( 1 1 1 )
|
||||
( 2 3 4 )
|
||||
A = ( 3 5 2 )
|
||||
( 4 2 5 )
|
||||
( 5 4 3 )
|
||||
and the 5-by-2 matrix
|
||||
|
||||
( -10 -3 )
|
||||
( 12 14 )
|
||||
B = ( 14 12 )
|
||||
( 16 16 )
|
||||
( 18 16 )
|
||||
We will first store the input matrix as a static C two-dimensional array,
|
||||
which is stored in col-major layout, and let LAPACKE handle the work space
|
||||
array allocation. The LAPACK base name for this function is gels, and we
|
||||
will use double precision (d), so the LAPACKE function name is LAPACKE_dgels.
|
||||
|
||||
lda=5 and ldb=5. The output for each right hand side is stored in b as
|
||||
consecutive vectors of length 3. The correct answer for this problem is
|
||||
the 3-by-2 matrix
|
||||
|
||||
( 2 1 )
|
||||
( 1 1 )
|
||||
( 1 2 )
|
||||
|
||||
A complete C program for this example is given below. Note that when the arrays
|
||||
are passed to the LAPACK routine, they must be dereferenced, since LAPACK is
|
||||
expecting arrays of type double *, not double **.
|
||||
|
||||
|
||||
LAPACKE Interface
|
||||
=================
|
||||
|
||||
LAPACKE_dgels (col-major, high-level) Example Program Results
|
||||
|
||||
-- LAPACKE Example routine (version 3.6.0) --
|
||||
-- LAPACK is a software package provided by Univ. of Tennessee, --
|
||||
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
|
||||
November 2015
|
||||
|
||||
*/
|
||||
/* Calling DGELS using col-major layout */
|
||||
|
||||
/* Includes */
|
||||
#include <stdio.h>
|
||||
#include <lapacke.h>
|
||||
#include "lapacke_example_aux.h"
|
||||
|
||||
/* Main program */
|
||||
int main (int argc, const char * argv[])
|
||||
{
|
||||
/* Locals */
|
||||
double A[5][3] = {{1,2,3},{4,5,1},{3,5,2},{4,1,4},{2,5,3}};
|
||||
double b[5][2] = {{-10,12},{14,16},{18,-3},{14,12},{16,16}};
|
||||
lapack_int info,m,n,lda,ldb,nrhs;
|
||||
|
||||
/* Initialization */
|
||||
m = 5;
|
||||
n = 3;
|
||||
nrhs = 2;
|
||||
lda = 5;
|
||||
ldb = 5;
|
||||
|
||||
/* Print Entry Matrix */
|
||||
print_matrix_colmajor( "Entry Matrix A", m, n, *A, lda );
|
||||
/* Print Right Rand Side */
|
||||
print_matrix_colmajor( "Right Hand Side b", n, nrhs, *b, ldb );
|
||||
printf( "\n" );
|
||||
|
||||
/* Executable statements */
|
||||
printf( "LAPACKE_dgels (col-major, high-level) Example Program Results\n" );
|
||||
/* Solve least squares problem*/
|
||||
info = LAPACKE_dgels(LAPACK_COL_MAJOR,'N',m,n,nrhs,*A,lda,*b,ldb);
|
||||
|
||||
/* Print Solution */
|
||||
print_matrix_colmajor( "Solution", n, nrhs, *b, ldb );
|
||||
printf( "\n" );
|
||||
exit( info );
|
||||
} /* End of LAPACKE_dgels Example */
|
||||
96
lapack-netlib/LAPACKE/example/example_DGELS_rowmajor.c
Normal file
96
lapack-netlib/LAPACKE/example/example_DGELS_rowmajor.c
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
LAPACKE Example : Calling DGELS using row-major layout
|
||||
=====================================================
|
||||
|
||||
The program computes the solution to the system of linear
|
||||
equations with a square matrix A and multiple
|
||||
right-hand sides B, where A is the coefficient matrix
|
||||
and b is the right-hand side matrix:
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
In this example, we wish solve the least squares problem min_x || B - Ax ||
|
||||
for two right-hand sides using the LAPACK routine DGELS. For input we will
|
||||
use the 5-by-3 matrix
|
||||
|
||||
( 1 1 1 )
|
||||
( 2 3 4 )
|
||||
A = ( 3 5 2 )
|
||||
( 4 2 5 )
|
||||
( 5 4 3 )
|
||||
and the 5-by-2 matrix
|
||||
|
||||
( -10 -3 )
|
||||
( 12 14 )
|
||||
B = ( 14 12 )
|
||||
( 16 16 )
|
||||
( 18 16 )
|
||||
We will first store the input matrix as a static C two-dimensional array,
|
||||
which is stored in row-major layout, and let LAPACKE handle the work space
|
||||
array allocation. The LAPACK base name for this function is gels, and we
|
||||
will use double precision (d), so the LAPACKE function name is LAPACKE_dgels.
|
||||
|
||||
thus lda=3 and ldb=2. The output for each right hand side is stored in b as
|
||||
consecutive vectors of length 3. The correct answer for this problem is
|
||||
the 3-by-2 matrix
|
||||
|
||||
( 2 1 )
|
||||
( 1 1 )
|
||||
( 1 2 )
|
||||
|
||||
A complete C program for this example is given below. Note that when the arrays
|
||||
are passed to the LAPACK routine, they must be dereferenced, since LAPACK is
|
||||
expecting arrays of type double *, not double **.
|
||||
|
||||
|
||||
LAPACKE Interface
|
||||
=================
|
||||
|
||||
LAPACKE_dgels (row-major, high-level) Example Program Results
|
||||
|
||||
-- LAPACKE Example routine (version 3.6.0) --
|
||||
-- LAPACK is a software package provided by Univ. of Tennessee, --
|
||||
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
|
||||
November 2015
|
||||
|
||||
*/
|
||||
/* Calling DGELS using row-major layout */
|
||||
|
||||
/* Includes */
|
||||
#include <stdio.h>
|
||||
#include <lapacke.h>
|
||||
#include "lapacke_example_aux.h"
|
||||
|
||||
/* Main program */
|
||||
int main (int argc, const char * argv[])
|
||||
{
|
||||
/* Locals */
|
||||
double A[5][3] = {1,1,1,2,3,4,3,5,2,4,2,5,5,4,3};
|
||||
double b[5][2] = {-10,-3,12,14,14,12,16,16,18,16};
|
||||
lapack_int info,m,n,lda,ldb,nrhs;
|
||||
int i,j;
|
||||
|
||||
/* Initialization */
|
||||
m = 5;
|
||||
n = 3;
|
||||
nrhs = 2;
|
||||
lda = 3;
|
||||
ldb = 2;
|
||||
|
||||
/* Print Entry Matrix */
|
||||
print_matrix_rowmajor( "Entry Matrix A", m, n, *A, lda );
|
||||
/* Print Right Rand Side */
|
||||
print_matrix_rowmajor( "Right Hand Side b", n, nrhs, *b, ldb );
|
||||
printf( "\n" );
|
||||
|
||||
/* Executable statements */
|
||||
printf( "LAPACKE_dgels (row-major, high-level) Example Program Results\n" );
|
||||
/* Solve least squares problem*/
|
||||
info = LAPACKE_dgels(LAPACK_ROW_MAJOR,'N',m,n,nrhs,*A,lda,*b,ldb);
|
||||
|
||||
/* Print Solution */
|
||||
print_matrix_rowmajor( "Solution", n, nrhs, *b, ldb );
|
||||
printf( "\n" );
|
||||
exit( 0 );
|
||||
} /* End of LAPACKE_dgels Example */
|
||||
110
lapack-netlib/LAPACKE/example/example_DGESV_colmajor.c
Normal file
110
lapack-netlib/LAPACKE/example/example_DGESV_colmajor.c
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
LAPACKE_dgesv Example
|
||||
=====================
|
||||
|
||||
The program computes the solution to the system of linear
|
||||
equations with a square matrix A and multiple
|
||||
right-hand sides B, where A is the coefficient matrix
|
||||
and b is the right-hand side matrix:
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
The routine solves for X the system of linear equations A*X = B,
|
||||
where A is an n-by-n matrix, the columns of matrix B are individual
|
||||
right-hand sides, and the columns of X are the corresponding
|
||||
solutions.
|
||||
|
||||
The LU decomposition with partial pivoting and row interchanges is
|
||||
used to factor A as A = P*L*U, where P is a permutation matrix, L
|
||||
is unit lower triangular, and U is upper triangular. The factored
|
||||
form of A is then used to solve the system of equations A*X = B.
|
||||
|
||||
LAPACKE Interface
|
||||
=================
|
||||
|
||||
LAPACKE_dgesv (col-major, high-level) Example Program Results
|
||||
|
||||
-- LAPACKE Example routine (version 3.6.0) --
|
||||
-- LAPACK is a software package provided by Univ. of Tennessee, --
|
||||
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
|
||||
November 2015
|
||||
|
||||
*/
|
||||
/* Includes */
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "lapacke.h"
|
||||
#include "lapacke_example_aux.h"
|
||||
|
||||
/* Main program */
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
/* Locals */
|
||||
lapack_int n, nrhs, lda, ldb, info;
|
||||
int i, j;
|
||||
/* Local arrays */
|
||||
double *A, *b;
|
||||
lapack_int *ipiv;
|
||||
|
||||
/* Default Value */
|
||||
n = 5; nrhs = 1;
|
||||
|
||||
/* Arguments */
|
||||
for( i = 1; i < argc; i++ ) {
|
||||
if( strcmp( argv[i], "-n" ) == 0 ) {
|
||||
n = atoi(argv[i+1]);
|
||||
i++;
|
||||
}
|
||||
if( strcmp( argv[i], "-nrhs" ) == 0 ) {
|
||||
nrhs = atoi(argv[i+1]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialization */
|
||||
lda=n, ldb=n;
|
||||
A = (double *)malloc(n*n*sizeof(double)) ;
|
||||
if (A==NULL){ printf("error of memory allocation\n"); exit(0); }
|
||||
b = (double *)malloc(n*nrhs*sizeof(double)) ;
|
||||
if (b==NULL){ printf("error of memory allocation\n"); exit(0); }
|
||||
ipiv = (lapack_int *)malloc(n*sizeof(lapack_int)) ;
|
||||
if (ipiv==NULL){ printf("error of memory allocation\n"); exit(0); }
|
||||
|
||||
for( i = 0; i < n; i++ ) {
|
||||
for( j = 0; j < n; j++ ) A[i+j*lda] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
|
||||
}
|
||||
|
||||
for(i=0;i<n*nrhs;i++)
|
||||
b[i] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
|
||||
|
||||
/* Print Entry Matrix */
|
||||
print_matrix_colmajor( "Entry Matrix A", n, n, A, lda );
|
||||
/* Print Right Rand Side */
|
||||
print_matrix_colmajor( "Right Rand Side b", n, nrhs, b, ldb );
|
||||
printf( "\n" );
|
||||
|
||||
/* Executable statements */
|
||||
printf( "LAPACKE_dgesv (row-major, high-level) Example Program Results\n" );
|
||||
/* Solve the equations A*X = B */
|
||||
info = LAPACKE_dgesv( LAPACK_COL_MAJOR, n, nrhs, A, lda, ipiv,
|
||||
b, ldb );
|
||||
|
||||
/* Check for the exact singularity */
|
||||
if( info > 0 ) {
|
||||
printf( "The diagonal element of the triangular factor of A,\n" );
|
||||
printf( "U(%i,%i) is zero, so that A is singular;\n", info, info );
|
||||
printf( "the solution could not be computed.\n" );
|
||||
exit( 1 );
|
||||
}
|
||||
if (info <0) exit( 1 );
|
||||
/* Print solution */
|
||||
print_matrix_colmajor( "Solution", n, nrhs, b, ldb );
|
||||
/* Print details of LU factorization */
|
||||
print_matrix_colmajor( "Details of LU factorization", n, n, A, lda );
|
||||
/* Print pivot indices */
|
||||
print_vector( "Pivot indices", n, ipiv );
|
||||
exit( 0 );
|
||||
} /* End of LAPACKE_dgesv Example */
|
||||
|
||||
107
lapack-netlib/LAPACKE/example/example_DGESV_rowmajor.c
Normal file
107
lapack-netlib/LAPACKE/example/example_DGESV_rowmajor.c
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
LAPACKE_dgesv Example
|
||||
=====================
|
||||
|
||||
The program computes the solution to the system of linear
|
||||
equations with a square matrix A and multiple
|
||||
right-hand sides B, where A is the coefficient matrix
|
||||
and b is the right-hand side matrix:
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
The routine solves for X the system of linear equations A*X = B,
|
||||
where A is an n-by-n matrix, the columns of matrix B are individual
|
||||
right-hand sides, and the columns of X are the corresponding
|
||||
solutions.
|
||||
|
||||
The LU decomposition with partial pivoting and row interchanges is
|
||||
used to factor A as A = P*L*U, where P is a permutation matrix, L
|
||||
is unit lower triangular, and U is upper triangular. The factored
|
||||
form of A is then used to solve the system of equations A*X = B.
|
||||
|
||||
LAPACKE Interface
|
||||
=================
|
||||
|
||||
LAPACKE_dgesv (row-major, high-level) Example Program Results
|
||||
|
||||
-- LAPACKE Example routine (version 3.6.0) --
|
||||
-- LAPACK is a software package provided by Univ. of Tennessee, --
|
||||
-- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
|
||||
November 2015
|
||||
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <lapacke.h>
|
||||
#include "lapacke_example_aux.h"
|
||||
|
||||
/* Main program */
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
/* Locals */
|
||||
lapack_int n, nrhs, lda, ldb, info;
|
||||
int i, j;
|
||||
/* Local arrays */
|
||||
double *A, *b;
|
||||
lapack_int *ipiv;
|
||||
|
||||
/* Default Value */
|
||||
n = 5; nrhs = 1;
|
||||
|
||||
/* Arguments */
|
||||
for( i = 1; i < argc; i++ ) {
|
||||
if( strcmp( argv[i], "-n" ) == 0 ) {
|
||||
n = atoi(argv[i+1]);
|
||||
i++;
|
||||
}
|
||||
if( strcmp( argv[i], "-nrhs" ) == 0 ) {
|
||||
nrhs = atoi(argv[i+1]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialization */
|
||||
lda=n, ldb=nrhs;
|
||||
A = (double *)malloc(n*n*sizeof(double)) ;
|
||||
if (A==NULL){ printf("error of memory allocation\n"); exit(0); }
|
||||
b = (double *)malloc(n*nrhs*sizeof(double)) ;
|
||||
if (b==NULL){ printf("error of memory allocation\n"); exit(0); }
|
||||
ipiv = (lapack_int *)malloc(n*sizeof(lapack_int)) ;
|
||||
if (ipiv==NULL){ printf("error of memory allocation\n"); exit(0); }
|
||||
|
||||
for( i = 0; i < n; i++ ) {
|
||||
for( j = 0; j < n; j++ ) A[i*lda+j] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
|
||||
}
|
||||
|
||||
for(i=0;i<n*nrhs;i++)
|
||||
b[i] = ((double) rand()) / ((double) RAND_MAX) - 0.5;
|
||||
|
||||
/* Print Entry Matrix */
|
||||
print_matrix_rowmajor( "Entry Matrix A", n, n, A, lda );
|
||||
/* Print Right Rand Side */
|
||||
print_matrix_rowmajor( "Right Rand Side b", n, nrhs, b, ldb );
|
||||
printf( "\n" );
|
||||
/* Executable statements */
|
||||
printf( "LAPACKE_dgesv (row-major, high-level) Example Program Results\n" );
|
||||
/* Solve the equations A*X = B */
|
||||
info = LAPACKE_dgesv( LAPACK_ROW_MAJOR, n, nrhs, A, lda, ipiv,
|
||||
b, ldb );
|
||||
/* Check for the exact singularity */
|
||||
if( info > 0 ) {
|
||||
printf( "The diagonal element of the triangular factor of A,\n" );
|
||||
printf( "U(%i,%i) is zero, so that A is singular;\n", info, info );
|
||||
printf( "the solution could not be computed.\n" );
|
||||
exit( 1 );
|
||||
}
|
||||
if (info <0) exit( 1 );
|
||||
/* Print solution */
|
||||
print_matrix_rowmajor( "Solution", n, nrhs, b, ldb );
|
||||
/* Print details of LU factorization */
|
||||
print_matrix_rowmajor( "Details of LU factorization", n, n, A, lda );
|
||||
/* Print pivot indices */
|
||||
print_vector( "Pivot indices", n, ipiv );
|
||||
exit( 0 );
|
||||
} /* End of LAPACKE_dgesv Example */
|
||||
|
||||
97
lapack-netlib/LAPACKE/example/example_user.c
Normal file
97
lapack-netlib/LAPACKE/example/example_user.c
Normal file
@@ -0,0 +1,97 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "lapacke.h"
|
||||
|
||||
/* Auxiliary routines prototypes */
|
||||
extern void print_matrix( char* desc, lapack_int m, lapack_int n, double* a, lapack_int lda );
|
||||
extern void print_int_vector( char* desc, lapack_int n, lapack_int* a );
|
||||
|
||||
/* Parameters */
|
||||
#define N 5
|
||||
#define NRHS 3
|
||||
#define LDA N
|
||||
#define LDB NRHS
|
||||
|
||||
/* Main program */
|
||||
int main() {
|
||||
/* Locals */
|
||||
lapack_int n = N, nrhs = NRHS, lda = LDA, ldb = LDB, info;
|
||||
/* Local arrays */
|
||||
lapack_int ipiv[N];
|
||||
double a[LDA*N] = {
|
||||
6.80, -6.05, -0.45, 8.32, -9.67,
|
||||
-2.11, -3.30, 2.58, 2.71, -5.14,
|
||||
5.66, 5.36, -2.70, 4.35, -7.26,
|
||||
5.97, -4.44, 0.27, -7.17, 6.08,
|
||||
8.23, 1.08, 9.04, 2.14, -6.87
|
||||
};
|
||||
double b[LDB*N] = {
|
||||
4.02, -1.56, 9.81,
|
||||
6.19, 4.00, -4.09,
|
||||
-8.22, -8.67, -4.57,
|
||||
-7.57, 1.75, -8.61,
|
||||
-3.03, 2.86, 8.99
|
||||
};
|
||||
|
||||
double aNorm;
|
||||
double rcond;
|
||||
char ONE_NORM = '1';
|
||||
lapack_int NROWS = n;
|
||||
lapack_int NCOLS = n;
|
||||
lapack_int LEADING_DIMENSION_A = n;
|
||||
|
||||
/* Print Entry Matrix */
|
||||
print_matrix( "Entry Matrix A", n, n, a, lda );
|
||||
/* Print Right Rand Side */
|
||||
print_matrix( "Right Rand Side", n, nrhs, b, ldb );
|
||||
printf( "\n" );
|
||||
/* Executable statements */
|
||||
printf( "LAPACKE_dgecon Example Program Results\n" );
|
||||
aNorm = LAPACKE_dlange(LAPACK_ROW_MAJOR, ONE_NORM, NROWS, NCOLS, a, LEADING_DIMENSION_A);
|
||||
info = LAPACKE_dgetrf(LAPACK_ROW_MAJOR, NROWS, NCOLS, a, LEADING_DIMENSION_A, ipiv);
|
||||
info = LAPACKE_dgecon(LAPACK_ROW_MAJOR, ONE_NORM, n, a, LEADING_DIMENSION_A, aNorm, &rcond); // aNorm should be 35.019999999999996
|
||||
double work[4*N];
|
||||
int iwork[N];
|
||||
//info = LAPACKE_dgecon_work(LAPACK_ROW_MAJOR, ONE_NORM, n, a, LEADING_DIMENSION_A, aNorm, &rcond, work, iwork); // aNorm should be 35.019999999999996
|
||||
//dgecon_( &ONE_NORM, &n, a, &LEADING_DIMENSION_A, &aNorm, &rcond, work, iwork, &info );
|
||||
/* Check for the exact singularity */
|
||||
if (info == 0)
|
||||
{
|
||||
printf("LAPACKE_dgecon completed SUCCESSFULLY...\n");
|
||||
}
|
||||
else if ( info < 0 )
|
||||
{
|
||||
printf( "Element %d of A had an illegal value\n", -info );
|
||||
exit( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
printf( "Unrecognized value of INFO = %d\n", info );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
/* Print solution */
|
||||
printf("LAPACKE_dlange / One-norm of A = %lf\n", aNorm);
|
||||
printf("LAPACKE_dgecon / RCOND of A = %f\n", rcond);
|
||||
exit( 0 );
|
||||
} /* End of LAPACKE_dgesv Example */
|
||||
|
||||
/* Auxiliary routine: printing a matrix */
|
||||
void print_matrix( char* desc, lapack_int m, lapack_int n, double* a, lapack_int lda ) {
|
||||
lapack_int i, j;
|
||||
printf( "\n %s\n", desc );
|
||||
for( i = 0; i < m; i++ ) {
|
||||
for( j = 0; j < n; j++ ) printf( " %6.2f", a[i*lda+j] );
|
||||
printf( "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
/* Auxiliary routine: printing a vector of integers */
|
||||
void print_int_vector( char* desc, lapack_int n, lapack_int* a ) {
|
||||
lapack_int j;
|
||||
printf( "\n %s\n", desc );
|
||||
for( j = 0; j < n; j++ ) printf( " %6i", a[j] );
|
||||
printf( "\n" );
|
||||
}
|
||||
|
||||
|
||||
33
lapack-netlib/LAPACKE/example/lapacke_example_aux.c
Normal file
33
lapack-netlib/LAPACKE/example/lapacke_example_aux.c
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <lapacke.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* Auxiliary routine: printing a matrix */
|
||||
void print_matrix_rowmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm ) {
|
||||
lapack_int i, j;
|
||||
printf( "\n %s\n", desc );
|
||||
|
||||
for( i = 0; i < m; i++ ) {
|
||||
for( j = 0; j < n; j++ ) printf( " %6.2f", mat[i*ldm+j] );
|
||||
printf( "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Auxiliary routine: printing a matrix */
|
||||
void print_matrix_colmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm ) {
|
||||
lapack_int i, j;
|
||||
printf( "\n %s\n", desc );
|
||||
|
||||
for( i = 0; i < m; i++ ) {
|
||||
for( j = 0; j < n; j++ ) printf( " %6.2f", mat[i+j*ldm] );
|
||||
printf( "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
/* Auxiliary routine: printing a vector of integers */
|
||||
void print_vector( char* desc, lapack_int n, lapack_int* vec ) {
|
||||
lapack_int j;
|
||||
printf( "\n %s\n", desc );
|
||||
for( j = 0; j < n; j++ ) printf( " %6i", vec[j] );
|
||||
printf( "\n" );
|
||||
}
|
||||
9
lapack-netlib/LAPACKE/example/lapacke_example_aux.h
Normal file
9
lapack-netlib/LAPACKE/example/lapacke_example_aux.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef _LAPACKE_EXAMPLE_AUX_
|
||||
#define _LAPACKE_EXAMPLE_AUX_
|
||||
|
||||
|
||||
void print_matrix_rowmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm );
|
||||
void print_matrix_colmajor( char* desc, lapack_int m, lapack_int n, double* mat, lapack_int ldm );
|
||||
void print_vector( char* desc, lapack_int n, lapack_int* vec );
|
||||
|
||||
#endif /* _LAPACKE_EXAMPLE_AUX_*/
|
||||
3
lapack-netlib/LAPACKE/include/CMakeLists.txt
Normal file
3
lapack-netlib/LAPACKE/include/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
SET (LAPACKE_INCLUDE lapacke.h lapacke_config.h lapacke_utils.h lapacke_mangling.h)
|
||||
|
||||
file(COPY ${LAPACKE_INCLUDE} DESTINATION ${LAPACK_BINARY_DIR}/include)
|
||||
17553
lapack-netlib/LAPACKE/include/lapacke.h
Normal file
17553
lapack-netlib/LAPACKE/include/lapacke.h
Normal file
File diff suppressed because it is too large
Load Diff
119
lapack-netlib/LAPACKE/include/lapacke_config.h
Normal file
119
lapack-netlib/LAPACKE/include/lapacke_config.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2010, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
******************************************************************************
|
||||
* Contents: Native C interface to LAPACK
|
||||
* Author: Intel Corporation
|
||||
* Generated May, 2011
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _LAPACKE_CONFIG_H_
|
||||
#define _LAPACKE_CONFIG_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(LAPACK_COMPLEX_CPP)
|
||||
#include <complex>
|
||||
#endif
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef lapack_int
|
||||
#if defined(LAPACK_ILP64)
|
||||
#define lapack_int long
|
||||
#else
|
||||
#define lapack_int int
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef lapack_logical
|
||||
#define lapack_logical lapack_int
|
||||
#endif
|
||||
|
||||
#ifndef LAPACK_COMPLEX_CUSTOM
|
||||
|
||||
#if defined(LAPACK_COMPLEX_STRUCTURE)
|
||||
|
||||
typedef struct { float real, imag; } _lapack_complex_float;
|
||||
typedef struct { double real, imag; } _lapack_complex_double;
|
||||
#define lapack_complex_float _lapack_complex_float
|
||||
#define lapack_complex_double _lapack_complex_double
|
||||
#define lapack_complex_float_real(z) ((z).real)
|
||||
#define lapack_complex_float_imag(z) ((z).imag)
|
||||
#define lapack_complex_double_real(z) ((z).real)
|
||||
#define lapack_complex_double_imag(z) ((z).imag)
|
||||
|
||||
#elif defined(LAPACK_COMPLEX_C99)
|
||||
|
||||
#include <complex.h>
|
||||
#define lapack_complex_float float _Complex
|
||||
#define lapack_complex_double double _Complex
|
||||
#define lapack_complex_float_real(z) (creal(z))
|
||||
#define lapack_complex_float_imag(z) (cimag(z))
|
||||
#define lapack_complex_double_real(z) (creal(z))
|
||||
#define lapack_complex_double_imag(z) (cimag(z))
|
||||
|
||||
#elif defined(LAPACK_COMPLEX_CPP)
|
||||
|
||||
#define lapack_complex_float std::complex<float>
|
||||
#define lapack_complex_double std::complex<double>
|
||||
#define lapack_complex_float_real(z) ((z).real())
|
||||
#define lapack_complex_float_imag(z) ((z).imag())
|
||||
#define lapack_complex_double_real(z) ((z).real())
|
||||
#define lapack_complex_double_imag(z) ((z).imag())
|
||||
|
||||
#else
|
||||
|
||||
#include <complex.h>
|
||||
#define lapack_complex_float float _Complex
|
||||
#define lapack_complex_double double _Complex
|
||||
#define lapack_complex_float_real(z) (creal(z))
|
||||
#define lapack_complex_float_imag(z) (cimag(z))
|
||||
#define lapack_complex_double_real(z) (creal(z))
|
||||
#define lapack_complex_double_imag(z) (cimag(z))
|
||||
|
||||
#endif
|
||||
|
||||
lapack_complex_float lapack_make_complex_float( float re, float im );
|
||||
lapack_complex_double lapack_make_complex_double( double re, double im );
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef LAPACK_malloc
|
||||
#define LAPACK_malloc( size ) malloc( size )
|
||||
#endif
|
||||
|
||||
#ifndef LAPACK_free
|
||||
#define LAPACK_free( p ) free( p )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _LAPACKE_CONFIG_H_ */
|
||||
17
lapack-netlib/LAPACKE/include/lapacke_mangling_with_flags.h
Normal file
17
lapack-netlib/LAPACKE/include/lapacke_mangling_with_flags.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef LAPACK_HEADER_INCLUDED
|
||||
#define LAPACK_HEADER_INCLUDED
|
||||
|
||||
#ifndef LAPACK_GLOBAL
|
||||
#if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_)
|
||||
#define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
|
||||
#elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER)
|
||||
#define LAPACK_GLOBAL(lcname,UCNAME) UCNAME
|
||||
#elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE)
|
||||
#define LAPACK_GLOBAL(lcname,UCNAME) lcname
|
||||
#else
|
||||
#define LAPACK_GLOBAL(lcname,UCNAME) lcname##_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
579
lapack-netlib/LAPACKE/include/lapacke_utils.h
Normal file
579
lapack-netlib/LAPACKE/include/lapacke_utils.h
Normal file
@@ -0,0 +1,579 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
******************************************************************************
|
||||
* Contents: Native C interface to LAPACK utility functions
|
||||
* Author: Intel Corporation
|
||||
* Created in January, 2010
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _LAPACKE_UTILS_H_
|
||||
#define _LAPACKE_UTILS_H_
|
||||
|
||||
#include "lapacke.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef ABS
|
||||
#define ABS(x) (((x) < 0) ? -(x) : (x))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
#define MAX(x,y) (((x) > (y)) ? (x) : (y))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
|
||||
#endif
|
||||
#ifndef MAX3
|
||||
#define MAX3(x,y,z) (((x) > MAX(y,z)) ? (x) : MAX(y,z))
|
||||
#endif
|
||||
#ifndef MIN3
|
||||
#define MIN3(x,y,z) (((x) < MIN(y,z)) ? (x) : MIN(y,z))
|
||||
#endif
|
||||
|
||||
#define IS_S_NONZERO(x) ( (x) < 0 || (x) > 0 )
|
||||
#define IS_D_NONZERO(x) ( (x) < 0 || (x) > 0 )
|
||||
#define IS_C_NONZERO(x) ( IS_S_NONZERO(*((float*)&x)) || \
|
||||
IS_S_NONZERO(*(((float*)&x)+1)) )
|
||||
#define IS_Z_NONZERO(x) ( IS_D_NONZERO(*((double*)&x)) || \
|
||||
IS_D_NONZERO(*(((double*)&x)+1)) )
|
||||
|
||||
/* Error handler */
|
||||
void LAPACKE_xerbla( const char *name, lapack_int info );
|
||||
|
||||
/* Compare two chars (case-insensitive) */
|
||||
lapack_logical LAPACKE_lsame( char ca, char cb );
|
||||
|
||||
/* Functions to convert column-major to row-major 2d arrays and vice versa. */
|
||||
void LAPACKE_cgb_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
void LAPACKE_cge_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const lapack_complex_float* in, lapack_int ldin,
|
||||
lapack_complex_float* out, lapack_int ldout );
|
||||
void LAPACKE_cgg_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const lapack_complex_float* in, lapack_int ldin,
|
||||
lapack_complex_float* out, lapack_int ldout );
|
||||
void LAPACKE_chb_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int kd,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
void LAPACKE_che_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
void LAPACKE_chp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_float *in,
|
||||
lapack_complex_float *out );
|
||||
void LAPACKE_chs_trans( int matrix_layout, lapack_int n,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
void LAPACKE_cpb_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int kd,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
void LAPACKE_cpf_trans( int matrix_layout, char transr, char uplo,
|
||||
lapack_int n, const lapack_complex_float *in,
|
||||
lapack_complex_float *out );
|
||||
void LAPACKE_cpo_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
void LAPACKE_cpp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_float *in,
|
||||
lapack_complex_float *out );
|
||||
void LAPACKE_csp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_float *in,
|
||||
lapack_complex_float *out );
|
||||
void LAPACKE_csy_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
void LAPACKE_ctb_trans( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, lapack_int kd,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
void LAPACKE_ctf_trans( int matrix_layout, char transr, char uplo, char diag,
|
||||
lapack_int n, const lapack_complex_float *in,
|
||||
lapack_complex_float *out );
|
||||
void LAPACKE_ctp_trans( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, const lapack_complex_float *in,
|
||||
lapack_complex_float *out );
|
||||
void LAPACKE_ctr_trans( int matrix_layout, char uplo, char diag, lapack_int n,
|
||||
const lapack_complex_float *in, lapack_int ldin,
|
||||
lapack_complex_float *out, lapack_int ldout );
|
||||
|
||||
void LAPACKE_dgb_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const double *in, lapack_int ldin,
|
||||
double *out, lapack_int ldout );
|
||||
void LAPACKE_dge_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const double* in, lapack_int ldin,
|
||||
double* out, lapack_int ldout );
|
||||
void LAPACKE_dgg_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const double* in, lapack_int ldin,
|
||||
double* out, lapack_int ldout );
|
||||
void LAPACKE_dhs_trans( int matrix_layout, lapack_int n,
|
||||
const double *in, lapack_int ldin,
|
||||
double *out, lapack_int ldout );
|
||||
void LAPACKE_dpb_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int kd,
|
||||
const double *in, lapack_int ldin,
|
||||
double *out, lapack_int ldout );
|
||||
void LAPACKE_dpf_trans( int matrix_layout, char transr, char uplo,
|
||||
lapack_int n, const double *in,
|
||||
double *out );
|
||||
void LAPACKE_dpo_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const double *in, lapack_int ldin,
|
||||
double *out, lapack_int ldout );
|
||||
void LAPACKE_dpp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const double *in,
|
||||
double *out );
|
||||
void LAPACKE_dsb_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int kd,
|
||||
const double *in, lapack_int ldin,
|
||||
double *out, lapack_int ldout );
|
||||
void LAPACKE_dsp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const double *in,
|
||||
double *out );
|
||||
void LAPACKE_dsy_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const double *in, lapack_int ldin,
|
||||
double *out, lapack_int ldout );
|
||||
void LAPACKE_dtb_trans( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, lapack_int kd,
|
||||
const double *in, lapack_int ldin,
|
||||
double *out, lapack_int ldout );
|
||||
void LAPACKE_dtf_trans( int matrix_layout, char transr, char uplo, char diag,
|
||||
lapack_int n, const double *in,
|
||||
double *out );
|
||||
void LAPACKE_dtp_trans( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, const double *in,
|
||||
double *out );
|
||||
void LAPACKE_dtr_trans( int matrix_layout, char uplo, char diag, lapack_int n,
|
||||
const double *in, lapack_int ldin,
|
||||
double *out, lapack_int ldout );
|
||||
|
||||
void LAPACKE_sgb_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const float *in, lapack_int ldin,
|
||||
float *out, lapack_int ldout );
|
||||
void LAPACKE_sge_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const float* in, lapack_int ldin,
|
||||
float* out, lapack_int ldout );
|
||||
void LAPACKE_sgg_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const float* in, lapack_int ldin,
|
||||
float* out, lapack_int ldout );
|
||||
void LAPACKE_shs_trans( int matrix_layout, lapack_int n,
|
||||
const float *in, lapack_int ldin,
|
||||
float *out, lapack_int ldout );
|
||||
void LAPACKE_spb_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int kd,
|
||||
const float *in, lapack_int ldin,
|
||||
float *out, lapack_int ldout );
|
||||
void LAPACKE_spf_trans( int matrix_layout, char transr, char uplo,
|
||||
lapack_int n, const float *in,
|
||||
float *out );
|
||||
void LAPACKE_spo_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const float *in, lapack_int ldin,
|
||||
float *out, lapack_int ldout );
|
||||
void LAPACKE_spp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const float *in,
|
||||
float *out );
|
||||
void LAPACKE_ssb_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int kd,
|
||||
const float *in, lapack_int ldin,
|
||||
float *out, lapack_int ldout );
|
||||
void LAPACKE_ssp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const float *in,
|
||||
float *out );
|
||||
void LAPACKE_ssy_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const float *in, lapack_int ldin,
|
||||
float *out, lapack_int ldout );
|
||||
void LAPACKE_stb_trans( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, lapack_int kd,
|
||||
const float *in, lapack_int ldin,
|
||||
float *out, lapack_int ldout );
|
||||
void LAPACKE_stf_trans( int matrix_layout, char transr, char uplo, char diag,
|
||||
lapack_int n, const float *in,
|
||||
float *out );
|
||||
void LAPACKE_stp_trans( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, const float *in,
|
||||
float *out );
|
||||
void LAPACKE_str_trans( int matrix_layout, char uplo, char diag, lapack_int n,
|
||||
const float *in, lapack_int ldin,
|
||||
float *out, lapack_int ldout );
|
||||
|
||||
void LAPACKE_zgb_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
void LAPACKE_zge_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const lapack_complex_double* in, lapack_int ldin,
|
||||
lapack_complex_double* out, lapack_int ldout );
|
||||
void LAPACKE_zgg_trans( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const lapack_complex_double* in, lapack_int ldin,
|
||||
lapack_complex_double* out, lapack_int ldout );
|
||||
void LAPACKE_zhb_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int kd,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
void LAPACKE_zhe_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
void LAPACKE_zhp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_double *in,
|
||||
lapack_complex_double *out );
|
||||
void LAPACKE_zhs_trans( int matrix_layout, lapack_int n,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
void LAPACKE_zpb_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int kd,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
void LAPACKE_zpf_trans( int matrix_layout, char transr, char uplo,
|
||||
lapack_int n, const lapack_complex_double *in,
|
||||
lapack_complex_double *out );
|
||||
void LAPACKE_zpo_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
void LAPACKE_zpp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_double *in,
|
||||
lapack_complex_double *out );
|
||||
void LAPACKE_zsp_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_double *in,
|
||||
lapack_complex_double *out );
|
||||
void LAPACKE_zsy_trans( int matrix_layout, char uplo, lapack_int n,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
void LAPACKE_ztb_trans( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, lapack_int kd,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
void LAPACKE_ztf_trans( int matrix_layout, char transr, char uplo, char diag,
|
||||
lapack_int n, const lapack_complex_double *in,
|
||||
lapack_complex_double *out );
|
||||
void LAPACKE_ztp_trans( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, const lapack_complex_double *in,
|
||||
lapack_complex_double *out );
|
||||
void LAPACKE_ztr_trans( int matrix_layout, char uplo, char diag, lapack_int n,
|
||||
const lapack_complex_double *in, lapack_int ldin,
|
||||
lapack_complex_double *out, lapack_int ldout );
|
||||
|
||||
/* NaN checkers */
|
||||
#define LAPACK_SISNAN( x ) ( x != x )
|
||||
#define LAPACK_DISNAN( x ) ( x != x )
|
||||
#define LAPACK_CISNAN( x ) ( LAPACK_SISNAN(*((float*) &x)) || \
|
||||
LAPACK_SISNAN(*(((float*) &x)+1)) )
|
||||
#define LAPACK_ZISNAN( x ) ( LAPACK_DISNAN(*((double*)&x)) || \
|
||||
LAPACK_DISNAN(*(((double*)&x)+1)) )
|
||||
|
||||
/* NaN checkers for vectors */
|
||||
lapack_logical LAPACKE_c_nancheck( lapack_int n,
|
||||
const lapack_complex_float *x,
|
||||
lapack_int incx );
|
||||
lapack_logical LAPACKE_d_nancheck( lapack_int n,
|
||||
const double *x,
|
||||
lapack_int incx );
|
||||
lapack_logical LAPACKE_s_nancheck( lapack_int n,
|
||||
const float *x,
|
||||
lapack_int incx );
|
||||
lapack_logical LAPACKE_z_nancheck( lapack_int n,
|
||||
const lapack_complex_double *x,
|
||||
lapack_int incx );
|
||||
/* NaN checkers for matrices */
|
||||
lapack_logical LAPACKE_cgb_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n, lapack_int kl,
|
||||
lapack_int ku,
|
||||
const lapack_complex_float *ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_cge_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n,
|
||||
const lapack_complex_float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_cgg_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n,
|
||||
const lapack_complex_float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_cgt_nancheck( lapack_int n,
|
||||
const lapack_complex_float *dl,
|
||||
const lapack_complex_float *d,
|
||||
const lapack_complex_float *du );
|
||||
lapack_logical LAPACKE_chb_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n, lapack_int kd,
|
||||
const lapack_complex_float* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_che_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const lapack_complex_float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_chp_nancheck( lapack_int n,
|
||||
const lapack_complex_float *ap );
|
||||
lapack_logical LAPACKE_chs_nancheck( int matrix_layout, lapack_int n,
|
||||
const lapack_complex_float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_cpb_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n, lapack_int kd,
|
||||
const lapack_complex_float* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_cpf_nancheck( lapack_int n,
|
||||
const lapack_complex_float *a );
|
||||
lapack_logical LAPACKE_cpo_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const lapack_complex_float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_cpp_nancheck( lapack_int n,
|
||||
const lapack_complex_float *ap );
|
||||
lapack_logical LAPACKE_cpt_nancheck( lapack_int n,
|
||||
const float *d,
|
||||
const lapack_complex_float *e );
|
||||
lapack_logical LAPACKE_csp_nancheck( lapack_int n,
|
||||
const lapack_complex_float *ap );
|
||||
lapack_logical LAPACKE_cst_nancheck( lapack_int n,
|
||||
const lapack_complex_float *d,
|
||||
const lapack_complex_float *e );
|
||||
lapack_logical LAPACKE_csy_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const lapack_complex_float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_ctb_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, lapack_int kd,
|
||||
const lapack_complex_float* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_ctf_nancheck( int matrix_layout, char transr,
|
||||
char uplo, char diag,
|
||||
lapack_int n,
|
||||
const lapack_complex_float *a );
|
||||
lapack_logical LAPACKE_ctp_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n,
|
||||
const lapack_complex_float *ap );
|
||||
lapack_logical LAPACKE_ctr_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n,
|
||||
const lapack_complex_float *a,
|
||||
lapack_int lda );
|
||||
|
||||
lapack_logical LAPACKE_dgb_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n, lapack_int kl,
|
||||
lapack_int ku,
|
||||
const double *ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_dge_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n,
|
||||
const double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_dgg_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n,
|
||||
const double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_dgt_nancheck( lapack_int n,
|
||||
const double *dl,
|
||||
const double *d,
|
||||
const double *du );
|
||||
lapack_logical LAPACKE_dhs_nancheck( int matrix_layout, lapack_int n,
|
||||
const double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_dpb_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n, lapack_int kd,
|
||||
const double* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_dpf_nancheck( lapack_int n,
|
||||
const double *a );
|
||||
lapack_logical LAPACKE_dpo_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_dpp_nancheck( lapack_int n,
|
||||
const double *ap );
|
||||
lapack_logical LAPACKE_dpt_nancheck( lapack_int n,
|
||||
const double *d,
|
||||
const double *e );
|
||||
lapack_logical LAPACKE_dsb_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n, lapack_int kd,
|
||||
const double* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_dsp_nancheck( lapack_int n,
|
||||
const double *ap );
|
||||
lapack_logical LAPACKE_dst_nancheck( lapack_int n,
|
||||
const double *d,
|
||||
const double *e );
|
||||
lapack_logical LAPACKE_dsy_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_dtb_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, lapack_int kd,
|
||||
const double* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_dtf_nancheck( int matrix_layout, char transr,
|
||||
char uplo, char diag,
|
||||
lapack_int n,
|
||||
const double *a );
|
||||
lapack_logical LAPACKE_dtp_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n,
|
||||
const double *ap );
|
||||
lapack_logical LAPACKE_dtr_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n,
|
||||
const double *a,
|
||||
lapack_int lda );
|
||||
|
||||
lapack_logical LAPACKE_sgb_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n, lapack_int kl,
|
||||
lapack_int ku,
|
||||
const float *ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_sge_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n,
|
||||
const float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_sgg_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n,
|
||||
const float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_sgt_nancheck( lapack_int n,
|
||||
const float *dl,
|
||||
const float *d,
|
||||
const float *du );
|
||||
lapack_logical LAPACKE_shs_nancheck( int matrix_layout, lapack_int n,
|
||||
const float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_spb_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n, lapack_int kd,
|
||||
const float* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_spf_nancheck( lapack_int n,
|
||||
const float *a );
|
||||
lapack_logical LAPACKE_spo_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_spp_nancheck( lapack_int n,
|
||||
const float *ap );
|
||||
lapack_logical LAPACKE_spt_nancheck( lapack_int n,
|
||||
const float *d,
|
||||
const float *e );
|
||||
lapack_logical LAPACKE_ssb_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n, lapack_int kd,
|
||||
const float* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_ssp_nancheck( lapack_int n,
|
||||
const float *ap );
|
||||
lapack_logical LAPACKE_sst_nancheck( lapack_int n,
|
||||
const float *d,
|
||||
const float *e );
|
||||
lapack_logical LAPACKE_ssy_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const float *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_stb_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, lapack_int kd,
|
||||
const float* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_stf_nancheck( int matrix_layout, char transr,
|
||||
char uplo, char diag,
|
||||
lapack_int n,
|
||||
const float *a );
|
||||
lapack_logical LAPACKE_stp_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n,
|
||||
const float *ap );
|
||||
lapack_logical LAPACKE_str_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n,
|
||||
const float *a,
|
||||
lapack_int lda );
|
||||
|
||||
lapack_logical LAPACKE_zgb_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n, lapack_int kl,
|
||||
lapack_int ku,
|
||||
const lapack_complex_double *ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_zge_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n,
|
||||
const lapack_complex_double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_zgg_nancheck( int matrix_layout, lapack_int m,
|
||||
lapack_int n,
|
||||
const lapack_complex_double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_zgt_nancheck( lapack_int n,
|
||||
const lapack_complex_double *dl,
|
||||
const lapack_complex_double *d,
|
||||
const lapack_complex_double *du );
|
||||
lapack_logical LAPACKE_zhb_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n, lapack_int kd,
|
||||
const lapack_complex_double* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_zhe_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const lapack_complex_double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_zhp_nancheck( lapack_int n,
|
||||
const lapack_complex_double *ap );
|
||||
lapack_logical LAPACKE_zhs_nancheck( int matrix_layout, lapack_int n,
|
||||
const lapack_complex_double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_zpb_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n, lapack_int kd,
|
||||
const lapack_complex_double* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_zpf_nancheck( lapack_int n,
|
||||
const lapack_complex_double *a );
|
||||
lapack_logical LAPACKE_zpo_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const lapack_complex_double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_zpp_nancheck( lapack_int n,
|
||||
const lapack_complex_double *ap );
|
||||
lapack_logical LAPACKE_zpt_nancheck( lapack_int n,
|
||||
const double *d,
|
||||
const lapack_complex_double *e );
|
||||
lapack_logical LAPACKE_zsp_nancheck( lapack_int n,
|
||||
const lapack_complex_double *ap );
|
||||
lapack_logical LAPACKE_zst_nancheck( lapack_int n,
|
||||
const lapack_complex_double *d,
|
||||
const lapack_complex_double *e );
|
||||
lapack_logical LAPACKE_zsy_nancheck( int matrix_layout, char uplo,
|
||||
lapack_int n,
|
||||
const lapack_complex_double *a,
|
||||
lapack_int lda );
|
||||
lapack_logical LAPACKE_ztb_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n, lapack_int kd,
|
||||
const lapack_complex_double* ab,
|
||||
lapack_int ldab );
|
||||
lapack_logical LAPACKE_ztf_nancheck( int matrix_layout, char transr,
|
||||
char uplo, char diag,
|
||||
lapack_int n,
|
||||
const lapack_complex_double *a );
|
||||
lapack_logical LAPACKE_ztp_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n,
|
||||
const lapack_complex_double *ap );
|
||||
lapack_logical LAPACKE_ztr_nancheck( int matrix_layout, char uplo, char diag,
|
||||
lapack_int n,
|
||||
const lapack_complex_double *a,
|
||||
lapack_int lda );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _LAPACKE_UTILS_H_ */
|
||||
9
lapack-netlib/LAPACKE/lapacke.pc.in
Normal file
9
lapack-netlib/LAPACKE/lapacke.pc.in
Normal file
@@ -0,0 +1,9 @@
|
||||
prefix=@prefix@
|
||||
libdir=@libdir@
|
||||
|
||||
Name: lapacke
|
||||
Description: C Standard Interface to LAPACK Linear Algebra PACKage
|
||||
Version: @LAPACK_VERSION@
|
||||
URL: http://www.netlib.org/lapack/
|
||||
Libs: -L${libdir} -llapacke
|
||||
Requires: lapack blas
|
||||
4
lapack-netlib/LAPACKE/mangling/CMakeLists.txt
Normal file
4
lapack-netlib/LAPACKE/mangling/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.7)
|
||||
project(MANGLING C Fortran)
|
||||
|
||||
add_executable(xintface Fintface.f Cintface.c)
|
||||
21
lapack-netlib/LAPACKE/mangling/Cintface.c
Normal file
21
lapack-netlib/LAPACKE/mangling/Cintface.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void c_intface_(int *i)
|
||||
{
|
||||
fprintf(stdout, "ADD_\n");
|
||||
}
|
||||
|
||||
void c_intface(int *i)
|
||||
{
|
||||
fprintf(stdout, "NOCHANGE\n");
|
||||
}
|
||||
|
||||
void c_intface__(int *i)
|
||||
{
|
||||
fprintf(stdout, "f77IsF2C\n");
|
||||
}
|
||||
|
||||
void C_INTFACE(int *i)
|
||||
{
|
||||
fprintf(stdout, "UPPER\n");
|
||||
}
|
||||
8
lapack-netlib/LAPACKE/mangling/Fintface.f
Normal file
8
lapack-netlib/LAPACKE/mangling/Fintface.f
Normal file
@@ -0,0 +1,8 @@
|
||||
program intface
|
||||
external c_intface
|
||||
integer i
|
||||
|
||||
call c_intface(i)
|
||||
|
||||
stop
|
||||
end
|
||||
2161
lapack-netlib/LAPACKE/src/CMakeLists.txt
Normal file
2161
lapack-netlib/LAPACKE/src/CMakeLists.txt
Normal file
File diff suppressed because it is too large
Load Diff
2214
lapack-netlib/LAPACKE/src/Makefile
Normal file
2214
lapack-netlib/LAPACKE/src/Makefile
Normal file
File diff suppressed because it is too large
Load Diff
115
lapack-netlib/LAPACKE/src/lapacke_cbbcsd.c
Normal file
115
lapack-netlib/LAPACKE/src/lapacke_cbbcsd.c
Normal file
@@ -0,0 +1,115 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cbbcsd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cbbcsd( int matrix_layout, char jobu1, char jobu2,
|
||||
char jobv1t, char jobv2t, char trans, lapack_int m,
|
||||
lapack_int p, lapack_int q, float* theta, float* phi,
|
||||
lapack_complex_float* u1, lapack_int ldu1,
|
||||
lapack_complex_float* u2, lapack_int ldu2,
|
||||
lapack_complex_float* v1t, lapack_int ldv1t,
|
||||
lapack_complex_float* v2t, lapack_int ldv2t,
|
||||
float* b11d, float* b11e, float* b12d, float* b12e,
|
||||
float* b21d, float* b21e, float* b22d, float* b22e )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lrwork = -1;
|
||||
float* rwork = NULL;
|
||||
float rwork_query;
|
||||
lapack_int nrows_u1, nrows_u2, nrows_v1t, nrows_v2t;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cbbcsd", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
nrows_u1 = ( LAPACKE_lsame( jobu1, 'y' ) ? p : 1);
|
||||
nrows_u2 = ( LAPACKE_lsame( jobu2, 'y' ) ? m-p : 1);
|
||||
nrows_v1t = ( LAPACKE_lsame( jobv1t, 'y' ) ? q : 1);
|
||||
nrows_v2t = ( LAPACKE_lsame( jobv2t, 'y' ) ? m-q : 1);
|
||||
if( LAPACKE_s_nancheck( q-1, phi, 1 ) ) {
|
||||
return -11;
|
||||
}
|
||||
if( LAPACKE_s_nancheck( q, theta, 1 ) ) {
|
||||
return -10;
|
||||
}
|
||||
if( LAPACKE_lsame( jobu1, 'y' ) ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, nrows_u1, p, u1, ldu1 ) ) {
|
||||
return -12;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobu2, 'y' ) ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, nrows_u2, m-p, u2, ldu2 ) ) {
|
||||
return -14;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobv1t, 'y' ) ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, nrows_v1t, q, v1t, ldv1t ) ) {
|
||||
return -16;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobv2t, 'y' ) ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, nrows_v2t, m-q, v2t, ldv2t ) ) {
|
||||
return -18;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cbbcsd_work( matrix_layout, jobu1, jobu2, jobv1t, jobv2t,
|
||||
trans, m, p, q, theta, phi, u1, ldu1, u2, ldu2,
|
||||
v1t, ldv1t, v2t, ldv2t, b11d, b11e, b12d, b12e,
|
||||
b21d, b21e, b22d, b22e, &rwork_query, lrwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_0;
|
||||
}
|
||||
lrwork = (lapack_int)rwork_query;
|
||||
/* Allocate memory for work arrays */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * lrwork );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cbbcsd_work( matrix_layout, jobu1, jobu2, jobv1t, jobv2t,
|
||||
trans, m, p, q, theta, phi, u1, ldu1, u2, ldu2,
|
||||
v1t, ldv1t, v2t, ldv2t, b11d, b11e, b12d, b12e,
|
||||
b21d, b21e, b22d, b22e, rwork, lrwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cbbcsd", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
205
lapack-netlib/LAPACKE/src/lapacke_cbbcsd_work.c
Normal file
205
lapack-netlib/LAPACKE/src/lapacke_cbbcsd_work.c
Normal file
@@ -0,0 +1,205 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cbbcsd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cbbcsd_work( int matrix_layout, char jobu1, char jobu2,
|
||||
char jobv1t, char jobv2t, char trans,
|
||||
lapack_int m, lapack_int p, lapack_int q,
|
||||
float* theta, float* phi,
|
||||
lapack_complex_float* u1, lapack_int ldu1,
|
||||
lapack_complex_float* u2, lapack_int ldu2,
|
||||
lapack_complex_float* v1t, lapack_int ldv1t,
|
||||
lapack_complex_float* v2t, lapack_int ldv2t,
|
||||
float* b11d, float* b11e, float* b12d,
|
||||
float* b12e, float* b21d, float* b21e,
|
||||
float* b22d, float* b22e, float* rwork,
|
||||
lapack_int lrwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cbbcsd( &jobu1, &jobu2, &jobv1t, &jobv2t, &trans, &m, &p, &q,
|
||||
theta, phi, u1, &ldu1, u2, &ldu2, v1t, &ldv1t, v2t,
|
||||
&ldv2t, b11d, b11e, b12d, b12e, b21d, b21e, b22d, b22e,
|
||||
rwork, &lrwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int nrows_u1 = ( LAPACKE_lsame( jobu1, 'y' ) ? p : 1);
|
||||
lapack_int nrows_u2 = ( LAPACKE_lsame( jobu2, 'y' ) ? m-p : 1);
|
||||
lapack_int nrows_v1t = ( LAPACKE_lsame( jobv1t, 'y' ) ? q : 1);
|
||||
lapack_int nrows_v2t = ( LAPACKE_lsame( jobv2t, 'y' ) ? m-q : 1);
|
||||
lapack_int ldu1_t = MAX(1,nrows_u1);
|
||||
lapack_int ldu2_t = MAX(1,nrows_u2);
|
||||
lapack_int ldv1t_t = MAX(1,nrows_v1t);
|
||||
lapack_int ldv2t_t = MAX(1,nrows_v2t);
|
||||
lapack_complex_float* u1_t = NULL;
|
||||
lapack_complex_float* u2_t = NULL;
|
||||
lapack_complex_float* v1t_t = NULL;
|
||||
lapack_complex_float* v2t_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldu1 < p ) {
|
||||
info = -13;
|
||||
LAPACKE_xerbla( "LAPACKE_cbbcsd_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldu2 < m-p ) {
|
||||
info = -15;
|
||||
LAPACKE_xerbla( "LAPACKE_cbbcsd_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldv1t < q ) {
|
||||
info = -17;
|
||||
LAPACKE_xerbla( "LAPACKE_cbbcsd_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldv2t < m-q ) {
|
||||
info = -19;
|
||||
LAPACKE_xerbla( "LAPACKE_cbbcsd_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lrwork == -1 ) {
|
||||
LAPACK_cbbcsd( &jobu1, &jobu2, &jobv1t, &jobv2t, &trans, &m, &p, &q,
|
||||
theta, phi, u1, &ldu1_t, u2, &ldu2_t, v1t, &ldv1t_t,
|
||||
v2t, &ldv2t_t, b11d, b11e, b12d, b12e, b21d, b21e,
|
||||
b22d, b22e, rwork, &lrwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
if( LAPACKE_lsame( jobu1, 'y' ) ) {
|
||||
u1_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldu1_t * MAX(1,p) );
|
||||
if( u1_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobu2, 'y' ) ) {
|
||||
u2_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldu2_t * MAX(1,m-p) );
|
||||
if( u2_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobv1t, 'y' ) ) {
|
||||
v1t_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldv1t_t * MAX(1,q) );
|
||||
if( v1t_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobv2t, 'y' ) ) {
|
||||
v2t_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldv2t_t * MAX(1,m-q) );
|
||||
if( v2t_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_3;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
if( LAPACKE_lsame( jobu1, 'y' ) ) {
|
||||
LAPACKE_cge_trans( matrix_layout, nrows_u1, p, u1, ldu1, u1_t,
|
||||
ldu1_t );
|
||||
}
|
||||
if( LAPACKE_lsame( jobu2, 'y' ) ) {
|
||||
LAPACKE_cge_trans( matrix_layout, nrows_u2, m-p, u2, ldu2, u2_t,
|
||||
ldu2_t );
|
||||
}
|
||||
if( LAPACKE_lsame( jobv1t, 'y' ) ) {
|
||||
LAPACKE_cge_trans( matrix_layout, nrows_v1t, q, v1t, ldv1t, v1t_t,
|
||||
ldv1t_t );
|
||||
}
|
||||
if( LAPACKE_lsame( jobv2t, 'y' ) ) {
|
||||
LAPACKE_cge_trans( matrix_layout, nrows_v2t, m-q, v2t, ldv2t, v2t_t,
|
||||
ldv2t_t );
|
||||
}
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cbbcsd( &jobu1, &jobu2, &jobv1t, &jobv2t, &trans, &m, &p, &q,
|
||||
theta, phi, u1_t, &ldu1_t, u2_t, &ldu2_t, v1t_t,
|
||||
&ldv1t_t, v2t_t, &ldv2t_t, b11d, b11e, b12d, b12e, b21d,
|
||||
b21e, b22d, b22e, rwork, &lrwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
if( LAPACKE_lsame( jobu1, 'y' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nrows_u1, p, u1_t, ldu1_t, u1,
|
||||
ldu1 );
|
||||
}
|
||||
if( LAPACKE_lsame( jobu2, 'y' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nrows_u2, m-p, u2_t, ldu2_t,
|
||||
u2, ldu2 );
|
||||
}
|
||||
if( LAPACKE_lsame( jobv1t, 'y' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nrows_v1t, q, v1t_t, ldv1t_t,
|
||||
v1t, ldv1t );
|
||||
}
|
||||
if( LAPACKE_lsame( jobv2t, 'y' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nrows_v2t, m-q, v2t_t, ldv2t_t,
|
||||
v2t, ldv2t );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( LAPACKE_lsame( jobv2t, 'y' ) ) {
|
||||
LAPACKE_free( v2t_t );
|
||||
}
|
||||
exit_level_3:
|
||||
if( LAPACKE_lsame( jobv1t, 'y' ) ) {
|
||||
LAPACKE_free( v1t_t );
|
||||
}
|
||||
exit_level_2:
|
||||
if( LAPACKE_lsame( jobu2, 'y' ) ) {
|
||||
LAPACKE_free( u2_t );
|
||||
}
|
||||
exit_level_1:
|
||||
if( LAPACKE_lsame( jobu1, 'y' ) ) {
|
||||
LAPACKE_free( u1_t );
|
||||
}
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cbbcsd_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cbbcsd_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
89
lapack-netlib/LAPACKE/src/lapacke_cbdsqr.c
Normal file
89
lapack-netlib/LAPACKE/src/lapacke_cbdsqr.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cbdsqr
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cbdsqr( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int ncvt, lapack_int nru, lapack_int ncc,
|
||||
float* d, float* e, lapack_complex_float* vt,
|
||||
lapack_int ldvt, lapack_complex_float* u,
|
||||
lapack_int ldu, lapack_complex_float* c,
|
||||
lapack_int ldc )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cbdsqr", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( ncc != 0 ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, ncc, c, ldc ) ) {
|
||||
return -13;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_s_nancheck( n, d, 1 ) ) {
|
||||
return -7;
|
||||
}
|
||||
if( LAPACKE_s_nancheck( n-1, e, 1 ) ) {
|
||||
return -8;
|
||||
}
|
||||
if( nru != 0 ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, nru, n, u, ldu ) ) {
|
||||
return -11;
|
||||
}
|
||||
}
|
||||
if( ncvt != 0 ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, ncvt, vt, ldvt ) ) {
|
||||
return -9;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
work = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,4*n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cbdsqr_work( matrix_layout, uplo, n, ncvt, nru, ncc, d, e, vt,
|
||||
ldvt, u, ldu, c, ldc, work );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cbdsqr", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
150
lapack-netlib/LAPACKE/src/lapacke_cbdsqr_work.c
Normal file
150
lapack-netlib/LAPACKE/src/lapacke_cbdsqr_work.c
Normal file
@@ -0,0 +1,150 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cbdsqr
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cbdsqr_work( int matrix_layout, char uplo, lapack_int n,
|
||||
lapack_int ncvt, lapack_int nru, lapack_int ncc,
|
||||
float* d, float* e, lapack_complex_float* vt,
|
||||
lapack_int ldvt, lapack_complex_float* u,
|
||||
lapack_int ldu, lapack_complex_float* c,
|
||||
lapack_int ldc, float* work )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cbdsqr( &uplo, &n, &ncvt, &nru, &ncc, d, e, vt, &ldvt, u, &ldu,
|
||||
c, &ldc, work, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldc_t = MAX(1,n);
|
||||
lapack_int ldu_t = MAX(1,nru);
|
||||
lapack_int ldvt_t = MAX(1,n);
|
||||
lapack_complex_float* vt_t = NULL;
|
||||
lapack_complex_float* u_t = NULL;
|
||||
lapack_complex_float* c_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldc < ncc ) {
|
||||
info = -14;
|
||||
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldu < n ) {
|
||||
info = -12;
|
||||
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldvt < ncvt ) {
|
||||
info = -10;
|
||||
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
if( ncvt != 0 ) {
|
||||
vt_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldvt_t * MAX(1,ncvt) );
|
||||
if( vt_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
}
|
||||
if( nru != 0 ) {
|
||||
u_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldu_t * MAX(1,n) );
|
||||
if( u_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
}
|
||||
if( ncc != 0 ) {
|
||||
c_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldc_t * MAX(1,ncc) );
|
||||
if( c_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
if( ncvt != 0 ) {
|
||||
LAPACKE_cge_trans( matrix_layout, n, ncvt, vt, ldvt, vt_t, ldvt_t );
|
||||
}
|
||||
if( nru != 0 ) {
|
||||
LAPACKE_cge_trans( matrix_layout, nru, n, u, ldu, u_t, ldu_t );
|
||||
}
|
||||
if( ncc != 0 ) {
|
||||
LAPACKE_cge_trans( matrix_layout, n, ncc, c, ldc, c_t, ldc_t );
|
||||
}
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cbdsqr( &uplo, &n, &ncvt, &nru, &ncc, d, e, vt_t, &ldvt_t, u_t,
|
||||
&ldu_t, c_t, &ldc_t, work, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
if( ncvt != 0 ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, ncvt, vt_t, ldvt_t, vt,
|
||||
ldvt );
|
||||
}
|
||||
if( nru != 0 ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nru, n, u_t, ldu_t, u, ldu );
|
||||
}
|
||||
if( ncc != 0 ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, ncc, c_t, ldc_t, c, ldc );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( ncc != 0 ) {
|
||||
LAPACKE_free( c_t );
|
||||
}
|
||||
exit_level_2:
|
||||
if( nru != 0 ) {
|
||||
LAPACKE_free( u_t );
|
||||
}
|
||||
exit_level_1:
|
||||
if( ncvt != 0 ) {
|
||||
LAPACKE_free( vt_t );
|
||||
}
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cbdsqr_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
86
lapack-netlib/LAPACKE/src/lapacke_cgbbrd.c
Normal file
86
lapack-netlib/LAPACKE/src/lapacke_cgbbrd.c
Normal file
@@ -0,0 +1,86 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbbrd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbbrd( int matrix_layout, char vect, lapack_int m,
|
||||
lapack_int n, lapack_int ncc, lapack_int kl,
|
||||
lapack_int ku, lapack_complex_float* ab,
|
||||
lapack_int ldab, float* d, float* e,
|
||||
lapack_complex_float* q, lapack_int ldq,
|
||||
lapack_complex_float* pt, lapack_int ldpt,
|
||||
lapack_complex_float* c, lapack_int ldc )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbbrd", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
|
||||
return -8;
|
||||
}
|
||||
if( ncc != 0 ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, ncc, c, ldc ) ) {
|
||||
return -16;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,MAX(m,n)) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,MAX(m,n)) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgbbrd_work( matrix_layout, vect, m, n, ncc, kl, ku, ab, ldab,
|
||||
d, e, q, ldq, pt, ldpt, c, ldc, work, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbbrd", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
163
lapack-netlib/LAPACKE/src/lapacke_cgbbrd_work.c
Normal file
163
lapack-netlib/LAPACKE/src/lapacke_cgbbrd_work.c
Normal file
@@ -0,0 +1,163 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbbrd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbbrd_work( int matrix_layout, char vect, lapack_int m,
|
||||
lapack_int n, lapack_int ncc, lapack_int kl,
|
||||
lapack_int ku, lapack_complex_float* ab,
|
||||
lapack_int ldab, float* d, float* e,
|
||||
lapack_complex_float* q, lapack_int ldq,
|
||||
lapack_complex_float* pt, lapack_int ldpt,
|
||||
lapack_complex_float* c, lapack_int ldc,
|
||||
lapack_complex_float* work, float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbbrd( &vect, &m, &n, &ncc, &kl, &ku, ab, &ldab, d, e, q, &ldq,
|
||||
pt, &ldpt, c, &ldc, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,kl+ku+1);
|
||||
lapack_int ldc_t = MAX(1,m);
|
||||
lapack_int ldpt_t = MAX(1,n);
|
||||
lapack_int ldq_t = MAX(1,m);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
lapack_complex_float* q_t = NULL;
|
||||
lapack_complex_float* pt_t = NULL;
|
||||
lapack_complex_float* c_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -9;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldc < ncc ) {
|
||||
info = -17;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldpt < n ) {
|
||||
info = -15;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldq < m ) {
|
||||
info = -13;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
|
||||
q_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldq_t * MAX(1,m) );
|
||||
if( q_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
|
||||
pt_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldpt_t * MAX(1,n) );
|
||||
if( pt_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
}
|
||||
if( ncc != 0 ) {
|
||||
c_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldc_t * MAX(1,ncc) );
|
||||
if( c_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_3;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
|
||||
if( ncc != 0 ) {
|
||||
LAPACKE_cge_trans( matrix_layout, m, ncc, c, ldc, c_t, ldc_t );
|
||||
}
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbbrd( &vect, &m, &n, &ncc, &kl, &ku, ab_t, &ldab_t, d, e, q_t,
|
||||
&ldq_t, pt_t, &ldpt_t, c_t, &ldc_t, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, m, n, kl, ku, ab_t, ldab_t, ab,
|
||||
ldab );
|
||||
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, m, q_t, ldq_t, q, ldq );
|
||||
}
|
||||
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, pt_t, ldpt_t, pt, ldpt );
|
||||
}
|
||||
if( ncc != 0 ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, ncc, c_t, ldc_t, c, ldc );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( ncc != 0 ) {
|
||||
LAPACKE_free( c_t );
|
||||
}
|
||||
exit_level_3:
|
||||
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'p' ) ) {
|
||||
LAPACKE_free( pt_t );
|
||||
}
|
||||
exit_level_2:
|
||||
if( LAPACKE_lsame( vect, 'b' ) || LAPACKE_lsame( vect, 'q' ) ) {
|
||||
LAPACKE_free( q_t );
|
||||
}
|
||||
exit_level_1:
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbbrd_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
81
lapack-netlib/LAPACKE/src/lapacke_cgbcon.c
Normal file
81
lapack-netlib/LAPACKE/src/lapacke_cgbcon.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbcon
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbcon( int matrix_layout, char norm, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
const lapack_int* ipiv, float anorm, float* rcond )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbcon", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
|
||||
return -6;
|
||||
}
|
||||
if( LAPACKE_s_nancheck( 1, &anorm, 1 ) ) {
|
||||
return -9;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,2*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgbcon_work( matrix_layout, norm, n, kl, ku, ab, ldab, ipiv,
|
||||
anorm, rcond, work, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbcon", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
87
lapack-netlib/LAPACKE/src/lapacke_cgbcon_work.c
Normal file
87
lapack-netlib/LAPACKE/src/lapacke_cgbcon_work.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbcon
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbcon_work( int matrix_layout, char norm, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
const lapack_int* ipiv, float anorm,
|
||||
float* rcond, lapack_complex_float* work,
|
||||
float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbcon( &norm, &n, &kl, &ku, ab, &ldab, ipiv, &anorm, rcond,
|
||||
work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,2*kl+ku+1);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -7;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbcon_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
|
||||
ldab_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbcon( &norm, &n, &kl, &ku, ab_t, &ldab_t, ipiv, &anorm, rcond,
|
||||
work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbcon_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbcon_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
54
lapack-netlib/LAPACKE/src/lapacke_cgbequ.c
Normal file
54
lapack-netlib/LAPACKE/src/lapacke_cgbequ.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbequ
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbequ( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
float* r, float* c, float* rowcnd, float* colcnd,
|
||||
float* amax )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbequ", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
|
||||
return -6;
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgbequ_work( matrix_layout, m, n, kl, ku, ab, ldab, r, c,
|
||||
rowcnd, colcnd, amax );
|
||||
}
|
||||
85
lapack-netlib/LAPACKE/src/lapacke_cgbequ_work.c
Normal file
85
lapack-netlib/LAPACKE/src/lapacke_cgbequ_work.c
Normal file
@@ -0,0 +1,85 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbequ
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbequ_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
float* r, float* c, float* rowcnd,
|
||||
float* colcnd, float* amax )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbequ( &m, &n, &kl, &ku, ab, &ldab, r, c, rowcnd, colcnd, amax,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,kl+ku+1);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -7;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbequ_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbequ( &m, &n, &kl, &ku, ab_t, &ldab_t, r, c, rowcnd, colcnd,
|
||||
amax, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbequ_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbequ_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
54
lapack-netlib/LAPACKE/src/lapacke_cgbequb.c
Normal file
54
lapack-netlib/LAPACKE/src/lapacke_cgbequb.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbequb
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbequb( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
float* r, float* c, float* rowcnd, float* colcnd,
|
||||
float* amax )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbequb", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, ku, ab, ldab ) ) {
|
||||
return -6;
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgbequb_work( matrix_layout, m, n, kl, ku, ab, ldab, r, c,
|
||||
rowcnd, colcnd, amax );
|
||||
}
|
||||
85
lapack-netlib/LAPACKE/src/lapacke_cgbequb_work.c
Normal file
85
lapack-netlib/LAPACKE/src/lapacke_cgbequb_work.c
Normal file
@@ -0,0 +1,85 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbequb
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbequb_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
const lapack_complex_float* ab,
|
||||
lapack_int ldab, float* r, float* c,
|
||||
float* rowcnd, float* colcnd, float* amax )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbequb( &m, &n, &kl, &ku, ab, &ldab, r, c, rowcnd, colcnd, amax,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,kl+ku+1);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -7;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbequb_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, m, n, kl, ku, ab, ldab, ab_t, ldab_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbequb( &m, &n, &kl, &ku, ab_t, &ldab_t, r, c, rowcnd, colcnd,
|
||||
amax, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbequb_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbequb_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
92
lapack-netlib/LAPACKE/src/lapacke_cgbrfs.c
Normal file
92
lapack-netlib/LAPACKE/src/lapacke_cgbrfs.c
Normal file
@@ -0,0 +1,92 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbrfs
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbrfs( int matrix_layout, char trans, lapack_int n,
|
||||
lapack_int kl, lapack_int ku, lapack_int nrhs,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
const lapack_complex_float* afb, lapack_int ldafb,
|
||||
const lapack_int* ipiv,
|
||||
const lapack_complex_float* b, lapack_int ldb,
|
||||
lapack_complex_float* x, lapack_int ldx, float* ferr,
|
||||
float* berr )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfs", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
|
||||
return -7;
|
||||
}
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb, ldafb ) ) {
|
||||
return -9;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
|
||||
return -12;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, x, ldx ) ) {
|
||||
return -14;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgbrfs_work( matrix_layout, trans, n, kl, ku, nrhs, ab, ldab,
|
||||
afb, ldafb, ipiv, b, ldb, x, ldx, ferr, berr,
|
||||
work, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfs", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
143
lapack-netlib/LAPACKE/src/lapacke_cgbrfs_work.c
Normal file
143
lapack-netlib/LAPACKE/src/lapacke_cgbrfs_work.c
Normal file
@@ -0,0 +1,143 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbrfs
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbrfs_work( int matrix_layout, char trans, lapack_int n,
|
||||
lapack_int kl, lapack_int ku, lapack_int nrhs,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
const lapack_complex_float* afb,
|
||||
lapack_int ldafb, const lapack_int* ipiv,
|
||||
const lapack_complex_float* b, lapack_int ldb,
|
||||
lapack_complex_float* x, lapack_int ldx,
|
||||
float* ferr, float* berr,
|
||||
lapack_complex_float* work, float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbrfs( &trans, &n, &kl, &ku, &nrhs, ab, &ldab, afb, &ldafb,
|
||||
ipiv, b, &ldb, x, &ldx, ferr, berr, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,kl+ku+1);
|
||||
lapack_int ldafb_t = MAX(1,2*kl+ku+1);
|
||||
lapack_int ldb_t = MAX(1,n);
|
||||
lapack_int ldx_t = MAX(1,n);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
lapack_complex_float* afb_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
lapack_complex_float* x_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -8;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldafb < n ) {
|
||||
info = -10;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -13;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldx < nrhs ) {
|
||||
info = -15;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
afb_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldafb_t * MAX(1,n) );
|
||||
if( afb_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
x_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldx_t * MAX(1,nrhs) );
|
||||
if( x_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_3;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
|
||||
ldafb_t );
|
||||
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
|
||||
LAPACKE_cge_trans( matrix_layout, n, nrhs, x, ldx, x_t, ldx_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbrfs( &trans, &n, &kl, &ku, &nrhs, ab_t, &ldab_t, afb_t,
|
||||
&ldafb_t, ipiv, b_t, &ldb_t, x_t, &ldx_t, ferr, berr,
|
||||
work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( x_t );
|
||||
exit_level_3:
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_2:
|
||||
LAPACKE_free( afb_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfs_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
111
lapack-netlib/LAPACKE/src/lapacke_cgbrfsx.c
Normal file
111
lapack-netlib/LAPACKE/src/lapacke_cgbrfsx.c
Normal file
@@ -0,0 +1,111 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbrfsx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbrfsx( int matrix_layout, char trans, char equed,
|
||||
lapack_int n, lapack_int kl, lapack_int ku,
|
||||
lapack_int nrhs, const lapack_complex_float* ab,
|
||||
lapack_int ldab, const lapack_complex_float* afb,
|
||||
lapack_int ldafb, const lapack_int* ipiv,
|
||||
const float* r, const float* c,
|
||||
const lapack_complex_float* b, lapack_int ldb,
|
||||
lapack_complex_float* x, lapack_int ldx,
|
||||
float* rcond, float* berr, lapack_int n_err_bnds,
|
||||
float* err_bnds_norm, float* err_bnds_comp,
|
||||
lapack_int nparams, float* params )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfsx", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
|
||||
return -8;
|
||||
}
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb, ldafb ) ) {
|
||||
return -10;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
|
||||
return -15;
|
||||
}
|
||||
if( LAPACKE_lsame( equed, 'b' ) || LAPACKE_lsame( equed, 'c' ) ) {
|
||||
if( LAPACKE_s_nancheck( n, c, 1 ) ) {
|
||||
return -14;
|
||||
}
|
||||
}
|
||||
if( nparams>0 ) {
|
||||
if( LAPACKE_s_nancheck( nparams, params, 1 ) ) {
|
||||
return -25;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( equed, 'b' ) || LAPACKE_lsame( equed, 'r' ) ) {
|
||||
if( LAPACKE_s_nancheck( n, r, 1 ) ) {
|
||||
return -13;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, x, ldx ) ) {
|
||||
return -17;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgbrfsx_work( matrix_layout, trans, equed, n, kl, ku, nrhs,
|
||||
ab, ldab, afb, ldafb, ipiv, r, c, b, ldb, x,
|
||||
ldx, rcond, berr, n_err_bnds, err_bnds_norm,
|
||||
err_bnds_comp, nparams, params, work, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfsx", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
174
lapack-netlib/LAPACKE/src/lapacke_cgbrfsx_work.c
Normal file
174
lapack-netlib/LAPACKE/src/lapacke_cgbrfsx_work.c
Normal file
@@ -0,0 +1,174 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbrfsx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbrfsx_work( int matrix_layout, char trans, char equed,
|
||||
lapack_int n, lapack_int kl, lapack_int ku,
|
||||
lapack_int nrhs,
|
||||
const lapack_complex_float* ab,
|
||||
lapack_int ldab,
|
||||
const lapack_complex_float* afb,
|
||||
lapack_int ldafb, const lapack_int* ipiv,
|
||||
const float* r, const float* c,
|
||||
const lapack_complex_float* b, lapack_int ldb,
|
||||
lapack_complex_float* x, lapack_int ldx,
|
||||
float* rcond, float* berr,
|
||||
lapack_int n_err_bnds, float* err_bnds_norm,
|
||||
float* err_bnds_comp, lapack_int nparams,
|
||||
float* params, lapack_complex_float* work,
|
||||
float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbrfsx( &trans, &equed, &n, &kl, &ku, &nrhs, ab, &ldab, afb,
|
||||
&ldafb, ipiv, r, c, b, &ldb, x, &ldx, rcond, berr,
|
||||
&n_err_bnds, err_bnds_norm, err_bnds_comp, &nparams,
|
||||
params, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,kl+ku+1);
|
||||
lapack_int ldafb_t = MAX(1,2*kl+ku+1);
|
||||
lapack_int ldb_t = MAX(1,n);
|
||||
lapack_int ldx_t = MAX(1,n);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
lapack_complex_float* afb_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
lapack_complex_float* x_t = NULL;
|
||||
float* err_bnds_norm_t = NULL;
|
||||
float* err_bnds_comp_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -9;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldafb < n ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -16;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldx < nrhs ) {
|
||||
info = -18;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
afb_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldafb_t * MAX(1,n) );
|
||||
if( afb_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
x_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldx_t * MAX(1,nrhs) );
|
||||
if( x_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_3;
|
||||
}
|
||||
err_bnds_norm_t = (float*)
|
||||
LAPACKE_malloc( sizeof(float) * nrhs * MAX(1,n_err_bnds) );
|
||||
if( err_bnds_norm_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_4;
|
||||
}
|
||||
err_bnds_comp_t = (float*)
|
||||
LAPACKE_malloc( sizeof(float) * nrhs * MAX(1,n_err_bnds) );
|
||||
if( err_bnds_comp_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_5;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
|
||||
ldafb_t );
|
||||
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
|
||||
LAPACKE_cge_trans( matrix_layout, n, nrhs, x, ldx, x_t, ldx_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbrfsx( &trans, &equed, &n, &kl, &ku, &nrhs, ab_t, &ldab_t,
|
||||
afb_t, &ldafb_t, ipiv, r, c, b_t, &ldb_t, x_t, &ldx_t,
|
||||
rcond, berr, &n_err_bnds, err_bnds_norm_t,
|
||||
err_bnds_comp_t, &nparams, params, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
|
||||
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_norm_t,
|
||||
nrhs, err_bnds_norm, nrhs );
|
||||
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_comp_t,
|
||||
nrhs, err_bnds_comp, nrhs );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( err_bnds_comp_t );
|
||||
exit_level_5:
|
||||
LAPACKE_free( err_bnds_norm_t );
|
||||
exit_level_4:
|
||||
LAPACKE_free( x_t );
|
||||
exit_level_3:
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_2:
|
||||
LAPACKE_free( afb_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbrfsx_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
57
lapack-netlib/LAPACKE/src/lapacke_cgbsv.c
Normal file
57
lapack-netlib/LAPACKE/src/lapacke_cgbsv.c
Normal file
@@ -0,0 +1,57 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbsv
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbsv( int matrix_layout, lapack_int n, lapack_int kl,
|
||||
lapack_int ku, lapack_int nrhs,
|
||||
lapack_complex_float* ab, lapack_int ldab,
|
||||
lapack_int* ipiv, lapack_complex_float* b,
|
||||
lapack_int ldb )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsv", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
|
||||
return -6;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
|
||||
return -9;
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgbsv_work( matrix_layout, n, kl, ku, nrhs, ab, ldab, ipiv, b,
|
||||
ldb );
|
||||
}
|
||||
106
lapack-netlib/LAPACKE/src/lapacke_cgbsv_work.c
Normal file
106
lapack-netlib/LAPACKE/src/lapacke_cgbsv_work.c
Normal file
@@ -0,0 +1,106 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbsv
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbsv_work( int matrix_layout, lapack_int n, lapack_int kl,
|
||||
lapack_int ku, lapack_int nrhs,
|
||||
lapack_complex_float* ab, lapack_int ldab,
|
||||
lapack_int* ipiv, lapack_complex_float* b,
|
||||
lapack_int ldb )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbsv( &n, &kl, &ku, &nrhs, ab, &ldab, ipiv, b, &ldb, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,2*kl+ku+1);
|
||||
lapack_int ldb_t = MAX(1,n);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -7;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsv_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -10;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsv_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
|
||||
ldab_t );
|
||||
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbsv( &n, &kl, &ku, &nrhs, ab_t, &ldab_t, ipiv, b_t, &ldb_t,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, kl+ku, ab_t, ldab_t, ab,
|
||||
ldab );
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsv_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsv_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
107
lapack-netlib/LAPACKE/src/lapacke_cgbsvx.c
Normal file
107
lapack-netlib/LAPACKE/src/lapacke_cgbsvx.c
Normal file
@@ -0,0 +1,107 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbsvx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbsvx( int matrix_layout, char fact, char trans,
|
||||
lapack_int n, lapack_int kl, lapack_int ku,
|
||||
lapack_int nrhs, lapack_complex_float* ab,
|
||||
lapack_int ldab, lapack_complex_float* afb,
|
||||
lapack_int ldafb, lapack_int* ipiv, char* equed,
|
||||
float* r, float* c, lapack_complex_float* b,
|
||||
lapack_int ldb, lapack_complex_float* x,
|
||||
lapack_int ldx, float* rcond, float* ferr,
|
||||
float* berr, float* rpivot )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvx", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
|
||||
return -8;
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'f' ) ) {
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb,
|
||||
ldafb ) ) {
|
||||
return -10;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
|
||||
return -16;
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
|
||||
LAPACKE_lsame( *equed, 'c' ) ) ) {
|
||||
if( LAPACKE_s_nancheck( n, c, 1 ) ) {
|
||||
return -15;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
|
||||
LAPACKE_lsame( *equed, 'r' ) ) ) {
|
||||
if( LAPACKE_s_nancheck( n, r, 1 ) ) {
|
||||
return -14;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgbsvx_work( matrix_layout, fact, trans, n, kl, ku, nrhs, ab,
|
||||
ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x,
|
||||
ldx, rcond, ferr, berr, work, rwork );
|
||||
/* Backup significant data from working array(s) */
|
||||
*rpivot = rwork[0];
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvx", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
159
lapack-netlib/LAPACKE/src/lapacke_cgbsvx_work.c
Normal file
159
lapack-netlib/LAPACKE/src/lapacke_cgbsvx_work.c
Normal file
@@ -0,0 +1,159 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbsvx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbsvx_work( int matrix_layout, char fact, char trans,
|
||||
lapack_int n, lapack_int kl, lapack_int ku,
|
||||
lapack_int nrhs, lapack_complex_float* ab,
|
||||
lapack_int ldab, lapack_complex_float* afb,
|
||||
lapack_int ldafb, lapack_int* ipiv, char* equed,
|
||||
float* r, float* c, lapack_complex_float* b,
|
||||
lapack_int ldb, lapack_complex_float* x,
|
||||
lapack_int ldx, float* rcond, float* ferr,
|
||||
float* berr, lapack_complex_float* work,
|
||||
float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbsvx( &fact, &trans, &n, &kl, &ku, &nrhs, ab, &ldab, afb,
|
||||
&ldafb, ipiv, equed, r, c, b, &ldb, x, &ldx, rcond, ferr,
|
||||
berr, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,kl+ku+1);
|
||||
lapack_int ldafb_t = MAX(1,2*kl+ku+1);
|
||||
lapack_int ldb_t = MAX(1,n);
|
||||
lapack_int ldx_t = MAX(1,n);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
lapack_complex_float* afb_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
lapack_complex_float* x_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -9;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldafb < n ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -17;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldx < nrhs ) {
|
||||
info = -19;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
afb_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldafb_t * MAX(1,n) );
|
||||
if( afb_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
x_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldx_t * MAX(1,nrhs) );
|
||||
if( x_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_3;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
|
||||
if( LAPACKE_lsame( fact, 'f' ) ) {
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
|
||||
ldafb_t );
|
||||
}
|
||||
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbsvx( &fact, &trans, &n, &kl, &ku, &nrhs, ab_t, &ldab_t, afb_t,
|
||||
&ldafb_t, ipiv, equed, r, c, b_t, &ldb_t, x_t, &ldx_t,
|
||||
rcond, ferr, berr, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
if( LAPACKE_lsame( fact, 'e' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
|
||||
LAPACKE_lsame( *equed, 'c' ) || LAPACKE_lsame( *equed, 'r' ) ) ) {
|
||||
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, ku, ab_t, ldab_t, ab,
|
||||
ldab );
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'e' ) || LAPACKE_lsame( fact, 'n' ) ) {
|
||||
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, kl+ku, afb_t,
|
||||
ldafb_t, afb, ldafb );
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
|
||||
LAPACKE_lsame( *equed, 'c' ) || LAPACKE_lsame( *equed, 'r' ) ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
|
||||
}
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( x_t );
|
||||
exit_level_3:
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_2:
|
||||
LAPACKE_free( afb_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvx_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
114
lapack-netlib/LAPACKE/src/lapacke_cgbsvxx.c
Normal file
114
lapack-netlib/LAPACKE/src/lapacke_cgbsvxx.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbsvxx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbsvxx( int matrix_layout, char fact, char trans,
|
||||
lapack_int n, lapack_int kl, lapack_int ku,
|
||||
lapack_int nrhs, lapack_complex_float* ab,
|
||||
lapack_int ldab, lapack_complex_float* afb,
|
||||
lapack_int ldafb, lapack_int* ipiv, char* equed,
|
||||
float* r, float* c, lapack_complex_float* b,
|
||||
lapack_int ldb, lapack_complex_float* x,
|
||||
lapack_int ldx, float* rcond, float* rpvgrw,
|
||||
float* berr, lapack_int n_err_bnds,
|
||||
float* err_bnds_norm, float* err_bnds_comp,
|
||||
lapack_int nparams, float* params )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvxx", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, ku, ab, ldab ) ) {
|
||||
return -8;
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'f' ) ) {
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, afb,
|
||||
ldafb ) ) {
|
||||
return -10;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
|
||||
return -16;
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
|
||||
LAPACKE_lsame( *equed, 'c' ) ) ) {
|
||||
if( LAPACKE_s_nancheck( n, c, 1 ) ) {
|
||||
return -15;
|
||||
}
|
||||
}
|
||||
if( nparams>0 ) {
|
||||
if( LAPACKE_s_nancheck( nparams, params, 1 ) ) {
|
||||
return -27;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
|
||||
LAPACKE_lsame( *equed, 'r' ) ) ) {
|
||||
if( LAPACKE_s_nancheck( n, r, 1 ) ) {
|
||||
return -14;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgbsvxx_work( matrix_layout, fact, trans, n, kl, ku, nrhs, ab,
|
||||
ldab, afb, ldafb, ipiv, equed, r, c, b, ldb, x,
|
||||
ldx, rcond, rpvgrw, berr, n_err_bnds,
|
||||
err_bnds_norm, err_bnds_comp, nparams, params,
|
||||
work, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvxx", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
187
lapack-netlib/LAPACKE/src/lapacke_cgbsvxx_work.c
Normal file
187
lapack-netlib/LAPACKE/src/lapacke_cgbsvxx_work.c
Normal file
@@ -0,0 +1,187 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbsvxx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbsvxx_work( int matrix_layout, char fact, char trans,
|
||||
lapack_int n, lapack_int kl, lapack_int ku,
|
||||
lapack_int nrhs, lapack_complex_float* ab,
|
||||
lapack_int ldab, lapack_complex_float* afb,
|
||||
lapack_int ldafb, lapack_int* ipiv,
|
||||
char* equed, float* r, float* c,
|
||||
lapack_complex_float* b, lapack_int ldb,
|
||||
lapack_complex_float* x, lapack_int ldx,
|
||||
float* rcond, float* rpvgrw, float* berr,
|
||||
lapack_int n_err_bnds, float* err_bnds_norm,
|
||||
float* err_bnds_comp, lapack_int nparams,
|
||||
float* params, lapack_complex_float* work,
|
||||
float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbsvxx( &fact, &trans, &n, &kl, &ku, &nrhs, ab, &ldab, afb,
|
||||
&ldafb, ipiv, equed, r, c, b, &ldb, x, &ldx, rcond,
|
||||
rpvgrw, berr, &n_err_bnds, err_bnds_norm, err_bnds_comp,
|
||||
&nparams, params, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,kl+ku+1);
|
||||
lapack_int ldafb_t = MAX(1,2*kl+ku+1);
|
||||
lapack_int ldb_t = MAX(1,n);
|
||||
lapack_int ldx_t = MAX(1,n);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
lapack_complex_float* afb_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
lapack_complex_float* x_t = NULL;
|
||||
float* err_bnds_norm_t = NULL;
|
||||
float* err_bnds_comp_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -9;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldafb < n ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -17;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldx < nrhs ) {
|
||||
info = -19;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
afb_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldafb_t * MAX(1,n) );
|
||||
if( afb_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
x_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldx_t * MAX(1,nrhs) );
|
||||
if( x_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_3;
|
||||
}
|
||||
err_bnds_norm_t = (float*)
|
||||
LAPACKE_malloc( sizeof(float) * nrhs * MAX(1,n_err_bnds) );
|
||||
if( err_bnds_norm_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_4;
|
||||
}
|
||||
err_bnds_comp_t = (float*)
|
||||
LAPACKE_malloc( sizeof(float) * nrhs * MAX(1,n_err_bnds) );
|
||||
if( err_bnds_comp_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_5;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, ku, ab, ldab, ab_t, ldab_t );
|
||||
if( LAPACKE_lsame( fact, 'f' ) ) {
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, afb, ldafb, afb_t,
|
||||
ldafb_t );
|
||||
}
|
||||
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbsvxx( &fact, &trans, &n, &kl, &ku, &nrhs, ab_t, &ldab_t,
|
||||
afb_t, &ldafb_t, ipiv, equed, r, c, b_t, &ldb_t, x_t,
|
||||
&ldx_t, rcond, rpvgrw, berr, &n_err_bnds,
|
||||
err_bnds_norm_t, err_bnds_comp_t, &nparams, params,
|
||||
work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
if( LAPACKE_lsame( fact, 'e' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
|
||||
LAPACKE_lsame( *equed, 'c' ) || LAPACKE_lsame( *equed, 'r' ) ) ) {
|
||||
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, ku, ab_t, ldab_t, ab,
|
||||
ldab );
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'e' ) || LAPACKE_lsame( fact, 'n' ) ) {
|
||||
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, n, n, kl, kl+ku, afb_t,
|
||||
ldafb_t, afb, ldafb );
|
||||
}
|
||||
if( LAPACKE_lsame( fact, 'f' ) && ( LAPACKE_lsame( *equed, 'b' ) ||
|
||||
LAPACKE_lsame( *equed, 'c' ) || LAPACKE_lsame( *equed, 'r' ) ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
|
||||
}
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, x_t, ldx_t, x, ldx );
|
||||
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_norm_t,
|
||||
nrhs, err_bnds_norm, n_err_bnds );
|
||||
LAPACKE_sge_trans( LAPACK_COL_MAJOR, nrhs, n_err_bnds, err_bnds_comp_t,
|
||||
nrhs, err_bnds_comp, n_err_bnds );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( err_bnds_comp_t );
|
||||
exit_level_5:
|
||||
LAPACKE_free( err_bnds_norm_t );
|
||||
exit_level_4:
|
||||
LAPACKE_free( x_t );
|
||||
exit_level_3:
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_2:
|
||||
LAPACKE_free( afb_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbsvxx_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
52
lapack-netlib/LAPACKE/src/lapacke_cgbtrf.c
Normal file
52
lapack-netlib/LAPACKE/src/lapacke_cgbtrf.c
Normal file
@@ -0,0 +1,52 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbtrf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbtrf( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
lapack_complex_float* ab, lapack_int ldab,
|
||||
lapack_int* ipiv )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrf", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, m, n, kl, kl+ku, ab, ldab ) ) {
|
||||
return -6;
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgbtrf_work( matrix_layout, m, n, kl, ku, ab, ldab, ipiv );
|
||||
}
|
||||
86
lapack-netlib/LAPACKE/src/lapacke_cgbtrf_work.c
Normal file
86
lapack-netlib/LAPACKE/src/lapacke_cgbtrf_work.c
Normal file
@@ -0,0 +1,86 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbtrf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbtrf_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int kl, lapack_int ku,
|
||||
lapack_complex_float* ab, lapack_int ldab,
|
||||
lapack_int* ipiv )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbtrf( &m, &n, &kl, &ku, ab, &ldab, ipiv, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,2*kl+ku+1);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -7;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrf_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, m, n, kl, kl+ku, ab, ldab, ab_t,
|
||||
ldab_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbtrf( &m, &n, &kl, &ku, ab_t, &ldab_t, ipiv, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cgb_trans( LAPACK_COL_MAJOR, m, n, kl, kl+ku, ab_t, ldab_t, ab,
|
||||
ldab );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrf_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrf_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
57
lapack-netlib/LAPACKE/src/lapacke_cgbtrs.c
Normal file
57
lapack-netlib/LAPACKE/src/lapacke_cgbtrs.c
Normal file
@@ -0,0 +1,57 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgbtrs
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbtrs( int matrix_layout, char trans, lapack_int n,
|
||||
lapack_int kl, lapack_int ku, lapack_int nrhs,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
const lapack_int* ipiv, lapack_complex_float* b,
|
||||
lapack_int ldb )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrs", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cgb_nancheck( matrix_layout, n, n, kl, kl+ku, ab, ldab ) ) {
|
||||
return -7;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, nrhs, b, ldb ) ) {
|
||||
return -10;
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgbtrs_work( matrix_layout, trans, n, kl, ku, nrhs, ab, ldab,
|
||||
ipiv, b, ldb );
|
||||
}
|
||||
105
lapack-netlib/LAPACKE/src/lapacke_cgbtrs_work.c
Normal file
105
lapack-netlib/LAPACKE/src/lapacke_cgbtrs_work.c
Normal file
@@ -0,0 +1,105 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgbtrs
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgbtrs_work( int matrix_layout, char trans, lapack_int n,
|
||||
lapack_int kl, lapack_int ku, lapack_int nrhs,
|
||||
const lapack_complex_float* ab, lapack_int ldab,
|
||||
const lapack_int* ipiv, lapack_complex_float* b,
|
||||
lapack_int ldb )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbtrs( &trans, &n, &kl, &ku, &nrhs, ab, &ldab, ipiv, b, &ldb,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldab_t = MAX(1,2*kl+ku+1);
|
||||
lapack_int ldb_t = MAX(1,n);
|
||||
lapack_complex_float* ab_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldab < n ) {
|
||||
info = -8;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrs_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrs_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
ab_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldab_t * MAX(1,n) );
|
||||
if( ab_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cgb_trans( matrix_layout, n, n, kl, kl+ku, ab, ldab, ab_t,
|
||||
ldab_t );
|
||||
LAPACKE_cge_trans( matrix_layout, n, nrhs, b, ldb, b_t, ldb_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgbtrs( &trans, &n, &kl, &ku, &nrhs, ab_t, &ldab_t, ipiv, b_t,
|
||||
&ldb_t, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, nrhs, b_t, ldb_t, b, ldb );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( ab_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrs_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgbtrs_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
56
lapack-netlib/LAPACKE/src/lapacke_cgebak.c
Normal file
56
lapack-netlib/LAPACKE/src/lapacke_cgebak.c
Normal file
@@ -0,0 +1,56 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgebak
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgebak( int matrix_layout, char job, char side, lapack_int n,
|
||||
lapack_int ilo, lapack_int ihi, const float* scale,
|
||||
lapack_int m, lapack_complex_float* v,
|
||||
lapack_int ldv )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgebak", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_s_nancheck( n, scale, 1 ) ) {
|
||||
return -7;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, m, v, ldv ) ) {
|
||||
return -9;
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgebak_work( matrix_layout, job, side, n, ilo, ihi, scale, m,
|
||||
v, ldv );
|
||||
}
|
||||
85
lapack-netlib/LAPACKE/src/lapacke_cgebak_work.c
Normal file
85
lapack-netlib/LAPACKE/src/lapacke_cgebak_work.c
Normal file
@@ -0,0 +1,85 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgebak
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgebak_work( int matrix_layout, char job, char side,
|
||||
lapack_int n, lapack_int ilo, lapack_int ihi,
|
||||
const float* scale, lapack_int m,
|
||||
lapack_complex_float* v, lapack_int ldv )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgebak( &job, &side, &n, &ilo, &ihi, scale, &m, v, &ldv, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldv_t = MAX(1,n);
|
||||
lapack_complex_float* v_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldv < m ) {
|
||||
info = -10;
|
||||
LAPACKE_xerbla( "LAPACKE_cgebak_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
v_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldv_t * MAX(1,m) );
|
||||
if( v_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, n, m, v, ldv, v_t, ldv_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgebak( &job, &side, &n, &ilo, &ihi, scale, &m, v_t, &ldv_t,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, m, v_t, ldv_t, v, ldv );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( v_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgebak_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgebak_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
54
lapack-netlib/LAPACKE/src/lapacke_cgebal.c
Normal file
54
lapack-netlib/LAPACKE/src/lapacke_cgebal.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgebal
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgebal( int matrix_layout, char job, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* ilo, lapack_int* ihi, float* scale )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgebal", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
|
||||
LAPACKE_lsame( job, 's' ) ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgebal_work( matrix_layout, job, n, a, lda, ilo, ihi, scale );
|
||||
}
|
||||
96
lapack-netlib/LAPACKE/src/lapacke_cgebal_work.c
Normal file
96
lapack-netlib/LAPACKE/src/lapacke_cgebal_work.c
Normal file
@@ -0,0 +1,96 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgebal
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgebal_work( int matrix_layout, char job, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* ilo, lapack_int* ihi, float* scale )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgebal( &job, &n, a, &lda, ilo, ihi, scale, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,n);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgebal_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
|
||||
LAPACKE_lsame( job, 's' ) ) {
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
|
||||
LAPACKE_lsame( job, 's' ) ) {
|
||||
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
|
||||
}
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgebal( &job, &n, a_t, &lda_t, ilo, ihi, scale, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
|
||||
LAPACKE_lsame( job, 's' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'p' ) ||
|
||||
LAPACKE_lsame( job, 's' ) ) {
|
||||
LAPACKE_free( a_t );
|
||||
}
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgebal_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgebal_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
79
lapack-netlib/LAPACKE/src/lapacke_cgebrd.c
Normal file
79
lapack-netlib/LAPACKE/src/lapacke_cgebrd.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgebrd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgebrd( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda, float* d,
|
||||
float* e, lapack_complex_float* tauq,
|
||||
lapack_complex_float* taup )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgebrd", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgebrd_work( matrix_layout, m, n, a, lda, d, e, tauq, taup,
|
||||
&work_query, lwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_0;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgebrd_work( matrix_layout, m, n, a, lda, d, e, tauq, taup,
|
||||
work, lwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgebrd", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
92
lapack-netlib/LAPACKE/src/lapacke_cgebrd_work.c
Normal file
92
lapack-netlib/LAPACKE/src/lapacke_cgebrd_work.c
Normal file
@@ -0,0 +1,92 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgebrd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgebrd_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
float* d, float* e, lapack_complex_float* tauq,
|
||||
lapack_complex_float* taup,
|
||||
lapack_complex_float* work, lapack_int lwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgebrd( &m, &n, a, &lda, d, e, tauq, taup, work, &lwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgebrd_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgebrd( &m, &n, a, &lda_t, d, e, tauq, taup, work, &lwork,
|
||||
&info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgebrd( &m, &n, a_t, &lda_t, d, e, tauq, taup, work, &lwork,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgebrd_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgebrd_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
80
lapack-netlib/LAPACKE/src/lapacke_cgecon.c
Normal file
80
lapack-netlib/LAPACKE/src/lapacke_cgecon.c
Normal file
@@ -0,0 +1,80 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgecon
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgecon( int matrix_layout, char norm, lapack_int n,
|
||||
const lapack_complex_float* a, lapack_int lda,
|
||||
float anorm, float* rcond )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgecon", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
if( LAPACKE_s_nancheck( 1, &anorm, 1 ) ) {
|
||||
return -6;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,2*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,2*n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgecon_work( matrix_layout, norm, n, a, lda, anorm, rcond,
|
||||
work, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgecon", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
83
lapack-netlib/LAPACKE/src/lapacke_cgecon_work.c
Normal file
83
lapack-netlib/LAPACKE/src/lapacke_cgecon_work.c
Normal file
@@ -0,0 +1,83 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgecon
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgecon_work( int matrix_layout, char norm, lapack_int n,
|
||||
const lapack_complex_float* a, lapack_int lda,
|
||||
float anorm, float* rcond,
|
||||
lapack_complex_float* work, float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgecon( &norm, &n, a, &lda, &anorm, rcond, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,n);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgecon_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgecon( &norm, &n, a_t, &lda_t, &anorm, rcond, work, rwork,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgecon_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgecon_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
53
lapack-netlib/LAPACKE/src/lapacke_cgeequ.c
Normal file
53
lapack-netlib/LAPACKE/src/lapacke_cgeequ.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeequ
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeequ( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const lapack_complex_float* a, lapack_int lda,
|
||||
float* r, float* c, float* rowcnd, float* colcnd,
|
||||
float* amax )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeequ", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgeequ_work( matrix_layout, m, n, a, lda, r, c, rowcnd,
|
||||
colcnd, amax );
|
||||
}
|
||||
82
lapack-netlib/LAPACKE/src/lapacke_cgeequ_work.c
Normal file
82
lapack-netlib/LAPACKE/src/lapacke_cgeequ_work.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeequ
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeequ_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const lapack_complex_float* a, lapack_int lda,
|
||||
float* r, float* c, float* rowcnd,
|
||||
float* colcnd, float* amax )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeequ( &m, &n, a, &lda, r, c, rowcnd, colcnd, amax, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeequ_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeequ( &m, &n, a_t, &lda_t, r, c, rowcnd, colcnd, amax, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeequ_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeequ_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
53
lapack-netlib/LAPACKE/src/lapacke_cgeequb.c
Normal file
53
lapack-netlib/LAPACKE/src/lapacke_cgeequb.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeequb
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeequb( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const lapack_complex_float* a, lapack_int lda,
|
||||
float* r, float* c, float* rowcnd, float* colcnd,
|
||||
float* amax )
|
||||
{
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeequb", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
return LAPACKE_cgeequb_work( matrix_layout, m, n, a, lda, r, c, rowcnd,
|
||||
colcnd, amax );
|
||||
}
|
||||
83
lapack-netlib/LAPACKE/src/lapacke_cgeequb_work.c
Normal file
83
lapack-netlib/LAPACKE/src/lapacke_cgeequb_work.c
Normal file
@@ -0,0 +1,83 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeequb
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeequb_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
const lapack_complex_float* a, lapack_int lda,
|
||||
float* r, float* c, float* rowcnd,
|
||||
float* colcnd, float* amax )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeequb( &m, &n, a, &lda, r, c, rowcnd, colcnd, amax, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeequb_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeequb( &m, &n, a_t, &lda_t, r, c, rowcnd, colcnd, amax,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeequb_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeequb_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
103
lapack-netlib/LAPACKE/src/lapacke_cgees.c
Normal file
103
lapack-netlib/LAPACKE/src/lapacke_cgees.c
Normal file
@@ -0,0 +1,103 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgees
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgees( int matrix_layout, char jobvs, char sort,
|
||||
LAPACK_C_SELECT1 select, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* sdim, lapack_complex_float* w,
|
||||
lapack_complex_float* vs, lapack_int ldvs )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
lapack_logical* bwork = NULL;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgees", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
|
||||
return -6;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
if( LAPACKE_lsame( sort, 's' ) ) {
|
||||
bwork = (lapack_logical*)
|
||||
LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
|
||||
if( bwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
}
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
|
||||
sdim, w, vs, ldvs, &work_query, lwork, rwork,
|
||||
bwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_2;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgees_work( matrix_layout, jobvs, sort, select, n, a, lda,
|
||||
sdim, w, vs, ldvs, work, lwork, rwork, bwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_2:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_1:
|
||||
if( LAPACKE_lsame( sort, 's' ) ) {
|
||||
LAPACKE_free( bwork );
|
||||
}
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgees", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
118
lapack-netlib/LAPACKE/src/lapacke_cgees_work.c
Normal file
118
lapack-netlib/LAPACKE/src/lapacke_cgees_work.c
Normal file
@@ -0,0 +1,118 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgees
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgees_work( int matrix_layout, char jobvs, char sort,
|
||||
LAPACK_C_SELECT1 select, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* sdim, lapack_complex_float* w,
|
||||
lapack_complex_float* vs, lapack_int ldvs,
|
||||
lapack_complex_float* work, lapack_int lwork,
|
||||
float* rwork, lapack_logical* bwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgees( &jobvs, &sort, select, &n, a, &lda, sdim, w, vs, &ldvs,
|
||||
work, &lwork, rwork, bwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,n);
|
||||
lapack_int ldvs_t = MAX(1,n);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* vs_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -7;
|
||||
LAPACKE_xerbla( "LAPACKE_cgees_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldvs < n ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgees_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgees( &jobvs, &sort, select, &n, a, &lda_t, sdim, w, vs,
|
||||
&ldvs_t, work, &lwork, rwork, bwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
if( LAPACKE_lsame( jobvs, 'v' ) ) {
|
||||
vs_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldvs_t * MAX(1,n) );
|
||||
if( vs_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgees( &jobvs, &sort, select, &n, a_t, &lda_t, sdim, w, vs_t,
|
||||
&ldvs_t, work, &lwork, rwork, bwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
|
||||
if( LAPACKE_lsame( jobvs, 'v' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vs_t, ldvs_t, vs, ldvs );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( LAPACKE_lsame( jobvs, 'v' ) ) {
|
||||
LAPACKE_free( vs_t );
|
||||
}
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgees_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgees_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
105
lapack-netlib/LAPACKE/src/lapacke_cgeesx.c
Normal file
105
lapack-netlib/LAPACKE/src/lapacke_cgeesx.c
Normal file
@@ -0,0 +1,105 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeesx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeesx( int matrix_layout, char jobvs, char sort,
|
||||
LAPACK_C_SELECT1 select, char sense, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* sdim, lapack_complex_float* w,
|
||||
lapack_complex_float* vs, lapack_int ldvs,
|
||||
float* rconde, float* rcondv )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
lapack_logical* bwork = NULL;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeesx", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
|
||||
return -7;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
if( LAPACKE_lsame( sort, 's' ) ) {
|
||||
bwork = (lapack_logical*)
|
||||
LAPACKE_malloc( sizeof(lapack_logical) * MAX(1,n) );
|
||||
if( bwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
}
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgeesx_work( matrix_layout, jobvs, sort, select, sense, n, a,
|
||||
lda, sdim, w, vs, ldvs, rconde, rcondv,
|
||||
&work_query, lwork, rwork, bwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_2;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgeesx_work( matrix_layout, jobvs, sort, select, sense, n, a,
|
||||
lda, sdim, w, vs, ldvs, rconde, rcondv, work,
|
||||
lwork, rwork, bwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_2:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_1:
|
||||
if( LAPACKE_lsame( sort, 's' ) ) {
|
||||
LAPACKE_free( bwork );
|
||||
}
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeesx", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
123
lapack-netlib/LAPACKE/src/lapacke_cgeesx_work.c
Normal file
123
lapack-netlib/LAPACKE/src/lapacke_cgeesx_work.c
Normal file
@@ -0,0 +1,123 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeesx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeesx_work( int matrix_layout, char jobvs, char sort,
|
||||
LAPACK_C_SELECT1 select, char sense,
|
||||
lapack_int n, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_int* sdim,
|
||||
lapack_complex_float* w,
|
||||
lapack_complex_float* vs, lapack_int ldvs,
|
||||
float* rconde, float* rcondv,
|
||||
lapack_complex_float* work, lapack_int lwork,
|
||||
float* rwork, lapack_logical* bwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeesx( &jobvs, &sort, select, &sense, &n, a, &lda, sdim, w, vs,
|
||||
&ldvs, rconde, rcondv, work, &lwork, rwork, bwork,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,n);
|
||||
lapack_int ldvs_t = MAX(1,n);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* vs_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -8;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldvs < n ) {
|
||||
info = -12;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgeesx( &jobvs, &sort, select, &sense, &n, a, &lda_t, sdim,
|
||||
w, vs, &ldvs_t, rconde, rcondv, work, &lwork, rwork,
|
||||
bwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
if( LAPACKE_lsame( jobvs, 'v' ) ) {
|
||||
vs_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldvs_t * MAX(1,n) );
|
||||
if( vs_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeesx( &jobvs, &sort, select, &sense, &n, a_t, &lda_t, sdim, w,
|
||||
vs_t, &ldvs_t, rconde, rcondv, work, &lwork, rwork,
|
||||
bwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
|
||||
if( LAPACKE_lsame( jobvs, 'v' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vs_t, ldvs_t, vs, ldvs );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( LAPACKE_lsame( jobvs, 'v' ) ) {
|
||||
LAPACKE_free( vs_t );
|
||||
}
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeesx_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
89
lapack-netlib/LAPACKE/src/lapacke_cgeev.c
Normal file
89
lapack-netlib/LAPACKE/src/lapacke_cgeev.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeev
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeev( int matrix_layout, char jobvl, char jobvr,
|
||||
lapack_int n, lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* w, lapack_complex_float* vl,
|
||||
lapack_int ldvl, lapack_complex_float* vr,
|
||||
lapack_int ldvr )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeev", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
|
||||
return -5;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,2*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgeev_work( matrix_layout, jobvl, jobvr, n, a, lda, w, vl,
|
||||
ldvl, vr, ldvr, &work_query, lwork, rwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_1;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgeev_work( matrix_layout, jobvl, jobvr, n, a, lda, w, vl,
|
||||
ldvl, vr, ldvr, work, lwork, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeev", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
141
lapack-netlib/LAPACKE/src/lapacke_cgeev_work.c
Normal file
141
lapack-netlib/LAPACKE/src/lapacke_cgeev_work.c
Normal file
@@ -0,0 +1,141 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeev
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeev_work( int matrix_layout, char jobvl, char jobvr,
|
||||
lapack_int n, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* w,
|
||||
lapack_complex_float* vl, lapack_int ldvl,
|
||||
lapack_complex_float* vr, lapack_int ldvr,
|
||||
lapack_complex_float* work, lapack_int lwork,
|
||||
float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeev( &jobvl, &jobvr, &n, a, &lda, w, vl, &ldvl, vr, &ldvr,
|
||||
work, &lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,n);
|
||||
lapack_int ldvl_t = MAX(1,n);
|
||||
lapack_int ldvr_t = MAX(1,n);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* vl_t = NULL;
|
||||
lapack_complex_float* vr_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -6;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldvl < n ) {
|
||||
info = -9;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldvr < n ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgeev( &jobvl, &jobvr, &n, a, &lda_t, w, vl, &ldvl_t, vr,
|
||||
&ldvr_t, work, &lwork, rwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
if( LAPACKE_lsame( jobvl, 'v' ) ) {
|
||||
vl_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldvl_t * MAX(1,n) );
|
||||
if( vl_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobvr, 'v' ) ) {
|
||||
vr_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldvr_t * MAX(1,n) );
|
||||
if( vr_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeev( &jobvl, &jobvr, &n, a_t, &lda_t, w, vl_t, &ldvl_t, vr_t,
|
||||
&ldvr_t, work, &lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
|
||||
if( LAPACKE_lsame( jobvl, 'v' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vl_t, ldvl_t, vl, ldvl );
|
||||
}
|
||||
if( LAPACKE_lsame( jobvr, 'v' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vr_t, ldvr_t, vr, ldvr );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( LAPACKE_lsame( jobvr, 'v' ) ) {
|
||||
LAPACKE_free( vr_t );
|
||||
}
|
||||
exit_level_2:
|
||||
if( LAPACKE_lsame( jobvl, 'v' ) ) {
|
||||
LAPACKE_free( vl_t );
|
||||
}
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeev_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
95
lapack-netlib/LAPACKE/src/lapacke_cgeevx.c
Normal file
95
lapack-netlib/LAPACKE/src/lapacke_cgeevx.c
Normal file
@@ -0,0 +1,95 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeevx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeevx( int matrix_layout, char balanc, char jobvl,
|
||||
char jobvr, char sense, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* w, lapack_complex_float* vl,
|
||||
lapack_int ldvl, lapack_complex_float* vr,
|
||||
lapack_int ldvr, lapack_int* ilo, lapack_int* ihi,
|
||||
float* scale, float* abnrm, float* rconde,
|
||||
float* rcondv )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeevx", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
|
||||
return -7;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,2*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgeevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
|
||||
lda, w, vl, ldvl, vr, ldvr, ilo, ihi, scale,
|
||||
abnrm, rconde, rcondv, &work_query, lwork,
|
||||
rwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_1;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgeevx_work( matrix_layout, balanc, jobvl, jobvr, sense, n, a,
|
||||
lda, w, vl, ldvl, vr, ldvr, ilo, ihi, scale,
|
||||
abnrm, rconde, rcondv, work, lwork, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeevx", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
147
lapack-netlib/LAPACKE/src/lapacke_cgeevx_work.c
Normal file
147
lapack-netlib/LAPACKE/src/lapacke_cgeevx_work.c
Normal file
@@ -0,0 +1,147 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeevx
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeevx_work( int matrix_layout, char balanc, char jobvl,
|
||||
char jobvr, char sense, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* w,
|
||||
lapack_complex_float* vl, lapack_int ldvl,
|
||||
lapack_complex_float* vr, lapack_int ldvr,
|
||||
lapack_int* ilo, lapack_int* ihi, float* scale,
|
||||
float* abnrm, float* rconde, float* rcondv,
|
||||
lapack_complex_float* work, lapack_int lwork,
|
||||
float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeevx( &balanc, &jobvl, &jobvr, &sense, &n, a, &lda, w, vl,
|
||||
&ldvl, vr, &ldvr, ilo, ihi, scale, abnrm, rconde, rcondv,
|
||||
work, &lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,n);
|
||||
lapack_int ldvl_t = MAX(1,n);
|
||||
lapack_int ldvr_t = MAX(1,n);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* vl_t = NULL;
|
||||
lapack_complex_float* vr_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -8;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldvl < n ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldvr < n ) {
|
||||
info = -13;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgeevx( &balanc, &jobvl, &jobvr, &sense, &n, a, &lda_t, w,
|
||||
vl, &ldvl_t, vr, &ldvr_t, ilo, ihi, scale, abnrm,
|
||||
rconde, rcondv, work, &lwork, rwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
if( LAPACKE_lsame( jobvl, 'v' ) ) {
|
||||
vl_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldvl_t * MAX(1,n) );
|
||||
if( vl_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobvr, 'v' ) ) {
|
||||
vr_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldvr_t * MAX(1,n) );
|
||||
if( vr_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeevx( &balanc, &jobvl, &jobvr, &sense, &n, a_t, &lda_t, w,
|
||||
vl_t, &ldvl_t, vr_t, &ldvr_t, ilo, ihi, scale, abnrm,
|
||||
rconde, rcondv, work, &lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
|
||||
if( LAPACKE_lsame( jobvl, 'v' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vl_t, ldvl_t, vl, ldvl );
|
||||
}
|
||||
if( LAPACKE_lsame( jobvr, 'v' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, vr_t, ldvr_t, vr, ldvr );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( LAPACKE_lsame( jobvr, 'v' ) ) {
|
||||
LAPACKE_free( vr_t );
|
||||
}
|
||||
exit_level_2:
|
||||
if( LAPACKE_lsame( jobvl, 'v' ) ) {
|
||||
LAPACKE_free( vl_t );
|
||||
}
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeevx_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
78
lapack-netlib/LAPACKE/src/lapacke_cgehrd.c
Normal file
78
lapack-netlib/LAPACKE/src/lapacke_cgehrd.c
Normal file
@@ -0,0 +1,78 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgehrd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgehrd( int matrix_layout, lapack_int n, lapack_int ilo,
|
||||
lapack_int ihi, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* tau )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgehrd", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, n, n, a, lda ) ) {
|
||||
return -5;
|
||||
}
|
||||
#endif
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgehrd_work( matrix_layout, n, ilo, ihi, a, lda, tau,
|
||||
&work_query, lwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_0;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgehrd_work( matrix_layout, n, ilo, ihi, a, lda, tau, work,
|
||||
lwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgehrd", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
90
lapack-netlib/LAPACKE/src/lapacke_cgehrd_work.c
Normal file
90
lapack-netlib/LAPACKE/src/lapacke_cgehrd_work.c
Normal file
@@ -0,0 +1,90 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgehrd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgehrd_work( int matrix_layout, lapack_int n, lapack_int ilo,
|
||||
lapack_int ihi, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* tau,
|
||||
lapack_complex_float* work, lapack_int lwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgehrd( &n, &ilo, &ihi, a, &lda, tau, work, &lwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,n);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -6;
|
||||
LAPACKE_xerbla( "LAPACKE_cgehrd_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgehrd( &n, &ilo, &ihi, a, &lda_t, tau, work, &lwork,
|
||||
&info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, n, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgehrd( &n, &ilo, &ihi, a_t, &lda_t, tau, work, &lwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, n, n, a_t, lda_t, a, lda );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgehrd_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgehrd_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
190
lapack-netlib/LAPACKE/src/lapacke_cgejsv.c
Normal file
190
lapack-netlib/LAPACKE/src/lapacke_cgejsv.c
Normal file
@@ -0,0 +1,190 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgejsv
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgejsv( int matrix_layout, char joba, char jobu, char jobv,
|
||||
char jobr, char jobt, char jobp, lapack_int m,
|
||||
lapack_int n, lapack_complex_float* a, lapack_int lda, float* sva,
|
||||
lapack_complex_float* u, lapack_int ldu, lapack_complex_float* v, lapack_int ldv,
|
||||
float* stat, lapack_int* istat )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = (
|
||||
// 1.1
|
||||
( LAPACKE_lsame( jobu, 'n' ) && LAPACKE_lsame( jobv, 'n' ) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) )) ? 2*n+1 :
|
||||
|
||||
//1.2
|
||||
( ( LAPACKE_lsame( jobu, 'n' ) && LAPACKE_lsame( jobv, 'n' ) &&
|
||||
!( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) )) ? n*n+3*n :
|
||||
|
||||
//2.1
|
||||
( ( ( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
|
||||
!( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 3*n :
|
||||
|
||||
|
||||
//2.2
|
||||
( ( ( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
|
||||
!( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
|
||||
!( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 3*n :
|
||||
|
||||
//3.1
|
||||
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' )) &&
|
||||
!( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' )) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 3*n :
|
||||
|
||||
//3.2
|
||||
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' )) &&
|
||||
!(LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' )) &&
|
||||
!(LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 3*n :
|
||||
|
||||
//4.1
|
||||
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
|
||||
( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 5*n+2*n*n :
|
||||
|
||||
//4.2
|
||||
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
|
||||
( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? 4*n*n:
|
||||
1) ) ) ) ) ) ) );
|
||||
lapack_int lrwork = (
|
||||
// 1.1
|
||||
( LAPACKE_lsame( jobu, 'n' ) && LAPACKE_lsame( jobv, 'n' ) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) )) ? MAX(7,n+2*m) :
|
||||
|
||||
//1.2
|
||||
( ( LAPACKE_lsame( jobu, 'n' ) && LAPACKE_lsame( jobv, 'n' ) &&
|
||||
!( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) )) ? MAX(7,2*n) :
|
||||
|
||||
//2.1
|
||||
( ( ( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
|
||||
!( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
|
||||
|
||||
|
||||
//2.2
|
||||
( ( ( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
|
||||
!( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
|
||||
!( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX(7,2*n) :
|
||||
|
||||
//3.1
|
||||
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' )) &&
|
||||
!( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' )) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
|
||||
|
||||
//3.2
|
||||
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' )) &&
|
||||
!(LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' )) &&
|
||||
!(LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX(7,2*n) :
|
||||
|
||||
//4.1
|
||||
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
|
||||
( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX( 7, n+ 2*m ) :
|
||||
|
||||
//4.2
|
||||
( ( ( LAPACKE_lsame( jobu, 'u' ) || LAPACKE_lsame( jobu, 'f' ) ) &&
|
||||
( LAPACKE_lsame( jobv, 'v' ) || LAPACKE_lsame( jobv, 'j' ) ) &&
|
||||
( LAPACKE_lsame( jobt, 't' ) || LAPACKE_lsame( joba, 'f' ) || LAPACKE_lsame( joba, 'g' ) ))? MAX(7,2*n) :
|
||||
1 ))))))));
|
||||
lapack_int* iwork = NULL;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* cwork = NULL;
|
||||
lapack_int i;
|
||||
lapack_int nu, nv;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgejsv", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
nu = LAPACKE_lsame( jobu, 'n' ) ? 1 : m;
|
||||
nv = LAPACKE_lsame( jobv, 'n' ) ? 1 : n;
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -10;
|
||||
}
|
||||
if( LAPACKE_lsame( jobu, 'f' ) || LAPACKE_lsame( jobu, 'u' ) ||
|
||||
LAPACKE_lsame( jobu, 'w' ) ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, nu, n, u, ldu ) ) {
|
||||
return -13;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobv, 'j' ) || LAPACKE_lsame( jobv, 'v' ) ||
|
||||
LAPACKE_lsame( jobv, 'w' ) ) {
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, nv, n, v, ldv ) ) {
|
||||
return -15;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * MAX(1,m+3*n) );
|
||||
if( iwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
cwork = (lapack_complex_float*)LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( cwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * lrwork );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgejsv_work( matrix_layout, joba, jobu, jobv, jobr, jobt,
|
||||
jobp, m, n, a, lda, sva, u, ldu, v, ldv, cwork,
|
||||
lwork, rwork, lrwork, iwork );
|
||||
/* Backup significant data from working array(s) */
|
||||
for( i=0; i<7; i++ ) {
|
||||
stat[i] = rwork[i];
|
||||
}
|
||||
for( i=0; i<3; i++ ) {
|
||||
istat[i] = iwork[i];
|
||||
}
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( cwork );
|
||||
exit_level_2:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_1:
|
||||
LAPACKE_free( iwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgejsv", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
151
lapack-netlib/LAPACKE/src/lapacke_cgejsv_work.c
Normal file
151
lapack-netlib/LAPACKE/src/lapacke_cgejsv_work.c
Normal file
@@ -0,0 +1,151 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgejsv
|
||||
* Author: Intel Corporation
|
||||
* Generated November, 2011
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgejsv_work( int matrix_layout, char joba, char jobu,
|
||||
char jobv, char jobr, char jobt, char jobp,
|
||||
lapack_int m, lapack_int n, lapack_complex_float* a,
|
||||
lapack_int lda, float* sva, lapack_complex_float* u,
|
||||
lapack_int ldu, lapack_complex_float* v, lapack_int ldv,
|
||||
lapack_complex_float* cwork, lapack_int lwork,
|
||||
float* rwork, lapack_int lrwork,
|
||||
lapack_int* iwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgejsv( &joba, &jobu, &jobv, &jobr, &jobt, &jobp, &m, &n, a,
|
||||
&lda, sva, u, &ldu, v, &ldv, cwork, &lwork, rwork, &lwork,
|
||||
iwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int nu = LAPACKE_lsame( jobu, 'n' ) ? 1 : m;
|
||||
lapack_int nv = LAPACKE_lsame( jobv, 'n' ) ? 1 : n;
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_int ldu_t = MAX(1,nu);
|
||||
lapack_int ldv_t = MAX(1,nv);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* u_t = NULL;
|
||||
lapack_complex_float* v_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldu < n ) {
|
||||
info = -14;
|
||||
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldv < n ) {
|
||||
info = -16;
|
||||
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
if( LAPACKE_lsame( jobu, 'f' ) || LAPACKE_lsame( jobu, 'u' ) ||
|
||||
LAPACKE_lsame( jobu, 'w' ) ) {
|
||||
u_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldu_t * MAX(1,n) );
|
||||
if( u_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
}
|
||||
if( LAPACKE_lsame( jobv, 'j' ) || LAPACKE_lsame( jobv, 'v' ) ||
|
||||
LAPACKE_lsame( jobv, 'w' ) ) {
|
||||
v_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldv_t * MAX(1,n) );
|
||||
if( v_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
if( LAPACKE_lsame( jobu, 'f' ) || LAPACKE_lsame( jobu, 'u' ) ||
|
||||
LAPACKE_lsame( jobu, 'w' ) ) {
|
||||
LAPACKE_cge_trans( matrix_layout, nu, n, u, ldu, u_t, ldu_t );
|
||||
}
|
||||
if( LAPACKE_lsame( jobv, 'j' ) || LAPACKE_lsame( jobv, 'v' ) ||
|
||||
LAPACKE_lsame( jobv, 'w' ) ) {
|
||||
LAPACKE_cge_trans( matrix_layout, nv, n, v, ldv, v_t, ldv_t );
|
||||
}
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgejsv( &joba, &jobu, &jobv, &jobr, &jobt, &jobp, &m, &n, a_t,
|
||||
&lda_t, sva, u_t, &ldu_t, v_t, &ldv_t, cwork, &lwork,
|
||||
rwork, &lrwork, iwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
if( LAPACKE_lsame( jobu, 'f' ) || LAPACKE_lsame( jobu, 'u' ) ||
|
||||
LAPACKE_lsame( jobu, 'w' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nu, n, u_t, ldu_t, u, ldu );
|
||||
}
|
||||
if( LAPACKE_lsame( jobv, 'j' ) || LAPACKE_lsame( jobv, 'v' ) ||
|
||||
LAPACKE_lsame( jobv, 'w' ) ) {
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, nv, n, v_t, ldv_t, v, ldv );
|
||||
}
|
||||
/* Release memory and exit */
|
||||
if( LAPACKE_lsame( jobv, 'j' ) || LAPACKE_lsame( jobv, 'v' ) ||
|
||||
LAPACKE_lsame( jobv, 'w' ) ) {
|
||||
LAPACKE_free( v_t );
|
||||
}
|
||||
exit_level_2:
|
||||
if( LAPACKE_lsame( jobu, 'f' ) || LAPACKE_lsame( jobu, 'u' ) ||
|
||||
LAPACKE_lsame( jobu, 'w' ) ) {
|
||||
LAPACKE_free( u_t );
|
||||
}
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgejsv_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
68
lapack-netlib/LAPACKE/src/lapacke_cgelq2.c
Normal file
68
lapack-netlib/LAPACKE/src/lapacke_cgelq2.c
Normal file
@@ -0,0 +1,68 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgelq2
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelq2( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelq2", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,m) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgelq2_work( matrix_layout, m, n, a, lda, tau, work );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelq2", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
84
lapack-netlib/LAPACKE/src/lapacke_cgelq2_work.c
Normal file
84
lapack-netlib/LAPACKE/src/lapacke_cgelq2_work.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgelq2
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelq2_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau,
|
||||
lapack_complex_float* work )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelq2( &m, &n, a, &lda, tau, work, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelq2_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelq2( &m, &n, a_t, &lda_t, tau, work, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelq2_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelq2_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
77
lapack-netlib/LAPACKE/src/lapacke_cgelqf.c
Normal file
77
lapack-netlib/LAPACKE/src/lapacke_cgelqf.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgelqf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelqf( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelqf", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgelqf_work( matrix_layout, m, n, a, lda, tau, &work_query,
|
||||
lwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_0;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgelqf_work( matrix_layout, m, n, a, lda, tau, work, lwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelqf", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
89
lapack-netlib/LAPACKE/src/lapacke_cgelqf_work.c
Normal file
89
lapack-netlib/LAPACKE/src/lapacke_cgelqf_work.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgelqf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelqf_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau,
|
||||
lapack_complex_float* work, lapack_int lwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelqf( &m, &n, a, &lda, tau, work, &lwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelqf_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgelqf( &m, &n, a, &lda_t, tau, work, &lwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelqf( &m, &n, a_t, &lda_t, tau, work, &lwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelqf_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelqf_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
82
lapack-netlib/LAPACKE/src/lapacke_cgels.c
Normal file
82
lapack-netlib/LAPACKE/src/lapacke_cgels.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgels
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgels( int matrix_layout, char trans, lapack_int m,
|
||||
lapack_int n, lapack_int nrhs,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* b, lapack_int ldb )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgels", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -6;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
|
||||
return -8;
|
||||
}
|
||||
#endif
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgels_work( matrix_layout, trans, m, n, nrhs, a, lda, b, ldb,
|
||||
&work_query, lwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_0;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgels_work( matrix_layout, trans, m, n, nrhs, a, lda, b, ldb,
|
||||
work, lwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgels", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
112
lapack-netlib/LAPACKE/src/lapacke_cgels_work.c
Normal file
112
lapack-netlib/LAPACKE/src/lapacke_cgels_work.c
Normal file
@@ -0,0 +1,112 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgels
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgels_work( int matrix_layout, char trans, lapack_int m,
|
||||
lapack_int n, lapack_int nrhs,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* b, lapack_int ldb,
|
||||
lapack_complex_float* work, lapack_int lwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgels( &trans, &m, &n, &nrhs, a, &lda, b, &ldb, work, &lwork,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_int ldb_t = MAX(1,MAX(m,n));
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -7;
|
||||
LAPACKE_xerbla( "LAPACKE_cgels_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -9;
|
||||
LAPACKE_xerbla( "LAPACKE_cgels_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgels( &trans, &m, &n, &nrhs, a, &lda_t, b, &ldb_t, work,
|
||||
&lwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
LAPACKE_cge_trans( matrix_layout, MAX(m,n), nrhs, b, ldb, b_t, ldb_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgels( &trans, &m, &n, &nrhs, a_t, &lda_t, b_t, &ldb_t, work,
|
||||
&lwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, MAX(m,n), nrhs, b_t, ldb_t, b,
|
||||
ldb );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgels_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgels_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
110
lapack-netlib/LAPACKE/src/lapacke_cgelsd.c
Normal file
110
lapack-netlib/LAPACKE/src/lapacke_cgelsd.c
Normal file
@@ -0,0 +1,110 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgelsd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelsd( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int nrhs, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* b,
|
||||
lapack_int ldb, float* s, float rcond,
|
||||
lapack_int* rank )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
/* Additional scalars declarations for work arrays */
|
||||
lapack_int liwork;
|
||||
lapack_int lrwork;
|
||||
lapack_int* iwork = NULL;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_int iwork_query;
|
||||
float rwork_query;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsd", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -5;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
|
||||
return -7;
|
||||
}
|
||||
if( LAPACKE_s_nancheck( 1, &rcond, 1 ) ) {
|
||||
return -10;
|
||||
}
|
||||
#endif
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgelsd_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
|
||||
rcond, rank, &work_query, lwork, &rwork_query,
|
||||
&iwork_query );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_0;
|
||||
}
|
||||
liwork = (lapack_int)iwork_query;
|
||||
lrwork = (lapack_int)rwork_query;
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) * liwork );
|
||||
if( iwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * lrwork );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgelsd_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
|
||||
rcond, rank, work, lwork, rwork, iwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_2:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_1:
|
||||
LAPACKE_free( iwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsd", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
114
lapack-netlib/LAPACKE/src/lapacke_cgelsd_work.c
Normal file
114
lapack-netlib/LAPACKE/src/lapacke_cgelsd_work.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgelsd
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelsd_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int nrhs, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* b,
|
||||
lapack_int ldb, float* s, float rcond,
|
||||
lapack_int* rank, lapack_complex_float* work,
|
||||
lapack_int lwork, float* rwork,
|
||||
lapack_int* iwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelsd( &m, &n, &nrhs, a, &lda, b, &ldb, s, &rcond, rank, work,
|
||||
&lwork, rwork, iwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_int ldb_t = MAX(1,MAX(m,n));
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -6;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsd_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -8;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsd_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgelsd( &m, &n, &nrhs, a, &lda_t, b, &ldb_t, s, &rcond, rank,
|
||||
work, &lwork, rwork, iwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
LAPACKE_cge_trans( matrix_layout, MAX(m,n), nrhs, b, ldb, b_t, ldb_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelsd( &m, &n, &nrhs, a_t, &lda_t, b_t, &ldb_t, s, &rcond, rank,
|
||||
work, &lwork, rwork, iwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, MAX(m,n), nrhs, b_t, ldb_t, b,
|
||||
ldb );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsd_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsd_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
95
lapack-netlib/LAPACKE/src/lapacke_cgelss.c
Normal file
95
lapack-netlib/LAPACKE/src/lapacke_cgelss.c
Normal file
@@ -0,0 +1,95 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgelss
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelss( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int nrhs, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* b,
|
||||
lapack_int ldb, float* s, float rcond,
|
||||
lapack_int* rank )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelss", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -5;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
|
||||
return -7;
|
||||
}
|
||||
if( LAPACKE_s_nancheck( 1, &rcond, 1 ) ) {
|
||||
return -10;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,5*MIN(m,n)) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgelss_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
|
||||
rcond, rank, &work_query, lwork, rwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_1;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgelss_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, s,
|
||||
rcond, rank, work, lwork, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelss", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
113
lapack-netlib/LAPACKE/src/lapacke_cgelss_work.c
Normal file
113
lapack-netlib/LAPACKE/src/lapacke_cgelss_work.c
Normal file
@@ -0,0 +1,113 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgelss
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelss_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int nrhs, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* b,
|
||||
lapack_int ldb, float* s, float rcond,
|
||||
lapack_int* rank, lapack_complex_float* work,
|
||||
lapack_int lwork, float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelss( &m, &n, &nrhs, a, &lda, b, &ldb, s, &rcond, rank, work,
|
||||
&lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_int ldb_t = MAX(1,MAX(m,n));
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -6;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelss_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -8;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelss_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgelss( &m, &n, &nrhs, a, &lda_t, b, &ldb_t, s, &rcond, rank,
|
||||
work, &lwork, rwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
LAPACKE_cge_trans( matrix_layout, MAX(m,n), nrhs, b, ldb, b_t, ldb_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelss( &m, &n, &nrhs, a_t, &lda_t, b_t, &ldb_t, s, &rcond, rank,
|
||||
work, &lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, MAX(m,n), nrhs, b_t, ldb_t, b,
|
||||
ldb );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelss_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelss_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
95
lapack-netlib/LAPACKE/src/lapacke_cgelsy.c
Normal file
95
lapack-netlib/LAPACKE/src/lapacke_cgelsy.c
Normal file
@@ -0,0 +1,95 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgelsy
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelsy( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int nrhs, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* b,
|
||||
lapack_int ldb, lapack_int* jpvt, float rcond,
|
||||
lapack_int* rank )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsy", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -5;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, MAX(m,n), nrhs, b, ldb ) ) {
|
||||
return -7;
|
||||
}
|
||||
if( LAPACKE_s_nancheck( 1, &rcond, 1 ) ) {
|
||||
return -10;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,2*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgelsy_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, jpvt,
|
||||
rcond, rank, &work_query, lwork, rwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_1;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgelsy_work( matrix_layout, m, n, nrhs, a, lda, b, ldb, jpvt,
|
||||
rcond, rank, work, lwork, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsy", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
113
lapack-netlib/LAPACKE/src/lapacke_cgelsy_work.c
Normal file
113
lapack-netlib/LAPACKE/src/lapacke_cgelsy_work.c
Normal file
@@ -0,0 +1,113 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgelsy
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgelsy_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_int nrhs, lapack_complex_float* a,
|
||||
lapack_int lda, lapack_complex_float* b,
|
||||
lapack_int ldb, lapack_int* jpvt, float rcond,
|
||||
lapack_int* rank, lapack_complex_float* work,
|
||||
lapack_int lwork, float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelsy( &m, &n, &nrhs, a, &lda, b, &ldb, jpvt, &rcond, rank,
|
||||
work, &lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_int ldb_t = MAX(1,MAX(m,n));
|
||||
lapack_complex_float* a_t = NULL;
|
||||
lapack_complex_float* b_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -6;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsy_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldb < nrhs ) {
|
||||
info = -8;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsy_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgelsy( &m, &n, &nrhs, a, &lda_t, b, &ldb_t, jpvt, &rcond,
|
||||
rank, work, &lwork, rwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
b_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) *
|
||||
ldb_t * MAX(1,nrhs) );
|
||||
if( b_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
LAPACKE_cge_trans( matrix_layout, MAX(m,n), nrhs, b, ldb, b_t, ldb_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgelsy( &m, &n, &nrhs, a_t, &lda_t, b_t, &ldb_t, jpvt, &rcond,
|
||||
rank, work, &lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, MAX(m,n), nrhs, b_t, ldb_t, b,
|
||||
ldb );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( b_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsy_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgelsy_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
78
lapack-netlib/LAPACKE/src/lapacke_cgemqrt.c
Normal file
78
lapack-netlib/LAPACKE/src/lapacke_cgemqrt.c
Normal file
@@ -0,0 +1,78 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
******************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgemqrt
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgemqrt( int matrix_layout, char side, char trans,
|
||||
lapack_int m, lapack_int n, lapack_int k,
|
||||
lapack_int nb, const lapack_complex_float* v,
|
||||
lapack_int ldv, const lapack_complex_float* t,
|
||||
lapack_int ldt, lapack_complex_float* c,
|
||||
lapack_int ldc )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgemqrt", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, c, ldc ) ) {
|
||||
return -12;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, ldt, nb, t, ldt ) ) {
|
||||
return -10;
|
||||
}
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, ldv, k, v, ldv ) ) {
|
||||
return -8;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,m) * MAX(1,nb) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgemqrt_work( matrix_layout, side, trans, m, n, k, nb, v, ldv,
|
||||
t, ldt, c, ldc, work );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgemqrt", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
120
lapack-netlib/LAPACKE/src/lapacke_cgemqrt_work.c
Normal file
120
lapack-netlib/LAPACKE/src/lapacke_cgemqrt_work.c
Normal file
@@ -0,0 +1,120 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
******************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgemqrt
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgemqrt_work( int matrix_layout, char side, char trans,
|
||||
lapack_int m, lapack_int n, lapack_int k,
|
||||
lapack_int nb, const lapack_complex_float* v,
|
||||
lapack_int ldv, const lapack_complex_float* t,
|
||||
lapack_int ldt, lapack_complex_float* c,
|
||||
lapack_int ldc, lapack_complex_float* work )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgemqrt( &side, &trans, &m, &n, &k, &nb, v, &ldv, t, &ldt, c,
|
||||
&ldc, work, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int ldc_t = MAX(1,m);
|
||||
lapack_int ldt_t = MAX(1,ldt);
|
||||
lapack_int ldv_t = MAX(1,ldv);
|
||||
lapack_complex_float* v_t = NULL;
|
||||
lapack_complex_float* t_t = NULL;
|
||||
lapack_complex_float* c_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( ldc < n ) {
|
||||
info = -13;
|
||||
LAPACKE_xerbla( "LAPACKE_cgemqrt_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldt < nb ) {
|
||||
info = -11;
|
||||
LAPACKE_xerbla( "LAPACKE_cgemqrt_work", info );
|
||||
return info;
|
||||
}
|
||||
if( ldv < k ) {
|
||||
info = -9;
|
||||
LAPACKE_xerbla( "LAPACKE_cgemqrt_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
v_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldv_t * MAX(1,k) );
|
||||
if( v_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
t_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldt_t * MAX(1,nb) );
|
||||
if( t_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
c_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * ldc_t * MAX(1,n) );
|
||||
if( c_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_2;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, ldv, k, v, ldv, v_t, ldv_t );
|
||||
LAPACKE_cge_trans( matrix_layout, ldt, nb, t, ldt, t_t, ldt_t );
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, c, ldc, c_t, ldc_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgemqrt( &side, &trans, &m, &n, &k, &nb, v_t, &ldv_t, t_t,
|
||||
&ldt_t, c_t, &ldc_t, work, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, c_t, ldc_t, c, ldc );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( c_t );
|
||||
exit_level_2:
|
||||
LAPACKE_free( t_t );
|
||||
exit_level_1:
|
||||
LAPACKE_free( v_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgemqrt_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgemqrt_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
77
lapack-netlib/LAPACKE/src/lapacke_cgeqlf.c
Normal file
77
lapack-netlib/LAPACKE/src/lapacke_cgeqlf.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeqlf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqlf( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqlf", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgeqlf_work( matrix_layout, m, n, a, lda, tau, &work_query,
|
||||
lwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_0;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgeqlf_work( matrix_layout, m, n, a, lda, tau, work, lwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqlf", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
89
lapack-netlib/LAPACKE/src/lapacke_cgeqlf_work.c
Normal file
89
lapack-netlib/LAPACKE/src/lapacke_cgeqlf_work.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeqlf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqlf_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau,
|
||||
lapack_complex_float* work, lapack_int lwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeqlf( &m, &n, a, &lda, tau, work, &lwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqlf_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgeqlf( &m, &n, a, &lda_t, tau, work, &lwork, &info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeqlf( &m, &n, a_t, &lda_t, tau, work, &lwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqlf_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqlf_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
87
lapack-netlib/LAPACKE/src/lapacke_cgeqp3.c
Normal file
87
lapack-netlib/LAPACKE/src/lapacke_cgeqp3.c
Normal file
@@ -0,0 +1,87 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeqp3
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqp3( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* jpvt, lapack_complex_float* tau )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqp3", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,2*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgeqp3_work( matrix_layout, m, n, a, lda, jpvt, tau,
|
||||
&work_query, lwork, rwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_1;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgeqp3_work( matrix_layout, m, n, a, lda, jpvt, tau, work,
|
||||
lwork, rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqp3", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
92
lapack-netlib/LAPACKE/src/lapacke_cgeqp3_work.c
Normal file
92
lapack-netlib/LAPACKE/src/lapacke_cgeqp3_work.c
Normal file
@@ -0,0 +1,92 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeqp3
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqp3_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* jpvt, lapack_complex_float* tau,
|
||||
lapack_complex_float* work, lapack_int lwork,
|
||||
float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeqp3( &m, &n, a, &lda, jpvt, tau, work, &lwork, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqp3_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Query optimal working array(s) size if requested */
|
||||
if( lwork == -1 ) {
|
||||
LAPACK_cgeqp3( &m, &n, a, &lda_t, jpvt, tau, work, &lwork, rwork,
|
||||
&info );
|
||||
return (info < 0) ? (info - 1) : info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeqp3( &m, &n, a_t, &lda_t, jpvt, tau, work, &lwork, rwork,
|
||||
&info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqp3_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqp3_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
77
lapack-netlib/LAPACKE/src/lapacke_cgeqpf.c
Normal file
77
lapack-netlib/LAPACKE/src/lapacke_cgeqpf.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeqpf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqpf( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* jpvt, lapack_complex_float* tau )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
float* rwork = NULL;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqpf", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,2*n) );
|
||||
if( rwork == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_1;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgeqpf_work( matrix_layout, m, n, a, lda, jpvt, tau, work,
|
||||
rwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_1:
|
||||
LAPACKE_free( rwork );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqpf", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
84
lapack-netlib/LAPACKE/src/lapacke_cgeqpf_work.c
Normal file
84
lapack-netlib/LAPACKE/src/lapacke_cgeqpf_work.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeqpf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqpf_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_int* jpvt, lapack_complex_float* tau,
|
||||
lapack_complex_float* work, float* rwork )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeqpf( &m, &n, a, &lda, jpvt, tau, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqpf_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeqpf( &m, &n, a_t, &lda_t, jpvt, tau, work, rwork, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqpf_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqpf_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
68
lapack-netlib/LAPACKE/src/lapacke_cgeqr2.c
Normal file
68
lapack-netlib/LAPACKE/src/lapacke_cgeqr2.c
Normal file
@@ -0,0 +1,68 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeqr2
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqr2( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_complex_float* work = NULL;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqr2", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
/* Allocate memory for working array(s) */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * MAX(1,n) );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgeqr2_work( matrix_layout, m, n, a, lda, tau, work );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqr2", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
84
lapack-netlib/LAPACKE/src/lapacke_cgeqr2_work.c
Normal file
84
lapack-netlib/LAPACKE/src/lapacke_cgeqr2_work.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native middle-level C interface to LAPACK function cgeqr2
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqr2_work( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau,
|
||||
lapack_complex_float* work )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
if( matrix_layout == LAPACK_COL_MAJOR ) {
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeqr2( &m, &n, a, &lda, tau, work, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
} else if( matrix_layout == LAPACK_ROW_MAJOR ) {
|
||||
lapack_int lda_t = MAX(1,m);
|
||||
lapack_complex_float* a_t = NULL;
|
||||
/* Check leading dimension(s) */
|
||||
if( lda < n ) {
|
||||
info = -5;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqr2_work", info );
|
||||
return info;
|
||||
}
|
||||
/* Allocate memory for temporary array(s) */
|
||||
a_t = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lda_t * MAX(1,n) );
|
||||
if( a_t == NULL ) {
|
||||
info = LAPACK_TRANSPOSE_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Transpose input matrices */
|
||||
LAPACKE_cge_trans( matrix_layout, m, n, a, lda, a_t, lda_t );
|
||||
/* Call LAPACK function and adjust info */
|
||||
LAPACK_cgeqr2( &m, &n, a_t, &lda_t, tau, work, &info );
|
||||
if( info < 0 ) {
|
||||
info = info - 1;
|
||||
}
|
||||
/* Transpose output matrices */
|
||||
LAPACKE_cge_trans( LAPACK_COL_MAJOR, m, n, a_t, lda_t, a, lda );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( a_t );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_TRANSPOSE_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqr2_work", info );
|
||||
}
|
||||
} else {
|
||||
info = -1;
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqr2_work", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
77
lapack-netlib/LAPACKE/src/lapacke_cgeqrf.c
Normal file
77
lapack-netlib/LAPACKE/src/lapacke_cgeqrf.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2014, Intel Corp.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************
|
||||
* Contents: Native high-level C interface to LAPACK function cgeqrf
|
||||
* Author: Intel Corporation
|
||||
* Generated November 2015
|
||||
*****************************************************************************/
|
||||
|
||||
#include "lapacke_utils.h"
|
||||
|
||||
lapack_int LAPACKE_cgeqrf( int matrix_layout, lapack_int m, lapack_int n,
|
||||
lapack_complex_float* a, lapack_int lda,
|
||||
lapack_complex_float* tau )
|
||||
{
|
||||
lapack_int info = 0;
|
||||
lapack_int lwork = -1;
|
||||
lapack_complex_float* work = NULL;
|
||||
lapack_complex_float work_query;
|
||||
if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqrf", -1 );
|
||||
return -1;
|
||||
}
|
||||
#ifndef LAPACK_DISABLE_NAN_CHECK
|
||||
/* Optionally check input matrices for NaNs */
|
||||
if( LAPACKE_cge_nancheck( matrix_layout, m, n, a, lda ) ) {
|
||||
return -4;
|
||||
}
|
||||
#endif
|
||||
/* Query optimal working array(s) size */
|
||||
info = LAPACKE_cgeqrf_work( matrix_layout, m, n, a, lda, tau, &work_query,
|
||||
lwork );
|
||||
if( info != 0 ) {
|
||||
goto exit_level_0;
|
||||
}
|
||||
lwork = LAPACK_C2INT( work_query );
|
||||
/* Allocate memory for work arrays */
|
||||
work = (lapack_complex_float*)
|
||||
LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
|
||||
if( work == NULL ) {
|
||||
info = LAPACK_WORK_MEMORY_ERROR;
|
||||
goto exit_level_0;
|
||||
}
|
||||
/* Call middle-level interface */
|
||||
info = LAPACKE_cgeqrf_work( matrix_layout, m, n, a, lda, tau, work, lwork );
|
||||
/* Release memory and exit */
|
||||
LAPACKE_free( work );
|
||||
exit_level_0:
|
||||
if( info == LAPACK_WORK_MEMORY_ERROR ) {
|
||||
LAPACKE_xerbla( "LAPACKE_cgeqrf", info );
|
||||
}
|
||||
return info;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user