Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 18685443 authored by Adrien Leman's avatar Adrien Leman Committed by hhakim
Browse files

adding misc directory

parent 92b49fce
No related branches found
No related tags found
No related merge requests found
Showing
with 1266 additions and 0 deletions
set(CTEST_PROJECT_NAME "faust")
#set(CTEST_NIGHTLY_START_TIME "18:30:00 CET")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "cdash.inria.fr")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=faust")
set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 10000)
##################################################################
############## README : run nightly faust project ################
##################################################################
This tool aims to launch automatically a shell-bash SCRIPT :
1- First at all, please chek out only the files presents in
following directory : devcpp/test/CTest_nightly
svn checkout --username XXX https://scm.gforge.inria.fr/authscm/XXX/svn/faust/trunk/devcpp/test/CTest_nightly
2- Configure your personnal run shell "run_nightly_PLATFORM.sh" with corresponding export of library and PATH used.
3- configure the "crontab" tool for UNIX or shulder for windows
crontab -e :
example :
# Run all day at 21h01 the nightly test and put results on CDASH
05 14 * * * /usr/bin/svn up /home/aleman/WORK/FAUST/faust_nightly/
35 14 * * * /home/aleman/WORK/FAUST/faust_nightly/run_nightly_XXX.sh
##
4- You have the possibility to set the time of the precedent svn in the file
CTestConfig.cmake
# DO NOT MODIFIED !!!
# This script launch the nightly faust project from the "run_nightly_XXX.sh"
# All the parameters, config optional, path of library, environment variables are defined in "run_nightly_XXX.sh"
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4)
IF(WIN32)
SET(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008")
SET (CTEST_SOURCE_DIRECTORY "$ENV{USERPROFILE}/faust_test")
SET (CTEST_BINARY_DIRECTORY "$ENV{USERPROFILE}/faust_test_build")
SET (CTEST_INSTALL_DIR "$ENV{USERPROFILE}/faust_output")
ELSEIF(UNIX)
SET(CTEST_CMAKE_GENERATOR "Unix Makefiles")
SET (CTEST_SOURCE_DIRECTORY "$ENV{PATH_DIR_RUN_NIGHTLY}/faust_test")
SET (CTEST_BINARY_DIRECTORY "$ENV{PATH_DIR_RUN_NIGHTLY}/faust_test_build")
SET (CTEST_INSTALL_DIR "$ENV{PATH_DIR_RUN_NIGHTLY}/faust_output")
ENDIF(WIN32)
FIND_PROGRAM(CTEST_SVN_COMMAND NAMES svn)
SET (CTEST_SVN_CHECKOUT "${CTEST_SVN_COMMAND} checkout --username testcdash --password testcdash https://scm.gforge.inria.fr/svn/faust/trunk/devcpp \"${CTEST_SOURCE_DIRECTORY}\"")
SET (CTEST_CHECKOUT_COMMAND "${CTEST_SVN_CHECKOUT}")
site_name(CTEST_SITE)
set(CTEST_BUILD_NAME "${CMAKE_SYSTEM}_${CMAKE_HOST_SYSTEM_PROCESSOR}")
# met les variables d'environnement a jour pour trouver les differentes librairies
#SET(ENV{PATH} "$ENV{PATH}:/usr/local/MATLAB/R2014b/bin")
#SET(ENV{OPENBLASDIR} "/home/ci/local/OPENBLAS/")
#SET(ENV{HDF5_ROOT_DIR} "/home/ci/local/HDF5")
SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
CTEST_START("Nightly")
CTEST_UPDATE()
# Option of the ctest build, set from run_nightly_XXX.sh
set (CTEST_CONFIGURE_OPTIONS_TMP "$ENV{CTEST_CONFIGURE_OPTIONS}" )
set (CTEST_CONFIGURE_OPTIONS_OK "-DCMAKE_INSTALL_PREFIX=${CTEST_INSTALL_DIR};${CTEST_CONFIGURE_OPTIONS_TMP}")
message(STATUS "CTEST_CONFIGURE_OPTIONS_OK=${CTEST_CONFIGURE_OPTIONS_OK}")
#message(STATUS " CTEST_CONFIGURE\(OPTIONS \"${CTEST_CONFIGURE_OPTIONS_OK}\"\) ")
CTEST_CONFIGURE(OPTIONS "${CTEST_CONFIGURE_OPTIONS_OK}")
#CTEST_CONFIGURE(OPTIONS "-DBUILD_DEBUG:BOOL=OFF;-DDASH_TESTING:BOOL=ON;-DBUILD_COVERAGE:BOOL=ON;-DFAUST_GEN_DOC:BOOL=OFF;-DCMAKE_INSTALL_PREFIX=${CTEST_INSTALL_DIR};-DFAUST_USE_GPU:BOOL=ON;-DFAUST_USE_OPENBLAS=ON")
#CTEST_BUILD()
CTEST_BUILD( TARGET install)
IF(UNIX)
SET(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CTEST_INSTALL_DIR}/lib")
ENDIF(UNIX)
CTEST_TEST()
if (WITH_COVERAGE AND CTEST_COVERAGE_COMMAND)
ctest_coverage()
endif (WITH_COVERAGE AND CTEST_COVERAGE_COMMAND)
if (WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
ctest_memcheck()
endif (WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
CTEST_SUBMIT()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4)
IF(WIN32)
SET(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008")
SET (CTEST_SOURCE_DIRECTORY "$ENV{USERPROFILE}/faust_test-ci")
SET (CTEST_BINARY_DIRECTORY "$ENV{USERPROFILE}/faust_test_build-ci")
SET (CTEST_INSTALL_DIR "$ENV{USERPROFILE}/faust_output-ci")
ELSE(WIN32)
SET(CTEST_CMAKE_GENERATOR "Unix Makefiles")
SET (CTEST_SOURCE_DIRECTORY "$ENV{USERPROFILE}/faust_test-ci")
SET (CTEST_BINARY_DIRECTORY "$ENV{USERPROFILE}/faust_test_build-ci")
SET (CTEST_INSTALL_DIR "$ENV{USERPROFILE}/faust_output-ci")
ENDIF(WIN32)
#SET(ENV{CC} "/home/tgautrai/local/gcc/gcc-old")
#SET(ENV{CXX} "/home/tgautrai/local/gcc/g++-old")
FIND_PROGRAM(CTEST_SVN_COMMAND NAMES svn)
if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
SET (CTEST_SVN_CHECKOUT "${CTEST_SVN_COMMAND} checkout --username testcdash --password testcdash https://scm.gforge.inria.fr/svn/faust/trunk/devcpp \"${CTEST_SOURCE_DIRECTORY}\"")
SET (CTEST_CHECKOUT_COMMAND "${CTEST_SVN_CHECKOUT}")
endif(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
site_name(CTEST_SITE)
set(CTEST_BUILD_NAME "${CMAKE_SYSTEM}_${CMAKE_HOST_SYSTEM_PROCESSOR}")
SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
CTEST_START("Continuous")
CTEST_UPDATE(RETURN_VALUE res)
IF(res EQUAL -1)
RETURN()
ENDIF(res EQUAL -1)
## run build and test for continuous integration model only if there was a new update
IF(res EQUAL 0)
RETURN()
ENDIF(res EQUAL 0)
#CTEST_CONFIGURE(OPTIONS "-DBUILD_DEBUG:BOOL=OFF;-DDASH_TESTING:BOOL=ON;-DBUILD_COVERAGE:BOOL=ON")
#CTEST_CONFIGURE(OPTIONS "-DBUILD_DEBUG:BOOL=OFF;-DDASH_TESTING:BOOL=ON;-DBUILD_COVERAGE:BOOL=ON;-DCMAKE_INSTALL_PREFIX=${CTEST_INSTALL_DIR};-DCMAKE_CC_COMPILER=$ENV{CC};-DCMAKE_CXX_COMPILER=$ENV{CXX}")
SET(ENV{PATH} "$ENV{PATH}:/usr/local/MATLAB/R2014b/bin")
SET(ENV{OPENBLASDIR} "/home/ci/local/OPENBLAS/")
SET(ENV{HDF5_ROOT_DIR} "/home/ci/local/HDF5")
CTEST_CONFIGURE(OPTIONS "-DBUILD_DEBUG:BOOL=OFF;-DDASH_TESTING:BOOL=ON;-DBUILD_COVERAGE:BOOL=ON;-DCMAKE_INSTALL_PREFIX=${CTEST_INSTALL_DIR};-DFAUST_GEN_DOC:BOOL=OFF")
CTEST_BUILD()
CTEST_BUILD(TARGET install)
IF(UNIX)
SET(ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${CTEST_INSTALL_DIR}/lib")
ENDIF(UNIX)
CTEST_TEST()
if (WITH_COVERAGE AND CTEST_COVERAGE_COMMAND)
ctest_coverage()
endif (WITH_COVERAGE AND CTEST_COVERAGE_COMMAND)
if (WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
ctest_memcheck()
endif (WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
CTEST_SUBMIT()
##################################################################
####################### run_nightly ##############################
# This shell-bash SCRIPT performs :
# - svn checkout
# - compile the selected target of faust project
# - run some examples relating to these targets.
#
# faust_test directory contains the sources of the faust project.
# faust_test_build directory contains the build of faust project.
# faust_output directory contains the build of faust project.
#
# WARNING : Please adjust your environment variables, corresponding
# to your computer configurations (library path)
#
# svn checkout --username XXX https://scm.gforge.inria.fr/authscm/XXX/svn/faust/trunk/devcpp/test/CTest_nightly
#
###################################################################
# Directory of the local path of the nightly project
export PATH_DIR_RUN_NIGHTLY='/home/aleman/WORK/FAUST/faust_nightly'
# Directory of the library used in the FAUST PROJECT
export OPENBLASDIR='/opt/OpenBLAS'
export MATIODIR='/usr/local'
export CUDADIR='/usr/local/cuda-7.5'
export EIGENDIR='/usr/include/eigen3'
# export version of gcc
export CC='/usr/lib64/ccache/gcc'
export CXX='/usr/lib64/ccache/g++'
# /usr/local/bin/matlab in the PATH
#export PATH=/usr/local/cuda-7.5/bin:/usr/local/bin:$PATH
export PATH=/usr/local/cuda-7.5/bin:/usr/local/bin:/usr/lib64/ccache/:$PATH
if [ ! -d "$PATH_DIR_RUN_NIGHTLY" ];
then
echo "ERROR : $PATH_DIR_RUN_NIGHTLY directory is not defined or do no exist !!!!!! Please select a valid PATH_DIR_RUN_NIGHTLY "
exit 1
fi
#export HDF5_ROOT_DIR=/home/aleman/Library/hdf5-1.8.16/src/.libs
# CTEST OPTION
export CTEST_CONFIGURE_OPTIONS="-DBUILD_DEBUG:BOOL=OFF;\
-DDASH_TESTING:BOOL=ON;\
-DBUILD_COVERAGE:BOOL=ON;\
-DFAUST_USE_OPENBLAS=ON;\
-DFAUST_USE_MATIO=ON;\
-DFAUST_USE_XML=ON;\
-DFAUST_USE_MEX=ON;\
-DFAUST_USE_GPU:BOOL=ON;\
-DFAUST_USE_PROFILING=OFF;\
-DFAUST_ISVERBOSE=OFF;\
-DFAUST_GEN_DOC:BOOL=OFF"
cd $PATH_DIR_RUN_NIGHTLY
rm -rf faust_test
rm -rf faust_test_build
rm -rf faust_output
mkdir faust_test
mkdir faust_test_build
mkdir faust_output
# launch ctest file
ctest -VV -C Release -S faustTest.cmake
##################################################################
####################### run_nightly ##############################
# This shell-bash SCRIPT performs :
# - svn checkout
# - compile the selected target of faust project
# - run some examples relating to these targets.
#
# faust_test directory contains the sources of the faust project.
# faust_test_build directory contains the build of faust project.
# faust_output directory contains the build of faust project.
#
# WARNING : Please adjust your environment variables, corresponding
# to your computer configurations (library path)
#
# svn checkout --username XXX https://scm.gforge.inria.fr/authscm/XXX/svn/faust/trunk/devcpp/test/CTest_nightly
#
###################################################################
# Directory of the local path of the nightly project
export PATH_DIR_RUN_NIGHTLY='/home/aleman/Documents/WORK/FAUST/faust_nightly'
if [ ! -d "$PATH_DIR_RUN_NIGHTLY" ];
then
echo "ERROR : $PATH_DIR_RUN_NIGHTLY directory is not defined or do no exist !!!!!! Please select a valid PATH_DIR_RUN_NIGHTLY "
exit 1
fi
# Directory of the library used in the FAUST PROJECT
export OPENBLASDIR='/home/aleman/library/OpenBLAS'
export MATIODIR='/home/aleman/library/matio-1.5.3/src/.libs'
export MATIODIRINC='/home/aleman/library/matio-1.5.3/src'
export CUDADIR='/usr/local/cuda-6.5'
export EIGENDIR='/usr/local/include/eigen3'
# export version of gcc
#export CC=/usr/lib64/ccache/gcc
#export CXX=/usr/lib64/ccache/g++
export CC='/usr/bin/gcc'
export CXX='/usr/bin/g++'
# /usr/local/bin/matlab in the PATH
# /usr/bin/gcc
#export PATH=/usr/local/cuda-6.5/bin:/usr/local/bin:$PATH
export PATH=/usr/local/cuda-6.5/bin:/usr/local/bin:/usr/bin:$PATH
# CTEST OPTION
export CTEST_CONFIGURE_OPTIONS="-DBUILD_DEBUG:BOOL=OFF;\
-DDASH_TESTING:BOOL=ON;\
-DBUILD_COVERAGE:BOOL=ON;\
-DFAUST_USE_OPENBLAS=ON;\
-DFAUST_USE_MATIO=ON;\
-DFAUST_USE_XML=ON;\
-DFAUST_USE_MEX=OFF;\
-DFAUST_USE_GPU:BOOL=OFF;\
-DFAUST_USE_PROFILING=OFF;\
-DFAUST_ISVERBOSE=OFF;\
-DFAUST_GEN_DOC:BOOL=OFF"
cd $PATH_DIR_RUN_NIGHTLY
rm -rf faust_test
rm -rf faust_test_build
rm -rf faust_output
mkdir faust_test
mkdir faust_test_build
mkdir faust_output
# launch ctest file
ctest -VV -C Release -S faustTest.cmake
##################################################################
####################### run_nightly ##############################
# This shell-bash SCRIPT performs :
# - svn checkout
# - compile the selected target of faust project
# - run some examples relating to these targets.
#
# faust_test directory contains the sources of the faust project.
# faust_test_build directory contains the build of faust project.
# faust_output directory contains the build of faust project.
#
# WARNING : Please adjust your environment variables, corresponding
# to your computer configurations (library path)
#
# svn checkout --username XXX https://scm.gforge.inria.fr/authscm/XXX/svn/faust/trunk/devcpp/test/CTest_nightly ./
#
###################################################################
# Directory of the library used in the FAUST PROJECT
export PATH=$PATH:/usr/local/MATLAB/R2014b/bin;
export PATH=$PATH:usr/local/include
# Directory of the local path of the nightly project
export PATH_DIR_RUN_NIGHTLY='/home/ci/faust_nightly'
export OPENBLASDIR='/home/ci/local/OPENBLAS'
export HDF5_ROOT_DIR='/home/ci/local/HDF5/lib'
export EIGENDIR='/home/ci/Library/eigen-eigen-07105f7124f9'
#export MATIODIR=/usr/local
#export CUDADIR=/usr/local/cuda-6.5
# export version of gcc
# export CC=/usr/lib64/ccache/gcc
# export CXX=/usr/lib64/ccache/g++
# /usr/local/bin/matlab in the PATH
#export PATH=/usr/local/cuda-7.5/bin:/usr/local/bin:$PATH
#export PATH=/usr/local/cuda-7.5/bin:/usr/local/bin:/usr/lib64/ccache/:$PATH
if [ ! -d "$PATH_DIR_RUN_NIGHTLY" ];
then
echo "ERROR : $PATH_DIR_RUN_NIGHTLY directory is not defined or do no exist !!!!!! Please select a valid PATH_DIR_RUN_NIGHTLY "
exit 1
fi
# CTEST OPTION
export CTEST_CONFIGURE_OPTIONS="-DBUILD_DEBUG:BOOL=OFF;\
-DDASH_TESTING:BOOL=ON;\
-DBUILD_COVERAGE:BOOL=ON;\
-DFAUST_USE_OPENBLAS=ON;\
-DFAUST_USE_MATIO=ON;\
-DFAUST_USE_XML=ON;\
-DFAUST_USE_MEX=OFF;\
-DFAUST_USE_GPU:BOOL=OFF;\
-DFAUST_USE_PROFILING=OFF;\
-DFAUST_ISVERBOSE=OFF;\
-DFAUST_GEN_DOC:BOOL=OFF"
cd $PATH_DIR_RUN_NIGHTLY
rm -rf ./faust_test
rm -rf ./faust_test_build
rm -rf ./faust_output
mkdir ./faust_test
mkdir ./faust_test_build
mkdir ./faust_output
# launch ctest file
ctest -VV -C Release -S faustTest.cmake
<?xml version="1.0" encoding="ISO-8859-1"?>
<hierarchical_fact>
<nb_fact>6</nb_fact>
<data>MEG_data.txt</data>
<niter1>200</niter1>
<niter2>200</niter2>
<verbose>1</verbose>
<updatewayR2L>0</updatewayR2L>
<factsideleft>0</factsideleft>
<init_lambda>1</init_lambda>
<constraints>
<row1>
<constraint>
<type>splin</type>
<dim1>8193</dim1>
<dim2>204</dim2>
<parameter>15</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>1632</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>1632</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>1632</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>1632</parameter>
</constraint>
</row1>
<row2>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>41616</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>46610</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>37288</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>29830</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>204</dim1>
<dim2>204</dim2>
<parameter>23864</parameter>
</constraint>
</row2>
</constraints>
</hierarchical_fact>
\ No newline at end of file
<?xml version="1.0" encoding="ISO-8859-1"?>
<hierarchical_fact>
<nb_fact>4</nb_fact>
<niter1>200</niter1>
<niter2>200</niter2>
<verbose>0</verbose>
<updatewayR2L>0</updatewayR2L>
<factsideleft>0</factsideleft>
<constantstepsize>0</constantstepsize>
<stepsize>0.0001</stepsize>
<init_lambda>1</init_lambda>
<constraints>
<row1>
<constraint>
<type>splin</type>
<dim1>500</dim1>
<dim2>32</dim2>
<parameter>5</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>96</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>96</parameter>
</constraint>
</row1>
<row2>
<constraint>
<type>normcol</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>1</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>666</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>333</parameter>
</constraint>
</row2>
</constraints>
</hierarchical_fact>
<?xml version="1.0" encoding="ISO-8859-1"?>
<palm4MSA>
<nb_fact>4</nb_fact>
<niter>200</niter>
<verbose>0</verbose>
<updatewayR2L>0</updatewayR2L>
<init_lambda>1</init_lambda>
<constraints>
<constraint>
<type>splin</type>
<dim1>500</dim1>
<dim2>32</dim2>
<parameter>5</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>96</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>96</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>333</parameter>
</constraint>
</constraints>
<constantstepsize>1</constantstepsize>
<stepsize>0.0001</stepsize>
</palm4MSA>
<?xml version="1.0" encoding="ISO-8859-1"?>
<hierarchical_fact>
<nb_fact>4</nb_fact>
<niter1>200</niter1>
<niter2>200</niter2>
<verbose>0</verbose>
<updatewayR2L>1</updatewayR2L>
<factsideleft>1</factsideleft>
<constantstepsize>0</constantstepsize>
<stepsize>0.0001</stepsize>
<init_lambda>1</init_lambda>
<constraints>
<row1>
<constraint>
<type>normlin</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>1</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>666</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>333</parameter>
</constraint>
</row1>
<row2>
<constraint>
<type>spcol</type>
<dim1>32</dim1>
<dim2>500</dim2>
<parameter>5</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>96</parameter>
</constraint>
<constraint>
<type>sp</type>
<dim1>32</dim1>
<dim2>32</dim2>
<parameter>96</parameter>
</constraint>
</row2>
</constraints>
</hierarchical_fact>
\ No newline at end of file
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.4
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/aleman/WORK/FAUST/faust_v1.10")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/aleman/WORK/FAUST/faust_v1.10/misc/demo")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
0
file(GLOB MATLAB_SCRIPTS "*.m")
file(GLOB MATLAB_SCRIPTS "*.m")
# configure_file(${FAUST_MEXINTERFACETOOLS_SRC_DIR}/matlab_faust.m.in ${FAUST_TESTMATLABSCRIPT_BIN_DIR}/matlab_faust.m COPYONLY)
if(FAUST_USE_MEX)
foreach(matlab_script localize_src.m figure_localize_src.m)
configure_file(${FAUST_DEMO_SRC_DIR}/${matlab_script} ${FAUST_DEMO_BIN_DIR}/${matlab_script} COPYONLY)
endforeach()
configure_file(${FAUST_DEMO_SRC_DIR}/set_path.m.in ${FAUST_DEMO_BIN_DIR}/set_path.m @ONLY)
endif()
# CMake generated Testfile for
# Source directory: /home/aleman/WORK/FAUST/faust_v1.10/misc/demo
# Build directory: /home/aleman/WORK/FAUST/faust_v1.10/misc/demo
#
# This file includes the relevant testing commands required for
# testing this directory and lists subdirectories to be tested as well.
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.4
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/aleman/WORK/FAUST/faust_v1.10
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/aleman/WORK/FAUST/faust_v1.10/build
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: install/strip
.PHONY : install/strip/fast
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: install/local
.PHONY : install/local/fast
# Special rule for the target test
test:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
/usr/bin/ctest --force-new-ctest-process $(ARGS)
.PHONY : test
# Special rule for the target test
test/fast: test
.PHONY : test/fast
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
/usr/bin/cmake-gui -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# The main all target
all: cmake_check_build_system
cd /home/aleman/WORK/FAUST/faust_v1.10/build && $(CMAKE_COMMAND) -E cmake_progress_start /home/aleman/WORK/FAUST/faust_v1.10/build/CMakeFiles /home/aleman/WORK/FAUST/faust_v1.10/misc/demo/CMakeFiles/progress.marks
cd /home/aleman/WORK/FAUST/faust_v1.10/build && $(MAKE) -f CMakeFiles/Makefile2 ../misc/demo/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/aleman/WORK/FAUST/faust_v1.10/build/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
cd /home/aleman/WORK/FAUST/faust_v1.10/build && $(MAKE) -f CMakeFiles/Makefile2 ../misc/demo/clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
cd /home/aleman/WORK/FAUST/faust_v1.10/build && $(MAKE) -f CMakeFiles/Makefile2 ../misc/demo/preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
cd /home/aleman/WORK/FAUST/faust_v1.10/build && $(MAKE) -f CMakeFiles/Makefile2 ../misc/demo/preinstall
.PHONY : preinstall/fast
# clear depends
depend:
cd /home/aleman/WORK/FAUST/faust_v1.10/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... list_install_components"
@echo "... install"
@echo "... rebuild_cache"
@echo "... install/strip"
@echo "... install/local"
@echo "... test"
@echo "... edit_cache"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
cd /home/aleman/WORK/FAUST/faust_v1.10/build && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
# Install script for directory: /home/aleman/WORK/FAUST/faust_v1.10/misc/demo
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/home/aleman/WORK/FAUST/faust_v1.10/FAuST_OUTPUT")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "Debug")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "0")
endif()
close all
clear all
set_path
load 'results_localise_src'
%% convergence analysis
d1 = cat(4,resDist(:,1,1,:),resDist(:,1,2,:));
d2 = cat(4,resDist(:,2,1,:),resDist(:,2,2,:));
d3 = cat(4,resDist(:,3,1,:),resDist(:,3,2,:));
test2 = 100*[squeeze(d1);zeros(1,1000);squeeze(d2);zeros(1,1000);squeeze(d3)];
%boxPlot(test2')
figure('color',[1 1 1]);
T = bplot(test2','linewidth',1.5);
legend(T)
% title('OMP')
ylabel('Distance between true and estimated sources (cm)')
box on
ax = gca;
x_tick=[1:nb_approx_MEG+1;nb_approx_MEG+3:2*nb_approx_MEG+3;2*nb_approx_MEG+5:3*nb_approx_MEG+5];
mean_x_tick = round(mean(x_tick,2));
set(ax,'XTick',reshape(x_tick',1,numel(x_tick)));
set(ax,'xticklabel', [])
axi = axis;
axis([0 3*(nb_approx_MEG+2) -0.3 4.7])
HorizontalOffset = 10;
verticalOffset = 0.43;
verticalOffset2 = 0.7;
yTicks = get(ax,'ytick');
xTicks = get(ax, 'xtick');
minY = min(yTicks);
text(xTicks(1), minY - verticalOffset, '$\mathbf{M}$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(2+nb_approx_MEG), minY - verticalOffset, '$\mathbf{M}$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(1+2*(nb_approx_MEG+1)), minY - verticalOffset, '$\mathbf{M}$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(round(mean(1:(nb_approx_MEG+1)))), minY - verticalOffset2, '$1<d<5$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(round(mean(nb_approx_MEG+2:2*(nb_approx_MEG+1)))), minY - verticalOffset2, '$5<d<8$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(round(mean(2*(nb_approx_MEG+1)+1:3*(nb_approx_MEG+1)))), minY - verticalOffset2, '$d>8$','HorizontalAlignment','center','interpreter', 'latex');
for i=1:nb_approx_MEG
text(xTicks(i+1), minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) '}$' ],'HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(i+2+nb_approx_MEG), minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) ' }$' ],'HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(i+1+2*(nb_approx_MEG+1)), minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) ' }$' ],'HorizontalAlignment','center','interpreter', 'latex');
end
%% MATLAB convergence analysis
d1 = cat(4,resDist_matlab(:,1,1,:),resDist_matlab(:,1,2,:));
d2 = cat(4,resDist_matlab(:,2,1,:),resDist_matlab(:,2,2,:));
d3 = cat(4,resDist_matlab(:,3,1,:),resDist_matlab(:,3,2,:));
test2 = 100*[squeeze(d1);zeros(1,1000);squeeze(d2);zeros(1,1000);squeeze(d3)];
%boxPlot(test2')
figure('color',[1 1 1]);
title('MATLAB');
T = bplot(test2','linewidth',1.5);
legend(T)
% title('OMP')
ylabel('Distance between true and estimated sources (cm)')
box on
ax = gca;
x_tick=[1:nb_approx_MEG+1;nb_approx_MEG+3:2*nb_approx_MEG+3;2*nb_approx_MEG+5:3*nb_approx_MEG+5];
mean_x_tick = round(mean(x_tick,2));
set(ax,'XTick',reshape(x_tick',1,numel(x_tick)));
set(ax,'xticklabel', [])
axi = axis;
axis([0 3*(nb_approx_MEG+2) -0.3 4.7])
HorizontalOffset = 10;
verticalOffset = 0.43;
verticalOffset2 = 0.7;
yTicks = get(ax,'ytick');
xTicks = get(ax, 'xtick');
minY = min(yTicks);
text(xTicks(1), minY - verticalOffset, '$\mathbf{M}$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(2+nb_approx_MEG), minY - verticalOffset, '$\mathbf{M}$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(1+2*(nb_approx_MEG+1)), minY - verticalOffset, '$\mathbf{M}$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(round(mean(1:(nb_approx_MEG+1)))), minY - verticalOffset2, '$1<d<5$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(round(mean(nb_approx_MEG+2:2*(nb_approx_MEG+1)))), minY - verticalOffset2, '$5<d<8$','HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(round(mean(2*(nb_approx_MEG+1)+1:3*(nb_approx_MEG+1)))), minY - verticalOffset2, '$d>8$','HorizontalAlignment','center','interpreter', 'latex');
for i=1:nb_approx_MEG
text(xTicks(i+1), minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) '}$' ],'HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(i+2+nb_approx_MEG), minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) ' }$' ],'HorizontalAlignment','center','interpreter', 'latex');
text(xTicks(i+1+2*(nb_approx_MEG+1)), minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) ' }$' ],'HorizontalAlignment','center','interpreter', 'latex');
end
%% time comparison
timeS = cat(3,compute_Times(:,1,:),compute_Times(:,2,:),compute_Times(:,3,:));
timeS = squeeze(1000*timeS)';
%boxPlot(test2')
figure('color',[1 1 1]);
T = bplot(timeS,'linewidth',1.5);
legend(T)
% title('OMP')
ylabel('Computed Time (ms)')
box on
ax = gca;
x_tick=[1:nb_approx_MEG+1];
mean_x_tick = round(mean(x_tick,2));
set(ax,'XTick',x_tick');
set(ax,'xticklabel', [])
axi = axis;
% axis([0 3*(nb_approx_MEG+2) -0.3 4.7])
% xlim([0 3*(nb_approx_MEG]);
HorizontalOffset = 10;
verticalOffset = 0.5;
verticalOffset2 = 1;
yTicks = get(ax,'ytick');
xTicks = get(ax, 'xtick');
minY = min(yTicks);
text(xTicks(1), minY - verticalOffset, '$\mathbf{M}$','HorizontalAlignment','center','interpreter', 'latex');
for i=1:nb_approx_MEG
text(xTicks(i+1), minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) '}$' ],'HorizontalAlignment','center','interpreter', 'latex');
end
%% MATLAB time comparison
timeS_matlab = cat(3,compute_Times_matlab(:,1,:),compute_Times_matlab(:,2,:),compute_Times_matlab(:,3,:));
timeS_matlab = squeeze(1000*timeS_matlab)';
%boxPlot(test2')
figure('color',[1 1 1]);
T = bplot(timeS_matlab,'linewidth',1.5);
legend(T)
% title('OMP')
ylabel('Computed Time (ms)')
box on
ax = gca;
x_tick=[1:nb_approx_MEG+1];
mean_x_tick = round(mean(x_tick,2));
set(ax,'XTick',x_tick');
set(ax,'xticklabel', [])
axi = axis;
% axis([0 3*(nb_approx_MEG+2) -0.3 4.7])
% xlim([0 3*(nb_approx_MEG]);
HorizontalOffset = 10;
verticalOffset = 0.5;
verticalOffset2 = 1;
yTicks = get(ax,'ytick');
xTicks = get(ax, 'xtick');
minY = min(yTicks);
text(xTicks(1), minY - verticalOffset, '$\mathbf{M}$','HorizontalAlignment','center','interpreter', 'latex');
for i=1:nb_approx_MEG
text(xTicks(i+1), minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) '}$' ],'HorizontalAlignment','center','interpreter', 'latex');
end
title('MATLAB');
%% speed-up
mean_Times=mean(timeS);
mean_Times_matlab=mean(timeS_matlab);
dense_matrix_time=mean_Times(1);
real_RCG=dense_matrix_time./mean_Times;
real_RCG_matlab=dense_matrix_time./mean_Times_matlab;
figure,
ax = gca;
set(ax,'xticklabel', [])
set(ax,'Visible','off');
plot(1:nb_approx_MEG,RCG_approxS_MEG,'linewidth',1.5);
set(ax,'XTick',[]);
hold on
plot(1:nb_approx_MEG,real_RCG(2:end),'linewidth',1.5);
plot(1:nb_approx_MEG,real_RCG_matlab(2:end),'linewidth',1.5);
verticalOffset=1.01;
for i=1:nb_approx_MEG
text(i, minY - verticalOffset, ['$\widehat{\mathbf{M}}_{' int2str(RCG_approxS_MEG(i)) '}$' ],'HorizontalAlignment','center','interpreter', 'latex');
end
legend('theoretical RCG','speed up faust','speed up MATLAB');
%% This is an example of a little experience of source localization in magnetoencephalography (MEG) using faust factorisation for speed-up the calculus,
%% the sparse algorithm used is greed_omp_chol from the toolbox smallbox2.0/Sparsify/GreedLab under GNU GPL 2.0 License
%% to show the different performance figure run figure_localisze_src after this script
clear all
close all
clc
set_path;
RCG_approxS_MEG=[6,8,16,25];
nb_approx_MEG = length(RCG_approxS_MEG);
MEG_approxS_norm = cell(1,nb_approx_MEG);
%Loading of the MEG matrix
load 'X_meg.mat'
load curv.mat
points2 = points;
points = points(points_used_idx,:);
X = X_fixed;
%X = randn(size(X_fixed));
%X_norm = X;
X_norm = X./repmat(sqrt(sum(X.^2,1)),size(X,1),1);
%Loading of the MEG matrix approximations
MEG_faustS=cell(1,nb_approx_MEG);
faustS_mult=cell(1,nb_approx_MEG);
trans_faustS_mult=cell(1,nb_approx_MEG);
matlab_faustS_mult=cell(1,nb_approx_MEG);
matlab_trans_faustS_mult=cell(1,nb_approx_MEG);
for i=1:nb_approx_MEG
RCG_approxS_MEG(i);
load(['M_' int2str(RCG_approxS_MEG(i))]);
facts{1}=lambda*facts{1};
X_approx =dvp(facts);
%X_hat = X' + 0.05*randn(size(X'));
X_approx = X_approx'; X_approx(:,sum(X_approx.^2,1)==0)=1;
%X_hat_norm = X_hat;
X_norm_approx = X_approx./repmat(sqrt(sum(X_approx.^2,1)),size(X_approx,1),1);
MEG_approxS_norm{i}=X_norm_approx;
%% structure faust
facts{1}=facts{1}./repmat(sqrt(sum(X_approx.^2,1)),size(X_approx,1),1)';% normalisation of the row dvp(facts)
sp_facts_trans = make_sparse(facts);
sp_facts = faust_transpose(sp_facts_trans);
trans_fc=matlab_faust(facts);
fc=transpose(trans_fc);
% f=@(x) x/2;
matlab_trans_faustS_mult{i}=@(x) f_mult(sp_facts_trans,x);
matlab_faustS_mult{i}=@(x) f_mult(sp_facts,x);
trans_faustS_mult{i}=@(x) trans_fc*x;
faustS_mult{i}=@(x) fc*x;
MEG_faustS{i}=trans_fc;
% eval(['function y = fc_mult' int2str(i) '(x) y=fc*x;end']);
% eval(['foncteur{i}=@fc_mult' int2str(i) ';']);
end
Ntraining = 500; % Number of training vectors
Sparsity = 2; % Number of sources per training vector
dist_paliers = [0.01,0.05,0.08]; dist_paliers = [dist_paliers, 0.5];
resDist = zeros(nb_approx_MEG+1,numel(dist_paliers)-1,Sparsity,Ntraining); % (Matrice,mthode,dist_sources,src_nb,run);
compute_Times = zeros(nb_approx_MEG+1,numel(dist_paliers)-1,Ntraining);
resDist_matlab = zeros(nb_approx_MEG+1,numel(dist_paliers)-1,Sparsity,Ntraining); % (Matrice,mthode,dist_sources,src_nb,run);
compute_Times_matlab = zeros(nb_approx_MEG+1,numel(dist_paliers)-1,Ntraining);
for k=1:numel(dist_paliers)-1
disp(['k=' num2str(k) '/' num2str(numel(dist_paliers)-1)])
%Parameters settings
Gamma = zeros(size(X_norm,2),Ntraining);
for ii=1:Ntraining
%disp(num2str(ii));
dist_sources = -1;
while ~((dist_paliers(k)<dist_sources)&&(dist_sources<dist_paliers(k+1)))
Gamma(:,ii) = sparse_coeffs(X_norm, 1, Sparsity); %
idx = find(Gamma(:,ii));
dist_sources = norm(points(idx(1)) - points(idx(2)));
end
% dist_sources = norm(points(idx(1)) - points(idx(2)))
end
Data = X_norm*Gamma;
sol_ist = zeros(size(Gamma));
sol_ist_hat = zeros(size(Gamma));
sol_ist_hat2 = zeros(size(Gamma));
err_ist = zeros(2,Ntraining);
err_ist_hat = zeros(2,Ntraining);
err_ist_hat2 = zeros(2,Ntraining);
dist_ist = zeros(Sparsity,Ntraining);
dist_ist_hat = zeros(Sparsity,Ntraining);
dist_ist_hat2 = zeros(Sparsity,Ntraining);
sol_iht = zeros(size(Gamma));
sol_iht_hat = zeros(size(Gamma));
sol_iht_hat2 = zeros(size(Gamma));
err_iht = zeros(2,Ntraining);
err_iht_hat = zeros(2,Ntraining);
err_iht_hat2 = zeros(2,Ntraining);
dist_iht = zeros(Sparsity,Ntraining);
dist_iht_hat = zeros(Sparsity,Ntraining);
dist_iht_hat2 = zeros(Sparsity,Ntraining);
sol_omp = zeros(size(Gamma));
sol_omp_hat = zeros(size(Gamma));
sol_omp_hat2 = zeros(size(Gamma));
err_omp = zeros(2,Ntraining);
err_omp_hat = zeros(2,Ntraining);
err_omp_hat2 = zeros(2,Ntraining);
diff_omp = zeros(2,Ntraining);
dist_omp = zeros(Sparsity,Ntraining);
dist_omp_hat = zeros(Sparsity,Ntraining);
dist_omp_hat2 = zeros(Sparsity,Ntraining);
for i=1:Ntraining
disp([' i=' num2str(i) '/' num2str(Ntraining)])
idx = find(Gamma(:,i));
dist_sources = norm(points(idx(1)) - points(idx(2)));
%l1 solving
tol = 1e-4;
lambda = 0.3;
%OMP solving
tic
[sol_omp(:,i), err_mse_omp, iter_time_omp]=greed_omp_chol(Data(:,i),X_norm,size(X_norm,2),'stopTol',1*Sparsity);
t1=toc;
err_omp(1,i) = norm(X_norm*Gamma(:,i)-X_norm*sol_omp(:,i))/norm(X_norm*Gamma(:,i));
err_omp(2,i) = isequal(find(Gamma(:,i)),find(sol_omp(:,i)>1e-4));
idx_omp = find(sol_omp(:,i));
resDist(1,k,1,i) = min(norm(points(idx(1)) - points(idx_omp(1))),norm(points(idx(1)) - points(idx_omp(2))));
resDist(1,k,2,i) = min(norm(points(idx(2)) - points(idx_omp(1))),norm(points(idx(2)) - points(idx_omp(2))));
compute_Times(1,k,i)=t1;
resDist_matlab(1,k,1,i) = min(norm(points(idx(1)) - points(idx_omp(1))),norm(points(idx(1)) - points(idx_omp(2))));
resDist_matlab(1,k,2,i) = min(norm(points(idx(2)) - points(idx_omp(1))),norm(points(idx(2)) - points(idx_omp(2))));
compute_Times_matlab(1,k,i)=t1;
for ll=1:nb_approx_MEG
X_approx_norm = MEG_approxS_norm{ll};
% [sol_omp_hat(:,i), err_mse_omp_hat, iter_time_omp_hat]=greed_omp_chol(Data(:,i),X_approx_norm,size(X_approx_norm,2),'stopTol',1*Sparsity);
tic
[sol_omp_hat(:,i), err_mse_omp_hat, iter_time_omp_hat]=greed_omp_chol(Data(:,i),faustS_mult{ll},size(X_approx_norm,2),'stopTol',1*Sparsity,'P_trans',trans_faustS_mult{ll});
t1=toc;
err_omp_hat(1,i) = norm(X_norm*Gamma(:,i)-X_approx_norm*sol_omp_hat(:,i))/norm(X_norm*Gamma(:,i));
err_omp_hat(2,i) = isequal(find(Gamma(:,i)),find(sol_omp_hat(:,i)>1e-4));
idx_omp = find(sol_omp_hat(:,i));
resDist(ll+1,k,1,i) = min(norm(points(idx(1)) - points(idx_omp(1))),norm(points(idx(1)) - points(idx_omp(2))));
resDist(ll+1,k,2,i) = min(norm(points(idx(2)) - points(idx_omp(1))),norm(points(idx(2)) - points(idx_omp(2))));
compute_Times(ll+1,k,i)=t1;
tic
[sol_omp_hat(:,i), err_mse_omp_hat, iter_time_omp_hat]=greed_omp_chol(Data(:,i),matlab_faustS_mult{ll},size(X_approx_norm,2),'stopTol',1*Sparsity,'P_trans',matlab_trans_faustS_mult{ll});
t2=toc;
err_omp_hat(1,i) = norm(X_norm*Gamma(:,i)-X_approx_norm*sol_omp_hat(:,i))/norm(X_norm*Gamma(:,i));
err_omp_hat(2,i) = isequal(find(Gamma(:,i)),find(sol_omp_hat(:,i)>1e-4));
idx_omp = find(sol_omp_hat(:,i));
resDist_matlab(ll+1,k,1,i) = min(norm(points(idx(1)) - points(idx_omp(1))),norm(points(idx(1)) - points(idx_omp(2))));
resDist_matlab(ll+1,k,2,i) = min(norm(points(idx(2)) - points(idx_omp(1))),norm(points(idx(2)) - points(idx_omp(2))));
compute_Times_matlab(ll+1,k,i)=t2;
% % faust
% [sol_omp_hat(:,i), err_mse_omp_hat, iter_time_omp_hat]=greed_omp_chol(Data(:,i),faustS_mult{ll},size(X_approx_norm,2),'stopTol',1*Sparsity,'P_trans',trans_faustS_mult{ll});
end
save('results_current','resDist','compute_Times');
end
end
toc
heure = clock ;
% save(['results_BSL_JOURNAL_6approx' date '-' num2str(heure(4)) '-' num2str(heure(5)) ],'resDist','RCG_approxS_MEG','nb_approx_MEG','compute_Times','RCG_approxS_MEG');
save('results_localise_src','resDist','resDist_matlab','RCG_approxS_MEG','nb_approx_MEG','compute_Times','compute_Times_matlab', 'RCG_approxS_MEG');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment