Skip to content

Commit

Permalink
Merge pull request #249 from karlnapf/master
Browse files Browse the repository at this point in the history
fix small issues
  • Loading branch information
Soeren Sonnenburg committed Jul 29, 2011
2 parents ccd86e9 + c94f370 commit 91831a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
15 changes: 9 additions & 6 deletions src/shogun/machine/DistanceMachine.cpp
Expand Up @@ -9,6 +9,7 @@
*/

#include <shogun/machine/DistanceMachine.h>
#include <shogun/base/Parameter.h>

using namespace shogun;

Expand All @@ -25,15 +26,22 @@ struct D_THREAD_PARAM
#endif // DOXYGEN_SHOULD_SKIP_THIS

CDistanceMachine::CDistanceMachine()
: CMachine(), distance(NULL)
: CMachine()
{
init();
}

CDistanceMachine::~CDistanceMachine()
{
SG_UNREF(distance);
}

void CDistanceMachine::init()
{
distance=NULL;
m_parameters->add((CSGObject**) distance, "distance", "Distance to use");
}

void CDistanceMachine::distances_lhs(float64_t* result,int32_t idx_a1,int32_t idx_a2,int32_t idx_b)
{
int32_t num_threads=parallel->get_num_threads();
Expand Down Expand Up @@ -189,8 +197,3 @@ void* CDistanceMachine::run_distance_thread_rhs(void* p)

return NULL;
}

void CDistanceMachine::store_model_features()
{

}
18 changes: 9 additions & 9 deletions src/shogun/machine/DistanceMachine.h
Expand Up @@ -95,30 +95,30 @@ class CDistanceMachine : public CMachine
*/
virtual CLabels* apply(CFeatures* data)=0;

/** Does nothing here , if needed, has to be done in subclasses */
virtual void store_model_features() {}

/** Stores feature data of underlying model.
*
*/
virtual void store_model_features();
private:
void init();

protected:
/** the distance */
CDistance* distance;

/**
* pthread function for compute distance values
*
* @param p thread parameter
*/
static void* run_distance_thread_lhs(void* p);

/**
* pthread function for compute distance values
*
* @param p thread parameter
*/
static void* run_distance_thread_rhs(void* p);


protected:
/** the distance */
CDistance* distance;
};
}
#endif

0 comments on commit 91831a1

Please sign in to comment.