<commit_before>/*
   Copyright (c) 2009-2013, <NAME>
                      2013, <NAME>
   All rights reserved.

   This file is part of Elemental and is under the BSD 2-Clause License, 
   which can be found in the LICENSE file in the root directory, or at 
   http://opensource.org/licenses/BSD-2-Clause
*/
#include "elemental.hpp"
#ifdef HAVE_QT5
 #include <QApplication>
#endif

namespace {

int numElemInits = 0;
bool elemInitializedMpi = false;
#ifdef HAVE_QT5
bool elemInitializedQt = false;
bool elemOpenedWindow = false;
QCoreApplication* coreApp;
std::vector<elem::DisplayWindow*> displayWindows;
std::vector<elem::ComplexDisplayWindow*> complexDisplayWindows;
bool haveMinRealWindowVal=false, haveMaxRealWindowVal=false,
     haveMinImagWindowVal=false, haveMaxImagWindowVal=false;
double minRealWindowVal, maxRealWindowVal,
       minImagWindowVal, maxImagWindowVal;
#endif
std::stack<int> blocksizeStack;
elem::Grid* defaultGrid = 0;
elem::MpiArgs* args = 0;

// Debugging
#ifndef RELEASE
std::stack<std::string> callStack;
#endif

// Tuning parameters for basic routines
int localSymvFloatBlocksize = 64;
int localSymvDoubleBlocksize = 64;
int localSymvComplexFloatBlocksize = 64;
int localSymvComplexDoubleBlocksize = 64;

int localTrr2kFloatBlocksize = 64;
int localTrr2kDoubleBlocksize = 64;
int localTrr2kComplexFloatBlocksize = 64;
int localTrr2kComplexDoubleBlocksize = 64;

int localTrrkFloatBlocksize = 64;
int localTrrkDoubleBlocksize = 64;
int localTrrkComplexFloatBlocksize = 64;
int localTrrkComplexDoubleBlocksize = 64;

// Tuning parameters for advanced routines
using namespace elem;
HermitianTridiagApproach tridiagApproach = HERMITIAN_TRIDIAG_DEFAULT;
GridOrder gridOrder = ROW_MAJOR;
}

namespace elem {

void OpenedWindow()
{ ::elemOpenedWindow = true; }

void RegisterDisplayWindow( DisplayWindow* window )
{ ::displayWindows.push_back( window ); }

void RegisterComplexDisplayWindow( ComplexDisplayWindow* window )
{ ::complexDisplayWindows.push_back( window ); }

double MinRealWindowVal()
{
    if( ::haveMinRealWindowVal )
        return ::minRealWindowVal;
    else
        return 0;
}

double MaxRealWindowVal()
{
    if( ::haveMaxRealWindowVal )
        return ::maxRealWindowVal;
    else
        return 0;
}

double MinImagWindowVal()
{
    if( ::haveMinImagWindowVal )
        return ::minImagWindowVal;
    else
        return 0;
}

double MaxImagWindowVal()
{
    if( ::haveMaxImagWindowVal )
        return ::maxImagWindowVal;
    else
        return 0;
}

void UpdateMinRealWindowVal( double minVal )
{
    if( ::haveMinRealWindowVal )
        ::minRealWindowVal = std::min( ::minRealWindowVal, minVal );
    else
        ::minRealWindowVal = minVal;
    ::haveMinRealWindowVal = true;
}

void UpdateMaxRealWindowVal( double maxVal )
{
    if( ::haveMaxRealWindowVal )
        ::maxRealWindowVal = std::max( ::maxRealWindowVal, maxVal );
    else
        ::maxRealWindowVal = maxVal;
    ::haveMaxRealWindowVal = true;
}

void UpdateMinImagWindowVal( double minVal )
{
    if( ::haveMinImagWindowVal )
        ::minImagWindowVal = std::min( ::minImagWindowVal, minVal );
    else
        ::minImagWindowVal = minVal;
    ::haveMinImagWindowVal = true;
}

void UpdateMaxImagWindowVal( double maxVal )
{
    if( ::haveMaxImagWindowVal )
        ::maxImagWindowVal = std::max( ::maxImagWindowVal, maxVal );
    else
        ::maxImagWindowVal = maxVal;
    ::haveMaxImagWindowVal = true;
}

bool Initialized()
{ return ::numElemInits > 0; }

void Initialize( int& argc, char**& argv )
{
    if( ::numElemInits > 0 )
    {
        ++::numElemInits;
        return;
    }

    ::args = new MpiArgs( argc, argv );
<commit_msg>Adding missing include guards for when Qt5 is not found<commit_after>/*
   Copyright (c) 2009-2013, <NAME>
                      2013, <NAME>
   All rights reserved.

   This file is part of Elemental and is under the BSD 2-Clause License, 
   which can be found in the LICENSE file in the root directory, or at 
   http://opensource.org/licenses/BSD-2-Clause
*/
#include "elemental.hpp"
#ifdef HAVE_QT5
 #include <QApplication>
#endif

namespace {

int numElemInits = 0;
bool elemInitializedMpi = false;
#ifdef HAVE_QT5
bool elemInitializedQt = false;
bool elemOpenedWindow = false;
QCoreApplication* coreApp;
std::vector<elem::DisplayWindow*> displayWindows;
std::vector<elem::ComplexDisplayWindow*> complexDisplayWindows;
bool haveMinRealWindowVal=false, haveMaxRealWindowVal=false,
     haveMinImagWindowVal=false, haveMaxImagWindowVal=false;
double minRealWindowVal, maxRealWindowVal,
       minImagWindowVal, maxImagWindowVal;
#endif
std::stack<int> blocksizeStack;
elem::Grid* defaultGrid = 0;
elem::MpiArgs* args = 0;

// Debugging
#ifndef RELEASE
std::stack<std::string> callStack;
#endif

// Tuning parameters for basic routines
int localSymvFloatBlocksize = 64;
int localSymvDoubleBlocksize = 64;
int localSymvComplexFloatBlocksize = 64;
int localSymvComplexDoubleBlocksize = 64;

int localTrr2kFloatBlocksize = 64;
int localTrr2kDoubleBlocksize = 64;
int localTrr2kComplexFloatBlocksize = 64;
int localTrr2kComplexDoubleBlocksize = 64;

int localTrrkFloatBlocksize = 64;
int localTrrkDoubleBlocksize = 64;
int localTrrkComplexFloatBlocksize = 64;
int localTrrkComplexDoubleBlocksize = 64;

// Tuning parameters for advanced routines
using namespace elem;
HermitianTridiagApproach tridiagApproach = HERMITIAN_TRIDIAG_DEFAULT;
GridOrder gridOrder = ROW_MAJOR;
}

namespace elem {

#ifdef HAVE_QT5
void OpenedWindow()
{ ::elemOpenedWindow = true; }

void RegisterDisplayWindow( DisplayWindow* window )
{ ::displayWindows.push_back( window ); }

void RegisterComplexDisplayWindow( ComplexDisplayWindow* window )
{ ::complexDisplayWindows.push_back( window ); }

double MinRealWindowVal()
{
    if( ::haveMinRealWindowVal )
        return ::minRealWindowVal;
    else
        return 0;
}

double MaxRealWindowVal()
{
    if( ::haveMaxRealWindowVal )
        return ::maxRealWindowVal;
    else
        return 0;
}

double MinImagWindowVal()
{
    if( ::haveMinImagWindowVal )
        return ::minImagWindowVal;
    else
        return 0;
}

double MaxImagWindowVal()
{
    if( ::haveMaxImagWindowVal )
        return ::maxImagWindowVal;
    else
        return 0;
}

void UpdateMinRealWindowVal( double minVal )
{
    if( ::haveMinRealWindowVal )
        ::minRealWindowVal = std::min( ::minRealWindowVal, minVal );
    else
        ::minRealWindowVal = minVal;
    ::haveMinRealWindowVal = true;
}

void UpdateMaxRealWindowVal( double maxVal )
{
    if( ::haveMaxRealWindowVal )
        ::maxRealWindowVal = std::max( ::maxRealWindowVal, maxVal );
    else
        ::maxRealWindowVal = maxVal;
    ::haveMaxRealWindowVal = true;
}

void UpdateMinImagWindowVal( double minVal )
{
    if( ::haveMinImagWindowVal )
        ::minImagWindowVal = std::min( ::minImagWindowVal, minVal );
    else
        ::minImagWindowVal = minVal;
    ::haveMinImagWindowVal = true;
}

void UpdateMaxImagWindowVal( double maxVal )
{
    if( ::haveMaxImagWindowVal )
        ::maxImagWindowVal = std::max( ::maxImagWindowVal, maxVal );
    else
        ::maxImagWindowVal = maxVal;
    ::haveMaxImagWindowVal = true;
}
#endif // ifdef HAVE_QT5

bool Initialized()
{ return ::numElemInits > 0; }

void Initialize( int& argc, char**& argv )
{
    if( ::numElemInits > 0 )
    {
        ++::numElemInits;
        return;
    }

    ::args = new MpiArgs( argc, argv );

{'fraction_non_alphanumeric': 0.0978568540234533, 'fraction_numerical': 0.014692007009030866, 'mean_word_length': 4.159944367176634, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2054677', 'n_tokens_mistral': 2491, 'n_tokens_neox': 2363, 'n_words': 576}