wip to compile it again with XCode on Sierra

This commit is contained in:
Yann Esposito (Yogsototh) 2016-09-24 14:08:58 +02:00
parent 6beae3ed45
commit aba7bc1213
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
19 changed files with 194 additions and 37 deletions

BIN
.DS_Store vendored

Binary file not shown.

1
.gitignore vendored
View File

@ -1 +1,2 @@
.svn
.DS_Store

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -203,10 +203,19 @@
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0800;
};
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "dees" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 08FB7794FE84155DC02AAC07 /* dees */;
projectDirPath = "";
projectRoot = "";
targets = (
8DD76F620486A84900D96B5E /* dees */,
);
@ -241,7 +250,6 @@
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
@ -249,6 +257,7 @@
"$(SRCROOT)/lib",
);
PRODUCT_NAME = dees;
SDKROOT = macosx;
ZERO_LINK = YES;
};
name = Debug;
@ -256,38 +265,66 @@
1DEB923308733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = "$(HOME)/bin";
LIBRARY_SEARCH_PATHS = (
"$(LIBRARY_SEARCH_PATHS)",
"$(SRCROOT)/lib",
);
PRODUCT_NAME = dees;
SDKROOT = macosx;
};
name = Release;
};
1DEB923608733DC60010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
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_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
};
name = Debug;
};
1DEB923708733DC60010E9CD /* Release */ = {
isa = XCBuildConfiguration;
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_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
};
name = Release;
};

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@ -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>

View File

@ -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>

View File

@ -18,16 +18,18 @@
#ifndef GENERAL_H
#define GENERAL_H
using namespace std;
#include <string>
#include <set>
#include <map>
//#include <vector>
#include <vector>
//#include <hash_set>
#include <iostream> // pour cout <<
#include <fstream> // pour fic <<
#include <cmath>
using namespace std;
// ------------- pour le portage --------------
// pour compiler sur le ppc

View File

@ -1,4 +1,4 @@
#ifndef _INTERFACE_H
#ifndef INTERFACE_H
#define INTERFACE_H
#include "main.H"
void Y();

View File

@ -70,7 +70,7 @@ void proportion_PRFA()
for (j = 0; j < nb_try; ++j)
{
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 (A.isPFA ())
@ -338,7 +338,7 @@ void Apprentissage_unique()
string str;
float tmp;
float precision;
T_ModeReturn moderet=begin;
T_ModeReturn moderet=::begin;
T_ModeEpsilon modeeps=epsfixed;
int max_etats=INT_MAX;
@ -348,7 +348,7 @@ void Apprentissage_unique()
cout << "1 - La precision .................. : "
<< precision << "\n";
cout << "2 - Le mode de retour ............. : "
<< (moderet==begin?"begin":"end") << "\n";
<< (moderet==::begin?"begin":"end") << "\n";
cout << "3 - Le mode de gestion de epsilon . : "
<< (modeeps==epsfixed?"epsfixed":
(modeeps==variable?"variable":"word_variable"))
@ -377,9 +377,9 @@ void Apprentissage_unique()
cout << "mode de retour (begin|end|b|e) : ";
cin >> str;
if ((str=="end") || (str == "e"))
moderet=end;
moderet=::end;
else
moderet=begin;
moderet=::begin;
}
else if (reponse == "3")
{ // mode de gestion de epsilon

4
ma.H
View File

@ -124,9 +124,9 @@ public:
// true if the MA is empty
inline bool empty() const {return Q.empty();}
// 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
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)
inline float val_iota (const State q) const {
SFunc::const_iterator i = iota.find (q);

4
ma.cpp
View File

@ -249,7 +249,7 @@ MA::save_dot (const char *Filename,
}
ofstream fp (Filename);
if (fp == NULL)
if (!fp)
{
throw 1;
}
@ -795,7 +795,7 @@ RESULT MA::load (const char *Filename)
if (Filename == NULL)
throw - 1;
ifstream fp (Filename);
if (fp == NULL)
if (!fp)
throw - 2;
fp.precision (30);
string buf;

View File

@ -15,7 +15,6 @@
* *
***************************************************************************/
using namespace std;
#include "interface.H"
#include "test.H"
#include "main.H"
@ -72,7 +71,7 @@ bool viewmultipletransitions=false; // vrai pour ne plus regrouper les transitio
bool interactive=false; // interactive mode
// 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)
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
@ -590,7 +589,7 @@ void affiche_PSe(void) {
cout << "res = " << res << endl;
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];
if (arg == "begin")
moderet = begin;
moderet = ::begin;
else
moderet = end;
moderet = ::end;
}
else if (arg == "--modeeps")
{
@ -1321,4 +1320,4 @@ main (int argc, char *argv[])
affiche_utilisation ();
return -1;
}
}
}

View File

@ -340,7 +340,7 @@ PFA::perplexite (const Sample & S) const
res = sum = 0;
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;
}
}

View File

@ -26,7 +26,6 @@
#include "pfa.H"
#include "simplex.H"
typedef enum {determinist, positive, nonconstrained} T_ModeVariables;
typedef enum {begin, end} T_ModeReturn;
typedef enum {epsfixed, variable, word_variable} T_ModeEpsilon;
@ -130,7 +129,7 @@ public:
const double prec, // The precision parameter
const double epsprime, // The bound under which transition are erased
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)
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
@ -175,5 +174,4 @@ protected:
RESULT compute_XR(void);
};
#endif

View File

@ -42,10 +42,10 @@ PPRFA::DEES (T_ModeVariables modeVariables,
cout << "\nmoderet = ";
switch (moderet)
{
case begin:
case ::begin:
cout << "begin";
break;
case end:
case ::end:
cout << "end";
}
cout << "\nmodeeps = ";
@ -533,4 +533,4 @@ RESULT PPRFA::sol (T_ModeVariables modeVariables, // le mode dans lequel renvoye
return solmax (modeVariables,solution, v, S, simplx,precision, moderet, modeeps, W, INT_MAX);
}
*/
}
}

View File

@ -105,7 +105,7 @@ public:
return S;
}
// 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();
}

View File

@ -475,7 +475,7 @@ RESULT Sample::load (const char *Filename)
break;
default:
cerr << "Erreur non repertoriée" << endl;
cerr << "Erreur non repertoriee" << endl;
}
}
return e;

View File

@ -25,7 +25,7 @@ void test_PSe(void) {
cout << "res = " << res << endl;
for (q=PSe.begin() ; q != PSe.end() ; q++) {
cout << "P_" << q->first << "(\Se) = " << q-> second << endl;
cout << "P_" << q->first << "(\\Se) = " << q-> second << endl;
}
}