GlobalMatrix.cpp 1.09 KB
Newer Older
1
2
3
4
5
6
7
8
//
//  GlobalMatrix.cpp
//  HappyHeart
//
//  Created by Sebastien Gilles on 27/04/15.
//  Copyright (c) 2015 Inria. All rights reserved.
//

9

10
#include "Core/LinearAlgebra/GlobalMatrix.hpp"
11
#include "Core/NumberingSubset.hpp"
12
13
14
15
16
17


namespace HappyHeart
{
    
    
18
19
20
21
22
23
24
    GlobalMatrix::GlobalMatrix(const NumberingSubset& row_numbering_subset,
                               const NumberingSubset& col_numbering_subset)
    : row_numbering_subset_(row_numbering_subset),
    col_numbering_subset_(col_numbering_subset)
    { }
    
    
25
    GlobalMatrix::GlobalMatrix(const GlobalMatrix& rhs)
26
27
28
    : Parent(rhs),
    row_numbering_subset_(rhs.row_numbering_subset_),
    col_numbering_subset_(rhs.col_numbering_subset_)
29
30
31
32
33
34
    { }
    
    
    
    void Swap(GlobalMatrix& A, GlobalMatrix& B)
    {
35
36
        assert(A.GetColNumberingSubset() == B.GetColNumberingSubset());
        assert(A.GetRowNumberingSubset() == B.GetRowNumberingSubset());
37
38
39
40
41
42
        
        using Parent = GlobalMatrix::Parent;
        
        Swap(static_cast<Parent&>(A), static_cast<Parent&>(B));
        
    }
43
44
    
    
45
46

} // namespace HappyHeart