// 3rd_party_lib:matrix4cj/target/matrix4cj
// 3rd_party_lib_ohos:matrix4cj/target/aarch64-linux-ohos/matrix4cj

package matrix4cj.tests.HLT.LEVEL1

import matrix4cj.*
import std.math.*
import std.unittest.*
import std.unittest.testmacro.*

@Test
public class TestMatrix5 {
    @TestCase
    func L0_Test_Matrix_norm1_01(): Unit {
        var matrix01 = Matrix(
            [
                [1.80, 2.88, 2.05, -0.89],
                [5.25, -2.95, -0.95, -3.80],
                [1.58, -2.69, -2.90, -1.04],
                [-1.11, -0.66, -0.59, 0.80]
            ]
        )
        var result = matrix01.normL1()
        @Assert(result,9.739999999999998)
    }
    @TestCase
    func L0_Test_Matrix_norm2_01(): Unit {
        var matrix01 = Matrix(
            [
                [1.80, 2.88, 2.05, -0.89],
                [5.25, -2.95, -0.95, -3.80],
                [1.58, -2.69, -2.90, -1.04],
                [-1.11, -0.66, -0.59, 0.80]
            ]
        )
        var result = matrix01.normL2()
        @Assert(result,8.001233392751233)
    }
    @TestCase
    func L0_Test_Matrix_normF_01(): Unit {
        var matrix01 = Matrix(
            [
                [1.80, 2.88, 2.05, -0.89],
                [5.25, -2.95, -0.95, -3.80],
                [1.58, -2.69, -2.90, -1.04],
                [-1.11, -0.66, -0.59, 0.80]
            ]
        )
        var result = matrix01.normFrobenius()
        @Assert(result,9.487697297026296)
    }
    @TestCase
    func L0_Test_Matrix_normInf_01(): Unit {
        var matrix01 = Matrix(
            [
                [1.80, 2.88, 2.05, -0.89],
                [5.25, -2.95, -0.95, -3.80],
                [1.58, -2.69, -2.90, -1.04],
                [-1.11, -0.66, -0.59, 0.80]
            ]
        )
        var result = matrix01.normInf()
        @Assert(result,12.95)
    }
}