Rename all beamforming to lasp. In all source code.

This commit is contained in:
Anne de Jong 2018-02-23 20:40:45 +01:00 committed by Anne de Jong
parent 49bc02ed16
commit c55d3b1e17
44 changed files with 268 additions and 269 deletions

7
.gitignore vendored
View File

@ -2,15 +2,14 @@
CMakeFiles CMakeFiles
CMakeCache.txt CMakeCache.txt
cmake_install.cmake cmake_install.cmake
Beamforming.egg-info lasp/*.cpp
beamforming/*.cpp
Makefile Makefile
build build
*.html *.html
__pycache__ __pycache__
cython_debug cython_debug
beamforming/config.pxi lasp/config.pxi
beamforming/wrappers.c lasp/wrappers.c
*.so *.so
test/test_bf test/test_bf
test/test_fft test/test_fft

View File

@ -2,47 +2,47 @@ cmake_minimum_required (VERSION 3.0)
project(beamforming) project(beamforming)
# Whether we want to use blas yes or no # Whether we want to use blas yes or no
set(ASCEE_USE_BLAS TRUE) set(LASP_USE_BLAS TRUE)
# set(ASCEE_USE_BLAS FALSE) # set(LASP_USE_BLAS FALSE)
set(ASCEE_FLOAT double) set(LASP_FLOAT double)
# set(ASCEE_FLOAT float) # set(LASP_FLOAT float)
add_definitions(-DASCEE_PARALLEL) add_definitions(-DLASP_PARALLEL)
add_definitions(-DASCEE_MAX_NUM_THREADS=8) add_definitions(-DLASP_MAX_NUM_THREADS=8)
add_definitions(-DASCEE_MAX_NUM_CHANNELS=80) add_definitions(-DLASP_MAX_NUM_CHANNELS=80)
# Reasonable maximum to the nfft size, at 48kHz this is 700s of data.. # Reasonable maximum to the nfft size, at 48kHz this is 700s of data..
add_definitions(-DASCEE_MAX_NFFT=33554432) # 2**25 add_definitions(-DLASP_MAX_NFFT=33554432) # 2**25
# ####################################### End of user-adjustable variables section # ####################################### End of user-adjustable variables section
add_definitions(-D_REENTRANT) add_definitions(-D_REENTRANT)
if(ASCEE_FLOAT STREQUAL "double") if(LASP_FLOAT STREQUAL "double")
add_definitions(-DASCEE_FLOAT=64) add_definitions(-DLASP_FLOAT=64)
add_definitions(-DASCEE_DOUBLE_PRECISION) add_definitions(-DLASP_DOUBLE_PRECISION)
else() else()
add_definitions(-DASCEE_FLOAT=32) add_definitions(-DLASP_FLOAT=32)
endif(ASCEE_FLOAT STREQUAL "double") endif(LASP_FLOAT STREQUAL "double")
if(NOT DEFINED ASCEE_DEBUG) if(NOT DEFINED LASP_DEBUG)
message(SEND_ERROR "ASCEE_DEBUG flag not defined. Please set -DASCEE_DEBUG=TRUE or -DASCEE_DEBUG=FALSE") message(SEND_ERROR "LASP_DEBUG flag not defined. Please set -DLASP_DEBUG=TRUE or -DLASP_DEBUG=FALSE")
endif(NOT DEFINED ASCEE_DEBUG) endif(NOT DEFINED LASP_DEBUG)
# ##################### END Cmake variables converted to a macro # ##################### END Cmake variables converted to a macro
set(Python_ADDITIONAL_VERSIONS "3") set(Python_ADDITIONAL_VERSIONS "3")
# #################### Setting definitions and debug-specific compilation flags # #################### Setting definitions and debug-specific compilation flags
if(ASCEE_DEBUG) if(LASP_DEBUG)
set(TRACERNAME ASCEETracer) set(TRACERNAME LASPTracer)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
message("Building debug code") message("Building debug code")
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
add_definitions(-DASCEE_DEBUG=1) add_definitions(-DLASP_DEBUG=1)
add_definitions(-DTRACERNAME=${TRACERNAME}) add_definitions(-DTRACERNAME=${TRACERNAME})
add_definitions(-DDEBUG) add_definitions(-DDEBUG)
add_definitions(-DTRACER=1) add_definitions(-DTRACER=1)
@ -63,7 +63,7 @@ else()
# set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--gc-sections") # set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--gc-sections")
add_definitions(-DTRACER=0 -DNDEBUG) add_definitions(-DTRACER=0 -DNDEBUG)
endif(ASCEE_DEBUG) endif(LASP_DEBUG)
# The last argument here takes care of calling SIGABRT when an integer overflow # The last argument here takes care of calling SIGABRT when an integer overflow
# occures. # occures.
@ -84,11 +84,11 @@ set(CMAKE_C_FLAGS_RELEASE "-O2 -mfpmath=sse -march=x86-64 -mtune=native \
# set(CMAKE_C_FLAGS_RELEASE "-O2 -march=native -mtune=native -fomit-frame-pointer") # set(CMAKE_C_FLAGS_RELEASE "-O2 -march=native -mtune=native -fomit-frame-pointer")
if(ASCEE_USE_BLAS) if(LASP_USE_BLAS)
add_definitions(-DASCEE_USE_BLAS=1) add_definitions(-DLASP_USE_BLAS=1)
else() else()
add_definitions(-DASCEE_USE_BLAS=0) add_definitions(-DLASP_USE_BLAS=0)
endif(ASCEE_USE_BLAS) endif(LASP_USE_BLAS)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(win32 true) set(win32 true)
@ -109,9 +109,9 @@ endif(DEFINED NUMPY_INCLUDE)
add_subdirectory(fftpack) add_subdirectory(fftpack)
include_directories( include_directories(
fftpack fftpack
beamforming/c lasp/c
) )
add_subdirectory(beamforming) add_subdirectory(lasp)
add_subdirectory(test) add_subdirectory(test)
find_program(PYTHON "python") find_program(PYTHON "python")
@ -119,7 +119,7 @@ find_program(PYTHON "python")
if (PYTHON) if (PYTHON)
# set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in") # set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in")
set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py") set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py")
set(DEPS "${CMAKE_CURRENT_SOURCE_DIR}/beamforming/*.py") set(DEPS "${CMAKE_CURRENT_SOURCE_DIR}/lasp/*.py")
set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp") set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp")
# configure_file(${SETUP_PY_IN} ${SETUP_PY}) # configure_file(${SETUP_PY_IN} ${SETUP_PY})

View File

@ -8,7 +8,7 @@ extern "C" {
#endif #endif
#define NPY_VISIBILITY_HIDDEN #define NPY_VISIBILITY_HIDDEN
#ifdef ASCEE_DOUBLE_PRECISION #ifdef LASP_DOUBLE_PRECISION
#define Treal double #define Treal double
#else #else
#define Treal float #define Treal float

View File

@ -15,4 +15,4 @@ include_directories(
set_source_files_properties(wrappers.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} ${CYTHON_EXTRA_C_FLAGS}") set_source_files_properties(wrappers.c PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} ${CYTHON_EXTRA_C_FLAGS}")
cython_add_module(wrappers wrappers.pyx) cython_add_module(wrappers wrappers.pyx)
target_link_libraries(wrappers beamforming_lib ) target_link_libraries(wrappers lasp_lib )

View File

@ -1,23 +1,23 @@
if(!ASCEE_DEBUG) if(!LASP_DEBUG)
# SET_SOURCE_FILES_PROPERTIES(si_lpn.c PROPERTIES COMPILE_FLAGS -O3) # SET_SOURCE_FILES_PROPERTIES(y.c PROPERTIES COMPILE_FLAGS -O3)
# SET_SOURCE_FILES_PROPERTIES(si_math.c PROPERTIES COMPILE_FLAGS -O3) # SET_SOURCE_FILES_PROPERTIES(x.c PROPERTIES COMPILE_FLAGS -O3)
endif(!ASCEE_DEBUG) endif(!LASP_DEBUG)
add_library(beamforming_lib add_library(lasp_lib
fft.c lasp_fft.c
ascee_math.c lasp_math.c
ascee_math_raw.c lasp_math_raw.c
ascee_alg.c lasp_alg.c
ascee_assert.c lasp_assert.c
ascee_tracer.c lasp_tracer.c
window.c lasp_window.c
aps.c lasp_aps.c
ps.c lasp_ps.c
mq.c lasp_mq.c
worker.c lasp_worker.c
dfifo.c lasp_dfifo.c
filterbank.c lasp_filterbank.c
) )
target_link_libraries(beamforming_lib fftpack openblas) target_link_libraries(lasp_lib fftpack openblas)

View File

@ -1,11 +1,11 @@
// ascee_alg.c // lasp_alg.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
// Description: // Description:
// (Linear) algebra routine implementations // (Linear) algebra routine implementations
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "ascee_alg.h" #include "lasp_alg.h"
@ -15,7 +15,7 @@ void cmv_dot(const cmat* A,const vc* restrict x,vc* restrict b){
dbgassert(A->n_rows == b->size,SIZEINEQUAL); dbgassert(A->n_rows == b->size,SIZEINEQUAL);
dbgassert(A->n_cols == x->size,SIZEINEQUAL); dbgassert(A->n_cols == x->size,SIZEINEQUAL);
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
dbgassert(false,"Untested function"); dbgassert(false,"Untested function");
/* typedef enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102} CBLAS_ORDER; */ /* typedef enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102} CBLAS_ORDER; */
/* typedef enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113, CblasConjNoTrans=114} CBLAS_TRANSPOSE; */ /* typedef enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113, CblasConjNoTrans=114} CBLAS_TRANSPOSE; */
@ -108,7 +108,7 @@ lapack_int LAPACKE_zgels( int matrix_layout, char trans, lapack_int m,
#if ASCEE_FLOAT == 64 #if LASP_FLOAT == 64
#define lapack_gelss LAPACKE_zgelss #define lapack_gelss LAPACKE_zgelss
#define lapack_gels LAPACKE_zgels #define lapack_gels LAPACKE_zgels

View File

@ -1,4 +1,4 @@
// ascee_alg.h // lasp_alg.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,9 +6,9 @@
// (Linear) algebra routines on matrices and vectors // (Linear) algebra routines on matrices and vectors
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef ASCEE_ALG_H #ifndef LASP_ALG_H
#define ASCEE_ALG_H #define LASP_ALG_H
#include "ascee_math.h" #include "lasp_math.h"
/** /**
* Compute the dot product of two vectors of floats * Compute the dot product of two vectors of floats
@ -185,5 +185,5 @@ d cmat_normdiff(const cmat* A,const cmat* B);
*/ */
void kronecker_product(const cmat* a,const cmat* b,cmat* result); void kronecker_product(const cmat* a,const cmat* b,cmat* result);
#endif // ASCEE_ALG_H #endif // LASP_ALG_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,4 @@
// ascee_alloc.h // lasp_alloc.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,10 +6,10 @@
// memory allocation functions. // memory allocation functions.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef ASCEE_ALLOC_H #ifndef LASP_ALLOC_H
#define ASCEE_ALLOC_H #define LASP_ALLOC_H
#include <malloc.h> #include <malloc.h>
#include "ascee_tracer.h" #include "lasp_tracer.h"
/** /**
* Reserved words for memory allocation. Can be changed to something * Reserved words for memory allocation. Can be changed to something
* else when required. For example for debugging purposes. * else when required. For example for debugging purposes.
@ -24,5 +24,5 @@ static inline void* a_malloc(size_t nbytes) {
#define a_free free #define a_free free
#define a_realloc realloc #define a_realloc realloc
#endif // ASCEE_ALLOC_H #endif // LASP_ALLOC_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,4 @@
// aps.c // lasp_aps.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
@ -6,10 +6,10 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#define TRACERPLUS (-5) #define TRACERPLUS (-5)
#include "aps.h" #include "lasp_aps.h"
#include "ps.h" #include "lasp_ps.h"
#include "ascee_alg.h" #include "lasp_alg.h"
#include "dfifo.h" #include "lasp_dfifo.h"
/* Multiplication factor for the maximum size of the fifo queue. This /* Multiplication factor for the maximum size of the fifo queue. This
* factor is multiplied by nfft to obtain the maximum size of the * factor is multiplied by nfft to obtain the maximum size of the
@ -65,7 +65,7 @@ AvPowerSpectra* AvPowerSpectra_alloc(const us nfft,
fsTRACE(15); fsTRACE(15);
/* Check nfft */ /* Check nfft */
if(nfft==0 || nfft % 2 != 0 || nfft > ASCEE_MAX_NFFT) { if(nfft==0 || nfft % 2 != 0 || nfft > LASP_MAX_NFFT) {
WARN("Invalid nfft"); WARN("Invalid nfft");
feTRACE(15); feTRACE(15);
return NULL; return NULL;

View File

@ -6,11 +6,11 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef APS_H #ifndef LASP_APS_H
#define APS_H #define LASP_APS_H
#include "types.h" #include "lasp_types.h"
#include "ascee_math.h" #include "lasp_math.h"
#include "window.h" #include "lasp_window.h"
typedef struct AvPowerSpectra_s AvPowerSpectra; typedef struct AvPowerSpectra_s AvPowerSpectra;
@ -74,5 +74,5 @@ cmat* AvPowerSpectra_addTimeData(AvPowerSpectra* aps,
void AvPowerSpectra_free(AvPowerSpectra*); void AvPowerSpectra_free(AvPowerSpectra*);
#endif // APS_H #endif // LASP_APS_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,16 +1,16 @@
// ascee_assert.c // lasp_assert.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
// Description: // Description:
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "ascee_assert.h" #include "lasp_assert.h"
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "types.h" #include "lasp_types.h"
#define MAX_MSG 200 #define MAX_MSG 200
void DBG_AssertFailedExtImplementation(const char* filename, void DBG_AssertFailedExtImplementation(const char* filename,

View File

@ -1,4 +1,4 @@
// dfifo.c // lasp_dfifo.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
@ -6,7 +6,7 @@
// Implementation of the dFifo queue // Implementation of the dFifo queue
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#define TRACERPLUS (-5) #define TRACERPLUS (-5)
#include "dfifo.h" #include "lasp_dfifo.h"
typedef struct dFifo_s { typedef struct dFifo_s {
dmat queue; dmat queue;

View File

@ -1,4 +1,4 @@
// dfifo.h // lasp_dfifo.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,10 +6,11 @@
// API of a contiguous fifo buffer of samples. // API of a contiguous fifo buffer of samples.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef DFIFO_H #ifndef LASP_DFIFO_H
#define DFIFO_H #define LASPDFIFO_H
#include "types.h" #include "lasp_types.h"
#include "ascee_math.h" #include "lasp_math.h"
typedef struct dFifo_s dFifo; typedef struct dFifo_s dFifo;
/** /**
@ -67,6 +68,6 @@ us dFifo_size(dFifo* fifo);
*/ */
void dFifo_free(dFifo* fifo); void dFifo_free(dFifo* fifo);
#endif // DFIFO_H #endif // LASP_DFIFO_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,4 @@
// fft.cpp // lasp_fft.c
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,9 +6,9 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#define TRACERPLUS (-5) #define TRACERPLUS (-5)
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include "fft.h" #include "lasp_fft.h"
#include "types.h" #include "lasp_types.h"
#include "fftpack.h" #include "fftpack.h"
typedef struct Fft_s { typedef struct Fft_s {

View File

@ -1,4 +1,4 @@
// fft.h // lasp_fft.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,10 +6,10 @@
// Interface to the FFT library, multiple channel FFT's // Interface to the FFT library, multiple channel FFT's
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef FFT_H #ifndef LASP_FFT_H
#define FFT_H #define LASP_FFT_H
#include "types.h" #include "lasp_types.h"
#include "ascee_math.h" #include "lasp_math.h"
/** /**
* Perform forward FFT's on real time data. * Perform forward FFT's on real time data.
@ -82,5 +82,5 @@ void Fft_ifft(const Fft* fft,const cmat* freqdata,dmat* timedata);
*/ */
void Fft_free(Fft* fft); void Fft_free(Fft* fft);
#endif // FFT_H #endif // LASP_FFT_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,15 +1,15 @@
// filterbank.c // lasp_filterbank.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
// Description: // Description:
// FilterBank implementation. // FilterBank implementation.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "filterbank.h" #include "lasp_filterbank.h"
#include "fft.h" #include "lasp_fft.h"
#include "dfifo.h" #include "lasp_dfifo.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include "ascee_alg.h" #include "lasp_alg.h"
#define FIFO_SIZE_MULT 2 #define FIFO_SIZE_MULT 2
typedef struct FilterBank_s { typedef struct FilterBank_s {

View File

@ -1,4 +1,4 @@
// filterbank.h // lasp_filterbank.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -12,8 +12,8 @@
#pragma once #pragma once
#ifndef FILTERBANK_H #ifndef FILTERBANK_H
#define FILTERBANK_H #define FILTERBANK_H
#include "types.h" #include "lasp_types.h"
#include "ascee_math.h" #include "lasp_math.h"
typedef struct FilterBank_s FilterBank; typedef struct FilterBank_s FilterBank;
/** /**

View File

@ -1,4 +1,4 @@
// ascee_math.c // lasp_math.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
@ -6,15 +6,15 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#define TRACERPLUS (-10) #define TRACERPLUS (-10)
#include "ascee_math.h" #include "lasp_math.h"
#include "ascee_assert.h" #include "lasp_assert.h"
#include "ascee_math.h" #include "lasp_math.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include <math.h> #include <math.h>
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
void print_dmat(const dmat* m) { void print_dmat(const dmat* m) {
fsTRACE(50); fsTRACE(50);
size_t row,col; size_t row,col;

View File

@ -1,4 +1,4 @@
// ascee_math.h // lasp_math.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,12 +6,12 @@
// copying of matrices and vectors. // copying of matrices and vectors.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef ASCEE_MATH_H #ifndef LASP_MATH_H
#define ASCEE_MATH_H #define LASP_MATH_H
#include "ascee_math_raw.h" #include "lasp_math_raw.h"
#include "ascee_alloc.h" #include "lasp_alloc.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include "ascee_assert.h" #include "lasp_assert.h"
/// Vector of floating point numbers /// Vector of floating point numbers
typedef struct { typedef struct {
@ -106,7 +106,7 @@ static inline c* getcmatval(const cmat* mat,const us row,const us col){
return &mat->_data[col*mat->stride+row]; return &mat->_data[col*mat->stride+row];
} }
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
#define OVERFLOW_MAGIC_NUMBER (-10e-45) #define OVERFLOW_MAGIC_NUMBER (-10e-45)
#define check_overflow_vx(vx) \ #define check_overflow_vx(vx) \
@ -195,16 +195,16 @@ static inline void cmat_set(cmat* mat,const c value){
*/ */
static inline vd vd_alloc(us size) { static inline vd vd_alloc(us size) {
vd result = { size, NULL,NULL}; vd result = { size, NULL,NULL};
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
result._data = (d*) a_malloc((size+1)*sizeof(d)); result._data = (d*) a_malloc((size+1)*sizeof(d));
result._data[size] = OVERFLOW_MAGIC_NUMBER; result._data[size] = OVERFLOW_MAGIC_NUMBER;
#else #else
result._data = (d*) a_malloc(size*sizeof(d)); result._data = (d*) a_malloc(size*sizeof(d));
#endif // ASCEE_DEBUG #endif // LASP_DEBUG
result._foreign_data = false; result._foreign_data = false;
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
vd_set(&result,NAN); vd_set(&result,NAN);
#endif // ASCEE_DEBUG #endif // LASP_DEBUG
return result; return result;
} }
/** /**
@ -216,16 +216,16 @@ static inline vd vd_alloc(us size) {
*/ */
static inline vc vc_alloc(us size) { static inline vc vc_alloc(us size) {
vc result = { size, NULL, NULL}; vc result = { size, NULL, NULL};
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
result._data = (c*) a_malloc((size+1)*sizeof(c)); result._data = (c*) a_malloc((size+1)*sizeof(c));
result._data[size] = OVERFLOW_MAGIC_NUMBER; result._data[size] = OVERFLOW_MAGIC_NUMBER;
#else #else
result._data = (c*) a_malloc(size*sizeof(c)); result._data = (c*) a_malloc(size*sizeof(c));
#endif // ASCEE_DEBUG #endif // LASP_DEBUG
result._foreign_data = false; result._foreign_data = false;
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
vc_set(&result,NAN+I*NAN); vc_set(&result,NAN+I*NAN);
#endif // ASCEE_DEBUG #endif // LASP_DEBUG
return result; return result;
} }
/** /**
@ -241,16 +241,16 @@ static inline dmat dmat_alloc(us n_rows,
us n_cols) { us n_cols) {
dmat result = { n_rows, n_cols, false, n_rows, NULL}; dmat result = { n_rows, n_cols, false, n_rows, NULL};
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
result._data = (d*) a_malloc((n_rows*n_cols+1)*sizeof(d)); result._data = (d*) a_malloc((n_rows*n_cols+1)*sizeof(d));
result._data[n_rows*n_cols] = OVERFLOW_MAGIC_NUMBER; result._data[n_rows*n_cols] = OVERFLOW_MAGIC_NUMBER;
#else #else
result._data = (d*) a_malloc((n_rows*n_cols)*sizeof(d)); result._data = (d*) a_malloc((n_rows*n_cols)*sizeof(d));
#endif // ASCEE_DEBUG #endif // LASP_DEBUG
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
dmat_set(&result,NAN); dmat_set(&result,NAN);
#endif // ASCEE_DEBUG #endif // LASP_DEBUG
return result; return result;
} }
@ -269,16 +269,16 @@ static inline cmat cmat_alloc(const us n_rows,
const us n_cols) { const us n_cols) {
cmat result = { n_rows, n_cols, false, n_rows, NULL}; cmat result = { n_rows, n_cols, false, n_rows, NULL};
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
result._data = (c*) a_malloc((n_rows*n_cols+1)*sizeof(c)); result._data = (c*) a_malloc((n_rows*n_cols+1)*sizeof(c));
result._data[n_rows*n_cols] = OVERFLOW_MAGIC_NUMBER; result._data[n_rows*n_cols] = OVERFLOW_MAGIC_NUMBER;
#else #else
result._data = (c*) a_malloc((n_rows*n_cols)*sizeof(c)); result._data = (c*) a_malloc((n_rows*n_cols)*sizeof(c));
#endif // ASCEE_DEBUG #endif // LASP_DEBUG
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
cmat_set(&result,NAN+I*NAN); cmat_set(&result,NAN+I*NAN);
#endif // ASCEE_DEBUG #endif // LASP_DEBUG
return result; return result;
} }
/** /**
@ -583,7 +583,7 @@ static inline void cmat_conj(cmat* x) {
} }
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
void print_cmat(const cmat* m); void print_cmat(const cmat* m);
void print_vc(const vc* m); void print_vc(const vc* m);
void print_vd(const vd* m); void print_vd(const vd* m);
@ -594,5 +594,5 @@ void print_dmat(const dmat* m);
#define print_dmat(m) #define print_dmat(m)
#endif #endif
#endif // ASCEE_MATH_H #endif // LASP_MATH_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,4 @@
// si_math.c // lasp_math_raw.c
// //
// last-edit-by: J.A. de Jong // last-edit-by: J.A. de Jong
// //
@ -6,7 +6,7 @@
// Operations working on raw arrays of floating point numbers // Operations working on raw arrays of floating point numbers
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#define TRACERPLUS (-5) #define TRACERPLUS (-5)
#include "ascee_math_raw.h" #include "lasp_math_raw.h"
#if ASCEE_USE_BLAS #if ASCEE_USE_BLAS
#include <cblas.h> #include <cblas.h>
#endif #endif

View File

@ -1,4 +1,4 @@
// ascee_math_raw.h // lasp_math_raw.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,21 +6,21 @@
// complex numbers. // complex numbers.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef ASCEE_MATH_RAW_H #ifndef LASP_MATH_RAW_H
#define ASCEE_MATH_RAW_H #define LASP_MATH_RAW_H
#include "ascee_assert.h" #include "lasp_assert.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include "types.h" #include "lasp_types.h"
#include <math.h> #include <math.h>
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
#include <cblas.h> #include <cblas.h>
#elif ASCEE_USE_BLAS == 0 #elif LASP_USE_BLAS == 0
#else #else
#error "ASCEE_USE_BLAS should be set to either 0 or 1" #error "LASP_USE_BLAS should be set to either 0 or 1"
#endif #endif
#ifdef ASCEE_DOUBLE_PRECISION #ifdef LASP_DOUBLE_PRECISION
#define c_real creal #define c_real creal
#define c_imag cimag #define c_imag cimag
#define d_abs fabs #define d_abs fabs
@ -34,7 +34,7 @@
#define d_cos cos #define d_cos cos
#define d_pow pow #define d_pow pow
#else // ASCEE_DOUBLE_PRECISION not defined #else // LASP_DOUBLE_PRECISION not defined
#define c_conj conjf #define c_conj conjf
#define c_real crealf #define c_real crealf
#define c_imag cimagf #define c_imag cimagf
@ -48,7 +48,7 @@
#define d_cos cosf #define d_cos cosf
#define d_pow powf #define d_pow powf
#endif // ASCEE_DOUBLE_PRECISION #endif // LASP_DOUBLE_PRECISION
#ifdef M_PI #ifdef M_PI
static const d number_pi = M_PI; static const d number_pi = M_PI;
@ -114,7 +114,7 @@ static inline c cd_dot(const c a[],const d b[],us size){
} }
/** /**
* Return the dot product of two complex-valued arrays. Wraps BLAS * Return the dot product of two complex-valued arrays. Wraps BLAS
* when ASCEE_USE_BLAS == 1. * when LASP_USE_BLAS == 1.
* *
* @param a complex-valued array * @param a complex-valued array
* @param b complex-valued array * @param b complex-valued array
@ -123,9 +123,9 @@ static inline c cd_dot(const c a[],const d b[],us size){
* @return the dot product * @return the dot product
*/ */
static inline c cc_dot(const c a[],const c b[],us size){ static inline c cc_dot(const c a[],const c b[],us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
WARN("CBlas zdotu not yet tested"); WARN("CBlas zdotu not yet tested");
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
// assert(0); // assert(0);
return cblas_zdotu(size,(d*) a,1,(d*) b,1); return cblas_zdotu(size,(d*) a,1,(d*) b,1);
#else #else
@ -150,8 +150,8 @@ static inline c cc_dot(const c a[],const c b[],us size){
* @return The result. * @return The result.
*/ */
static inline d d_dot(const d a[],const d b[],const us size){ static inline d d_dot(const d a[],const d b[],const us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
return cblas_ddot(size,a,1,b,1); return cblas_ddot(size,a,1,b,1);
#else // Single precision function #else // Single precision function
return cblas_sdot(size,a,1,b,1); return cblas_sdot(size,a,1,b,1);
@ -175,7 +175,7 @@ static inline d d_dot(const d a[],const d b[],const us size){
* @param size : Size of arrays * @param size : Size of arrays
*/ */
static inline void d_copy(d to[],const d from[],const us size){ static inline void d_copy(d to[],const d from[],const us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
cblas_dcopy(size,from,1,to,1); cblas_dcopy(size,from,1,to,1);
#else #else
us i; us i;
@ -210,8 +210,8 @@ static inline void cd_copy(c to[],const d from[],const us size) {
*/ */
static inline void c_copy(c to[],const c from[],const us size){ static inline void c_copy(c to[],const c from[],const us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
cblas_zcopy(size,(d*) from,1,(d*) to,1); cblas_zcopy(size,(d*) from,1,(d*) to,1);
#else #else
cblas_ccopy(size,(d*) from,1,(d*) to,1); cblas_ccopy(size,(d*) from,1,(d*) to,1);
@ -232,8 +232,8 @@ static inline void c_copy(c to[],const c from[],const us size){
*/ */
static inline void d_add_to(d x[],const d y[], static inline void d_add_to(d x[],const d y[],
const d fac,const us size){ const d fac,const us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
cblas_daxpy(size,fac,y,1,x,1); cblas_daxpy(size,fac,y,1,x,1);
#else #else
cblas_saxpy(size,fac,y,1,x,1); cblas_saxpy(size,fac,y,1,x,1);
@ -255,8 +255,8 @@ static inline void d_add_to(d x[],const d y[],
static inline void c_add_to(c x[],const c y[], static inline void c_add_to(c x[],const c y[],
const c fac,const us size){ const c fac,const us size){
fsTRACE(15); fsTRACE(15);
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
cblas_zaxpy(size,(d*) &fac,(d*) y,1,(d*) x,1); cblas_zaxpy(size,(d*) &fac,(d*) y,1,(d*) x,1);
#else #else
cblas_caxpy(size,(d*) &fac,(d*) y,1,(d*) x,1); cblas_caxpy(size,(d*) &fac,(d*) y,1,(d*) x,1);
@ -277,8 +277,8 @@ static inline void c_add_to(c x[],const c y[],
* @param size size of the array * @param size size of the array
*/ */
static inline void d_scale(d a[],const d scale_fac,us size){ static inline void d_scale(d a[],const d scale_fac,us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
cblas_dscal(size,scale_fac,a,1); cblas_dscal(size,scale_fac,a,1);
#else #else
cblas_sscal(size,scale_fac,a,1); cblas_sscal(size,scale_fac,a,1);
@ -299,14 +299,14 @@ static inline void d_scale(d a[],const d scale_fac,us size){
* @param size size of the array * @param size size of the array
*/ */
static inline void c_scale(c a[],const c scale_fac,us size){ static inline void c_scale(c a[],const c scale_fac,us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
// Complex argument should be given in as array of two double // Complex argument should be given in as array of two double
// values. The first the real part, the second the imaginary // values. The first the real part, the second the imaginary
// part. Fortunately the (c) type stores the two values in this // part. Fortunately the (c) type stores the two values in this
// order. To be portable and absolutely sure anything goes well, // order. To be portable and absolutely sure anything goes well,
// we convert it explicitly here. // we convert it explicitly here.
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
cblas_zscal(size,(d*) &scale_fac,(d*) a,1); cblas_zscal(size,(d*) &scale_fac,(d*) a,1);
#else #else
cblas_cscal(size,(d*) &scale_fac,(d*) a,1); cblas_cscal(size,(d*) &scale_fac,(d*) a,1);
@ -357,7 +357,7 @@ static inline d d_min(const d a[],us size){
* @param size Size of array * @param size Size of array
*/ */
static inline d d_norm(const d a[],us size){ static inline d d_norm(const d a[],us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
return cblas_dnrm2(size,a,1); return cblas_dnrm2(size,a,1);
#else #else
d norm = 0; d norm = 0;
@ -378,7 +378,7 @@ static inline d d_norm(const d a[],us size){
* @param size Size of array * @param size Size of array
*/ */
static inline d c_norm(const c a[],us size){ static inline d c_norm(const c a[],us size){
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
return cblas_dznrm2(size,(d*) a,1); return cblas_dznrm2(size,(d*) a,1);
#else #else
d norm = 0; d norm = 0;
@ -434,8 +434,8 @@ static inline void carray_conj(c res[],const c in[],const us size) {
// First set the result vector to zero // First set the result vector to zero
fsTRACE(15); fsTRACE(15);
c_set(res,0,size); c_set(res,0,size);
#if ASCEE_USE_BLAS == 1 #if LASP_USE_BLAS == 1
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
// Cast as a float, scale all odd elements with minus one to find // Cast as a float, scale all odd elements with minus one to find
// the complex conjugate. // the complex conjugate.
cblas_daxpy(size ,1.0,(d*) in,2,(d*) res,2); cblas_daxpy(size ,1.0,(d*) in,2,(d*) res,2);
@ -443,12 +443,12 @@ static inline void carray_conj(c res[],const c in[],const us size) {
#else #else
cblas_faxpy(size ,1,(d*) in,2,(d*) res,2); cblas_faxpy(size ,1,(d*) in,2,(d*) res,2);
cblas_faxpy(size,-1,&((d*) in)[1],2,&((d*) res)[1],2); cblas_faxpy(size,-1,&((d*) in)[1],2,&((d*) res)[1],2);
#endif // ASCEE_DOUBLE_PRECISION #endif // LASP_DOUBLE_PRECISION
#else #else
for(us i=0;i<size;i++) { for(us i=0;i<size;i++) {
res[i] = c_conj(in[i]); res[i] = c_conj(in[i]);
} }
#endif // ASCEE_USE_BLAS #endif // LASP_USE_BLAS
feTRACE(15); feTRACE(15);
} }
/** /**
@ -458,20 +458,20 @@ static inline void carray_conj(c res[],const c in[],const us size) {
* @param size Size of the vector * @param size Size of the vector
*/ */
static inline void c_conj_inplace(c res[],us size) { static inline void c_conj_inplace(c res[],us size) {
#if ASCEE_USE_BLAS #if LASP_USE_BLAS
#if ASCEE_DOUBLE_PRECISION #if LASP_DOUBLE_PRECISION
// Cast as a float, scale all odd elements with minus one to find // Cast as a float, scale all odd elements with minus one to find
// the complex conjugate. // the complex conjugate.
cblas_dscal(size,-1,&((d*) res)[1],2); cblas_dscal(size,-1,&((d*) res)[1],2);
#else #else
cblas_sscal(size,-1,&((d*) res)[1],2); cblas_sscal(size,-1,&((d*) res)[1],2);
#endif // ASCEE_DOUBLE_PRECISION #endif // LASP_DOUBLE_PRECISION
#else #else
for(us i=0;i<size;i++) { for(us i=0;i<size;i++) {
res[i] = c_conj(res[i]); res[i] = c_conj(res[i]);
} }
#endif // ASCEE_USE_BLAS #endif // LASP_USE_BLAS
} }
#endif // ASCEE_MATH_RAW_H #endif // LASP_MATH_RAW_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,4 @@
// mq.c // lasp_mq.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
@ -7,11 +7,11 @@
// different threads. // different threads.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#define TRACERPLUS (-6) #define TRACERPLUS (-6)
#include "types.h" #include "lasp_types.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include "ascee_assert.h" #include "lasp_assert.h"
#include "ascee_alloc.h" #include "lasp_alloc.h"
#include "mq.h" #include "lasp_mq.h"
#include <pthread.h> #include <pthread.h>
/* #ifdef linux */ /* #ifdef linux */
@ -89,8 +89,8 @@ void print_job_queue(JobQueue* jq) {
JobQueue* JobQueue_alloc(const us max_jobs) { JobQueue* JobQueue_alloc(const us max_jobs) {
TRACE(15,"JobQueue_alloc"); TRACE(15,"JobQueue_alloc");
if(max_jobs > ASCEE_MAX_NUM_CHANNELS) { if(max_jobs > LASP_MAX_NUM_CHANNELS) {
WARN("Max jobs restricted to ASCEE_MAX_NUM_CHANNELS"); WARN("Max jobs restricted to LASP_MAX_NUM_CHANNELS");
return NULL; return NULL;
} }
JobQueue* jq = a_malloc(sizeof(JobQueue)); JobQueue* jq = a_malloc(sizeof(JobQueue));
@ -252,7 +252,7 @@ void* JobQueue_assign(JobQueue* jq) {
} }
TRACE(16,"JobQueue_assign: found ready job. Assigned to:"); TRACE(16,"JobQueue_assign: found ready job. Assigned to:");
#ifdef ASCEE_DEBUG #ifdef LASP_DEBUG
pthread_t thisthread = pthread_self(); pthread_t thisthread = pthread_self();
iVARTRACE(16,thisthread); iVARTRACE(16,thisthread);
#endif #endif

View File

@ -1,4 +1,4 @@
// ps.c // lasp_ps.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
@ -6,11 +6,11 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#define TRACERPLUS (-5) #define TRACERPLUS (-5)
#include "ps.h" #include "lasp_ps.h"
#include "fft.h" #include "lasp_fft.h"
#include "ascee_alloc.h" #include "lasp_alloc.h"
#include "ascee_alg.h" #include "lasp_alg.h"
#include "ascee_assert.h" #include "lasp_assert.h"
typedef struct PowerSpectra_s { typedef struct PowerSpectra_s {

View File

@ -1,4 +1,4 @@
// ps.h // lasp_ps.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,9 +6,9 @@
// routines. // routines.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef PS_H #ifndef LASP_PS_H
#define PS_H #define LASP_PS_H
#include "window.h" #include "lasp_window.h"
typedef struct PowerSpectra_s PowerSpectra; typedef struct PowerSpectra_s PowerSpectra;
@ -57,5 +57,5 @@ void PowerSpectra_free(PowerSpectra* ps);
#endif // PS_H #endif // LASP_PS_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,4 @@
// signals.h // lasp_signals.h
// //
// Author: J.A. de Jong - ASCEE // Author: J.A. de Jong - ASCEE
// //
@ -6,9 +6,9 @@
// Several signal functions // Several signal functions
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef SIGNALS_H #ifndef LASP_SIGNALS_H
#define SIGNALS_H #define LASP_SIGNALS_H
#include "ascee_math.h" #include "lasp_math.h"
/** /**
* Compute the signal power, that is \f$ \frac{1}{N} \sum_{i=0}^{N-1} * Compute the signal power, that is \f$ \frac{1}{N} \sum_{i=0}^{N-1}
@ -28,5 +28,5 @@ static inline d signal_power(vd* signal) {
#endif // SIGNALS_H #endif // LASP_SIGNALS_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,4 @@
// si_tracer.c // lasp_tracer.c
// //
// last-edit-by: J.A. de Jong // last-edit-by: J.A. de Jong
// //
@ -7,8 +7,8 @@
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#if TRACER == 1 #if TRACER == 1
#include <stdio.h> #include <stdio.h>
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include "types.h" #include "lasp_types.h"
#ifdef _REENTRANT #ifdef _REENTRANT
#include <stdatomic.h> #include <stdatomic.h>

View File

@ -129,7 +129,7 @@ extern int TRACERNAME;
static inline int getTracerLevel() { return TRACERNAME;} static inline int getTracerLevel() { return TRACERNAME;}
#endif #endif
#include "types.h" #include "lasp_types.h"
// Use this preprocessor command to introduce one TRACERNAME integer per unit // Use this preprocessor command to introduce one TRACERNAME integer per unit
/* Introduce one static logger */ /* Introduce one static logger */

View File

@ -7,18 +7,18 @@
// needed. // needed.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef TYPES_H #ifndef LASP_TYPES_H
#define TYPES_H #define LASP_TYPES_H
#include <stddef.h> #include <stddef.h>
// // Branch prediction performance improvement // // Branch prediction performance improvement
#if !defined(likely) #if !defined(likely)
#if defined(__GNUC__) && !defined(ASCEE_DEBUG) #if defined(__GNUC__) && !defined(LASP_DEBUG)
#define likely(x) __builtin_expect(!!(x), 1) #define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0) #define unlikely(x) __builtin_expect(!!(x), 0)
#else #else
#define likely(x) (x) #define likely(x) (x)
#define unlikely(x) (x) #define unlikely(x) (x)
#endif // if defined(__GNUC__) && !defined(ASCEE_DEBUG) #endif // if defined(__GNUC__) && !defined(LASP_DEBUG)
#endif // !defined(likely) #endif // !defined(likely)
@ -30,14 +30,14 @@ typedef size_t us; /* Size type I always use */
// To change the whole code to 32-bit floating points, change this to // To change the whole code to 32-bit floating points, change this to
// float. // float.
#if ASCEE_FLOAT == 32 #if LASP_FLOAT == 32
typedef float d; /* Shortcut for double */ typedef float d; /* Shortcut for double */
typedef float complex c; typedef float complex c;
#elif ASCEE_FLOAT == 64 #elif LASP_FLOAT == 64
typedef double d; /* Shortcut for double */ typedef double d; /* Shortcut for double */
typedef double complex c; typedef double complex c;
#else #else
#error ASCEE_FLOAT should be either 32 or 64 #error LASP_FLOAT should be either 32 or 64
#endif #endif
@ -49,7 +49,6 @@ typedef double complex c;
#define FAILURE -2 #define FAILURE -2
#endif // LASP_TYPES_H
#endif // ASCEE_TYPES_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -6,8 +6,8 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "window.h" #include "lasp_window.h"
#include "signals.h" #include "lasp_signals.h"
#include <stdlib.h> #include <stdlib.h>
/** /**
* Compute the Hann window * Compute the Hann window

View File

@ -6,9 +6,9 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef WINDOW_H #ifndef LASP_WINDOW_H
#define WINDOW_H #define LASP_WINDOW_H
#include "ascee_math.h" #include "lasp_math.h"
typedef enum { typedef enum {
Hann = 0, Hann = 0,
@ -33,5 +33,5 @@ typedef enum {
int window_create(const WindowType wintype,vd* result,d* win_power); int window_create(const WindowType wintype,vd* result,d* win_power);
#endif // WINDOW_H #endif // LASP_WINDOW_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -1,4 +1,4 @@
// worker.c // lasp_worker.c
// //
// Author: J.A. de Jong -ASCEE // Author: J.A. de Jong -ASCEE
// //
@ -6,12 +6,12 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#define TRACERPLUS (-5) #define TRACERPLUS (-5)
#include "worker.h" #include "lasp_worker.h"
#include "mq.h" #include "lasp_mq.h"
#include "ascee_alloc.h" #include "lasp_alloc.h"
#include <pthread.h> #include <pthread.h>
#include "ascee_assert.h" #include "lasp_assert.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
typedef struct Workers_s { typedef struct Workers_s {
JobQueue* jq; JobQueue* jq;
@ -22,7 +22,7 @@ typedef struct Workers_s {
pthread_mutex_t global_data_mutex; pthread_mutex_t global_data_mutex;
void* global_data; void* global_data;
pthread_t worker_threads[ASCEE_MAX_NUM_THREADS]; pthread_t worker_threads[LASP_MAX_NUM_THREADS];
us num_workers; us num_workers;
} Workers; } Workers;
@ -37,7 +37,7 @@ Workers* Workers_create(const us num_workers,
TRACE(15,"Workers_create"); TRACE(15,"Workers_create");
if(num_workers > ASCEE_MAX_NUM_THREADS) { if(num_workers > LASP_MAX_NUM_THREADS) {
WARN("Number of workers too high in Workers_create"); WARN("Number of workers too high in Workers_create");
return NULL; return NULL;
} }

View File

@ -8,9 +8,9 @@
// on the push of a new job. // on the push of a new job.
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#pragma once #pragma once
#ifndef WORKER_H #ifndef LASP_WORKER_H
#define WORKER_H #define LASP_WORKER_H
#include "types.h" #include "lasp_types.h"
typedef struct Workers_s Workers; typedef struct Workers_s Workers;
typedef struct JobQueue_s JobQueue; typedef struct JobQueue_s JobQueue;
@ -57,5 +57,5 @@ Workers* Workers_create(const us num_workers,
*/ */
void Workers_free(Workers* w); void Workers_free(Workers* w);
#endif // WORKER_H #endif // LASP_WORKER_H
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -3,9 +3,9 @@ import numpy as np
cimport numpy as np cimport numpy as np
from libcpp cimport bool from libcpp cimport bool
DEF ASCEE_FLOAT = "@ASCEE_FLOAT@" DEF LASP_FLOAT = "@LASP_FLOAT@"
IF ASCEE_FLOAT == "double": IF LASP_FLOAT == "double":
ctypedef double d ctypedef double d
ctypedef double complex c ctypedef double complex c
NUMPY_FLOAT_TYPE = np.float64 NUMPY_FLOAT_TYPE = np.float64
@ -23,13 +23,13 @@ ELSE:
ctypedef size_t us ctypedef size_t us
cdef extern from "ascee_tracer.h": cdef extern from "lasp_tracer.h":
void setTracerLevel(int) void setTracerLevel(int)
void TRACE(int,const char*) void TRACE(int,const char*)
void fsTRACE(int) void fsTRACE(int)
void feTRACE(int) void feTRACE(int)
void clearScreen() void clearScreen()
cdef extern from "ascee_math.h": cdef extern from "lasp_math.h":
ctypedef struct dmat: ctypedef struct dmat:
us n_cols us n_cols
us n_rows us n_rows
@ -60,6 +60,6 @@ cdef extern from "ascee_math.h":
cdef extern from "numpy/arrayobject.h": cdef extern from "numpy/arrayobject.h":
void PyArray_ENABLEFLAGS(np.ndarray arr, int flags) void PyArray_ENABLEFLAGS(np.ndarray arr, int flags)
cdef extern from "ascee_python.h": cdef extern from "lasp_python.h":
object dmat_to_ndarray(dmat*,bint transfer_ownership) object dmat_to_ndarray(dmat*,bint transfer_ownership)

View File

@ -15,7 +15,7 @@ def cls():
clearScreen() clearScreen()
# cls() # cls()
cdef extern from "fft.h": cdef extern from "lasp_fft.h":
ctypedef struct c_Fft "Fft" ctypedef struct c_Fft "Fft"
c_Fft* Fft_create(us nfft) c_Fft* Fft_create(us nfft)
void Fft_free(c_Fft*) void Fft_free(c_Fft*)
@ -96,7 +96,7 @@ cdef class Fft:
cdef extern from "window.h": cdef extern from "lasp_window.h":
ctypedef enum WindowType: ctypedef enum WindowType:
Hann Hann
Hamming Hamming
@ -111,7 +111,7 @@ rectangular = Rectangular
bartlett = Bartlett bartlett = Bartlett
blackman = Blackman blackman = Blackman
cdef extern from "ps.h": cdef extern from "lasp_ps.h":
ctypedef struct c_PowerSpectra "PowerSpectra" ctypedef struct c_PowerSpectra "PowerSpectra"
c_PowerSpectra* PowerSpectra_alloc(const us nfft, c_PowerSpectra* PowerSpectra_alloc(const us nfft,
const WindowType wt) const WindowType wt)
@ -177,7 +177,7 @@ cdef class PowerSpectra:
PowerSpectra_free(self._ps) PowerSpectra_free(self._ps)
cdef extern from "aps.h": cdef extern from "lasp_aps.h":
ctypedef struct c_AvPowerSpectra "AvPowerSpectra" ctypedef struct c_AvPowerSpectra "AvPowerSpectra"
c_AvPowerSpectra* AvPowerSpectra_alloc(const us nfft, c_AvPowerSpectra* AvPowerSpectra_alloc(const us nfft,
const us nchannels, const us nchannels,
@ -260,7 +260,7 @@ cdef class AvPowerSpectra:
return result return result
cdef extern from "filterbank.h": cdef extern from "lasp_filterbank.h":
ctypedef struct c_FilterBank "FilterBank": ctypedef struct c_FilterBank "FilterBank":
pass pass
c_FilterBank* FilterBank_create(const dmat* h,const us nfft) nogil c_FilterBank* FilterBank_create(const dmat* h,const us nfft) nogil

View File

@ -9,9 +9,9 @@ descr = "Python wrappers around several C++ optimized beamforming codes"
setup( setup(
name="Beamforming", name="LASP",
version="1.0", version="1.0",
packages=['beamforming'], packages=['lasp'],
author='J.A. de Jong - ASCEE', author='J.A. de Jong - ASCEE',
author_email="j.a.dejong@ascee.nl", author_email="j.a.dejong@ascee.nl",
# Project uses reStructuredText, so ensure that the docutils get # Project uses reStructuredText, so ensure that the docutils get
@ -20,7 +20,7 @@ setup(
license='MIT', license='MIT',
description=descr, description=descr,
keywords="Beamforming", keywords="",
url="http://www.ascee.nl/beamforming/", # project home page, if any url="http://www.ascee.nl/lasp/", # project home page, if any
) )

View File

@ -1,9 +1,9 @@
include_directories(${CMAKE_SOURCE_DIR}/beamforming/c) include_directories(${CMAKE_SOURCE_DIR}/lasp/c)
add_executable(test_bf test_bf.c) add_executable(test_bf test_bf.c)
add_executable(test_workers test_workers.c) add_executable(test_workers test_workers.c)
add_executable(test_fft test_fft.c) add_executable(test_fft test_fft.c)
add_executable(test_math test_math.c) add_executable(test_math test_math.c)
target_link_libraries(test_bf beamforming_lib) target_link_libraries(test_bf lasp_lib)
target_link_libraries(test_fft beamforming_lib pthread) target_link_libraries(test_fft lasp_lib pthread)
target_link_libraries(test_workers beamforming_lib pthread) target_link_libraries(test_workers lasp_lib pthread)
target_link_libraries(test_math beamforming_lib pthread efence) target_link_libraries(test_math lasp_lib pthread)

View File

@ -5,7 +5,7 @@
// Description: // Description:
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "ascee_math.h" #include "lasp_math.h"
int main() { int main() {

View File

@ -6,8 +6,8 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "fft.h" #include "lasp_fft.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
int main() { int main() {

View File

@ -6,10 +6,10 @@
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "fft.h" #include "lasp_fft.h"
#include "ascee_math.h" #include "lasp_math.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include "ascee_alg.h" #include "lasp_alg.h"
int main() { int main() {

View File

@ -5,10 +5,10 @@
// Description: // Description:
// //
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#include "worker.h" #include "lasp_worker.h"
#include "mq.h" #include "lasp_mq.h"
#include "ascee_tracer.h" #include "lasp_tracer.h"
#include "ascee_assert.h" #include "lasp_assert.h"
#include <unistd.h> #include <unistd.h>
static void* walloc(void*); static void* walloc(void*);
static int worker(void*,void*); static int worker(void*,void*);