Files
core_math/tjp/core/math/HMatrix.cpp
Timothy Prepscius 0807c0286a flatten 20260225
2026-02-25 12:36:47 -05:00

57 lines
921 B
C++
Executable File

//
// Math.cpp
// amoeba
//
// Created by Timothy Prepscius on 12/30/16.
// Copyright © 2016 Timothy Prepscius. All rights reserved.
//
#include "HMatrix.hpp"
#include "HMatrix.inl"
namespace tjp {
namespace core {
namespace math {
// inline
template<>
HMatrix<double> operator *(const HMatrix<double> &lhs, const HMatrix<double> &rhs)
{
HMatrix<Real> result;
for (int r = 0; r < 4; ++r)
{
for (int c = 0; c < 4; ++c)
{
result[r][c] = 0;
for (int i = 0; i < 4; ++i)
{
result[r][c] += lhs[i][c] * rhs[r][i];
}
}
}
return result;
}
template<>
const HMatrix<double> HMatrix<double>::Zero {
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
};
template<>
const HMatrix<double> HMatrix<double>::Identity {
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1
};
} // namespace
} // namespace
} // namespace