/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
END_TEST;
}
+int UtcDaliMatrixOperatorMultiply03P(void)
+{
+ const float ll[16] = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
+ const float rr[16] = {1.0f, 5.0f, 0.0f, 0.0f, 2.0f, 6.0f, 0.0f, 0.0f, 3.0f, 7.0f, 0.0f, 0.0f, 4.0f, 8.0f, 0.0f, 0.0f};
+ Matrix left(ll);
+ Matrix right(rr);
+
+ const float els[16] = {26.0f, 32.0f, 38.0f, 44.0f, 32.0f, 40.0f, 48.0f, 56.0f, 38.0f, 48.0f, 58.0f, 68.0f, 44.0f, 56.0f, 68.0f, 80.0f};
+ Matrix result(els);
+
+ // Get result by operator*
+ Matrix multResult = left * right;
+ DALI_TEST_EQUALS(multResult, result, 0.01f, TEST_LOCATION);
+
+ // Get result by Multiply API
+ Matrix::Multiply(multResult, right, left);
+ DALI_TEST_EQUALS(multResult, result, 0.01f, TEST_LOCATION);
+
+ END_TEST;
+}
+
int UtcDaliMatrixOperatorEqualsP(void)
{
Matrix m1 = Matrix::IDENTITY;
END_TEST;
}
+int UtcDaliMatrix3OperatorMultiply03P(void)
+{
+ Matrix3 left(
+ 1.0f, 2.0f, 3.0f, 5.0f, 6.0f, 7.0f, 0.0f, 0.0f, 0.0f);
+ Matrix3 right(
+ 1.0f, 5.0f, 0.0f, 2.0f, 6.0f, 0.0f, 3.0f, 7.0f, 0.0f);
+
+ Matrix3 result(
+ 26.0f, 32.0f, 38.0f, 32.0f, 40.0f, 48.0f, 38.0f, 48.0f, 58.0f);
+
+ // Get result by operator*
+ Matrix3 multResult = left * right;
+ DALI_TEST_EQUALS(multResult, result, 0.01f, TEST_LOCATION);
+
+ // Get result by Multiply API
+ Matrix3::Multiply(multResult, right, left);
+ DALI_TEST_EQUALS(multResult, result, 0.01f, TEST_LOCATION);
+
+ END_TEST;
+}
+
int UtcDaliMatrix3EqualityOperator(void)
{
Matrix3 m1(0.0f, 3.0f, 6.0f, 12.0f, 15.0f, 18.0f, 24.0f, 27.0f, 30.0f);
static void Multiply(Matrix& result, const Matrix& lhs, const Quaternion& rhs);
/**
+ * @brief Multiplication operator.
+ *
+ * Returned Matrix = This Matrix * rhs
+ *
+ * @note It makes some memory allocate & copy internally.
+ * Use Matrix::Multiply API for time critical path.
+ *
+ * @SINCE_2_1.44
+ * @param[in] rhs The Matrix to multiply this by
+ * @return A Matrix containing the result
+ */
+ Matrix operator*(const Matrix& rhs) const
+ {
+ Matrix result(false);
+ Multiply(result, rhs, *this);
+ return result;
+ }
+
+ /**
* @brief The multiplication operator.
*
* Returned Vector = This Matrix * rhs
static void Multiply(Matrix3& result, const Matrix3& lhs, const Matrix3& rhs);
/**
+ * @brief Multiplication operator.
+ *
+ * Returned Matrix = This Matrix * rhs
+ *
+ * @note It makes some memory allocate & copy internally.
+ * Use Matrix3::Multiply API for time critical path.
+ *
+ * @SINCE_2_1.44
+ * @param[in] rhs The Matrix to multiply this by
+ * @return A Matrix containing the result
+ */
+ Matrix3 operator*(const Matrix3& rhs) const
+ {
+ Matrix3 result;
+ Multiply(result, rhs, *this);
+ return result;
+ }
+
+ /**
* @brief The multiplication operator.
*
* Returned Vector = This Matrix * rhs