UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DenseMatrix.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
5#include "Chaos/Core.h"
6#include "Chaos/Vector.h"
7#include "Chaos/Matrix.h"
8#include "Chaos/Utilities.h"
9
10namespace Chaos
11{
17 {
18 public:
19 FReal M() const
20 {
21 return Mass;
22 }
23
24 const FReal I(int32 RowIndex, int32 ColIndex) const
25 {
26 checkSlow(RowIndex < 3);
28 return Inertia.M[RowIndex][ColIndex];
29 }
30
31 static FMassMatrix Make(const FReal InM, const FMatrix33& InI)
32 {
33 return FMassMatrix(InM, InI);
34 }
35
37 {
38 return FMassMatrix(InM, MoveTemp(InI));
39 }
40
41 static FMassMatrix Make(const FReal InM, const FRotation3& Q, const FMatrix33& InI)
42 {
43 return FMassMatrix(InM, Q, InI);
44 }
45
46 private:
47 FMassMatrix(const FReal InM, const FMatrix33& InI)
48 : Mass(InM)
49 , Inertia(InI)
50 {
51 }
52
53 FMassMatrix(const FReal InM, FMatrix33&& InI)
54 : Mass(InM)
55 , Inertia(MoveTemp(InI))
56 {
57 }
58
59 FMassMatrix(const FReal InM, const FRotation3& Q, const FMatrix33& InI)
60 : Mass(InM)
61 , Inertia(Utilities::ComputeWorldSpaceInertia(Q, InI))
62 {
63 }
64
65 FReal Mass;
66 FMatrix33 Inertia;
67 };
68
77 template<int32 T_MAXELEMENTS>
79 {
80 public:
82
84 : NRows(0)
85 , NCols(0)
86 {
87 }
88
90 : NRows(InNRows)
91 , NCols(InNCols)
92 {
93 }
94
96 {
97 *this = A;
98 }
99
101 {
102 SetDimensions(A.NumRows(), A.NumColumns());
103 for (int32 Index = 0; Index < NumElements(); ++Index)
104 {
105 M[Index] = A.M[Index];
106 }
107 return *this;
108 }
109
114 {
115 return NRows;
116 }
117
122 {
123 return NCols;
124 }
125
130 {
131 return NRows * NCols;
132 }
133
139 {
141 NRows = InNumRows;
142 NCols = InNumColumns;
143 }
144
151 {
153 const int32 NewRowIndex = NRows;
154 NRows = NRows + InNumRows;
155 return NewRowIndex;
156 }
157
161 FORCEINLINE FReal& At(const int32 RowIndex, const int32 ColumnIndex)
162 {
163 checkSlow(RowIndex < NumRows());
165 return M[ElementIndex(RowIndex, ColumnIndex)];
166 }
167
171 FORCEINLINE const FReal& At(const int32 RowIndex, const int32 ColumnIndex) const
172 {
173 checkSlow(RowIndex < NumRows());
175 return M[ElementIndex(RowIndex, ColumnIndex)];
176 }
177
181 void Init(const int32 InNRows, const int32 InNCols, FReal V)
182 {
184 Set(V);
185 }
186
190 FORCEINLINE void SetAt(const int32 RowIndex, const int32 ColumnIndex, const FReal V)
191 {
192 At(RowIndex, ColumnIndex) = V;
193 }
194
198 void Set(FReal V)
199 {
200 for (int32 II = 0; II < NumElements(); ++II)
201 {
202 M[II] = V;
203 }
204 }
205
211 {
212 check(NumRows() == NumColumns());
213 for (int32 II = 0; II < NRows; ++II)
214 {
215 At(II, II) = V;
216 }
217 }
218
223 {
224 check(Start + Num <= NumRows());
225 check(Start + Num <= NumColumns());
226 for (int32 II = 0; II < Num; ++II)
227 {
228 int32 JJ = Start + II;
229 At(JJ, JJ) = V;
230 }
231 }
232
236 void SetRowAt(const int32 RowIndex, const int32 ColumnIndex, const FReal* V, const int32 NumV)
237 {
238 check(RowIndex + NumV < NumRows());
240 FReal* Row = &At(RowIndex, ColumnIndex);
241 for (int32 II = 0; II < NumV; ++II)
242 {
243 *Row++ = *V++;
244 }
245 }
246
247 void SetRowAt(const int32 RowIndex, const int32 ColumnIndex, const FVec3& V)
248 {
249 SetRowAt(RowIndex, ColumnIndex, V[0], V[1], V[2]);
250 }
251
252 void SetRowAt(const int32 RowIndex, const int32 ColumnIndex, const FReal V0, const FReal V1, const FReal V2)
253 {
254 check(RowIndex + 1 <= NumRows());
255 check(ColumnIndex + 3 <= NumColumns());
256 FReal* Row = &At(RowIndex, ColumnIndex);
257 *Row++ = V0;
258 *Row++ = V1;
259 *Row++ = V2;
260 }
261
265 void SetColumnAt(const int32 RowIndex, const int32 ColumnIndex, const FReal* V, const int32 NumV)
266 {
267 check(RowIndex + NumV <= NumRows());
268 check(ColumnIndex + 1 <= NumColumns());
269 for (int32 II = 0; II < NumV; ++II)
270 {
271 At(RowIndex + II, ColumnIndex) = V[II];
272 }
273 }
274
275 void SetColumnAt(const int32 RowIndex, const int32 ColumnIndex, const FVec3& V)
276 {
277 check(RowIndex + 3 <= NumRows());
278 check(ColumnIndex + 1 <= NumColumns());
279 At(RowIndex + 0, ColumnIndex) = V[0];
280 At(RowIndex + 1, ColumnIndex) = V[1];
281 At(RowIndex + 2, ColumnIndex) = V[2];
282 }
283
287 template<int32 T_EA>
289 {
290 check(RowOffset + V.NumRows() <= NumRows());
292 for (int32 II = 0; II < V.NumRows(); ++II)
293 {
294 for (int32 JJ = 0; JJ < V.NumColumns(); ++JJ)
295 {
296 At(II + RowOffset, JJ + ColumnOffset) = V.At(II, JJ);
297 }
298 }
299 }
300
305 {
306 check(RowOffset + 3 <= NumRows());
307 check(ColumnOffset + 3 <= NumColumns());
308 for (int32 II = 0; II < 3; ++II)
309 {
310 for (int32 JJ = 0; JJ < 3; ++JJ)
311 {
312 At(II + RowOffset, JJ + ColumnOffset) = V.M[JJ][II];
313 }
314 }
315 }
316
321 {
322 check(RowOffset + 3 <= NumRows());
323 check(ColumnOffset + 3 <= NumColumns());
324 FReal* Row0 = &At(RowOffset + 0, ColumnOffset);
325 *Row0++ = VDiag;
326 *Row0++ = VOffDiag;
327 *Row0++ = VOffDiag;
328 FReal* Row1 = &At(RowOffset + 1, ColumnOffset);
329 *Row1++ = VOffDiag;
330 *Row1++ = VDiag;
331 *Row1++ = VOffDiag;
332 FReal* Row2 = &At(RowOffset + 2, ColumnOffset);
333 *Row2++ = VOffDiag;
334 *Row2++ = VOffDiag;
335 *Row2++ = VDiag;
336 }
337
338 //
339 // Factory methods
340 //
341
349
357
363 {
365 }
366
371 {
373 M.At(0, 0) = InM[0];
374 M.At(1, 0) = InM[1];
375 M.At(2, 0) = InM[2];
376 return M;
377 }
378
383 {
384 // NOTE: UE matrices are Column-major (columns are sequential in memory), but DenseMatrix is Row-major (rows are sequential in memory)
386 M.At(0, 0) = InM.M[0][0];
387 M.At(0, 1) = InM.M[1][0];
388 M.At(0, 2) = InM.M[2][0];
389 M.At(1, 0) = InM.M[0][1];
390 M.At(1, 1) = InM.M[1][1];
391 M.At(1, 2) = InM.M[2][1];
392 M.At(2, 0) = InM.M[0][2];
393 M.At(2, 1) = InM.M[1][2];
394 M.At(2, 2) = InM.M[2][2];
395 return M;
396 }
397
402 {
404 for (int32 I = 0; I < InNumRows; ++I)
405 {
406 for (int32 J = 0; J < InNumCols; ++J)
407 {
408 M.At(I, J) = (I == J) ? D : 0;
409 }
410 }
411 return M;
412 }
413
418 {
419 return MakeDiagonal(InDim, InDim, (FReal)1);
420 }
421
422 //
423 // Math operations
424 //
425
429 template<int32 T_EA>
431 {
432 TDenseMatrix<T_MAXELEMENTS> Result(A.NumColumns(), A.NumRows());
433 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
434 {
435 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
436 {
437 Result.At(IRow, ICol) = A.At(ICol, IRow);
438 }
439 }
440 return Result;
441 }
442
446 template<int32 T_EA>
448 {
449 // @todo(ccaulfield): optimize
450 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), A.NumColumns());
451 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
452 {
453 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
454 {
455 Result.At(IRow, ICol) = -A.At(IRow, ICol);
456 }
457 }
458 return Result;
459 }
460
464 template<int32 T_EA, int32 T_EB>
466 {
467 // @todo(ccaulfield): optimize
468 check(A.NumColumns() == B.NumColumns());
469 check(A.NumRows() == B.NumRows());
470 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), A.NumColumns());
471 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
472 {
473 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
474 {
475 Result.At(IRow, ICol) = A.At(IRow, ICol) + B.At(IRow, ICol);
476 }
477 }
478 return Result;
479 }
480
484 template<int32 T_EA, int32 T_EB>
486 {
487 // @todo(ccaulfield): optimize
488 check(A.NumColumns() == B.NumColumns());
489 check(A.NumRows() == B.NumRows());
490 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), A.NumColumns());
491 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
492 {
493 for (int32 ICol = IRow; ICol < Result.NumColumns(); ++ICol)
494 {
495 FReal V = A.At(IRow, ICol) + B.At(IRow, ICol);
496 Result.At(IRow, ICol) = V;
497 Result.At(ICol, IRow) = V;
498 }
499 }
500 return Result;
501 }
502
506 template<int32 T_EA, int32 T_EB>
508 {
509 // @todo(ccaulfield): optimize
510 check(A.NumColumns() == B.NumColumns());
511 check(A.NumRows() == B.NumRows());
512 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), A.NumColumns());
513 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
514 {
515 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
516 {
517 Result.At(IRow, ICol) = A.At(IRow, ICol) - B.At(IRow, ICol);
518 }
519 }
520 return Result;
521 }
522
527 template<int32 T_EA, int32 T_EB>
529 {
530 // @todo(ccaulfield): optimize
531 check(A.NumColumns() == B.NumRows());
532 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), B.NumColumns());
533 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
534 {
535 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
536 {
537 FReal V = 0;
538 for (int32 II = 0; II < A.NumColumns(); ++II)
539 {
540 V += A.At(IRow, II) * B.At(II, ICol);
541 }
542 Result.At(IRow, ICol) = V;
543 }
544 }
545 return Result;
546 }
547
552 template<int32 T_EA, int32 T_EB>
554 {
555 // @todo(ccaulfield): optimize
556 check(A.NumRows() == B.NumRows());
557 TDenseMatrix<T_MAXELEMENTS> Result(A.NumColumns(), B.NumColumns());
558 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
559 {
560 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
561 {
562 FReal V = 0;
563 for (int32 II = 0; II < A.NumRows(); ++II)
564 {
565 V += A.At(II, IRow) * B.At(II, ICol);
566 }
567 Result.At(IRow, ICol) = V;
568 }
569 }
570 return Result;
571 }
572
577 template<int32 T_EA, int32 T_EB>
579 {
580 // @todo(ccaulfield): optimize
581 check(A.NumColumns() == B.NumColumns());
582 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), B.NumRows());
583 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
584 {
585 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
586 {
587 FReal V = 0;
588 for (int32 II = 0; II < A.NumColumns(); ++II)
589 {
590 V += A.At(IRow, II) * B.At(ICol, II);
591 }
592 Result.At(IRow, ICol) = V;
593 }
594 }
595 return Result;
596 }
597
602 template<int32 T_EA, int32 T_EB>
604 {
605 // @todo(ccaulfield): optimize
606 check(A.NumRows() == B.NumColumns());
607 TDenseMatrix<T_MAXELEMENTS> Result(A.NumColumns(), B.NumRows());
608 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
609 {
610 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
611 {
612 FReal V = 0;
613 for (int32 II = 0; II < A.NumRows(); ++II)
614 {
615 V += A.At(II, IRow) * B.At(ICol, II);
616 }
617 Result.At(IRow, ICol) = V;
618 }
619 }
620 return Result;
621 }
622
627 template<int32 T_EA, int32 T_EB>
629 {
630 // @todo(ccaulfield): optimize
631 check(A.NumColumns() == B.NumRows());
632 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), B.NumColumns());
633 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
634 {
635 for (int32 ICol = IRow; ICol < Result.NumColumns(); ++ICol)
636 {
637 FReal V = 0;
638 for (int32 II = 0; II < A.NumColumns(); ++II)
639 {
640 V += A.At(IRow, II) * B.At(II, ICol);
641 }
642 Result.At(IRow, ICol) = V;
643 Result.At(ICol, IRow) = V;
644 }
645 }
646 return Result;
647 }
648
653 template<int32 T_EA, int32 T_EB, int32 T_EC>
655 {
656 // @todo(ccaulfield): optimize
657 check(B.NumColumns() == C.NumRows());
658 check(A.NumRows() == B.NumRows());
659 check(A.NumRows() == C.NumColumns());
660 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), A.NumColumns());
661 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
662 {
663 for (int32 ICol = IRow; ICol < Result.NumColumns(); ++ICol)
664 {
665 FReal V = 0;
666 for (int32 II = 0; II < B.NumColumns(); ++II)
667 {
668 V += B.At(IRow, II) * C.At(II, ICol);
669 }
670 FReal VA = A.At(IRow, ICol);
671 Result.At(IRow, ICol) = VA + V;
672 Result.At(ICol, IRow) = VA + V;
673 }
674 }
675 return Result;
676 }
677
683 template<int32 T_EA>
685 {
686 check(A.NumColumns() == 6);
687
689
690 // Calculate columns 0-2
691 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
692 {
693 for (int32 ICol = 0; ICol < 3; ++ICol)
694 {
695 Result.At(IRow, ICol) = A.At(IRow, ICol) * B.M();
696 }
697 }
698
699 // Calculate columns 3-5
700 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
701 {
702 for (int32 ICol = 3; ICol < 6; ++ICol)
703 {
704 FReal V = 0;
705 for (int32 KK = 3; KK < 6; ++KK)
706 {
707 V += A.At(IRow, KK) * B.I(KK - 3, ICol - 3);
708 }
709 Result.At(IRow, ICol) = V;
710 }
711 }
712
713 return Result;
714 }
715
716
722 template<int32 T_EB>
724 {
725 check(B.NumRows() == 6);
726
728
729 // Calculate rows 0-2
730 for (int32 IRow = 0; IRow < 3; ++IRow)
731 {
732 for (int32 ICol = 0; ICol < B.NumColumns(); ++ICol)
733 {
734 Result.At(IRow, ICol) = A.M() * B.At(IRow, ICol);
735 }
736 }
737
738 // Calculate rows 3-5
739 for (int32 IRow = 3; IRow < 6; ++IRow)
740 {
741 for (int32 ICol = 0; ICol < B.NumColumns(); ++ICol)
742 {
743 FReal V = 0;
744 for (int32 KK = 3; KK < 6; ++KK)
745 {
746 V += A.I(IRow - 3, KK - 3) * B.At(KK, ICol);
747 }
748 Result.At(IRow, ICol) = V;
749 }
750 }
751
752 return Result;
753 }
754
760 template<int32 T_EB>
762 {
763 check(B.NumColumns() == 6);
764
766
767 // Calculate rows 0-2
768 for (int32 IRow = 0; IRow < 3; ++IRow)
769 {
770 for (int32 ICol = 0; ICol < B.NumRows(); ++ICol)
771 {
772 Result.At(IRow, ICol) = A.M() * B.At(ICol, IRow);
773 }
774 }
775
776 // Calculate rows 3-5
777 for (int32 IRow = 3; IRow < 6; ++IRow)
778 {
779 for (int32 ICol = 0; ICol < B.NumRows(); ++ICol)
780 {
781 FReal V = 0;
782 for (int32 KK = 3; KK < 6; ++KK)
783 {
784 V += A.I(IRow - 3, KK - 3) * B.At(ICol, KK);
785 }
786 Result.At(IRow, ICol) = V;
787 }
788 }
789
790 return Result;
791 }
792
793
797 template<int32 T_EA>
799 {
800 // @todo(ccaulfield): optimize
801 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), A.NumColumns());
802 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
803 {
804 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
805 {
806 Result.At(IRow, ICol) = A.At(IRow, ICol) * V;
807 }
808 }
809 return Result;
810 }
811
815 template<int32 T_EA>
817 {
818 return Multiply(A, V);
819 }
820
824 template<int32 T_EA>
826 {
827 // @todo(ccaulfield): optimize
828 TDenseMatrix<T_MAXELEMENTS> Result(A.NumRows(), A.NumColumns());
829 for (int32 IRow = 0; IRow < Result.NumRows(); ++IRow)
830 {
831 for (int32 ICol = 0; ICol < Result.NumColumns(); ++ICol)
832 {
833 Result.At(IRow, ICol) = A.At(IRow, ICol) / V;
834 }
835 }
836 return Result;
837 }
838
842 template<int32 T_EA, int32 T_EB>
847
848 private:
849 TDenseMatrix(const int32 InNRows, const int32 InNCols, const FReal V)
850 : NRows(InNRows)
851 , NCols(InNCols)
852 {
853 for (int32 I = 0; I < NumElements(); ++I)
854 {
855 M[I] = V;
856 }
857 }
858
859 TDenseMatrix(const int32 InNRows, const int32 InNCols, const FReal* V, const int32 N)
860 : NRows(InNRows)
861 , NCols(InNCols)
862 {
863 int32 NLimited = FMath::Min<int32>(NumElements(), N);
864 for (int32 I = 0; I < NLimited; ++I)
865 {
866 M[I] = V[I];
867 }
868 }
869
870 FORCEINLINE int32 ElementIndex(const int32 RowIndex, const int32 ColumnIndex) const
871 {
872 return RowIndex * NCols + ColumnIndex;
873 }
874
876 int32 NRows;
877 int32 NCols;
878 };
879
886 {
887 public:
888
895 template<int32 T_E>
897 {
898 check(A.NumRows() == A.NumColumns());
899 const int32 N = A.NumRows();
900 for (int32 I = 0; I < N; ++I)
901 {
902 for (int32 J = I; J < N; ++J)
903 {
904 FReal Sum = A.At(I, J);
905 for (int32 K = I - 1; K >= 0; --K)
906 {
907 Sum -= A.At(I, K) * A.At(J, K);
908 }
909 if (I == J)
910 {
911 if (Sum <= 0)
912 {
913 // Not positive definite (rounding?)
914 return false;
915 }
916 A.At(I, J) = FMath::Sqrt(Sum);
917 }
918 else
919 {
920 A.At(J, I) = Sum / A.At(I, I);
921 }
922 }
923 }
924
925 for (int32 I = 0; I < N; ++I)
926 {
927 for (int32 J = 0; J < I; ++J)
928 {
929 A.At(J, I) = 0;
930 }
931 }
932
933 return true;
934 }
935
945 template<int32 T_EA, int32 T_EB, int32 T_EX>
947 {
948 check(B.NumColumns() == 1);
949 check(G.NumRows() == B.NumRows());
950
951 const int32 N = G.NumRows();
952 X.SetDimensions(N, 1);
953
954 // By definition:
955 // A.X = G.Gt.X = B
956 // Rearrange and define Y:
957 // Gt.X = G^-1.B = Y
958 // Which gives:
959 // GY = B
960 // GtX = Y
961
962 // Solve GY = B (G is lower-triangular) for Y
963 for (int32 I = 0; I < N; ++I)
964 {
965 FReal Sum = B.At(I, 0);
966 for (int32 K = I - 1; K >= 0; --K)
967 {
968 Sum -= G.At(I, K) * X.At(K, 0);
969 }
970 X.At(I, 0) = Sum / G.At(I, I);
971 }
972
973 // Solve GtX = Y (Gt is upper-triangular) for X
974 for (int32 I = N - 1; I >= 0; --I)
975 {
976 FReal Sum = X.At(I, 0);
977 for (int32 K = I + 1; K < N; ++K)
978 {
979 Sum -= G.At(K, I) * X.At(K, 0);
980 }
981 X.At(I, 0) = Sum / G.At(I, I);
982 }
983 }
984
997 template<int32 T_EA, int32 T_EB, int32 T_EX>
999 {
1000 check(B.NumColumns() == 1);
1001 check(A.NumRows() == B.NumRows());
1002
1004 if (!CholeskyFactorize(G))
1005 {
1006 // Not positive definite
1007 return false;
1008 }
1009
1011 return true;
1012 }
1013 };
1014
1015
1016}
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Num
Definition MetalRHIPrivate.h:234
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition DenseMatrix.h:886
static bool SolvePositiveDefinite(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B, TDenseMatrix< T_EX > &X)
Definition DenseMatrix.h:998
static bool CholeskyFactorize(TDenseMatrix< T_E > &A)
Definition DenseMatrix.h:896
static void SolveCholeskyFactorized(const TDenseMatrix< T_EA > &G, const TDenseMatrix< T_EB > &B, TDenseMatrix< T_EX > &X)
Definition DenseMatrix.h:946
Definition DenseMatrix.h:17
const FReal I(int32 RowIndex, int32 ColIndex) const
Definition DenseMatrix.h:24
FReal M() const
Definition DenseMatrix.h:19
static FMassMatrix Make(const FReal InM, const FRotation3 &Q, const FMatrix33 &InI)
Definition DenseMatrix.h:41
static FMassMatrix Make(const FReal InM, const FMatrix33 &InI)
Definition DenseMatrix.h:31
static FMassMatrix Make(const FReal InM, FMatrix33 &&InI)
Definition DenseMatrix.h:36
Definition DenseMatrix.h:79
static TDenseMatrix< MaxElements > MultiplyAtBt(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:603
static TDenseMatrix< MaxElements > Make(const int32 InNumRows, const int32 InNumCols, const FReal *V, const int32 VLen)
Definition DenseMatrix.h:362
static TDenseMatrix< MaxElements > Make(const int32 InNumRows, const int32 InNumCols)
Definition DenseMatrix.h:345
FORCEINLINE void SetDimensions(const int32 InNumRows, const int32 InNumColumns)
Definition DenseMatrix.h:138
FORCEINLINE int32 NumColumns() const
Definition DenseMatrix.h:121
void Init(const int32 InNRows, const int32 InNCols, FReal V)
Definition DenseMatrix.h:181
static TDenseMatrix< MaxElements > MultiplyAB(const FMassMatrix &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:723
static const int32 MaxElements
Definition DenseMatrix.h:81
void SetRowAt(const int32 RowIndex, const int32 ColumnIndex, const FReal *V, const int32 NumV)
Definition DenseMatrix.h:236
void SetColumnAt(const int32 RowIndex, const int32 ColumnIndex, const FVec3 &V)
Definition DenseMatrix.h:275
void SetRowAt(const int32 RowIndex, const int32 ColumnIndex, const FVec3 &V)
Definition DenseMatrix.h:247
FORCEINLINE const FReal & At(const int32 RowIndex, const int32 ColumnIndex) const
Definition DenseMatrix.h:171
void SetBlockAt(const int32 RowOffset, const int32 ColumnOffset, const FMatrix33 &V)
Definition DenseMatrix.h:304
static TDenseMatrix< MaxElements > MultiplyAB_Symmetric(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:628
static TDenseMatrix< MaxElements > Transpose(const TDenseMatrix< T_EA > &A)
Definition DenseMatrix.h:430
FORCEINLINE void SetAt(const int32 RowIndex, const int32 ColumnIndex, const FReal V)
Definition DenseMatrix.h:190
static TDenseMatrix< MaxElements > Multiply(const FReal V, const TDenseMatrix< T_EA > &A)
Definition DenseMatrix.h:816
static TDenseMatrix< MaxElements > Negate(const TDenseMatrix< T_EA > &A)
Definition DenseMatrix.h:447
static TDenseMatrix< MaxElements > Make(const FVec3 &InM)
Definition DenseMatrix.h:370
static TDenseMatrix< MaxElements > MultiplyAB(const TDenseMatrix< T_EA > &A, const FMassMatrix &B)
Definition DenseMatrix.h:684
TDenseMatrix< MaxElements > & operator=(const TDenseMatrix< MaxElements > &A)
Definition DenseMatrix.h:100
static TDenseMatrix< MaxElements > Multiply(const TDenseMatrix< T_EA > &A, const FReal V)
Definition DenseMatrix.h:798
static TDenseMatrix< MaxElements > MakeDiagonal(const int32 InNumRows, const int32 InNumCols, const FReal D)
Definition DenseMatrix.h:401
void SetRowAt(const int32 RowIndex, const int32 ColumnIndex, const FReal V0, const FReal V1, const FReal V2)
Definition DenseMatrix.h:252
TDenseMatrix(const int32 InNRows, const int32 InNCols)
Definition DenseMatrix.h:89
static TDenseMatrix< MaxElements > MultiplyABt(const FMassMatrix &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:761
void SetDiagonal(FReal V)
Definition DenseMatrix.h:210
void SetBlockAtDiagonal33(const int32 RowOffset, const int32 ColumnOffset, const FReal VDiag, const FReal VOffDiag)
Definition DenseMatrix.h:320
static TDenseMatrix< MaxElements > MultiplyAtB(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:553
FORCEINLINE FReal & At(const int32 RowIndex, const int32 ColumnIndex)
Definition DenseMatrix.h:161
static TDenseMatrix< MaxElements > MultiplyABt(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:578
static TDenseMatrix< MaxElements > Add(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:465
TDenseMatrix()
Definition DenseMatrix.h:83
static TDenseMatrix< MaxElements > Make(const FMatrix33 &InM)
Definition DenseMatrix.h:382
static TDenseMatrix< MaxElements > Divide(const TDenseMatrix< T_EA > &A, const FReal V)
Definition DenseMatrix.h:825
static TDenseMatrix< MaxElements > Subtract(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:507
static TDenseMatrix< MaxElements > DotProduct(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:843
static TDenseMatrix< MaxElements > MakeIdentity(const int32 InDim)
Definition DenseMatrix.h:417
FORCEINLINE int32 NumRows() const
Definition DenseMatrix.h:113
static TDenseMatrix< MaxElements > Add_Symmetric(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:485
static TDenseMatrix< MaxElements > MultiplyAB(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B)
Definition DenseMatrix.h:528
void SetDiagonalAt(int32 Start, int32 Num, FReal V)
Definition DenseMatrix.h:222
TDenseMatrix(const TDenseMatrix< MaxElements > &A)
Definition DenseMatrix.h:95
FORCEINLINE int32 AddRows(const int32 InNumRows)
Definition DenseMatrix.h:150
FORCEINLINE int32 NumElements() const
Definition DenseMatrix.h:129
void SetColumnAt(const int32 RowIndex, const int32 ColumnIndex, const FReal *V, const int32 NumV)
Definition DenseMatrix.h:265
static TDenseMatrix< MaxElements > Make(const int32 InNumRows, const int32 InNumCols, const FReal V)
Definition DenseMatrix.h:353
static TDenseMatrix< MaxElements > MultiplyBCAddA_Symmetric(const TDenseMatrix< T_EA > &A, const TDenseMatrix< T_EB > &B, const TDenseMatrix< T_EC > &C)
Definition DenseMatrix.h:654
void SetBlockAt(const int32 RowOffset, const int32 ColumnOffset, const TDenseMatrix< T_EA > &V)
Definition DenseMatrix.h:288
void Set(FReal V)
Definition DenseMatrix.h:198
FMatrix33 ComputeWorldSpaceInertia(const FRotation3 &CoMRotation, const FMatrix33 &I)
Definition Utilities.h:327
Definition SkeletalMeshComponent.h:307
@ X
Definition SimulationModuleBase.h:152
FRealDouble FReal
Definition Real.h:22
TRotation< FReal, 3 > FRotation3
Definition Core.h:19
PMatrix< FReal, 3, 3 > FMatrix33
Definition Core.h:20
U16 Index
Definition radfft.cpp:71