2

shogun ツールボックスをコンパイルしようとしていますが、このエラーが発生しています

    C:/shogun-3.0.0/shogun-3.0.0/src/shogun/../shogun/mathematics/Math.h: In static
    member function 'static int shogun::CMath::is_finite(double)':
    C:/shogun-3.0.0/shogun-3.0.0/src/shogun/../shogun/mathematics/Math.h:1255:20: er
    ror: 'ifinite' was not declared in this scope
    return ifinite(f);

関数自体はこのようになります。

        inline static int is_finite(double)
        {      
        #if defined(isfinite) && !defined(SUNOS)
        return ifinite(f);
        #else
        return finite(f);
        #endif
        }

http://www.alecjacobson.com/weblog/?p=1768にも同様の説明があると思いますが、cmath が含まれていないのでわかりません。それが何であるか考えていますか?

4

2 に答える 2

2

機能はisfinite、ではありませんifinite

含めませんが<cmath>、Shogun source here<cmath>によると、との両方<math.h>が間違った順序で含まれています。

#include <shogun/base/SGObject.h>
#include <shogun/lib/common.h>
#include <cmath>                             <<<<<<
#include <shogun/mathematics/Math.h>
#include <shogun/mathematics/lapack.h>
#include <shogun/io/SGIO.h>

#include <stdio.h>
#include <stdlib.h>
#include <math.h>                            <<<<<<

したがって、使用することになっていますstd::isfinite

于 2013-11-21T13:32:17.687 に答える
2

ここから shogun-3.0.0 をダウンロードしましたが、ソースのどこにも「ifinite」という文字列はありません。is_finiteinの定義Math.hは次のとおりです。

        /// checks whether a float is finite
        inline static int is_finite(double f)
        {
#if defined(isfinite) && !defined(SUNOS)
            return isfinite(f);
#else
            return finite(f);
#endif
        }

質問に入力したエラーとソース テキストが正しい場合は、ソースが破損している可能性があります。ソースをダウンロードして、もう一度やり直してください。

于 2013-11-21T15:20:15.640 に答える