nalgebra/base/
alias.rs

1#[cfg(any(feature = "alloc", feature = "std"))]
2use crate::base::dimension::Dyn;
3use crate::base::dimension::{U1, U2, U3, U4, U5, U6};
4use crate::base::storage::Owned;
5#[cfg(any(feature = "std", feature = "alloc"))]
6use crate::base::vec_storage::VecStorage;
7use crate::base::{ArrayStorage, Const, Matrix, Unit};
8use crate::storage::OwnedUninit;
9use std::mem::MaybeUninit;
10
11/*
12 *
13 *
14 * Column-major matrices.
15 *
16 *
17 */
18
19/// An owned matrix column-major matrix with `R` rows and `C` columns.
20///
21/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
22pub type OMatrix<T, R, C> = Matrix<T, R, C, Owned<T, R, C>>;
23
24/// An owned matrix with uninitialized data.
25pub type UninitMatrix<T, R, C> = Matrix<MaybeUninit<T>, R, C, OwnedUninit<T, R, C>>;
26
27/// An owned matrix column-major matrix with `R` rows and `C` columns.
28///
29/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
30#[deprecated(
31    note = "use SMatrix for a statically-sized matrix using integer dimensions, or OMatrix for an owned matrix using types as dimensions."
32)]
33pub type MatrixMN<T, R, C> = Matrix<T, R, C, Owned<T, R, C>>;
34
35/// An owned matrix column-major matrix with `D` columns.
36///
37/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
38#[deprecated(note = "use OMatrix<T, D, D> or SMatrix<T, D, D> instead.")]
39pub type MatrixN<T, D> = Matrix<T, D, D, Owned<T, D, D>>;
40
41/// A statically sized column-major matrix with `R` rows and `C` columns.
42///
43/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
44pub type SMatrix<T, const R: usize, const C: usize> =
45    Matrix<T, Const<R>, Const<C>, ArrayStorage<T, R, C>>;
46
47/// A dynamically sized column-major matrix.
48///
49/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
50#[cfg(any(feature = "std", feature = "alloc"))]
51pub type DMatrix<T> = Matrix<T, Dyn, Dyn, VecStorage<T, Dyn, Dyn>>;
52
53/// A heap-allocated, column-major, matrix with a dynamic number of rows and 1 columns.
54///
55/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
56#[cfg(any(feature = "std", feature = "alloc"))]
57pub type MatrixXx1<T> = Matrix<T, Dyn, U1, VecStorage<T, Dyn, U1>>;
58/// A heap-allocated, column-major, matrix with a dynamic number of rows and 2 columns.
59///
60/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
61#[cfg(any(feature = "std", feature = "alloc"))]
62pub type MatrixXx2<T> = Matrix<T, Dyn, U2, VecStorage<T, Dyn, U2>>;
63/// A heap-allocated, column-major, matrix with a dynamic number of rows and 3 columns.
64///
65/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
66#[cfg(any(feature = "std", feature = "alloc"))]
67pub type MatrixXx3<T> = Matrix<T, Dyn, U3, VecStorage<T, Dyn, U3>>;
68/// A heap-allocated, column-major, matrix with a dynamic number of rows and 4 columns.
69///
70/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
71#[cfg(any(feature = "std", feature = "alloc"))]
72pub type MatrixXx4<T> = Matrix<T, Dyn, U4, VecStorage<T, Dyn, U4>>;
73/// A heap-allocated, column-major, matrix with a dynamic number of rows and 5 columns.
74///
75/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
76#[cfg(any(feature = "std", feature = "alloc"))]
77pub type MatrixXx5<T> = Matrix<T, Dyn, U5, VecStorage<T, Dyn, U5>>;
78/// A heap-allocated, column-major, matrix with a dynamic number of rows and 6 columns.
79///
80/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
81#[cfg(any(feature = "std", feature = "alloc"))]
82pub type MatrixXx6<T> = Matrix<T, Dyn, U6, VecStorage<T, Dyn, U6>>;
83
84/// A heap-allocated, column-major, matrix with 1 rows and a dynamic number of columns.
85///
86/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
87#[cfg(any(feature = "std", feature = "alloc"))]
88pub type Matrix1xX<T> = Matrix<T, U1, Dyn, VecStorage<T, U1, Dyn>>;
89/// A heap-allocated, column-major, matrix with 2 rows and a dynamic number of columns.
90///
91/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
92#[cfg(any(feature = "std", feature = "alloc"))]
93pub type Matrix2xX<T> = Matrix<T, U2, Dyn, VecStorage<T, U2, Dyn>>;
94/// A heap-allocated, column-major, matrix with 3 rows and a dynamic number of columns.
95///
96/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
97#[cfg(any(feature = "std", feature = "alloc"))]
98pub type Matrix3xX<T> = Matrix<T, U3, Dyn, VecStorage<T, U3, Dyn>>;
99/// A heap-allocated, column-major, matrix with 4 rows and a dynamic number of columns.
100///
101/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
102#[cfg(any(feature = "std", feature = "alloc"))]
103pub type Matrix4xX<T> = Matrix<T, U4, Dyn, VecStorage<T, U4, Dyn>>;
104/// A heap-allocated, column-major, matrix with 5 rows and a dynamic number of columns.
105///
106/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
107#[cfg(any(feature = "std", feature = "alloc"))]
108pub type Matrix5xX<T> = Matrix<T, U5, Dyn, VecStorage<T, U5, Dyn>>;
109/// A heap-allocated, column-major, matrix with 6 rows and a dynamic number of columns.
110///
111/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
112#[cfg(any(feature = "std", feature = "alloc"))]
113pub type Matrix6xX<T> = Matrix<T, U6, Dyn, VecStorage<T, U6, Dyn>>;
114
115/// A stack-allocated, column-major, 1x1 square matrix.
116///
117/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
118pub type Matrix1<T> = Matrix<T, U1, U1, ArrayStorage<T, 1, 1>>;
119/// A stack-allocated, column-major, 2x2 square matrix.
120///
121/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
122pub type Matrix2<T> = Matrix<T, U2, U2, ArrayStorage<T, 2, 2>>;
123/// A stack-allocated, column-major, 3x3 square matrix.
124///
125/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
126pub type Matrix3<T> = Matrix<T, U3, U3, ArrayStorage<T, 3, 3>>;
127/// A stack-allocated, column-major, 4x4 square matrix.
128///
129/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
130pub type Matrix4<T> = Matrix<T, U4, U4, ArrayStorage<T, 4, 4>>;
131/// A stack-allocated, column-major, 5x5 square matrix.
132///
133/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
134pub type Matrix5<T> = Matrix<T, U5, U5, ArrayStorage<T, 5, 5>>;
135/// A stack-allocated, column-major, 6x6 square matrix.
136///
137/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
138pub type Matrix6<T> = Matrix<T, U6, U6, ArrayStorage<T, 6, 6>>;
139
140/// A stack-allocated, column-major, 1x2 matrix.
141///
142/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
143pub type Matrix1x2<T> = Matrix<T, U1, U2, ArrayStorage<T, 1, 2>>;
144/// A stack-allocated, column-major, 1x3 matrix.
145///
146/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
147pub type Matrix1x3<T> = Matrix<T, U1, U3, ArrayStorage<T, 1, 3>>;
148/// A stack-allocated, column-major, 1x4 matrix.
149///
150/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
151pub type Matrix1x4<T> = Matrix<T, U1, U4, ArrayStorage<T, 1, 4>>;
152/// A stack-allocated, column-major, 1x5 matrix.
153///
154/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
155pub type Matrix1x5<T> = Matrix<T, U1, U5, ArrayStorage<T, 1, 5>>;
156/// A stack-allocated, column-major, 1x6 matrix.
157///
158/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
159pub type Matrix1x6<T> = Matrix<T, U1, U6, ArrayStorage<T, 1, 6>>;
160
161/// A stack-allocated, column-major, 2x3 matrix.
162///
163/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
164pub type Matrix2x3<T> = Matrix<T, U2, U3, ArrayStorage<T, 2, 3>>;
165/// A stack-allocated, column-major, 2x4 matrix.
166///
167/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
168pub type Matrix2x4<T> = Matrix<T, U2, U4, ArrayStorage<T, 2, 4>>;
169/// A stack-allocated, column-major, 2x5 matrix.
170///
171/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
172pub type Matrix2x5<T> = Matrix<T, U2, U5, ArrayStorage<T, 2, 5>>;
173/// A stack-allocated, column-major, 2x6 matrix.
174///
175/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
176pub type Matrix2x6<T> = Matrix<T, U2, U6, ArrayStorage<T, 2, 6>>;
177
178/// A stack-allocated, column-major, 3x4 matrix.
179///
180/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
181pub type Matrix3x4<T> = Matrix<T, U3, U4, ArrayStorage<T, 3, 4>>;
182/// A stack-allocated, column-major, 3x5 matrix.
183///
184/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
185pub type Matrix3x5<T> = Matrix<T, U3, U5, ArrayStorage<T, 3, 5>>;
186/// A stack-allocated, column-major, 3x6 matrix.
187///
188/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
189pub type Matrix3x6<T> = Matrix<T, U3, U6, ArrayStorage<T, 3, 6>>;
190
191/// A stack-allocated, column-major, 4x5 matrix.
192///
193/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
194pub type Matrix4x5<T> = Matrix<T, U4, U5, ArrayStorage<T, 4, 5>>;
195/// A stack-allocated, column-major, 4x6 matrix.
196///
197/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
198pub type Matrix4x6<T> = Matrix<T, U4, U6, ArrayStorage<T, 4, 6>>;
199
200/// A stack-allocated, column-major, 5x6 matrix.
201///
202/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
203pub type Matrix5x6<T> = Matrix<T, U5, U6, ArrayStorage<T, 5, 6>>;
204
205/// A stack-allocated, column-major, 2x1 matrix.
206///
207/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
208pub type Matrix2x1<T> = Matrix<T, U2, U1, ArrayStorage<T, 2, 1>>;
209/// A stack-allocated, column-major, 3x1 matrix.
210///
211/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
212pub type Matrix3x1<T> = Matrix<T, U3, U1, ArrayStorage<T, 3, 1>>;
213/// A stack-allocated, column-major, 4x1 matrix.
214///
215/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
216pub type Matrix4x1<T> = Matrix<T, U4, U1, ArrayStorage<T, 4, 1>>;
217/// A stack-allocated, column-major, 5x1 matrix.
218///
219/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
220pub type Matrix5x1<T> = Matrix<T, U5, U1, ArrayStorage<T, 5, 1>>;
221/// A stack-allocated, column-major, 6x1 matrix.
222///
223/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
224pub type Matrix6x1<T> = Matrix<T, U6, U1, ArrayStorage<T, 6, 1>>;
225
226/// A stack-allocated, column-major, 3x2 matrix.
227///
228/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
229pub type Matrix3x2<T> = Matrix<T, U3, U2, ArrayStorage<T, 3, 2>>;
230/// A stack-allocated, column-major, 4x2 matrix.
231///
232/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
233pub type Matrix4x2<T> = Matrix<T, U4, U2, ArrayStorage<T, 4, 2>>;
234/// A stack-allocated, column-major, 5x2 matrix.
235///
236/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
237pub type Matrix5x2<T> = Matrix<T, U5, U2, ArrayStorage<T, 5, 2>>;
238/// A stack-allocated, column-major, 6x2 matrix.
239///
240/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
241pub type Matrix6x2<T> = Matrix<T, U6, U2, ArrayStorage<T, 6, 2>>;
242
243/// A stack-allocated, column-major, 4x3 matrix.
244///
245/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
246pub type Matrix4x3<T> = Matrix<T, U4, U3, ArrayStorage<T, 4, 3>>;
247/// A stack-allocated, column-major, 5x3 matrix.
248///
249/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
250pub type Matrix5x3<T> = Matrix<T, U5, U3, ArrayStorage<T, 5, 3>>;
251/// A stack-allocated, column-major, 6x3 matrix.
252///
253/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
254pub type Matrix6x3<T> = Matrix<T, U6, U3, ArrayStorage<T, 6, 3>>;
255
256/// A stack-allocated, column-major, 5x4 matrix.
257///
258/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
259pub type Matrix5x4<T> = Matrix<T, U5, U4, ArrayStorage<T, 5, 4>>;
260/// A stack-allocated, column-major, 6x4 matrix.
261///
262/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
263pub type Matrix6x4<T> = Matrix<T, U6, U4, ArrayStorage<T, 6, 4>>;
264
265/// A stack-allocated, column-major, 6x5 matrix.
266///
267/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
268pub type Matrix6x5<T> = Matrix<T, U6, U5, ArrayStorage<T, 6, 5>>;
269
270/*
271 *
272 *
273 * Column vectors.
274 *
275 *
276 */
277/// A dynamically sized column vector.
278#[cfg(any(feature = "std", feature = "alloc"))]
279pub type DVector<T> = Matrix<T, Dyn, U1, VecStorage<T, Dyn, U1>>;
280
281/// An owned D-dimensional column vector.
282pub type OVector<T, D> = Matrix<T, D, U1, Owned<T, D, U1>>;
283/// A statically sized D-dimensional column vector.
284pub type SVector<T, const D: usize> = Matrix<T, Const<D>, U1, ArrayStorage<T, D, 1>>; // Owned<T, Const<D>, U1>>;
285
286/// An owned matrix with uninitialized data.
287pub type UninitVector<T, D> = Matrix<MaybeUninit<T>, D, U1, OwnedUninit<T, D, U1>>;
288
289/// An owned matrix column-major matrix with `R` rows and `C` columns.
290///
291/// **Because this is an alias, not all its methods are listed here. See the [`Matrix`](crate::base::Matrix) type too.**
292#[deprecated(
293    note = "use SVector for a statically-sized matrix using integer dimensions, or OVector for an owned matrix using types as dimensions."
294)]
295pub type VectorN<T, D> = Matrix<T, D, U1, Owned<T, D, U1>>;
296
297/// A stack-allocated, 1-dimensional column vector.
298pub type Vector1<T> = Matrix<T, U1, U1, ArrayStorage<T, 1, 1>>;
299/// A stack-allocated, 2-dimensional column vector.
300pub type Vector2<T> = Matrix<T, U2, U1, ArrayStorage<T, 2, 1>>;
301/// A stack-allocated, 3-dimensional column vector.
302pub type Vector3<T> = Matrix<T, U3, U1, ArrayStorage<T, 3, 1>>;
303/// A stack-allocated, 4-dimensional column vector.
304pub type Vector4<T> = Matrix<T, U4, U1, ArrayStorage<T, 4, 1>>;
305/// A stack-allocated, 5-dimensional column vector.
306pub type Vector5<T> = Matrix<T, U5, U1, ArrayStorage<T, 5, 1>>;
307/// A stack-allocated, 6-dimensional column vector.
308pub type Vector6<T> = Matrix<T, U6, U1, ArrayStorage<T, 6, 1>>;
309
310/*
311 *
312 *
313 * Row vectors.
314 *
315 *
316 */
317/// A dynamically sized row vector.
318#[cfg(any(feature = "std", feature = "alloc"))]
319pub type RowDVector<T> = Matrix<T, U1, Dyn, VecStorage<T, U1, Dyn>>;
320
321/// An owned D-dimensional row vector.
322pub type RowOVector<T, D> = Matrix<T, U1, D, Owned<T, U1, D>>;
323
324/// A statically sized D-dimensional row vector.
325pub type RowSVector<T, const D: usize> = Matrix<T, U1, Const<D>, ArrayStorage<T, 1, D>>;
326
327/// A stack-allocated, 1-dimensional row vector.
328pub type RowVector1<T> = Matrix<T, U1, U1, ArrayStorage<T, 1, 1>>;
329/// A stack-allocated, 2-dimensional row vector.
330pub type RowVector2<T> = Matrix<T, U1, U2, ArrayStorage<T, 1, 2>>;
331/// A stack-allocated, 3-dimensional row vector.
332pub type RowVector3<T> = Matrix<T, U1, U3, ArrayStorage<T, 1, 3>>;
333/// A stack-allocated, 4-dimensional row vector.
334pub type RowVector4<T> = Matrix<T, U1, U4, ArrayStorage<T, 1, 4>>;
335/// A stack-allocated, 5-dimensional row vector.
336pub type RowVector5<T> = Matrix<T, U1, U5, ArrayStorage<T, 1, 5>>;
337/// A stack-allocated, 6-dimensional row vector.
338pub type RowVector6<T> = Matrix<T, U1, U6, ArrayStorage<T, 1, 6>>;
339
340/*
341 *
342 *
343 * Unit Vector.
344 *
345 *
346 */
347/// A stack-allocated, 1-dimensional unit vector.
348pub type UnitVector1<T> = Unit<Matrix<T, U1, U1, ArrayStorage<T, 1, 1>>>;
349/// A stack-allocated, 2-dimensional unit vector.
350pub type UnitVector2<T> = Unit<Matrix<T, U2, U1, ArrayStorage<T, 2, 1>>>;
351/// A stack-allocated, 3-dimensional unit vector.
352pub type UnitVector3<T> = Unit<Matrix<T, U3, U1, ArrayStorage<T, 3, 1>>>;
353/// A stack-allocated, 4-dimensional unit vector.
354pub type UnitVector4<T> = Unit<Matrix<T, U4, U1, ArrayStorage<T, 4, 1>>>;
355/// A stack-allocated, 5-dimensional unit vector.
356pub type UnitVector5<T> = Unit<Matrix<T, U5, U1, ArrayStorage<T, 5, 1>>>;
357/// A stack-allocated, 6-dimensional unit vector.
358pub type UnitVector6<T> = Unit<Matrix<T, U6, U1, ArrayStorage<T, 6, 1>>>;