indentation in strings
This commit is contained in:
@@ -52,8 +52,7 @@ TEST(PIMathMatrixT_Test, element) {
|
|||||||
ASSERT_TRUE(true);
|
ASSERT_TRUE(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrixT_Test, element)
|
TEST(PIMathMatrixT_Test, element) {
|
||||||
{
|
|
||||||
auto matrix = PIMathMatrix<double>::identity(3, 3);
|
auto matrix = PIMathMatrix<double>::identity(3, 3);
|
||||||
for(uint i = 0; i < 3; i++) {
|
for(uint i = 0; i < 3; i++) {
|
||||||
if(matrix.element(i,i) != 1.0) {
|
if(matrix.element(i,i) != 1.0) {
|
||||||
@@ -72,8 +71,7 @@ TEST(PIMathMatrixT_Test, element)
|
|||||||
ASSERT_TRUE(true);
|
ASSERT_TRUE(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrix_Test, matrixRow)
|
TEST(PIMathMatrix_Test, matrixRow) {
|
||||||
{
|
|
||||||
PIMathVector<double> vector;
|
PIMathVector<double> vector;
|
||||||
vector.resize(3, 3.0);
|
vector.resize(3, 3.0);
|
||||||
auto matrix = PIMathMatrix<double>::matrixRow(vector);
|
auto matrix = PIMathMatrix<double>::matrixRow(vector);
|
||||||
@@ -583,8 +581,7 @@ TEST(PIMathMatrix_Test, matrixMultiplication)
|
|||||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 * matrix2, 7.5, 2));
|
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 * matrix2, 7.5, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrix_Test, matrixAndVectorMultiplication)
|
TEST(PIMathMatrix_Test, matrixAndVectorMultiplication) {
|
||||||
{
|
|
||||||
PIMathMatrix<double> matrix1(2, 2, 1.5);
|
PIMathMatrix<double> matrix1(2, 2, 1.5);
|
||||||
PIMathVector<double> vector;
|
PIMathVector<double> vector;
|
||||||
vector.resize(2, 2.5);
|
vector.resize(2, 2.5);
|
||||||
@@ -596,8 +593,7 @@ TEST(PIMathMatrix_Test, matrixAndVectorMultiplication)
|
|||||||
ASSERT_TRUE(true);
|
ASSERT_TRUE(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrix_Test, vectorAndMatrixMultiplication)
|
TEST(PIMathMatrix_Test, vectorAndMatrixMultiplication) {
|
||||||
{
|
|
||||||
PIMathMatrix<double> matrix1(2, 2, 1.5);
|
PIMathMatrix<double> matrix1(2, 2, 1.5);
|
||||||
PIMathVector<double> vector;
|
PIMathVector<double> vector;
|
||||||
vector.resize(2, 2.5);
|
vector.resize(2, 2.5);
|
||||||
@@ -609,14 +605,12 @@ TEST(PIMathMatrix_Test, vectorAndMatrixMultiplication)
|
|||||||
ASSERT_TRUE(true);
|
ASSERT_TRUE(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrix_Test, valAndMatrixMultiplication)
|
TEST(PIMathMatrix_Test, valAndMatrixMultiplication) {
|
||||||
{
|
|
||||||
PIMathMatrix<double> matrix1(3, 3, 1.5);
|
PIMathMatrix<double> matrix1(3, 3, 1.5);
|
||||||
ASSERT_TRUE(cmpSquareMatrixWithValue(25.0*matrix1, 37.5, 3));
|
ASSERT_TRUE(cmpSquareMatrixWithValue(25.0*matrix1, 37.5, 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrix_Test, hermitian)
|
TEST(PIMathMatrix_Test, hermitian) {
|
||||||
{
|
|
||||||
complex<double> val;
|
complex<double> val;
|
||||||
complex<double> res;
|
complex<double> res;
|
||||||
val.imag(1.0);
|
val.imag(1.0);
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ const uint rows = 3;
|
|||||||
const uint cols = 3;
|
const uint cols = 3;
|
||||||
|
|
||||||
template<typename Type>
|
template<typename Type>
|
||||||
bool cmpSquareMatrixWithValue(PIMathMatrixT<rows, cols, double> matrix, Type val, int num)
|
bool cmpSquareMatrixWithValue(PIMathMatrixT<rows, cols, double> matrix, Type val, int num) {
|
||||||
{
|
|
||||||
bool b = true;
|
bool b = true;
|
||||||
for(int i = 0; i < num; i++) {
|
for(int i = 0; i < num; i++) {
|
||||||
for(int j = 0; j < num; j++) {
|
for(int j = 0; j < num; j++) {
|
||||||
@@ -18,8 +17,7 @@ bool cmpSquareMatrixWithValue(PIMathMatrixT<rows, cols, double> matrix, Type val
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrixT_Test, identity)
|
TEST(PIMathMatrixT_Test, identity) {
|
||||||
{
|
|
||||||
auto matrix = PIMathMatrixT<rows, cols, double>::identity();
|
auto matrix = PIMathMatrixT<rows, cols, double>::identity();
|
||||||
for(int i = 0; i < 3; i++){
|
for(int i = 0; i < 3; i++){
|
||||||
if(matrix[i][i] != 1.0){
|
if(matrix[i][i] != 1.0){
|
||||||
@@ -39,8 +37,7 @@ TEST(PIMathMatrixT_Test, identity)
|
|||||||
ASSERT_TRUE(true);
|
ASSERT_TRUE(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrixT_Test, at)
|
TEST(PIMathMatrixT_Test, at) {
|
||||||
{
|
|
||||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::identity();
|
auto matrix1 = PIMathMatrixT<rows, cols, double>::identity();
|
||||||
for(uint i = 0; i < rows; i++) {
|
for(uint i = 0; i < rows; i++) {
|
||||||
if(matrix1.at(i,i) != 1.0) {
|
if(matrix1.at(i,i) != 1.0) {
|
||||||
@@ -324,27 +321,23 @@ TEST(PIMathMatrixT_Test, operator_Division_Assignment) {
|
|||||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1, 3.36, rows));
|
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1, 3.36, rows));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrixT_Test, operator_Addition)
|
TEST(PIMathMatrixT_Test, operator_Addition) {
|
||||||
{
|
|
||||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||||
auto matrix2 = PIMathMatrixT<rows, cols, double>::filled(8.28);
|
auto matrix2 = PIMathMatrixT<rows, cols, double>::filled(8.28);
|
||||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 + matrix2, 15.0, rows));
|
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 + matrix2, 15.0, rows));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrixT_Test, operator_Subtraction)
|
TEST(PIMathMatrixT_Test, operator_Subtraction) {
|
||||||
{
|
|
||||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.0);
|
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.0);
|
||||||
auto matrix2 = PIMathMatrixT<rows, cols, double>::filled(5.0);
|
auto matrix2 = PIMathMatrixT<rows, cols, double>::filled(5.0);
|
||||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 - matrix2, 1.0, rows));
|
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 - matrix2, 1.0, rows));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(PIMathMatrixT_Test, operator_Multiplication)
|
TEST(PIMathMatrixT_Test, operator_Multiplication) {
|
||||||
{
|
|
||||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 * 4.0, 26.88, rows));
|
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 * 4.0, 26.88, rows));
|
||||||
}
|
}
|
||||||
TEST(PIMathMatrixT_Test, operator_Division)
|
TEST(PIMathMatrixT_Test, operator_Division) {
|
||||||
{
|
|
||||||
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
auto matrix1 = PIMathMatrixT<rows, cols, double>::filled(6.72);
|
||||||
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 / 4.0, 1.68, rows));
|
ASSERT_TRUE(cmpSquareMatrixWithValue(matrix1 / 4.0, 1.68, rows));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user