wip to compile it again with XCode on Sierra
This commit is contained in:
parent
6beae3ed45
commit
aba7bc1213
19 changed files with 194 additions and 37 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
.svn
|
.svn
|
||||||
|
.DS_Store
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 42;
|
objectVersion = 46;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
@ -203,10 +203,19 @@
|
||||||
/* Begin PBXProject section */
|
/* Begin PBXProject section */
|
||||||
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
08FB7793FE84155DC02AAC07 /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastUpgradeCheck = 0800;
|
||||||
|
};
|
||||||
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "dees" */;
|
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "dees" */;
|
||||||
|
compatibilityVersion = "Xcode 3.2";
|
||||||
|
developmentRegion = English;
|
||||||
hasScannedForEncodings = 1;
|
hasScannedForEncodings = 1;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
);
|
||||||
mainGroup = 08FB7794FE84155DC02AAC07 /* dees */;
|
mainGroup = 08FB7794FE84155DC02AAC07 /* dees */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
8DD76F620486A84900D96B5E /* dees */,
|
8DD76F620486A84900D96B5E /* dees */,
|
||||||
);
|
);
|
||||||
|
@ -241,7 +250,6 @@
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||||
GCC_MODEL_TUNING = G5;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
INSTALL_PATH = "$(HOME)/bin";
|
INSTALL_PATH = "$(HOME)/bin";
|
||||||
LIBRARY_SEARCH_PATHS = (
|
LIBRARY_SEARCH_PATHS = (
|
||||||
|
@ -249,6 +257,7 @@
|
||||||
"$(SRCROOT)/lib",
|
"$(SRCROOT)/lib",
|
||||||
);
|
);
|
||||||
PRODUCT_NAME = dees;
|
PRODUCT_NAME = dees;
|
||||||
|
SDKROOT = macosx;
|
||||||
ZERO_LINK = YES;
|
ZERO_LINK = YES;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
|
@ -256,38 +265,66 @@
|
||||||
1DEB923308733DC60010E9CD /* Release */ = {
|
1DEB923308733DC60010E9CD /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ARCHS = (
|
|
||||||
ppc,
|
|
||||||
i386,
|
|
||||||
);
|
|
||||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
|
||||||
GCC_MODEL_TUNING = G5;
|
|
||||||
INSTALL_PATH = "$(HOME)/bin";
|
INSTALL_PATH = "$(HOME)/bin";
|
||||||
LIBRARY_SEARCH_PATHS = (
|
LIBRARY_SEARCH_PATHS = (
|
||||||
"$(LIBRARY_SEARCH_PATHS)",
|
"$(LIBRARY_SEARCH_PATHS)",
|
||||||
"$(SRCROOT)/lib",
|
"$(SRCROOT)/lib",
|
||||||
);
|
);
|
||||||
PRODUCT_NAME = dees;
|
PRODUCT_NAME = dees;
|
||||||
|
SDKROOT = macosx;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
1DEB923608733DC60010E9CD /* Debug */ = {
|
1DEB923608733DC60010E9CD /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
1DEB923708733DC60010E9CD /* Release */ = {
|
1DEB923708733DC60010E9CD /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
|
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
|
7
dees.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
dees.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
BIN
dees.xcodeproj/project.xcworkspace/xcuserdata/esposito.xcuserdatad/UserInterfaceState.xcuserstate
generated
Normal file
BIN
dees.xcodeproj/project.xcworkspace/xcuserdata/esposito.xcuserdatad/UserInterfaceState.xcuserstate
generated
Normal file
Binary file not shown.
|
@ -0,0 +1,91 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "0800"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
|
||||||
|
BuildableName = "dees"
|
||||||
|
BlueprintName = "dees"
|
||||||
|
ReferencedContainer = "container:dees.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
|
||||||
|
BuildableName = "dees"
|
||||||
|
BlueprintName = "dees"
|
||||||
|
ReferencedContainer = "container:dees.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
|
||||||
|
BuildableName = "dees"
|
||||||
|
BlueprintName = "dees"
|
||||||
|
ReferencedContainer = "container:dees.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "8DD76F620486A84900D96B5E"
|
||||||
|
BuildableName = "dees"
|
||||||
|
BlueprintName = "dees"
|
||||||
|
ReferencedContainer = "container:dees.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>SchemeUserState</key>
|
||||||
|
<dict>
|
||||||
|
<key>dees.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
<dict>
|
||||||
|
<key>8DD76F620486A84900D96B5E</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -18,16 +18,18 @@
|
||||||
#ifndef GENERAL_H
|
#ifndef GENERAL_H
|
||||||
#define GENERAL_H
|
#define GENERAL_H
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <map>
|
#include <map>
|
||||||
//#include <vector>
|
#include <vector>
|
||||||
//#include <hash_set>
|
//#include <hash_set>
|
||||||
#include <iostream> // pour cout <<
|
#include <iostream> // pour cout <<
|
||||||
#include <fstream> // pour fic <<
|
#include <fstream> // pour fic <<
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
// ------------- pour le portage --------------
|
// ------------- pour le portage --------------
|
||||||
|
|
||||||
// pour compiler sur le ppc
|
// pour compiler sur le ppc
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef _INTERFACE_H
|
#ifndef INTERFACE_H
|
||||||
#define INTERFACE_H
|
#define INTERFACE_H
|
||||||
#include "main.H"
|
#include "main.H"
|
||||||
void Y();
|
void Y();
|
||||||
|
|
|
@ -70,7 +70,7 @@ void proportion_PRFA()
|
||||||
for (j = 0; j < nb_try; ++j)
|
for (j = 0; j < nb_try; ++j)
|
||||||
{
|
{
|
||||||
A.becomeRandomMax(i,2,0,nb_moy_succ, 1, i);
|
A.becomeRandomMax(i,2,0,nb_moy_succ, 1, i);
|
||||||
taille_auto = A.size ();
|
taille_auto = (int) A.size ();
|
||||||
if (taille_auto == (unsigned int) i)
|
if (taille_auto == (unsigned int) i)
|
||||||
{
|
{
|
||||||
if (A.isPFA ())
|
if (A.isPFA ())
|
||||||
|
@ -338,7 +338,7 @@ void Apprentissage_unique()
|
||||||
string str;
|
string str;
|
||||||
float tmp;
|
float tmp;
|
||||||
float precision;
|
float precision;
|
||||||
T_ModeReturn moderet=begin;
|
T_ModeReturn moderet=::begin;
|
||||||
T_ModeEpsilon modeeps=epsfixed;
|
T_ModeEpsilon modeeps=epsfixed;
|
||||||
|
|
||||||
int max_etats=INT_MAX;
|
int max_etats=INT_MAX;
|
||||||
|
@ -348,7 +348,7 @@ void Apprentissage_unique()
|
||||||
cout << "1 - La precision .................. : "
|
cout << "1 - La precision .................. : "
|
||||||
<< precision << "\n";
|
<< precision << "\n";
|
||||||
cout << "2 - Le mode de retour ............. : "
|
cout << "2 - Le mode de retour ............. : "
|
||||||
<< (moderet==begin?"begin":"end") << "\n";
|
<< (moderet==::begin?"begin":"end") << "\n";
|
||||||
cout << "3 - Le mode de gestion de epsilon . : "
|
cout << "3 - Le mode de gestion de epsilon . : "
|
||||||
<< (modeeps==epsfixed?"epsfixed":
|
<< (modeeps==epsfixed?"epsfixed":
|
||||||
(modeeps==variable?"variable":"word_variable"))
|
(modeeps==variable?"variable":"word_variable"))
|
||||||
|
@ -377,9 +377,9 @@ void Apprentissage_unique()
|
||||||
cout << "mode de retour (begin|end|b|e) : ";
|
cout << "mode de retour (begin|end|b|e) : ";
|
||||||
cin >> str;
|
cin >> str;
|
||||||
if ((str=="end") || (str == "e"))
|
if ((str=="end") || (str == "e"))
|
||||||
moderet=end;
|
moderet=::end;
|
||||||
else
|
else
|
||||||
moderet=begin;
|
moderet=::begin;
|
||||||
}
|
}
|
||||||
else if (reponse == "3")
|
else if (reponse == "3")
|
||||||
{ // mode de gestion de epsilon
|
{ // mode de gestion de epsilon
|
||||||
|
|
4
ma.H
4
ma.H
|
@ -124,9 +124,9 @@ public:
|
||||||
// true if the MA is empty
|
// true if the MA is empty
|
||||||
inline bool empty() const {return Q.empty();}
|
inline bool empty() const {return Q.empty();}
|
||||||
// return the size of the MA
|
// return the size of the MA
|
||||||
inline unsigned int size () const {return Q.size ();}
|
inline unsigned long size () const {return Q.size ();}
|
||||||
// return the number of letter of the MA
|
// return the number of letter of the MA
|
||||||
inline unsigned int nb_lettres () const {return Sigma.size ();}
|
inline unsigned long nb_lettres () const {return Sigma.size ();}
|
||||||
// return safely iota[q] (even if iota[q]=0)
|
// return safely iota[q] (even if iota[q]=0)
|
||||||
inline float val_iota (const State q) const {
|
inline float val_iota (const State q) const {
|
||||||
SFunc::const_iterator i = iota.find (q);
|
SFunc::const_iterator i = iota.find (q);
|
||||||
|
|
4
ma.cpp
4
ma.cpp
|
@ -249,7 +249,7 @@ MA::save_dot (const char *Filename,
|
||||||
}
|
}
|
||||||
|
|
||||||
ofstream fp (Filename);
|
ofstream fp (Filename);
|
||||||
if (fp == NULL)
|
if (!fp)
|
||||||
{
|
{
|
||||||
throw 1;
|
throw 1;
|
||||||
}
|
}
|
||||||
|
@ -795,7 +795,7 @@ RESULT MA::load (const char *Filename)
|
||||||
if (Filename == NULL)
|
if (Filename == NULL)
|
||||||
throw - 1;
|
throw - 1;
|
||||||
ifstream fp (Filename);
|
ifstream fp (Filename);
|
||||||
if (fp == NULL)
|
if (!fp)
|
||||||
throw - 2;
|
throw - 2;
|
||||||
fp.precision (30);
|
fp.precision (30);
|
||||||
string buf;
|
string buf;
|
||||||
|
|
9
main.cpp
9
main.cpp
|
@ -15,7 +15,6 @@
|
||||||
* *
|
* *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
#include "interface.H"
|
#include "interface.H"
|
||||||
#include "test.H"
|
#include "test.H"
|
||||||
#include "main.H"
|
#include "main.H"
|
||||||
|
@ -72,7 +71,7 @@ bool viewmultipletransitions=false; // vrai pour ne plus regrouper les transitio
|
||||||
bool interactive=false; // interactive mode
|
bool interactive=false; // interactive mode
|
||||||
|
|
||||||
// L'apprentissage
|
// L'apprentissage
|
||||||
T_ModeReturn moderet = end; // Le mode de retour des arÍtes (end ou begin)
|
T_ModeReturn moderet = ::end; // Le mode de retour des arÍtes (end ou begin)
|
||||||
T_ModeEpsilon modeeps = variable; // Le mode d'apprentissage avec epsilon fixe ou variable (epsfixed ou variable)
|
T_ModeEpsilon modeeps = variable; // Le mode d'apprentissage avec epsilon fixe ou variable (epsfixed ou variable)
|
||||||
float test_proportion = 0.2; // la proportion de l'echantillon attribuee au test
|
float test_proportion = 0.2; // la proportion de l'echantillon attribuee au test
|
||||||
int nb_tours = 100; // Le nombre d'itÈrations pour Baum Welch
|
int nb_tours = 100; // Le nombre d'itÈrations pour Baum Welch
|
||||||
|
@ -590,7 +589,7 @@ void affiche_PSe(void) {
|
||||||
cout << "res = " << res << endl;
|
cout << "res = " << res << endl;
|
||||||
|
|
||||||
for (q=PSe.begin() ; q != PSe.end() ; q++) {
|
for (q=PSe.begin() ; q != PSe.end() ; q++) {
|
||||||
cout << "P_" << q->first << "(\Se) = " << q-> second << endl;
|
cout << "P_" << q->first << "(\\Se) = " << q-> second << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -713,9 +712,9 @@ initialise_arguments (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
arg = argv[++i];
|
arg = argv[++i];
|
||||||
if (arg == "begin")
|
if (arg == "begin")
|
||||||
moderet = begin;
|
moderet = ::begin;
|
||||||
else
|
else
|
||||||
moderet = end;
|
moderet = ::end;
|
||||||
}
|
}
|
||||||
else if (arg == "--modeeps")
|
else if (arg == "--modeeps")
|
||||||
{
|
{
|
||||||
|
|
2
pfa.cpp
2
pfa.cpp
|
@ -340,7 +340,7 @@ PFA::perplexite (const Sample & S) const
|
||||||
res = sum = 0;
|
res = sum = 0;
|
||||||
for (w = S.begin (); w != S.end (); S.next (w))
|
for (w = S.begin (); w != S.end (); S.next (w))
|
||||||
{
|
{
|
||||||
res += log (r(w->first)) * w->second;
|
res += log (p(w->first)) * w->second;
|
||||||
sum += w->second;
|
sum += w->second;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
pprfa.H
4
pprfa.H
|
@ -26,7 +26,6 @@
|
||||||
#include "pfa.H"
|
#include "pfa.H"
|
||||||
#include "simplex.H"
|
#include "simplex.H"
|
||||||
|
|
||||||
|
|
||||||
typedef enum {determinist, positive, nonconstrained} T_ModeVariables;
|
typedef enum {determinist, positive, nonconstrained} T_ModeVariables;
|
||||||
typedef enum {begin, end} T_ModeReturn;
|
typedef enum {begin, end} T_ModeReturn;
|
||||||
typedef enum {epsfixed, variable, word_variable} T_ModeEpsilon;
|
typedef enum {epsfixed, variable, word_variable} T_ModeEpsilon;
|
||||||
|
@ -130,7 +129,7 @@ public:
|
||||||
const double prec, // The precision parameter
|
const double prec, // The precision parameter
|
||||||
const double epsprime, // The bound under which transition are erased
|
const double epsprime, // The bound under which transition are erased
|
||||||
const bool verbose = false, // verbose mode (show the states during construction)
|
const bool verbose = false, // verbose mode (show the states during construction)
|
||||||
const T_ModeReturn moderet = end, // return mode (end of the tree or begin of the tree)
|
const T_ModeReturn moderet = ::end, // return mode (end of the tree or begin of the tree)
|
||||||
const T_ModeEpsilon modeeps = variable, // epsilon mode (epsfixed or variable)
|
const T_ModeEpsilon modeeps = variable, // epsilon mode (epsfixed or variable)
|
||||||
unsigned int maxstates = INT_MAX, // The maximal states number after which learning is cancelled
|
unsigned int maxstates = INT_MAX, // The maximal states number after which learning is cancelled
|
||||||
unsigned int seuil=10, // La periodicitÈ minimum avant de ne plus considÈrer l'Ètat
|
unsigned int seuil=10, // La periodicitÈ minimum avant de ne plus considÈrer l'Ètat
|
||||||
|
@ -175,5 +174,4 @@ protected:
|
||||||
RESULT compute_XR(void);
|
RESULT compute_XR(void);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -42,10 +42,10 @@ PPRFA::DEES (T_ModeVariables modeVariables,
|
||||||
cout << "\nmoderet = ";
|
cout << "\nmoderet = ";
|
||||||
switch (moderet)
|
switch (moderet)
|
||||||
{
|
{
|
||||||
case begin:
|
case ::begin:
|
||||||
cout << "begin";
|
cout << "begin";
|
||||||
break;
|
break;
|
||||||
case end:
|
case ::end:
|
||||||
cout << "end";
|
cout << "end";
|
||||||
}
|
}
|
||||||
cout << "\nmodeeps = ";
|
cout << "\nmodeeps = ";
|
||||||
|
|
2
sample.H
2
sample.H
|
@ -105,7 +105,7 @@ public:
|
||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
// Renvoie le nombre de mots contenus dans S (pour la fct° precision)
|
// Renvoie le nombre de mots contenus dans S (pour la fct° precision)
|
||||||
inline unsigned int nb_mots() const
|
inline unsigned long nb_mots() const
|
||||||
{
|
{
|
||||||
return S.size();
|
return S.size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -475,7 +475,7 @@ RESULT Sample::load (const char *Filename)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
cerr << "Erreur non repertoriée" << endl;
|
cerr << "Erreur non repertoriee" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return e;
|
return e;
|
||||||
|
|
2
test.cpp
2
test.cpp
|
@ -25,7 +25,7 @@ void test_PSe(void) {
|
||||||
cout << "res = " << res << endl;
|
cout << "res = " << res << endl;
|
||||||
|
|
||||||
for (q=PSe.begin() ; q != PSe.end() ; q++) {
|
for (q=PSe.begin() ; q != PSe.end() ; q++) {
|
||||||
cout << "P_" << q->first << "(\Se) = " << q-> second << endl;
|
cout << "P_" << q->first << "(\\Se) = " << q-> second << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue