File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1515
1616typedef uint32_t (* lut_fn_t )(uint32_t );
1717
18- // Function to generate a LUT dynamically
18+ /**
19+ * @brief Generate a lookup table (LUT) for a given function.
20+ *
21+ * @param size Size of the LUT.
22+ * @param func Function to compute LUT values.
23+ * @return uint32_t* Pointer to the generated LUT or NULL on failure.
24+ */
1925uint32_t * generate_lut (size_t size , lut_fn_t func ) {
2026 uint32_t * table = malloc (size * sizeof (uint32_t ));
2127 if (table == NULL ) {
@@ -28,7 +34,12 @@ uint32_t* generate_lut(size_t size, lut_fn_t func) {
2834 return table ;
2935}
3036
31- // Example transformation function
37+ /**
38+ * @brief Compute the cube of a number.
39+ *
40+ * @param x Input number.
41+ * @return uint32_t Cube of the input number.
42+ */
3243uint32_t cube (uint32_t x ) {
3344 return x * x * x ;
3445}
You can’t perform that action at this time.
0 commit comments