<commit_before>// ---------------------------------------------------------------------
//
// Copyright (C) 2005 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------

#ifndef dealii_lapack_support_h
#define dealii_lapack_support_h


#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>

DEAL_II_NAMESPACE_OPEN


namespace LAPACKSupport
{
  /**
   * Most of the LAPACK functions one can apply to a matrix (e.g., by calling
   * the member functions of this class) change its content in some ways. For
   * example, they may invert the matrix, or may replace it by a matrix whose
   * columns represent the eigenvectors of the original content of the matrix.
   * The elements of this enumeration are therefore used to track what is
   * currently being stored by this object.
   *
   * @author <NAME>, 2005
   */
  enum State
  {
    /// Contents is actually a matrix.
    matrix,
    /// Contents is the inverse of a matrix.
    inverse_matrix,
    /// Contents is an LU decomposition.
    lu,
    /// Contents is a Cholesky decomposition.
    cholesky,
    /// Eigenvalue vector is filled
    eigenvalues,
    /// Matrix contains singular value decomposition,
    svd,
    /// Matrix is the inverse of a singular value decomposition
    inverse_svd,
    /// Contents is something useless.
    unusable = 0x8000
  };

  /**
   * Function printing the name of a State.
   */
  inline const char *state_name(State s)
  {
    switch (s)
      {
      case matrix:
        return "matrix";
      case inverse_matrix:
        return "inverse matrix";
      case lu:
        return "lu decomposition";
      case eigenvalues:
        return "eigenvalues";
      case svd:
        return "svd";
      case inverse_svd:
        return "inverse_svd";
      case unusable:
        return "unusable";
      default:
        return "unknown";
      }
  }

  /**
   * A matrix can have certain features allowing for optimization, but hard to
   * test. These are listed here.
   */
  enum Property
  {
    /// No special properties
    general = 0,
    /// Matrix is symmetric
    symmetric = 1,
    /// Matrix is upper triangular
    upper_triangular = 2,
    /// Matrix is lower triangular
    lower_triangular = 4,
    /// Matrix is diagonal
    diagonal = 6,
    /// Matrix is in upper Hessenberg form
    hessenberg = 8
  };

  /**
   * Function printing the name of a Property.
   */
  inline const char *property_name(const Property s)
  {
    switch (s)
      {
      case general:
        return "general";
      case symmetric:
        return "symmetric";
      case upper_triangular:
        return "upper triangular";
      case lower_triangular:
        return "lower triangular";
      case diagonal:
        return "diagonal";
      case hessenberg:
        return "Hessenberg";
      }

    Assert (false, ExcNotImplemented());
    return "invalid";
  }

  /**
   * Character constant.
   */
  static const char A = 'A';
  /**
   * Character constant.
   */
  static const char N = 'N';
  /**
   * Character constant.
   */
  static const char T = 'T';
  /**
   * Character constant.
   */
  static const char U = 'U';
  /**
   * Character constant.
   */
  static const char L = 'L';
  /**
   * Character constant.
   */
  static const char V = 'V';
  /**
   * Integer constant.
   */
  static const int zero = 0;
  /**
   * Integer constant.
   */
  static const int one = 1;

  /**
   * A LAPACK function returned an error code.
   */
  DeclException2(ExcErrorCode, char *, int,
                 << "The function " << arg1 << " returned with an error code " << arg2);

  /**
   * Exception thrown when a matrix is not in a suitable state for an
   * operation. For instance, a LAPACK routine may have left the matrix in an
   * unusable state, then vmult does not make sense anymore.
   */
  DeclException1(ExcState, State,
                 << "The function cannot be called while the matrix is in state "
                 << state_name(arg1));

  /**
   * Exception thrown when a matrix does not have suitable properties for an
   * operation.
   */
  DeclException1(ExcProperty, Property,
                 << "The function cannot be called with a "
                 << property_name(arg1)
                 << " matrix.");

  /**
   * This exception is thrown if a certain LAPACK function is not available
   * because no LAPACK installation was detected during configuration.
   */
  DeclException1(ExcMissing, char *,
                 << "When you ran 'cmake' during installation of deal.II, "
                 << "no suitable installation of the BLAS or LAPACK library could "
                 << "be found. Consequently, the function <"
                 << arg1
                 << "> can not be called. Refer to the doc/readme.html "
                 << "file for information on how to ensure that deal.II "
                 << "picks up an existing BLAS and LAPACK installation at "
                 << "configuration time.");
}


DEAL_II_NAMESPACE_CLOSE

#endif
<commit_msg>Enable doxygen for the LAPACKSupport namespace.<commit_after>// ---------------------------------------------------------------------
//
// Copyright (C) 2005 - 2017 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------

#ifndef dealii_lapack_support_h
#define dealii_lapack_support_h


#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>

DEAL_II_NAMESPACE_OPEN


/**
 * A namespace containing constants, exceptions, enumerations, and other
 * utilities used by the deal.II LAPACK bindings.
 */
namespace LAPACKSupport
{
  /**
   * Most of the LAPACK functions one can apply to a matrix (e.g., by calling
   * the member functions of this class) change its content in some ways. For
   * example, they may invert the matrix, or may replace it by a matrix whose
   * columns represent the eigenvectors of the original content of the matrix.
   * The elements of this enumeration are therefore used to track what is
   * currently being stored by this object.
   *
   * @author <NAME>, 2005
   */
  enum State
  {
    /// Contents is actually a matrix.
    matrix,
    /// Contents is the inverse of a matrix.
    inverse_matrix,
    /// Contents is an LU decomposition.
    lu,
    /// Contents is a Cholesky decomposition.
    cholesky,
    /// Eigenvalue vector is filled
    eigenvalues,
    /// Matrix contains singular value decomposition,
    svd,
    /// Matrix is the inverse of a singular value decomposition
    inverse_svd,
    /// Contents is something useless.
    unusable = 0x8000
  };

  /**
   * Function printing the name of a State.
   */
  inline const char *state_name(State s)
  {
    switch (s)
      {
      case matrix:
        return "matrix";
      case inverse_matrix:
        return "inverse matrix";
      case lu:
        return "lu decomposition";
      case eigenvalues:
        return "eigenvalues";
      case svd:
        return "svd";
      case inverse_svd:
        return "inverse_svd";
      case unusable:
        return "unusable";
      default:
        return "unknown";
      }
  }

  /**
   * A matrix can have certain features allowing for optimization, but hard to
   * test. These are listed here.
   */
  enum Property
  {
    /// No special properties
    general = 0,
    /// Matrix is symmetric
    symmetric = 1,
    /// Matrix is upper triangular
    upper_triangular = 2,
    /// Matrix is lower triangular
    lower_triangular = 4,
    /// Matrix is diagonal
    diagonal = 6,
    /// Matrix is in upper Hessenberg form
    hessenberg = 8
  };

  /**
   * Function printing the name of a Property.
   */
  inline const char *property_name(const Property s)
  {
    switch (s)
      {
      case general:
        return "general";
      case symmetric:
        return "symmetric";
      case upper_triangular:
        return "upper triangular";
      case lower_triangular:
        return "lower triangular";
      case diagonal:
        return "diagonal";
      case hessenberg:
        return "Hessenberg";
      }

    Assert (false, ExcNotImplemented());
    return "invalid";
  }

  /**
   * Character constant.
   */
  static const char A = 'A';
  /**
   * Character constant.
   */
  static const char N = 'N';
  /**
   * Character constant.
   */
  static const char T = 'T';
  /**
   * Character constant.
   */
  static const char U = 'U';
  /**
   * Character constant.
   */
  static const char L = 'L';
  /**
   * Character constant.
   */
  static const char V = 'V';
  /**
   * Integer constant.
   */
  static const int zero = 0;
  /**
   * Integer constant.
   */
  static const int one = 1;

  /**
   * A LAPACK function returned an error code.
   */
  DeclException2(ExcErrorCode, char *, int,
                 << "The function " << arg1 << " returned with an error code " << arg2);

  /**
   * Exception thrown when a matrix is not in a suitable state for an
   * operation. For instance, a LAPACK routine may have left the matrix in an
   * unusable state, then vmult does not make sense anymore.
   */
  DeclException1(ExcState, State,
                 << "The function cannot be called while the matrix is in state "
                 << state_name(arg1));

  /**
   * Exception thrown when a matrix does not have suitable properties for an
   * operation.
   */
  DeclException1(ExcProperty, Property,
                 << "The function cannot be called with a "
                 << property_name(arg1)
                 << " matrix.");

  /**
   * This exception is thrown if a certain LAPACK function is not available
   * because no LAPACK installation was detected during configuration.
   */
  DeclException1(ExcMissing, char *,
                 << "When you ran 'cmake' during installation of deal.II, "
                 << "no suitable installation of the BLAS or LAPACK library could "
                 << "be found. Consequently, the function <"
                 << arg1
                 << "> can not be called. Refer to the doc/readme.html "
                 << "file for information on how to ensure that deal.II "
                 << "picks up an existing BLAS and LAPACK installation at "
                 << "configuration time.");
}


DEAL_II_NAMESPACE_CLOSE

#endif

{'fraction_non_alphanumeric': 0.11437527989252128, 'fraction_numerical': 0.006448723690103001, 'mean_word_length': 1.9863599893019523, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 11, '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': '6702262', 'n_tokens_mistral': 3106, 'n_tokens_neox': 2963, 'n_words': 1210}