GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Mar-2008, 04:55
sheree sheree is offline
Awaiting Email Confirmation
 
Join Date: Mar 2008
Posts: 15
sheree is on a distinguished road
Question

ANN library with BCC55


Hello everyone,
I am working on project that need an optimal nearest neighbour search algorithm and I wanted to use both exact and approximate algorithms in order to compare the best one for my prblem, However ANN provide them by download ANN library that is already written in c++. So does anyone know if Borland support the ANN library or may be know how can I add this library from "his experience "
I thank you in advance for any kind of help.

S H E R E E
  #2  
Old 28-Mar-2008, 12:30
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,310
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: ANN library with BCC55


Quote:
Originally Posted by sheree
...how can I add this library...

[disclaimer]
The following works for me with Borland C++ version 5.5.1 on my Windows XP platrorm. Your mileage may vary.
[/disclaimer]

I use command-line for everything. If you have Borland bcc32 version 5.5.1, here's a way:

Download ann_1.1.1 from http://www.cs.umd.edu/~mount/ANN/


Uncompress it, so you have a directory tree starting at ann_1.1.1 (See Footnote.)


Go into the ann_1.1.1\src directory. Rename the Makefile in that directory to something else, just so you will have it as a reference (Maybe something like Makefile.original)

Past the following into your text editor and save it as Makefile:

Code:
#----------------------------------------------------------------------------- # Makefile for ANN library #---------------------------------------------------------------------- # Copyright (c) 1997-2005 University of Maryland and Sunil Arya and # David Mount. All Rights Reserved. # # This software and related documentation is part of the Approximate # Nearest Neighbor Library (ANN). This software is provided under # the provisions of the Lesser GNU Public License (LGPL). See the # file ../ReadMe.txt for further information. # # The University of Maryland (U.M.) and the authors make no # representations about the suitability or fitness of this software for # any purpose. It is provided "as is" without express or implied # warranty. #---------------------------------------------------------------------- # History: # Revision 0.1 03/04/98 # Initial release # Revision 1.0 04/01/05 # Renamed files from .cc to .cpp for Microsoft Visual C++ # Added kd_dump.cpp # Revision 1.1 05/03/05 # Added kd_fix_rad_search.cpp and bd_fix_rad_search.cpp #---------------------------------------------------------------------- # # Modified for use with Borland bcc32 version 5.5 and Borland make.exe # davekw7x # March, 2008 #----------------------------------------------------------------------------- # Some basic definitions: # BORLANDDIR Installation directory for Borland version 5.5 # CXX Command line for Borland Version 5.5 # INCDIR ANN include directory # LIBDIR ANN library directory # ANNLIB ANN library file name # ANNDEFS Definitions required for borland version 5.5 #----------------------------------------------------------------------------- BORLANDDIR = C:\Borland\bcc55 CXX = $(BORLANDDIR)\bin\bcc32 -I$(BORLANDDIR)\include -L$(BORLANDDIR)\lib INCDIR = ..\include LIBDIR = ..\lib ANNLIB = ANN.lib ANNDEFS = -DANN_NO_RANDOM -DANN_NO_LIMITS_H -DPERF TARGET = $(LIBDIR)\$(ANNLIB) SOURCES = ANN.cpp brute.cpp kd_tree.cpp kd_util.cpp kd_split.cpp \ kd_dump.cpp kd_search.cpp kd_pr_search.cpp kd_fix_rad_search.cpp \ bd_tree.cpp bd_search.cpp bd_pr_search.cpp bd_fix_rad_search.cpp \ perf.cpp OBJECTS = ANN.obj brute.obj kd_tree.obj kd_util.obj kd_split.obj \ kd_dump.obj kd_search.obj kd_pr_search.obj kd_fix_rad_search.obj \ bd_tree.obj bd_search.obj bd_pr_search.obj bd_fix_rad_search.obj \ perf.obj LIBOBJ = +ANN.obj +brute.obj +kd_tree.obj +kd_util.obj \ +kd_split.obj +kd_dump.obj +kd_search.obj +kd_pr_search.obj \ +kd_fix_rad_search.obj +bd_tree.obj +bd_search.obj \ +bd_pr_search.obj +bd_fix_rad_search.obj +perf.obj #----------------------------------------------------------------------------- # The target is the library #----------------------------------------------------------------------------- $(TARGET): $(OBJECTS) @if EXIST $(TARGET) del $(TARGET) tlib $(TARGET) $(LIBOBJ) #----------------------------------------------------------------------------- # Make object files #----------------------------------------------------------------------------- .cpp.obj: $(CXX) -c -I$(INCDIR) $(ANNDEFS) $< #----------------------------------------------------------------------------- # Cleaning #----------------------------------------------------------------------------- clean: @if exist *.obj del *.obj @if exist $(TARGET) del $(TARGET)

Note that if your Borland compiler is not installed at "C:\Borland\bcc55", change the definition of BORLANDDIR in the Makefile.

Assuming that the Borland binary directory is on your PATH, then just execute "make" from the command line. (If it's not on the path, then either put it there, or use the entire path name on the command line. Like "C:\borland\bcc55\bin\make", or whatever...)

There may be lots of warnings about stuff not being expanded inline. Ignore these warnings.

If it runs OK, then there will be a file named ANN.lib in the ann_1.1.1\lib directory.

Now cd into the ann_1.1.1\test directory. Rename the Makefile in that directory to something like Makefile.original.

Paste the following into a text window and save as Makefile:

Code:
#----------------------------------------------------------------------------- # Makefile for the test and evaluation program # # ANN: Approximate Nearest Neighbors # Version: 1.1.1 08/04/06 #----------------------------------------------------------------------------- # Copyright (c) 1997-2005 University of Maryland and Sunil Arya and # David Mount. All Rights Reserved. # # This software and related documentation is part of the Approximate # Nearest Neighbor Library (ANN). This software is provided under # the provisions of the Lesser GNU Public License (LGPL). See the # file ../ReadMe.txt for further information. # # The University of Maryland (U.M.) and the authors make no # representations about the suitability or fitness of this software for # any purpose. It is provided "as is" without express or implied # warranty. #----------------------------------------------------------------------------- # Revision 0.1 03/04/98 # Initial release # Revision 1.1.1 08/04/06 # Added copyright/license #----------------------------------------------------------------------------- # Note: For full performance measurements, it is assumed that the library # and this program have both been compiled with the -DANN_PERF flag. See # the Makefile in the ANN base directory for this flag. #----------------------------------------------------------------------------- # # Modified for use with Borland bcc32 version 5.5 and Borland make.exe # davekw7x # March, 2008 # # Put this Makefile in the ann_1.1.1\test directory # # This leaves the executable in this same directory # # This assumes that the library has been made, using the # Makefile in the ann_1.1.1\src directory (so the # library ANN.lib is in the ..\lib directory) # # #----------------------------------------------------------------------------- # Basic definitions # BORLANDDIR Installation directory for Borland version 5.5 # CXX Command line for Borland version 5.5 # INCDIR ANN include directory # LIBDIR ANN library directory # ANNLIB ANN library file # ANNDEFS ANN defines for Borland version 5.5 #----------------------------------------------------------------------------- BORLANDDIR = C:\Borland\BCC55 CXX = $(BORLANDDIR)\bin\bcc32 -I$(BORLANDDIR)\include -L$(BORLANDDIR)\lib INCDIR = ..\include LIBDIR = ..\lib ANNLIB = ANN.lib ANNDEFS = -DANN_NO_RANDOM -DANN_NO_LIMITS_H -DANN_PERF TARGET = ann_test.exe SOURCES = ann_test.cpp rand.cpp OBJECTS = ann_test.obj rand.obj #----------------------------------------------------------------------------- # Make the program #----------------------------------------------------------------------------- $(TARGET): $(OBJECTS) $(LIBDIR)\$(ANNLIB) $(CXX) $(OBJECTS) $(LIBDIR)\$(ANNLIB) .cpp.obj: $(CXX) -c -I$(INCDIR) $(ANNDEFS) $< #----------------------------------------------------------------------------- # Cleaning #----------------------------------------------------------------------------- clean: @if exist *.obj del *.obj @if exist $(TARGET) del $(TARGET)

Now run make from this directory. If everything has been OK up until now, you should have a file named ann_test.exe in that directory.

Execute the following from the command line:

Code:
ann_test <test1.in >test1.out

It creates a file named test1.out. The contents of test1.out should be something like the following:

Code:
------------------------------------------------------------ ann_test: Version 1.1.1 Copyright: David M. Mount and Sunil Arya. Latest Revision: Aug 4, 2006. ------------------------------------------------------------ validate = on (Warning: this may slow execution time.) stats = query_stats [Read Data Points: data_size = 20 file_name = test1-data.pts dim = 2 ] [Read Query Points: query_size = 10 file_name = test1-query.pts dim = 2 ] [Build ann-structure: split_rule = suggest shrink_rule = none data_size = 20 dim = 2 bucket_size = 1 process_time = 0 sec (Structure Statistics: n_nodes = 39 (opt = 40, best if < 400) n_leaves = 20 (0 contain no points) n_splits = 19 n_shrinks = 0 empty_leaves = 0 percent (best if < 50 percent) depth = 6 (opt = 4, best if < 17) avg_aspect_ratio = 1.48847 (best if < 20) ) ] (Computing true nearest neighbors for validation. This may take time.) [Run Queries: query_size = 10 dim = 2 search_method = standard epsilon = 0 near_neigh = 3 true_nn = 13 query_time = 0 sec/query (biased by perf measurements) (Performance stats: [ mean : stddev ]< min , max > leaf_nodes = [ 0 : 0 ]< 0 , 0 > splitting_nodes = [ 0 : 0 ]< 0 , 0 > shrinking_nodes = [ 0 : 0 ]< 0 , 0 > total_nodes = [ 0 : 0 ]< 0 , 0 > points_visited = [ 0 : 0 ]< 0 , 0 > coord_hits/pt = [ 0 : 0 ]< 0 , 0 > floating_ops_(K) = [ 0 : 0 ]< 0 , 0 > average_error = [ 0 : 0 ]< 0 , 0 > rank_error = [ 0 : 0 ]< 0 , 0 > ) ] [Run Queries: query_size = 10 dim = 2 search_method = priority epsilon = 0 near_neigh = 3 true_nn = 13 query_time = 0 sec/query (biased by perf measurements) (Performance stats: [ mean : stddev ]< min , max > leaf_nodes = [ 0 : 0 ]< 0 , 0 > splitting_nodes = [ 0 : 0 ]< 0 , 0 > shrinking_nodes = [ 0 : 0 ]< 0 , 0 > total_nodes = [ 0 : 0 ]< 0 , 0 > points_visited = [ 0 : 0 ]< 0 , 0 > coord_hits/pt = [ 0 : 0 ]< 0 , 0 > floating_ops_(K) = [ 0 : 0 ]< 0 , 0 > average_error = [ 0 : 0 ]< 0 , 0 > rank_error = [ 0 : 0 ]< 0 , 0 > ) ]

Read the documentation file ANNmanual.pdf.

Create your own project file at one level below ann_1.1.1 and use the Makefile from the test directory as a model to create your own project.

Note that the Makefiles that I used do not have headers as dependencies. If you change any of the headers, then do make clean before doing a new make.

Regards,

Dave

Footnote: I strongly recommend that you make a project file far and away from any Windows installation or Borland installation or any other system directories. For example make a directory named C:\Projects. (Actually, I always have a different disk partition that is different from C:, but that's another story.)

Then download your ann_1.1.1.tar.gz to the \Projects directory. Since I do everything from a command line, I never, ever (really, not ever) make a directory or file name with spaces in it. You can do what you want, but I just thought I would put it out there for your consideration.
  #3  
Old 01-Apr-2008, 01:03
Peter_APIIT Peter_APIIT is offline
Regular Member
 
Join Date: May 2007
Location: Malaysia
Posts: 545
Peter_APIIT can only hope to improve

Re: ANN library with BCC55


What is ann package all about ?

Thanks for your help.
  #4  
Old 01-Apr-2008, 08:28
sheree sheree is offline
Awaiting Email Confirmation
 
Join Date: Mar 2008
Posts: 15
sheree is on a distinguished road

Re: ANN library with BCC55


Hello,
thanks a lot for the help, but actaully I could you explaine:
first,where should I uncompress the file ann_1.1.1 ?
I tried all what you said and I put ann_1.1.1 in another directory, and went to the directory C:\BCC55, because it is my directory and there I typed " make" and every thing is okay but then I haven't got any "ANN.lib in the ann_1.1.1\lib directory" at all and "ann_1.1.1\lib directory , ann_1.1.1\bin directory" are empty as well.
By the way I didn't put the new Makefile in the C:\BCC55\bin and in this directory I have other make, could that cause a confusion .....in typing just make in C:\BCC55\bin directory.

I'll appreciate any more detail.

thanks.
  #5  
Old 01-Apr-2008, 09:50
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,310
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: ANN library with BCC55


Quote:
Originally Posted by sheree
...where should I uncompress the file ann_1.1.1 ?

What I said before:
Quote:
Originally Posted by davekw7x
.
download your ann_1.1.1.tar.gz to the \Projects directory
.
so you have a directory tree starting at ann_1.1.1
.
Go into the ann_1.1.1\src directory.
.
Past the following into your text editor and save it as Makefile
.
if your Borland compiler is not installed at "C:\Borland\bcc55", change the definition of BORLANDDIR in the Makefile
.
Now run make from this directory
.
.

I'm not sure exactly where I went wrong in the instructions, but I will try again...


Some amplification:

I would create a directory named \Projects. I would download the tarball file to the \Projects directory and expand it there. (Since you have already downloaded it, just copy it to the \Projects directory.)

So, after expanding it, you will have everything in \Projects\ann_1.1.1

Then cd into \Projects\ann_1.1.1\src and put the Makefile that I suggested in \Projects\ann_1.1.1\src. Inside the Makefile, change the BORLANDDIR assignment to correspond to your bcc55 installation directory:
Code:
BORLANDDIR = C:\bcc55
Then from a command prompt in \Projects\ann_1.1.1\src, execute
Code:
C:\bcc55\bin\make

Regards,

Dave
  #6  
Old 01-Apr-2008, 10:15
sheree sheree is offline
Awaiting Email Confirmation
 
Join Date: Mar 2008
Posts: 15
sheree is on a distinguished road

Re: ANN library with BCC55


Aha, I see now.
now I think I did the right but during the execute, I have got this error message:
/*********************************************/
>make
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
C:\BCC55\bin\bcc32 -IC:\BCC55\include -LC:\BCC55\lib -c -I..\include -DANN_NO_RANDOM -DANN_NO_LIMITS_H -DPERF brute.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
brute.cpp:
Warning W8017 C:\BCC55\include\ANN/ANN.h 108: Redefinition of 'DBL_MAX' is not identical
Error E2451 C:\BCC55\include\ANN/ANNperf.h 95: Undefined symbol 'ANN_DBL_MAX' in function ANNsampStat::reset()
Error E2451 pr_queue_k.h 46: Undefined symbol 'ANN_DIST_INF'
Warning W8027 pr_queue_k.h 105: Functions containing for are not expanded inline
Warning W8057 brute.cpp 78: Parameter 'eps' is never used in function ANNbruteForce::annkSearch(double *,int,int *,double *,double)
Warning W8057 brute.cpp 109: Parameter 'eps' is never used in function ANNbruteForce::annkFRSearch(double *,double,int,int *,double *,double)
*** 2 errors in Compile ***
/*********************************************/

Do you know, how can I handle such errors

Thanks
  #7  
Old 01-Apr-2008, 10:44
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,310
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: ANN library with BCC55


Quote:
Originally Posted by sheree
Aha, I see now.
now I think I did the right but...

1. You have a directory named C:\bcc55\include\ANN. If you had done what I suggested, it wouldn't be there. If that is left over from your previous attempts, then delete it (and any other stuff under C:\bcc55 that you have added.) I respectfully suggest that you keep everything out of and away from your bcc55 directories. (At least until you have built it successfully.)

2. Clean out (delete) everything except the tarball file in all directories that you have previously created for your ANN efforts. Delete the directories, too.

3. Repeat the steps I suggested in my previous posts: (Create a brand new \Projects directory, etc.)

Here are the first couple of lines that my make created:
Code:
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland C:\Borland\bcc55\bin\bcc32 -IC:\Borland\bcc55\include -LC:\Borland\bcc55\lib -c -I..\include -DANN_NO_RANDOM -DANN_NO_LIMITS_H -DPERF ANN.cpp Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland ann.cpp: C:\Borland\bcc55\bin\bcc32 -IC:\Borland\bcc55\include -LC:\Borland\bcc55\lib -c -I..\include -DANN_NO_RANDOM -DANN_NO_LIMITS_H -DPERF brute.cpp Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland brute.cpp: Warning W8027 pr_queue_k.h 105: Functions containing for are not expanded inline Warning W8057 brute.cpp 78: Parameter 'eps' is never used in function ANNbruteForce::annkSearch(double *,int,int *,double *,double) Warning W8057 brute.cpp 109: Parameter 'eps' is never used in function ANNbruteForce::annkFRSearch(double *,double,int,int *,double *,double)

We are apparently working with the same version of compiler and make programs. I am also assuming that you are using the same version of ann_1.1.1.tar.gz, obtained from the site that I mentioned.

If this is so, then I can't see why yours would be different (other than the exact path to bcc32 and the borland include and library files). See Footnote.

As I mentioned before, the warnings are innocuous, and can be ignored, but there should be no errors.


Regards,

Dave

Footnote:
Here are lines 108-115 of ANN.h:
CPP / C++ / C Code:
#ifdef ANN_NO_LIMITS_H					// limits.h unavailable
  #include <cvalues>					// replacement for limits.h
  const double ANN_DBL_MAX = MAXDOUBLE;	// insert maximum double
#else
  #include <climits>
  #include <cfloat>
  const double ANN_DBL_MAX = DBL_MAX;
#endif

What do these lines of ANN.h look like in your distribution?
  #8  
Old 01-Apr-2008, 14:40
sheree sheree is offline
Awaiting Email Confirmation
 
Join Date: Mar 2008
Posts: 15
sheree is on a distinguished road

Re: ANN library with BCC55


I deleted every thing and I do the following:
1. create new directory C:\project
2. put ann_1.1.1 in C:\project
3. went to C:\project\ann_1.1.1\scr modify Makefile
4. past yours Makefile in it " and I changed the directory to C:\BCC55 as I have"
5. from C:\project\ann_1.1.1\scr directory execute C:\BCC55\bin\make
but I have two errors........:-(
Yes, exactly the main problem in that part of the library you mensioned:
I have got those lines:
#include <cvalues> // replacement for limits.h
const double ANN_DBL_MAX = maxdouble; // insert maximum double#else
#include <climits>
#include <cfloat>
const double ANN_DBL_MAX = DBL_MAX;
#endif
the colored line is 114 of ANN.h
So, Irepeated everything as you recommand.
When I go to the directory C:\projects\ann_1.1.1\src and execute C:\BCC55\bin\make I have two errors:


C:\project\ann_1.1.1>cd src
C:\project\ann_1.1.1\src>C:\BCC55\Bin\make
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
C:\BCC55\bin\bcc32 -IC:\BCC55\include -LC:\BCC55\lib -c -I..\include -DA
NN_NO_RANDOM -DANN_NO_LIMITS_H -DPERF ANN.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
ANN.cpp:
Error E2209 ..\include\ANN/ANN.h 109: Unable to open include file 'cvalues'
Error E2451 ..\include\ANN/ANN.h 110: Undefined symbol 'MAXDOUBLE'
*** 2 errors in Compile ***

** error 1 ** deleting ANN.obj

but if I just execute from the following directory:
C:\project\ann_1.1.1\>
the I have the following result:
C:\project\ann_1.1.1>C:\BCC55\Bin\make
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
"Enter one of the following:"
" make linux-g++ for Linux and g++"
" make macosx-g++ for Mac OS X and g++"
" make sunos5 for Sun with SunOS 5.x"
" make sunos5-sl for Sun with SunOS 5.x, make shared libs"
" make sunos5-g++ for Sun with SunOS 5.x and g++"
" make sunos5-g++-sl for Sun with SunOS 5.x, g++, make shared libs"
" make clean remove .o files"
" make realclean remove .o, library and executable files"
" "
"See file Makefile for other compilation options, such as disabling"
"performance measurement code."


and I tried "make clean" from the directory:

C:\project\ann_1.1.1>make clean

and the output looks like that:

MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
cd src ; make clean

** error -1 ** deleting clean

while from the directory:

C:\project\ann_1.1.1\src>make clean

the output looks like:

MAKE Version 5.2 Copyright (c) 1987, 2000 Borland

And then I tried some other tricks, so I just copied the ANN file that contains the header files into the C.\BCC55\include directory and I tested the "ann_sample.cpp" code that is exist in the C:\project\ann_1.1.1\sample and I compiled it, the result has one error that related to the same line "114" like that

bcc32 -v- -w -O1 ann_sample.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
ann_sample.cpp:

Error E2451 C:\BCC55\INCLUDE\ANN/ANN.h 114: Undefined symbol '_max_dble'
*** 1 errors in Compile ***


what was strange , the green symbol is not exist ......but the error points to the red line 114

W H A T D O Y O U T H I N K ??
  #9  
Old 01-Apr-2008, 16:58
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,310
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: ANN library with BCC55


Quote:
Originally Posted by sheree
I deleted every thing and I do the following:

So, I repeated everything as you recommand.
.
.

So, let's try an experiment.

Make a new directory named \Projects\testcvalues.

Paste the following into your text editor and save it as testcvalues.cpp in that directory.
Compile it from a command line prompt in that directory.

CPP / C++ / C Code:
#include <iostream>
#include <cvalues>

using namespace std;

int main()
{
    cout << "MAXDOUBLE = " << MAXDOUBLE << endl;
    return 0;
}

If it doesn't complain about <iostream>, but gives an error message about not finding <cvalues>, then let's try something else.

Modify the testcvalues.cpp file as follows:

CPP / C++ / C Code:
#include <iostream>
//#include <cvalues>
#include <climits>
#include <cfloat>

using std::cout;
using std::endl;
using std::_max_dble;

int main()
{
    //cout << "MAXDOUBLE   = " << MAXDOUBLE << endl;
    cout << "DBL_MAX     = " << DBL_MAX << endl;
    cout << "FLT_EPSILON = " << FLT_EPSILON << endl;
    cout << "_max_dble   = " << _max_dble << endl;
    return 0;
}

Now, what happens? If you get a successful compile, then execute the program.

Here's what I see:
Code:
DBL_MAX = 1.79769e+308 FLT_EPSILON = 1.19209e-07 _max_dble = 1.79769e+308

If you get it this time, then rejoice! We are almost done. (I hope that those don't become "famous last words.")

Go back to the ANN src directory and edit the Makefile that I supplied.

Change the ANNDEFS line to
Code:
ANNDEFS= -DANN_NO_RANDOM -DPERF


Now, here is the part I was trying to avoid: Because of a quirky little "feature" of this particular Borland <cfloat> file, it won't use _max_dble unless you specifically tell it with something like the using std::_max_dble line in the test program.

Edit the ann_1.1.1\ANN\ANN.h as follows: You need to put using std::_max_dble; just before it defines ANN_DBL_MAX.

So, now lines 108-116 will look like:

CPP / C++ / C Code:
#ifdef ANN_NO_LIMITS_H					// limits.h unavailable
  #include <cvalues>					// replacement for limits.h
  const double ANN_DBL_MAX = MAXDOUBLE;	// insert maximum double
#else
  #include <climits>
  #include <cfloat>
  using std::_max_dble; // Added by davekw7x to get Borland BCC55 <cfloat> to play nice with ANN
  const double ANN_DBL_MAX = DBL_MAX;
#endif

Now execute C:\BCC55\bin\make clean and C:\BCC55\bin\make

Let me know how it goes.

(If this works, then note that you must change the ANNDEFS line in test\Makefile the same way that you did in the src\Makefile.)

Regards,

Dave

Footnote: My bcc55 installation has a file named cvalues.h in its bcc55\include directory and it is possible that yours does not.

If so, then I'm sorry it took so long to get around to it. Not all compilers have this particular file, and, in fact I have seen some distributions with what appears to be the same version number but with minor variations in some of the files.

If ANN works with the changes I made here, don't change your BCC55 installation, just go forward. Don't look back.

"Don't look back.
Something may be gaining on you."
---Satchel Paige
Last edited by davekw7x : 01-Apr-2008 at 17:41.
  #10  
Old 02-Apr-2008, 13:38
sheree sheree is offline
Awaiting Email Confirmation
 
Join Date: Mar 2008
Posts: 15
sheree is on a distinguished road
Cool

Re: ANN library with BCC55


Hyeeeeeeeeeeeeeeeeeeeeeeeee we win,
thanks davekw7x, you are absolutely right, now I have got it
The problem was exactly "cvalues" now everything is working well and I tried the "ann" library with my project as well, it is wonderful
The last experience evaluated the problem precisely
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
News:E-XD++ MFC Library Professional Edition V9.20 is released (100% Source jackonlyone Member Announcements, Advertisements & Offers 0 07-Mar-2006 21:04
Bloodshed Dev C++ Project Options JdS C++ Forum 6 11-Nov-2005 17:23

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:09.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.