mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
26 lines
332 B
C++
26 lines
332 B
C++
#include "Matrix.hpp"
|
|
#include <assert.h>
|
|
|
|
using namespace matrix;
|
|
|
|
int main()
|
|
{
|
|
Matrix3f A;
|
|
A.setIdentity();
|
|
assert(A.rows() == 3);
|
|
assert(A.cols() == 3);
|
|
|
|
for (int i = 0; i < 3; i++) {
|
|
for (int j = 0; j < 3; j++) {
|
|
if (i == j) {
|
|
assert(A(i, j) == 1);
|
|
|
|
} else {
|
|
assert(A(i, j) == 0);
|
|
}
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|