4#if defined(HAVE_READLINE) && defined(HAVE_READLINE_READLINE_H)
11ml_internal *_get_internals();
13int test_ml_is_initialised();
14void remove_dictionary();
16void remove_file_list();
18void remove_dictionary()
20 ml_internal *internal_obs =
NULL;
22 internal_obs = _get_internals();
24 printf(
"Removing pDictionary\n");
25 Py_DECREF(internal_obs->pDictionary);
26 internal_obs->pDictionary =
NULL;
33 ml_internal *internal_obs =
NULL;
35 internal_obs = _get_internals();
37 printf(
"Removing pVectors\n");
38 Py_DECREF(internal_obs->pVectors);
39 internal_obs->pVectors =
NULL;
42void remove_file_list()
44 ml_internal *internal_obs =
NULL;
46 internal_obs = _get_internals();
48 printf(
"Removing pFile_list\n");
49 Py_DECREF(internal_obs->pFile_list);
50 internal_obs->pFile_list =
NULL;
53int test_ml_is_initialised()
59 i = ml_is_initialised();
60 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
63 printf(
"Cannot test - initialization failed\n");
69 i = ml_is_initialised();
70 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
74 printf(
"Returnvalue for ml_initialise: \t\t%d\n",
i);
77 i = ml_is_initialised();
78 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
83 i = ml_is_initialised();
84 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
88 printf(
"Returnvalue for ml_initialise: \t\t%d\n",
i);
91 i = ml_is_initialised();
92 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
97 i = ml_is_initialised();
98 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
102 printf(
"Returnvalue for ml_initialise: \t\t%d\n",
i);
103 if (
i != 1)
return 1;
105 i = ml_is_initialised();
106 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
107 if (
i != 1)
return 1;
113int main(
int argc,
char *argv[])
118 printf(
"Usage: %s\n", argv[0]);
123 i = ml_is_initialised();
124 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
127 printf(
"Cannot test - initialization failed\n");
133 i = ml_is_initialised();
134 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
135 if (
i != 0)
return 1;
138 printf(
"Returnvalue for ml_initialise: \t\t%d\n",
i);
139 if (
i != 1)
return 1;
142 i = ml_is_initialised();
143 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
144 if (
i != 1)
return 1;
146 if (test_ml_is_initialised())
return 1;
149 printf(
"Returnvalue for ml_finalise: \t\t%d\n",
i);
150 if (
i != 1)
return 1;
152 i = ml_is_initialised();
153 printf(
"Returnvalue for ml_is_initialised: \t%d\n",
i);
154 if (
i != 0)
return 1;
159int main(
int argc,
char *argv[])
165int main(
int argc,
char *argv[])
Function definitions for using python to do machine learning in Singular.