Fixes to make it work againg, but failing at udp.begin()

This commit is contained in:
Pascal Serrarens 2025-04-17 12:50:49 +02:00
parent 3cca327080
commit 83539df3e5

View File

@ -1,5 +1,7 @@
#include "Matrix.h"
#if !defined(NO_STD)
#include <iostream>
#endif
namespace LinearAlgebra {
@ -61,7 +63,9 @@ Matrix2::Matrix2(const Matrix2& m)
this->data = nullptr;
else {
this->data = new float[this->nValues];
std::copy(m.data, m.data + nValues, this->data);
for (int ix = 0; ix < this->nValues; ++ix)
this->data[ix] = m.data[ix];
}
}
@ -76,7 +80,8 @@ Matrix2& Matrix2::operator=(const Matrix2& m) {
this->data = nullptr;
else {
this->data = new float[this->nValues];
std::copy(m.data, m.data + this->nValues, this->data);
for (int ix = 0; ix < this->nValues; ++ix)
this->data[ix] = m.data[ix];
}
}
return *this;
@ -89,7 +94,8 @@ Matrix2::~Matrix2() {
Matrix2 Matrix2::Clone() const {
Matrix2 r = Matrix2(this->nRows, this->nCols);
std::copy(this->data, this->data + this->nValues, r.data);
for (int ix = 0; ix < this->nValues; ++ix)
r.data[ix] = this->data[ix];
return r;
}
@ -158,8 +164,8 @@ Matrix2 Matrix2::SkewMatrix(const Vector3& v) {
Matrix2 Matrix2::Transpose() const {
Matrix2 r = Matrix2(this->nCols, this->nRows);
for (uint rowIx = 0; rowIx < this->nRows; rowIx++) {
for (uint colIx = 0; colIx < this->nCols; colIx++)
for (int rowIx = 0; rowIx < this->nRows; rowIx++) {
for (int colIx = 0; colIx < this->nCols; colIx++)
r.data[colIx * this->nCols + rowIx] =
this->data[rowIx * this->nCols + colIx];
}