text: //=================================================================================================
  /*!
  //  \file src/mathtest/densematrix/UniLowerTest.cpp
  //  \brief Source file for the unilower DenseMatrix operation test
  //
  //  Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved
  //
  //  This file is part of the Blaze library. You can redistribute it and/or modify it under
  //  the terms of the New (Revised) BSD License. Redistribution and use in source and binary
  //  forms, with or without modification, are permitted provided that the following conditions
  //  are met:
  //
  //  1. Redistributions of source code must retain the above copyright notice, this list of
  //     conditions and the following disclaimer.
  //  2. Redistributions in binary form must reproduce the above copyright notice, this list
  //     of conditions and the following disclaimer in the documentation and/or other materials
  //     provided with the distribution.
  //  3. Neither the names of the Blaze development group nor the names of its contributors
  //     may be used to endorse or promote products derived from this software without specific
  //     prior written permission.
  //
  //  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
  //  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  //  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  //  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  //  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  //  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  //  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  //  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  //  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  //  DAMAGE.
  */
  //=================================================================================================
  
  
  //*************************************************************************************************
  // Includes
  //*************************************************************************************************
  
  #include <cstdlib>
  #include <iostream>
  #include <blaze/math/dense/DenseMatrix.h>
  #include <blaze/math/DynamicMatrix.h>
  #include <blaze/math/UniLowerMatrix.h>
  #include <blazetest/mathtest/densematrix/UniLowerTest.h>
  
  
  namespace blazetest {
  
  namespace mathtest {
  
  namespace densematrix {
  
  //=================================================================================================
  //
  //  CONSTRUCTORS
  //
  //=================================================================================================
  
  //*************************************************************************************************
  /*!\brief Constructor for the UniLowerTest class test.
  //
  // \exception std::runtime_error Operation error detected.
  */
  UniLowerTest::UniLowerTest()
  {
     testIsSymmetric();
     testIsHermitian();
     testIsLower();
     testIsUniform();
     testIsUniLower();
     testIsStrictlyLower();
     testIsUpper();
     testIsUniUpper();
     testIsStrictlyUpper();
     testIsDiagonal();
     testIsIdentity();
  }
  //*************************************************************************************************
  
  
  
  
  //=================================================================================================
  //
  //  TEST FUNCTIONS
  //
  //=================================================================================================
  
  //*************************************************************************************************
  /*!\brief Test of the \c isSymmetric() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isSymmetric() function for dense matrices. In case an
  // error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsSymmetric()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isSymmetric()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isSymmetric( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isSymmetric evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isSymmetric( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isSymmetric evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isSymmetric()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isSymmetric( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isSymmetric evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isSymmetric( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isSymmetric evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isHermitian() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isHermitian() function for dense matrices. In case an
  // error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsHermitian()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isHermitian()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<cplx,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isHermitian( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isHermitian evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<cplx,blaze::rowMajor> > mat( 3UL );
           mat(1,0).imag( 4 );
           mat(2,0).imag( 5 );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isHermitian( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isHermitian evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isHermitian()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<cplx,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isHermitian( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isHermitian evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<cplx,blaze::columnMajor> > mat( 3UL );
           mat(1,0).imag( 4 );
           mat(2,0).imag( 5 );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isHermitian( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isHermitian evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isUniform() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isUniform() function for dense matrices. In case an
  // error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsUniform()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isUniform()";
  
        // Non-uniform unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUniform( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniform evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isUniform()";
  
        // Non-uniform unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUniform( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniform evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isLower() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isLower() function for dense matrices. In case an
  // error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsLower()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isLower()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isLower( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isLower( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isLower()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isLower( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isLower( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isUniLower() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isUniLower() function for dense matrices. In case an
  // error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsUniLower()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isUniLower()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUniLower( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 2;
           mat(2,0) = 3;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isUniLower( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isUniLower()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUniLower( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 2;
           mat(2,0) = 3;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUniLower( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isStrictlyLower() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isStrictlyLower() function for dense matrices. In case
  // an error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsStrictlyLower()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isStrictlyLower()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isStrictlyLower( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isStrictlyLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower triangular matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isStrictlyLower( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isStrictlyLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isStrictlyLower()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isStrictlyLower( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isStrictlyLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower triangular matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isStrictlyLower( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isStrictlyLower evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isUpper() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isUpper() function for dense matrices. In case an
  // error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsUpper()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isUpper()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUpper( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isUpper( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isUpper()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUpper( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUpper( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isUniUpper() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isUniUpper() function for dense matrices. In case an
  // error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsUniUpper()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isUniUpper()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUniUpper( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 2;
           mat(2,0) = 3;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isUniUpper( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isUniUpper()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUniUpper( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isUniUpper( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isUniUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isStrictlyUpper() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isStrictlyUpper() function for dense matrices. In case an
  // error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsStrictlyUpper()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isStrictlyUpper()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isStrictlyUpper( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isStrictlyUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isStrictlyUpper( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isStrictlyUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isStrictlyUpper()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isStrictlyUpper( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isStrictlyUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isStrictlyUpper( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isStrictlyUpper evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isDiagonal() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isDiagonal() function for dense matrices. In case
  // an error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsDiagonal()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isDiagonal()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isDiagonal( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isDiagonal evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isDiagonal( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isDiagonal evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isDiagonal()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isDiagonal( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isDiagonal evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isDiagonal( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isDiagonal evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  
  //*************************************************************************************************
  /*!\brief Test of the \c isIdentity() function for dense matrices.
  //
  // \return void
  // \exception std::runtime_error Error detected.
  //
  // This function performs a test of the \c isIdentity() function for dense matrices. In case
  // an error is detected, a \a std::runtime_error exception is thrown.
  */
  void UniLowerTest::testIsIdentity()
  {
     //=====================================================================================
     // Row-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Row-major isIdentity()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isIdentity( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isIdentity evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::rowMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 2UL );
           checkNonZeros( mat, 2UL, 2UL );
  
           if( isIdentity( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isIdentity evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  
  
     //=====================================================================================
     // Column-major matrix tests
     //=====================================================================================
  
     {
        test_ = "Column-major isIdentity()";
  
        // Default unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 3UL );
           checkNonZeros( mat, 0UL, 1UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isIdentity( mat ) != true ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isIdentity evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
  
        // Unilower matrix
        {
           blaze::UniLowerMatrix< blaze::DynamicMatrix<int,blaze::columnMajor> > mat( 3UL );
           mat(1,0) = 4;
           mat(2,0) = 5;
  
           checkRows    ( mat, 3UL );
           checkColumns ( mat, 3UL );
           checkCapacity( mat, 9UL );
           checkNonZeros( mat, 5UL );
           checkNonZeros( mat, 0UL, 3UL );
           checkNonZeros( mat, 1UL, 1UL );
           checkNonZeros( mat, 2UL, 1UL );
  
           if( isIdentity( mat ) != false ) {
              std::ostringstream oss;
              oss << " Test: " << test_ << "\n"
                  << " Error: Invalid isIdentity evaluation\n"
                  << " Details:\n"
                  << "   Matrix:\n" << mat << "\n";
              throw std::runtime_error( oss.str() );
           }
        }
     }
  }
  //*************************************************************************************************
  
  } // namespace densematrix
  
  } // namespace mathtest
  
  } // namespace blazetest
  
  
  
  
  //=================================================================================================
  //
  //  MAIN FUNCTION
  //
  //=================================================================================================
  
  //*************************************************************************************************
  int main()
  {
     std::cout << "   Running unilower DenseMatrix operation test..." << std::endl;
  
     try
     {
        RUN_DENSEMATRIX_UNILOWER_TEST;
     }
     catch( std::exception& ex ) {
        std::cerr << "\n\n ERROR DETECTED during unilower DenseMatrix operation test:\n"
                  << ex.what() << "\n";
        return EXIT_FAILURE;
     }
  
     return EXIT_SUCCESS;
  }
  //*************************************************************************************************
  