MCPcopy
hub / github.com/EngoEngine/engo / TestMatrixMultiply

Function TestMatrixMultiply

math_test.go:796–881  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

794}
795
796func TestMatrixMultiply(t *testing.T) {
797 data := []struct {
798 m1, m2, expected []float32
799 }{
800 {
801 m1: []float32{
802 0, 0, 0,
803 0, 0, 0,
804 0, 0, 0,
805 },
806 m2: []float32{
807 0, 0, 0,
808 0, 0, 0,
809 0, 0, 0,
810 },
811 expected: []float32{
812 0, 0, 0,
813 0, 0, 0,
814 0, 0, 0,
815 },
816 },
817 {
818 m1: []float32{
819 1, 2, 3,
820 4, 5, 6,
821 7, 8, 9,
822 },
823 m2: []float32{
824 1, 0, 0,
825 0, 1, 0,
826 0, 0, 1,
827 },
828 expected: []float32{
829 1, 2, 3,
830 4, 5, 6,
831 7, 8, 9,
832 },
833 },
834 {
835 m1: []float32{
836 0, 1, 2,
837 2, 3, 4,
838 3, 4, 2,
839 },
840 m2: []float32{
841 1, 3, 2,
842 2, 3, 2,
843 2, 1, 1,
844 },
845 expected: []float32{
846 12, 18, 18,
847 12, 19, 20,
848 5, 9, 10,
849 },
850 },
851 {
852 m1: []float32{
853 1, 3, 2,

Callers

nothing calls this directly

Calls 4

IdentityMatrixFunction · 0.85
FloatEqualFunction · 0.85
SetMethod · 0.45
MultiplyMethod · 0.45

Tested by

no test coverage detected