1 //=================================================================================================
2 /*!
3 //  \file blazetest/mathtest/adaptors/symmetricmatrix/SparseScalarTest.h
4 //  \brief Header file for the SymmetricMatrix sparse scalar 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_SYMMETRICMATRIX_SPARSESCALARTEST_H_
36 #define _BLAZETEST_MATHTEST_ADAPTORS_SYMMETRICMATRIX_SPARSESCALARTEST_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/Symmetric.h>
52 #include <blaze/math/SymmetricMatrix.h>
53 #include <blaze/math/typetraits/IsRowMajorMatrix.h>
54 #include <blaze/util/constraints/SameType.h>
55 #include <blazetest/system/Types.h>
56 
57 
58 namespace blazetest {
59 
60 namespace mathtest {
61 
62 namespace adaptors {
63 
64 namespace symmetricmatrix {
65 
66 //=================================================================================================
67 //
68 //  CLASS DEFINITION
69 //
70 //=================================================================================================
71 
72 //*************************************************************************************************
73 /*!\brief Auxiliary class for all tests of the sparse scalar SymmetricMatrix specialization.
74 //
75 // This class represents a test suite for the blaze::SymmetricMatrix class template specialization
76 // for sparse matrices with scalar element type. It performs a series of both compile time as well
77 // as runtime tests.
78 */
79 class SparseScalarTest
80 {
81  public:
82    //**Constructors********************************************************************************
83    /*!\name Constructors */
84    //@{
85    explicit SparseScalarTest();
86    // No explicitly declared copy constructor.
87    //@}
88    //**********************************************************************************************
89 
90    //**Destructor**********************************************************************************
91    // No explicitly declared destructor.
92    //**********************************************************************************************
93 
94  private:
95    //**Test functions******************************************************************************
96    /*!\name Test functions */
97    //@{
98    void testConstructors();
99    void testAssignment  ();
100    void testAddAssign   ();
101    void testSubAssign   ();
102    void testSchurAssign ();
103    void testMultAssign  ();
104    void testScaling     ();
105    void testFunctionCall();
106    void testIterator    ();
107    void testNonZeros    ();
108    void testReset       ();
109    void testClear       ();
110    void testResize      ();
111    void testReserve     ();
112    void testTrim        ();
113    void testShrinkToFit ();
114    void testSwap        ();
115    void testSet         ();
116    void testInsert      ();
117    void testAppend      ();
118    void testErase       ();
119    void testFind        ();
120    void testLowerBound  ();
121    void testUpperBound  ();
122    void testTranspose   ();
123    void testCTranspose  ();
124    void testIsDefault   ();
125    void testSubmatrix   ();
126    void testRow         ();
127    void testColumn      ();
128 
129    template< typename Type >
130    void checkRows( const Type& matrix, size_t expectedRows ) const;
131 
132    template< typename Type >
133    void checkColumns( const Type& matrix, size_t expectedColumns ) const;
134 
135    template< typename Type >
136    void checkCapacity( const Type& matrix, size_t minCapacity ) const;
137 
138    template< typename Type >
139    void checkCapacity( const Type& matrix, size_t index, size_t minCapacity ) const;
140 
141    template< typename Type >
142    void checkNonZeros( const Type& matrix, size_t expectedNonZeros ) const;
143 
144    template< typename Type >
145    void checkNonZeros( const Type& matrix, size_t index, size_t expectedNonZeros ) const;
146    //@}
147    //**********************************************************************************************
148 
149    //**Member variables****************************************************************************
150    /*!\name Member variables */
151    //@{
152    std::string test_;  //!< Label of the currently performed test.
153    //@}
154    //**********************************************************************************************
155 
156    //**Type definitions****************************************************************************
157    //! Type of the scalar row-major symmetric matrix.
158    using ST = blaze::SymmetricMatrix< blaze::CompressedMatrix<int,blaze::rowMajor> >;
159 
160    //! Type of the scalar column-major symmetric matrix.
161    using OST = blaze::SymmetricMatrix< blaze::CompressedMatrix<int,blaze::columnMajor> >;
162 
163    using RST  = ST::Rebind<double>::Other;   //!< Rebound row-major symmetric matrix type.
164    using ORST = OST::Rebind<double>::Other;  //!< Rebound column-major symmetric matrix type.
165    //**********************************************************************************************
166 
167    //**Compile time checks*************************************************************************
168    /*! \cond BLAZE_INTERNAL */
169    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ST                  );
170    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ST::ResultType      );
171    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ST::OppositeType    );
172    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ST::TransposeType   );
173    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OST                 );
174    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OST::ResultType     );
175    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OST::OppositeType   );
176    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( OST::TransposeType  );
177    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RST                 );
178    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RST::ResultType     );
179    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RST::OppositeType   );
180    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( RST::TransposeType  );
181    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORST                );
182    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORST::ResultType    );
183    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORST::OppositeType  );
184    BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( ORST::TransposeType );
185 
186    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( ST                  );
187    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( ST::ResultType      );
188    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ST::OppositeType    );
189    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ST::TransposeType   );
190    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( OST                 );
191    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( OST::ResultType     );
192    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( OST::OppositeType   );
193    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( OST::TransposeType  );
194    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( RST                 );
195    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( RST::ResultType     );
196    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( RST::OppositeType   );
197    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( RST::TransposeType  );
198    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ORST                );
199    BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE( ORST::ResultType    );
200    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( ORST::OppositeType  );
201    BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE   ( ORST::TransposeType );
202 
203    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( ST                  );
204    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( ST::ResultType      );
205    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( ST::OppositeType    );
206    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( ST::TransposeType   );
207    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( OST                 );
208    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( OST::ResultType     );
209    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( OST::OppositeType   );
210    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( OST::TransposeType  );
211    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( RST                 );
212    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( RST::ResultType     );
213    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( RST::OppositeType   );
214    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( RST::TransposeType  );
215    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( ORST                );
216    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( ORST::ResultType    );
217    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( ORST::OppositeType  );
218    BLAZE_CONSTRAINT_MUST_BE_SYMMETRIC_MATRIX_TYPE( ORST::TransposeType );
219 
220    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ST::ResultType      );
221    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ST::OppositeType    );
222    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ST::TransposeType   );
223    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OST::ResultType     );
224    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OST::OppositeType   );
225    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( OST::TransposeType  );
226    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RST::ResultType     );
227    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RST::OppositeType   );
228    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( RST::TransposeType  );
229    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORST::ResultType    );
230    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORST::OppositeType  );
231    BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION( ORST::TransposeType );
232 
233    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ST::ElementType,   ST::ResultType::ElementType      );
234    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ST::ElementType,   ST::OppositeType::ElementType    );
235    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ST::ElementType,   ST::TransposeType::ElementType   );
236    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OST::ElementType,  OST::ResultType::ElementType     );
237    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OST::ElementType,  OST::OppositeType::ElementType   );
238    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( OST::ElementType,  OST::TransposeType::ElementType  );
239    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RST::ElementType,  RST::ResultType::ElementType     );
240    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RST::ElementType,  RST::OppositeType::ElementType   );
241    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( RST::ElementType,  RST::TransposeType::ElementType  );
242    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORST::ElementType, ORST::ResultType::ElementType    );
243    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORST::ElementType, ORST::OppositeType::ElementType  );
244    BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE( ORST::ElementType, ORST::TransposeType::ElementType );
245    /*! \endcond */
246    //**********************************************************************************************
247 };
248 //*************************************************************************************************
249 
250 
251 
252 
253 //=================================================================================================
254 //
255 //  TEST FUNCTIONS
256 //
257 //=================================================================================================
258 
259 //*************************************************************************************************
260 /*!\brief Checking the number of rows of the given matrix.
261 //
262 // \param matrix The matrix to be checked.
263 // \param expectedRows The expected number of rows of the matrix.
264 // \return void
265 // \exception std::runtime_error Error detected.
266 //
267 // This function checks the number of rows of the given matrix. In case the actual number of
268 // rows does not correspond to the given expected number of rows, a \a std::runtime_error
269 // exception is thrown.
270 */
271 template< typename Type >  // Type of the matrix
checkRows(const Type & matrix,size_t expectedRows)272 void SparseScalarTest::checkRows( const Type& matrix, size_t expectedRows ) const
273 {
274    if( matrix.rows() != expectedRows ) {
275       std::ostringstream oss;
276       oss << " Test: " << test_ << "\n"
277           << " Error: Invalid number of rows detected\n"
278           << " Details:\n"
279           << "   Number of rows         : " << matrix.rows() << "\n"
280           << "   Expected number of rows: " << expectedRows << "\n";
281       throw std::runtime_error( oss.str() );
282    }
283 }
284 //*************************************************************************************************
285 
286 
287 //*************************************************************************************************
288 /*!\brief Checking the number of columns of the given matrix.
289 //
290 // \param matrix The matrix to be checked.
291 // \param expectedRows The expected number of columns of the matrix.
292 // \return void
293 // \exception std::runtime_error Error detected.
294 //
295 // This function checks the number of columns of the given matrix. In case the actual number of
296 // columns does not correspond to the given expected number of columns, a \a std::runtime_error
297 // exception is thrown.
298 */
299 template< typename Type >  // Type of the matrix
checkColumns(const Type & matrix,size_t expectedColumns)300 void SparseScalarTest::checkColumns( const Type& matrix, size_t expectedColumns ) const
301 {
302    if( matrix.columns() != expectedColumns ) {
303       std::ostringstream oss;
304       oss << " Test: " << test_ << "\n"
305           << " Error: Invalid number of columns detected\n"
306           << " Details:\n"
307           << "   Number of columns         : " << matrix.columns() << "\n"
308           << "   Expected number of columns: " << expectedColumns << "\n";
309       throw std::runtime_error( oss.str() );
310    }
311 }
312 //*************************************************************************************************
313 
314 
315 //*************************************************************************************************
316 /*!\brief Checking the capacity of the given matrix.
317 //
318 // \param matrix The matrix to be checked.
319 // \param minCapacity The expected minimum capacity of the matrix.
320 // \return void
321 // \exception std::runtime_error Error detected.
322 //
323 // This function checks the capacity of the given matrix. In case the actual capacity is smaller
324 // than the given expected minimum capacity, a \a std::runtime_error exception is thrown.
325 */
326 template< typename Type >  // Type of the matrix
checkCapacity(const Type & matrix,size_t minCapacity)327 void SparseScalarTest::checkCapacity( const Type& matrix, size_t minCapacity ) const
328 {
329    if( capacity( matrix ) < minCapacity ) {
330       std::ostringstream oss;
331       oss << " Test: " << test_ << "\n"
332           << " Error: Invalid capacity detected\n"
333           << " Details:\n"
334           << "   Capacity                 : " << capacity( matrix ) << "\n"
335           << "   Expected minimum capacity: " << minCapacity << "\n";
336       throw std::runtime_error( oss.str() );
337    }
338 }
339 //*************************************************************************************************
340 
341 
342 //*************************************************************************************************
343 /*!\brief Checking the capacity of a specific row/column of the given matrix.
344 //
345 // \param matrix The matrix to be checked.
346 // \param index The row/column to be checked.
347 // \param minCapacity The expected minimum capacity of the specified row/column.
348 // \return void
349 // \exception std::runtime_error Error detected.
350 //
351 // This function checks the capacity of a specific row/column of the given matrix. In case the
352 // actual capacity is smaller than the given expected minimum capacity, a \a std::runtime_error
353 // exception is thrown.
354 */
355 template< typename Type >  // Type of the matrix
checkCapacity(const Type & matrix,size_t index,size_t minCapacity)356 void SparseScalarTest::checkCapacity( const Type& matrix, size_t index, size_t minCapacity ) const
357 {
358    if( capacity( matrix, index ) < minCapacity ) {
359       std::ostringstream oss;
360       oss << " Test: " << test_ << "\n"
361           << " Error: Invalid capacity detected in "
362           << ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
363           << " Details:\n"
364           << "   Capacity                 : " << capacity( matrix, index ) << "\n"
365           << "   Expected minimum capacity: " << minCapacity << "\n";
366       throw std::runtime_error( oss.str() );
367    }
368 }
369 //*************************************************************************************************
370 
371 
372 //*************************************************************************************************
373 /*!\brief Checking the number of non-zero elements of the given matrix.
374 //
375 // \param matrix The matrix to be checked.
376 // \param expectedNonZeros The expected number of non-zero elements of the matrix.
377 // \return void
378 // \exception std::runtime_error Error detected.
379 //
380 // This function checks the number of non-zero elements of the given matrix. In case the
381 // actual number of non-zero elements does not correspond to the given expected number,
382 // a \a std::runtime_error exception is thrown.
383 */
384 template< typename Type >  // Type of the matrix
checkNonZeros(const Type & matrix,size_t expectedNonZeros)385 void SparseScalarTest::checkNonZeros( const Type& matrix, size_t expectedNonZeros ) const
386 {
387    if( nonZeros( matrix ) != expectedNonZeros ) {
388       std::ostringstream oss;
389       oss << " Test: " << test_ << "\n"
390           << " Error: Invalid number of non-zero elements\n"
391           << " Details:\n"
392           << "   Number of non-zeros         : " << nonZeros( matrix ) << "\n"
393           << "   Expected number of non-zeros: " << expectedNonZeros << "\n";
394       throw std::runtime_error( oss.str() );
395    }
396 
397    if( capacity( matrix ) < nonZeros( matrix ) ) {
398       std::ostringstream oss;
399       oss << " Test: " << test_ << "\n"
400           << " Error: Invalid capacity detected\n"
401           << " Details:\n"
402           << "   Number of non-zeros: " << nonZeros( matrix ) << "\n"
403           << "   Capacity           : " << capacity( matrix ) << "\n";
404       throw std::runtime_error( oss.str() );
405    }
406 }
407 //*************************************************************************************************
408 
409 
410 //*************************************************************************************************
411 /*!\brief Checking the number of non-zero elements in a specific row/column of the given matrix.
412 //
413 // \param matrix The matrix to be checked.
414 // \param index The row/column to be checked.
415 // \param expectedNonZeros The expected number of non-zero elements in the specified row/column.
416 // \return void
417 // \exception std::runtime_error Error detected.
418 //
419 // This function checks the number of non-zero elements in the specified row/column of the
420 // given matrix. In case the actual number of non-zero elements does not correspond to the
421 // given expected number, a \a std::runtime_error exception is thrown.
422 */
423 template< typename Type >  // Type of the matrix
checkNonZeros(const Type & matrix,size_t index,size_t expectedNonZeros)424 void SparseScalarTest::checkNonZeros( const Type& matrix, size_t index, size_t expectedNonZeros ) const
425 {
426    if( nonZeros( matrix, index ) != expectedNonZeros ) {
427       std::ostringstream oss;
428       oss << " Test: " << test_ << "\n"
429           << " Error: Invalid number of non-zero elements in "
430           << ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
431           << " Details:\n"
432           << "   Number of non-zeros         : " << nonZeros( matrix, index ) << "\n"
433           << "   Expected number of non-zeros: " << expectedNonZeros << "\n";
434       throw std::runtime_error( oss.str() );
435    }
436 
437    if( capacity( matrix, index ) < nonZeros( matrix, index ) ) {
438       std::ostringstream oss;
439       oss << " Test: " << test_ << "\n"
440           << " Error: Invalid capacity detected in "
441           << ( blaze::IsRowMajorMatrix<Type>::value ? "row " : "column " ) << index << "\n"
442           << " Details:\n"
443           << "   Number of non-zeros: " << nonZeros( matrix, index ) << "\n"
444           << "   Capacity           : " << capacity( matrix, index ) << "\n";
445       throw std::runtime_error( oss.str() );
446    }
447 }
448 //*************************************************************************************************
449 
450 
451 
452 
453 //=================================================================================================
454 //
455 //  GLOBAL TEST FUNCTIONS
456 //
457 //=================================================================================================
458 
459 //*************************************************************************************************
460 /*!\brief Testing the functionality of the sparse scalar SymmetricMatrix specialization.
461 //
462 // \return void
463 */
runTest()464 void runTest()
465 {
466    SparseScalarTest();
467 }
468 //*************************************************************************************************
469 
470 
471 
472 
473 //=================================================================================================
474 //
475 //  MACRO DEFINITIONS
476 //
477 //=================================================================================================
478 
479 //*************************************************************************************************
480 /*! \cond BLAZE_INTERNAL */
481 /*!\brief Macro for the execution of the SymmetricMatrix sparse scalar test.
482 */
483 #define RUN_SYMMETRICMATRIX_SPARSESCALAR_TEST \
484    blazetest::mathtest::adaptors::symmetricmatrix::runTest()
485 /*! \endcond */
486 //*************************************************************************************************
487 
488 } // namespace symmetricmatrix
489 
490 } // namespace adaptors
491 
492 } // namespace mathtest
493 
494 } // namespace blazetest
495 
496 #endif
497