Skip to content

Commit 981c00b

Browse files
committed
BUG: Fixes compile errors due to missing implementations.
This bug was revealed using Xcode 16.3 on a MacOS Sequoia 15.4 machine Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent 2e31697 commit 981c00b

File tree

3 files changed

+41
-18
lines changed

3 files changed

+41
-18
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1515
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1616

1717
# set project's name
18-
project(EbsdLibProj VERSION 1.0.37)
18+
project(EbsdLibProj VERSION 1.0.38)
1919

2020
# ---------- Setup output Directories -------------------------
2121
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY

Source/EbsdLib/Math/Matrix3X3.hpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ class Matrix3X3
129129
* @param rhs
130130
* @return
131131
*/
132-
Matrix3X3& multiplyInPlace(SelfType& rhs)
132+
SelfType& multiplyInPlace(SelfType& rhs)
133133
{
134-
Matrix3X3 outMat;
134+
SelfType outMat;
135135
outMat[0] = m_Data[0] * rhs[0] + m_Data[1] * rhs[3] + m_Data[2] * rhs[6];
136136
outMat[1] = m_Data[0] * rhs[1] + m_Data[1] * rhs[4] + m_Data[2] * rhs[7];
137137
outMat[2] = m_Data[0] * rhs[2] + m_Data[1] * rhs[5] + m_Data[2] * rhs[8];
@@ -150,9 +150,9 @@ class Matrix3X3
150150
* @param rhs
151151
* @param outMat
152152
*/
153-
Matrix3X3 operator+(const Matrix3X3& rhs) const
153+
SelfType operator+(const Matrix3X3& rhs) const
154154
{
155-
Matrix3X3 outMat;
155+
SelfType outMat;
156156
outMat[0] = m_Data[0] + rhs[0];
157157
outMat[1] = m_Data[1] + rhs[1];
158158
outMat[2] = m_Data[2] + rhs[2];
@@ -170,9 +170,9 @@ class Matrix3X3
170170
* @param rhs
171171
* @param outMat
172172
*/
173-
Matrix3X3 operator-(const Matrix3X3& rhs) const
173+
SelfType operator-(const SelfType& rhs) const
174174
{
175-
Matrix3X3 outMat;
175+
SelfType outMat;
176176
outMat[0] = m_Data[0] - rhs[0];
177177
outMat[1] = m_Data[1] - rhs[1];
178178
outMat[2] = m_Data[2] - rhs[2];
@@ -217,7 +217,7 @@ class Matrix3X3
217217
* @brief Multiplies each element of a 3x1 matrix by a scalar value and returns the result
218218
* @param scalar to multiply each element by.
219219
*/
220-
Matrix3X3 operator*(T scalar)
220+
SelfType operator*(T scalar)
221221
{
222222
return {
223223
m_Data[0] * scalar, m_Data[1] * scalar, m_Data[2] * scalar, m_Data[3] * scalar, m_Data[4] * scalar, m_Data[5] * scalar, m_Data[6] * scalar, m_Data[7] * scalar, m_Data[8] * scalar,
@@ -230,9 +230,9 @@ class Matrix3X3
230230
* @param outMat
231231
*/
232232

233-
Matrix3X3 transpose() const
233+
SelfType transpose() const
234234
{
235-
Matrix3X3 outMat;
235+
SelfType outMat;
236236
outMat[0] = m_Data[0];
237237
outMat[1] = m_Data[3];
238238
outMat[2] = m_Data[6];
@@ -249,7 +249,7 @@ class Matrix3X3
249249
* @brief Inverts the 3x3 matrix and returns the result
250250
* @return outMat
251251
*/
252-
void invert()
252+
SelfType invert()
253253
{
254254
SelfType adjoint = this->adjoint();
255255
T oneOverDeterminant = 1.0 / this->determinant();
@@ -261,7 +261,7 @@ class Matrix3X3
261261
* @return outMat
262262
*/
263263

264-
void adjoint()
264+
SelfType adjoint()
265265
{
266266
SelfType temp = this->cofactor();
267267
return temp.transpose();
@@ -274,7 +274,7 @@ class Matrix3X3
274274

275275
SelfType cofactor() const
276276
{
277-
SelfType temp = this->minors3X3();
277+
SelfType temp = this->minors();
278278
SelfType outMat;
279279

280280
// Row 0
@@ -292,14 +292,14 @@ class Matrix3X3
292292
return outMat;
293293
}
294294

295-
/**
295+
/**b
296296
* @brief Calculates the matrix of minors of the 3x3 matrix and places the result into outMat
297297
* @return outMat
298298
*/
299299

300-
Matrix3X3 minors()
300+
SelfType minors() const
301301
{
302-
Matrix3X3 outMat;
302+
SelfType outMat;
303303
outMat[0] = m_Data[4] * m_Data[8] - m_Data[7] * m_Data[5];
304304
outMat[1] = m_Data[3] * m_Data[8] - m_Data[6] * m_Data[5];
305305
outMat[2] = m_Data[3] * m_Data[7] - m_Data[6] * m_Data[4];
@@ -329,7 +329,7 @@ class Matrix3X3
329329
* @param g
330330
*/
331331

332-
Matrix3X3 identity()
332+
SelfType identity()
333333
{
334334
return {1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f};
335335
}
@@ -339,7 +339,7 @@ class Matrix3X3
339339
* @param g
340340
*/
341341

342-
Matrix3X3 normalize() const
342+
SelfType normalize() const
343343
{
344344
T denom = m_Data[0] * m_Data[0] + m_Data[3] * m_Data[3] + m_Data[6] * m_Data[6];
345345
if(denom == 0.0)

Source/Test/TextureTest.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "EbsdLib/LaueOps/TriclinicOps.h"
5050
#include "EbsdLib/LaueOps/TrigonalLowOps.h"
5151
#include "EbsdLib/LaueOps/TrigonalOps.h"
52+
#include "EbsdLib/Math/Matrix3X3.hpp"
5253
#include "EbsdLib/Texture/StatsGen.hpp"
5354
#include "EbsdLib/Texture/Texture.hpp"
5455

@@ -186,13 +187,35 @@ class TextureTest
186187
TestTextureOdf<TrigonalOps>();
187188
}
188189

190+
void TestMatrix3X3()
191+
{
192+
EbsdLib::Matrix3X3F matrix(1.0f, 2.0f, 3.0, 4.0f, 5.0f, 6.0f, 7.0, 8.0f, 9.0f);
193+
matrix[0] = 10.0f;
194+
matrix.data()[0] = 12.0f;
195+
matrix = matrix * matrix;
196+
matrix = matrix.multiplyInPlace(matrix);
197+
matrix = matrix + matrix;
198+
matrix = matrix - matrix;
199+
matrix = matrix * 22.0f;
200+
201+
matrix = matrix.transpose();
202+
matrix = matrix.invert();
203+
matrix = matrix.adjoint();
204+
matrix = matrix.cofactor();
205+
matrix = matrix.minors();
206+
float det = matrix.determinant();
207+
matrix = matrix.normalize();
208+
matrix = matrix.identity();
209+
}
210+
189211
void operator()()
190212
{
191213
std::cout << "<===== Start " << getNameOfClass() << std::endl;
192214

193215
int err = EXIT_SUCCESS;
194216
DREAM3D_REGISTER_TEST(TestOdfGeneration())
195217
DREAM3D_REGISTER_TEST(TestMdfGeneration())
218+
DREAM3D_REGISTER_TEST(TestMatrix3X3())
196219
}
197220

198221
public:

0 commit comments

Comments
 (0)