- Added some note on SSE/SEE2 optimization.
- Supported SSE/SSE2 optimization with GCC. git-svn-id: file:///home/svnrepos/software/liblbfgs/trunk@3 ecf4c44f-38d1-4fa4-9757-a0b4dd0349fc
This commit is contained in:
		@@ -42,12 +42,18 @@ static int progress(
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define N   8
 | 
			
		||||
#define N   100
 | 
			
		||||
 | 
			
		||||
int main(int argc, char *argv)
 | 
			
		||||
{
 | 
			
		||||
    int i, ret = 0;
 | 
			
		||||
    lbfgsfloatval_t x[N], fx;
 | 
			
		||||
    lbfgsfloatval_t fx;
 | 
			
		||||
    lbfgsfloatval_t *x = lbfgs_malloc(N);
 | 
			
		||||
 | 
			
		||||
    if (x == NULL) {
 | 
			
		||||
        printf("ERROR: Failed to allocate a memory block for variables.\n");
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Initialize the variables. */
 | 
			
		||||
    for (i = 0;i < N;i += 2) {
 | 
			
		||||
@@ -65,5 +71,6 @@ int main(int argc, char *argv)
 | 
			
		||||
    printf("L-BFGS optimization terminated with status code = %d\n", ret);
 | 
			
		||||
    printf("  fx = %f, x[0] = %f, x[1] = %f\n", fx, x[0], x[1]);
 | 
			
		||||
 | 
			
		||||
    lbfgs_free(x);
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										199
									
								
								sample/sample.vcproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										199
									
								
								sample/sample.vcproj
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,199 @@
 | 
			
		||||
<?xml version="1.0" encoding="shift_jis"?>
 | 
			
		||||
<VisualStudioProject
 | 
			
		||||
	ProjectType="Visual C++"
 | 
			
		||||
	Version="8.00"
 | 
			
		||||
	Name="sample"
 | 
			
		||||
	ProjectGUID="{230FE517-BDAB-4CDD-A1C4-EF41974F82CE}"
 | 
			
		||||
	RootNamespace="sample"
 | 
			
		||||
	Keyword="Win32Proj"
 | 
			
		||||
	>
 | 
			
		||||
	<Platforms>
 | 
			
		||||
		<Platform
 | 
			
		||||
			Name="Win32"
 | 
			
		||||
		/>
 | 
			
		||||
	</Platforms>
 | 
			
		||||
	<ToolFiles>
 | 
			
		||||
	</ToolFiles>
 | 
			
		||||
	<Configurations>
 | 
			
		||||
		<Configuration
 | 
			
		||||
			Name="Debug|Win32"
 | 
			
		||||
			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
 | 
			
		||||
			IntermediateDirectory="$(ConfigurationName)"
 | 
			
		||||
			ConfigurationType="1"
 | 
			
		||||
			CharacterSet="1"
 | 
			
		||||
			>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCPreBuildEventTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCCustomBuildTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCXMLDataGeneratorTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCWebServiceProxyGeneratorTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCMIDLTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCCLCompilerTool"
 | 
			
		||||
				Optimization="0"
 | 
			
		||||
				AdditionalIncludeDirectories="$(SolutionDir)include"
 | 
			
		||||
				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
 | 
			
		||||
				MinimalRebuild="true"
 | 
			
		||||
				BasicRuntimeChecks="3"
 | 
			
		||||
				RuntimeLibrary="3"
 | 
			
		||||
				UsePrecompiledHeader="0"
 | 
			
		||||
				WarningLevel="3"
 | 
			
		||||
				Detect64BitPortabilityProblems="true"
 | 
			
		||||
				DebugInformationFormat="4"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCManagedResourceCompilerTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCResourceCompilerTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCPreLinkEventTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCLinkerTool"
 | 
			
		||||
				LinkIncremental="2"
 | 
			
		||||
				GenerateDebugInformation="true"
 | 
			
		||||
				SubSystem="1"
 | 
			
		||||
				TargetMachine="1"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCALinkTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCManifestTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCXDCMakeTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCBscMakeTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCFxCopTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCAppVerifierTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCWebDeploymentTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCPostBuildEventTool"
 | 
			
		||||
			/>
 | 
			
		||||
		</Configuration>
 | 
			
		||||
		<Configuration
 | 
			
		||||
			Name="Release|Win32"
 | 
			
		||||
			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
 | 
			
		||||
			IntermediateDirectory="$(ConfigurationName)"
 | 
			
		||||
			ConfigurationType="1"
 | 
			
		||||
			CharacterSet="1"
 | 
			
		||||
			WholeProgramOptimization="1"
 | 
			
		||||
			>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCPreBuildEventTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCCustomBuildTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCXMLDataGeneratorTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCWebServiceProxyGeneratorTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCMIDLTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCCLCompilerTool"
 | 
			
		||||
				AdditionalIncludeDirectories="$(SolutionDir)include"
 | 
			
		||||
				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
 | 
			
		||||
				RuntimeLibrary="2"
 | 
			
		||||
				UsePrecompiledHeader="0"
 | 
			
		||||
				WarningLevel="3"
 | 
			
		||||
				Detect64BitPortabilityProblems="true"
 | 
			
		||||
				DebugInformationFormat="3"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCManagedResourceCompilerTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCResourceCompilerTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCPreLinkEventTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCLinkerTool"
 | 
			
		||||
				LinkIncremental="1"
 | 
			
		||||
				GenerateDebugInformation="true"
 | 
			
		||||
				SubSystem="1"
 | 
			
		||||
				OptimizeReferences="2"
 | 
			
		||||
				EnableCOMDATFolding="2"
 | 
			
		||||
				TargetMachine="1"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCALinkTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCManifestTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCXDCMakeTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCBscMakeTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCFxCopTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCAppVerifierTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCWebDeploymentTool"
 | 
			
		||||
			/>
 | 
			
		||||
			<Tool
 | 
			
		||||
				Name="VCPostBuildEventTool"
 | 
			
		||||
			/>
 | 
			
		||||
		</Configuration>
 | 
			
		||||
	</Configurations>
 | 
			
		||||
	<References>
 | 
			
		||||
	</References>
 | 
			
		||||
	<Files>
 | 
			
		||||
		<Filter
 | 
			
		||||
			Name="<22>\<5C>[<5B>X <20>t<EFBFBD>@<40>C<EFBFBD><43>"
 | 
			
		||||
			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
 | 
			
		||||
			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 | 
			
		||||
			>
 | 
			
		||||
			<File
 | 
			
		||||
				RelativePath=".\sample.c"
 | 
			
		||||
				>
 | 
			
		||||
			</File>
 | 
			
		||||
		</Filter>
 | 
			
		||||
		<Filter
 | 
			
		||||
			Name="<22>w<EFBFBD>b<EFBFBD>_<EFBFBD>[ <20>t<EFBFBD>@<40>C<EFBFBD><43>"
 | 
			
		||||
			Filter="h;hpp;hxx;hm;inl;inc;xsd"
 | 
			
		||||
			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 | 
			
		||||
			>
 | 
			
		||||
		</Filter>
 | 
			
		||||
		<Filter
 | 
			
		||||
			Name="<22><><EFBFBD>\<5C>[<5B>X <20>t<EFBFBD>@<40>C<EFBFBD><43>"
 | 
			
		||||
			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
 | 
			
		||||
			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
 | 
			
		||||
			>
 | 
			
		||||
		</Filter>
 | 
			
		||||
	</Files>
 | 
			
		||||
	<Globals>
 | 
			
		||||
	</Globals>
 | 
			
		||||
</VisualStudioProject>
 | 
			
		||||
		Reference in New Issue
	
	Block a user