Documentation
¶
Index ¶
- Constants
- func AlmostEqual(a, b, tolerance float64) bool
- func AssertAlmostEqual(t *testing.T, expected, actual, tolerance float64, message string)
- func AssertError(t *testing.T, err error, message string)
- func AssertMatrixAlmostEqual(t *testing.T, expected, actual types.Matrix, tolerance float64, message string)
- func AssertNoError(t *testing.T, err error, message string)
- func AssertSliceAlmostEqual(t *testing.T, expected, actual []float64, tolerance float64, message string)
- func CompareMatrixDimensions(a, b types.Matrix) bool
- func CreateTestPCAConfig(components int) types.PCAConfig
- func GenerateIdentityMatrix(size int) types.Matrix
- func GenerateRandomMatrix(rows, cols int) types.Matrix
- func GenerateTestMatrix(rows, cols int, seed float64) types.Matrix
Constants ¶
const ( // DefaultTolerance is the default numerical tolerance for floating point comparisons DefaultTolerance = 1e-10 // LooseTolerance is used for less strict comparisons LooseTolerance = 1e-6 // StrictTolerance is used for very strict comparisons StrictTolerance = 1e-14 )
Variables ¶
This section is empty.
Functions ¶
func AlmostEqual ¶
AlmostEqual checks if two float64 values are approximately equal within tolerance
func AssertAlmostEqual ¶
AssertAlmostEqual checks if two values are almost equal and fails the test if not
func AssertError ¶
AssertError checks that an error is not nil and fails the test if it is
func AssertMatrixAlmostEqual ¶
func AssertMatrixAlmostEqual(t *testing.T, expected, actual types.Matrix, tolerance float64, message string)
AssertMatrixAlmostEqual checks if two matrices are almost equal element-wise
func AssertNoError ¶
AssertNoError checks that an error is nil and fails the test if not
func AssertSliceAlmostEqual ¶
func AssertSliceAlmostEqual(t *testing.T, expected, actual []float64, tolerance float64, message string)
AssertSliceAlmostEqual checks if two slices are almost equal element-wise
func CompareMatrixDimensions ¶
CompareMatrixDimensions checks if two matrices have the same dimensions
func CreateTestPCAConfig ¶
CreateTestPCAConfig creates a basic PCA configuration for testing
func GenerateIdentityMatrix ¶
GenerateIdentityMatrix creates an identity matrix
func GenerateRandomMatrix ¶
GenerateRandomMatrix creates a test matrix with pseudo-random values
Types ¶
This section is empty.