Commit 4ab04340 authored by COULAUD Olivier's avatar COULAUD Olivier
Browse files
parents 28ca945a 866ecb5f
......@@ -130,7 +130,7 @@ scalfmm_handle scalfmm_init( scalfmm_kernel_type KernelType,scalfmm_algorithm al
* @param morton_index morton index of the cell to be allocated.
* @param tree_position int[3] position inside the tree (number of boxes in
* each direction)
* @param spatial_position double[3] center of the cell
* @param spatial_position double[3] lower left corner of the cell
* @param inDatas user generic pointer to kernel.
*/
typedef void* (*Callback_init_cell)(int level, long long morton_index, int* tree_position, double* spatial_position, void * inDatas);
......@@ -166,24 +166,24 @@ typedef void (*Callback_copy_cell)(void * userDatas, FSize size, void * memoryAl
* @param nbParts Number of particles inside that leaf
* @param idxParts array of size nbParts, containing the indices of each parts
* @param morton_index of the current cell
* @param center of the current leaf (3 double)
* @param lower left corner of the current leaf (3 double)
* @param userData cell user data
* @param userData Kernel user data
*/
typedef void (*Callback_apply_on_leaf)(int level, FSize nbParts, const FSize * idxParts, long long morton_index, double center[3],
typedef void (*Callback_apply_on_leaf)(int level, FSize nbParts, const FSize * idxParts, long long morton_index, double llc[3],
void * cellDatas,void * leafDatas, void * userDatas);
/**
* @brief Callback to initialise data inside the Leaves
* @param level current level of leaves (ie height of the tree)
* @param level current level of leaves (ie height of the tree-1)
* @param nbParts Number of particles inside that leaf"
* @param idxParts array of size nbParts, containing the indices of each parts
* @param morton_index of the current cell
* @param center of the current leaf (3 double)
* @param lower left corner of the current leaf (3 double)
* @param userData leaf user data
* @param userData Kernel user data
*/
typedef void* (*Callback_init_leaf)(int level, FSize nbParts, const FSize * idxParts, long long morton_index, double center[3],
typedef void* (*Callback_init_leaf)(int level, FSize nbParts, const FSize * idxParts, long long morton_index, double llc[3],
void * cellDatas, void * userDatas);
/**
......@@ -605,7 +605,7 @@ typedef void (*Callback_P2PSym)(void * targetLeaf, FSize nbParticles, const FSiz
* @param morton_index morton index of the cell to be allocated.
* @param tree_position int[3] position inside the tree (number of boxes in
* each direction)
* @param spatial_position double[3] center of the cell
* @param spatial_position double[3] lower left corner of the cell
* @param usercell ptr to user's cell
*/
typedef void (*Callback_apply_on_cell)(int level, long long morton_index, int* tree_position, double* spatial_position, void * userCell, void * userData);
......
......@@ -502,7 +502,7 @@ public:
//Then init leaves
octree->forEachCellLeaf([&](CoreCell * currCell, LeafClass * leaf){
FTreeCoordinate currCoord = currCell->getCoordinate();
int currLevel = octree->getHeight();
int currLevel = octree->getHeight()-1;
MortonIndex currMorton = currCoord.getMortonIndex(currLevel);
double position[3];
position[0] = boxCorner.getX() + currCoord.getX()*boxwidth/double(1<<currLevel);
......@@ -664,7 +664,11 @@ public:
printf("\tDownPass finished\n");
}
else{
(FScalFMMEngine<FReal>::abstrct)->execute();
if(octree->getHeight() == 2){
(FScalFMMEngine<FReal>::abstrct)->execute(FFmmP2P);
}else{
(FScalFMMEngine<FReal>::abstrct)->execute();
}
}
}
}
......
License Information
===================
The Open Source Clustering Software consists of several packages, which have
different licenses.
* Cluster 3.0 is a GUI-based program for Windows, Mac OS X, Linux, and Unix.
It is based on Michael Eisen's Cluster/TreeView code. Cluster 3.0 is covered
by Michael Eisen's original license, available at
http://rana.lbl.gov/EisenSoftwareSource.htm. The command-line version of
Cluster 3.0 is also covered by this license.
* Pycluster is an extension module to the scripting language Python. It is
covered by the Python License (same license as Python itself).
* Algorithm::Cluster, the interface to the scripting language Perl. It was
released under the Artistic License (same license as Perl itself).
* The routines in the C Clustering Library can also be used directly by calling
them from other C programs. In that case, the Python License applies.
In all cases, copyright notices must be retained in their original form.
Open Source Clustering Software
===============================
The Open Source Clustering Software consists of the most commonly used routines
for clustering analysis of gene expression data. The software packages below all
depend on the C Clustering Library, which is a library of routines for
hierarchical (pairwise single-, complete-, maximum-, and average-linkage)
clustering, k-means clustering, and Self-Organizing Maps on a 2D rectangular
grid. The C Clustering Library complies with the ANSI C standard.
Several packages are available as part of the Open Source Clustering Software:
* Cluster 3.0 is a GUI-based program for Windows, based on Michael Eisen's
Cluster/TreeView code. Cluster 3.0 was written for Microsoft Windows, and
subsequently ported to Mac OS X (Cocoa) and Unix/Linux. Cluster 3.0 can
also be used as a command line program.
* Pycluster (or Bio.Cluster if used as part of Biopython) is an extension
module to the scripting language Python.
* Algorithm::Cluster is an extension module to the scripting language Perl.
* The routines in the C Clustering Library can also be used directly by calling
them from other C programs.
INSTALLATION
============
See the INSTALL file in this directory.
VIEWING CLUSTERING RESULTS
==========================
We recommend using Java TreeView for visualizing clustering results.
Java TreeView is a Java version of Michael Eisen's Treeview program with
extended capabilities. In particular, it is possible to visualize k-means
clustering results in addition to hierarchical clustering results.
Java TreeView was written by Alok Saldanha at Stanford University; it can be
downloaded at http://jtreeview.sourceforge.net.
MANUAL
======
The routines in the C Clustering Library is described in the manual
(cluster.pdf). This manual also describes how to use the routines from Python
and from Perl. Cluster 3.0 has a separate manual (cluster3.pdf). Both of these
manuals can be found in the doc subdirectory. They can also be downloaded from
our website:
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon/software/cluster/cluster.pdf;
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon/software/cluster/cluster3.pdf.
LITERATURE
==========
M.J.L. de Hoon, S. Imoto, J. Nolan, and S. Miyano: "Open Source Clustering
Software", Bioinformatics 20(9): 1453-1454 (2004).
CONTACT
=======
Michiel de Hoon
University of Tokyo, Institute of Medical Science
Human Genome Center, Laboratory of DNA Information Analysis
Currently at
RIKEN Genomic Sciences Center
mdehoon 'AT' gsc.riken.jp
This diff is collapsed.
/******************************************************************************/
/* The C Clustering Library.
* Copyright (C) 2002 Michiel Jan Laurens de Hoon.
*
* This library was written at the Laboratory of DNA Information Analysis,
* Human Genome Center, Institute of Medical Science, University of Tokyo,
* 4-6-1 Shirokanedai, Minato-ku, Tokyo 108-8639, Japan.
* Contact: mdehoon 'AT' gsc.riken.jp
*
* Permission to use, copy, modify, and distribute this software and its
* documentation with or without modifications and for any purpose and
* without fee is hereby granted, provided that any copyright notices
* appear in all copies and that both those copyright notices and this
* permission notice appear in supporting documentation, and that the
* names of the contributors or copyright holders not be used in
* advertising or publicity pertaining to distribution of the software
* without specific prior permission.
*
* THE CONTRIBUTORS AND COPYRIGHT HOLDERS OF THIS SOFTWARE DISCLAIM ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE
* CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT
* OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE.
*
*/
// @SCALFMM_PRIVATE
#ifdef WINDOWS
# include <windows.h>
#endif
#define CLUSTERVERSION "1.52a"
/* Chapter 2 */
double clusterdistance (int nrows, int ncolumns, double** data, int** mask,
double weight[], int n1, int n2, int index1[], int index2[], char dist,
char method, int transpose);
double** distancematrix (int ngenes, int ndata, double** data,
int** mask, double* weight, char dist, int transpose);
/* Chapter 3 */
int getclustercentroids(int nclusters, int nrows, int ncolumns,
double** data, int** mask, int clusterid[], double** cdata, int** cmask,
int transpose, char method);
void getclustermedoids(int nclusters, int nelements, double** distance,
int clusterid[], int centroids[], double errors[]);
void kcluster (int nclusters, int ngenes, int ndata, double** data,
int** mask, double weight[], int transpose, int npass, char method, char dist,
int clusterid[], double* error, int* ifound);
void kmedoids (int nclusters, int nelements, double** distance,
int npass, int clusterid[], double* error, int* ifound);
/* Chapter 4 */
typedef struct {int left; int right; double distance;} Node;
/*
* A Node struct describes a single node in a tree created by hierarchical
* clustering. The tree can be represented by an array of n Node structs,
* where n is the number of elements minus one. The integers left and right
* in each Node struct refer to the two elements or subnodes that are joined
* in this node. The original elements are numbered 0..nelements-1, and the
* nodes -1..-(nelements-1). For each node, distance contains the distance
* between the two subnodes that were joined.
*/
Node* treecluster (int nrows, int ncolumns, double** data, int** mask,
double weight[], int transpose, char dist, char method, double** distmatrix);
void cuttree (int nelements, Node* tree, int nclusters, int clusterid[]);
/* Chapter 5 */
void somcluster (int nrows, int ncolumns, double** data, int** mask,
const double weight[], int transpose, int nxnodes, int nynodes,
double inittau, int niter, char dist, double*** celldata,
int clusterid[][2]);
/* Chapter 6 */
int pca(int m, int n, double** u, double** v, double* w);
/* Utility routines, currently undocumented */
void sort(int n, const double data[], int index[]);
double mean(int n, double x[]);
double median (int n, double x[]);
double* calculate_weights(int nrows, int ncolumns, double** data, int** mask,
double weights[], int transpose, char dist, double cutoff, double exponent);
# check if compiling into source directories
STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
if(insource)
MESSAGE(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../")
endif(insource)
project(ADDONS_HMAT_SCALFMM CXX C)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SCALFMM_CXX_FLAGS}")
# Active language
# -----------------------
ENABLE_LANGUAGE(CXX C)
MESSAGE(STATUS " CXX ${CMAKE_CXX_COMPILER_ID}" )
# Options
OPTION( SCALFMM_ADDON_HMAT "Set to ON to build ScalFMM HMat interface" OFF )
# if ask to build addon
if(SCALFMM_ADDON_HMAT)
list(APPEND FUSE_LIST "SCOTCH")
set(SCOTCH_NOT_FOUND $ENV{SCOTCH_LIB})
if(NOT SCOTCH_NOT_FOUND)
MESSAGE(STATUS " SCOTCH not found " )
else()
OPTION( SCALFMM_USE_SCOTCH "Set to ON to use scotch" ON )
if (SCALFMM_USE_SCOTCH)
include_directories($ENV{SCOTCH_INC})
SET(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};-L$ENV{SCOTCH_LIB};-lscotch;-lscotcherr")
endif()
endif()
# first build lib scalfmmhmat
set(LIBRARY_OUTPUT_PATH ../lib/${CMAKE_BUILD_TYPE})
# Searching all cpp file
file( GLOB_RECURSE source_lib_files Src/*.cpp )
# Adding cpp files to project
add_library( scalfmmhmat STATIC ${source_lib_files} )
# Add blas library (even if it is set to off)
target_link_libraries( scalfmmhmat scalfmm)
# Adding the entire project dir as an include dir
INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/Src
${CMAKE_SOURCE_DIR}/Src
${SCALFMM_INCLUDES}
)
# Install lib
install( TARGETS scalfmmhmat ARCHIVE DESTINATION lib )
# Install header
SET(my_include_dirs "Src")
file( GLOB hpp_in_dir Src/*.hpp Src/*.hpp)
INSTALL( FILES ${hpp_in_dir} DESTINATION include/ScalFmm/HMat )
# Add C Clustering Library
file( GLOB_RECURSE ccl_lib_files CClusteringLibrary/*.c )
add_library( cclusteringlib STATIC ${ccl_lib_files} )
INCLUDE_DIRECTORIES(CClusteringLibrary/)
target_link_libraries( cclusteringlib scalfmm)
install( TARGETS cclusteringlib ARCHIVE DESTINATION lib )
file( GLOB_RECURSE source_tests_files Tests/*.cpp )
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR}/Src )
# Then build test files
SET(hmat_list_execs "")
foreach(exec ${source_tests_files})
get_filename_component(
execname ${exec}
NAME_WE
)
set(compile_exec "TRUE")
foreach(fuse_key ${FUSE_LIST})
file(STRINGS "${exec}" lines_fuse REGEX "@FUSE_${fuse_key}")
if(lines_fuse)
if( NOT SCALFMM_USE_${fuse_key} )
MESSAGE( STATUS "This needs ${fuse_key} = ${exec}" )
set(compile_exec "FALSE")
endif()
endif()
endforeach()
# Dependency are OK
if( compile_exec )
add_executable( ${execname} ${exec} )
# link to scalfmm and scalfmmhmat and cclusteringlib
target_link_libraries(
${execname}
${scalfmm_lib}
scalfmmhmat
cclusteringlib
${SCALFMM_LIBRARIES}
)
LIST(APPEND hmat_list_execs ${execname})
endif()
endforeach(exec)
add_custom_target(hmat DEPENDS ${hmat_list_execs})
endif()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Berenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifndef FHUTILS_HPP
#define FHUTILS_HPP
// @SCALFMM_PRIVATE
#include "Utils/FGlobal.hpp"
#include <cstring>
template <class Type>
void FSetToZeros(Type array[], const int length){
memset(array, 0, length*sizeof(Type));
}
struct FBlockDescriptor {
int row, col, nbRows, nbCols, level;
};
#endif // FHUTILS_HPP
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment