/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/math/matrix.h>
// EXTERNAL INCLUDES
-#include <math.h>
-#include <string.h>
-#include <iostream>
+#include <cmath>
+#include <cstring> // for memcpy
+#include <ostream>
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
return false;
}
- det = 1.0 / det;
+ det = 1.0f / det;
- for (int i = 0; i < 16; i++)
+ for( int32_t i = 0; i < 16; i++)
{
out[i] = inv[i] * det;
}
#ifndef __ARM_NEON__
- for( int i=0; i < 4; i++ )
+ for( int32_t i=0; i < 4; i++ )
{
// i<<2 gives the first vector / column
- int loc = i<<2;
- int loc1 = loc + 1;
- int loc2 = loc + 2;
- int loc3 = loc + 3;
+ int32_t loc = i<<2;
+ int32_t loc1 = loc + 1;
+ int32_t loc2 = loc + 2;
+ int32_t loc3 = loc + 3;
float value0 = lhsPtr[loc];
float value1 = lhsPtr[loc1];
float value2 = lhsPtr[loc2];
#ifndef __ARM_NEON__
- for( int i=0; i < 4; i++ )
+ for( int32_t i=0; i < 4; i++ )
{
// i<<2 gives the first vector / column
- int loc = i<<2;
- int loc1 = loc + 1;
- int loc2 = loc + 2;
- int loc3 = loc + 3;
+ int32_t loc = i<<2;
+ int32_t loc1 = loc + 1;
+ int32_t loc2 = loc + 2;
+ int32_t loc3 = loc + 3;
float value0 = lhsPtr[loc];
float value1 = lhsPtr[loc1];
float value2 = lhsPtr[loc2];
std::ostream& operator<< (std::ostream& o, const Matrix& matrix)
{
- return o << "[ [" << matrix.mMatrix[0] << ", " << matrix.mMatrix[1] << ", " << matrix.mMatrix[2] << ", " << matrix.mMatrix[3] << "], "
- << "[" << matrix.mMatrix[4] << ", " << matrix.mMatrix[5] << ", " << matrix.mMatrix[6] << ", " << matrix.mMatrix[7] << "], "
- << "[" << matrix.mMatrix[8] << ", " << matrix.mMatrix[9] << ", " << matrix.mMatrix[10] << ", " << matrix.mMatrix[11] << "], "
- << "[" << matrix.mMatrix[12] << ", " << matrix.mMatrix[13] << ", " << matrix.mMatrix[14] << ", " << matrix.mMatrix[15] << "] ]";
+ return o << "[ " << matrix.mMatrix[0] << ", " << matrix.mMatrix[1] << ", " << matrix.mMatrix[2] << ", " << matrix.mMatrix[3] << ", "
+ << matrix.mMatrix[4] << ", " << matrix.mMatrix[5] << ", " << matrix.mMatrix[6] << ", " << matrix.mMatrix[7] << ", "
+ << matrix.mMatrix[8] << ", " << matrix.mMatrix[9] << ", " << matrix.mMatrix[10] << ", " << matrix.mMatrix[11] << ", "
+ << matrix.mMatrix[12] << ", " << matrix.mMatrix[13] << ", " << matrix.mMatrix[14] << ", " << matrix.mMatrix[15] << " ]";
}
} // namespace Dali