From c3acd217c3569a47f7de3a2ee2162c8523678242 Mon Sep 17 00:00:00 2001 From: Joey Dumont Date: Thu, 10 Jul 2014 15:33:10 -0400 Subject: [PATCH] Minor changes. --- CMakeLists.txt | 5 ++++- src/wignerSymbols-cpp.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b93aba..d5ae930 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,16 @@ # Name of project project(wignerSymbols) set (wignerSymbols_VERSION_MAJOR 0) -set (wignerSymbols_VERSION_MINOR 0) +set (wignerSymbols_VERSION_MINOR 1) set (wignerSymbols_VERSION_RELEASE 1) # CMake config cmake_minimum_required(VERSION 2.8) set (CMAKE_INSTALL_PREFIX /usr/) + +# Compiler config enable_language (Fortran) +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall -march=native") # Included files include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/src/wignerSymbols-cpp.cpp b/src/wignerSymbols-cpp.cpp index b6cb0c1..e0b2abe 100644 --- a/src/wignerSymbols-cpp.cpp +++ b/src/wignerSymbols-cpp.cpp @@ -50,7 +50,7 @@ std::vector wigner3j(double l2, double l3, thrcof[0] = srtiny; // From now on, we check the variation of |alpha(l1)|. - double alphaOld, alphaNew, beta, l1(l1min); + double alphaNew, l1(l1min); if (l1min==0.0) alphaNew = -(m3-m2+2.0*wigner3j_auxB(l1,l2,l3,m1,m2,m3))/wigner3j_auxA(1.0,l2,l3,m1,m2,m3); else @@ -268,7 +268,7 @@ std::vector wigner6j(double l2, double l3, sixcof[0] = srtiny; // From now on, we check the variation of |alpha(l1)|. - double alphaOld, alphaNew, beta, l1(l1min); + double alphaNew, l1(l1min); if (l1min==0) alphaNew = -(l2*(l2+1.0)+l3*(l3+1.0)+l5*(l5+1.0)+l6*(l6+1.0)-2.0*l4*(l4+1.0))/wigner6j_auxA(1.0,l2,l3,l4,l5,l6); @@ -298,7 +298,7 @@ std::vector wigner6j(double l2, double l3, sixcof[1] = alphaNew*sixcof[0]; // We compute the rest of the recursion. - int i = 1; + unsigned int i = 1; bool alphaVar = false; do { @@ -357,7 +357,7 @@ std::vector wigner6j(double l2, double l3, sixcof[size-2] = alphaNew*sixcof[size-1]; // We compute the rest of the backward recursion. - int j = size-2; + unsigned int j = size-2; do { // Bookkeeping @@ -400,7 +400,7 @@ std::vector wigner6j(double l2, double l3, // We compute the overall factor. double sum = 0.0; - for (int k=0;k