<commit_before>/*
   Copyright (c) 2009-2014, <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
*/
#pragma once
#ifndef EL_IO_HPP
#define EL_IO_HPP

namespace El {

const char* QtImageFormat( FileFormat format );
std::string FileExtension( FileFormat format );
FileFormat FormatFromExtension( const std::string ext );
FileFormat DetectFormat( const std::string filename );

std::ifstream::pos_type FileSize( std::ifstream& file );

// TODO: Many more color maps
namespace ColorMapNS {
enum ColorMap
{
    GRAYSCALE,
    GRAYSCALE_DISCRETE,
    RED_BLACK_GREEN,
    BLUE_RED
};
}
using namespace ColorMapNS;

#ifdef EL_HAVE_QT5
// Return true if Qt5 was detected, but no GUI is allowed.
// This is useful if images are to be written to file using Qt5's wrappers.
bool GuiDisabled();

// When Elemental is finalized, if no window was opened, then it must call 
// app.exit() instead
void OpenedWindow();

// For keeping track of the extreme values visualized so far
double MinRealWindowVal();
double MaxRealWindowVal();
double MinImagWindowVal();
double MaxImagWindowVal();
void UpdateMinRealWindowVal( double minVal );
void UpdateMaxRealWindowVal( double maxVal );
void UpdateMinImagWindowVal( double minVal );
void UpdateMaxImagWindowVal( double maxVal );
#endif

} // namespace El

#ifdef EL_HAVE_QT5
# include "El/io/DisplayWidget.hpp"
# include "El/io/DisplayWindow-premoc.hpp"
# include "El/io/ComplexDisplayWindow-premoc.hpp"
#endif // ifdef EL_HAVE_QT5

namespace El {

// Color maps
// ==========
void SetColorMap( ColorMap colorMap );
ColorMap GetColorMap();
void SetNumDiscreteColors( Int numColors );
Int NumDiscreteColors();
#ifdef EL_HAVE_QT5
QRgb SampleColorMap( double value, double minVal, double maxVal );
#endif 

// Display
// =======
void ProcessEvents( int numMsecs );

// Dense
// -----
template<typename Real>
void Display( const Matrix<Real>& A, std::string title="Matrix" );
template<typename Real>
void Display( const Matrix<Complex<Real>>& A, std::string title="Matrix" );
template<typename T>
void Display
( const AbstractDistMatrix<T>& AAbs, std::string title="DistMatrix" );
template<typename T>
void Display
( const AbstractBlockDistMatrix<T>& AAbs, std::string title="BlockDistMatrix" );

// Sparse-direct
// -------------
void Display( const Graph& graph, std::string title="Graph" );
void Display( const DistGraph& graph, std::string title="DistGraph" );

template<typename Real>
void Display
( const SparseMatrix<Real>& A, std::string title="SparseMatrix" );
template<typename Real>
void Display
( const SparseMatrix<Complex<Real>>& A, std::string title="SparseMatrix" );
template<typename Real>
void Display
( const DistSparseMatrix<Real>& A, 
  std::string title="DistSparseMatrix" );
template<typename Real>
void Display
( const DistSparseMatrix<Complex<Real>>& A, 
  std::string title="DistSparseMatrix" );

void DisplayLocal
( const DistSymmInfo& info, bool beforeFact, std::string title="" );

// Print
// =====

// Dense
// -----
template<typename T>
void Print
( const Matrix<T>& A, std::string title="Matrix", std::ostream& os=std::cout );
template<typename T>
void Print
( const AbstractDistMatrix<T>& AAbs, std::string title="DistMatrix",
  std::ostream& os=std::cout );
template<typename T>
void Print
( const AbstractBlockDistMatrix<T>& AAbs, std::string title="BlockDistMatrix",
  std::ostream& os=std::cout );<commit_msg>Adding missing forward declaration of DistSymmInfo in include/El/io.hpp<commit_after>/*
   Copyright (c) 2009-2014, <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
*/
#pragma once
#ifndef EL_IO_HPP
#define EL_IO_HPP

namespace El {

const char* QtImageFormat( FileFormat format );
std::string FileExtension( FileFormat format );
FileFormat FormatFromExtension( const std::string ext );
FileFormat DetectFormat( const std::string filename );

std::ifstream::pos_type FileSize( std::ifstream& file );

// TODO: Many more color maps
namespace ColorMapNS {
enum ColorMap
{
    GRAYSCALE,
    GRAYSCALE_DISCRETE,
    RED_BLACK_GREEN,
    BLUE_RED
};
}
using namespace ColorMapNS;

#ifdef EL_HAVE_QT5
// Return true if Qt5 was detected, but no GUI is allowed.
// This is useful if images are to be written to file using Qt5's wrappers.
bool GuiDisabled();

// When Elemental is finalized, if no window was opened, then it must call 
// app.exit() instead
void OpenedWindow();

// For keeping track of the extreme values visualized so far
double MinRealWindowVal();
double MaxRealWindowVal();
double MinImagWindowVal();
double MaxImagWindowVal();
void UpdateMinRealWindowVal( double minVal );
void UpdateMaxRealWindowVal( double maxVal );
void UpdateMinImagWindowVal( double minVal );
void UpdateMaxImagWindowVal( double maxVal );
#endif

} // namespace El

#ifdef EL_HAVE_QT5
# include "El/io/DisplayWidget.hpp"
# include "El/io/DisplayWindow-premoc.hpp"
# include "El/io/ComplexDisplayWindow-premoc.hpp"
#endif // ifdef EL_HAVE_QT5

namespace El {

// Color maps
// ==========
void SetColorMap( ColorMap colorMap );
ColorMap GetColorMap();
void SetNumDiscreteColors( Int numColors );
Int NumDiscreteColors();
#ifdef EL_HAVE_QT5
QRgb SampleColorMap( double value, double minVal, double maxVal );
#endif 

// Display
// =======
void ProcessEvents( int numMsecs );

// Dense
// -----
template<typename Real>
void Display( const Matrix<Real>& A, std::string title="Matrix" );
template<typename Real>
void Display( const Matrix<Complex<Real>>& A, std::string title="Matrix" );
template<typename T>
void Display
( const AbstractDistMatrix<T>& AAbs, std::string title="DistMatrix" );
template<typename T>
void Display
( const AbstractBlockDistMatrix<T>& AAbs, std::string title="BlockDistMatrix" );

// Sparse-direct
// -------------
void Display( const Graph& graph, std::string title="Graph" );
void Display( const DistGraph& graph, std::string title="DistGraph" );

template<typename Real>
void Display
( const SparseMatrix<Real>& A, std::string title="SparseMatrix" );
template<typename Real>
void Display
( const SparseMatrix<Complex<Real>>& A, std::string title="SparseMatrix" );
template<typename Real>
void Display
( const DistSparseMatrix<Real>& A, 
  std::string title="DistSparseMatrix" );
template<typename Real>
void Display
( const DistSparseMatrix<Complex<Real>>& A, 
  std::string title="DistSparseMatrix" );

// Forward declaration
struct DistSymmInfo;

void DisplayLocal
( const DistSymmInfo& info, bool beforeFact, std::string title="" );

// Print
// =====

// Dense
// -----
template<typename T>
void Print
( const Matrix<T>& A, std::string title="Matrix", std::ostream& os=std::cout );
template<typename T>
void Print
( const AbstractDistMatrix<T>& AAbs, std::string title="DistMatrix",
  std::ostream& os=std::cout );
template<typename T>
void Print
( const AbstractBlockDistMatrix<T>& AAbs, std::string title="BlockDistMatrix",
  std::ostream& os=std::cout );
{'fraction_non_alphanumeric': 0.12678993465869595, 'fraction_numerical': 0.0044487696371472265, 'mean_word_length': 5.228571428571429, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, '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': '4964679', 'n_tokens_mistral': 2223, 'n_tokens_neox': 2164, 'n_words': 693}