So-Bogus
A c++ sparse block matrix library aimed at Second Order cone problems
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Traits.hpp
1 /*
2  * This file is part of bogus, a C++ sparse block matrix library.
3  *
4  * Copyright 2013 Gilles Daviet <gdaviet@gmail.com>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
10 
11 #ifndef BOGUS_BLOCK_TRAITS_HPP
12 #define BOGUS_BLOCK_TRAITS_HPP
13 
14 #include <vector>
15 
16 namespace bogus {
17 
18 template< typename Derived >
19 struct BlockMatrixTraits { } ;
20 
22 template< typename ElementType >
24  typedef std::vector< ElementType > Type ;
25  enum { is_mutable = 1 } ;
26 } ;
27 
28 template< typename BlockType >
30 {
31  typedef typename BlockType::Scalar Scalar ;
33  typedef BlockType TransposeStorageType ;
34 
35  enum {
37  RowsAtCompileTime = BlockType::RowsAtCompileTime,
39  ColsAtCompileTime = BlockType::ColsAtCompileTime,
40 
44  is_row_major = false,
47  } ;
48 } ;
49 
50 // Transpose, blobk-matrix/vector and block/block product return types
51 // Specialization of these structures should define a ReturnType if the operation is allowed
52 
54 template< typename BlockType >
56 
58 
59 template< typename VectorType >
61 
63 template< typename LhsBlockType, typename RhsBlockType, bool TransposeLhs, bool TransposeRhs >
65  typedef LhsBlockType ReturnType ;
66 } ;
67 
68 } // namespace bogus
69 
70 #endif
Definition: Traits.hpp:19
Number of rows spanned by a block at compile time ; useful for efficient segmentation.
Definition: Traits.hpp:37
Defines the return type of the product of two blocks potentially transposed.
Definition: Traits.hpp:64
Whether this block is equal to its transpose.
Definition: Traits.hpp:46
Definition: Traits.hpp:29
Defines the type of the vectors resulting from the multiplication of a BlockMatrix and an instance of...
Definition: Traits.hpp:60
Ordering inside the block ; only useful uses_plain_array_storage is true.
Definition: Traits.hpp:44
Can be set to true if &quot;const Scalar* data_pointer( const BlockType&amp; )&quot; exist.
Definition: Traits.hpp:42
Number of cols spanned by a block at compile time ; useful for efficient segmentation.
Definition: Traits.hpp:39
Default container type, that should resizable and use contiguous storage.
Definition: Traits.hpp:23
Defines the return type of an associated transpose_block( const BlockType&amp; ) function.
Definition: Traits.hpp:55
BlockType TransposeStorageType
Type for storing the result of transpose_block( BlockType ), useful for cacheTranspose() ...
Definition: Traits.hpp:33