Skip to content

Commit 28763d5

Browse files
committed
Merge branch 'eigenvalues'
This brings in the Eigen3 implementation of kernel/distance matrices
2 parents 440b202 + 906308f commit 28763d5

File tree

378 files changed

+100979
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

378 files changed

+100979
-184
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ FIND_PACKAGE(ZLIB 1.2.3 REQUIRED)
6363
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
6464
SET(KMERCLUST_DEPENDS_LIBS ${KMERCLUST_DEPENDS_LIBS} ${ZLIB_LIBRARIES})
6565

66+
FIND_PACKAGE(Eigen3 3.0.0 REQUIRED)
67+
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
68+
# Eigen is header only, no need for libs
69+
6670
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ZLIB_C_FLAGS}")
6771
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ZLIB_C_FLAGS} -DSEQAN_HAS_ZLIB=1")
6872

cmake/FindEigen3.cmake

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# - Try to find Eigen3 lib
2+
#
3+
# This module supports requiring a minimum version, e.g. you can do
4+
# find_package(Eigen3 3.1.2)
5+
# to require version 3.1.2 or newer of Eigen3.
6+
#
7+
# Once done this will define
8+
#
9+
# EIGEN3_FOUND - system has eigen lib with correct version
10+
# EIGEN3_INCLUDE_DIR - the eigen include directory
11+
# EIGEN3_VERSION - eigen version
12+
#
13+
# This module reads hints about search locations from
14+
# the following enviroment variables:
15+
#
16+
# EIGEN3_ROOT
17+
# EIGEN3_ROOT_DIR
18+
19+
# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
20+
# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
21+
# Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
22+
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
23+
24+
if(NOT Eigen3_FIND_VERSION)
25+
if(NOT Eigen3_FIND_VERSION_MAJOR)
26+
set(Eigen3_FIND_VERSION_MAJOR 2)
27+
endif(NOT Eigen3_FIND_VERSION_MAJOR)
28+
if(NOT Eigen3_FIND_VERSION_MINOR)
29+
set(Eigen3_FIND_VERSION_MINOR 91)
30+
endif(NOT Eigen3_FIND_VERSION_MINOR)
31+
if(NOT Eigen3_FIND_VERSION_PATCH)
32+
set(Eigen3_FIND_VERSION_PATCH 0)
33+
endif(NOT Eigen3_FIND_VERSION_PATCH)
34+
35+
set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
36+
endif(NOT Eigen3_FIND_VERSION)
37+
38+
macro(_eigen3_check_version)
39+
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
40+
41+
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
42+
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
43+
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
44+
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
45+
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
46+
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
47+
48+
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
49+
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
50+
set(EIGEN3_VERSION_OK FALSE)
51+
else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
52+
set(EIGEN3_VERSION_OK TRUE)
53+
endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
54+
55+
if(NOT EIGEN3_VERSION_OK)
56+
57+
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
58+
"but at least version ${Eigen3_FIND_VERSION} is required")
59+
endif(NOT EIGEN3_VERSION_OK)
60+
endmacro(_eigen3_check_version)
61+
62+
if (EIGEN3_INCLUDE_DIR)
63+
64+
# in cache already
65+
_eigen3_check_version()
66+
set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
67+
68+
else (EIGEN3_INCLUDE_DIR)
69+
70+
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
71+
HINTS
72+
ENV EIGEN3_ROOT
73+
ENV EIGEN3_ROOT_DIR
74+
PATHS
75+
${CMAKE_INSTALL_PREFIX}/include
76+
${KDE4_INCLUDE_DIR}
77+
src/ext
78+
PATH_SUFFIXES eigen3 eigen
79+
)
80+
81+
if(EIGEN3_INCLUDE_DIR)
82+
_eigen3_check_version()
83+
endif(EIGEN3_INCLUDE_DIR)
84+
85+
include(FindPackageHandleStandardArgs)
86+
find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
87+
88+
mark_as_advanced(EIGEN3_INCLUDE_DIR)
89+
90+
endif(EIGEN3_INCLUDE_DIR)
91+

src/ext/eigen3/COPYING.BSD

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Copyright (c) 2011, Intel Corporation. All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
* Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
* Neither the name of Intel Corporation nor the names of its contributors may
13+
be used to endorse or promote products derived from this software without
14+
specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26+
*/

0 commit comments

Comments
 (0)