BELFEM
0.9.0
Berkeley Lab Finite Element Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
fn_sort.hpp
Go to the documentation of this file.
1
/*
2
* BELFEM -- The Berkeley Lab Finite Element Framework
3
* Copyright (c) 2026, The Regents of the University of California,
4
* through Lawrence Berkeley National Laboratory (subject to receipt of any required
5
* approvals from the U.S. Dept. of Energy). All rights reserved.
6
*
7
* Developers: Christian Messe, Gregory Giard
8
*
9
* See the top-level LICENSE file for the complete license and disclaimer.
10
*/
11
18
19
#ifndef BELFEM_FN_SORT_HPP
20
#define BELFEM_FN_SORT_HPP
21
22
#include "
cl_Vector.hpp
"
23
24
#ifdef BELFEM_BLAZE
25
#include <memory>
26
#include <vector>
27
#include <algorithm>
28
#endif
29
30
namespace
belfem
31
{
32
//------------------------------------------------------------------------------
33
39
template
<
typename
T >
40
void
41
sort
(
Vector< T >
& aVector )
42
{
43
#ifdef BELFEM_ARMADILLO
44
// call armadillo interface
45
aVector.
vector_data
() =
sort
( aVector.
vector_data
() );
46
#elif BELFEM_BLAZE
47
// sort data
48
std::sort( aVector.
data
(), aVector.
data
() + aVector.
length
() );
49
#endif
50
}
51
52
//------------------------------------------------------------------------------
53
}
54
55
#endif
//BELFEM_FN_SORT_HPP
cl_Vector.hpp
belfem::Vector
Column vector.
Definition
cl_BZ_Vector.hpp:41
belfem::Vector::data
T * data()
expose the underlying raw pointer ( writable version )
Definition
cl_AR_Vector.hpp:182
belfem::Vector::length
size_t length() const
get the length of the vector
Definition
cl_AR_Vector.hpp:257
belfem::Vector::vector_data
VectorType & vector_data()
expose the underlying matrix implementation ( writable version )
Definition
cl_AR_Vector.hpp:204
belfem
USER GUIDES:
Definition
cl_Capacitor.cpp:16
belfem::sort
void sort(Cell< T > &aCell)
Definition
cl_Cell.hpp:455
src
linalg
fn_sort.hpp
Generated by
1.18.0