1 //=================================================================================================
2 /*!
3 //  \file blazetest/mathtest/adaptors/strictlylowermatrix/SparseTest.h
4 //  \brief Header file for the StrictlyLowerMatrix sparse test
5 //
6 //  Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
7 //
8 //  This file is part of the Blaze library. You can redistribute it and/or modify it under
9 //  the terms of the New (Revised) BSD License. Redistribution and use in source and binary
10 //  forms, with or without modification, are permitted provided that the following conditions
11 //  are met:
12 //
13 //  1. Redistributions of source code must retain the above copyright notice, this list of
14 //     conditions and the following disclaimer.
15 //  2. Redistributions in binary form must reproduce the above copyright notice, this list
16 //     of conditions and the following disclaimer in the documentation and/or other materials
17 //     provided with the distribution.
18 //  3. Neither the names of the Blaze development group nor the names of its contributors
19 //     may be used to endorse or promote products derived from this software without specific
20 //     prior written permission.
21 //
22 //  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
23 //  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 //  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25 //  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 //  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
27 //  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
28 //  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 //  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 //  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31 //  DAMAGE.
32 */
33 //=================================================================================================
34 
35 #ifndef _BLAZETEST_MATHTEST_ADAPTORS_STRICTLYLOWERMATRIX_SPARSETEST_H_
36 #define _BLAZETEST_MATHTEST_ADAPTORS_STRICTLYLOWERMATRIX_SPARSETEST_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <sstream>
44 #include <stdexcept>
45 #include <string>
46 #include <blaze/math/CompressedMatrix.h>
47 #include <blaze/math/constraints/ColumnMajorMatrix.h>
48 #include <blaze/math/constraints/RequiresEvaluation.h>
49 #include <blaze/math/constraints/RowMajorMatrix.h>
50 #include <blaze/math/constraints/SparseMatrix.h>
51 #include <blaze/math/constraints/StrictlyLower.h>
52 #include <blaze/math/constraints/StrictlyUpper.h>
53 #include <blaze/math/StrictlyLowerMatrix.h>
54 #include <blaze/math/typetraits/IsRowMajorMatrix.h>
55 #include <blaze/util/constraints/SameType.h>
56 #include <blazetest/system/Types.h>
57 
58 
59 namespace blazetest {
60 
61 namespace mathtest {
62 
63 namespace adaptors {
64 
65 namespace strictlylowermatrix {
66 
67 //=================================================================================================
68 //
69 //  CLASS DEFINITION
70 //
71 //=================================================================================================
72 
73 //*************************************************************************************************
74 /*!\brief Auxiliary class for all tests of the sparse StrictlyLowerMatrix specialization.
75 //
76 // This class represents a test suite for the blaze::StrictlyLowerMatrix class template
77 // specialization for sparse matrices. It performs a series of both compile time as well as
78 // runtime tests.
79 */
80 class SparseTest
81 {
82  public:
83    //**Constructors********************************************************************************
84    /*!\name Constructors */
85    //@{
86    explicit SparseTest();
87    // No explicitly declared copy constructor.
88    //@}
89    //**********************************************************************************************
90 
91    //**Destructor**********************************************************************************
92    // No explicitly declared destructor.
93    //**********************************************************************************************
94 
95  private:
96    //**Test functions******************************************************************************
97    /*!\name Test functions */
98    //@{
99    void testConstructors();
100    void testAssignment  ();
101    void testAddAssign   ();
102    void testSubAssign   ();
103    void testSchurAssign ();
104    void testMultAssign  ();
105    void testScaling     ();
106    void testFunctionCall();
107    void testIterator    ();
108    void testNonZeros    ();
109    void testReset       ();
110    void testClear       ();
111    void testResize      ();
112    void testReserve     ();
113    void testTrim        ();
114    void testShrinkToFit ();
115    void testSwap        ();
116    void testSet         ();
117    void testInsert      ();
118    void testAppend      ();
119    void testErase       ();
120    void testFind        ();
121    void testLowerBound  ();
122    void testUpperBound  ();
123    void testIsDefault   ();
124    void testSubmatrix   ();
125    void testRow         ();
126    void testColumn      ();
127 
128    template< typename Type >
129    void checkRows( const Type& matrix, size_t expectedRows ) const;
130 
131    template< typename Type >
132    void checkColumns( const Type& matrix, size_t expectedColumns ) const;
133 
134    template< typename Type >
135    void checkCapacity( const Type& matrix, size_t minCapacity ) const;
136 
137    template< typename Type >
138    void checkCapacity( const Type& matrix, size_t index, size_t minCapacity ) const;
139 
140    template< typename Type >
141    void checkNonZeros( const Type& matrix, size_t expectedNonZeros ) const;
142 
143    template< typename Type >
144    void checkNonZeros( const Type& matrix, size_t index, size_t expectedNonZeros ) const;
145    //@}
146    //**********************************************************************************************
147 
148    //**Member variables****************************************************************************
149    /*!\name Member variables */
150    //@{
151    std::string test_;  //!< Label of the currently performed test.
152    //@}
153    //**********************************************************************************************
154 
155    //**Type definitions****************************************************************************
156    //! Type of the row-major strictly lower matrix.
157    using LT = blaze::StrictlyLowerMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> >;
158 
159    //! Type of the column-major strictly lower matrix.
160    using OLT = blaze::StrictlyLowerMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> >;
161 
162    using RLT  = LT::Rebind<double>::Other;   //!< Rebound row-major strictly lower matrix type.
163    using ORLT = OLT::Rebind<double>::Other;  //!< Rebound column-major strictly lower matrix type.
164    //**********************************************************************************************
165 
166    //**Compile time checks*************************************************************************
167    /*! \cond BLAZE_INTERNAL */
168    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( LT                  );
169    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( LT::ResultType      );
170    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( LT::OppositeType    );
171    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( LT::TransposeType   );
172    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OLT                 );
173    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OLT::ResultType     );
174    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OLT::OppositeType   );
175    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OLT::TransposeType  );
176    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RLT                 );
177    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RLT::ResultType     );
178    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RLT::OppositeType   );
179    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RLT::TransposeType  );
180    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORLT                );
181    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORLT::ResultType    );
182    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORLT::OppositeType  );
183    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORLT::TransposeType );
184 
185    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( LT                  );
186    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( LT::ResultType      );
187    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( LT::OppositeType    );
188    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( LT::TransposeType   );
189    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( OLT                 );
190    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( OLT::ResultType     );
191    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( OLT::OppositeType   );
192    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( OLT::TransposeType  );
193    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( RLT                 );
194    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( RLT::ResultType     );
195    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( RLT::OppositeType   );
196    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( RLT::TransposeType  );
197    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ORLT                );
198    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ORLT::ResultType    );
199    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( ORLT::OppositeType  );
200    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( ORLT::TransposeType );
201 
202    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( LT                  );
203    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( LT::ResultType      );
204    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( LT::OppositeType    );
205    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_UPPER_MATRIX_TYPE( LT::TransposeType   );
206    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( OLT                 );
207    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( OLT::ResultType     );
208    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( OLT::OppositeType   );
209    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_UPPER_MATRIX_TYPE( OLT::TransposeType  );
210    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( RLT                 );
211    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( RLT::ResultType     );
212    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( RLT::OppositeType   );
213    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_UPPER_MATRIX_TYPE( RLT::TransposeType  );
214    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( ORLT                );
215    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( ORLT::ResultType    );
216    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_LOWER_MATRIX_TYPE( ORLT::OppositeType  );
217    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_UPPER_MATRIX_TYPE( ORLT::TransposeType );
218 
219    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( LT::ResultType      );
220    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( LT::OppositeType    );
221    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( LT::TransposeType   );
222    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OLT::ResultType     );
223    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OLT::OppositeType   );
224    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OLT::TransposeType  );
225    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RLT::ResultType     );
226    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RLT::OppositeType   );
227    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RLT::TransposeType  );
228    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORLT::ResultType    );
229    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORLT::OppositeType  );
230    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORLT::TransposeType );
231 
232    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( LT::ElementType,   LT::ResultType::ElementType      );
233    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( LT::ElementType,   LT::OppositeType::ElementType    );
234    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( LT::ElementType,   LT::TransposeType::ElementType   );
235    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OLT::ElementType,  OLT::ResultType::ElementType     );
236    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OLT::ElementType,  OLT::OppositeType::ElementType   );
237    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OLT::ElementType,  OLT::TransposeType::ElementType  );
238    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RLT::ElementType,  RLT::ResultType::ElementType     );
239    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RLT::ElementType,  RLT::OppositeType::ElementType   );
240    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RLT::ElementType,  RLT::TransposeType::ElementType  );
241    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORLT::ElementType, ORLT::ResultType::ElementType    );
242    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORLT::ElementType, ORLT::OppositeType::ElementType  );
243    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORLT::ElementType, ORLT::TransposeType::ElementType );
244    /*! \endcond */
245    //**********************************************************************************************
246 };
247 //*************************************************************************************************
248 
249 
250 
251 
252 //=================================================================================================
253 //
254 //  TEST FUNCTIONS
255 //
256 //=================================================================================================
257 
258 //*************************************************************************************************
259 /*!\brief Checking the number of rows of the given matrix.
260 //
261 // \param matrix The matrix to be checked.
262 // \param expectedRows The expected number of rows of the matrix.
263 // \return void
264 // \exception std::runtime_error Error detected.
265 //
266 // This function checks the number of rows of the given matrix. In case the actual number of
267 // rows does not correspond to the given expected number of rows, a \a std::runtime_error
268 // exception is thrown.
269 */
270 template< typename Type >  // Type of the matrix
checkRows(const Type & matrix,size_t expectedRows)271 void SparseTest::checkRows( const Type& matrix, size_t expectedRows ) const
272 {
273    if( matrix.rows() != expectedRows ) {
274       std::ostringstream oss;
275       oss << " Test: " << test_ << "\n"
276           << " Error: Invalid number of rows detected\n"
277           << " Details:\n"
278           << "   Number of rows         : " << matrix.rows() << "\n"
279           << "   Expected number of rows: " << expectedRows << "\n";
280       throw std::runtime_error( oss.str() );
281    }
282 }
283 //*************************************************************************************************
284 
285 
286 //*************************************************************************************************
287 /*!\brief Checking the number of columns of the given matrix.
288 //
289 // \param matrix The matrix to be checked.
290 // \param expectedRows The expected number of columns of the matrix.
291 // \return void
292 // \exception std::runtime_error Error detected.
293 //
294 // This function checks the number of columns of the given matrix. In case the actual number of
295 // columns does not correspond to the given expected number of columns, a \a std::runtime_error
296 // exception is thrown.
297 */
298 template< typename Type >  // Type of the matrix
checkColumns(const Type & matrix,size_t expectedColumns)299 void SparseTest::checkColumns( const Type& matrix, size_t expectedColumns ) const
300 {
301    if( matrix.columns() != expectedColumns ) {
302       std::ostringstream oss;
303       oss << " Test: " << test_ << "\n"
304           << " Error: Invalid number of columns detected\n"
305           << " Details:\n"
306           << "   Number of columns         : " << matrix.columns() << "\n"
307           << "   Expected number of columns: " << expectedColumns << "\n";
308       throw std::runtime_error( oss.str() );
309    }
310 }
311 //*************************************************************************************************
312 
313 
314 //*************************************************************************************************
315 /*!\brief Checking the capacity of the given matrix.
316 //
317 // \param matrix The matrix to be checked.
318 // \param minCapacity The expected minimum capacity of the matrix.
319 // \return void
320 // \exception std::runtime_error Error detected.
321 //
322 // This function checks the capacity of the given matrix. In case the actual capacity is smaller
323 // than the given expected minimum capacity, a \a std::runtime_error exception is thrown.
324 */
325 template< typename Type >  // Type of the matrix
checkCapacity(const Type & matrix,size_t minCapacity)326 void SparseTest::checkCapacity( const Type& matrix, size_t minCapacity ) const
327 {
328    if( capacity( matrix ) < minCapacity ) {
329       std::ostringstream oss;
330       oss << " Test: " << test_ << "\n"
331           << " Error: Invalid capacity detected\n"
332           << " Details:\n"
333           << "   Capacity                 : " << capacity( matrix ) << "\n"
334           << "   Expected minimum capacity: " << minCapacity << "\n";
335       throw std::runtime_error( oss.str() );
336    }
337 }
338 //*************************************************************************************************
339 
340 
341 //*************************************************************************************************
342 /*!\brief Checking the capacity of a specific row/column of the given matrix.
343 //
344 // \param matrix The matrix to be checked.
345 // \param index The row/column to be checked.
346 // \param minCapacity The expected minimum capacity of the specified row/column.
347 // \return void
348 // \exception std::runtime_error Error detected.
349 //
350 // This function checks the capacity of a specific row/column of the given matrix. In case the
351 // actual capacity is smaller than the given expected minimum capacity, a \a std::runtime_error
352 // exception is thrown.
353 */
354 template< typename Type >  // Type of the matrix
checkCapacity(const Type & matrix,size_t index,size_t minCapacity)355 void SparseTest::checkCapacity( const Type& matrix, size_t index, size_t minCapacity ) const
356 {
357    if( capacity( matrix, index ) < minCapacity ) {
358       std::ostringstream oss;
359       oss << " Test: " << test_ << "\n"
360           << " Error: Invalid capacity detected in "
361           << ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
362           << " Details:\n"
363           << "   Capacity                 : " << capacity( matrix, index ) << "\n"
364           << "   Expected minimum capacity: " << minCapacity << "\n";
365       throw std::runtime_error( oss.str() );
366    }
367 }
368 //*************************************************************************************************
369 
370 
371 //*************************************************************************************************
372 /*!\brief Checking the number of non-zero elements of the given matrix.
373 //
374 // \param matrix The matrix to be checked.
375 // \param expectedNonZeros The expected number of non-zero elements of the matrix.
376 // \return void
377 // \exception std::runtime_error Error detected.
378 //
379 // This function checks the number of non-zero elements of the given matrix. In case the
380 // actual number of non-zero elements does not correspond to the given expected number,
381 // a \a std::runtime_error exception is thrown.
382 */
383 template< typename Type >  // Type of the matrix
checkNonZeros(const Type & matrix,size_t expectedNonZeros)384 void SparseTest::checkNonZeros( const Type& matrix, size_t expectedNonZeros ) const
385 {
386    if( nonZeros( matrix ) != expectedNonZeros ) {
387       std::ostringstream oss;
388       oss << " Test: " << test_ << "\n"
389           << " Error: Invalid number of non-zero elements\n"
390           << " Details:\n"
391           << "   Number of non-zeros         : " << nonZeros( matrix ) << "\n"
392           << "   Expected number of non-zeros: " << expectedNonZeros << "\n";
393       throw std::runtime_error( oss.str() );
394    }
395 
396    if( capacity( matrix ) < nonZeros( matrix ) ) {
397       std::ostringstream oss;
398       oss << " Test: " << test_ << "\n"
399           << " Error: Invalid capacity detected\n"
400           << " Details:\n"
401           << "   Number of non-zeros: " << nonZeros( matrix ) << "\n"
402           << "   Capacity           : " << capacity( matrix ) << "\n";
403       throw std::runtime_error( oss.str() );
404    }
405 }
406 //*************************************************************************************************
407 
408 
409 //*************************************************************************************************
410 /*!\brief Checking the number of non-zero elements in a specific row/column of the given matrix.
411 //
412 // \param matrix The matrix to be checked.
413 // \param index The row/column to be checked.
414 // \param expectedNonZeros The expected number of non-zero elements in the specified row/column.
415 // \return void
416 // \exception std::runtime_error Error detected.
417 //
418 // This function checks the number of non-zero elements in the specified row/column of the
419 // given matrix. In case the actual number of non-zero elements does not correspond to the
420 // given expected number, a \a std::runtime_error exception is thrown.
421 */
422 template< typename Type >  // Type of the matrix
checkNonZeros(const Type & matrix,size_t index,size_t expectedNonZeros)423 void SparseTest::checkNonZeros( const Type& matrix, size_t index, size_t expectedNonZeros ) const
424 {
425    if( nonZeros( matrix, index ) != expectedNonZeros ) {
426       std::ostringstream oss;
427       oss << " Test: " << test_ << "\n"
428           << " Error: Invalid number of non-zero elements in "
429           << ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
430           << " Details:\n"
431           << "   Number of non-zeros         : " << nonZeros( matrix, index ) << "\n"
432           << "   Expected number of non-zeros: " << expectedNonZeros << "\n";
433       throw std::runtime_error( oss.str() );
434    }
435 
436    if( capacity( matrix, index ) < nonZeros( matrix, index ) ) {
437       std::ostringstream oss;
438       oss << " Test: " << test_ << "\n"
439           << " Error: Invalid capacity detected in "
440           << ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
441           << " Details:\n"
442           << "   Number of non-zeros: " << nonZeros( matrix, index ) << "\n"
443           << "   Capacity           : " << capacity( matrix, index ) << "\n";
444       throw std::runtime_error( oss.str() );
445    }
446 }
447 //*************************************************************************************************
448 
449 
450 
451 
452 //=================================================================================================
453 //
454 //  GLOBAL TEST FUNCTIONS
455 //
456 //=================================================================================================
457 
458 //*************************************************************************************************
459 /*!\brief Testing the functionality of the sparse StrictlyLowerMatrix specialization.
460 //
461 // \return void
462 */
runTest()463 void runTest()
464 {
465    SparseTest();
466 }
467 //*************************************************************************************************
468 
469 
470 
471 
472 //=================================================================================================
473 //
474 //  MACRO DEFINITIONS
475 //
476 //=================================================================================================
477 
478 //*************************************************************************************************
479 /*! \cond BLAZE_INTERNAL */
480 /*!\brief Macro for the execution of the StrictlyLowerMatrix sparse test.
481 */
482 #define RUN_STRICTLYLOWERMATRIX_SPARSE_TEST \
483    blazetest::mathtest::adaptors::strictlylowermatrix::runTest()
484 /*! \endcond */
485 //*************************************************************************************************
486 
487 } // namespace strictlylowermatrix
488 
489 } // namespace adaptors
490 
491 } // namespace mathtest
492 
493 } // namespace blazetest
494 
495 #endif
496