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

#include "Core/LinearAlgebra/GlobalVector.hpp"
GILLES Sebastien's avatar
GILLES Sebastien committed
10
#include "Core/NumberingSubset.hpp"
11
12
13
14
15
16


namespace HappyHeart
{
    
    
GILLES Sebastien's avatar
GILLES Sebastien committed
17
18
19
20
21
22
    GlobalVector::GlobalVector(const NumberingSubset& numbering_subset)
    : numbering_subset_(numbering_subset)
    { }
    
    
    
23
    GlobalVector::GlobalVector(const GlobalVector& rhs)
GILLES Sebastien's avatar
GILLES Sebastien committed
24
25
    : Parent(rhs),
    numbering_subset_(rhs.numbering_subset_)
26
27
28
29
30
31
    { }
    
    
    
    void Swap(GlobalVector& A, GlobalVector& B)
    {
GILLES Sebastien's avatar
GILLES Sebastien committed
32
        assert(A.GetNumberingSubset() == B.GetNumberingSubset());
33
34
35
36
37
38
        
        using Parent = GlobalVector::Parent;

        Swap(static_cast<Parent&>(A), static_cast<Parent&>(B));
        
    }
39
40
41
42
43
44
45
46
47
48
49
50
51
52
    
    
    
    bool NumberingSubsetEqual(const GlobalVector& lhs, const GlobalVector& rhs)
    {
        return lhs.GetNumberingSubset() == rhs.GetNumberingSubset();
    }
    
    
    bool NumberingSubsetLess(const GlobalVector& lhs, const GlobalVector& rhs)
    {
        return lhs.GetNumberingSubset()< rhs.GetNumberingSubset();
    }

53
54
55
  

} // namespace HappyHeart