]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Eugen -> eigen
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 26 Aug 2020 09:30:18 +0000 (10:30 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 26 Aug 2020 09:30:18 +0000 (10:30 +0100)
contrib/kann/kautodiff.c
contrib/kann/kautodiff.h
lualib/lua_ffi/linalg.lua
src/lua/lua_tensor.c

index c8037d353523c1e21d541a01bcaa638e4c1db896..439485a0abe90d3b495f3eb4f112dd55608977a7 100644 (file)
@@ -952,7 +952,7 @@ void kad_sgemm_simple(int trans_A, int trans_B, int M, int N, int K, const float
 }
 #endif
 
-bool kad_ssyev_simple(int N, float *A, float *eugenvals)
+bool kad_ssyev_simple(int N, float *A, float *eigenvals)
 {
 #ifndef HAVE_CBLAS
        return false;
@@ -963,10 +963,10 @@ bool kad_ssyev_simple(int N, float *A, float *eugenvals)
 
        /* Query and allocate the optimal workspace */
        lwork = -1;
-       ssyev ("Vectors", "Upper", &n, A, &lda, eugenvals, &wkopt, &lwork, &info);
+       ssyev ("Vectors", "Upper", &n, A, &lda, eigenvals, &wkopt, &lwork, &info);
        lwork = wkopt;
        work = (float*) g_malloc(lwork * sizeof(double));
-       ssyev ("Vectors", "Upper", &n, A, &lda, eugenvals, work, &lwork, &info);
+       ssyev ("Vectors", "Upper", &n, A, &lda, eigenvals, work, &lwork, &info);
        /* Check for convergence */
        if (info > 0) {
                g_free (work);
index 8c797205c11faaeba664c4d8de16f929893848d4..d7e713304149f69af0c9fb605994afbc08d14a2b 100644 (file)
@@ -246,11 +246,11 @@ static inline int kad_len(const kad_node_t *p) /* calculate the size of p->x */
 /* Additions by Rspamd */
 void kad_sgemm_simple (int trans_A, int trans_B, int M, int N, int K, const float *A, const float *B, float *C);
 /**
- * Calculate eugenvectors and eugenvalues
+ * Calculate eigenvectors and eigenvalues
  * @param N dimensions of A (must be NxN)
- * @param A input matrix (part of it will be destroyed, so copy if needed), on finish the first `nwork` columns will have eugenvectors
- * @param eugenvals eugenvalues, must be N elements vector
+ * @param A input matrix (part of it will be destroyed, so copy if needed), on finish the first `nwork` columns will have eigenvectors
+ * @param eigenvals eigenvalues, must be N elements vector
  */
-bool kad_ssyev_simple (int N, float *A, float *eugenvals);
+bool kad_ssyev_simple (int N, float *A, float *eigenvals);
 
 #endif
index ae71fc08ba407f6fe6b7559744cc26bda26fadf5..59ff577a2d8ed12b65dce6924ce60706dcea48f2 100644 (file)
@@ -65,7 +65,7 @@ exports.sgemm = function(a, m, b, n, k, trans_a, trans_b)
   return res
 end
 
-exports.eugen = function(a, n)
+exports.eigen = function(a, n)
   if type(a) == 'table' then
     -- Need to convert, slow!
     n = n or #a
index f8386d6f3dc767ca2c02cbfce4e419bcc20be234..b40ee6e7103d230ea13bd981f026de0a1939eed4 100644 (file)
@@ -35,7 +35,7 @@ LUA_FUNCTION_DEF (tensor, tostring);
 LUA_FUNCTION_DEF (tensor, index);
 LUA_FUNCTION_DEF (tensor, newindex);
 LUA_FUNCTION_DEF (tensor, len);
-LUA_FUNCTION_DEF (tensor, eugen);
+LUA_FUNCTION_DEF (tensor, eigen);
 LUA_FUNCTION_DEF (tensor, mean);
 LUA_FUNCTION_DEF (tensor, transpose);
 
@@ -56,7 +56,7 @@ static luaL_reg rspamd_tensor_m[] = {
                {"__index", lua_tensor_index},
                {"__newindex", lua_tensor_newindex},
                {"__len", lua_tensor_len},
-               LUA_INTERFACE_DEF (tensor, eugen),
+               LUA_INTERFACE_DEF (tensor, eigen),
                LUA_INTERFACE_DEF (tensor, mean),
                LUA_INTERFACE_DEF (tensor, transpose),
                {NULL, NULL},
@@ -604,9 +604,9 @@ lua_tensor_len (lua_State *L)
 }
 
 static gint
-lua_tensor_eugen (lua_State *L)
+lua_tensor_eigen (lua_State *L)
 {
-       struct rspamd_lua_tensor *t = lua_check_tensor (L, 1), *eugen;
+       struct rspamd_lua_tensor *t = lua_check_tensor (L, 1), *eigen;
 
        if (t) {
                if (t->ndims != 2 || t->dim[0] != t->dim[1]) {
@@ -614,9 +614,9 @@ lua_tensor_eugen (lua_State *L)
                                        t->dim[0], t->dim[1]);
                }
 
-               eugen = lua_newtensor (L, 1, &t->dim[0], true, true);
+               eigen = lua_newtensor (L, 1, &t->dim[0], true, true);
 
-               if (!kad_ssyev_simple (t->dim[0], t->data, eugen->data)) {
+               if (!kad_ssyev_simple (t->dim[0], t->data, eigen->data)) {
                        lua_pop (L, 1);
                        return luaL_error (L, "kad_ssyev_simple failed (no blas?)");
                }