source: mmcs/armadillo_bits/fn_join.hpp @ 8daa049

matrices
Last change on this file since 8daa049 was 9dd61b1, checked in by rboet <rboet@…>, 9 years ago

Avance del proyecto 60%

  • Property mode set to 100644
File size: 2.9 KB
Line 
1// Copyright (C) 2010-2015 Conrad Sanderson
2// Copyright (C) 2010-2015 NICTA (www.nicta.com.au)
3//
4// This Source Code Form is subject to the terms of the Mozilla Public
5// License, v. 2.0. If a copy of the MPL was not distributed with this
6// file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
8
9//! \addtogroup fn_join
10//! @{
11
12
13
14template<typename T1, typename T2>
15inline
16const Glue<T1, T2, glue_join>
17join_cols(const Base<typename T1::elem_type,T1>& A, const Base<typename T1::elem_type,T2>& B)
18  {
19  arma_extra_debug_sigprint();
20 
21  return Glue<T1, T2, glue_join>(A.get_ref(), B.get_ref(), 0);
22  }
23
24
25
26template<typename T1, typename T2>
27inline
28const Glue<T1, T2, glue_join>
29join_vert(const Base<typename T1::elem_type,T1>& A, const Base<typename T1::elem_type,T2>& B)
30  {
31  arma_extra_debug_sigprint();
32 
33  return Glue<T1, T2, glue_join>(A.get_ref(), B.get_ref(), 0);
34  }
35
36
37
38template<typename T1, typename T2>
39inline
40const Glue<T1, T2, glue_join>
41join_rows(const Base<typename T1::elem_type,T1>& A, const Base<typename T1::elem_type,T2>& B)
42  {
43  arma_extra_debug_sigprint();
44 
45  return Glue<T1, T2, glue_join>(A.get_ref(), B.get_ref(), 1);
46  }
47
48
49
50template<typename T1, typename T2>
51inline
52const Glue<T1, T2, glue_join>
53join_horiz(const Base<typename T1::elem_type,T1>& A, const Base<typename T1::elem_type,T2>& B)
54  {
55  arma_extra_debug_sigprint();
56 
57  return Glue<T1, T2, glue_join>(A.get_ref(), B.get_ref(), 1);
58  }
59
60
61
62template<typename T1, typename T2>
63inline
64const GlueCube<T1, T2, glue_join>
65join_slices(const BaseCube<typename T1::elem_type,T1>& A, const BaseCube<typename T1::elem_type,T2>& B)
66  {
67  arma_extra_debug_sigprint();
68 
69  return GlueCube<T1, T2, glue_join>(A.get_ref(), B.get_ref());
70  }
71
72
73
74//
75// for sparse matrices
76
77template<typename T1, typename T2>
78inline
79const SpGlue<T1, T2, spglue_join_cols>
80join_cols(const SpBase<typename T1::elem_type,T1>& A, const SpBase<typename T1::elem_type,T2>& B)
81  {
82  arma_extra_debug_sigprint();
83 
84  return SpGlue<T1, T2, spglue_join_cols>(A.get_ref(), B.get_ref());
85  }
86
87
88
89template<typename T1, typename T2>
90inline
91const SpGlue<T1, T2, spglue_join_cols>
92join_vert(const SpBase<typename T1::elem_type,T1>& A, const SpBase<typename T1::elem_type,T2>& B)
93  {
94  arma_extra_debug_sigprint();
95 
96  return SpGlue<T1, T2, spglue_join_cols>(A.get_ref(), B.get_ref());
97  }
98
99
100
101template<typename T1, typename T2>
102inline
103const SpGlue<T1, T2, spglue_join_rows>
104join_rows(const SpBase<typename T1::elem_type,T1>& A, const SpBase<typename T1::elem_type,T2>& B)
105  {
106  arma_extra_debug_sigprint();
107 
108  return SpGlue<T1, T2, spglue_join_rows>(A.get_ref(), B.get_ref());
109  }
110
111
112
113template<typename T1, typename T2>
114inline
115const SpGlue<T1, T2, spglue_join_rows>
116join_horiz(const SpBase<typename T1::elem_type,T1>& A, const SpBase<typename T1::elem_type,T2>& B)
117  {
118  arma_extra_debug_sigprint();
119 
120  return SpGlue<T1, T2, spglue_join_rows>(A.get_ref(), B.get_ref());
121  }
122
123
124
125//! @}
Note: See TracBrowser for help on using the repository browser.